diff --git a/asm/macros/battle_ai_script.inc b/asm/macros/battle_ai_script.inc index 4c7646d6f6e4..5341e5a4311c 100644 --- a/asm/macros/battle_ai_script.inc +++ b/asm/macros/battle_ai_script.inc @@ -251,11 +251,11 @@ .4byte \param1 .endm - .macro nullsub_2A + .macro nop_2A .byte 0x2a .endm - .macro nullsub_2B + .macro nop_2B .byte 0x2b .endm @@ -287,11 +287,11 @@ .4byte \param1 .endm - .macro nullsub_32 + .macro nop_32 .byte 0x32 .endm - .macro nullsub_33 + .macro nop_33 .byte 0x33 .endm @@ -467,27 +467,27 @@ .byte \battler .endm - .macro nullsub_52 + .macro nop_52 .byte 0x52 .endm - .macro nullsub_53 + .macro nop_53 .byte 0x53 .endm - .macro nullsub_54 + .macro nop_54 .byte 0x54 .endm - .macro nullsub_55 + .macro nop_55 .byte 0x55 .endm - .macro nullsub_56 + .macro nop_56 .byte 0x56 .endm - .macro nullsub_57 + .macro nop_57 .byte 0x57 .endm diff --git a/asm/macros/battle_frontier/apprentice.inc b/asm/macros/battle_frontier/apprentice.inc index 83871880b636..9eb5f9ea8a64 100644 --- a/asm/macros/battle_frontier/apprentice.inc +++ b/asm/macros/battle_frontier/apprentice.inc @@ -94,11 +94,19 @@ @ Buffer some APPRENTICE_BUFF_* string to the given stringvar (0 for STR_VAR_1, 1 for STR_VAR_2, 2 for STR_VAR_3) .macro apprentice_buff stringvar:req, tobuff:req setvar VAR_0x8004, APPRENTICE_FUNC_BUFFER_STRING - setvar VAR_0x8005, \stringvar + .if \stringvar == STR_VAR_1 + setvar VAR_0x8005, 0 + .elseif \stringvar == STR_VAR_2 + setvar VAR_0x8005, 1 + .elseif \stringvar == STR_VAR_3 + setvar VAR_0x8005, 2 + .else + setvar VAR_0x8005, \stringvar + .endif .if \tobuff >= VARS_START - copyvar VAR_0x8006, \tobuff + copyvar VAR_0x8006, \tobuff .else - setvar VAR_0x8006, \tobuff + setvar VAR_0x8006, \tobuff .endif special CallApprenticeFunction .endm diff --git a/asm/macros/battle_frontier/frontier_util.inc b/asm/macros/battle_frontier/frontier_util.inc index def5b4d1c734..c875fcdde2d8 100644 --- a/asm/macros/battle_frontier/frontier_util.inc +++ b/asm/macros/battle_frontier/frontier_util.inc @@ -136,7 +136,13 @@ @ Buffer the name of gTrainerBattleOpponent_A in STR_VAR_1 (0) or STR_VAR_2 (1) .macro frontier_gettrainername stringVar:req setvar VAR_0x8004, FRONTIER_UTIL_FUNC_BUFFER_TRAINER_NAME - setvar VAR_0x8005, \stringVar + .if \stringVar == STR_VAR_1 + setvar VAR_0x8005, 0 + .elseif \stringVar == STR_VAR_2 + setvar VAR_0x8005, 1 + .else + setvar VAR_0x8005, \stringVar + .endif special CallFrontierUtilFunc .endm diff --git a/asm/macros/event.inc b/asm/macros/event.inc index 27a43972589b..28f010ef2834 100644 --- a/asm/macros/event.inc +++ b/asm/macros/event.inc @@ -44,7 +44,7 @@ .4byte \destination .endm - @ Jumps to the standard function at index function. + @ Jumps to the script in gStdScripts at index function. .macro gotostd function:req .byte 0x08 .byte \function @@ -56,82 +56,82 @@ STD_OBTAIN_DECORATION = 7 STD_REGISTER_MATCH_CALL = 8 - @ Calls the standard function at index function. + @ Calls the script in gStdScripts at index function. .macro callstd function:req .byte 0x09 .byte \function .endm - @ If the result of the last comparison matches condition (see Comparison operators), jumps to the standard function at index function. + @ If the result of the last comparison matches condition (see Comparison operators), jumps to the script in gStdScripts at index function. .macro gotostd_if condition:req, function:req .byte 0x0a .byte \condition .byte \function .endm - @ If the result of the last comparison matches condition (see Comparison operators), calls the standard function at index function. + @ If the result of the last comparison matches condition (see Comparison operators), calls the script in gStdScripts at index function. .macro callstd_if condition:req, function:req .byte 0x0b .byte \condition .byte \function .endm - @ Executes a script stored in a default RAM location. + @ Equivalent to the 'return' command for a RAM script. .macro returnram .byte 0x0c .endm - @ Terminates script execution and "resets the script RAM". - .macro killscript + @ Equivalent to the 'end' command for a RAM script. + .macro endram .byte 0x0d .endm - @ Sets some status related to Mystery Event. + @ Sets the Mystery Event script status (MEVENT_STATUS_*). .macro setmysteryeventstatus value:req .byte 0x0e .byte \value .endm - @ Sets the specified script bank to value. - .macro loadword destination:req, value:req + @ Sets the value at the specified script data index to a fixed 4-byte value. + .macro loadword destIndex:req, value:req .byte 0x0f - .byte \destination + .byte \destIndex .4byte \value .endm - @ Sets the specified script bank to value. - .macro loadbyte destination:req, value:req + @ Sets the value at the specified script data index to a fixed byte value. + .macro loadbyte destIndex:req, value:req .byte 0x10 - .byte \destination + .byte \destIndex .byte \value .endm - @ Sets the byte at offset to value. - .macro writebytetoaddr value:req, offset:req + @ Sets the value at the specified pointer. + .macro setptr value:req, ptr:req .byte 0x11 .byte \value - .4byte \offset + .4byte \ptr .endm - @ Copies the byte value at source into the specified script bank. - .macro loadbytefromaddr destination:req, source:req + @ Sets the value at the specified script data index to the value at pointer 'source'. + .macro loadbytefromptr destIndex:req, source:req .byte 0x12 - .byte \destination + .byte \destIndex .4byte \source .endm - @ Not sure. Judging from XSE's description I think it takes the least-significant byte in bank source and writes it to destination. - .macro setptrbyte source:req, destination:req + @ Sets the value at pointer 'destination' to the contents of the script data at 'srcIndex'. + .macro setptrbyte srcIndex:req, destination:req .byte 0x13 - .byte \source + .byte \srcIndex .4byte \destination .endm - @ Copies the contents of bank source into bank destination. - .macro copylocal destination:req, source:req + @ Copies the contents of the script data from one index to another. + .macro copylocal destIndex:req, srcIndex:req .byte 0x14 - .byte \destination - .byte \source + .byte \destIndex + .byte \srcIndex .endm @ Copies the byte at source to destination, replacing whatever byte was previously there. @@ -176,56 +176,64 @@ .2byte \source .endm - @ Compares the values of script banks a and b, after forcing the values to bytes. - .macro compare_local_to_local byte1:req, byte2:req + @ Compares the values of the script data at indexes 'local1' and 'local2'. + @ The result is stored in comparisonResult to be acted on by goto_if / call_if + .macro compare_local_to_local local1:req, local2:req .byte 0x1b - .byte \byte1 - .byte \byte2 + .byte \local1 + .byte \local2 .endm - @ Compares the least-significant byte of the value of script bank a to a fixed byte value (b). - .macro compare_local_to_value a:req, b:req + @ Compares the value of the script data at index 'local' to a fixed value. + @ The result is stored in comparisonResult to be acted on by goto_if / call_if + .macro compare_local_to_value local:req, value:req .byte 0x1c - .byte \a - .byte \b + .byte \local + .byte \value .endm - @ Compares the least-significant byte of the value of script bank a to the byte located at offset b. - .macro compare_local_to_addr a:req, b:req + @ Compares the value of the script data at index 'local' to the value at 'ptr' + @ The result is stored in comparisonResult to be acted on by goto_if / call_if + .macro compare_local_to_ptr local:req, ptr:req .byte 0x1d - .byte \a - .4byte \b + .byte \local + .4byte \ptr .endm - @ Compares the byte located at offset a to the least-significant byte of the value of script bank b. - .macro compare_addr_to_local a:req, b:req + @ Compares the value at 'ptr' to the value of the script data at index 'local'. + @ The result is stored in comparisonResult to be acted on by goto_if / call_if + .macro compare_ptr_to_local ptr:req, local:req .byte 0x1e - .4byte \a - .byte \b + .4byte \ptr + .byte \local .endm - @ Compares the byte located at offset a to a fixed byte value (b). - .macro compare_addr_to_value a:req, b:req + @ Compares the value at 'ptr' to a fixed value. + @ The result is stored in comparisonResult to be acted on by goto_if / call_if + .macro compare_ptr_to_value ptr:req, value:req .byte 0x1f - .4byte \a - .byte \b + .4byte \ptr + .byte \value .endm - @ Compares the byte located at offset a to the byte located at offset b. - .macro compare_addr_to_addr a:req, b:req + @ Compares the value at 'ptr1' to the value at 'ptr2'. + @ The result is stored in comparisonResult to be acted on by goto_if / call_if + .macro compare_ptr_to_ptr ptr1:req, ptr2:req .byte 0x20 - .4byte \a - .4byte \b + .4byte \ptr1 + .4byte \ptr2 .endm - @ Compares the value of `var` to a fixed word value (b). + @ Compares the value of 'var' to a fixed value. + @ The result is stored in comparisonResult to be acted on by goto_if / call_if .macro compare_var_to_value var:req, value:req .byte 0x21 .2byte \var .2byte \value .endm - @ Compares the value of `var1` to the value of `var2`. + @ Compares the value of 'var1' to the value of 'var2'. + @ The result is stored in comparisonResult to be acted on by goto_if / call_if .macro compare_var_to_var var1:req, var2:req .byte 0x22 .2byte \var1 @@ -233,7 +241,7 @@ .endm @ Generic compare macro which attempts to deduce argument types based on their values - @ Any values between 0x4000 to 0x40FF and 0x8000 to 0x8015 are considered event variable identifiers + @ Any values between VARS_START to VARS_END and SPECIAL_VARS_START to SPECIAL_VARS_END are considered event variable identifiers .macro compare var:req, arg:req .if ((\arg >= VARS_START && \arg <= VARS_END) || (\arg >= SPECIAL_VARS_START && \arg <= SPECIAL_VARS_END)) compare_var_to_var \var, \arg @@ -242,41 +250,34 @@ .endif .endm - @ Calls the native C function stored at `func`. + @ Calls the native C function stored at func. .macro callnative func:req .byte 0x23 .4byte \func .endm - @ Replaces the script with the function stored at `func`. Execution returns to the bytecode script when func returns TRUE. + @ Replaces the script with the function stored at func. Execution returns to the bytecode script when func returns TRUE. .macro gotonative func:req .byte 0x24 .4byte \func .endm - @ Calls a special function; that is, a function designed for use by scripts and listed in a table of pointers. + @ Calls a function listed in the table in data/specials.inc. .macro special function:req .byte 0x25 .2byte SPECIAL_\function .endm - @ Calls a special function. That function's output (if any) will be written to the variable you specify. + @ Calls a function listed in the table in data/specials.inc. + @ That function's output (if any) will be written to the variable specified by 'output'. .macro specialvar output:req, function:req .byte 0x26 .2byte \output .2byte SPECIAL_\function .endm - @ temporary solution - .macro specialvar_ output:req, functionId:req - .byte 0x26 - .2byte \output - .2byte \functionId - .endm - - @ Blocks script execution until a command or ASM code manually unblocks it. Generally used with specific - @ commands and specials. If this command runs, and a subsequent command or piece of ASM does not unblock - @ state, the script will remain blocked indefinitely (essentially a hang). + @ Blocks script execution until a command or C code manually unblocks it. Generally used with specific + @ commands and specials. Calling EnableBothScriptContexts for instance will allow execution to continue. .macro waitstate .byte 0x27 .endm @@ -287,46 +288,46 @@ .2byte \frames .endm - @ Sets a to 1. - .macro setflag a:req + @ Sets flag to TRUE. + .macro setflag flag:req .byte 0x29 - .2byte \a + .2byte \flag .endm - @ Sets a to 0. - .macro clearflag a:req + @ Sets flag to FALSE. + .macro clearflag flag:req .byte 0x2a - .2byte \a + .2byte \flag .endm - @ Compares a to 1. - .macro checkflag a:req + @ Compares flag to TRUE and stores the result in comparisonResult to be used by goto_if, etc + @ See additional _if_unset and _if_set macros + .macro checkflag flag:req .byte 0x2b - .2byte \a + .2byte \flag .endm - @ Initializes the RTC`s local time offset to the given hour and minute. In FireRed, this command is a nop. + @ Initializes the RTC`s local time offset to the given hour and minute. .macro initclock hour:req, minute:req .byte 0x2c .2byte \hour .2byte \minute .endm - @ Runs time based events. In FireRed, this command is a nop. + @ Updates local time using the RTC and runs time based events. .macro dotimebasedevents .byte 0x2d .endm - @ Sets the values of variables 0x8000, 0x8001, and 0x8002 to the current hour, minute, and second. In FRLG, - @ this command sets those variables to zero. + @ Sets the values of variables VAR_0x8000, VAR_0x8001, and VAR_0x8002 to the current hour, minute, and second. .macro gettime .byte 0x2e .endm - @ Plays the specified (sound_number) sound. Only one sound may play at a time, with newer ones interrupting older ones. - .macro playse sound_number:req + @ Plays the specified sound. Only one sound may play at a time, with newer ones interrupting older ones. + .macro playse song:req .byte 0x2f - .2byte \sound_number + .2byte \song .endm @ Blocks script execution until the currently-playing sound (triggered by playse) finishes playing. @@ -335,9 +336,9 @@ .endm @ Plays the fanfare specified by the song number. If the specified song is not a fanfare it will instead play the first song in sFanfares. - .macro playfanfare songNumber:req + .macro playfanfare song:req .byte 0x31 - .2byte \songNumber + .2byte \song .endm @ Blocks script execution until all currently-playing fanfares finish. @@ -345,18 +346,19 @@ .byte 0x32 .endm - @ Plays the specified (song_number) song. If save_song is TRUE, the - @ specified (song_number) will be saved as if savebgm was called with it. - .macro playbgm song_number:req, save_song:req + @ Plays the specified song. If save_song is TRUE, the + @ specified song will be saved as if savebgm was called with it. + .macro playbgm song:req, save_song:req .byte 0x33 - .2byte \song_number + .2byte \song .byte \save_song .endm - @ Saves the specified (song_number) song to be played later. - .macro savebgm song_number:req + @ Saves the specified song to be played later. Saved music may be played when Overworld_PlaySpecialMapMusic is called. This occurs on + @ exiting most warps. + .macro savebgm song:req .byte 0x34 - .2byte \song_number + .2byte \song .endm @ Crossfades the currently-playing song into the map's default song. @@ -364,10 +366,10 @@ .byte 0x35 .endm - @ Crossfades the currently-playng song into the specified (song_number) song. - .macro fadenewbgm song_number:req + @ Crossfades the currently-playing song into the specified song. + .macro fadenewbgm song:req .byte 0x36 - .2byte \song_number + .2byte \song .endm @ Fades out the currently-playing song. @@ -382,91 +384,125 @@ .byte \speed .endm - @ Sends the player to Warp warp on Map bank.map. If the specified warp is 0xFF, - @ then the player will instead be sent to (X, Y) on the map. - .macro warp map:req, warp:req, X:req, Y:req - .byte 0x39 + @ Helper macro for warp commands that formats their arguments. + @ It allows warp macros to either provide 1. a valid id for which warp location to use, + @ or 2. a pair of x/y coordinates to use. Both may be provided but at least one will be + @ ignored by SetPlayerCoordsFromWarp. If none are provided it will use dummy arguments, + @ and the warp will send the player to the center of the map. + @ Examples of valid inputs for a warp command: + @ - warp MAP, x, y + @ - warp MAP, warpId + @ - warp MAP + @ - warp MAP, warpId, x, y + .macro formatwarp map:req, a, b, c map \map - .byte \warp - .2byte \X - .2byte \Y + .ifb \a @ No arguments provided, use dummy warpId and coords. + .byte WARP_ID_NONE + .2byte -1 @ x + .2byte -1 @ y + .else + .ifb \b @ Only one argument provided, treat it as a warpId and use dummy coords. + .byte \a @ warpId + .2byte -1 @ x + .2byte -1 @ y + .else + .ifb \c @ Only two arguments provided, treat them as a coord pair and use dummy warpId. + .byte WARP_ID_NONE + .2byte \a @ x + .2byte \b @ y + .else @ All three arguments provided. Output them and let the warp sort out which to use. + .byte \a @ warpId + .2byte \b @ x + .2byte \c @ y + .endif + .endif + .endif .endm - @ Clone of warp that does not play a sound effect. - .macro warpsilent map:req, warp:req, X:req, Y:req + + @ Warps the player to the specified map. + @ Warp commands can be given either the id of which warp location to go to on the destination map + @ or a pair of x/y coordinates to go to directly on the destination map. + .macro warp map:req, a, b, c + .byte 0x39 + formatwarp \map, \a, \b, \c + .endm + + @ Warps the player to the specified map without playing a sound effect. + @ Warp commands can be given either the id of which warp location to go to on the destination map + @ or a pair of x/y coordinates to go to directly on the destination map. + .macro warpsilent map:req, a, b, c .byte 0x3a - map \map - .byte \warp - .2byte \X - .2byte \Y + formatwarp \map, \a, \b, \c .endm - @ Clone of warp that plays a door opening animation before stepping upwards into it. - .macro warpdoor map:req, warp:req, X:req, Y:req + @ Warps the player to the specified map and plays a door opening animation before stepping upwards into it. + @ Warp commands can be given either the id of which warp location to go to on the destination map + @ or a pair of x/y coordinates to go to directly on the destination map. + .macro warpdoor map:req, a, b, c .byte 0x3b - map \map - .byte \warp - .2byte \X - .2byte \Y + formatwarp \map, \a, \b, \c .endm - @ Warps the player to another map using a hole animation. + @ Warps the player to another map using a hole animation. If the specified map is MAP_UNDEFINED it will instead + @ use the map set by setholewarp. In either case the target coordinates on the destination map will be the + @ player's current position. .macro warphole map:req .byte 0x3c map \map .endm - @ Clone of warp that uses a teleport effect. It is apparently only used in R/S/E. - .macro warpteleport map:req, warp:req, X:req, Y:req + @ Warps the player to the specified map using a teleport effect. Effect is similar to warpspinenter but + @ this warp has a fade out first and doesn't maintain the original facing direction. + @ Warp commands can be given either the id of which warp location to go to on the destination map + @ or a pair of x/y coordinates to go to directly on the destination map. + .macro warpteleport map:req, a, b, c .byte 0x3d - map \map - .byte \warp - .2byte \X - .2byte \Y + formatwarp \map, \a, \b, \c .endm @ Sets the warp destination to be used later. - .macro setwarp map:req, warp:req, X:req, Y:req + @ Warp commands can be given either the id of which warp location to go to on the destination map + @ or a pair of x/y coordinates to go to directly on the destination map. + .macro setwarp map:req, a, b, c .byte 0x3e - map \map - .byte \warp - .2byte \X - .2byte \Y + formatwarp \map, \a, \b, \c .endm - @ Sets the warp destination that a warp to Warp 127 on Map 127.127 will connect to. - @ Useful when a map has warps that need to go to script-controlled locations (i.e. elevators). - .macro setdynamicwarp map:req, warp:req, X:req, Y:req + @ Sets the dynamic warp destination. Warps with a destination map of MAP_NONE will target this destination. + @ Warp commands can be given either the id of which warp location to go to on the destination map + @ or a pair of x/y coordinates to go to directly on the destination map. + .macro setdynamicwarp map:req, a, b, c .byte 0x3f - map \map - .byte \warp - .2byte \X - .2byte \Y + formatwarp \map, \a, \b, \c .endm - @ Sets the destination that diving or emerging from a dive will take the player to. - .macro setdivewarp map:req, warp:req, X:req, Y:req + @ Sets the destination that diving or emerging from a dive will take the player to. Note that this only + @ applies if the current map does not have a dive/emerge connection. If it does have a corresponding + @ map connection then that map and the player's current coordinates will be used as the destination instead. + @ Warp commands can be given either the id of which warp location to go to on the destination map + @ or a pair of x/y coordinates to go to directly on the destination map. + .macro setdivewarp map:req, a, b, c .byte 0x40 - map \map - .byte \warp - .2byte \X - .2byte \Y + formatwarp \map, \a, \b, \c .endm @ Sets the destination that falling into a hole will take the player to. - .macro setholewarp map:req, warp:req, X:req, Y:req + @ While it does accept and set the x/y coordinates and warpId, they are ultimately ignored. + @ This is only used to set the map the player should fall to. The exact location on the + @ map to fall to is determined by warphole. + @ Warp commands can be given either the id of which warp location to go to on the destination map + @ or a pair of x/y coordinates to go to directly on the destination map. + .macro setholewarp map:req, a=0, b=0, c .byte 0x41 - map \map - .byte \warp - .2byte \X - .2byte \Y + formatwarp \map, \a, \b, \c .endm - @ Retrieves the player's zero-indexed X- and Y-coordinates in the map, and stores them in the specified variables. - .macro getplayerxy X:req, Y:req + @ Retrieves the player's zero-indexed x- and y-coordinates in the map, and stores them in the specified variables. + .macro getplayerxy x:req, y:req .byte 0x42 - .2byte \X - .2byte \Y + .2byte \x + .2byte \y .endm @ Retrieves the number of Pokemon in the player's party, and stores that number in VAR_RESULT. @@ -474,176 +510,178 @@ .byte 0x43 .endm - @ Attempts to add quantity of item index to the player's Bag. If the player has enough room, the item will be added and - @ VAR_RESULT will be set to TRUE; otherwise, VAR_RESULT is set to FALSE. - .macro additem index:req, quantity=1 + @ Attempts to add quantity of the specified item to the player's Bag. If the player has enough room, the item will + @ be added and VAR_RESULT will be set to TRUE; otherwise, VAR_RESULT is set to FALSE. + .macro additem itemId:req, quantity=1 .byte 0x44 - .2byte \index + .2byte \itemId .2byte \quantity .endm - @ Removes quantity of item index from the player's Bag. - .macro removeitem index:req, quantity=1 + @ Removes quantity of the specified item from the player's Bag. If the player has fewer than 'quantity' in their bag + @ then none will be removed and VAR_RESULT will be set to FALSE. Otherwise it will be set to TRUE. + .macro removeitem itemId:req, quantity=1 .byte 0x45 - .2byte \index + .2byte \itemId .2byte \quantity .endm - @ Checks if the player has enough space in their Bag to hold quantity more of item index. Sets VAR_RESULT to + @ Checks if the player has enough space in their Bag to hold quantity more of the specified item. Sets VAR_RESULT to @ TRUE if there is room, or FALSE is there is no room. - .macro checkitemspace index:req, quantity:req + .macro checkitemspace itemId:req, quantity=1 .byte 0x46 - .2byte \index + .2byte \itemId .2byte \quantity .endm - @ Checks if the player has quantity or more of item index in their Bag. Sets VAR_RESULT to TRUE if the player has + @ Checks if the player has quantity or more of the specified item in their Bag. Sets VAR_RESULT to TRUE if the player has @ enough of the item, or FALSE if they have fewer than quantity of the item. - .macro checkitem index:req, quantity:req + .macro checkitem itemId:req, quantity=1 .byte 0x47 - .2byte \index + .2byte \itemId .2byte \quantity .endm @ Checks which Bag pocket the specified item belongs in, and writes the pocket value (POCKET_*) to VAR_RESULT. - @ This script is used to show the name of the proper Bag pocket when the player receives an item via callstd (simplified to giveitem in XSE). - .macro checkitemtype index:req + @ This is used to show the name of the proper Bag pocket when the player receives an item via callstd. + .macro checkitemtype itemId:req .byte 0x48 - .2byte \index + .2byte \itemId .endm - @ Adds a quantity amount of item index to the player's PC. Both arguments can be variables. - .macro addpcitem index:req, quantity:req + @ Adds quantity of the specified item to the player's PC. + .macro addpcitem itemId:req, quantity=1 .byte 0x49 - .2byte \index + .2byte \itemId .2byte \quantity .endm - @ Checks for quantity amount of item index in the player's PC. Both arguments can be variables. - .macro checkpcitem index:req, quantity:req + @ Checks for quantity of the specified item in the player's PC. + .macro checkpcitem itemId:req, quantity=1 .byte 0x4a - .2byte \index + .2byte \itemId .2byte \quantity .endm - @ Adds decoration to the player's PC. In FireRed, this command is a nop. (The argument is read, but not used for anything.) + @ Adds a decoration to the player's PC. .macro adddecoration decoration:req .byte 0x4b .2byte \decoration .endm - @ Removes a decoration from the player's PC. In FireRed, this command is a nop. (The argument is read, but not used for anything.) + @ Removes a decoration from the player's PC. .macro removedecoration decoration:req .byte 0x4c .2byte \decoration .endm - @ Checks for decoration in the player's PC. In FireRed, this command is a nop. (The argument is read, but not used for anything.) + @ Checks for decoration in the player's PC. .macro checkdecor decoration:req .byte 0x4d .2byte \decoration .endm - @ Checks if the player has enough space in their PC to hold decoration. Sets VAR_RESULT to TRUE if there is room, or - @ FALSE is there is no room. In FireRed, this command is a nop. (The argument is read, but not used for anything.) + @ Checks if the player has enough space in their PC to hold the decoration. + @ Sets VAR_RESULT to TRUE if there is room, or FALSE is there is no room. .macro checkdecorspace decoration:req .byte 0x4e .2byte \decoration .endm - @ Applies the movement data at movements to the specified (index) Object. Also closes any standard message boxes that are still open. - @ If no map is specified, then the current map is used. - .macro applymovement index:req, movements:req, map + @ Applies the movement data at movements to the specified (localId) object. If no map is specified, then the current map is used. + .macro applymovement localId:req, movements:req, map .ifb \map .byte 0x4f - .2byte \index + .2byte \localId .4byte \movements .else @ Really only useful if the object has followed from one map to another (e.g. Wally during the catching event). .byte 0x50 - .2byte \index + .2byte \localId .4byte \movements map \map .endif .endm - @ Blocks script execution until the movements being applied to the specified (index) Object finish. - @ If the specified Object is 0x0000, then the command will block script execution until all Objects - @ affected by applymovement finish their movements. If the specified Object is not currently being + @ Blocks script execution until the movements being applied to the specified (localId) object finish. + @ If the specified object is 0, then the command will block script execution until all objects + @ affected by applymovement finish their movements. If the specified object is not currently being @ manipulated with applymovement, then this command does nothing. @ If no map is specified, then the current map is used. - .macro waitmovement index:req, map + .macro waitmovement localId:req, map .ifb \map .byte 0x51 - .2byte \index + .2byte \localId .else .byte 0x52 - .2byte \index + .2byte \localId map \map .endif .endm - @ Attempts to hide the specified (index) Object on the specified (map_group, map_num) map, - @ by setting its visibility flag if it has a valid one. If the Object does not have a valid - @ visibility flag, this command does nothing. + @ Attempts to despawn the specified (localId) object on the specified map. + @ It also sets the object's visibility flag if it has one. @ If no map is specified, then the current map is used. - .macro removeobject index:req, map + .macro removeobject localId:req, map .ifb \map .byte 0x53 - .2byte \index + .2byte \localId .else .byte 0x54 - .2byte \index + .2byte \localId map \map .endif .endm - @ Unsets the specified (index) Object's visibility flag on the specified (map_group, map_num) map if it has a valid one. - @ If the Object does not have a valid visibility flag, this command does nothing. + @ Attempts to spawn the specified (localId) object the specified map. + @ Note that unlike removeobject this does not modify the object's flag. @ If no map is specified, then the current map is used. - .macro addobject index:req, map + .macro addobject localId:req, map .ifb \map .byte 0x55 - .2byte \index + .2byte \localId .else .byte 0x56 - .2byte \index + .2byte \localId map \map .endif .endm - @ Sets the specified (index) Object's position on the current map. - .macro setobjectxy index:req, x:req, y:req + @ Sets the specified (localId) object's position on the current map. + .macro setobjectxy localId:req, x:req, y:req .byte 0x57 - .2byte \index + .2byte \localId .2byte \x .2byte \y .endm - .macro showobjectat index:req, map:req + @ Sets the specified object's invisibility to FALSE. + .macro showobjectat localId:req, map:req .byte 0x58 - .2byte \index + .2byte \localId map \map .endm - .macro hideobjectat index:req, map:req + @ Sets the specified object's invisibility to TRUE. + .macro hideobjectat localId:req, map:req .byte 0x59 - .2byte \index + .2byte \localId map \map .endm - @ If the script was called by an Object, then that Object will turn to face toward the metatile that the player is standing on. + @ Turns the currently selected object (if there is one) to face the player. .macro faceplayer .byte 0x5a .endm - .macro turnobject index:req, direction:req + @ Turns the specified object in the specified direction. + .macro turnobject localId:req, direction:req .byte 0x5b - .2byte \index + .2byte \localId .byte \direction .endm - @ If the Trainer flag for Trainer index is not set, this command does absolutely nothing. + @ Configures the arguments for a trainer battle, then jumps to the appropriate script in scripts/trainer_battle.inc .macro trainerbattle type:req, trainer:req, local_id:req, pointer1:req, pointer2, pointer3, pointer4 .byte 0x5c .byte \type @@ -700,8 +738,8 @@ NO_MUSIC = FALSE - @ Starts a single trainer battle, takes a trainer, intro text, loss text, and an optional event script - @ when used with an event script, you can also pass in an optional flag to disable music + @ Starts a single trainer battle. Takes a trainer, intro text, loss text, and an optional event script. + @ When used with an event script, you can also pass in an optional flag to disable music .macro trainerbattle_single trainer:req, intro_text:req, lose_text:req, event_script=FALSE, music=TRUE .if \event_script == FALSE trainerbattle TRAINER_BATTLE_SINGLE, \trainer, 0, \intro_text, \lose_text @@ -712,8 +750,8 @@ .endif .endm - @ Starts a double trainer battle, takes a trainer, intro text, loss text, text for when you have too few pokemon - @ and an optional event script, when used with an event script you can pass in an optional flag to disable music + @ Starts a double trainer battle. Takes a trainer, intro text, loss text, text for when you have too few pokemon + @ and an optional event script. When used with an event script you can pass in an optional flag to disable music .macro trainerbattle_double trainer:req, intro_text:req, lose_text:req, not_enough_pkmn_text:req, event_script=FALSE, music=TRUE .if \event_script == FALSE trainerbattle TRAINER_BATTLE_DOUBLE, \trainer, 0, \intro_text, \lose_text, \not_enough_pkmn_text @@ -724,25 +762,25 @@ .endif .endm - @ Starts a rematch battle, takes a trainer, intro text and loss text + @ Starts a rematch battle. Takes a trainer, intro text and loss text .macro trainerbattle_rematch trainer:req, intro_text:req, lose_text:req trainerbattle TRAINER_BATTLE_REMATCH, \trainer, 0, \intro_text, \lose_text .endm - @ Starts a rematch double battle, takes a trainer, intro text, loss text, and text for when you have too few pokemon + @ Starts a rematch double battle. Takes a trainer, intro text, loss text, and text for when you have too few pokemon .macro trainerbattle_rematch_double trainer:req, intro_text:req, lose_text:req, not_enough_pkmn_text:req trainerbattle TRAINER_BATTLE_REMATCH_DOUBLE, \trainer, 0, \intro_text, \lose_text, \not_enough_pkmn_text .endm - @ Starts a trainer battle, skipping intro text, takes a trainer and loss text + @ Starts a trainer battle, skipping intro text. Takes a trainer and loss text .macro trainerbattle_no_intro trainer:req, lose_text:req trainerbattle TRAINER_BATTLE_SINGLE_NO_INTRO_TEXT, \trainer, 0, \lose_text .endm - @ Starts a trainer battle using the battle information stored in RAM (usually by trainerbattle, which actually calls this - @ command behind-the-scenes), and blocks script execution until the battle finishes. - .macro trainerbattlebegin + @ Starts a trainer battle using the battle information stored in RAM (usually by the scripts in trainer_battle.inc, which + @ are run by trainerbattle), and blocks script execution until the battle finishes. + .macro dotrainerbattle .byte 0x5d .endm @@ -756,38 +794,41 @@ .byte 0x5f .endm - @ Compares Flag (trainer + 0x500) to 1. (If the flag is set, then the trainer has been defeated by the player.) + @ Checks if the trainer has been defeated by the player (by comparing the flag 'trainer + TRAINER_FLAGS_START' to TRUE). .macro checktrainerflag trainer:req .byte 0x60 .2byte \trainer .endm - @ Sets Flag (trainer + 0x500). + @ Sets the trainer flag (trainer + TRAINER_FLAGS_START) to TRUE (defeated). .macro settrainerflag trainer:req .byte 0x61 .2byte \trainer .endm - @ Clears Flag (trainer + 0x500). + @ Sets the trainer flag (trainer + TRAINER_FLAGS_START) to FALSE (not defeated). .macro cleartrainerflag trainer:req .byte 0x62 .2byte \trainer .endm - .macro setobjectxyperm index:req, x:req, y:req + @ Sets the coordinates of an object's template, so that if the sprite goes off screen + @ it'll still be there when it comes back on screen. + .macro setobjectxyperm localId:req, x:req, y:req .byte 0x63 - .2byte \index + .2byte \localId .2byte \x .2byte \y .endm - @ Copies a live object event's xy position to its template, so that if the sprite goes off screen, + @ Copies a live object event's xy position to its template, so that if the sprite goes off screen @ it'll still be there when it comes back on screen. - .macro copyobjectxytoperm index:req + .macro copyobjectxytoperm localId:req .byte 0x64 - .2byte \index + .2byte \localId .endm + @ Sets the movement type (MOVEMENT_TYPE_*) for an object's template. .macro setobjectmovementtype word:req, byte:req .byte 0x65 .2byte \word @@ -801,8 +842,8 @@ .endm @ Starts displaying a standard message box containing the specified text. If text is a pointer, then the string at - @ that offset will be loaded and used. If text is script bank 0, then the value of script bank 0 will be treated as - @ a pointer to the text. (You can use loadpointer to place a string pointer in a script bank.) + @ that offset will be loaded and used. If text is NULL, then the value of script data 0 will be treated as + @ a pointer to the text. The 'loadword 0' in msgbox sets this value, for instance. .macro message text:req .byte 0x67 .4byte \text @@ -823,17 +864,17 @@ .byte 0x6a .endm - @ Resumes normal movement for all Objects on-screen, and closes any standard message boxes that are still open. + @ Resumes normal movement for all objects on-screen, and closes any standard message boxes that are still open. .macro releaseall .byte 0x6b .endm - @ If the script was called by an Object, then that Object's movement will resume. This command also closes any standard message boxes that are still open. + @ Resumes normal movement for the selected object (if there is one) and the player. Also closes any standard message boxes that are still open. .macro release .byte 0x6c .endm - @ Blocks script execution until the player presses any key. + @ Blocks script execution until the player presses the A or B button. .macro waitbuttonpress .byte 0x6d .endm @@ -859,7 +900,7 @@ @ Displays a multichoice box from which the user can choose a selection, and blocks script execution until a selection is made. @ Lists of options are predefined (sMultichoiceLists) and the one to be used is specified with multichoiceId. - @ The default argument determines the initial position of the cursor when the box is first opened; it is zero-indexed, and if it is too large, it is treated as 0x00. + @ The default argument determines the initial position of the cursor when the box is first opened; it is zero-indexed, and if it is too large, it is treated as 0. @ If ignoreBPress is set to a non-zero value, then the user will not be allowed to back out of the multichoice with the B button. .macro multichoicedefault x:req, y:req, multichoiceId:req, default:req, ignoreBPress:req .byte 0x70 @@ -906,7 +947,7 @@ .byte \ignoreBPress .endm - @ Displays a box containing the front sprite for the specified (species) Pokemon species. + @ Displays a box containing the front sprite for the specified Pokemon species. .macro showmonpic species:req, x:req, y:req .byte 0x75 .2byte \species @@ -914,7 +955,7 @@ .byte \y .endm - @ Hides all boxes displayed with showmonpic. + @ Hides the box displayed by showmonpic. .macro hidemonpic .byte 0x76 .endm @@ -925,9 +966,9 @@ .byte \winnerId .endm - @ Displays the string at pointer as braille text in a standard message box. The string must be formatted to use braille - @ characters and needs to provide six extra starting characters that are skipped (in RS, these characters determined the - @ box's size and position, but in Emerald these are calculated automatically). + @ Displays the given string as braille text in a standard message box. The string should use the .braille directive + @ to convert text to braille, and be preceded by brailleformat. The brailleformat data is skipped over (in RS, these + @ bytes determined the box's size and position, but in Emerald these are calculated automatically). .macro braillemessage text:req .byte 0x78 .4byte \text @@ -944,209 +985,237 @@ .byte \textTop .endm - @ Gives the player one of the specified (species) Pokemon at level level holding item. The trailing 0s are unused parameters + @ Gives the player a Pokémon of the specified species and level, holding the specified item. The trailing 0s are unused parameters. + @ VAR_RESULT will be set to MON_GIVEN_TO_PARTY, MON_GIVEN_TO_PC, or MON_CANT_GIVE depending on the outcome. .macro givemon species:req, level:req, item:req .byte 0x79 .2byte \species .byte \level .2byte \item - .4byte 0x0 - .4byte 0x0 + .4byte 0 + .4byte 0 .byte 0 .endm + @ Gives the player an Egg of the specified species. + @ VAR_RESULT will be set to MON_GIVEN_TO_PARTY, MON_GIVEN_TO_PC, or MON_CANT_GIVE depending on the outcome. .macro giveegg species:req .byte 0x7a .2byte \species .endm - .macro setmonmove index:req, slot:req, move:req + @ Replaces the move at 'slot' of the Pokémon in the player's party at 'partyIndex' with the specified move. + @ If a value greater than PARTY_SIZE is given for partyIndex it will use the last Pokémon in the party instead. + @ Note that this means in vanilla a value equal to PARTY_SIZE for partyIndex will go out of bounds. + .macro setmonmove partyIndex:req, slot:req, move:req .byte 0x7b - .byte \index + .byte \partyIndex .byte \slot .2byte \move .endm - @ Checks if at least one Pokemon in the player's party knows the specified (index) attack. If so, VAR_RESULT is set to the + @ Checks if at least one Pokemon in the player's party knows the specified move. If so, VAR_RESULT is set to the @ (zero-indexed) slot number of the first Pokemon that knows the move. If not, VAR_RESULT is set to PARTY_SIZE. @ VAR_0x8004 is also set to this Pokemon's species. - .macro checkpartymove index:req + .macro checkpartymove move:req .byte 0x7c - .2byte \index + .2byte \move .endm - @ Writes the name of the Pokemon at index species to the specified buffer. - .macro bufferspeciesname out:req, species:req + @ Converts STR_VAR_1, STR_VAR_2, or STR_VAR_3 to its corresponding index into sScriptStringVars (0, 1, or 2). + @ If given anything else it will output it directly. + @ Note: Because the STR_VAR_# arguments given to this macro are not part of a processed string they are not + @ replaced with their charmap values, they are just passed as the literal characters "STR_VAR_#". + .macro stringvar id:req + .if \id == STR_VAR_1 + .byte 0 + .elseif \id == STR_VAR_2 + .byte 1 + .elseif \id == STR_VAR_3 + .byte 2 + .else + .byte \id + .endif + .endm + + @ Writes the name of the given Pokemon species to the specified buffer. + .macro bufferspeciesname stringVarId:req, species:req .byte 0x7d - .byte \out + stringvar \stringVarId .2byte \species .endm @ Writes the name of the species of the first Pokemon in the player's party to the specified buffer. - .macro bufferleadmonspeciesname out:req + .macro bufferleadmonspeciesname stringVarId:req .byte 0x7e - .byte \out + stringvar \stringVarId .endm - @ Writes the nickname of the Pokemon in slot slot (zero-indexed) of the player's party to the specified buffer. + @ Writes the nickname of the Pokemon in 'slot' (zero-indexed) of the player's party to the specified buffer. @ If an empty or invalid slot is specified, ten spaces ("") are written to the buffer. - .macro bufferpartymonnick out:req, slot:req + .macro bufferpartymonnick stringVarId:req, slot:req .byte 0x7f - .byte \out + stringvar \stringVarId .2byte \slot .endm - @ Writes the name of the item at index item to the specified buffer. If the specified index is larger than - @ the number of items in the game (0x176), the name of item 0 ("????????") is buffered instead. - .macro bufferitemname out:req, item:req + @ Writes the name of the specified item to the specified buffer. If itemId is >= ITEMS_COUNT, + @ then the name of ITEM_NONE ("????????") is buffered instead. + .macro bufferitemname stringVarId:req, item:req .byte 0x80 - .byte \out + stringvar \stringVarId .2byte \item .endm - @ Writes the name of the decoration at index decoration to the specified buffer. In FireRed, this command is a nop. - .macro bufferdecorationname out:req, decoration:req + @ Writes the name of the specified decoration to the specified buffer. + .macro bufferdecorationname stringVarId:req, decoration:req .byte 0x81 - .byte \out + stringvar \stringVarId .2byte \decoration .endm - @ Writes the name of the move at index move to the specified buffer. - .macro buffermovename out:req, move:req + @ Writes the name of the specified move to the specified buffer. + .macro buffermovename stringVarId:req, move:req .byte 0x82 - .byte \out + stringvar \stringVarId .2byte \move .endm @ Converts the value of input to a decimal string, and writes that string to the specified buffer. - .macro buffernumberstring out:req, input:req + .macro buffernumberstring stringVarId:req, input:req .byte 0x83 - .byte \out + stringvar \stringVarId .2byte \input .endm - @ Writes the standard string identified by index to the specified buffer. This command has no protections in place at all, - @ so specifying an invalid standard string (e.x. 0x2B) can and usually will cause crashes or garbage characters. - .macro bufferstdstring out:req, index:req + @ Writes the given standard string (STDSTRING_*) to the specified buffer. Invalid std string ids are not handled. + .macro bufferstdstring stringVarId:req, index:req .byte 0x84 - .byte \out + stringvar \stringVarId .2byte \index .endm - @ Copies the string at offset to the specified buffer. - .macro bufferstring out:req, offset:req + @ Copies the string at the given pointer to the specified buffer. + .macro bufferstring stringVarId:req, text:req .byte 0x85 - .byte \out - .4byte \offset + stringvar \stringVarId + .4byte \text .endm @ Opens the Pokemart system, offering the specified products for sale. + @ Products should be a list of .2byte item values preceded by an .align 2 .macro pokemart products:req .byte 0x86 .4byte \products .endm @ Opens the Pokemart system and treats the list of items as decorations. + @ Products should be a list of .2byte decoration values preceded by an .align 2 .macro pokemartdecoration products:req .byte 0x87 .4byte \products .endm - @ Apparent clone of pokemartdecoration. + @ Identical to pokemartdecoration, but with slight changes to the clerk dialogue. See uses of MART_TYPE_DECOR2. .macro pokemartdecoration2 products:req .byte 0x88 .4byte \products .endm - @ Starts up the slot machine minigame. - .macro playslotmachine word:req + @ Starts up the slot machine minigame. id is a SLOT_MACHINE_* value that influences probabilities of certain reel outcomes. + .macro playslotmachine id:req .byte 0x89 - .2byte \word + .2byte \id .endm - @ Sets a berry tree's specific berry and growth stage. In FireRed, this command is a nop. - .macro setberrytree tree_id:req, berry:req, growth_stage:req + @ Sets a berry tree's berry and growth stage. treeId is any BERRY_TREE_* constant (an index into berryTrees in SaveBlock1), + @ berry is any ITEM_TO_BERRY(ITEM_BERRY_NAME) value, and growthStage is any BERRY_STAGE_* constant. + .macro setberrytree treeId:req, berry:req, growthStage:req .byte 0x8a - .byte \tree_id + .byte \treeId .byte \berry - .byte \growth_stage + .byte \growthStage .endm - @ This allows you to choose a Pokemon to use in a contest. In FireRed, this command sets the byte at 0x03000EA8 to 0x01. + @ Opens the party menu to select a Pokemon for a contest. .macro choosecontestmon .byte 0x8b .endm - @ Starts a contest. In FireRed, this command is a nop. + @ Starts the appeals round of a contest. .macro startcontest .byte 0x8c .endm - @ Shows the results of a contest. In FireRed, this command is a nop. + @ Shows the results screen of a contest. .macro showcontestresults .byte 0x8d .endm - @ Starts a contest over a link connection. In FireRed, this command is a nop. + @ Starts communication to initialize a link contest. .macro contestlinktransfer .byte 0x8e .endm - @ Stores a random integer between 0 and limit in VAR_RESULT. + @ Stores a random integer between 0 and limit (exclusive of limit) in VAR_RESULT. .macro random limit:req .byte 0x8f .2byte \limit .endm - @ If check is 0x00, this command adds value to the player's money. - .macro addmoney value:req, check:req + @ Adds value to the player's money. If adding 'value' money would exceed MAX_MONEY, the player's money is set to MAX_MONEY. + @ If 'disable' is set to anything but 0 then this command does nothing. + .macro addmoney value:req, disable=0 .byte 0x90 .4byte \value - .byte \check + .byte \disable .endm - @ If check is 0x00, this command subtracts value from the player's money. - .macro removemoney value:req, check:req + @ Subtracts value from the player's money. If the player has less than 'value' money, their money is set to 0. + @ If 'disable' is set to anything but 0 then this command does nothing. + .macro removemoney value:req, disable=0 .byte 0x91 .4byte \value - .byte \check + .byte \disable .endm - @ If check is 0x00, this command will check if the player has money >= value; VAR_RESULT is set to TRUE if the player - @ has enough money, or FALSE if they do not. - .macro checkmoney value:req, check:req + @ Checks if the player has money >= value. VAR_RESULT is set to TRUE if the player has enough money, or FALSE if they do not. + @ If 'disable' is set to anything but 0 then this command does nothing. + .macro checkmoney value:req, disable=0 .byte 0x92 .4byte \value - .byte \check + .byte \disable .endm - @ Spawns a secondary box showing how much money the player has. - .macro showmoneybox x:req, y:req, check:req + @ Creates a window showing how much money the player has. + @ If 'disable' is set to anything but 0 then this command does nothing. + .macro showmoneybox x:req, y:req, disable=0 .byte 0x93 .byte \x .byte \y - .byte \check + .byte \disable .endm - @ Hides the secondary box spawned by showmoney. Consumption of the x and y arguments was dummied out. + @ Destroys the window created by showmoneybox. Consumption of the x and y arguments was dummied out. .macro hidemoneybox .byte 0x94 .byte 0 @ \x .byte 0 @ \y .endm - @ Updates the secondary box spawned by showmoney. Consumes but does not use arguments. - .macro updatemoneybox x:req, y:req + @ Updates the window created by showmoneybox. Consumption of the x and y arguments was dummied out. + @ If 'disable' is set to anything but 0 then this command does nothing. + .macro updatemoneybox disable=0 .byte 0x95 - .byte \x - .byte \y - .byte 0 @ 1 = don't perform this command. Always 0 in vanilla. Why this is a thing is beyond me. + .byte 0 @ \x + .byte 0 @ \y + .byte \disable .endm - @ Gets the price reduction for the index given. In FireRed, this command is a nop. - .macro getpricereduction index:req + @ Gets whether the effects of the specified PokeNews program are active. newsKind is a POKENEWS_* constant. + .macro getpokenewsactive newsKind:req .byte 0x96 - .2byte \index + .2byte \newsKind .endm @ Fades the screen to and from black and white. Modes are FADE_(TO/FROM)_(WHITE/BLACK) @@ -1162,65 +1231,71 @@ .byte \speed .endm - .macro setflashradius word:req + @ Sets the flash level. A level of 0 is fully bright, a level of 1 is the largest flash radius, a level + @ of 7 is the smallest flash radius, a level of 8 is fully black. + .macro setflashlevel level:req .byte 0x99 - .2byte \word + .2byte \level .endm - .macro animateflash byte:req + @ Animates the flash radius from its current size to the size it would be at the specified level. + @ Note that this does not actually change the current flash level. It's typically used just before a setflashlevel. + .macro animateflash level:req .byte 0x9a - .byte \byte + .byte \level .endm - .macro messageautoscroll pointer:req + @ Automatically scrolls through the message without player input and at a fixed speed. + .macro messageautoscroll text:req .byte 0x9b - .4byte \pointer + .4byte \text .endm - @ Executes the specified field move animation. + @ Executes the specified field effect animation (FLDEFF_*). .macro dofieldeffect animation:req .byte 0x9c .2byte \animation .endm - @ Sets up the field effect argument argument with the value value. - .macro setfieldeffectargument argument:req, param:req + @ Sets the field effect argument at index 'argNum' to 'value.' + .macro setfieldeffectargument argNum:req, value:req .byte 0x9d - .byte \argument - .2byte \param + .byte \argNum + .2byte \value .endm - @ Blocks script execution until all playing field move animations complete. + @ Blocks script execution until all playing field effect animations complete. .macro waitfieldeffect animation:req .byte 0x9e .2byte \animation .endm - @ Sets which healing place the player will return to if all of the Pokemon in their party faint. + @ Sets which healing location (HEAL_LOCATION_*) the player will return to if all of the Pokemon in their party faint. .macro setrespawn heallocation:req .byte 0x9f .2byte \heallocation .endm - @ Checks the player's gender. If male, then MALE (0) is stored in VAR_RESULT. If female, then FEMALE (1) is stored in VAR_RESULT. + @ Checks the player's gender. Stores the result (MALE (0) or FEMALE (1)) in VAR_RESULT. .macro checkplayergender .byte 0xa0 .endm - @ Plays the specified (species) Pokemon's cry. You can use waitcry to block script execution until the sound finishes. + @ Plays the cry of the given species. Mode is any CRY_MODE_* constant. + @ You can use waitmoncry to block script execution until the cry finishes. .macro playmoncry species:req, mode:req .byte 0xa1 .2byte \species .2byte \mode .endm - @ Changes the metatile at (x, y) on the current map. - .macro setmetatile x:req, y:req, metatile_number:req, has_collision:req + @ Set the metatile at (x, y) on the current map to the given metatile and impassability. + .macro setmetatile x:req, y:req, metatileId:req, impassable:req .byte 0xa2 .2byte \x .2byte \y - .2byte \metatile_number - .2byte \has_collision + .2byte \metatileId + .2byte \impassable .endm @ Queues a weather change to the default weather for the map. @@ -1239,54 +1314,63 @@ .byte 0xa5 .endm - @ This command manages cases in which maps have tiles that change state when stepped on (specifically, cracked/breakable floors). - .macro setstepcallback subroutine:req + @ Enables the overworld task specified by stepCbId (STEP_CB_*). Only 1 can be active at a time. See src/field_tasks.c for more. + .macro setstepcallback stepCbId:req .byte 0xa6 - .byte \subroutine + .byte \stepCbId .endm + @ Sets the current map layout to the one specified by index (LAYOUT_*). + @ This should be done before the layout is loaded, typically in the ON_TRANSITION map script. .macro setmaplayoutindex index:req .byte 0xa7 .2byte \index .endm - .macro setobjectpriority index:req, map:req, priority:req + @ Sets the specified object's sprite's subpriority, and sets fixedPriority to TRUE. + @ Only used to hide the player and Briney behind the boat. + .macro setobjectsubpriority localId:req, map:req, subpriority:req .byte 0xa8 - .2byte \index + .2byte \localId map \map - .byte \priority + .byte \subpriority .endm - .macro resetobjectpriority index:req, map:req + @ Sets the specified object's fixedPriority to FALSE. Does not change the subpriority field. + .macro resetobjectsubpriority localId:req, map:req .byte 0xa9 - .2byte \index + .2byte \localId map \map .endm - .macro createvobject sprite:req, byte2:req, x:req, y:req, elevation, direction + @ Creates a sprite with object graphics. Used when creating large groups of static NPCs that exceed + @ the object event limit (e.g. Contest / Battle Dome audiences and Union Room group members). + @ The specified id can be used to refer to the sprite again later with turnvobject. + .macro createvobject graphicsId:req, id:req, x:req, y:req, elevation=3, direction=DIR_SOUTH .byte 0xaa - .byte \sprite - .byte \byte2 + .byte \graphicsId + .byte \id .2byte \x .2byte \y .byte \elevation .byte \direction .endm - .macro turnvobject index:req, direction:req + @ Turns a sprite created with createvobject. + .macro turnvobject id:req, direction:req .byte 0xab - .byte \index + .byte \id .byte \direction .endm - @ Opens the door metatile at (X, Y) with an animation. + @ Opens the door metatile at (x, y) with an animation. .macro opendoor x:req, y:req .byte 0xac .2byte \x .2byte \y .endm - @ Closes the door metatile at (X, Y) with an animation. + @ Closes the door metatile at (x, y) with an animation. .macro closedoor x:req, y:req .byte 0xad .2byte \x @@ -1298,21 +1382,21 @@ .byte 0xae .endm - @ Sets the door tile at (x, y) to be open without an animation. + @ Sets the door metatile at (x, y) to be open without an animation. .macro setdooropen x:req, y:req .byte 0xaf .2byte \x .2byte \y .endm - @ Sets the door tile at (x, y) to be closed without an animation. + @ Sets the door metatile at (x, y) to be closed without an animation. .macro setdoorclosed x:req, y:req .byte 0xb0 .2byte \x .2byte \y .endm - @ In Emerald, this command consumes its parameters and does nothing. In FireRed, this command is a nop. + @ Consumes its parameters and does nothing. It is implemented but unused in Ruby/Sapphire. .macro addelevmenuitem a:req, b:req, c:req, d:req .byte 0xb1 .byte \a @@ -1321,27 +1405,33 @@ .2byte \d .endm - @ In FireRed and Emerald, this command is a nop. + @ Does nothing. It is implemented but unused in Ruby/Sapphire. .macro showelevmenu .byte 0xb2 .endm + @ Gets the number of coins the player has and stores it in the variable 'out'. .macro checkcoins out:req .byte 0xb3 .2byte \out .endm + @ Gives 'count' coins to the player, up to a total of MAX_COINS. + @ If the player already has MAX_COINS then VAR_RESULT is set to TRUE, otherwise it is set to FALSE. .macro addcoins count:req .byte 0xb4 .2byte \count .endm + @ Takes 'count' coins from the player. + @ If the player has fewer than 'count' coins then no coins are taken and VAR_RESULT is set to TRUE. + @ Otherwise VAR_RESULT is set to FALSE. .macro removecoins count:req .byte 0xb5 .2byte \count .endm - @ Prepares to start a wild battle against a species at Level level holding item. Running this command will not affect + @ Prepares to start a wild battle against a 'species' at 'level' holding 'item'. Running this command will not affect @ normal wild battles. You start the prepared battle with dowildbattle. .macro setwildbattle species:req, level:req, item:req .byte 0xb6 @@ -1355,83 +1445,90 @@ .byte 0xb7 .endm + @ Sets a relative address to be used by the other vcommands as part of a Mystery Gift script. .macro setvaddress pointer:req .byte 0xb8 .4byte \pointer .endm + @ Equivalent to goto using the relative address set by setvaddress. .macro vgoto pointer:req .byte 0xb9 .4byte \pointer .endm + @ Equivalent to call using the relative address set by setvaddress. .macro vcall pointer:req .byte 0xba .4byte \pointer .endm + @ Equivalent to goto_if using the relative address set by setvaddress. .macro vgoto_if byte:req, pointer:req .byte 0xbb .byte \byte .4byte \pointer .endm + @ Equivalent to call_if using the relative address set by setvaddress. .macro vcall_if byte:req, pointer:req .byte 0xbc .byte \byte .4byte \pointer .endm + @ Equivalent to message using the relative address set by setvaddress. .macro vmessage pointer:req .byte 0xbd .4byte \pointer .endm - .macro vloadptr pointer:req + @ Expands the given text at the pointer (- the relative address set by setvaddress) into gStringVar4 + .macro vbuffermessage ptr:req .byte 0xbe - .4byte \pointer + .4byte \ptr .endm - .macro vbufferstring byte:req, pointer:req + @ Equivalent to bufferstring using the relative address set by setvaddress. + .macro vbufferstring stringVarIndex:req, pointer:req .byte 0xbf - .byte \byte + stringvar \stringVarIndex .4byte \pointer .endm - @ Spawns a secondary box showing how many Coins the player has. + @ Create a window showing how many Coins the player has. .macro showcoinsbox x:req, y:req .byte 0xc0 .byte \x .byte \y .endm - @ Hides the secondary box spawned by showcoins. It consumes its arguments but doesn't use them. + @ Destroys the window created by showcoins. It consumes its arguments but doesn't use them. .macro hidecoinsbox x:req, y:req .byte 0xc1 .byte \x .byte \y .endm - @ Updates the secondary box spawned by showcoins. It consumes its arguments but doesn't use them. + @ Updates the window created by showcoins. It consumes its arguments but doesn't use them. .macro updatecoinsbox x:req, y:req .byte 0xc2 .byte \x .byte \y .endm - @ Increases the value of the specified game stat by 1. The stat's value will not be allowed to exceed 0x00FFFFFF. + @ Increases the value of the specified game stat by 1. The maximum value of a stat is 0xFFFFFF. See include/constants/game_stat.h .macro incrementgamestat stat:req .byte 0xc3 .byte \stat .endm @ Sets the destination that using an Escape Rope or Dig will take the player to. - .macro setescapewarp map:req, warp:req, x:req, y:req + @ Warp commands can be given either the id of which warp location to go to on the destination map + @ or a pair of x/y coordinates to go to directly on the destination map. + .macro setescapewarp map:req, a, b, c .byte 0xc4 - map \map - .byte \warp - .2byte \x - .2byte \y + formatwarp \map, \a, \b, \c .endm @ Blocks script execution until cry finishes. @@ -1439,49 +1536,40 @@ .byte 0xc5 .endm - @ Writes the name of the specified (box) PC box to the specified buffer. - .macro bufferboxname out:req, box:req + @ Writes the name of the specified PC box to the specified buffer. + .macro bufferboxname stringVarId:req, box:req .byte 0xc6 - .byte \out + stringvar \stringVarId .2byte \box .endm - @ Sets the color of the text in standard message boxes. 0x00 produces blue (male) text, 0x01 produces red (female) text, - @ 0xFF resets the color to the default for the current OW's gender, and all other values produce black text. @ Used only in FireRed/LeafGreen, does nothing in Emerald. .macro textcolor color:req .byte 0xc7 .byte \color .endm - @ The exact purpose of this command is unknown, but it is related to the blue help-text box that appears on the bottom - @ of the screen when the Main Menu is opened. @ Used only in FireRed/LeafGreen, does nothing in Emerald. .macro loadhelp pointer:req .byte 0xc8 .4byte \pointer .endm - @ The exact purpose of this command is unknown, but it is related to the blue help-text box that appears on the bottom of - @ the screen when the Main Menu is opened. @ Used only in FireRed/LeafGreen, does nothing in Emerald. .macro unloadhelp .byte 0xc9 .endm - @ After using this command, all standard message boxes will use the signpost frame. @ Used only in FireRed/LeafGreen, does nothing in Emerald. .macro signmsg .byte 0xca .endm - @ Ends the effects of signmsg, returning message box frames to normal. @ Used only in FireRed/LeafGreen, does nothing in Emerald. .macro normalmsg .byte 0xcb .endm - @ Compares the value of a hidden variable to a dword. @ Used only in FireRed/LeafGreen, does nothing in Emerald. .macro comparehiddenvar a:req, value:req .byte 0xcc @@ -1489,39 +1577,38 @@ .4byte \value .endm - @ Sets the Pokemon in the specified slot of the player party's eventLegal bit. + @ Sets the eventLegal bit for the Pokemon in the specified slot of the player's party. .macro setmoneventlegal slot:req .byte 0xcd .2byte \slot .endm - @ Checks if the Pokemon in the specified slot of the player's party has its eventLegal bit set. If it isn't set, + @ Checks if the eventLegal bit is set for the Pokemon in the specified slot of the player's party. If it isn't set, @ VAR_RESULT is TRUE. If the bit is set (or if the specified slot is empty or invalid), VAR_RESULT is FALSE. .macro checkmoneventlegal slot:req .byte 0xce .2byte \slot .endm - @ Depending on factors I haven't managed to understand yet, this command may cause script execution to jump to the - @ offset specified by the pointer at 0x020375C0. - .macro gotoram + @ Jumps to the ram script saved from a Wonder Card. If there is no valid saved Wonder Card or if the + @ ram script is invalid then this does nothing. + .macro trywondercardscript .byte 0xcf .endm - @ Sets worldmapflag to 1. This allows the player to Fly to the corresponding map, if that map has a flightspot. @ Used only in FireRed/LeafGreen, does nothing in Emerald. .macro setworldmapflag worldmapflag:req .byte 0xd0 .2byte \worldmapflag .endm - @ Clone of warpteleport? It is apparently only used in FR/LG, and only with specials.[source] - .macro warpteleport2 map:req, warp:req, x:req, y:req + @ Warps the player to the specified map using a teleport effect. Effect is similar to warpteleport, but + @ this warp has no fade out and maintains the original facing direction. + @ Warp commands can be given either the id of which warp location to go to on the destination map + @ or a pair of x/y coordinates to go to directly on the destination map. + .macro warpspinenter map:req, a, b, c .byte 0xd1 - map \map - .byte \warp - .2byte \x - .2byte \y + formatwarp \map, \a, \b, \c .endm @ Changes the location where the player caught the Pokemon in the specified slot of their party. @@ -1531,99 +1618,114 @@ .byte \location .endm - @ For the rotating tile puzzles in Mossdeep Gym/Trick House Room 7. Moves the objects on the colored puzzle - @ specified by puzzleNumber one rotation + @ For the rotating tile puzzles in Mossdeep Gym / Trick House Room 7. Moves the objects one rotation + @ on the colored puzzle specified by puzzleNumber. .macro moverotatingtileobjects puzzleNumber:req .byte 0xd3 .2byte \puzzleNumber .endm - @ For the rotating tile puzzles in Mossdeep Gym/Trick House Room 7. Updates the facing direction of all objects on the puzzle tiles + @ For the rotating tile puzzles in Mossdeep Gym / Trick House Room 7. Updates the facing direction of all objects on the puzzle tiles .macro turnrotatingtileobjects .byte 0xd4 .endm - @ For the rotating tile puzzles in Mossdeep Gym/Trick House Room 7. Allocates memory for the puzzle objects. + @ For the rotating tile puzzles in Mossdeep Gym / Trick House Room 7. Allocates memory for the puzzle objects. @ isTrickHouse is needed to determine which of the two maps the puzzle is on, in order to know where in the tileset - @ the puzzle tiles start. In FireRed, this command is a nop. + @ the puzzle tiles start (TRUE for Trick House Room, FALSE for Mossdeep Gym). .macro initrotatingtilepuzzle isTrickHouse:req .byte 0xd5 .2byte \isTrickHouse .endm - @ For the rotating tile puzzles in Mossdeep Gym/Trick House Room 7. Frees the memory allocated for the puzzle objects. + @ For the rotating tile puzzles in Mossdeep Gym / Trick House Room 7. Frees the memory allocated for the puzzle objects. .macro freerotatingtilepuzzle .byte 0xd6 .endm - .macro warpmossdeepgym map:req, warpId:req, x:req, y:req + @ Warp used by the teleport tiles in the Mossdeep Gym. Plays SE_WARP_IN and does a simple fade transition. + @ Also skips reloading object events by setting SKIP_OBJECT_EVENT_LOAD. + @ Warp commands can be given either the id of which warp location to go to on the destination map + @ or a pair of x/y coordinates to go to directly on the destination map. + .macro warpmossdeepgym map:req, a, b, c .byte 0xd7 - map \map - .byte \warpId - .2byte \x - .2byte \y + formatwarp \map, \a, \b, \c .endm + @ Sets the selected object to the id of the currently approaching trainer. .macro selectapproachingtrainer .byte 0xd8 .endm + @ Freezes all objects immediately except the player and the approaching trainers. + @ The player and trainers are frozen once their movement is finished. .macro lockfortrainer .byte 0xd9 .endm + @ Destroys the window created by braillemessage. .macro closebraillemessage .byte 0xda .endm - .macro messageinstant pointer:req + @ Prints and draws the message all at once rather than character by character. + @ Does not wait for player input to continue. + .macro messageinstant text:req .byte 0xdb - .4byte \pointer + .4byte \text .endm + @ Equivalent to fadescreen but copies gPlttBufferUnfaded to gPaletteDecompressionBuffer on the fade out + @ and the reverse on the fade in, in effect saving gPlttBufferUnfaded to restore it. .macro fadescreenswapbuffers mode:req .byte 0xdc .byte \mode .endm - .macro buffertrainerclassname out:req, class:req + @ Buffers the specified trainer's class name to the given string var. + @ If the trainer id is >= TRAINERS_COUNT it will be treated as TRAINER_NONE. + .macro buffertrainerclassname stringVarId:req, trainerId:req .byte 0xdd - .byte \out - .2byte \class + stringvar \stringVarId + .2byte \trainerId .endm - .macro buffertrainername out:req, trainer:req + @ Buffers the specified trainer's name to the given string var. + @ If the trainer id is >= TRAINERS_COUNT it will be treated as TRAINER_NONE. + .macro buffertrainername stringVarId:req, trainerId:req .byte 0xde - .byte \out - .2byte \trainer + stringvar \stringVarId + .2byte \trainerId .endm - .macro pokenavcall pointer:req + @ Starts a Pokenav call with the given text. + .macro pokenavcall text:req .byte 0xdf - .4byte \pointer + .4byte \text .endm - .macro warpsootopolislegend map:req, byte:req, word1:req, word2:req + @ Warp with a fade to white. Used during the Sootopolis legendary fight. + @ Warp commands can be given either the id of which warp location to go to on the destination map + @ or a pair of x/y coordinates to go to directly on the destination map. + .macro warpwhitefade map:req, a, b, c .byte 0xe0 - map \map - .byte \byte - .2byte \word1 - .2byte \word2 + formatwarp \map, \a, \b, \c .endm - .macro buffercontesttypestring out:req, word:req + @ Buffers the name of the contest category to the buffer. + @ For example a category of CONTEST_CATEGORY_COOL will buffer the string "COOLNESS CONTEST". + .macro buffercontestname stringVarId:req, category:req .byte 0xe1 - .byte \out - .2byte \word + stringvar \stringVarId + .2byte \category .endm - @ Writes the name of the specified (item) item to the specified buffer. If the specified item is a Berry (0x85 - 0xAE) or - @ Poke Ball (0x4) and if the quantity is 2 or more, the buffered string will be pluralized ("IES" or "S" appended). - @ If the specified item is the Enigma Berry, I have no idea what this command does (but testing showed no pluralization). - @ If the specified index is larger than the number of items in the game (0x176), the name of item 0 ("????????") is buffered instead. - .macro bufferitemnameplural out:req, item:req, quantity:req + @ Writes the name of the specified item to the specified buffer. If 'item' is a Berry or ITEM_POKE_BALL + @ and if the quantity is 2 or more, the buffered string will be pluralized ("IES" or "S" appended). + @ If the specified item is >= ITEMS_COUNT then the name of ITEM_NONE ("????????") is buffered instead. + .macro bufferitemnameplural stringVarId:req, item:req, quantity:req .byte 0xe2 - .byte \out + stringvar \stringVarId .2byte \item .2byte \quantity .endm @@ -1641,28 +1743,48 @@ goto_if TRUE, \dest .endm - .macro goto_if_lt dest:req @ LESS THAN - goto_if 0, \dest + @ Allows 'compare' followed by a conditional goto/call to be combined into a single statement. + @ The following are examples of the two acceptable formats this facilitates: + @ compare VAR_RESULT, TRUE + @ goto_if_eq MyScript + @ - or - + @ goto_if_eq VAR_RESULT, TRUE, MyScript + @ + @ The first two arguments to this macro are the base command, e.g. 'goto_if 1' for goto_if_eq. + @ The remaining arguments 'a, b, c' depend on the format: + @ For a single statement, 'a' and 'b' are the values to compare and 'c' is the destination pointer. + @ For a statement preceded by a compare, 'a' is the destination pointer and 'b/c' are not provided. + .macro trycompare jump:req, condition:req, a:req, b, c + .ifnb \c + compare \a, \b + \jump \condition, \c + .else + \jump \condition, \a + .endif + .endm + + .macro goto_if_lt a:req, b, c @ LESS THAN + trycompare goto_if, 0, \a, \b, \c .endm - .macro goto_if_eq dest:req @ EQUAL - goto_if 1, \dest + .macro goto_if_eq a:req, b, c @ EQUAL + trycompare goto_if, 1, \a, \b, \c .endm - .macro goto_if_gt dest:req @ GREATER THAN - goto_if 2, \dest + .macro goto_if_gt a:req, b, c @ GREATER THAN + trycompare goto_if, 2, \a, \b, \c .endm - .macro goto_if_le dest:req @ LESS THAN OR EQUAL - goto_if 3, \dest + .macro goto_if_le a:req, b, c @ LESS THAN OR EQUAL + trycompare goto_if, 3, \a, \b, \c .endm - .macro goto_if_ge dest:req @ GREATER THAN OR EQUAL - goto_if 4, \dest + .macro goto_if_ge a:req, b, c @ GREATER THAN OR EQUAL + trycompare goto_if, 4, \a, \b, \c .endm - .macro goto_if_ne dest:req @ NOT EQUAL - goto_if 5, \dest + .macro goto_if_ne a:req, b, c @ NOT EQUAL + trycompare goto_if, 5, \a, \b, \c .endm .macro call_if_unset flag:req, dest:req @@ -1675,36 +1797,36 @@ call_if TRUE, \dest .endm - .macro call_if_lt dest:req @ LESS THAN - call_if 0, \dest + .macro call_if_lt a:req, b, c @ LESS THAN + trycompare call_if, 0, \a, \b, \c .endm - .macro call_if_eq dest:req @ EQUAL - call_if 1, \dest + .macro call_if_eq a:req, b, c @ EQUAL + trycompare call_if, 1, \a, \b, \c .endm - .macro call_if_gt dest:req @ GREATER THAN - call_if 2, \dest + .macro call_if_gt a:req, b, c @ GREATER THAN + trycompare call_if, 2, \a, \b, \c .endm - .macro call_if_le dest:req @ LESS THAN OR EQUAL - call_if 3, \dest + .macro call_if_le a:req, b, c @ LESS THAN OR EQUAL + trycompare call_if, 3, \a, \b, \c .endm - .macro call_if_ge dest:req @ GREATER THAN OR EQUAL - call_if 4, \dest + .macro call_if_ge a:req, b, c @ GREATER THAN OR EQUAL + trycompare call_if, 4, \a, \b, \c .endm - .macro call_if_ne dest:req @ NOT EQUAL - call_if 5, \dest + .macro call_if_ne a:req, b, c @ NOT EQUAL + trycompare call_if, 5, \a, \b, \c .endm - .macro vgoto_if_eq dest:req - vgoto_if TRUE, \dest + .macro vgoto_if_eq a:req, b, c + trycompare vgoto_if, TRUE, \a, \b, \c .endm - .macro vgoto_if_ne dest:req - vgoto_if FALSE, \dest + .macro vgoto_if_ne a:req, b, c + trycompare vgoto_if, FALSE, \a, \b, \c .endm .macro vgoto_if_unset flag:req, dest:req @@ -1753,32 +1875,42 @@ MSGBOX_YESNO = 5 MSGBOX_AUTOCLOSE = 6 MSGBOX_GETPOINTS = 9 + MSGBOX_POKENAV = 10 YES = 1 NO = 0 + @ Buffers the given text and calls the relevant standard message script (see gStdScripts). .macro msgbox text:req, type=MSGBOX_DEFAULT loadword 0, \text callstd \type .endm + @ Gives 'amount' of the specified 'item' to the player and prints a message with fanfare. + @ If the player doesn't have space for all the items then as many are added as possible, the + @ message indicates there is no room, and VAR_RESULT is set to FALSE. + @ Otherwise VAR_RESULT is set to TRUE, and the message indicates they have received the item(s). .macro giveitem item:req, amount=1 setorcopyvar VAR_0x8000, \item setorcopyvar VAR_0x8001, \amount callstd STD_OBTAIN_ITEM .endm + @ For picking up items in the overworld. Similar to giveitem, but with different language and + @ sets the flag of the last-talked to object (the item the player picked up). .macro finditem item:req, amount=1 setorcopyvar VAR_0x8000, \item setorcopyvar VAR_0x8001, \amount callstd STD_FIND_ITEM .endm + @ Equivalent to giveitem but for a single decoration. .macro givedecoration decoration:req setorcopyvar VAR_0x8000, \decoration callstd STD_OBTAIN_DECORATION .endm + @ Registers the specified trainer in Match Call and plays a fanfare with a notification message. .macro register_matchcall trainer:req setvar VAR_0x8004, \trainer special SetMatchCallRegisteredFlag @@ -1786,6 +1918,7 @@ callstd STD_REGISTER_MATCH_CALL .endm + @ Does a sparkle field effect (e.g. when the Trick Master is hiding) at the given coordinates. .macro dofieldeffectsparkle x:req, y:req, priority:req setfieldeffectargument 0, \x setfieldeffectargument 1, \y @@ -1793,6 +1926,7 @@ dofieldeffect FLDEFF_SPARKLE .endm + @ Prints a braille message, waits for an A or B press, then closes the message. .macro braillemsgbox text:req braillemessage \text waitbuttonpress diff --git a/data/event_scripts.s b/data/event_scripts.s index c33932a53085..edab4987fa3a 100644 --- a/data/event_scripts.s +++ b/data/event_scripts.s @@ -99,7 +99,7 @@ gStdScripts:: .4byte Std_ObtainDecoration @ STD_OBTAIN_DECORATION .4byte Std_RegisteredInMatchCall @ STD_REGISTER_MATCH_CALL .4byte Std_MsgboxGetPoints @ MSGBOX_GETPOINTS - .4byte Std_10 + .4byte Std_MsgboxPokenav @ MSGBOX_POKENAV gStdScripts_End:: .include "data/maps/PetalburgCity/scripts.inc" @@ -583,12 +583,9 @@ EventScript_WhiteOut:: end EventScript_ResetMrBriney:: - compare VAR_BRINEY_LOCATION, 1 - goto_if_eq EventScript_MoveMrBrineyToHouse - compare VAR_BRINEY_LOCATION, 2 - goto_if_eq EventScript_MoveMrBrineyToDewford - compare VAR_BRINEY_LOCATION, 3 - goto_if_eq EventScript_MoveMrBrineyToRoute109 + goto_if_eq VAR_BRINEY_LOCATION, 1, EventScript_MoveMrBrineyToHouse + goto_if_eq VAR_BRINEY_LOCATION, 2, EventScript_MoveMrBrineyToDewford + goto_if_eq VAR_BRINEY_LOCATION, 3, EventScript_MoveMrBrineyToRoute109 end EventScript_MoveMrBrineyToHouse:: @@ -801,10 +798,8 @@ Movement_UnusedBoardFerry: step_end Common_EventScript_FerryDepartIsland:: - compare VAR_FACING, DIR_SOUTH - call_if_eq Ferry_EventScript_DepartIslandSouth - compare VAR_FACING, DIR_WEST - call_if_eq Ferry_EventScript_DepartIslandWest + call_if_eq VAR_FACING, DIR_SOUTH, Ferry_EventScript_DepartIslandSouth + call_if_eq VAR_FACING, DIR_WEST, Ferry_EventScript_DepartIslandWest delay 30 hideobjectat OBJ_EVENT_ID_PLAYER, 0 call Common_EventScript_FerryDepart @@ -820,7 +815,7 @@ Common_EventScript_NameReceivedPartyMon:: return Common_EventScript_PlayerHandedOverTheItem:: - bufferitemname 0, VAR_0x8004 + bufferitemname STR_VAR_1, VAR_0x8004 playfanfare MUS_OBTAIN_TMHM message gText_PlayerHandedOverTheItem waitmessage @@ -1001,7 +996,7 @@ Common_EventScript_LegendaryFlewAway:: fadescreenswapbuffers FADE_TO_BLACK removeobject VAR_LAST_TALKED fadescreenswapbuffers FADE_FROM_BLACK - bufferspeciesname 0, VAR_0x8004 + bufferspeciesname STR_VAR_1, VAR_0x8004 msgbox gText_LegendaryFlewAway, MSGBOX_DEFAULT release end diff --git a/data/maps/AbandonedShip_CaptainsOffice/scripts.inc b/data/maps/AbandonedShip_CaptainsOffice/scripts.inc index 99dfa7bd8048..7c59fec9676c 100644 --- a/data/maps/AbandonedShip_CaptainsOffice/scripts.inc +++ b/data/maps/AbandonedShip_CaptainsOffice/scripts.inc @@ -5,9 +5,8 @@ AbandonedShip_CaptainsOffice_EventScript_CaptSternAide:: lock faceplayer goto_if_set FLAG_EXCHANGED_SCANNER, AbandonedShip_CaptainsOffice_EventScript_ThisIsSSCactus - checkitem ITEM_SCANNER, 1 - compare VAR_RESULT, TRUE - goto_if_eq AbandonedShip_CaptainsOffice_EventScript_CanYouDeliverScanner + checkitem ITEM_SCANNER + goto_if_eq VAR_RESULT, TRUE, AbandonedShip_CaptainsOffice_EventScript_CanYouDeliverScanner goto_if_set FLAG_ITEM_ABANDONED_SHIP_HIDDEN_FLOOR_ROOM_4_SCANNER, AbandonedShip_CaptainsOffice_EventScript_ThisIsSSCactus msgbox AbandonedShip_CaptainsOffice_Text_NoSuccessFindingScanner, MSGBOX_DEFAULT release diff --git a/data/maps/AbandonedShip_Corridors_B1F/scripts.inc b/data/maps/AbandonedShip_Corridors_B1F/scripts.inc index dd70c9dd3291..19f103362ed3 100644 --- a/data/maps/AbandonedShip_Corridors_B1F/scripts.inc +++ b/data/maps/AbandonedShip_Corridors_B1F/scripts.inc @@ -4,7 +4,7 @@ AbandonedShip_Corridors_B1F_MapScripts:: .byte 0 AbandonedShip_Corridors_B1F_OnResume: - setdivewarp MAP_ABANDONED_SHIP_UNDERWATER1, 255, 5, 4 + setdivewarp MAP_ABANDONED_SHIP_UNDERWATER1, 5, 4 end AbandonedShip_Corridors_B1F_OnLoad: @@ -13,11 +13,11 @@ AbandonedShip_Corridors_B1F_OnLoad: end AbandonedShip_Corridors_B1F_EventScript_LockStorageRoom:: - setmetatile 11, 4, METATILE_InsideShip_IntactDoor_Bottom_Locked, 1 + setmetatile 11, 4, METATILE_InsideShip_IntactDoor_Bottom_Locked, TRUE return AbandonedShip_Corridors_B1F_EventScript_UnlockStorageRoom:: - setmetatile 11, 4, METATILE_InsideShip_IntactDoor_Bottom_Unlocked, 1 + setmetatile 11, 4, METATILE_InsideShip_IntactDoor_Bottom_Unlocked, TRUE return AbandonedShip_Corridors_B1F_EventScript_TuberM:: @@ -27,9 +27,8 @@ AbandonedShip_Corridors_B1F_EventScript_TuberM:: AbandonedShip_Corridors_B1F_EventScript_StorageRoomDoor:: lockall goto_if_set FLAG_USED_STORAGE_KEY, AbandonedShip_Corridors_B1F_EventScript_DoorIsUnlocked - checkitem ITEM_STORAGE_KEY, 1 - compare VAR_RESULT, FALSE - goto_if_eq AbandonedShip_Corridors_B1F_EventScript_DoorIsLocked + checkitem ITEM_STORAGE_KEY + goto_if_eq VAR_RESULT, FALSE, AbandonedShip_Corridors_B1F_EventScript_DoorIsLocked msgbox AbandonedShip_Corridors_B1F_Text_InsertedStorageKey, MSGBOX_DEFAULT playse SE_PIN removeitem ITEM_STORAGE_KEY diff --git a/data/maps/AbandonedShip_HiddenFloorCorridors/scripts.inc b/data/maps/AbandonedShip_HiddenFloorCorridors/scripts.inc index 4ec63a7e103c..dade6a516e86 100644 --- a/data/maps/AbandonedShip_HiddenFloorCorridors/scripts.inc +++ b/data/maps/AbandonedShip_HiddenFloorCorridors/scripts.inc @@ -4,7 +4,7 @@ AbandonedShip_HiddenFloorCorridors_MapScripts:: .byte 0 AbandonedShip_HiddenFloorCorridors_OnResume: - setdivewarp MAP_ABANDONED_SHIP_UNDERWATER1, 255, 5, 4 + setdivewarp MAP_ABANDONED_SHIP_UNDERWATER1, 5, 4 end AbandonedShip_HiddenFloorCorridors_OnLoad: @@ -19,43 +19,42 @@ AbandonedShip_HiddenFloorCorridors_OnLoad: end AbandonedShip_HiddenFloorCorridors_EventScript_UnlockRoom1:: - setmetatile 3, 8, METATILE_InsideShip_IntactDoor_Bottom_Unlocked, 1 + setmetatile 3, 8, METATILE_InsideShip_IntactDoor_Bottom_Unlocked, TRUE return AbandonedShip_HiddenFloorCorridors_EventScript_UnlockRoom2:: - setmetatile 6, 8, METATILE_InsideShip_IntactDoor_Bottom_Unlocked, 1 + setmetatile 6, 8, METATILE_InsideShip_IntactDoor_Bottom_Unlocked, TRUE return AbandonedShip_HiddenFloorCorridors_EventScript_UnlockRoom4:: - setmetatile 3, 3, METATILE_InsideShip_DoorIndent_Unlocked, 0 + setmetatile 3, 3, METATILE_InsideShip_DoorIndent_Unlocked, FALSE return AbandonedShip_HiddenFloorCorridors_EventScript_UnlockRoom6:: - setmetatile 9, 3, METATILE_InsideShip_DoorIndent_Unlocked, 0 + setmetatile 9, 3, METATILE_InsideShip_DoorIndent_Unlocked, FALSE return AbandonedShip_HiddenFloorCorridors_EventScript_LockRoom1:: - setmetatile 3, 8, METATILE_InsideShip_IntactDoor_Bottom_Locked, 1 + setmetatile 3, 8, METATILE_InsideShip_IntactDoor_Bottom_Locked, TRUE return AbandonedShip_HiddenFloorCorridors_EventScript_LockRoom2:: - setmetatile 6, 8, METATILE_InsideShip_IntactDoor_Bottom_Locked, 1 + setmetatile 6, 8, METATILE_InsideShip_IntactDoor_Bottom_Locked, TRUE return AbandonedShip_HiddenFloorCorridors_EventScript_LockRoom4:: - setmetatile 3, 3, METATILE_InsideShip_DoorIndent_Locked, 0 + setmetatile 3, 3, METATILE_InsideShip_DoorIndent_Locked, FALSE return AbandonedShip_HiddenFloorCorridors_EventScript_LockRoom6:: - setmetatile 9, 3, METATILE_InsideShip_DoorIndent_Locked, 0 + setmetatile 9, 3, METATILE_InsideShip_DoorIndent_Locked, FALSE return AbandonedShip_HiddenFloorCorridors_EventScript_Room1Door:: lockall goto_if_set FLAG_USED_ROOM_1_KEY, AbandonedShip_HiddenFloorCorridors_EventScript_TheDoorIsOpen - checkitem ITEM_ROOM_1_KEY, 1 - compare VAR_RESULT, FALSE - goto_if_eq AbandonedShip_HiddenFloorCorridors_EventScript_Rm1IsLocked + checkitem ITEM_ROOM_1_KEY + goto_if_eq VAR_RESULT, FALSE, AbandonedShip_HiddenFloorCorridors_EventScript_Rm1IsLocked msgbox AbandonedShip_HiddenFloorCorridors_Text_InsertedKey, MSGBOX_DEFAULT playse SE_PIN removeitem ITEM_ROOM_1_KEY @@ -68,9 +67,8 @@ AbandonedShip_HiddenFloorCorridors_EventScript_Room1Door:: AbandonedShip_HiddenFloorCorridors_EventScript_Room2Door:: lockall goto_if_set FLAG_USED_ROOM_2_KEY, AbandonedShip_HiddenFloorCorridors_EventScript_TheDoorIsOpen - checkitem ITEM_ROOM_2_KEY, 1 - compare VAR_RESULT, FALSE - goto_if_eq AbandonedShip_HiddenFloorCorridors_EventScript_Rm2IsLocked + checkitem ITEM_ROOM_2_KEY + goto_if_eq VAR_RESULT, FALSE, AbandonedShip_HiddenFloorCorridors_EventScript_Rm2IsLocked msgbox AbandonedShip_HiddenFloorCorridors_Text_InsertedKey, MSGBOX_DEFAULT playse SE_PIN removeitem ITEM_ROOM_2_KEY @@ -83,9 +81,8 @@ AbandonedShip_HiddenFloorCorridors_EventScript_Room2Door:: AbandonedShip_HiddenFloorCorridors_EventScript_Room4Door:: lockall goto_if_set FLAG_USED_ROOM_4_KEY, AbandonedShip_HiddenFloorCorridors_EventScript_TheDoorIsOpen - checkitem ITEM_ROOM_4_KEY, 1 - compare VAR_RESULT, FALSE - goto_if_eq AbandonedShip_HiddenFloorCorridors_EventScript_Rm4IsLocked + checkitem ITEM_ROOM_4_KEY + goto_if_eq VAR_RESULT, FALSE, AbandonedShip_HiddenFloorCorridors_EventScript_Rm4IsLocked msgbox AbandonedShip_HiddenFloorCorridors_Text_InsertedKey, MSGBOX_DEFAULT playse SE_PIN removeitem ITEM_ROOM_4_KEY @@ -98,9 +95,8 @@ AbandonedShip_HiddenFloorCorridors_EventScript_Room4Door:: AbandonedShip_HiddenFloorCorridors_EventScript_Room6Door:: lockall goto_if_set FLAG_USED_ROOM_6_KEY, AbandonedShip_HiddenFloorCorridors_EventScript_TheDoorIsOpen - checkitem ITEM_ROOM_6_KEY, 1 - compare VAR_RESULT, FALSE - goto_if_eq AbandonedShip_HiddenFloorCorridors_EventScript_Rm6IsLocked + checkitem ITEM_ROOM_6_KEY + goto_if_eq VAR_RESULT, FALSE, AbandonedShip_HiddenFloorCorridors_EventScript_Rm6IsLocked msgbox AbandonedShip_HiddenFloorCorridors_Text_InsertedKey, MSGBOX_DEFAULT playse SE_PIN removeitem ITEM_ROOM_6_KEY diff --git a/data/maps/AbandonedShip_HiddenFloorRooms/scripts.inc b/data/maps/AbandonedShip_HiddenFloorRooms/scripts.inc index cdeb225de228..e9b14b7b0b0c 100644 --- a/data/maps/AbandonedShip_HiddenFloorRooms/scripts.inc +++ b/data/maps/AbandonedShip_HiddenFloorRooms/scripts.inc @@ -17,12 +17,9 @@ AbandonedShip_HiddenFloorRooms_EventScript_DoHiddenItemSparkle:: setvar VAR_TEMP_1, 1 getplayerxy VAR_TEMP_2, VAR_TEMP_3 setvar VAR_TEMP_4, 1 - compare VAR_TEMP_2, 21 - call_if_eq AbandonedShip_HiddenFloorRooms_EventScript_InMiddleRoomColumn - compare VAR_TEMP_2, 36 - call_if_eq AbandonedShip_HiddenFloorRooms_EventScript_InRightRoomColumn - compare VAR_TEMP_3, 2 - call_if_eq AbandonedShip_HiddenFloorRooms_EventScript_InUpperRoomRow + call_if_eq VAR_TEMP_2, 21, AbandonedShip_HiddenFloorRooms_EventScript_InMiddleRoomColumn + call_if_eq VAR_TEMP_2, 36, AbandonedShip_HiddenFloorRooms_EventScript_InRightRoomColumn + call_if_eq VAR_TEMP_3, 2, AbandonedShip_HiddenFloorRooms_EventScript_InUpperRoomRow switch VAR_TEMP_4 case 1, AbandonedShip_HiddenFloorRooms_EventScript_EnterRm1 case 2, AbandonedShip_HiddenFloorRooms_EventScript_EnterRm2 @@ -48,8 +45,7 @@ AbandonedShip_HiddenFloorRooms_EventScript_EnterRm1:: delay 20 dofieldeffectsparkle 10, 10, 0 specialvar VAR_RESULT, FoundAbandonedShipRoom4Key - compare VAR_RESULT, FALSE - call_if_eq AbandonedShip_HiddenFloorRooms_EventScript_Rm4KeySparkle + call_if_eq VAR_RESULT, FALSE, AbandonedShip_HiddenFloorRooms_EventScript_Rm4KeySparkle waitfieldeffect FLDEFF_SPARKLE delay 10 end @@ -59,11 +55,9 @@ AbandonedShip_HiddenFloorRooms_EventScript_EnterRm2:: AbandonedShip_HiddenFloorRooms_EventScript_EnterRm3:: specialvar VAR_RESULT, FoundAbandonedShipRoom1Key - compare VAR_RESULT, TRUE - goto_if_eq AbandonedShip_HiddenFloorRooms_EventScript_Rm3NoSparkle + goto_if_eq VAR_RESULT, TRUE, AbandonedShip_HiddenFloorRooms_EventScript_Rm3NoSparkle delay 20 - compare VAR_RESULT, FALSE - call_if_eq AbandonedShip_HiddenFloorRooms_EventScript_Rm1KeySparkle + call_if_eq VAR_RESULT, FALSE, AbandonedShip_HiddenFloorRooms_EventScript_Rm1KeySparkle waitfieldeffect FLDEFF_SPARKLE delay 10 end @@ -76,8 +70,7 @@ AbandonedShip_HiddenFloorRooms_EventScript_EnterRm4:: dofieldeffectsparkle 8, 5, 0 dofieldeffectsparkle 11, 3, 0 specialvar VAR_RESULT, FoundAbandonedShipRoom6Key - compare VAR_RESULT, FALSE - call_if_eq AbandonedShip_HiddenFloorRooms_EventScript_Rm6KeySparkle + call_if_eq VAR_RESULT, FALSE, AbandonedShip_HiddenFloorRooms_EventScript_Rm6KeySparkle waitfieldeffect FLDEFF_SPARKLE delay 10 end @@ -88,8 +81,7 @@ AbandonedShip_HiddenFloorRooms_EventScript_EnterRm5:: dofieldeffectsparkle 25, 2, 0 dofieldeffectsparkle 24, 6, 0 specialvar VAR_RESULT, FoundAbandonedShipRoom2Key - compare VAR_RESULT, FALSE - call_if_eq AbandonedShip_HiddenFloorRooms_EventScript_Rm2KeySparkle + call_if_eq VAR_RESULT, FALSE, AbandonedShip_HiddenFloorRooms_EventScript_Rm2KeySparkle waitfieldeffect FLDEFF_SPARKLE delay 10 end diff --git a/data/maps/AbandonedShip_Rooms2_1F/scripts.inc b/data/maps/AbandonedShip_Rooms2_1F/scripts.inc index e02d109b7bf5..b0f317ef2838 100644 --- a/data/maps/AbandonedShip_Rooms2_1F/scripts.inc +++ b/data/maps/AbandonedShip_Rooms2_1F/scripts.inc @@ -4,8 +4,7 @@ AbandonedShip_Rooms2_1F_MapScripts:: AbandonedShip_Rooms2_1F_EventScript_Dan:: trainerbattle_double TRAINER_KIRA_AND_DAN_1, AbandonedShip_Rooms2_1F_Text_DanIntro, AbandonedShip_Rooms2_1F_Text_DanDefeat, AbandonedShip_Rooms2_1F_Text_DanNotEnoughMons, AbandonedShip_Rooms2_1F_EventScript_RegisterDan specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq AbandonedShip_Rooms2_1F_EventScript_DanRematch + goto_if_eq VAR_RESULT, TRUE, AbandonedShip_Rooms2_1F_EventScript_DanRematch msgbox AbandonedShip_Rooms2_1F_Text_DanPostBattle, MSGBOX_DEFAULT release end @@ -24,8 +23,7 @@ AbandonedShip_Rooms2_1F_EventScript_DanRematch:: AbandonedShip_Rooms2_1F_EventScript_Kira:: trainerbattle_double TRAINER_KIRA_AND_DAN_1, AbandonedShip_Rooms2_1F_Text_KiraIntro, AbandonedShip_Rooms2_1F_Text_KiraDefeat, AbandonedShip_Rooms2_1F_Text_KiraNotEnoughMons, AbandonedShip_Rooms2_1F_EventScript_RegisterKira specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq AbandonedShip_Rooms2_1F_EventScript_KiraRematch + goto_if_eq VAR_RESULT, TRUE, AbandonedShip_Rooms2_1F_EventScript_KiraRematch msgbox AbandonedShip_Rooms2_1F_Text_KiraPostBattle, MSGBOX_DEFAULT release end diff --git a/data/maps/AbandonedShip_Rooms_1F/scripts.inc b/data/maps/AbandonedShip_Rooms_1F/scripts.inc index 41b4eb3b6750..c8ea84964019 100644 --- a/data/maps/AbandonedShip_Rooms_1F/scripts.inc +++ b/data/maps/AbandonedShip_Rooms_1F/scripts.inc @@ -13,8 +13,7 @@ AbandonedShip_Rooms_1F_EventScript_Demetrius:: AbandonedShip_Rooms_1F_EventScript_Thalia:: trainerbattle_single TRAINER_THALIA_1, AbandonedShip_Rooms_1F_Text_ThaliaIntro, AbandonedShip_Rooms_1F_Text_ThaliaDefeat, AbandonedShip_Rooms_1F_EventScript_RegisterThalia specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq AbandonedShip_Rooms_1F_EventScript_ThaliaRematch + goto_if_eq VAR_RESULT, TRUE, AbandonedShip_Rooms_1F_EventScript_ThaliaRematch msgbox AbandonedShip_Rooms_1F_Text_ThaliaPostBattle, MSGBOX_DEFAULT release end diff --git a/data/maps/AbandonedShip_Rooms_B1F/scripts.inc b/data/maps/AbandonedShip_Rooms_B1F/scripts.inc index a716972ff487..484f15ba1208 100644 --- a/data/maps/AbandonedShip_Rooms_B1F/scripts.inc +++ b/data/maps/AbandonedShip_Rooms_B1F/scripts.inc @@ -3,7 +3,7 @@ AbandonedShip_Rooms_B1F_MapScripts:: .byte 0 AbandonedShip_Rooms_B1F_OnResume: - setdivewarp MAP_ABANDONED_SHIP_UNDERWATER2, 255, 17, 4 + setdivewarp MAP_ABANDONED_SHIP_UNDERWATER2, 17, 4 end AbandonedShip_Rooms_B1F_EventScript_FatMan:: diff --git a/data/maps/AbandonedShip_Underwater1/scripts.inc b/data/maps/AbandonedShip_Underwater1/scripts.inc index 9b3528b7796b..0f47704d1a1c 100644 --- a/data/maps/AbandonedShip_Underwater1/scripts.inc +++ b/data/maps/AbandonedShip_Underwater1/scripts.inc @@ -3,6 +3,6 @@ AbandonedShip_Underwater1_MapScripts:: .byte 0 AbandonedShip_Underwater1_OnResume: - setdivewarp MAP_ABANDONED_SHIP_HIDDEN_FLOOR_CORRIDORS, 255, 0, 10 + setdivewarp MAP_ABANDONED_SHIP_HIDDEN_FLOOR_CORRIDORS, 0, 10 end diff --git a/data/maps/AbandonedShip_Underwater2/scripts.inc b/data/maps/AbandonedShip_Underwater2/scripts.inc index bb139bd510db..6258b50c1859 100644 --- a/data/maps/AbandonedShip_Underwater2/scripts.inc +++ b/data/maps/AbandonedShip_Underwater2/scripts.inc @@ -3,6 +3,6 @@ AbandonedShip_Underwater2_MapScripts:: .byte 0 AbandonedShip_Underwater2_OnResume: - setdivewarp MAP_ABANDONED_SHIP_ROOMS_B1F, 255, 13, 7 + setdivewarp MAP_ABANDONED_SHIP_ROOMS_B1F, 13, 7 end diff --git a/data/maps/AncientTomb/scripts.inc b/data/maps/AncientTomb/scripts.inc index f2e242bbd693..d28ac7bc3592 100644 --- a/data/maps/AncientTomb/scripts.inc +++ b/data/maps/AncientTomb/scripts.inc @@ -10,8 +10,7 @@ AncientTomb_OnResume: AncientTomb_EventScript_TryRemoveRegisteel:: specialvar VAR_RESULT, GetBattleOutcome - compare VAR_RESULT, B_OUTCOME_CAUGHT - goto_if_ne Common_EventScript_NopReturn + goto_if_ne VAR_RESULT, B_OUTCOME_CAUGHT, Common_EventScript_NopReturn removeobject VAR_LAST_TALKED return @@ -29,12 +28,12 @@ AncientTomb_OnLoad: end AncientTomb_EventScript_HideRegiEntrance:: - setmetatile 7, 19, METATILE_Cave_EntranceCover, 1 - setmetatile 8, 19, METATILE_Cave_EntranceCover, 1 - setmetatile 9, 19, METATILE_Cave_EntranceCover, 1 - setmetatile 7, 20, METATILE_Cave_SealedChamberBraille_Mid, 1 - setmetatile 8, 20, METATILE_Cave_SealedChamberBraille_Mid, 1 - setmetatile 9, 20, METATILE_Cave_SealedChamberBraille_Mid, 1 + setmetatile 7, 19, METATILE_Cave_EntranceCover, TRUE + setmetatile 8, 19, METATILE_Cave_EntranceCover, TRUE + setmetatile 9, 19, METATILE_Cave_EntranceCover, TRUE + setmetatile 7, 20, METATILE_Cave_SealedChamberBraille_Mid, TRUE + setmetatile 8, 20, METATILE_Cave_SealedChamberBraille_Mid, TRUE + setmetatile 9, 20, METATILE_Cave_SealedChamberBraille_Mid, TRUE return AncientTomb_EventScript_CaveEntranceMiddle:: @@ -68,12 +67,9 @@ AncientTomb_EventScript_Registeel:: waitstate clearflag FLAG_SYS_CTRL_OBJ_DELETE specialvar VAR_RESULT, GetBattleOutcome - compare VAR_RESULT, B_OUTCOME_WON - goto_if_eq AncientTomb_EventScript_DefeatedRegisteel - compare VAR_RESULT, B_OUTCOME_RAN - goto_if_eq AncientTomb_EventScript_RanFromRegisteel - compare VAR_RESULT, B_OUTCOME_PLAYER_TELEPORTED - goto_if_eq AncientTomb_EventScript_RanFromRegisteel + goto_if_eq VAR_RESULT, B_OUTCOME_WON, AncientTomb_EventScript_DefeatedRegisteel + goto_if_eq VAR_RESULT, B_OUTCOME_RAN, AncientTomb_EventScript_RanFromRegisteel + goto_if_eq VAR_RESULT, B_OUTCOME_PLAYER_TELEPORTED, AncientTomb_EventScript_RanFromRegisteel setflag FLAG_DEFEATED_REGISTEEL release end diff --git a/data/maps/AquaHideout_B1F/scripts.inc b/data/maps/AquaHideout_B1F/scripts.inc index 2a6f156e5c52..4f2eb836f5ec 100644 --- a/data/maps/AquaHideout_B1F/scripts.inc +++ b/data/maps/AquaHideout_B1F/scripts.inc @@ -9,8 +9,7 @@ AquaHideout_B1F_OnResume: AquaHideout_B1F_EventScript_TryRemoveElectrode:: specialvar VAR_RESULT, GetBattleOutcome - compare VAR_RESULT, B_OUTCOME_CAUGHT - goto_if_ne Common_EventScript_NopReturn + goto_if_ne VAR_RESULT, B_OUTCOME_CAUGHT, Common_EventScript_NopReturn removeobject VAR_LAST_TALKED return @@ -39,12 +38,9 @@ AquaHideout_B1F_EventScript_Electrode1:: dowildbattle clearflag FLAG_SYS_CTRL_OBJ_DELETE specialvar VAR_RESULT, GetBattleOutcome - compare VAR_RESULT, B_OUTCOME_WON - goto_if_eq AquaHideout_B1F_EventScript_DefeatedElectrode1 - compare VAR_RESULT, B_OUTCOME_RAN - goto_if_eq AquaHideout_B1F_EventScript_DefeatedElectrode1 - compare VAR_RESULT, B_OUTCOME_PLAYER_TELEPORTED - goto_if_eq AquaHideout_B1F_EventScript_DefeatedElectrode1 + goto_if_eq VAR_RESULT, B_OUTCOME_WON, AquaHideout_B1F_EventScript_DefeatedElectrode1 + goto_if_eq VAR_RESULT, B_OUTCOME_RAN, AquaHideout_B1F_EventScript_DefeatedElectrode1 + goto_if_eq VAR_RESULT, B_OUTCOME_PLAYER_TELEPORTED, AquaHideout_B1F_EventScript_DefeatedElectrode1 setflag FLAG_DEFEATED_ELECTRODE_1_AQUA_HIDEOUT release end @@ -66,12 +62,9 @@ AquaHideout_B1F_EventScript_Electrode2:: dowildbattle clearflag FLAG_SYS_CTRL_OBJ_DELETE specialvar VAR_RESULT, GetBattleOutcome - compare VAR_RESULT, B_OUTCOME_WON - goto_if_eq AquaHideout_B1F_EventScript_DefeatedElectrode2 - compare VAR_RESULT, B_OUTCOME_RAN - goto_if_eq AquaHideout_B1F_EventScript_DefeatedElectrode2 - compare VAR_RESULT, B_OUTCOME_PLAYER_TELEPORTED - goto_if_eq AquaHideout_B1F_EventScript_DefeatedElectrode2 + goto_if_eq VAR_RESULT, B_OUTCOME_WON, AquaHideout_B1F_EventScript_DefeatedElectrode2 + goto_if_eq VAR_RESULT, B_OUTCOME_RAN, AquaHideout_B1F_EventScript_DefeatedElectrode2 + goto_if_eq VAR_RESULT, B_OUTCOME_PLAYER_TELEPORTED, AquaHideout_B1F_EventScript_DefeatedElectrode2 setflag FLAG_DEFEATED_ELECTRODE_2_AQUA_HIDEOUT release end diff --git a/data/maps/BattleFrontier_BattleArenaBattleRoom/scripts.inc b/data/maps/BattleFrontier_BattleArenaBattleRoom/scripts.inc index adea508ae6c9..844ec070a60a 100644 --- a/data/maps/BattleFrontier_BattleArenaBattleRoom/scripts.inc +++ b/data/maps/BattleFrontier_BattleArenaBattleRoom/scripts.inc @@ -28,10 +28,8 @@ BattleFrontier_BattleArenaBattleRoom_OnTransition: BattleFrontier_BattleArenaBattleRoom_EventScript_SetPlayerGfx:: checkplayergender - compare VAR_RESULT, MALE - goto_if_eq BattleFrontier_BattleArenaBattleRoom_EventScript_SetPlayerGfxMale - compare VAR_RESULT, FEMALE - goto_if_eq BattleFrontier_BattleArenaBattleRoom_EventScript_SetPlayerGfxFemale + goto_if_eq VAR_RESULT, MALE, BattleFrontier_BattleArenaBattleRoom_EventScript_SetPlayerGfxMale + goto_if_eq VAR_RESULT, FEMALE, BattleFrontier_BattleArenaBattleRoom_EventScript_SetPlayerGfxFemale return BattleFrontier_BattleArenaBattleRoom_EventScript_SetPlayerGfxMale:: @@ -52,8 +50,7 @@ BattleFrontier_BattleArenaBattleRoom_EventScript_EnterRoom:: applymovement LOCALID_PLAYER, BattleFrontier_BattleArenaBattleRoom_Movement_PlayerEnter waitmovement 0 frontier_get FRONTIER_DATA_BATTLE_NUM - compare VAR_RESULT, 0 - goto_if_eq BattleFrontier_BattleArenaBattleRoom_EventScript_AnnounceTrainers + goto_if_eq VAR_RESULT, 0, BattleFrontier_BattleArenaBattleRoom_EventScript_AnnounceTrainers applymovement LOCALID_ATTENDANT, BattleFrontier_BattleArenaBattleRoom_Movement_WalkInPlaceDown applymovement LOCALID_PLAYER, BattleFrontier_BattleArenaBattleRoom_Movement_WalkInPlaceLeft setvar VAR_TEMP_2, 1 @@ -110,7 +107,7 @@ BattleFrontier_BattleArenaBattleRoom_EventScript_DeclareOpponentWinner:: msgbox BattleFrontier_BattleArenaBattleRoom_Text_WinnerIsOpponent, MSGBOX_DEFAULT BattleFrontier_BattleArenaBattleRoom_EventScript_WarpToLobbyLost:: frontier_set FRONTIER_DATA_CHALLENGE_STATUS, CHALLENGE_STATUS_LOST - warp MAP_BATTLE_FRONTIER_BATTLE_ARENA_LOBBY, 255, 7, 8 + warp MAP_BATTLE_FRONTIER_BATTLE_ARENA_LOBBY, 7, 8 waitstate BattleFrontier_BattleArenaBattleRoom_EventScript_DefeatedOpponent:: @@ -137,24 +134,16 @@ BattleFrontier_BattleArenaBattleRoom_EventScript_DefeatedOpponent:: BattleFrontier_BattleArenaBattleRoom_EventScript_AskReadyForOpponent:: frontier_getbrainstatus copyvar VAR_TEMP_F, VAR_RESULT - compare VAR_RESULT, FRONTIER_BRAIN_NOT_READY - goto_if_ne BattleFrontier_BattleArenaBattleRoom_EventScript_TycoonUpNext + goto_if_ne VAR_RESULT, FRONTIER_BRAIN_NOT_READY, BattleFrontier_BattleArenaBattleRoom_EventScript_TycoonUpNext frontier_get FRONTIER_DATA_BATTLE_NUM - compare VAR_RESULT, 1 - call_if_eq BattleFrontier_BattleArenaBattleRoom_EventScript_ReadyFor2ndOpponent - compare VAR_RESULT, 2 - call_if_eq BattleFrontier_BattleArenaBattleRoom_EventScript_ReadyFor3rdOpponent - compare VAR_RESULT, 3 - call_if_eq BattleFrontier_BattleArenaBattleRoom_EventScript_ReadyFor4thOpponent - compare VAR_RESULT, 4 - call_if_eq BattleFrontier_BattleArenaBattleRoom_EventScript_ReadyFor5thOpponent - compare VAR_RESULT, 5 - call_if_eq BattleFrontier_BattleArenaBattleRoom_EventScript_ReadyFor6thOpponent - compare VAR_RESULT, 6 - call_if_eq BattleFrontier_BattleArenaBattleRoom_EventScript_ReadyFor7thOpponent + call_if_eq VAR_RESULT, 1, BattleFrontier_BattleArenaBattleRoom_EventScript_ReadyFor2ndOpponent + call_if_eq VAR_RESULT, 2, BattleFrontier_BattleArenaBattleRoom_EventScript_ReadyFor3rdOpponent + call_if_eq VAR_RESULT, 3, BattleFrontier_BattleArenaBattleRoom_EventScript_ReadyFor4thOpponent + call_if_eq VAR_RESULT, 4, BattleFrontier_BattleArenaBattleRoom_EventScript_ReadyFor5thOpponent + call_if_eq VAR_RESULT, 5, BattleFrontier_BattleArenaBattleRoom_EventScript_ReadyFor6thOpponent + call_if_eq VAR_RESULT, 6, BattleFrontier_BattleArenaBattleRoom_EventScript_ReadyFor7thOpponent call BattleFrontier_EventScript_GetCantRecordBattle - compare VAR_RESULT, TRUE - goto_if_eq BattleFrontier_BattleArenaBattleRoom_EventScript_AskReadyForOpponentNoRecord + goto_if_eq VAR_RESULT, TRUE, BattleFrontier_BattleArenaBattleRoom_EventScript_AskReadyForOpponentNoRecord multichoice 19, 4, MULTI_GO_ON_RECORD_REST_RETIRE, TRUE switch VAR_RESULT case 0, BattleFrontier_BattleArenaBattleRoom_EventScript_ContinueChallenge @@ -210,7 +199,7 @@ BattleFrontier_BattleArenaBattleRoom_EventScript_ContinueChallenge:: BattleFrontier_BattleArenaBattleRoom_EventScript_ReturnToLobbyWon:: delay 60 frontier_set FRONTIER_DATA_CHALLENGE_STATUS, CHALLENGE_STATUS_WON - warp MAP_BATTLE_FRONTIER_BATTLE_ARENA_LOBBY, 255, 7, 8 + warp MAP_BATTLE_FRONTIER_BATTLE_ARENA_LOBBY, 7, 8 waitstate BattleFrontier_BattleArenaBattleRoom_EventScript_ReadyFor2ndOpponent:: @@ -254,16 +243,14 @@ BattleFrontier_BattleArenaBattleRoom_EventScript_PauseChallenge:: end BattleFrontier_BattleArenaBattleRoom_EventScript_TycoonUpNext:: - compare VAR_TEMP_2, 1 - goto_if_eq BattleFrontier_BattleArenaBattleRoom_EventScript_AskReadyForTycoon + goto_if_eq VAR_TEMP_2, 1, BattleFrontier_BattleArenaBattleRoom_EventScript_AskReadyForTycoon msgbox BattleFrontier_BattleArenaBattleRoom_Text_NowFaceTycoon, MSGBOX_DEFAULT setvar VAR_TEMP_2, 1 BattleFrontier_BattleArenaBattleRoom_EventScript_AskReadyForTycoon:: message BattleFrontier_BattleArenaBattleRoom_Text_PreparedForTycoon waitmessage call BattleFrontier_EventScript_GetCantRecordBattle - compare VAR_RESULT, TRUE - goto_if_eq BattleFrontier_BattleArenaBattleRoom_EventScript_AskReadyForTycoonNoRecord + goto_if_eq VAR_RESULT, TRUE, BattleFrontier_BattleArenaBattleRoom_EventScript_AskReadyForTycoonNoRecord multichoice 19, 4, MULTI_GO_ON_RECORD_REST_RETIRE, TRUE switch VAR_RESULT case 0, BattleFrontier_BattleArenaBattleRoom_EventScript_BattleGreta @@ -309,8 +296,7 @@ BattleFrontier_BattleArenaBattleRoom_EventScript_BattleGreta:: case FRONTIER_BRAIN_STREAK, BattleFrontier_BattleArenaBattleRoom_EventScript_BattleGretaSilver case FRONTIER_BRAIN_STREAK_LONG, BattleFrontier_BattleArenaBattleRoom_EventScript_BattleGretaGold frontier_get FRONTIER_DATA_HEARD_BRAIN_SPEECH - compare VAR_RESULT, FALSE - goto_if_ne BattleFrontier_BattleArenaBattleRoom_EventScript_BattleGretaSilver + goto_if_ne VAR_RESULT, FALSE, BattleFrontier_BattleArenaBattleRoom_EventScript_BattleGretaSilver msgbox BattleFrontier_BattleArenaBattleRoom_Text_GretaYoureChallenger, MSGBOX_DEFAULT closemessage frontier_set FRONTIER_DATA_HEARD_BRAIN_SPEECH @@ -324,15 +310,13 @@ BattleFrontier_BattleArenaBattleRoom_EventScript_BattleGreta:: BattleFrontier_BattleArenaBattleRoom_EventScript_BattleGretaSilver:: msgbox BattleFrontier_BattleArenaBattleRoom_Text_IgniteMyPassionForBattle, MSGBOX_DEFAULT call BattleFrontier_BattleArenaBattleRoom_EventScript_StartArenaBattle - compare VAR_RESULT, 1 - goto_if_eq BattleFrontier_BattleArenaBattleRoom_EventScript_DefeatedGretaSilver + goto_if_eq VAR_RESULT, 1, BattleFrontier_BattleArenaBattleRoom_EventScript_DefeatedGretaSilver goto BattleFrontier_BattleArenaBattleRoom_EventScript_DeclareOpponentWinner BattleFrontier_BattleArenaBattleRoom_EventScript_DefeatedGretaSilver:: call BattleFrontier_BattleArenaBattleRoom_EventScript_DeclarePlayerWinner frontier_getsymbols - compare VAR_RESULT, 0 - goto_if_ne BattleFrontier_BattleArenaBattleRoom_EventScript_ReturnToLobbyWon + goto_if_ne VAR_RESULT, 0, BattleFrontier_BattleArenaBattleRoom_EventScript_ReturnToLobbyWon applymovement LOCALID_OPPONENT, BattleFrontier_BattleArenaBattleRoom_Movement_OpponentStepForwardLong waitmovement 0 msgbox BattleFrontier_BattleArenaBattleRoom_Text_GretaYoureToughAfterAll, MSGBOX_DEFAULT @@ -346,8 +330,7 @@ BattleFrontier_BattleArenaBattleRoom_EventScript_DefeatedGretaSilver:: BattleFrontier_BattleArenaBattleRoom_EventScript_IntroGretaGold:: frontier_get FRONTIER_DATA_HEARD_BRAIN_SPEECH - compare VAR_RESULT, FALSE - goto_if_ne BattleFrontier_BattleArenaBattleRoom_EventScript_BattleGretaGold + goto_if_ne VAR_RESULT, FALSE, BattleFrontier_BattleArenaBattleRoom_EventScript_BattleGretaGold msgbox BattleFrontier_BattleArenaBattleRoom_Text_GretaLookingForwardToSeeingAgain, MSGBOX_DEFAULT closemessage frontier_set FRONTIER_DATA_HEARD_BRAIN_SPEECH @@ -361,15 +344,13 @@ BattleFrontier_BattleArenaBattleRoom_EventScript_IntroGretaGold:: BattleFrontier_BattleArenaBattleRoom_EventScript_BattleGretaGold:: msgbox BattleFrontier_BattleArenaBattleRoom_Text_LetsGetThisStarted, MSGBOX_DEFAULT call BattleFrontier_BattleArenaBattleRoom_EventScript_StartArenaBattle - compare VAR_RESULT, 1 - goto_if_eq BattleFrontier_BattleArenaBattleRoom_EventScript_DefeatedGretaGold + goto_if_eq VAR_RESULT, 1, BattleFrontier_BattleArenaBattleRoom_EventScript_DefeatedGretaGold goto BattleFrontier_BattleArenaBattleRoom_EventScript_DeclareOpponentWinner BattleFrontier_BattleArenaBattleRoom_EventScript_DefeatedGretaGold:: call BattleFrontier_BattleArenaBattleRoom_EventScript_DeclarePlayerWinner frontier_getsymbols - compare VAR_RESULT, 2 - goto_if_eq BattleFrontier_BattleArenaBattleRoom_EventScript_ReturnToLobbyWon + goto_if_eq VAR_RESULT, 2, BattleFrontier_BattleArenaBattleRoom_EventScript_ReturnToLobbyWon applymovement LOCALID_OPPONENT, BattleFrontier_BattleArenaBattleRoom_Movement_OpponentStepForwardLong waitmovement 0 msgbox BattleFrontier_BattleArenaBattleRoom_Text_GretaBlownAway, MSGBOX_DEFAULT diff --git a/data/maps/BattleFrontier_BattleArenaCorridor/scripts.inc b/data/maps/BattleFrontier_BattleArenaCorridor/scripts.inc index 1752b934211b..7086819569b9 100644 --- a/data/maps/BattleFrontier_BattleArenaCorridor/scripts.inc +++ b/data/maps/BattleFrontier_BattleArenaCorridor/scripts.inc @@ -22,7 +22,7 @@ BattleFrontier_BattleArenaCorridor_EventScript_WalkToBattleRoom:: applymovement OBJ_EVENT_ID_PLAYER, BattleFrontier_BattleArenaCorridor_Movement_PlayerEnterDoor waitmovement 0 setvar VAR_0x8006, 0 - warp MAP_BATTLE_FRONTIER_BATTLE_ARENA_BATTLE_ROOM, 255, 7, 5 + warp MAP_BATTLE_FRONTIER_BATTLE_ARENA_BATTLE_ROOM, 7, 5 waitstate end diff --git a/data/maps/BattleFrontier_BattleArenaLobby/scripts.inc b/data/maps/BattleFrontier_BattleArenaLobby/scripts.inc index 12b600f69b87..9467f34197a6 100644 --- a/data/maps/BattleFrontier_BattleArenaLobby/scripts.inc +++ b/data/maps/BattleFrontier_BattleArenaLobby/scripts.inc @@ -40,8 +40,7 @@ BattleFrontier_BattleArenaLobby_EventScript_QuitWithoutSaving:: BattleFrontier_BattleArenaLobby_EventScript_WonChallenge:: lockall frontier_isbrain - compare VAR_RESULT, TRUE - goto_if_eq BattleFrontier_BattleArenaLobby_EventScript_DefeatedTycoon + goto_if_eq VAR_RESULT, TRUE, BattleFrontier_BattleArenaLobby_EventScript_DefeatedTycoon msgbox BattleFrontier_BattleArenaLobby_Text_CongratsOnSevenWins, MSGBOX_DEFAULT goto BattleFrontier_BattleArenaLobby_EventScript_GiveBattlePoints @@ -80,8 +79,7 @@ BattleFrontier_BattleArenaLobby_EventScript_SaveAfterChallenge:: playse SE_SAVE waitse call BattleFrontier_EventScript_GetCantRecordBattle - compare VAR_RESULT, TRUE - goto_if_eq BattleFrontier_BattleArenaLobby_EventScript_EndSaveAfterChallenge + goto_if_eq VAR_RESULT, TRUE, BattleFrontier_BattleArenaLobby_EventScript_EndSaveAfterChallenge message BattleFrontier_BattleArenaLobby_Text_RecordLastMatch waitmessage multichoicedefault 20, 8, MULTI_YESNO, 1, FALSE @@ -131,8 +129,7 @@ BattleFrontier_BattleArenaLobby_EventScript_TryEnterChallenge:: case FRONTIER_LVL_TENT, BattleFrontier_BattleArenaLobby_EventScript_CancelChallenge case MULTI_B_PRESSED, BattleFrontier_BattleArenaLobby_EventScript_CancelChallenge frontier_checkineligible - compare VAR_0x8004, TRUE - goto_if_eq BattleFrontier_BattleArenaLobby_EventScript_NotEnoughValidMons + goto_if_eq VAR_0x8004, TRUE, BattleFrontier_BattleArenaLobby_EventScript_NotEnoughValidMons frontier_set FRONTIER_DATA_LVL_MODE, VAR_RESULT msgbox BattleFrontier_BattleArenaLobby_Text_SelectThreeMons, MSGBOX_DEFAULT fadescreen FADE_TO_BLACK @@ -141,8 +138,7 @@ BattleFrontier_BattleArenaLobby_EventScript_TryEnterChallenge:: setvar VAR_0x8005, FRONTIER_PARTY_SIZE special ChoosePartyForBattleFrontier waitstate - compare VAR_RESULT, 0 - goto_if_eq BattleFrontier_BattleArenaLobby_EventScript_LoadPartyAndCancelChallenge + goto_if_eq VAR_RESULT, 0, BattleFrontier_BattleArenaLobby_EventScript_LoadPartyAndCancelChallenge msgbox BattleFrontier_BattleArenaLobby_Text_OkayToSave, MSGBOX_YESNO switch VAR_RESULT case NO, BattleFrontier_BattleArenaLobby_EventScript_LoadPartyAndCancelChallenge @@ -161,19 +157,16 @@ BattleFrontier_BattleArenaLobby_EventScript_SaveBeforeChallenge:: delay 2 call Common_EventScript_SaveGame setvar VAR_TEMP_0, 255 - compare VAR_RESULT, 0 - goto_if_eq BattleFrontier_BattleArenaLobby_EventScript_CancelChallengeSaveFailed + goto_if_eq VAR_RESULT, 0, BattleFrontier_BattleArenaLobby_EventScript_CancelChallengeSaveFailed BattleFrontier_BattleArenaLobby_EventScript_EnterChallenge:: special SavePlayerParty frontier_setpartyorder FRONTIER_PARTY_SIZE msgbox BattleFrontier_BattleArenaLobby_Text_GuideYouToArena, MSGBOX_DEFAULT closemessage frontier_get FRONTIER_DATA_LVL_MODE - compare VAR_RESULT, FRONTIER_LVL_50 - call_if_eq BattleFrontier_BattleArenaLobby_EventScript_WalkToDoorLv50 - compare VAR_RESULT, FRONTIER_LVL_OPEN - call_if_eq BattleFrontier_BattleArenaLobby_EventScript_WalkToDoorLvOpen - warp MAP_BATTLE_FRONTIER_BATTLE_ARENA_CORRIDOR, 255, 9, 13 + call_if_eq VAR_RESULT, FRONTIER_LVL_50, BattleFrontier_BattleArenaLobby_EventScript_WalkToDoorLv50 + call_if_eq VAR_RESULT, FRONTIER_LVL_OPEN, BattleFrontier_BattleArenaLobby_EventScript_WalkToDoorLvOpen + warp MAP_BATTLE_FRONTIER_BATTLE_ARENA_CORRIDOR, 9, 13 setvar VAR_TEMP_0, 0 waitstate end diff --git a/data/maps/BattleFrontier_BattleDomeBattleRoom/scripts.inc b/data/maps/BattleFrontier_BattleDomeBattleRoom/scripts.inc index 76088f54d198..406ab46aecf7 100644 --- a/data/maps/BattleFrontier_BattleDomeBattleRoom/scripts.inc +++ b/data/maps/BattleFrontier_BattleDomeBattleRoom/scripts.inc @@ -20,17 +20,14 @@ BattleFrontier_BattleDomeBattleRoom_OnTransition: dome_setopponentgfx frontier_get FRONTIER_DATA_BATTLE_NUM copyvar VAR_TEMP_F, VAR_RESULT - compare VAR_RESULT, DOME_ROUND1 - call_if_eq BattleFrontier_BattleDomeBattleRoom_EventScript_SetWalkingAudienceMemberPos + call_if_eq VAR_RESULT, DOME_ROUND1, BattleFrontier_BattleDomeBattleRoom_EventScript_SetWalkingAudienceMemberPos call BattleFrontier_BattleDomeBattleRoom_EventScript_SetPlayerGfx end BattleFrontier_BattleDomeBattleRoom_EventScript_SetPlayerGfx:: checkplayergender - compare VAR_RESULT, MALE - goto_if_eq BattleFrontier_BattleDomeBattleRoom_EventScript_SetPlayerGfxMale - compare VAR_RESULT, FEMALE - goto_if_eq BattleFrontier_BattleDomeBattleRoom_EventScript_SetPlayerGfxFemale + goto_if_eq VAR_RESULT, MALE, BattleFrontier_BattleDomeBattleRoom_EventScript_SetPlayerGfxMale + goto_if_eq VAR_RESULT, FEMALE, BattleFrontier_BattleDomeBattleRoom_EventScript_SetPlayerGfxFemale return BattleFrontier_BattleDomeBattleRoom_EventScript_SetPlayerGfxMale:: @@ -48,18 +45,15 @@ BattleFrontier_BattleDomeBattleRoom_OnFrame: BattleFrontier_BattleDomeBattleRoom_EventScript_EnterRoom:: lockall call BattleFrontier_BattleDomeBattleRoom_EventScript_GetRoundNum - compare VAR_RESULT, DOME_ROUND1 - call_if_eq BattleFrontier_BattleDomeBattleRoom_EventScript_TryDoAudienceMemberWalkToSeat + call_if_eq VAR_RESULT, DOME_ROUND1, BattleFrontier_BattleDomeBattleRoom_EventScript_TryDoAudienceMemberWalkToSeat applymovement LOCALID_ANNOUNCER, Common_Movement_WalkInPlaceDown waitmovement 0 call BattleFrontier_BattleDomeBattleRoom_EventScript_AnnouncePlayer msgbox BattleFrontier_BattleDomeBattleRoom_Text_PlayerHasEnteredDome, MSGBOX_DEFAULT closemessage showobjectat LOCALID_PLAYER, MAP_BATTLE_FRONTIER_BATTLE_DOME_BATTLE_ROOM - compare VAR_TEMP_F, DOME_FINAL - goto_if_ne BattleFrontier_BattleDomeBattleRoom_EventScript_PlayerEnter - compare VAR_TEMP_E, FRONTIER_BRAIN_NOT_READY - goto_if_ne BattleFrontier_BattleDomeBattleRoom_EventScript_PlayerEnterForTucker + goto_if_ne VAR_TEMP_F, DOME_FINAL, BattleFrontier_BattleDomeBattleRoom_EventScript_PlayerEnter + goto_if_ne VAR_TEMP_E, FRONTIER_BRAIN_NOT_READY, BattleFrontier_BattleDomeBattleRoom_EventScript_PlayerEnterForTucker BattleFrontier_BattleDomeBattleRoom_EventScript_PlayerEnter:: applymovement LOCALID_PLAYER, BattleFrontier_BattleDomeBattleRoom_Movement_PlayerEnter goto BattleFrontier_BattleDomeBattleRoom_EventScript_AudienceReactToPlayer @@ -70,10 +64,8 @@ BattleFrontier_BattleDomeBattleRoom_EventScript_AudienceReactToPlayer:: playse SE_M_ENCORE2 call BattleFrontier_BattleDomeBattleRoom_EventScript_AudienceLookAround waitmovement 0 - compare VAR_TEMP_F, DOME_FINAL - goto_if_ne BattleFrontier_BattleDomeBattleRoom_EventScript_BattleOpponent - compare VAR_TEMP_E, FRONTIER_BRAIN_NOT_READY - goto_if_ne BattleFrontier_BattleDomeBattleRoom_EventScript_AnnounceTucker + goto_if_ne VAR_TEMP_F, DOME_FINAL, BattleFrontier_BattleDomeBattleRoom_EventScript_BattleOpponent + goto_if_ne VAR_TEMP_E, FRONTIER_BRAIN_NOT_READY, BattleFrontier_BattleDomeBattleRoom_EventScript_AnnounceTucker BattleFrontier_BattleDomeBattleRoom_EventScript_BattleOpponent:: dome_getopponentname msgbox BattleFrontier_BattleDomeBattleRoom_Text_PlayerVersusTrainer, MSGBOX_DEFAULT @@ -105,8 +97,7 @@ BattleFrontier_BattleDomeBattleRoom_EventScript_Draw:: delay 180 applymovement LOCALID_REFEREE, BattleFrontier_BattleDomeBattleRoom_Movement_RefereeExit waitmovement 0 - compare VAR_TEMP_2, DRAW_TUCKER @ Tucker always wins on a draw - goto_if_eq BattleFrontier_BattleDomeBattleRoom_EventScript_LostToOpponent + goto_if_eq VAR_TEMP_2, DRAW_TUCKER, BattleFrontier_BattleDomeBattleRoom_EventScript_LostToOpponent @ Tucker always wins on a draw dome_compareseeds switch VAR_RESULT case 1, BattleFrontier_BattleDomeBattleRoom_EventScript_DefeatedOpponent @@ -114,12 +105,9 @@ BattleFrontier_BattleDomeBattleRoom_EventScript_LostToOpponent:: applymovement LOCALID_ANNOUNCER, Common_Movement_WalkInPlaceDown waitmovement 0 dome_getopponentname - compare VAR_TEMP_2, NO_DRAW - call_if_eq BattleFrontier_BattleDomeBattleRoom_EventScript_OpponentWon - compare VAR_TEMP_2, DRAW_TRAINER - call_if_eq BattleFrontier_BattleDomeBattleRoom_EventScript_OpponentWonDraw - compare VAR_TEMP_2, DRAW_TUCKER - call_if_eq BattleFrontier_BattleDomeBattleRoom_EventScript_TuckerWonDraw + call_if_eq VAR_TEMP_2, NO_DRAW, BattleFrontier_BattleDomeBattleRoom_EventScript_OpponentWon + call_if_eq VAR_TEMP_2, DRAW_TRAINER, BattleFrontier_BattleDomeBattleRoom_EventScript_OpponentWonDraw + call_if_eq VAR_TEMP_2, DRAW_TUCKER, BattleFrontier_BattleDomeBattleRoom_EventScript_TuckerWonDraw playse SE_M_ENCORE2 call BattleFrontier_BattleDomeBattleRoom_EventScript_AudienceLookAround delay 60 @@ -130,13 +118,13 @@ BattleFrontier_BattleDomeBattleRoom_EventScript_WarpToLobbyLost:: goto BattleFrontier_BattleDomeBattleRoom_EventScript_WarpToLobby BattleFrontier_BattleDomeBattleRoom_EventScript_OpponentWon:: - frontier_gettrainername 1 + frontier_gettrainername STR_VAR_2 message BattleFrontier_BattleDomeBattleRoom_Text_TrainerIsWinner waitmessage return BattleFrontier_BattleDomeBattleRoom_EventScript_OpponentWonDraw:: - frontier_gettrainername 0 + frontier_gettrainername STR_VAR_1 message BattleFrontier_BattleDomeBattleRoom_Text_RefereesDecidedWinnerTrainer waitmessage return @@ -149,10 +137,8 @@ BattleFrontier_BattleDomeBattleRoom_EventScript_TuckerWonDraw:: BattleFrontier_BattleDomeBattleRoom_EventScript_DefeatedOpponent:: applymovement LOCALID_ANNOUNCER, Common_Movement_WalkInPlaceDown waitmovement 0 - compare VAR_TEMP_2, NO_DRAW - call_if_eq BattleFrontier_BattleDomeBattleRoom_EventScript_PlayerWon - compare VAR_TEMP_2, DRAW_TRAINER - call_if_eq BattleFrontier_BattleDomeBattleRoom_EventScript_PlayerWonDraw + call_if_eq VAR_TEMP_2, NO_DRAW, BattleFrontier_BattleDomeBattleRoom_EventScript_PlayerWon + call_if_eq VAR_TEMP_2, DRAW_TRAINER, BattleFrontier_BattleDomeBattleRoom_EventScript_PlayerWonDraw playse SE_M_ENCORE2 call BattleFrontier_BattleDomeBattleRoom_EventScript_AudienceLookAround delay 60 @@ -164,7 +150,7 @@ BattleFrontier_BattleDomeBattleRoom_EventScript_DefeatedOpponent:: switch VAR_RESULT case DOME_ROUNDS_COUNT, BattleFrontier_BattleDomeBattleRoom_EventScript_WonTourney setvar VAR_0x8006, 1 - warp MAP_BATTLE_FRONTIER_BATTLE_DOME_PRE_BATTLE_ROOM, 255, 5, 3 + warp MAP_BATTLE_FRONTIER_BATTLE_DOME_PRE_BATTLE_ROOM, 5, 3 waitstate BattleFrontier_BattleDomeBattleRoom_EventScript_WonTourney:: @@ -196,14 +182,11 @@ BattleFrontier_BattleDomeBattleRoom_EventScript_PlayerWonDraw:: BattleFrontier_BattleDomeBattleRoom_EventScript_AnnouncePlayer:: dome_get DOME_DATA_ATTEMPTED_CHALLENGE - compare VAR_RESULT, FALSE - goto_if_eq BattleFrontier_BattleDomeBattleRoom_EventScript_AnnouncePlayerFirstAttempt + goto_if_eq VAR_RESULT, FALSE, BattleFrontier_BattleDomeBattleRoom_EventScript_AnnouncePlayerFirstAttempt dome_get DOME_DATA_HAS_WON_CHALLENGE - compare VAR_RESULT, FALSE - goto_if_eq BattleFrontier_BattleDomeBattleRoom_EventScript_AnnouncePlayerNeverWon + goto_if_eq VAR_RESULT, FALSE, BattleFrontier_BattleDomeBattleRoom_EventScript_AnnouncePlayerNeverWon dome_get DOME_DATA_WIN_STREAK_ACTIVE - compare VAR_RESULT, FALSE - goto_if_eq BattleFrontier_BattleDomeBattleRoom_EventScript_AnnouncePlayerBrokenStreak + goto_if_eq VAR_RESULT, FALSE, BattleFrontier_BattleDomeBattleRoom_EventScript_AnnouncePlayerBrokenStreak goto BattleFrontier_BattleDomeBattleRoom_EventScript_AnnouncePlayerChampion return @@ -266,8 +249,7 @@ BattleFrontier_BattleDomeBattleRoom_EventScript_AnnouncePlayerNeverWonFinal:: return BattleFrontier_BattleDomeBattleRoom_EventScript_AnnouncePlayerChampion:: - compare VAR_TEMP_F, DOME_FINAL - goto_if_ne BattleFrontier_BattleDomeBattleRoom_EventScript_AnnouncePlayerChampionNoTucker + goto_if_ne VAR_TEMP_F, DOME_FINAL, BattleFrontier_BattleDomeBattleRoom_EventScript_AnnouncePlayerChampionNoTucker switch VAR_TEMP_E case FRONTIER_BRAIN_SILVER, BattleFrontier_BattleDomeBattleRoom_EventScript_AnnouncePlayerPreTuckerSilver case FRONTIER_BRAIN_GOLD, BattleFrontier_BattleDomeBattleRoom_EventScript_AnnouncePlayerPreTuckerGold @@ -387,8 +369,7 @@ BattleFrontier_BattleDomeBattleRoom_EventScript_TuckerEnter:: case FRONTIER_BRAIN_STREAK, BattleFrontier_BattleDomeBattleRoom_EventScript_BattleTuckerSilver case FRONTIER_BRAIN_STREAK_LONG, BattleFrontier_BattleDomeBattleRoom_EventScript_BattleTuckerGold frontier_get FRONTIER_DATA_HEARD_BRAIN_SPEECH - compare VAR_RESULT, FALSE - goto_if_ne BattleFrontier_BattleDomeBattleRoom_EventScript_BattleTuckerSilver + goto_if_ne VAR_RESULT, FALSE, BattleFrontier_BattleDomeBattleRoom_EventScript_BattleTuckerSilver msgbox BattleFrontier_BattleDomeBattleRoom_Text_TuckerSilverIntro, MSGBOX_DEFAULT frontier_set FRONTIER_DATA_HEARD_BRAIN_SPEECH BattleFrontier_BattleDomeBattleRoom_EventScript_BattleTuckerSilver:: @@ -401,8 +382,7 @@ BattleFrontier_BattleDomeBattleRoom_EventScript_BattleTuckerSilver:: msgbox BattleFrontier_BattleDomeBattleRoom_Text_IncredibleVictorIsPlayer, MSGBOX_DEFAULT dome_resolvewinners DOME_PLAYER_WON_MATCH frontier_getsymbols - compare VAR_RESULT, 0 - goto_if_ne BattleFrontier_BattleDomeBattleRoom_EventScript_WonTourney + goto_if_ne VAR_RESULT, 0, BattleFrontier_BattleDomeBattleRoom_EventScript_WonTourney closemessage applymovement LOCALID_OPPONENT, BattleFrontier_BattleDomeBattleRoom_Movement_TuckerApproachPlayer waitmovement 0 @@ -417,8 +397,7 @@ BattleFrontier_BattleDomeBattleRoom_EventScript_BattleTuckerSilver:: BattleFrontier_BattleDomeBattleRoom_EventScript_TuckerGoldIntro:: frontier_get FRONTIER_DATA_HEARD_BRAIN_SPEECH - compare VAR_RESULT, FALSE - goto_if_ne BattleFrontier_BattleDomeBattleRoom_EventScript_BattleTuckerGold + goto_if_ne VAR_RESULT, FALSE, BattleFrontier_BattleDomeBattleRoom_EventScript_BattleTuckerGold msgbox BattleFrontier_BattleDomeBattleRoom_Text_TuckerGoldIntro, MSGBOX_DEFAULT frontier_set FRONTIER_DATA_HEARD_BRAIN_SPEECH BattleFrontier_BattleDomeBattleRoom_EventScript_BattleTuckerGold:: @@ -431,8 +410,7 @@ BattleFrontier_BattleDomeBattleRoom_EventScript_BattleTuckerGold:: msgbox BattleFrontier_BattleDomeBattleRoom_Text_IncredibleVictorIsPlayer, MSGBOX_DEFAULT dome_resolvewinners DOME_PLAYER_WON_MATCH frontier_getsymbols - compare VAR_RESULT, 2 - goto_if_eq BattleFrontier_BattleDomeBattleRoom_EventScript_WonTourney + goto_if_eq VAR_RESULT, 2, BattleFrontier_BattleDomeBattleRoom_EventScript_WonTourney closemessage applymovement LOCALID_OPPONENT, BattleFrontier_BattleDomeBattleRoom_Movement_TuckerApproachPlayer waitmovement 0 @@ -490,12 +468,10 @@ BattleFrontier_BattleDomeBattleRoom_EventScript_SetUpObjects:: setvar VAR_TEMP_1, 1 applymovement OBJ_EVENT_ID_PLAYER, BattleFrontier_BattleDomeBattleRoom_Movement_SetInvisible frontier_get FRONTIER_DATA_BATTLE_NUM - compare VAR_RESULT, DOME_FINAL - goto_if_ne BattleFrontier_BattleDomeBattleRoom_EventScript_EndSetUpObjects + goto_if_ne VAR_RESULT, DOME_FINAL, BattleFrontier_BattleDomeBattleRoom_EventScript_EndSetUpObjects frontier_getbrainstatus copyvar VAR_TEMP_E, VAR_RESULT - compare VAR_RESULT, FRONTIER_BRAIN_NOT_READY - goto_if_eq BattleFrontier_BattleDomeBattleRoom_EventScript_EndSetUpObjects + goto_if_eq VAR_RESULT, FRONTIER_BRAIN_NOT_READY, BattleFrontier_BattleDomeBattleRoom_EventScript_EndSetUpObjects call BattleFrontier_EventScript_SetBrainObjectGfx setobjectxyperm LOCALID_OPPONENT, 13, 9 removeobject LOCALID_OPPONENT @@ -505,8 +481,7 @@ BattleFrontier_BattleDomeBattleRoom_EventScript_EndSetUpObjects:: end BattleFrontier_BattleDomeBattleRoom_OnResume: - compare VAR_TEMP_9, 1 - call_if_eq BattleFrontier_BattleDomeBattleRoom_EventScript_CallAddAudience + call_if_eq VAR_TEMP_9, 1, BattleFrontier_BattleDomeBattleRoom_EventScript_CallAddAudience end BattleFrontier_BattleDomeBattleRoom_EventScript_CallAddAudience:: @@ -515,90 +490,86 @@ BattleFrontier_BattleDomeBattleRoom_EventScript_CallAddAudience:: @ Add audience members to supplement the permanent object event audience BattleFrontier_BattleDomeBattleRoom_EventScript_AddAudience:: - compare VAR_TEMP_F, DOME_ROUND1 - call_if_eq BattleFrontier_BattleDomeBattleRoom_EventScript_AddRound1Audience - compare VAR_TEMP_F, DOME_ROUND2 - call_if_eq BattleFrontier_BattleDomeBattleRoom_EventScript_AddRound2Audience - compare VAR_TEMP_F, DOME_SEMIFINAL - call_if_eq BattleFrontier_BattleDomeBattleRoom_EventScript_AddSemifinalAudience - compare VAR_TEMP_F, DOME_FINAL - call_if_eq BattleFrontier_BattleDomeBattleRoom_EventScript_AddFinalAudience + call_if_eq VAR_TEMP_F, DOME_ROUND1, BattleFrontier_BattleDomeBattleRoom_EventScript_AddRound1Audience + call_if_eq VAR_TEMP_F, DOME_ROUND2, BattleFrontier_BattleDomeBattleRoom_EventScript_AddRound2Audience + call_if_eq VAR_TEMP_F, DOME_SEMIFINAL, BattleFrontier_BattleDomeBattleRoom_EventScript_AddSemifinalAudience + call_if_eq VAR_TEMP_F, DOME_FINAL, BattleFrontier_BattleDomeBattleRoom_EventScript_AddFinalAudience return BattleFrontier_BattleDomeBattleRoom_EventScript_AddRound1Audience:: return BattleFrontier_BattleDomeBattleRoom_EventScript_AddRound2Audience:: - createvobject OBJ_EVENT_GFX_SCIENTIST_1, 1, 3, 0, 3, DIR_SOUTH - createvobject OBJ_EVENT_GFX_EXPERT_F, 4, 6, 0, 3, DIR_SOUTH - createvobject OBJ_EVENT_GFX_NINJA_BOY, 6, 8, 0, 3, DIR_SOUTH - createvobject OBJ_EVENT_GFX_LITTLE_GIRL, 9, 11, 0, 3, DIR_SOUTH - createvobject OBJ_EVENT_GFX_SCIENTIST_1, 11, 13, 0, 3, DIR_SOUTH - createvobject OBJ_EVENT_GFX_MAN_5, 13, 15, 0, 3, DIR_SOUTH - createvobject OBJ_EVENT_GFX_BEAUTY, 19, 7, 1, 3, DIR_SOUTH - createvobject OBJ_EVENT_GFX_WOMAN_5, 22, 11, 1, 3, DIR_SOUTH - createvobject OBJ_EVENT_GFX_LITTLE_BOY, 25, 15, 1, 3, DIR_SOUTH - createvobject OBJ_EVENT_GFX_YOUNGSTER, 26, 2, 2, 3, DIR_SOUTH - createvobject OBJ_EVENT_GFX_SCHOOL_KID_M, 29, 5, 1, 3, DIR_SOUTH + createvobject OBJ_EVENT_GFX_SCIENTIST_1, 1, 3, 0 + createvobject OBJ_EVENT_GFX_EXPERT_F, 4, 6, 0 + createvobject OBJ_EVENT_GFX_NINJA_BOY, 6, 8, 0 + createvobject OBJ_EVENT_GFX_LITTLE_GIRL, 9, 11, 0 + createvobject OBJ_EVENT_GFX_SCIENTIST_1, 11, 13, 0 + createvobject OBJ_EVENT_GFX_MAN_5, 13, 15, 0 + createvobject OBJ_EVENT_GFX_BEAUTY, 19, 7, 1 + createvobject OBJ_EVENT_GFX_WOMAN_5, 22, 11, 1 + createvobject OBJ_EVENT_GFX_LITTLE_BOY, 25, 15, 1 + createvobject OBJ_EVENT_GFX_YOUNGSTER, 26, 2, 2 + createvobject OBJ_EVENT_GFX_SCHOOL_KID_M, 29, 5, 1 return BattleFrontier_BattleDomeBattleRoom_EventScript_AddSemifinalAudience:: - createvobject OBJ_EVENT_GFX_SCIENTIST_1, 1, 3, 0, 3, DIR_SOUTH - createvobject OBJ_EVENT_GFX_EXPERT_F, 4, 6, 0, 3, DIR_SOUTH - createvobject OBJ_EVENT_GFX_NINJA_BOY, 6, 8, 0, 3, DIR_SOUTH - createvobject OBJ_EVENT_GFX_WOMAN_2, 7, 9, 0, 3, DIR_SOUTH - createvobject OBJ_EVENT_GFX_LITTLE_GIRL, 9, 11, 0, 3, DIR_SOUTH - createvobject OBJ_EVENT_GFX_LASS, 10, 12, 0, 3, DIR_SOUTH - createvobject OBJ_EVENT_GFX_SCIENTIST_1, 11, 13, 0, 3, DIR_SOUTH - createvobject OBJ_EVENT_GFX_MAN_5, 13, 15, 0, 3, DIR_SOUTH - createvobject OBJ_EVENT_GFX_GENTLEMAN, 15, 2, 1, 3, DIR_SOUTH - createvobject OBJ_EVENT_GFX_NINJA_BOY, 16, 3, 1, 3, DIR_SOUTH - createvobject OBJ_EVENT_GFX_WOMAN_2, 17, 4, 1, 3, DIR_SOUTH - createvobject OBJ_EVENT_GFX_BEAUTY, 19, 7, 1, 3, DIR_SOUTH - createvobject OBJ_EVENT_GFX_EXPERT_F, 20, 9, 1, 3, DIR_SOUTH - createvobject OBJ_EVENT_GFX_WOMAN_5, 22, 11, 1, 3, DIR_SOUTH - createvobject OBJ_EVENT_GFX_SCIENTIST_1, 23, 13, 1, 3, DIR_SOUTH - createvobject OBJ_EVENT_GFX_LITTLE_BOY, 25, 15, 1, 3, DIR_SOUTH - createvobject OBJ_EVENT_GFX_YOUNGSTER, 26, 2, 2, 3, DIR_SOUTH - createvobject OBJ_EVENT_GFX_HEX_MANIAC, 28, 5, 2, 3, DIR_SOUTH - createvobject OBJ_EVENT_GFX_SCHOOL_KID_M, 29, 5, 1, 3, DIR_SOUTH - createvobject OBJ_EVENT_GFX_MART_EMPLOYEE, 30, 6, 2, 3, DIR_SOUTH - createvobject OBJ_EVENT_GFX_WOMAN_5, 31, 8, 2, 3, DIR_SOUTH + createvobject OBJ_EVENT_GFX_SCIENTIST_1, 1, 3, 0 + createvobject OBJ_EVENT_GFX_EXPERT_F, 4, 6, 0 + createvobject OBJ_EVENT_GFX_NINJA_BOY, 6, 8, 0 + createvobject OBJ_EVENT_GFX_WOMAN_2, 7, 9, 0 + createvobject OBJ_EVENT_GFX_LITTLE_GIRL, 9, 11, 0 + createvobject OBJ_EVENT_GFX_LASS, 10, 12, 0 + createvobject OBJ_EVENT_GFX_SCIENTIST_1, 11, 13, 0 + createvobject OBJ_EVENT_GFX_MAN_5, 13, 15, 0 + createvobject OBJ_EVENT_GFX_GENTLEMAN, 15, 2, 1 + createvobject OBJ_EVENT_GFX_NINJA_BOY, 16, 3, 1 + createvobject OBJ_EVENT_GFX_WOMAN_2, 17, 4, 1 + createvobject OBJ_EVENT_GFX_BEAUTY, 19, 7, 1 + createvobject OBJ_EVENT_GFX_EXPERT_F, 20, 9, 1 + createvobject OBJ_EVENT_GFX_WOMAN_5, 22, 11, 1 + createvobject OBJ_EVENT_GFX_SCIENTIST_1, 23, 13, 1 + createvobject OBJ_EVENT_GFX_LITTLE_BOY, 25, 15, 1 + createvobject OBJ_EVENT_GFX_YOUNGSTER, 26, 2, 2 + createvobject OBJ_EVENT_GFX_HEX_MANIAC, 28, 5, 2 + createvobject OBJ_EVENT_GFX_SCHOOL_KID_M, 29, 5, 1 + createvobject OBJ_EVENT_GFX_MART_EMPLOYEE, 30, 6, 2 + createvobject OBJ_EVENT_GFX_WOMAN_5, 31, 8, 2 return BattleFrontier_BattleDomeBattleRoom_EventScript_AddFinalAudience:: - createvobject OBJ_EVENT_GFX_NINJA_BOY, 0, 2, 0, 3, DIR_SOUTH - createvobject OBJ_EVENT_GFX_SCIENTIST_1, 1, 3, 0, 3, DIR_SOUTH - createvobject OBJ_EVENT_GFX_BEAUTY, 2, 15, 0, 3, DIR_SOUTH - createvobject OBJ_EVENT_GFX_MAN_5, 3, 5, 0, 3, DIR_SOUTH - createvobject OBJ_EVENT_GFX_EXPERT_F, 4, 6, 0, 3, DIR_SOUTH - createvobject OBJ_EVENT_GFX_SCIENTIST_1, 5, 7, 0, 3, DIR_SOUTH - createvobject OBJ_EVENT_GFX_NINJA_BOY, 6, 8, 0, 3, DIR_SOUTH - createvobject OBJ_EVENT_GFX_WOMAN_2, 7, 9, 0, 3, DIR_SOUTH - createvobject OBJ_EVENT_GFX_WOMAN_3, 8, 10, 0, 3, DIR_SOUTH - createvobject OBJ_EVENT_GFX_LITTLE_GIRL, 9, 11, 0, 3, DIR_SOUTH - createvobject OBJ_EVENT_GFX_LASS, 10, 12, 0, 3, DIR_SOUTH - createvobject OBJ_EVENT_GFX_SCIENTIST_1, 11, 13, 0, 3, DIR_SOUTH - createvobject OBJ_EVENT_GFX_BEAUTY, 12, 14, 0, 3, DIR_SOUTH - createvobject OBJ_EVENT_GFX_MAN_5, 13, 15, 2, 3, DIR_SOUTH - createvobject OBJ_EVENT_GFX_HIKER, 14, 12, 2, 3, DIR_SOUTH - createvobject OBJ_EVENT_GFX_GENTLEMAN, 15, 2, 1, 3, DIR_SOUTH - createvobject OBJ_EVENT_GFX_NINJA_BOY, 16, 3, 1, 3, DIR_SOUTH - createvobject OBJ_EVENT_GFX_WOMAN_2, 17, 4, 1, 3, DIR_SOUTH - createvobject OBJ_EVENT_GFX_WOMAN_3, 18, 6, 1, 3, DIR_SOUTH - createvobject OBJ_EVENT_GFX_BEAUTY, 19, 7, 1, 3, DIR_SOUTH - createvobject OBJ_EVENT_GFX_EXPERT_F, 20, 9, 1, 3, DIR_SOUTH - createvobject OBJ_EVENT_GFX_MAN_2, 21, 10, 1, 3, DIR_SOUTH - createvobject OBJ_EVENT_GFX_WOMAN_5, 22, 11, 1, 3, DIR_SOUTH - createvobject OBJ_EVENT_GFX_SCIENTIST_1, 23, 13, 1, 3, DIR_SOUTH - createvobject OBJ_EVENT_GFX_GENTLEMAN, 24, 14, 1, 3, DIR_SOUTH - createvobject OBJ_EVENT_GFX_LITTLE_BOY, 25, 15, 1, 3, DIR_SOUTH - createvobject OBJ_EVENT_GFX_YOUNGSTER, 26, 2, 2, 3, DIR_SOUTH - createvobject OBJ_EVENT_GFX_FAT_MAN, 27, 3, 2, 3, DIR_SOUTH - createvobject OBJ_EVENT_GFX_HEX_MANIAC, 28, 5, 2, 3, DIR_SOUTH - createvobject OBJ_EVENT_GFX_SCHOOL_KID_M, 29, 5, 1, 3, DIR_SOUTH - createvobject OBJ_EVENT_GFX_MART_EMPLOYEE, 30, 6, 2, 3, DIR_SOUTH - createvobject OBJ_EVENT_GFX_WOMAN_5, 31, 8, 2, 3, DIR_SOUTH + createvobject OBJ_EVENT_GFX_NINJA_BOY, 0, 2, 0 + createvobject OBJ_EVENT_GFX_SCIENTIST_1, 1, 3, 0 + createvobject OBJ_EVENT_GFX_BEAUTY, 2, 15, 0 + createvobject OBJ_EVENT_GFX_MAN_5, 3, 5, 0 + createvobject OBJ_EVENT_GFX_EXPERT_F, 4, 6, 0 + createvobject OBJ_EVENT_GFX_SCIENTIST_1, 5, 7, 0 + createvobject OBJ_EVENT_GFX_NINJA_BOY, 6, 8, 0 + createvobject OBJ_EVENT_GFX_WOMAN_2, 7, 9, 0 + createvobject OBJ_EVENT_GFX_WOMAN_3, 8, 10, 0 + createvobject OBJ_EVENT_GFX_LITTLE_GIRL, 9, 11, 0 + createvobject OBJ_EVENT_GFX_LASS, 10, 12, 0 + createvobject OBJ_EVENT_GFX_SCIENTIST_1, 11, 13, 0 + createvobject OBJ_EVENT_GFX_BEAUTY, 12, 14, 0 + createvobject OBJ_EVENT_GFX_MAN_5, 13, 15, 2 + createvobject OBJ_EVENT_GFX_HIKER, 14, 12, 2 + createvobject OBJ_EVENT_GFX_GENTLEMAN, 15, 2, 1 + createvobject OBJ_EVENT_GFX_NINJA_BOY, 16, 3, 1 + createvobject OBJ_EVENT_GFX_WOMAN_2, 17, 4, 1 + createvobject OBJ_EVENT_GFX_WOMAN_3, 18, 6, 1 + createvobject OBJ_EVENT_GFX_BEAUTY, 19, 7, 1 + createvobject OBJ_EVENT_GFX_EXPERT_F, 20, 9, 1 + createvobject OBJ_EVENT_GFX_MAN_2, 21, 10, 1 + createvobject OBJ_EVENT_GFX_WOMAN_5, 22, 11, 1 + createvobject OBJ_EVENT_GFX_SCIENTIST_1, 23, 13, 1 + createvobject OBJ_EVENT_GFX_GENTLEMAN, 24, 14, 1 + createvobject OBJ_EVENT_GFX_LITTLE_BOY, 25, 15, 1 + createvobject OBJ_EVENT_GFX_YOUNGSTER, 26, 2, 2 + createvobject OBJ_EVENT_GFX_FAT_MAN, 27, 3, 2 + createvobject OBJ_EVENT_GFX_HEX_MANIAC, 28, 5, 2 + createvobject OBJ_EVENT_GFX_SCHOOL_KID_M, 29, 5, 1 + createvobject OBJ_EVENT_GFX_MART_EMPLOYEE, 30, 6, 2 + createvobject OBJ_EVENT_GFX_WOMAN_5, 31, 8, 2 return BattleFrontier_BattleDomeBattleRoom_Movement_SetInvisible: @@ -883,14 +854,13 @@ BattleFrontier_BattleDomeBattleRoom_EventScript_AudienceLookAround:: BattleFrontier_BattleDomeBattleRoom_EventScript_WarpToLobby:: copyvar VAR_RESULT, VAR_FRONTIER_BATTLE_MODE - compare VAR_RESULT, FRONTIER_MODE_DOUBLES - goto_if_eq BattleFrontier_BattleDomePreBattleRoom_EventScript_WarpToLobbyDoubles - warp MAP_BATTLE_FRONTIER_BATTLE_DOME_LOBBY, 255, 5, 11 + goto_if_eq VAR_RESULT, FRONTIER_MODE_DOUBLES, BattleFrontier_BattleDomePreBattleRoom_EventScript_WarpToLobbyDoubles + warp MAP_BATTLE_FRONTIER_BATTLE_DOME_LOBBY, 5, 11 waitstate end BattleFrontier_BattleDomePreBattleRoom_EventScript_WarpToLobbyDoubles:: - warp MAP_BATTLE_FRONTIER_BATTLE_DOME_LOBBY, 255, 17, 11 + warp MAP_BATTLE_FRONTIER_BATTLE_DOME_LOBBY, 17, 11 waitstate end @@ -898,15 +868,13 @@ BattleFrontier_BattleDomePreBattleRoom_EventScript_WarpToLobbyDoubles:: BattleFrontier_BattleDomeBattleRoom_EventScript_SetWalkingAudienceMemberPos:: random 2 copyvar VAR_TEMP_D, VAR_RESULT - compare VAR_TEMP_D, 0 - goto_if_eq Common_EventScript_NopReturn + goto_if_eq VAR_TEMP_D, 0, Common_EventScript_NopReturn setobjectxyperm LOCALID_AUDIENCE_WALKING, 2, 0 setobjectmovementtype LOCALID_AUDIENCE_WALKING, MOVEMENT_TYPE_FACE_RIGHT return BattleFrontier_BattleDomeBattleRoom_EventScript_TryDoAudienceMemberWalkToSeat:: - compare VAR_TEMP_D, 0 - goto_if_eq Common_EventScript_NopReturn + goto_if_eq VAR_TEMP_D, 0, Common_EventScript_NopReturn applymovement LOCALID_AUDIENCE_WALKING, BattleFrontier_BattleDomeBattleRoom_Movement_AudienceMemberWalkToSeat return diff --git a/data/maps/BattleFrontier_BattleDomeCorridor/scripts.inc b/data/maps/BattleFrontier_BattleDomeCorridor/scripts.inc index 32f3c82ba356..d286dc8681fa 100644 --- a/data/maps/BattleFrontier_BattleDomeCorridor/scripts.inc +++ b/data/maps/BattleFrontier_BattleDomeCorridor/scripts.inc @@ -12,8 +12,7 @@ BattleFrontier_BattleDomeCorridor_EventScript_EnterCorridor:: delay 16 setvar VAR_TEMP_0, 1 frontier_get FRONTIER_DATA_LVL_MODE - compare VAR_RESULT, FRONTIER_LVL_OPEN - goto_if_eq BattleFrontier_BattleDomeCorridor_EventScript_WalkToBattleRoomLvOpen + goto_if_eq VAR_RESULT, FRONTIER_LVL_OPEN, BattleFrontier_BattleDomeCorridor_EventScript_WalkToBattleRoomLvOpen applymovement LOCALID_ATTENDANT, BattleFrontier_BattleDomeCorridor_Movement_AttendantWalkToDoorLv50 applymovement OBJ_EVENT_ID_PLAYER, BattleFrontier_BattleDomeCorridor_Movement_PlayerWalkToDoorLv50 waitmovement 0 @@ -40,7 +39,7 @@ BattleFrontier_BattleDomeCorridor_EventScript_WalkToBattleRoomLvOpen:: BattleFrontier_BattleDomeCorridor_EventScript_WarpToPreBattleRoom:: waitmovement 0 setvar VAR_0x8006, 0 - warp MAP_BATTLE_FRONTIER_BATTLE_DOME_PRE_BATTLE_ROOM, 255, 5, 7 + warp MAP_BATTLE_FRONTIER_BATTLE_DOME_PRE_BATTLE_ROOM, 5, 7 waitstate end diff --git a/data/maps/BattleFrontier_BattleDomeLobby/scripts.inc b/data/maps/BattleFrontier_BattleDomeLobby/scripts.inc index 04df6f38c6c5..b972a0814c3b 100644 --- a/data/maps/BattleFrontier_BattleDomeLobby/scripts.inc +++ b/data/maps/BattleFrontier_BattleDomeLobby/scripts.inc @@ -48,8 +48,7 @@ BattleFrontier_BattleDomeLobby_EventScript_WonChallenge:: call BattleFrontier_EventScript_IncrementWinStreak lockall frontier_isbrain - compare VAR_RESULT, TRUE - goto_if_eq BattleFrontier_BattleDomeLobby_EventScript_DefeatedAce + goto_if_eq VAR_RESULT, TRUE, BattleFrontier_BattleDomeLobby_EventScript_DefeatedAce msgbox BattleFrontier_BattleDomeLobby_Text_CongratsForWinningTourney, MSGBOX_DEFAULT goto BattleFrontier_BattleDomeLobby_EventScript_GiveBattlePoints @@ -88,8 +87,7 @@ BattleFrontier_BattleDomeLobby_EventScript_AskRecordBattle:: playse SE_SAVE waitse call BattleFrontier_EventScript_GetCantRecordBattle - compare VAR_RESULT, TRUE - goto_if_eq BattleFrontier_BattleDomeLobby_EventScript_EndChallenge + goto_if_eq VAR_RESULT, TRUE, BattleFrontier_BattleDomeLobby_EventScript_EndChallenge message BattleFrontier_BattleDomeLobby_Text_RecordLastMatch waitmessage multichoicedefault 20, 8, MULTI_YESNO, 1, FALSE @@ -137,15 +135,11 @@ BattleFrontier_BattleDomeLobby_EventScript_DoublesAttendant:: BattleFrontier_BattleDomeLobby_EventScript_AttendantWelcome:: special SavePlayerParty - compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_SINGLES - call_if_eq BattleFrontier_BattleDomeLobby_EventScript_WelcomeSingles - compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_DOUBLES - call_if_eq BattleFrontier_BattleDomeLobby_EventScript_WelcomeDoubles + call_if_eq VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_SINGLES, BattleFrontier_BattleDomeLobby_EventScript_WelcomeSingles + call_if_eq VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_DOUBLES, BattleFrontier_BattleDomeLobby_EventScript_WelcomeDoubles BattleFrontier_BattleDomeLobby_EventScript_AskTakeChallenge:: - compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_SINGLES - call_if_eq BattleFrontier_BattleDomeLobby_EventScript_TakeSinglesChallenge - compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_DOUBLES - call_if_eq BattleFrontier_BattleDomeLobby_EventScript_TakeDoublesChallenge + call_if_eq VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_SINGLES, BattleFrontier_BattleDomeLobby_EventScript_TakeSinglesChallenge + call_if_eq VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_DOUBLES, BattleFrontier_BattleDomeLobby_EventScript_TakeDoublesChallenge waitmessage multichoice 17, 6, MULTI_CHALLENGEINFO, FALSE switch VAR_RESULT @@ -162,8 +156,7 @@ BattleFrontier_BattleDomeLobby_EventScript_TryEnterChallenge:: case FRONTIER_LVL_TENT, BattleFrontier_BattleDomeLobby_EventScript_CancelChallenge case MULTI_B_PRESSED, BattleFrontier_BattleDomeLobby_EventScript_CancelChallenge frontier_checkineligible - compare VAR_0x8004, TRUE - goto_if_eq BattleFrontier_BattleDomeLobby_EventScript_NotEnoughValidMons + goto_if_eq VAR_0x8004, TRUE, BattleFrontier_BattleDomeLobby_EventScript_NotEnoughValidMons frontier_set FRONTIER_DATA_LVL_MODE, VAR_RESULT msgbox BattleFrontier_BattleDomeLobby_Text_SelectThreeMons, MSGBOX_DEFAULT fadescreen FADE_TO_BLACK @@ -172,8 +165,7 @@ BattleFrontier_BattleDomeLobby_EventScript_TryEnterChallenge:: setvar VAR_0x8005, FRONTIER_PARTY_SIZE special ChoosePartyForBattleFrontier waitstate - compare VAR_RESULT, 0 - goto_if_eq BattleFrontier_BattleDomeLobby_EventScript_LoadPartyCancelChallenge + goto_if_eq VAR_RESULT, 0, BattleFrontier_BattleDomeLobby_EventScript_LoadPartyCancelChallenge msgbox BattleFrontier_BattleDomeLobby_Text_OkayToSaveBeforeChallenge, MSGBOX_YESNO switch VAR_RESULT case NO, BattleFrontier_BattleDomeLobby_EventScript_LoadPartyCancelChallenge @@ -191,8 +183,7 @@ BattleFrontier_BattleDomeLobby_EventScript_SaveBeforeChallenge:: delay 2 call Common_EventScript_SaveGame setvar VAR_TEMP_0, 255 - compare VAR_RESULT, 0 - goto_if_eq BattleFrontier_BattleDomeLobby_EventScript_CancelChallengeSaveFailed + goto_if_eq VAR_RESULT, 0, BattleFrontier_BattleDomeLobby_EventScript_CancelChallengeSaveFailed dome_inittrainers BattleFrontier_BattleDomeLobby_EventScript_EnterChallenge:: special SavePlayerParty @@ -202,16 +193,14 @@ BattleFrontier_BattleDomeLobby_EventScript_EnterChallenge:: closemessage call BattleFrontier_BattleDomeLobby_EventScript_WalkToDoor special HealPlayerParty - warp MAP_BATTLE_FRONTIER_BATTLE_DOME_CORRIDOR, 255, 23, 6 + warp MAP_BATTLE_FRONTIER_BATTLE_DOME_CORRIDOR, 23, 6 setvar VAR_TEMP_0, 0 waitstate end BattleFrontier_BattleDomeLobby_EventScript_ExplainChallenge:: - compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_SINGLES - call_if_eq BattleFrontier_BattleDomeLobby_EventScript_ExplainSinglesChallenge - compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_DOUBLES - call_if_eq BattleFrontier_BattleDomeLobby_EventScript_ExplainDoublesChallenge + call_if_eq VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_SINGLES, BattleFrontier_BattleDomeLobby_EventScript_ExplainSinglesChallenge + call_if_eq VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_DOUBLES, BattleFrontier_BattleDomeLobby_EventScript_ExplainDoublesChallenge goto BattleFrontier_BattleDomeLobby_EventScript_AskTakeChallenge BattleFrontier_BattleDomeLobby_EventScript_NotEnoughValidMons:: @@ -240,27 +229,19 @@ BattleFrontier_BattleDomeLobby_EventScript_EndCancelChallenge:: end BattleFrontier_BattleDomeLobby_EventScript_WalkToDoor:: - compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_SINGLES - call_if_eq BattleFrontier_BattleDomeLobby_EventScript_SinglesAttendantWalkToDoor - compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_DOUBLES - call_if_eq BattleFrontier_BattleDomeLobby_EventScript_DoublesAttendantWalkToDoor + call_if_eq VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_SINGLES, BattleFrontier_BattleDomeLobby_EventScript_SinglesAttendantWalkToDoor + call_if_eq VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_DOUBLES, BattleFrontier_BattleDomeLobby_EventScript_DoublesAttendantWalkToDoor applymovement OBJ_EVENT_ID_PLAYER, BattleFrontier_BattleDomeLobby_Movement_WalkToDoor waitmovement 0 - compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_SINGLES - call_if_eq BattleFrontier_BattleDomeLobby_EventScript_OpenSinglesDoor - compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_DOUBLES - call_if_eq BattleFrontier_BattleDomeLobby_EventScript_OpenDoublesDoor + call_if_eq VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_SINGLES, BattleFrontier_BattleDomeLobby_EventScript_OpenSinglesDoor + call_if_eq VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_DOUBLES, BattleFrontier_BattleDomeLobby_EventScript_OpenDoublesDoor waitdooranim - compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_SINGLES - call_if_eq BattleFrontier_BattleDomeLobby_EventScript_SinglesAttendantEnterDoor - compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_DOUBLES - call_if_eq BattleFrontier_BattleDomeLobby_EventScript_DoublesAttendantEnterDoor + call_if_eq VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_SINGLES, BattleFrontier_BattleDomeLobby_EventScript_SinglesAttendantEnterDoor + call_if_eq VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_DOUBLES, BattleFrontier_BattleDomeLobby_EventScript_DoublesAttendantEnterDoor applymovement OBJ_EVENT_ID_PLAYER, BattleFrontier_BattleDomeLobby_Movement_PlayerEnterDoor waitmovement 0 - compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_SINGLES - call_if_eq BattleFrontier_BattleDomeLobby_EventScript_CloseSinglesDoor - compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_DOUBLES - call_if_eq BattleFrontier_BattleDomeLobby_EventScript_CloseDoublesDoor + call_if_eq VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_SINGLES, BattleFrontier_BattleDomeLobby_EventScript_CloseSinglesDoor + call_if_eq VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_DOUBLES, BattleFrontier_BattleDomeLobby_EventScript_CloseDoublesDoor waitdooranim return @@ -357,14 +338,10 @@ BattleFrontier_BattleDomeLobby_EventScript_ShowDoublesResults:: BattleFrontier_BattleDomeLobby_EventScript_ShowPrevTourneyTree:: dome_get DOME_DATA_PREV_TOURNEY_TYPE - compare VAR_RESULT, 0 - call_if_eq BattleFrontier_BattleDomeLobby_EventScript_PrevTourneyResultsSinglesLv50 - compare VAR_RESULT, 1 - call_if_eq BattleFrontier_BattleDomeLobby_EventScript_PrevTourneyResultsDoublesLv50 - compare VAR_RESULT, 2 - call_if_eq BattleFrontier_BattleDomeLobby_EventScript_PrevTourneyResultsSinglesLvOpen - compare VAR_RESULT, 3 - call_if_eq BattleFrontier_BattleDomeLobby_EventScript_PrevTourneyResultsDoublesLvOpen + call_if_eq VAR_RESULT, 0, BattleFrontier_BattleDomeLobby_EventScript_PrevTourneyResultsSinglesLv50 + call_if_eq VAR_RESULT, 1, BattleFrontier_BattleDomeLobby_EventScript_PrevTourneyResultsDoublesLv50 + call_if_eq VAR_RESULT, 2, BattleFrontier_BattleDomeLobby_EventScript_PrevTourneyResultsSinglesLvOpen + call_if_eq VAR_RESULT, 3, BattleFrontier_BattleDomeLobby_EventScript_PrevTourneyResultsDoublesLvOpen fadescreen FADE_TO_BLACK dome_showprevtourneytree waitstate diff --git a/data/maps/BattleFrontier_BattleDomePreBattleRoom/scripts.inc b/data/maps/BattleFrontier_BattleDomePreBattleRoom/scripts.inc index ca441cf1f8dc..6ca4296cc0d1 100644 --- a/data/maps/BattleFrontier_BattleDomePreBattleRoom/scripts.inc +++ b/data/maps/BattleFrontier_BattleDomePreBattleRoom/scripts.inc @@ -19,8 +19,7 @@ BattleFrontier_BattleDomePreBattleRoom_OnFrame: .2byte 0 BattleFrontier_BattleDomePreBattleRoom_EventScript_EnterRoom:: - compare VAR_0x8006, 1 - goto_if_eq BattleFrontier_BattleDomePreBattleRoom_EventScript_ReturnFromBattle + goto_if_eq VAR_0x8006, 1, BattleFrontier_BattleDomePreBattleRoom_EventScript_ReturnFromBattle frontier_set FRONTIER_DATA_RECORD_DISABLED, TRUE setvar VAR_TEMP_0, 1 applymovement OBJ_EVENT_ID_PLAYER, BattleFrontier_BattleDomePreBattleRoom_Movement_PlayerEnter @@ -31,8 +30,7 @@ BattleFrontier_BattleDomePreBattleRoom_EventScript_AskReadyForNextRound:: waitmessage switch VAR_RESULT @ No case? call BattleFrontier_EventScript_GetCantRecordBattle - compare VAR_RESULT, TRUE - goto_if_eq BattleFrontier_BattleDomePreBattleRoom_EventScript_AskReadyForNextRoundNoRecord + goto_if_eq VAR_RESULT, TRUE, BattleFrontier_BattleDomePreBattleRoom_EventScript_AskReadyForNextRoundNoRecord multichoice 16, 0, MULTI_TOURNEY_WITH_RECORD, TRUE switch VAR_RESULT case 0, BattleFrontier_BattleDomePreBattleRoom_EventScript_ShowOpponentInfo @@ -146,8 +144,7 @@ BattleFrontier_BattleDomePreBattleRoom_EventScript_ContinueChallenge:: special ChoosePartyForBattleFrontier waitstate frontier_resetsketch - compare VAR_RESULT, 0 - goto_if_eq BattleFrontier_BattleDomePreBattleRoom_EventScript_AskReadyForNextRound + goto_if_eq VAR_RESULT, 0, BattleFrontier_BattleDomePreBattleRoom_EventScript_AskReadyForNextRound dome_set DOME_DATA_SELECTED_MONS dome_reduceparty dome_setopponent @@ -163,7 +160,7 @@ BattleFrontier_BattleDomePreBattleRoom_EventScript_ContinueChallenge:: waitmovement 0 closedoor 5, 1 waitdooranim - warp MAP_BATTLE_FRONTIER_BATTLE_DOME_BATTLE_ROOM, 255, 9, 5 + warp MAP_BATTLE_FRONTIER_BATTLE_DOME_BATTLE_ROOM, 9, 5 setvar VAR_TEMP_0, 0 waitstate end diff --git a/data/maps/BattleFrontier_BattleFactoryBattleRoom/scripts.inc b/data/maps/BattleFrontier_BattleFactoryBattleRoom/scripts.inc index 24f5ebe103ac..cf44e3118e90 100644 --- a/data/maps/BattleFrontier_BattleFactoryBattleRoom/scripts.inc +++ b/data/maps/BattleFrontier_BattleFactoryBattleRoom/scripts.inc @@ -19,14 +19,11 @@ BattleFrontier_BattleFactoryBattleRoom_MapScripts:: BattleFrontier_BattleFactoryBattleRoom_OnTransition: frontier_settrainers checkplayergender - compare VAR_RESULT, MALE - call_if_eq BattleFrontier_BattleFactoryBattleRoom_EventScript_SetPlayerGfxMale - compare VAR_RESULT, FEMALE - call_if_eq BattleFrontier_BattleFactoryBattleRoom_EventScript_SetPlayerGfxFemale + call_if_eq VAR_RESULT, MALE, BattleFrontier_BattleFactoryBattleRoom_EventScript_SetPlayerGfxMale + call_if_eq VAR_RESULT, FEMALE, BattleFrontier_BattleFactoryBattleRoom_EventScript_SetPlayerGfxFemale frontier_getbrainstatus copyvar VAR_TEMP_F, VAR_RESULT - compare VAR_RESULT, FRONTIER_BRAIN_NOT_READY - goto_if_ne BattleFrontier_BattleFactoryBattleRoom_EventScript_SetUpFactoryHeadObj + goto_if_ne VAR_RESULT, FRONTIER_BRAIN_NOT_READY, BattleFrontier_BattleFactoryBattleRoom_EventScript_SetUpFactoryHeadObj end BattleFrontier_BattleFactoryBattleRoom_EventScript_SetUpFactoryHeadObj:: @@ -41,8 +38,7 @@ BattleFrontier_BattleFactoryBattleRoom_OnWarp: BattleFrontier_BattleFactoryBattleRoom_EventScript_HideObjects:: setvar VAR_TEMP_1, 1 hideobjectat OBJ_EVENT_ID_PLAYER, MAP_BATTLE_FRONTIER_BATTLE_FACTORY_BATTLE_ROOM - compare VAR_TEMP_F, FRONTIER_BRAIN_NOT_READY - goto_if_ne BattleFrontier_BattleFactoryBattleRoom_EventScript_EndHideObjects + goto_if_ne VAR_TEMP_F, FRONTIER_BRAIN_NOT_READY, BattleFrontier_BattleFactoryBattleRoom_EventScript_EndHideObjects hideobjectat LOCALID_OPPONENT, MAP_BATTLE_FRONTIER_BATTLE_FACTORY_BATTLE_ROOM BattleFrontier_BattleFactoryBattleRoom_EventScript_EndHideObjects:: end @@ -71,8 +67,7 @@ BattleFrontier_BattleFactoryBattleRoom_EventScript_EnterRoomFactoryHeadBattle:: end BattleFrontier_BattleFactoryBattleRoom_EventScript_EnterRoom:: - compare VAR_TEMP_F, FRONTIER_BRAIN_NOT_READY - goto_if_ne BattleFrontier_BattleFactoryBattleRoom_EventScript_EnterRoomFactoryHeadBattle + goto_if_ne VAR_TEMP_F, FRONTIER_BRAIN_NOT_READY, BattleFrontier_BattleFactoryBattleRoom_EventScript_EnterRoomFactoryHeadBattle applymovement LOCALID_PLAYER, BattleFrontier_BattleFactoryBattleRoom_Movement_PlayerEnterRoom applymovement OBJ_EVENT_ID_PLAYER, BattleFrontier_BattleFactoryBattleRoom_Movement_PlayerEnterRoom waitmovement 0 @@ -84,8 +79,7 @@ BattleFrontier_BattleFactoryBattleRoom_EventScript_EnterRoom:: applymovement LOCALID_OPPONENT, BattleFrontier_BattleFactoryBattleRoom_Movement_OpponentEnter waitmovement 0 BattleFrontier_BattleFactoryBattleRoom_EventScript_BattleOpponent:: - compare VAR_TEMP_F, FRONTIER_BRAIN_NOT_READY - goto_if_ne BattleFrontier_BattleFactoryBattleRoom_EventScript_BattleNoland + goto_if_ne VAR_TEMP_F, FRONTIER_BRAIN_NOT_READY, BattleFrontier_BattleFactoryBattleRoom_EventScript_BattleNoland palace_getopponentintro lockall msgbox gStringVar4, MSGBOX_DEFAULT @@ -105,8 +99,7 @@ BattleFrontier_BattleFactoryBattleRoom_EventScript_WarpToLobbyLost:: BattleFrontier_BattleFactoryBattleRoom_EventScript_DefeatedOpponent:: factory_get FACTORY_DATA_WIN_STREAK_SWAPS - compare VAR_RESULT, MAX_STREAK - goto_if_eq BattleFrontier_BattleFactoryBattleRoom_EventScript_IncrementWinStreak + goto_if_eq VAR_RESULT, MAX_STREAK, BattleFrontier_BattleFactoryBattleRoom_EventScript_IncrementWinStreak addvar VAR_RESULT, 1 setorcopyvar VAR_0x8006, VAR_RESULT factory_set FACTORY_DATA_WIN_STREAK_SWAPS @ uses VAR_0x8006 above @@ -119,7 +112,7 @@ BattleFrontier_BattleFactoryBattleRoom_EventScript_IncrementBattleNum:: switch VAR_RESULT case 7, BattleFrontier_BattleFactoryBattleRoom_EventScript_WarpToLobbyWon setvar VAR_0x8006, 1 - warp MAP_BATTLE_FRONTIER_BATTLE_FACTORY_PRE_BATTLE_ROOM, 255, 8, 8 + warp MAP_BATTLE_FRONTIER_BATTLE_FACTORY_PRE_BATTLE_ROOM, 8, 8 waitstate BattleFrontier_BattleFactoryBattleRoom_EventScript_WarpToLobbyWon:: frontier_set FRONTIER_DATA_CHALLENGE_STATUS, CHALLENGE_STATUS_WON @@ -131,21 +124,18 @@ BattleFrontier_BattleFactoryBattleRoom_EventScript_BattleNoland:: case FRONTIER_BRAIN_STREAK, BattleFrontier_BattleFactoryBattleRoom_EventScript_BattleNolandSilver case FRONTIER_BRAIN_STREAK_LONG, BattleFrontier_BattleFactoryBattleRoom_EventScript_BattleNolandGold frontier_get FRONTIER_DATA_HEARD_BRAIN_SPEECH - compare VAR_RESULT, FALSE - goto_if_ne BattleFrontier_BattleFactoryBattleRoom_EventScript_BattleNolandSilver + goto_if_ne VAR_RESULT, FALSE, BattleFrontier_BattleFactoryBattleRoom_EventScript_BattleNolandSilver msgbox BattleFrontier_BattleFactoryBattleRoom_Text_NolandImFactoryHead, MSGBOX_DEFAULT frontier_set FRONTIER_DATA_HEARD_BRAIN_SPEECH BattleFrontier_BattleFactoryBattleRoom_EventScript_BattleNolandSilver:: msgbox BattleFrontier_BattleFactoryBattleRoom_Text_ShakeOutKnowledgeBringItOn, MSGBOX_DEFAULT call BattleFrontier_BattleFactoryBattleRoom_EventScript_DoNolandBattle - compare VAR_RESULT, 1 - goto_if_eq BattleFrontier_BattleFactoryBattleRoom_EventScript_DefeatedNolandSilver + goto_if_eq VAR_RESULT, 1, BattleFrontier_BattleFactoryBattleRoom_EventScript_DefeatedNolandSilver goto BattleFrontier_BattleFactoryBattleRoom_EventScript_WarpToLobbyLost BattleFrontier_BattleFactoryBattleRoom_EventScript_DefeatedNolandSilver:: frontier_getsymbols - compare VAR_RESULT, 0 - goto_if_ne BattleFrontier_BattleFactoryBattleRoom_EventScript_DefeatedNoland + goto_if_ne VAR_RESULT, 0, BattleFrontier_BattleFactoryBattleRoom_EventScript_DefeatedNoland msgbox BattleFrontier_BattleFactoryBattleRoom_Text_NolandLetsSeeFrontierPass, MSGBOX_DEFAULT closemessage applymovement LOCALID_PLAYER, BattleFrontier_BattleFactoryBattleRoom_Movement_PlayerApproachNoland @@ -160,21 +150,18 @@ BattleFrontier_BattleFactoryBattleRoom_EventScript_DefeatedNolandSilver:: BattleFrontier_BattleFactoryBattleRoom_EventScript_IntroNolandGold:: frontier_get FRONTIER_DATA_HEARD_BRAIN_SPEECH - compare VAR_RESULT, FALSE - goto_if_ne BattleFrontier_BattleFactoryBattleRoom_EventScript_BattleNolandGold + goto_if_ne VAR_RESULT, FALSE, BattleFrontier_BattleFactoryBattleRoom_EventScript_BattleNolandGold msgbox BattleFrontier_BattleFactoryBattleRoom_Text_HarderLookThanLastTime, MSGBOX_DEFAULT frontier_set FRONTIER_DATA_HEARD_BRAIN_SPEECH BattleFrontier_BattleFactoryBattleRoom_EventScript_BattleNolandGold:: msgbox BattleFrontier_BattleFactoryBattleRoom_Text_AllRightBringItOn, MSGBOX_DEFAULT call BattleFrontier_BattleFactoryBattleRoom_EventScript_DoNolandBattle - compare VAR_RESULT, 1 - goto_if_eq BattleFrontier_BattleFactoryBattleRoom_EventScript_DefeatedNolandGold + goto_if_eq VAR_RESULT, 1, BattleFrontier_BattleFactoryBattleRoom_EventScript_DefeatedNolandGold goto BattleFrontier_BattleFactoryBattleRoom_EventScript_WarpToLobbyLost BattleFrontier_BattleFactoryBattleRoom_EventScript_DefeatedNolandGold:: frontier_getsymbols - compare VAR_RESULT, 2 - goto_if_eq BattleFrontier_BattleFactoryBattleRoom_EventScript_DefeatedNoland + goto_if_eq VAR_RESULT, 2, BattleFrontier_BattleFactoryBattleRoom_EventScript_DefeatedNoland msgbox BattleFrontier_BattleFactoryBattleRoom_Text_OutOfMyLeagueLetsSeePass, MSGBOX_DEFAULT waitmessage applymovement LOCALID_PLAYER, BattleFrontier_BattleFactoryBattleRoom_Movement_PlayerApproachNoland @@ -199,14 +186,12 @@ BattleFrontier_BattleFactoryBattleRoom_EventScript_DoNolandBattle:: BattleFrontier_BattleFactoryBattleRoom_EventScript_DefeatedNoland:: factory_get FACTORY_DATA_WIN_STREAK_SWAPS - compare VAR_RESULT, MAX_STREAK - goto_if_eq BattleFrontier_BattleFactoryBattleRoom_EventScript_IncrementWinStreak + goto_if_eq VAR_RESULT, MAX_STREAK, BattleFrontier_BattleFactoryBattleRoom_EventScript_IncrementWinStreak addvar VAR_RESULT, 1 setorcopyvar VAR_0x8006, VAR_RESULT factory_set FACTORY_DATA_WIN_STREAK_SWAPS @ uses VAR_0x8006 above factory_get FACTORY_DATA_WIN_STREAK - compare VAR_RESULT, MAX_STREAK - goto_if_eq BattleFrontier_BattleFactoryBattleRoom_EventScript_IncrementBattleNum + goto_if_eq VAR_RESULT, MAX_STREAK, BattleFrontier_BattleFactoryBattleRoom_EventScript_IncrementBattleNum addvar VAR_RESULT, 1 factory_set FACTORY_DATA_WIN_STREAK, VAR_RESULT frontier_get FRONTIER_DATA_BATTLE_NUM @@ -245,14 +230,13 @@ BattleFrontier_BattleFactoryBattleRoom_Movement_NolandMoveToBattle: BattleFrontier_BattleFactoryBattleRoom_EventScript_WarpToLobby:: copyvar VAR_RESULT, VAR_FRONTIER_BATTLE_MODE - compare VAR_RESULT, FRONTIER_MODE_DOUBLES - goto_if_eq BattleFrontier_BattleFactoryBattleRoom_EventScript_WarpToLobbyDoubles - warp MAP_BATTLE_FRONTIER_BATTLE_FACTORY_LOBBY, 255, 4, 8 + goto_if_eq VAR_RESULT, FRONTIER_MODE_DOUBLES, BattleFrontier_BattleFactoryBattleRoom_EventScript_WarpToLobbyDoubles + warp MAP_BATTLE_FRONTIER_BATTLE_FACTORY_LOBBY, 4, 8 waitstate end BattleFrontier_BattleFactoryBattleRoom_EventScript_WarpToLobbyDoubles:: - warp MAP_BATTLE_FRONTIER_BATTLE_FACTORY_LOBBY, 255, 14, 8 + warp MAP_BATTLE_FRONTIER_BATTLE_FACTORY_LOBBY, 14, 8 waitstate end diff --git a/data/maps/BattleFrontier_BattleFactoryLobby/scripts.inc b/data/maps/BattleFrontier_BattleFactoryLobby/scripts.inc index 3b11392947b4..682b2c91d193 100644 --- a/data/maps/BattleFrontier_BattleFactoryLobby/scripts.inc +++ b/data/maps/BattleFrontier_BattleFactoryLobby/scripts.inc @@ -43,8 +43,7 @@ BattleFrontier_BattleFactoryLobby_EventScript_QuitWithoutSaving:: BattleFrontier_BattleFactoryLobby_EventScript_WonChallenge:: lockall frontier_isbrain - compare VAR_RESULT, TRUE - goto_if_eq BattleFrontier_BattleFactoryLobby_EventScript_DefeatedFactoryHead + goto_if_eq VAR_RESULT, TRUE, BattleFrontier_BattleFactoryLobby_EventScript_DefeatedFactoryHead msgbox BattleFrontier_BattleFactoryLobby_Text_CongratsSevenWins, MSGBOX_DEFAULT waitmessage goto BattleFrontier_BattleFactoryLobby_EventScript_GiveBattlePoints @@ -79,8 +78,7 @@ BattleFrontier_BattleFactoryLobby_EventScript_LostChallenge:: BattleFrontier_BattleFactoryLobby_EventScript_AskRecordBattle:: call BattleFrontier_EventScript_GetCantRecordBattle - compare VAR_RESULT, TRUE - goto_if_eq BattleFrontier_BattleFactoryLobby_EventScript_EndRecordBattle + goto_if_eq VAR_RESULT, TRUE, BattleFrontier_BattleFactoryLobby_EventScript_EndRecordBattle message BattleFrontier_BattleFactoryLobby_Text_RecordLastMatch waitmessage multichoicedefault 20, 8, MULTI_YESNO, 1, FALSE @@ -126,15 +124,11 @@ BattleFrontier_BattleFactoryLobby_EventScript_DoublesAttendant:: BattleFrontier_BattleFactoryLobby_EventScript_Attendant:: special SavePlayerParty - compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_SINGLES - call_if_eq BattleFrontier_BattleFactoryLobby_EventScript_WelcomeForSingleBattle - compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_DOUBLES - call_if_eq BattleFrontier_BattleFactoryLobby_EventScript_WelcomeForDoubleBattle + call_if_eq VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_SINGLES, BattleFrontier_BattleFactoryLobby_EventScript_WelcomeForSingleBattle + call_if_eq VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_DOUBLES, BattleFrontier_BattleFactoryLobby_EventScript_WelcomeForDoubleBattle BattleFrontier_BattleFactoryLobby_EventScript_AskTakeChallenge:: - compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_SINGLES - call_if_eq BattleFrontier_BattleFactoryLobby_EventScript_TakeSinglesChallenge - compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_DOUBLES - call_if_eq BattleFrontier_BattleFactoryLobby_EventScript_TakeDoublesChallenge + call_if_eq VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_SINGLES, BattleFrontier_BattleFactoryLobby_EventScript_TakeSinglesChallenge + call_if_eq VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_DOUBLES, BattleFrontier_BattleFactoryLobby_EventScript_TakeDoublesChallenge waitmessage multichoice 17, 6, MULTI_CHALLENGEINFO, FALSE switch VAR_RESULT @@ -167,21 +161,18 @@ BattleFrontier_BattleFactoryLobby_EventScript_SaveBeforeChallenge:: delay 2 call Common_EventScript_SaveGame setvar VAR_TEMP_0, 255 - compare VAR_RESULT, 0 - goto_if_eq BattleFrontier_BattleFactoryLobby_EventScript_CancelChallengeSaveFailed + goto_if_eq VAR_RESULT, 0, BattleFrontier_BattleFactoryLobby_EventScript_CancelChallengeSaveFailed setvar VAR_0x8006, 0 BattleFrontier_BattleFactoryLobby_EventScript_EnterChallenge:: special SavePlayerParty msgbox BattleFrontier_BattleFactoryLobby_Text_StepThisWay, MSGBOX_DEFAULT closemessage - compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_SINGLES - call_if_eq BattleFrontier_BattleFactoryLobby_EventScript_TalkedToSinglesAttendant - compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_DOUBLES - call_if_eq BattleFrontier_BattleFactoryLobby_EventScript_TalkedToDoublesAttendant + call_if_eq VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_SINGLES, BattleFrontier_BattleFactoryLobby_EventScript_TalkedToSinglesAttendant + call_if_eq VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_DOUBLES, BattleFrontier_BattleFactoryLobby_EventScript_TalkedToDoublesAttendant applymovement VAR_LAST_TALKED, BattleFrontier_BattleFactoryLobby_Movement_AttendantEnterDoor applymovement OBJ_EVENT_ID_PLAYER, BattleFrontier_BattleFactoryLobby_Movement_PlayerEnterDoor waitmovement 0 - warp MAP_BATTLE_FRONTIER_BATTLE_FACTORY_PRE_BATTLE_ROOM, 255, 8, 13 + warp MAP_BATTLE_FRONTIER_BATTLE_FACTORY_PRE_BATTLE_ROOM, 8, 13 setvar VAR_TEMP_0, 0 waitstate end @@ -195,10 +186,8 @@ BattleFrontier_BattleFactoryLobby_EventScript_TalkedToDoublesAttendant:: return BattleFrontier_BattleFactoryLobby_EventScript_ExplainChallenge:: - compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_SINGLES - call_if_eq BattleFrontier_BattleFactoryLobby_EventScript_ExplainSinglesChallenge - compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_DOUBLES - call_if_eq BattleFrontier_BattleFactoryLobby_EventScript_ExplainDoublesChallenge + call_if_eq VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_SINGLES, BattleFrontier_BattleFactoryLobby_EventScript_ExplainSinglesChallenge + call_if_eq VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_DOUBLES, BattleFrontier_BattleFactoryLobby_EventScript_ExplainDoublesChallenge goto BattleFrontier_BattleFactoryLobby_EventScript_AskTakeChallenge BattleFrontier_BattleFactoryLobby_EventScript_CancelChallengeSaveFailed:: diff --git a/data/maps/BattleFrontier_BattleFactoryPreBattleRoom/scripts.inc b/data/maps/BattleFrontier_BattleFactoryPreBattleRoom/scripts.inc index ce3cb357c281..d54cf83570e9 100644 --- a/data/maps/BattleFrontier_BattleFactoryPreBattleRoom/scripts.inc +++ b/data/maps/BattleFrontier_BattleFactoryPreBattleRoom/scripts.inc @@ -11,8 +11,7 @@ BattleFrontier_BattleFactoryPreBattleRoom_OnWarp: BattleFrontier_BattleFactoryPreBattleRoom_EventScript_SetUpObjects:: setvar VAR_TEMP_1, 1 - compare VAR_0x8006, 1 - goto_if_ne BattleFrontier_BattleFactoryPreBattleRoom_EventScript_TurnPlayerNorth + goto_if_ne VAR_0x8006, 1, BattleFrontier_BattleFactoryPreBattleRoom_EventScript_TurnPlayerNorth setobjectxy LOCALID_ATTENDANT, 8, 7 turnobject LOCALID_ATTENDANT, DIR_SOUTH BattleFrontier_BattleFactoryPreBattleRoom_EventScript_TurnPlayerNorth:: @@ -24,14 +23,12 @@ BattleFrontier_BattleFactoryPreBattleRoom_OnFrame: .2byte 0 BattleFrontier_BattleFactoryPreBattleRoom_EventScript_EnterRoom:: - compare VAR_0x8006, 1 - goto_if_eq BattleFrontier_BattleFactoryPreBattleRoom_EventScript_ReturnToRoomFromBattle + goto_if_eq VAR_0x8006, 1, BattleFrontier_BattleFactoryPreBattleRoom_EventScript_ReturnToRoomFromBattle setvar VAR_TEMP_0, 1 applymovement LOCALID_ATTENDANT, BattleFrontier_BattleFactoryPreBattleRoom_Movement_AttendantEnterRoom applymovement OBJ_EVENT_ID_PLAYER, BattleFrontier_BattleFactoryPreBattleRoom_Movement_PlayerEnterRoom waitmovement 0 - compare VAR_0x8006, 2 - goto_if_eq BattleFrontier_BattleFactoryPreBattleRoom_EventScript_ResumeChallenge + goto_if_eq VAR_0x8006, 2, BattleFrontier_BattleFactoryPreBattleRoom_EventScript_ResumeChallenge factory_generaterentalmons factory_generateopponentmons factory_getopponentmontype @@ -49,12 +46,10 @@ BattleFrontier_BattleFactoryPreBattleRoom_EventScript_EnterBattleRoom:: msgbox BattleFrontier_BattleFactoryPreBattleRoom_Text_RightThisWay, MSGBOX_DEFAULT closemessage call BattleFrontier_EventScript_GetLvlMode - compare VAR_RESULT, FRONTIER_LVL_50 - call_if_eq BattleFrontier_BattleFactoryPreBattleRoom_EventScript_WalkToBattleRoomLv50 - compare VAR_RESULT, FRONTIER_LVL_OPEN - call_if_eq BattleFrontier_BattleFactoryPreBattleRoom_EventScript_WalkToBattleRoomLvOpen + call_if_eq VAR_RESULT, FRONTIER_LVL_50, BattleFrontier_BattleFactoryPreBattleRoom_EventScript_WalkToBattleRoomLv50 + call_if_eq VAR_RESULT, FRONTIER_LVL_OPEN, BattleFrontier_BattleFactoryPreBattleRoom_EventScript_WalkToBattleRoomLvOpen waitmovement 0 - warp MAP_BATTLE_FRONTIER_BATTLE_FACTORY_BATTLE_ROOM, 255, 6, 11 + warp MAP_BATTLE_FRONTIER_BATTLE_FACTORY_BATTLE_ROOM, 6, 11 waitstate end @@ -66,8 +61,7 @@ BattleFrontier_BattleFactoryPreBattleRoom_EventScript_ReturnToRoomFromBattle:: waitfanfare special HealPlayerParty frontier_getbrainstatus - compare VAR_RESULT, FRONTIER_BRAIN_NOT_READY - goto_if_eq BattleFrontier_BattleFactoryPreBattleRoom_EventScript_AskReadyForRegularOpponent + goto_if_eq VAR_RESULT, FRONTIER_BRAIN_NOT_READY, BattleFrontier_BattleFactoryPreBattleRoom_EventScript_AskReadyForRegularOpponent playse SE_POKENAV_CALL waitse msgbox BattleFrontier_BattleFactoryPreBattleRoom_Text_WaitFewMoments, MSGBOX_DEFAULT @@ -86,25 +80,17 @@ BattleFrontier_BattleFactoryPreBattleRoom_EventScript_ReturnToRoomFromBattle:: BattleFrontier_BattleFactoryPreBattleRoom_EventScript_AskReadyForOpponent:: frontier_getbrainstatus - compare VAR_RESULT, FRONTIER_BRAIN_NOT_READY - goto_if_ne BattleFrontier_BattleFactoryPreBattleRoom_EventScript_AskReadyForHead + goto_if_ne VAR_RESULT, FRONTIER_BRAIN_NOT_READY, BattleFrontier_BattleFactoryPreBattleRoom_EventScript_AskReadyForHead BattleFrontier_BattleFactoryPreBattleRoom_EventScript_AskReadyForRegularOpponent:: frontier_get FRONTIER_DATA_BATTLE_NUM - compare VAR_RESULT, 1 - call_if_eq BattleFrontier_BattleFactoryPreBattleRoom_EventScript_ReadyFor2ndOpponent - compare VAR_RESULT, 2 - call_if_eq BattleFrontier_BattleFactoryPreBattleRoom_EventScript_ReadyFor3rdOpponent - compare VAR_RESULT, 3 - call_if_eq BattleFrontier_BattleFactoryPreBattleRoom_EventScript_ReadyFor4thOpponent - compare VAR_RESULT, 4 - call_if_eq BattleFrontier_BattleFactoryPreBattleRoom_EventScript_ReadyFor5thOpponent - compare VAR_RESULT, 5 - call_if_eq BattleFrontier_BattleFactoryPreBattleRoom_EventScript_ReadyFor6thOpponent - compare VAR_RESULT, 6 - call_if_eq BattleFrontier_BattleFactoryPreBattleRoom_EventScript_ReadyFor7thOpponent + call_if_eq VAR_RESULT, 1, BattleFrontier_BattleFactoryPreBattleRoom_EventScript_ReadyFor2ndOpponent + call_if_eq VAR_RESULT, 2, BattleFrontier_BattleFactoryPreBattleRoom_EventScript_ReadyFor3rdOpponent + call_if_eq VAR_RESULT, 3, BattleFrontier_BattleFactoryPreBattleRoom_EventScript_ReadyFor4thOpponent + call_if_eq VAR_RESULT, 4, BattleFrontier_BattleFactoryPreBattleRoom_EventScript_ReadyFor5thOpponent + call_if_eq VAR_RESULT, 5, BattleFrontier_BattleFactoryPreBattleRoom_EventScript_ReadyFor6thOpponent + call_if_eq VAR_RESULT, 6, BattleFrontier_BattleFactoryPreBattleRoom_EventScript_ReadyFor7thOpponent call BattleFrontier_EventScript_GetCantRecordBattle - compare VAR_RESULT, TRUE - goto_if_eq BattleFrontier_BattleFactoryPreBattleRoom_EventScript_AskReadyForOpponentNoRecord + goto_if_eq VAR_RESULT, TRUE, BattleFrontier_BattleFactoryPreBattleRoom_EventScript_AskReadyForOpponentNoRecord multichoice 19, 4, MULTI_GO_ON_RECORD_REST_RETIRE, TRUE switch VAR_RESULT case 0, BattleFrontier_BattleFactoryPreBattleRoom_EventScript_AskSwapMon @@ -168,8 +154,7 @@ BattleFrontier_BattleFactoryPreBattleRoom_EventScript_SwapMons:: fadescreen FADE_TO_BLACK factory_swapmons waitstate - compare VAR_RESULT, TRUE @ Did player keep current pokemon - goto_if_eq BattleFrontier_BattleFactoryPreBattleRoom_EventScript_EnterBattleRoom + goto_if_eq VAR_RESULT, TRUE, BattleFrontier_BattleFactoryPreBattleRoom_EventScript_EnterBattleRoom @ Did player keep current pokemon factory_setswapped msgbox BattleFrontier_BattleFactoryPreBattleRoom_Text_YourSwapIsComplete, MSGBOX_DEFAULT goto BattleFrontier_BattleFactoryPreBattleRoom_EventScript_EnterBattleRoom @@ -223,42 +208,24 @@ BattleFrontier_BattleFactoryPreBattleRoom_EventScript_ResumeChallenge:: BattleFrontier_BattleFactoryPreBattleRoom_EventScript_CommentOnOpponentType:: msgbox BattleFrontier_BattleFactoryPreBattleRoom_Text_InvestigatedUpcomingOpponent, MSGBOX_DEFAULT - compare VAR_0x8005, TYPE_NORMAL - call_if_eq BattleFrontier_BattleFactoryPreBattleRoom_EventScript_OpponentUsesNormal - compare VAR_0x8005, TYPE_FIGHTING - call_if_eq BattleFrontier_BattleFactoryPreBattleRoom_EventScript_OpponentUsesFighting - compare VAR_0x8005, TYPE_FLYING - call_if_eq BattleFrontier_BattleFactoryPreBattleRoom_EventScript_OpponentUsesFlying - compare VAR_0x8005, TYPE_POISON - call_if_eq BattleFrontier_BattleFactoryPreBattleRoom_EventScript_OpponentUsesPoison - compare VAR_0x8005, TYPE_GROUND - call_if_eq BattleFrontier_BattleFactoryPreBattleRoom_EventScript_OpponentUsesGround - compare VAR_0x8005, TYPE_ROCK - call_if_eq BattleFrontier_BattleFactoryPreBattleRoom_EventScript_OpponentUsesRock - compare VAR_0x8005, TYPE_BUG - call_if_eq BattleFrontier_BattleFactoryPreBattleRoom_EventScript_OpponentUsesBug - compare VAR_0x8005, TYPE_GHOST - call_if_eq BattleFrontier_BattleFactoryPreBattleRoom_EventScript_OpponentUsesGhost - compare VAR_0x8005, TYPE_STEEL - call_if_eq BattleFrontier_BattleFactoryPreBattleRoom_EventScript_OpponentUsesSteel - compare VAR_0x8005, TYPE_FIRE - call_if_eq BattleFrontier_BattleFactoryPreBattleRoom_EventScript_OpponentUsesFire - compare VAR_0x8005, TYPE_WATER - call_if_eq BattleFrontier_BattleFactoryPreBattleRoom_EventScript_OpponentUsesWater - compare VAR_0x8005, TYPE_GRASS - call_if_eq BattleFrontier_BattleFactoryPreBattleRoom_EventScript_OpponentUsesGrass - compare VAR_0x8005, TYPE_ELECTRIC - call_if_eq BattleFrontier_BattleFactoryPreBattleRoom_EventScript_OpponentUsesElectric - compare VAR_0x8005, TYPE_PSYCHIC - call_if_eq BattleFrontier_BattleFactoryPreBattleRoom_EventScript_OpponentUsesPsychic - compare VAR_0x8005, TYPE_ICE - call_if_eq BattleFrontier_BattleFactoryPreBattleRoom_EventScript_OpponentUsesIce - compare VAR_0x8005, TYPE_DRAGON - call_if_eq BattleFrontier_BattleFactoryPreBattleRoom_EventScript_OpponentUsesDragon - compare VAR_0x8005, TYPE_DARK - call_if_eq BattleFrontier_BattleFactoryPreBattleRoom_EventScript_OpponentUsesDark - compare VAR_0x8005, NUMBER_OF_MON_TYPES - call_if_eq BattleFrontier_BattleFactoryPreBattleRoom_EventScript_OpponentHasNoMostCommonType + call_if_eq VAR_0x8005, TYPE_NORMAL, BattleFrontier_BattleFactoryPreBattleRoom_EventScript_OpponentUsesNormal + call_if_eq VAR_0x8005, TYPE_FIGHTING, BattleFrontier_BattleFactoryPreBattleRoom_EventScript_OpponentUsesFighting + call_if_eq VAR_0x8005, TYPE_FLYING, BattleFrontier_BattleFactoryPreBattleRoom_EventScript_OpponentUsesFlying + call_if_eq VAR_0x8005, TYPE_POISON, BattleFrontier_BattleFactoryPreBattleRoom_EventScript_OpponentUsesPoison + call_if_eq VAR_0x8005, TYPE_GROUND, BattleFrontier_BattleFactoryPreBattleRoom_EventScript_OpponentUsesGround + call_if_eq VAR_0x8005, TYPE_ROCK, BattleFrontier_BattleFactoryPreBattleRoom_EventScript_OpponentUsesRock + call_if_eq VAR_0x8005, TYPE_BUG, BattleFrontier_BattleFactoryPreBattleRoom_EventScript_OpponentUsesBug + call_if_eq VAR_0x8005, TYPE_GHOST, BattleFrontier_BattleFactoryPreBattleRoom_EventScript_OpponentUsesGhost + call_if_eq VAR_0x8005, TYPE_STEEL, BattleFrontier_BattleFactoryPreBattleRoom_EventScript_OpponentUsesSteel + call_if_eq VAR_0x8005, TYPE_FIRE, BattleFrontier_BattleFactoryPreBattleRoom_EventScript_OpponentUsesFire + call_if_eq VAR_0x8005, TYPE_WATER, BattleFrontier_BattleFactoryPreBattleRoom_EventScript_OpponentUsesWater + call_if_eq VAR_0x8005, TYPE_GRASS, BattleFrontier_BattleFactoryPreBattleRoom_EventScript_OpponentUsesGrass + call_if_eq VAR_0x8005, TYPE_ELECTRIC, BattleFrontier_BattleFactoryPreBattleRoom_EventScript_OpponentUsesElectric + call_if_eq VAR_0x8005, TYPE_PSYCHIC, BattleFrontier_BattleFactoryPreBattleRoom_EventScript_OpponentUsesPsychic + call_if_eq VAR_0x8005, TYPE_ICE, BattleFrontier_BattleFactoryPreBattleRoom_EventScript_OpponentUsesIce + call_if_eq VAR_0x8005, TYPE_DRAGON, BattleFrontier_BattleFactoryPreBattleRoom_EventScript_OpponentUsesDragon + call_if_eq VAR_0x8005, TYPE_DARK, BattleFrontier_BattleFactoryPreBattleRoom_EventScript_OpponentUsesDark + call_if_eq VAR_0x8005, NUMBER_OF_MON_TYPES, BattleFrontier_BattleFactoryPreBattleRoom_EventScript_OpponentHasNoMostCommonType return BattleFrontier_BattleFactoryPreBattleRoom_EventScript_OpponentUsesNormal:: @@ -334,24 +301,15 @@ BattleFrontier_BattleFactoryPreBattleRoom_EventScript_OpponentHasNoMostCommonTyp return BattleFrontier_BattleFactoryPreBattleRoom_EventScript_CommentOnOpponentStyle:: - compare VAR_0x8006, FACTORY_STYLE_NONE - call_if_eq BattleFrontier_BattleFactoryPreBattleRoom_EventScript_StyleUnrestrained - compare VAR_0x8006, FACTORY_STYLE_PREPARATION - call_if_eq BattleFrontier_BattleFactoryPreBattleRoom_EventScript_StyleTotalPreparation - compare VAR_0x8006, FACTORY_STYLE_SLOW_STEADY - call_if_eq BattleFrontier_BattleFactoryPreBattleRoom_EventScript_StyleSlowAndSteady - compare VAR_0x8006, FACTORY_STYLE_ENDURANCE - call_if_eq BattleFrontier_BattleFactoryPreBattleRoom_EventScript_StyleEndurance - compare VAR_0x8006, FACTORY_STYLE_HIGH_RISK - call_if_eq BattleFrontier_BattleFactoryPreBattleRoom_EventScript_StyleHighRisk - compare VAR_0x8006, FACTORY_STYLE_WEAKENING - call_if_eq BattleFrontier_BattleFactoryPreBattleRoom_EventScript_StyleWeakenFoe - compare VAR_0x8006, FACTORY_STYLE_UNPREDICTABLE - call_if_eq BattleFrontier_BattleFactoryPreBattleRoom_EventScript_StyleImpossibleToPredict - compare VAR_0x8006, FACTORY_STYLE_WEATHER - call_if_eq BattleFrontier_BattleFactoryPreBattleRoom_EventScript_StyleDependsOnFlow - compare VAR_0x8006, FACTORY_NUM_STYLES - call_if_eq BattleFrontier_BattleFactoryPreBattleRoom_EventScript_StyleFlexible + call_if_eq VAR_0x8006, FACTORY_STYLE_NONE, BattleFrontier_BattleFactoryPreBattleRoom_EventScript_StyleUnrestrained + call_if_eq VAR_0x8006, FACTORY_STYLE_PREPARATION, BattleFrontier_BattleFactoryPreBattleRoom_EventScript_StyleTotalPreparation + call_if_eq VAR_0x8006, FACTORY_STYLE_SLOW_STEADY, BattleFrontier_BattleFactoryPreBattleRoom_EventScript_StyleSlowAndSteady + call_if_eq VAR_0x8006, FACTORY_STYLE_ENDURANCE, BattleFrontier_BattleFactoryPreBattleRoom_EventScript_StyleEndurance + call_if_eq VAR_0x8006, FACTORY_STYLE_HIGH_RISK, BattleFrontier_BattleFactoryPreBattleRoom_EventScript_StyleHighRisk + call_if_eq VAR_0x8006, FACTORY_STYLE_WEAKENING, BattleFrontier_BattleFactoryPreBattleRoom_EventScript_StyleWeakenFoe + call_if_eq VAR_0x8006, FACTORY_STYLE_UNPREDICTABLE, BattleFrontier_BattleFactoryPreBattleRoom_EventScript_StyleImpossibleToPredict + call_if_eq VAR_0x8006, FACTORY_STYLE_WEATHER, BattleFrontier_BattleFactoryPreBattleRoom_EventScript_StyleDependsOnFlow + call_if_eq VAR_0x8006, FACTORY_NUM_STYLES, BattleFrontier_BattleFactoryPreBattleRoom_EventScript_StyleFlexible return BattleFrontier_BattleFactoryPreBattleRoom_EventScript_StyleUnrestrained:: @@ -394,8 +352,7 @@ BattleFrontier_BattleFactoryPreBattleRoom_EventScript_AskReadyForHead:: message BattleFrontier_BattleFactoryPreBattleRoom_Text_PreparedToFaceHead waitmessage call BattleFrontier_EventScript_GetCantRecordBattle - compare VAR_RESULT, TRUE - goto_if_eq BattleFrontier_BattleFactoryPreBattleRoom_EventScript_AskReadyForHeadNoRecord + goto_if_eq VAR_RESULT, TRUE, BattleFrontier_BattleFactoryPreBattleRoom_EventScript_AskReadyForHeadNoRecord multichoice 19, 4, MULTI_GO_ON_RECORD_REST_RETIRE, TRUE switch VAR_RESULT case 0, BattleFrontier_BattleFactoryPreBattleRoom_EventScript_AskSwapBeforeHead diff --git a/data/maps/BattleFrontier_BattlePalaceBattleRoom/scripts.inc b/data/maps/BattleFrontier_BattlePalaceBattleRoom/scripts.inc index 13015dd3e100..2e9366d44b88 100644 --- a/data/maps/BattleFrontier_BattlePalaceBattleRoom/scripts.inc +++ b/data/maps/BattleFrontier_BattlePalaceBattleRoom/scripts.inc @@ -21,10 +21,8 @@ BattleFrontier_BattlePalaceBattleRoom_OnTransition: BattleFrontier_BattlePalaceBattleRoom_EventScript_SetPlayerGfx:: checkplayergender - compare VAR_RESULT, MALE - goto_if_eq BattleFrontier_BattlePalaceBattleRoom_EventScript_SetPlayerGfxMale - compare VAR_RESULT, FEMALE - goto_if_eq BattleFrontier_BattlePalaceBattleRoom_EventScript_SetPlayerGfxFemale + goto_if_eq VAR_RESULT, MALE, BattleFrontier_BattlePalaceBattleRoom_EventScript_SetPlayerGfxMale + goto_if_eq VAR_RESULT, FEMALE, BattleFrontier_BattlePalaceBattleRoom_EventScript_SetPlayerGfxFemale return @ The opponent's gfx are set to the players by default @@ -45,8 +43,7 @@ BattleFrontier_BattlePalaceBattleRoom_OnFrame: BattleFrontier_BattlePalaceBattleRoom_EventScript_EnterRoom:: showobjectat LOCALID_PLAYER, MAP_BATTLE_FRONTIER_BATTLE_PALACE_BATTLE_ROOM frontier_get FRONTIER_DATA_BATTLE_NUM - compare VAR_RESULT, 0 - goto_if_eq BattleFrontier_BattlePalaceBattleRoom_EventScript_BeginChallenge + goto_if_eq VAR_RESULT, 0, BattleFrontier_BattlePalaceBattleRoom_EventScript_BeginChallenge applymovement LOCALID_PLAYER, BattleFrontier_BattlePalaceBattleRoom_Movement_PlayerReturnToChallenge waitmovement 0 applymovement LOCALID_ATTENDANT, BattleFrontier_BattlePalaceBattleRoom_Movement_FaceDown @@ -95,24 +92,16 @@ BattleFrontier_BattlePalaceBattleRoom_EventScript_DefeatedOpponent:: BattleFrontier_BattlePalaceBattleRoom_EventScript_AskReadyForOpponent:: frontier_getbrainstatus copyvar VAR_TEMP_F, VAR_RESULT - compare VAR_RESULT, FRONTIER_BRAIN_NOT_READY - goto_if_ne BattleFrontier_BattlePalaceBattleRoom_EventScript_MavenUpNext + goto_if_ne VAR_RESULT, FRONTIER_BRAIN_NOT_READY, BattleFrontier_BattlePalaceBattleRoom_EventScript_MavenUpNext frontier_get FRONTIER_DATA_BATTLE_NUM - compare VAR_RESULT, 1 - call_if_eq BattleFrontier_BattlePalaceBattleRoom_EventScript_ReadyFor2ndOpponent - compare VAR_RESULT, 2 - call_if_eq BattleFrontier_BattlePalaceBattleRoom_EventScript_ReadyFor3rdOpponent - compare VAR_RESULT, 3 - call_if_eq BattleFrontier_BattlePalaceBattleRoom_EventScript_ReadyFor4thOpponent - compare VAR_RESULT, 4 - call_if_eq BattleFrontier_BattlePalaceBattleRoom_EventScript_ReadyFor5thOpponent - compare VAR_RESULT, 5 - call_if_eq BattleFrontier_BattlePalaceBattleRoom_EventScript_ReadyFor6thOpponent - compare VAR_RESULT, 6 - call_if_eq BattleFrontier_BattlePalaceBattleRoom_EventScript_ReadyFor7thOpponent + call_if_eq VAR_RESULT, 1, BattleFrontier_BattlePalaceBattleRoom_EventScript_ReadyFor2ndOpponent + call_if_eq VAR_RESULT, 2, BattleFrontier_BattlePalaceBattleRoom_EventScript_ReadyFor3rdOpponent + call_if_eq VAR_RESULT, 3, BattleFrontier_BattlePalaceBattleRoom_EventScript_ReadyFor4thOpponent + call_if_eq VAR_RESULT, 4, BattleFrontier_BattlePalaceBattleRoom_EventScript_ReadyFor5thOpponent + call_if_eq VAR_RESULT, 5, BattleFrontier_BattlePalaceBattleRoom_EventScript_ReadyFor6thOpponent + call_if_eq VAR_RESULT, 6, BattleFrontier_BattlePalaceBattleRoom_EventScript_ReadyFor7thOpponent call BattleFrontier_EventScript_GetCantRecordBattle - compare VAR_RESULT, TRUE - goto_if_eq BattleFrontier_BattlePalaceBattleRoom_EventScript_AskReadyForOpponentNoRecord + goto_if_eq VAR_RESULT, TRUE, BattleFrontier_BattlePalaceBattleRoom_EventScript_AskReadyForOpponentNoRecord multichoice 19, 4, MULTI_GO_ON_RECORD_REST_RETIRE, TRUE switch VAR_RESULT case 0, BattleFrontier_BattlePalaceBattleRoom_EventScript_ContinueChallenge @@ -179,16 +168,14 @@ BattleFrontier_BattlePalaceBattleRoom_EventScript_PauseChallenge:: end BattleFrontier_BattlePalaceBattleRoom_EventScript_MavenUpNext:: - compare VAR_TEMP_2, 1 - goto_if_eq BattleFrontier_BattlePalaceBattleRoom_EventScript_AskReadyForMaven + goto_if_eq VAR_TEMP_2, 1, BattleFrontier_BattlePalaceBattleRoom_EventScript_AskReadyForMaven msgbox BattleFrontier_BattlePalaceBattleRoom_Text_ChallengingPalaceMaven, MSGBOX_DEFAULT setvar VAR_TEMP_2, 1 BattleFrontier_BattlePalaceBattleRoom_EventScript_AskReadyForMaven:: message BattleFrontier_BattlePalaceBattleRoom_Text_ReadyForPalaceMaven waitmessage call BattleFrontier_EventScript_GetCantRecordBattle - compare VAR_RESULT, TRUE - goto_if_eq BattleFrontier_BattlePalaceBattleRoom_EventScript_AskReadyForMavenNoRecord + goto_if_eq VAR_RESULT, TRUE, BattleFrontier_BattlePalaceBattleRoom_EventScript_AskReadyForMavenNoRecord multichoice 19, 4, MULTI_GO_ON_RECORD_REST_RETIRE, TRUE switch VAR_RESULT case 0, BattleFrontier_BattlePalaceBattleRoom_EventScript_BattleSpenser @@ -225,22 +212,19 @@ BattleFrontier_BattlePalaceBattleRoom_EventScript_BattleSpenser:: case FRONTIER_BRAIN_STREAK, BattleFrontier_BattlePalaceBattleRoom_EventScript_BattleSpenserSilver case FRONTIER_BRAIN_STREAK_LONG, BattleFrontier_BattlePalaceBattleRoom_EventScript_BattleSpenserGold frontier_get FRONTIER_DATA_HEARD_BRAIN_SPEECH - compare VAR_RESULT, FALSE - goto_if_ne BattleFrontier_BattlePalaceBattleRoom_EventScript_BattleSpenserSilver + goto_if_ne VAR_RESULT, FALSE, BattleFrontier_BattlePalaceBattleRoom_EventScript_BattleSpenserSilver msgbox BattleFrontier_BattlePalaceBattleRoom_Text_SpenserFirstIntro, MSGBOX_DEFAULT frontier_set FRONTIER_DATA_HEARD_BRAIN_SPEECH BattleFrontier_BattlePalaceBattleRoom_EventScript_BattleSpenserSilver:: msgbox BattleFrontier_BattlePalaceBattleRoom_Text_ProveYourBondWithMons, MSGBOX_DEFAULT call BattleFrontier_BattlePalaceBattleRoom_EventScript_DoPalaceBattle - compare VAR_RESULT, 1 - goto_if_eq BattleFrontier_BattlePalaceBattleRoom_EventScript_DefeatedSpenserSilver + goto_if_eq VAR_RESULT, 1, BattleFrontier_BattlePalaceBattleRoom_EventScript_DefeatedSpenserSilver goto BattleFrontier_BattlePalaceBattleRoom_EventScript_WarpToLobbyLost BattleFrontier_BattlePalaceBattleRoom_EventScript_DefeatedSpenserSilver:: palace_incrementstreak frontier_getsymbols - compare VAR_RESULT, 0 - goto_if_ne BattleFrontier_BattlePalaceBattleRoom_EventScript_WarpToLobbyWon + goto_if_ne VAR_RESULT, 0, BattleFrontier_BattlePalaceBattleRoom_EventScript_WarpToLobbyWon msgbox BattleFrontier_BattlePalaceBattleRoom_Text_SpenserPostSilverBattle, MSGBOX_DEFAULT applymovement LOCALID_PLAYER, BattleFrontier_BattlePalaceBattleRoom_Movement_FaceUp applymovement LOCALID_ATTENDANT, BattleFrontier_BattlePalaceBattleRoom_Movement_FaceDown @@ -260,22 +244,19 @@ BattleFrontier_BattlePalaceBattleRoom_EventScript_DefeatedSpenserSilver:: BattleFrontier_BattlePalaceBattleRoom_EventScript_IntroSpenserGold:: frontier_get FRONTIER_DATA_HEARD_BRAIN_SPEECH - compare VAR_RESULT, FALSE - goto_if_ne BattleFrontier_BattlePalaceBattleRoom_EventScript_BattleSpenserGold + goto_if_ne VAR_RESULT, FALSE, BattleFrontier_BattlePalaceBattleRoom_EventScript_BattleSpenserGold msgbox BattleFrontier_BattlePalaceBattleRoom_Text_SpenserThisTimeWontHoldBack, MSGBOX_DEFAULT frontier_set FRONTIER_DATA_HEARD_BRAIN_SPEECH BattleFrontier_BattlePalaceBattleRoom_EventScript_BattleSpenserGold:: msgbox BattleFrontier_BattlePalaceBattleRoom_Text_Kaaah, MSGBOX_DEFAULT call BattleFrontier_BattlePalaceBattleRoom_EventScript_DoPalaceBattle - compare VAR_RESULT, 1 - goto_if_eq BattleFrontier_BattlePalaceBattleRoom_EventScript_DefeatedSpenserGold + goto_if_eq VAR_RESULT, 1, BattleFrontier_BattlePalaceBattleRoom_EventScript_DefeatedSpenserGold goto BattleFrontier_BattlePalaceBattleRoom_EventScript_WarpToLobbyLost BattleFrontier_BattlePalaceBattleRoom_EventScript_DefeatedSpenserGold:: palace_incrementstreak frontier_getsymbols - compare VAR_RESULT, 2 - goto_if_eq BattleFrontier_BattlePalaceBattleRoom_EventScript_WarpToLobbyWon + goto_if_eq VAR_RESULT, 2, BattleFrontier_BattlePalaceBattleRoom_EventScript_WarpToLobbyWon msgbox BattleFrontier_BattlePalaceBattleRoom_Text_SpenserYourTeamIsAdmirable, MSGBOX_DEFAULT applymovement LOCALID_PLAYER, BattleFrontier_BattlePalaceBattleRoom_Movement_FaceUp applymovement LOCALID_ATTENDANT, BattleFrontier_BattlePalaceBattleRoom_Movement_FaceDown @@ -417,14 +398,13 @@ BattleFrontier_BattlePalaceBattleRoom_Movement_UnusedOpponentEnter3: BattleFrontier_BattlePalaceBattleRoom_EventScript_WarpToLobby:: copyvar VAR_RESULT, VAR_FRONTIER_BATTLE_MODE - compare VAR_RESULT, FRONTIER_MODE_DOUBLES - goto_if_eq BattleFrontier_BattlePalaceBattleRoom_EventScript_WarpToLobbyDoubles - warp MAP_BATTLE_FRONTIER_BATTLE_PALACE_LOBBY, 255, 5, 7 + goto_if_eq VAR_RESULT, FRONTIER_MODE_DOUBLES, BattleFrontier_BattlePalaceBattleRoom_EventScript_WarpToLobbyDoubles + warp MAP_BATTLE_FRONTIER_BATTLE_PALACE_LOBBY, 5, 7 waitstate end BattleFrontier_BattlePalaceBattleRoom_EventScript_WarpToLobbyDoubles:: - warp MAP_BATTLE_FRONTIER_BATTLE_PALACE_LOBBY, 255, 19, 7 + warp MAP_BATTLE_FRONTIER_BATTLE_PALACE_LOBBY, 19, 7 waitstate end diff --git a/data/maps/BattleFrontier_BattlePalaceCorridor/scripts.inc b/data/maps/BattleFrontier_BattlePalaceCorridor/scripts.inc index 011170bae846..ad2a2ee9f5b7 100644 --- a/data/maps/BattleFrontier_BattlePalaceCorridor/scripts.inc +++ b/data/maps/BattleFrontier_BattlePalaceCorridor/scripts.inc @@ -15,20 +15,14 @@ BattleFrontier_BattlePalaceCorridor_EventScript_WalkThroughCorridor:: waitmovement 0 lockall palace_getcomment - compare VAR_RESULT, 0 - call_if_eq BattleFrontier_BattlePalaceCorridor_EventScript_RandomComment1 - compare VAR_RESULT, 1 - call_if_eq BattleFrontier_BattlePalaceCorridor_EventScript_RandomComment2 - compare VAR_RESULT, 2 - call_if_eq BattleFrontier_BattlePalaceCorridor_EventScript_RandomComment3 - compare VAR_RESULT, 3 - call_if_eq BattleFrontier_BattlePalaceCorridor_EventScript_StreakComment - compare VAR_RESULT, 4 - call_if_eq BattleFrontier_BattlePalaceCorridor_EventScript_LongStreakComment + call_if_eq VAR_RESULT, 0, BattleFrontier_BattlePalaceCorridor_EventScript_RandomComment1 + call_if_eq VAR_RESULT, 1, BattleFrontier_BattlePalaceCorridor_EventScript_RandomComment2 + call_if_eq VAR_RESULT, 2, BattleFrontier_BattlePalaceCorridor_EventScript_RandomComment3 + call_if_eq VAR_RESULT, 3, BattleFrontier_BattlePalaceCorridor_EventScript_StreakComment + call_if_eq VAR_RESULT, 4, BattleFrontier_BattlePalaceCorridor_EventScript_LongStreakComment closemessage frontier_get FRONTIER_DATA_LVL_MODE - compare VAR_RESULT, FRONTIER_LVL_OPEN - goto_if_eq BattleFrontier_BattlePalaceCorridor_EventScript_WalkToOpenBattleRoom + goto_if_eq VAR_RESULT, FRONTIER_LVL_OPEN, BattleFrontier_BattlePalaceCorridor_EventScript_WalkToOpenBattleRoom applymovement LOCALID_ATTENDANT, BattleFrontier_BattlePalaceCorridor_Movement_AttendantWalkTo50BattleRoom applymovement OBJ_EVENT_ID_PLAYER, BattleFrontier_BattlePalaceCorridor_Movement_PlayerWalkTo50BattleRoom waitmovement 0 @@ -53,7 +47,7 @@ BattleFrontier_BattlePalaceCorridor_EventScript_WalkToOpenBattleRoom:: closedoor 10, 3 waitdooranim BattleFrontier_BattlePalaceCorridor_EventScript_WarpToBattleRoom:: - warp MAP_BATTLE_FRONTIER_BATTLE_PALACE_BATTLE_ROOM, 255, 7, 4 + warp MAP_BATTLE_FRONTIER_BATTLE_PALACE_BATTLE_ROOM, 7, 4 waitstate end diff --git a/data/maps/BattleFrontier_BattlePalaceLobby/scripts.inc b/data/maps/BattleFrontier_BattlePalaceLobby/scripts.inc index a51fa48fde8a..481f7000db81 100644 --- a/data/maps/BattleFrontier_BattlePalaceLobby/scripts.inc +++ b/data/maps/BattleFrontier_BattlePalaceLobby/scripts.inc @@ -41,8 +41,7 @@ BattleFrontier_BattlePalaceLobby_EventScript_QuitWithoutSaving:: BattleFrontier_BattlePalaceLobby_EventScript_WonChallenge:: lockall frontier_isbrain - compare VAR_RESULT, TRUE - goto_if_eq BattleFrontier_BattlePalaceLobby_EventScript_DefeatedMaven + goto_if_eq VAR_RESULT, TRUE, BattleFrontier_BattlePalaceLobby_EventScript_DefeatedMaven msgbox BattleFrontier_BattlePalaceLobby_Text_FirmTrueBondsFor7WinStreak, MSGBOX_DEFAULT goto BattleFrontier_BattlePalaceLobby_EventScript_GiveBattlePoints @@ -81,8 +80,7 @@ BattleFrontier_BattlePalaceLobby_EventScript_SaveAfterChallenge:: playse SE_SAVE waitse call BattleFrontier_EventScript_GetCantRecordBattle - compare VAR_RESULT, TRUE - goto_if_eq BattleFrontier_BattlePalaceLobby_EventScript_EndSaveAfterChallenge + goto_if_eq VAR_RESULT, TRUE, BattleFrontier_BattlePalaceLobby_EventScript_EndSaveAfterChallenge message BattleFrontier_BattlePalaceLobby_Text_LikeToRecordMatch waitmessage multichoicedefault 20, 8, MULTI_YESNO, 1, FALSE @@ -126,18 +124,13 @@ BattleFrontier_BattlePalaceLobby_EventScript_DoublesAttendant:: BattleFrontier_BattlePalaceLobby_EventScript_Attendant:: palace_get PALACE_DATA_PRIZE - compare VAR_RESULT, ITEM_NONE - goto_if_ne BattleFrontier_BattlePalaceLobby_EventScript_WonChallenge + goto_if_ne VAR_RESULT, ITEM_NONE, BattleFrontier_BattlePalaceLobby_EventScript_WonChallenge special SavePlayerParty - compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_SINGLES - call_if_eq BattleFrontier_BattlePalaceLobby_EventScript_WelcomeForSingleBattle - compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_DOUBLES - call_if_eq BattleFrontier_BattlePalaceLobby_EventScript_WelcomeForDoubleBattle + call_if_eq VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_SINGLES, BattleFrontier_BattlePalaceLobby_EventScript_WelcomeForSingleBattle + call_if_eq VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_DOUBLES, BattleFrontier_BattlePalaceLobby_EventScript_WelcomeForDoubleBattle BattleFrontier_BattlePalaceLobby_EventScript_AskTakeChallenge:: - compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_SINGLES - call_if_eq BattleFrontier_BattlePalaceLobby_EventScript_AskTakeSingleBattleChallenge - compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_DOUBLES - call_if_eq BattleFrontier_BattlePalaceLobby_EventScript_AskTakeDoubleBattleChallenge + call_if_eq VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_SINGLES, BattleFrontier_BattlePalaceLobby_EventScript_AskTakeSingleBattleChallenge + call_if_eq VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_DOUBLES, BattleFrontier_BattlePalaceLobby_EventScript_AskTakeDoubleBattleChallenge waitmessage multichoice 17, 6, MULTI_CHALLENGEINFO, FALSE switch VAR_RESULT @@ -154,8 +147,7 @@ BattleFrontier_BattlePalaceLobby_EventScript_TryEnterChallenge:: case FRONTIER_LVL_TENT, BattleFrontier_BattlePalaceLobby_EventScript_CancelChallenge case MULTI_B_PRESSED, BattleFrontier_BattlePalaceLobby_EventScript_CancelChallenge frontier_checkineligible - compare VAR_0x8004, TRUE - goto_if_eq BattleFrontier_BattlePalaceLobby_EventScript_NotEnoughValidMons + goto_if_eq VAR_0x8004, TRUE, BattleFrontier_BattlePalaceLobby_EventScript_NotEnoughValidMons frontier_set FRONTIER_DATA_LVL_MODE, VAR_RESULT msgbox BattleFrontier_BattlePalaceLobby_Text_NowSelectThreeMons, MSGBOX_DEFAULT fadescreen FADE_TO_BLACK @@ -164,8 +156,7 @@ BattleFrontier_BattlePalaceLobby_EventScript_TryEnterChallenge:: setvar VAR_0x8005, FRONTIER_PARTY_SIZE special ChoosePartyForBattleFrontier waitstate - compare VAR_RESULT, 0 - goto_if_eq BattleFrontier_BattlePalaceLobby_EventScript_LoadPartyAndCancelChallenge + goto_if_eq VAR_RESULT, 0, BattleFrontier_BattlePalaceLobby_EventScript_LoadPartyAndCancelChallenge msgbox BattleFrontier_BattlePalaceLobby_Text_MustSaveBeforeChallenge2, MSGBOX_YESNO switch VAR_RESULT case NO, BattleFrontier_BattlePalaceLobby_EventScript_LoadPartyAndCancelChallenge @@ -184,22 +175,20 @@ BattleFrontier_BattlePalaceLobby_EventScript_SaveBeforeChallenge:: delay 2 call Common_EventScript_SaveGame setvar VAR_TEMP_0, 255 - compare VAR_RESULT, 0 - goto_if_eq BattleFrontier_BattlePalaceLobby_EventScript_CancelChallengeSaveFailed + goto_if_eq VAR_RESULT, 0, BattleFrontier_BattlePalaceLobby_EventScript_CancelChallengeSaveFailed BattleFrontier_BattlePalaceLobby_EventScript_EnterChallenge:: special SavePlayerParty frontier_setpartyorder FRONTIER_PARTY_SIZE msgbox BattleFrontier_BattlePalaceLobby_Text_FollowMe, MSGBOX_DEFAULT closemessage call BattleFrontier_BattlePalaceLobby_EventScript_WalkToDoor - warp MAP_BATTLE_FRONTIER_BATTLE_PALACE_CORRIDOR, 255, 8, 13 + warp MAP_BATTLE_FRONTIER_BATTLE_PALACE_CORRIDOR, 8, 13 setvar VAR_TEMP_0, 0 waitstate end BattleFrontier_BattlePalaceLobby_EventScript_ExplainChallenge:: - compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_DOUBLES - goto_if_eq BattleFrontier_BattlePalaceLobby_EventScript_ExplainDoublesChallenge + goto_if_eq VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_DOUBLES, BattleFrontier_BattlePalaceLobby_EventScript_ExplainDoublesChallenge msgbox BattleFrontier_BattlePalaceLobby_Text_ExplainSingleBattleChallenge, MSGBOX_DEFAULT goto BattleFrontier_BattlePalaceLobby_EventScript_AskTakeChallenge @@ -249,25 +238,19 @@ BattleFrontier_BattlePalaceLobby_EventScript_AskTakeDoubleBattleChallenge:: return BattleFrontier_BattlePalaceLobby_EventScript_WalkToDoor:: - compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_SINGLES - call_if_eq BattleFrontier_BattlePalaceLobby_EventScript_TalkedToSinglesAttendant - compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_DOUBLES - call_if_eq BattleFrontier_BattlePalaceLobby_EventScript_TalkedToDoublesAttendant + call_if_eq VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_SINGLES, BattleFrontier_BattlePalaceLobby_EventScript_TalkedToSinglesAttendant + call_if_eq VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_DOUBLES, BattleFrontier_BattlePalaceLobby_EventScript_TalkedToDoublesAttendant applymovement VAR_LAST_TALKED, BattleFrontier_BattlePalaceLobby_Movement_WalkToDoor applymovement OBJ_EVENT_ID_PLAYER, BattleFrontier_BattlePalaceLobby_Movement_WalkToDoor waitmovement 0 - compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_SINGLES - call_if_eq BattleFrontier_BattlePalaceLobby_EventScript_OpenSinglesHallDoor - compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_DOUBLES - call_if_eq BattleFrontier_BattlePalaceLobby_EventScript_OpenDoublesHallDoor + call_if_eq VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_SINGLES, BattleFrontier_BattlePalaceLobby_EventScript_OpenSinglesHallDoor + call_if_eq VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_DOUBLES, BattleFrontier_BattlePalaceLobby_EventScript_OpenDoublesHallDoor waitdooranim applymovement VAR_LAST_TALKED, BattleFrontier_BattlePalaceLobby_Movement_AttendantEnterDoor applymovement OBJ_EVENT_ID_PLAYER, BattleFrontier_BattlePalaceLobby_Movement_PlayerEnterDoor waitmovement 0 - compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_SINGLES - call_if_eq BattleFrontier_BattlePalaceLobby_EventScript_CloseSinglesHallDoor - compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_DOUBLES - call_if_eq BattleFrontier_BattlePalaceLobby_EventScript_CloseDoublesHallDoor + call_if_eq VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_SINGLES, BattleFrontier_BattlePalaceLobby_EventScript_CloseSinglesHallDoor + call_if_eq VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_DOUBLES, BattleFrontier_BattlePalaceLobby_EventScript_CloseDoublesHallDoor waitdooranim return diff --git a/data/maps/BattleFrontier_BattlePikeCorridor/scripts.inc b/data/maps/BattleFrontier_BattlePikeCorridor/scripts.inc index 44539747b812..fe2c6ed00f50 100644 --- a/data/maps/BattleFrontier_BattlePikeCorridor/scripts.inc +++ b/data/maps/BattleFrontier_BattlePikeCorridor/scripts.inc @@ -25,7 +25,7 @@ BattleFrontier_BattlePikeCorridor_EventScript_EnterCorridor:: waitmovement 0 frontier_set FRONTIER_DATA_CHALLENGE_STATUS, 99 call BattleFrontier_BattlePike_EventScript_CloseCurtain - warpsilent MAP_BATTLE_FRONTIER_BATTLE_PIKE_THREE_PATH_ROOM, 255, 6, 10 + warpsilent MAP_BATTLE_FRONTIER_BATTLE_PIKE_THREE_PATH_ROOM, 6, 10 waitstate end diff --git a/data/maps/BattleFrontier_BattlePikeLobby/scripts.inc b/data/maps/BattleFrontier_BattlePikeLobby/scripts.inc index ecbbafef245a..fb91ee752a23 100644 --- a/data/maps/BattleFrontier_BattlePikeLobby/scripts.inc +++ b/data/maps/BattleFrontier_BattlePikeLobby/scripts.inc @@ -41,8 +41,7 @@ BattleFrontier_BattlePikeLobby_EventScript_QuitWithoutSaving:: BattleFrontier_BattlePikeLobby_EventScript_WonChallenge:: lockall frontier_isbrain - compare VAR_RESULT, TRUE - goto_if_eq BattleFrontier_BattlePikeLobby_EventScript_DefeatedQueen + goto_if_eq VAR_RESULT, TRUE, BattleFrontier_BattlePikeLobby_EventScript_DefeatedQueen msgbox BattleFrontier_BattlePikeLobby_Text_PossessLuckInAbundance, MSGBOX_DEFAULT waitmessage goto BattleFrontier_BattlePikeLobby_EventScript_GiveBattlePoints @@ -116,8 +115,7 @@ BattleFrontier_BattlePikeLobby_EventScript_TryEnterChallenge:: case FRONTIER_LVL_TENT, BattleFrontier_BattlePikeLobby_EventScript_CancelChallenge case MULTI_B_PRESSED, BattleFrontier_BattlePikeLobby_EventScript_CancelChallenge frontier_checkineligible - compare VAR_0x8004, TRUE - goto_if_eq BattleFrontier_BattlePikeLobby_EventScript_NotEnoughValidMons + goto_if_eq VAR_0x8004, TRUE, BattleFrontier_BattlePikeLobby_EventScript_NotEnoughValidMons frontier_set FRONTIER_DATA_LVL_MODE, VAR_RESULT msgbox BattleFrontier_BattlePikeLobby_Text_PleaseChooseThreeMons, MSGBOX_DEFAULT fadescreen FADE_TO_BLACK @@ -126,8 +124,7 @@ BattleFrontier_BattlePikeLobby_EventScript_TryEnterChallenge:: setvar VAR_0x8005, FRONTIER_PARTY_SIZE special ChoosePartyForBattleFrontier waitstate - compare VAR_RESULT, 0 - goto_if_eq BattleFrontier_BattlePikeLobby_EventScript_LoadPartyAndCancelChallenge + goto_if_eq VAR_RESULT, 0, BattleFrontier_BattlePikeLobby_EventScript_LoadPartyAndCancelChallenge msgbox BattleFrontier_BattlePikeLobby_Text_SaveBeforeChallenge, MSGBOX_YESNO switch VAR_RESULT case NO, BattleFrontier_BattlePikeLobby_EventScript_LoadPartyAndCancelChallenge @@ -149,8 +146,7 @@ BattleFrontier_BattlePikeLobby_EventScript_SaveBeforeChallenge:: call Common_EventScript_SaveGame setvar VAR_TEMP_0, 255 pike_savehelditems - compare VAR_RESULT, 0 - goto_if_eq BattleFrontier_BattlePikeLobby_EventScript_CancelChallengeSaveFailed + goto_if_eq VAR_RESULT, 0, BattleFrontier_BattlePikeLobby_EventScript_CancelChallengeSaveFailed special SavePlayerParty frontier_setpartyorder FRONTIER_PARTY_SIZE msgbox BattleFrontier_BattlePikeLobby_Text_StepThisWay, MSGBOX_DEFAULT @@ -159,7 +155,7 @@ BattleFrontier_BattlePikeLobby_EventScript_SaveBeforeChallenge:: call BattleFrontier_BattlePikeLobby_EventScript_WalkToCorridor special HealPlayerParty call BattleFrontier_BattlePike_EventScript_CloseCurtain - warpsilent MAP_BATTLE_FRONTIER_BATTLE_PIKE_CORRIDOR, 255, 6, 7 + warpsilent MAP_BATTLE_FRONTIER_BATTLE_PIKE_CORRIDOR, 6, 7 setvar VAR_TEMP_0, 0 waitstate end diff --git a/data/maps/BattleFrontier_BattlePikeRoomFinal/scripts.inc b/data/maps/BattleFrontier_BattlePikeRoomFinal/scripts.inc index 15ebbeb3fd19..e0246ed57de7 100644 --- a/data/maps/BattleFrontier_BattlePikeRoomFinal/scripts.inc +++ b/data/maps/BattleFrontier_BattlePikeRoomFinal/scripts.inc @@ -18,7 +18,7 @@ BattleFrontier_BattlePikeRoomFinal_EventScript_EnterRoom:: msgbox BattleFrontier_BattlePikeRoomFinal_Text_CongratsThisWayPlease, MSGBOX_DEFAULT closemessage releaseall - warp MAP_BATTLE_FRONTIER_BATTLE_PIKE_LOBBY, 255, 5, 6 + warp MAP_BATTLE_FRONTIER_BATTLE_PIKE_LOBBY, 5, 6 waitstate end diff --git a/data/maps/BattleFrontier_BattlePikeRoomNormal/scripts.inc b/data/maps/BattleFrontier_BattlePikeRoomNormal/scripts.inc index 5bd04bfb4035..9d060214de6d 100644 --- a/data/maps/BattleFrontier_BattlePikeRoomNormal/scripts.inc +++ b/data/maps/BattleFrontier_BattlePikeRoomNormal/scripts.inc @@ -44,7 +44,7 @@ BattleFrontier_BattlePikeRoomNormal_EventScript_EnterSingleBattleRoom:: case 1, BattleFrontier_BattlePikeRoomNormal_EventScript_WonSingleBattle BattleFrontier_BattlePikeRoomNormal_EventScript_WarpToLobbyLost:: frontier_set FRONTIER_DATA_CHALLENGE_STATUS, CHALLENGE_STATUS_LOST - warp MAP_BATTLE_FRONTIER_BATTLE_PIKE_LOBBY, 255, 5, 6 + warp MAP_BATTLE_FRONTIER_BATTLE_PIKE_LOBBY, 5, 6 waitstate end @@ -137,21 +137,18 @@ BattleFrontier_BattlePikeRoomNormal_EventScript_LucyEnter:: case FRONTIER_BRAIN_STREAK, BattleFrontier_BattlePikeRoomNormal_EventScript_BattleLucySilver case FRONTIER_BRAIN_STREAK_LONG, BattleFrontier_BattlePikeRoomNormal_EventScript_BattleLucyGold frontier_get FRONTIER_DATA_HEARD_BRAIN_SPEECH - compare VAR_RESULT, FALSE - goto_if_ne BattleFrontier_BattlePikeRoomNormal_EventScript_BattleLucySilver + goto_if_ne VAR_RESULT, FALSE, BattleFrontier_BattlePikeRoomNormal_EventScript_BattleLucySilver msgbox BattleFrontier_BattlePikeRoomNormal_Text_ImThePikeQueen, MSGBOX_DEFAULT frontier_set FRONTIER_DATA_HEARD_BRAIN_SPEECH BattleFrontier_BattlePikeRoomNormal_EventScript_BattleLucySilver:: msgbox BattleFrontier_BattlePikeRoomNormal_Text_HopeYouDidntUseUpLuck, MSGBOX_DEFAULT call BattleFrontier_BattlePikeRoomNormal_EventScript_DoPikeQueenBattle - compare VAR_RESULT, 1 - goto_if_eq BattleFrontier_BattlePikeRoomNormal_EventScript_DefeatedLucySilver + goto_if_eq VAR_RESULT, 1, BattleFrontier_BattlePikeRoomNormal_EventScript_DefeatedLucySilver goto BattleFrontier_BattlePikeRoomNormal_EventScript_WarpToLobbyLost BattleFrontier_BattlePikeRoomNormal_EventScript_DefeatedLucySilver:: frontier_getsymbols - compare VAR_RESULT, 0 - goto_if_ne BattleFrontier_BattlePikeRoomNormal_EventScript_DefeatedLucy + goto_if_ne VAR_RESULT, 0, BattleFrontier_BattlePikeRoomNormal_EventScript_DefeatedLucy msgbox BattleFrontier_BattlePikeRoomNormal_Text_LucyShowMeFrontierPass, MSGBOX_DEFAULT waitmessage playfanfare MUS_OBTAIN_SYMBOL @@ -165,21 +162,18 @@ BattleFrontier_BattlePikeRoomNormal_EventScript_DefeatedLucySilver:: BattleFrontier_BattlePikeRoomNormal_EventScript_IntroLucyGold:: frontier_get FRONTIER_DATA_HEARD_BRAIN_SPEECH - compare VAR_RESULT, FALSE - goto_if_ne BattleFrontier_BattlePikeRoomNormal_EventScript_BattleLucyGold + goto_if_ne VAR_RESULT, FALSE, BattleFrontier_BattlePikeRoomNormal_EventScript_BattleLucyGold msgbox BattleFrontier_BattlePikeRoomNormal_Text_LucyYouAgain, MSGBOX_DEFAULT frontier_set FRONTIER_DATA_HEARD_BRAIN_SPEECH BattleFrontier_BattlePikeRoomNormal_EventScript_BattleLucyGold:: msgbox BattleFrontier_BattlePikeRoomNormal_Text_NowComeOn, MSGBOX_DEFAULT call BattleFrontier_BattlePikeRoomNormal_EventScript_DoPikeQueenBattle - compare VAR_RESULT, 1 - goto_if_eq BattleFrontier_BattlePikeRoomNormal_EventScript_DefeatedLucyGold + goto_if_eq VAR_RESULT, 1, BattleFrontier_BattlePikeRoomNormal_EventScript_DefeatedLucyGold goto BattleFrontier_BattlePikeRoomNormal_EventScript_WarpToLobbyLost BattleFrontier_BattlePikeRoomNormal_EventScript_DefeatedLucyGold:: frontier_getsymbols - compare VAR_RESULT, 2 - goto_if_eq BattleFrontier_BattlePikeRoomNormal_EventScript_DefeatedLucy + goto_if_eq VAR_RESULT, 2, BattleFrontier_BattlePikeRoomNormal_EventScript_DefeatedLucy msgbox BattleFrontier_BattlePikeRoomNormal_Text_LucyFrontierPass, MSGBOX_DEFAULT waitmessage playfanfare MUS_OBTAIN_SYMBOL @@ -290,10 +284,8 @@ BattleFrontier_BattlePikeRoomNormal_EventScript_EnterStatusRoom:: waitmovement 0 pike_getstatusmon copyvar VAR_0x8004, VAR_RESULT - compare VAR_0x8004, PIKE_STATUSMON_KIRLIA - call_if_eq BattleFrontier_BattlePikeRoomNormal_EventScript_KirliaAttack - compare VAR_0x8004, PIKE_STATUSMON_DUSCLOPS - call_if_eq BattleFrontier_BattlePikeRoomNormal_EventScript_DusclopsAttack + call_if_eq VAR_0x8004, PIKE_STATUSMON_KIRLIA, BattleFrontier_BattlePikeRoomNormal_EventScript_KirliaAttack + call_if_eq VAR_0x8004, PIKE_STATUSMON_DUSCLOPS, BattleFrontier_BattlePikeRoomNormal_EventScript_DusclopsAttack msgbox BattleFrontier_BattlePikeRoomNormal_Text_AttacksWhenStartled, MSGBOX_DEFAULT closemessage releaseall @@ -306,14 +298,10 @@ BattleFrontier_BattlePikeRoomNormal_EventScript_KirliaAttack:: playmoncry SPECIES_KIRLIA, CRY_MODE_NORMAL waitmoncry pike_getstatus - compare VAR_RESULT, PIKE_STATUS_TOXIC - call_if_eq BattleFrontier_BattlePikeRoomNormal_EventScript_KirliaUsedToxic - compare VAR_RESULT, PIKE_STATUS_BURN - call_if_eq BattleFrontier_BattlePikeRoomNormal_EventScript_KirliaUsedWillOWisp - compare VAR_RESULT, PIKE_STATUS_PARALYSIS - call_if_eq BattleFrontier_BattlePikeRoomNormal_EventScript_KirliaUsedThunderWave - compare VAR_RESULT, PIKE_STATUS_SLEEP - call_if_eq BattleFrontier_BattlePikeRoomNormal_EventScript_KirliaUsedHypnosis + call_if_eq VAR_RESULT, PIKE_STATUS_TOXIC, BattleFrontier_BattlePikeRoomNormal_EventScript_KirliaUsedToxic + call_if_eq VAR_RESULT, PIKE_STATUS_BURN, BattleFrontier_BattlePikeRoomNormal_EventScript_KirliaUsedWillOWisp + call_if_eq VAR_RESULT, PIKE_STATUS_PARALYSIS, BattleFrontier_BattlePikeRoomNormal_EventScript_KirliaUsedThunderWave + call_if_eq VAR_RESULT, PIKE_STATUS_SLEEP, BattleFrontier_BattlePikeRoomNormal_EventScript_KirliaUsedHypnosis pike_flashscreen waitstate applymovement LOCALID_OBJ_0, BattleFrontier_BattlePikeRoomNormal_Movement_NPCApproachMon @@ -341,10 +329,8 @@ BattleFrontier_BattlePikeRoomNormal_EventScript_DusclopsAttack:: playmoncry SPECIES_DUSCLOPS, CRY_MODE_NORMAL waitmoncry pike_getstatus - compare VAR_RESULT, PIKE_STATUS_FREEZE - call_if_eq BattleFrontier_BattlePikeRoomNormal_EventScript_DusclopsUsedIceBeam - compare VAR_RESULT, PIKE_STATUS_BURN - call_if_eq BattleFrontier_BattlePikeRoomNormal_EventScript_DusclopsUsedWillOWisp + call_if_eq VAR_RESULT, PIKE_STATUS_FREEZE, BattleFrontier_BattlePikeRoomNormal_EventScript_DusclopsUsedIceBeam + call_if_eq VAR_RESULT, PIKE_STATUS_BURN, BattleFrontier_BattlePikeRoomNormal_EventScript_DusclopsUsedWillOWisp pike_flashscreen waitstate applymovement LOCALID_OBJ_0, BattleFrontier_BattlePikeRoomNormal_Movement_NPCApproachMon @@ -569,10 +555,8 @@ BattleFrontier_BattlePikeRoomNormal_EventScript_StatusNPC:: BattleFrontier_BattlePikeRoomNormal_EventScript_HealNPC:: pike_healonetwomons - compare VAR_RESULT, 2 - call_if_eq BattleFrontier_BattlePikeRoomNormal_EventScript_WillRestoreTwoMons - compare VAR_RESULT, 1 - call_if_eq BattleFrontier_BattlePikeRoomNormal_EventScript_WillRestoreOneMon + call_if_eq VAR_RESULT, 2, BattleFrontier_BattlePikeRoomNormal_EventScript_WillRestoreTwoMons + call_if_eq VAR_RESULT, 1, BattleFrontier_BattlePikeRoomNormal_EventScript_WillRestoreOneMon playfanfare MUS_HEAL waitfanfare msgbox BattleFrontier_BattlePikeRoomNormal_Text_BestOfLuckFarewell, MSGBOX_DEFAULT @@ -608,46 +592,46 @@ BattleFrontier_BattlePikeRoomNormal_EventScript_StatusMon:: end BattleFrontier_BattlePikeRoomNormal_EventScript_SetCurtainTilesMostlyClosed:: - setmetatile 4, 1, METATILE_BattlePike_Curtain_Stage1_Tile0, 1 - setmetatile 3, 2, METATILE_BattlePike_Curtain_Stage1_Tile1, 1 - setmetatile 4, 2, METATILE_BattlePike_Curtain_Stage1_Tile2, 1 - setmetatile 5, 2, METATILE_BattlePike_Curtain_Stage1_Tile3, 1 - setmetatile 3, 3, METATILE_BattlePike_Curtain_Stage1_Tile4, 1 - setmetatile 4, 3, METATILE_BattlePike_Curtain_Stage1_Tile5, 0 - setmetatile 5, 3, METATILE_BattlePike_Curtain_Stage1_Tile6, 1 + setmetatile 4, 1, METATILE_BattlePike_Curtain_Stage1_Tile0, TRUE + setmetatile 3, 2, METATILE_BattlePike_Curtain_Stage1_Tile1, TRUE + setmetatile 4, 2, METATILE_BattlePike_Curtain_Stage1_Tile2, TRUE + setmetatile 5, 2, METATILE_BattlePike_Curtain_Stage1_Tile3, TRUE + setmetatile 3, 3, METATILE_BattlePike_Curtain_Stage1_Tile4, TRUE + setmetatile 4, 3, METATILE_BattlePike_Curtain_Stage1_Tile5, FALSE + setmetatile 5, 3, METATILE_BattlePike_Curtain_Stage1_Tile6, TRUE special DrawWholeMapView return BattleFrontier_BattlePikeRoomNormal_EventScript_SetCurtainTilesLittleClosed:: - setmetatile 4, 1, METATILE_BattlePike_Curtain_Stage2_Tile0, 1 - setmetatile 3, 2, METATILE_BattlePike_Curtain_Stage2_Tile1, 1 - setmetatile 4, 2, METATILE_BattlePike_Curtain_Stage2_Tile2, 1 - setmetatile 5, 2, METATILE_BattlePike_Curtain_Stage2_Tile3, 1 - setmetatile 3, 3, METATILE_BattlePike_Curtain_Stage2_Tile4, 1 - setmetatile 4, 3, METATILE_BattlePike_Curtain_Stage2_Tile5, 0 - setmetatile 5, 3, METATILE_BattlePike_Curtain_Stage2_Tile6, 1 + setmetatile 4, 1, METATILE_BattlePike_Curtain_Stage2_Tile0, TRUE + setmetatile 3, 2, METATILE_BattlePike_Curtain_Stage2_Tile1, TRUE + setmetatile 4, 2, METATILE_BattlePike_Curtain_Stage2_Tile2, TRUE + setmetatile 5, 2, METATILE_BattlePike_Curtain_Stage2_Tile3, TRUE + setmetatile 3, 3, METATILE_BattlePike_Curtain_Stage2_Tile4, TRUE + setmetatile 4, 3, METATILE_BattlePike_Curtain_Stage2_Tile5, FALSE + setmetatile 5, 3, METATILE_BattlePike_Curtain_Stage2_Tile6, TRUE special DrawWholeMapView return BattleFrontier_BattlePikeRoomNormal_EventScript_SetCurtainTilesOpen:: - setmetatile 4, 1, METATILE_BattlePike_Curtain_Stage3_Tile0, 1 - setmetatile 3, 2, METATILE_BattlePike_Curtain_Stage3_Tile1, 1 - setmetatile 4, 2, METATILE_BattlePike_Curtain_Stage3_Tile2, 1 - setmetatile 5, 2, METATILE_BattlePike_Curtain_Stage3_Tile3, 1 - setmetatile 3, 3, METATILE_BattlePike_Curtain_Stage3_Tile4, 1 - setmetatile 4, 3, METATILE_BattlePike_Curtain_Stage3_Tile5, 0 - setmetatile 5, 3, METATILE_BattlePike_Curtain_Stage3_Tile6, 1 + setmetatile 4, 1, METATILE_BattlePike_Curtain_Stage3_Tile0, TRUE + setmetatile 3, 2, METATILE_BattlePike_Curtain_Stage3_Tile1, TRUE + setmetatile 4, 2, METATILE_BattlePike_Curtain_Stage3_Tile2, TRUE + setmetatile 5, 2, METATILE_BattlePike_Curtain_Stage3_Tile3, TRUE + setmetatile 3, 3, METATILE_BattlePike_Curtain_Stage3_Tile4, TRUE + setmetatile 4, 3, METATILE_BattlePike_Curtain_Stage3_Tile5, FALSE + setmetatile 5, 3, METATILE_BattlePike_Curtain_Stage3_Tile6, TRUE special DrawWholeMapView return BattleFrontier_BattlePikeRoomNormal_EventScript_SetCurtainTilesClosed:: - setmetatile 4, 1, METATILE_BattlePike_Curtain_Stage0_Tile0, 1 - setmetatile 3, 2, METATILE_BattlePike_Curtain_Stage0_Tile1, 1 - setmetatile 4, 2, METATILE_BattlePike_Curtain_Stage0_Tile2, 1 - setmetatile 5, 2, METATILE_BattlePike_Curtain_Stage0_Tile3, 1 - setmetatile 3, 3, METATILE_BattlePike_Curtain_Stage0_Tile4, 1 - setmetatile 4, 3, METATILE_BattlePike_Curtain_Stage0_Tile5, 0 - setmetatile 5, 3, METATILE_BattlePike_Curtain_Stage0_Tile6, 1 + setmetatile 4, 1, METATILE_BattlePike_Curtain_Stage0_Tile0, TRUE + setmetatile 3, 2, METATILE_BattlePike_Curtain_Stage0_Tile1, TRUE + setmetatile 4, 2, METATILE_BattlePike_Curtain_Stage0_Tile2, TRUE + setmetatile 5, 2, METATILE_BattlePike_Curtain_Stage0_Tile3, TRUE + setmetatile 3, 3, METATILE_BattlePike_Curtain_Stage0_Tile4, TRUE + setmetatile 4, 3, METATILE_BattlePike_Curtain_Stage0_Tile5, FALSE + setmetatile 5, 3, METATILE_BattlePike_Curtain_Stage0_Tile6, TRUE special DrawWholeMapView return diff --git a/data/maps/BattleFrontier_BattlePikeRoomWildMons/scripts.inc b/data/maps/BattleFrontier_BattlePikeRoomWildMons/scripts.inc index ee9e548f6ebd..19926b9675e3 100644 --- a/data/maps/BattleFrontier_BattlePikeRoomWildMons/scripts.inc +++ b/data/maps/BattleFrontier_BattlePikeRoomWildMons/scripts.inc @@ -16,7 +16,7 @@ BattleFrontier_BattlePikeRoomWildMons_EventScript_SetInWildMonRoom:: BattleFrontier_BattlePikeRoomWildMons_EventScript_WarpToLobbyLost:: frontier_set FRONTIER_DATA_CHALLENGE_STATUS, CHALLENGE_STATUS_LOST - warp MAP_BATTLE_FRONTIER_BATTLE_PIKE_LOBBY, 255, 5, 6 + warp MAP_BATTLE_FRONTIER_BATTLE_PIKE_LOBBY, 5, 6 waitstate end @@ -32,10 +32,8 @@ BattleFrontier_BattlePikeRoomWildMons_EventScript_TurnPlayerNorth:: BattleFrontier_BattlePikeRoomWildMons_OnResume: call BattleFrontier_BattlePikeRoom_EventScript_ResetSketchedMoves frontier_get FRONTIER_DATA_BATTLE_OUTCOME - compare VAR_RESULT, B_OUTCOME_LOST - goto_if_eq BattleFrontier_BattlePikeRoomWildMons_EventScript_SetLost - compare VAR_RESULT, B_OUTCOME_DREW - goto_if_eq BattleFrontier_BattlePikeRoomWildMons_EventScript_SetLost + goto_if_eq VAR_RESULT, B_OUTCOME_LOST, BattleFrontier_BattlePikeRoomWildMons_EventScript_SetLost + goto_if_eq VAR_RESULT, B_OUTCOME_DREW, BattleFrontier_BattlePikeRoomWildMons_EventScript_SetLost end BattleFrontier_BattlePikeRoomWildMons_EventScript_SetLost:: diff --git a/data/maps/BattleFrontier_BattlePikeThreePathRoom/scripts.inc b/data/maps/BattleFrontier_BattlePikeThreePathRoom/scripts.inc index 37737554f5a3..e95ca9dcea85 100644 --- a/data/maps/BattleFrontier_BattlePikeThreePathRoom/scripts.inc +++ b/data/maps/BattleFrontier_BattlePikeThreePathRoom/scripts.inc @@ -28,7 +28,7 @@ BattleFrontier_BattlePikeThreePathRoom_EventScript_GetChallengeStatus:: end BattleFrontier_BattlePikeThreePathRoom_EventScript_WarpToLobby:: - warp MAP_BATTLE_FRONTIER_BATTLE_PIKE_LOBBY, 255, 5, 6 + warp MAP_BATTLE_FRONTIER_BATTLE_PIKE_LOBBY, 5, 6 waitstate end @@ -151,8 +151,7 @@ BattleFrontier_BattlePikeThreePathRoom_EventScript_AskRetireChallenge:: BattleFrontier_BattlePikeThreePathRoom_EventScript_SetHintRoom:: pike_sethintroom - compare VAR_RESULT, TRUE - goto_if_eq BattleFrontier_BattlePikeThreePathRoom_EventScript_SetPikeQueenHint + goto_if_eq VAR_RESULT, TRUE, BattleFrontier_BattlePikeThreePathRoom_EventScript_SetPikeQueenHint setvar VAR_TEMP_5, 255 end @@ -173,8 +172,7 @@ BattleFrontier_BattlePikeThreePathRoom_EventScript_GivePikeQueenHint:: BattleFrontier_BattlePikeThreePathRoom_EventScript_HintGiver:: pike_gethint - compare VAR_RESULT, PIKE_HINT_BRAIN - goto_if_eq BattleFrontier_BattlePikeThreePathRoom_EventScript_GiveBrainHint + goto_if_eq VAR_RESULT, PIKE_HINT_BRAIN, BattleFrontier_BattlePikeThreePathRoom_EventScript_GiveBrainHint lock faceplayer msgbox BattleFrontier_BattlePikeThreePathRoom_Text_FindingItDifficultToChoose, MSGBOX_YESNO diff --git a/data/maps/BattleFrontier_BattlePyramidFloor/scripts.inc b/data/maps/BattleFrontier_BattlePyramidFloor/scripts.inc index 8993418ee8b9..a6b3f63c8e5f 100644 --- a/data/maps/BattleFrontier_BattlePyramidFloor/scripts.inc +++ b/data/maps/BattleFrontier_BattlePyramidFloor/scripts.inc @@ -21,8 +21,7 @@ BattleFrontier_BattlePyramidFloor_EventScript_UpdateLight:: BattleFrontier_BattlePyramidFloor_EventScript_UpdateLightLoop:: special CallBattlePyramidFunction delay 2 - compare VAR_RESULT, 2 - goto_if_ne BattleFrontier_BattlePyramidFloor_EventScript_UpdateLightLoop + goto_if_ne VAR_RESULT, 2, BattleFrontier_BattlePyramidFloor_EventScript_UpdateLightLoop setvar VAR_TEMP_D, 0 releaseall end @@ -45,18 +44,12 @@ BattleFrontier_BattlePyramidFloor_OnResume: case CHALLENGE_STATUS_SAVING, BattleFrontier_BattlePyramid_EventScript_WarpToLobby case CHALLENGE_STATUS_PAUSED, BattleFrontier_BattlePyramidFloor_EventScript_ReadyChallenge frontier_get FRONTIER_DATA_BATTLE_OUTCOME - compare VAR_RESULT, B_OUTCOME_RAN - goto_if_eq BattleFrontier_BattlePyramidFloor_EventScript_ResetParty - compare VAR_RESULT, B_OUTCOME_PLAYER_TELEPORTED - goto_if_eq BattleFrontier_BattlePyramidFloor_EventScript_ResetParty - compare VAR_RESULT, 0 - goto_if_eq BattleFrontier_BattlePyramidFloor_EventScript_ResetParty - compare VAR_RESULT, B_OUTCOME_LOST - goto_if_eq BattleFrontier_BattlePyramid_EventScript_WarpToLobbyLost - compare VAR_RESULT, B_OUTCOME_DREW - goto_if_eq BattleFrontier_BattlePyramid_EventScript_WarpToLobbyLost - compare VAR_RESULT, B_OUTCOME_FORFEITED - goto_if_eq BattleFrontier_BattlePyramid_EventScript_WarpToLobbyLost + goto_if_eq VAR_RESULT, B_OUTCOME_RAN, BattleFrontier_BattlePyramidFloor_EventScript_ResetParty + goto_if_eq VAR_RESULT, B_OUTCOME_PLAYER_TELEPORTED, BattleFrontier_BattlePyramidFloor_EventScript_ResetParty + goto_if_eq VAR_RESULT, 0, BattleFrontier_BattlePyramidFloor_EventScript_ResetParty + goto_if_eq VAR_RESULT, B_OUTCOME_LOST, BattleFrontier_BattlePyramid_EventScript_WarpToLobbyLost + goto_if_eq VAR_RESULT, B_OUTCOME_DREW, BattleFrontier_BattlePyramid_EventScript_WarpToLobbyLost + goto_if_eq VAR_RESULT, B_OUTCOME_FORFEITED, BattleFrontier_BattlePyramid_EventScript_WarpToLobbyLost frontier_isbattletype BATTLE_TYPE_TRAINER @ VAR_RESULT seems to be ignored here setvar VAR_TEMP_D, 1 BattleFrontier_BattlePyramidFloor_EventScript_ResetParty:: @@ -70,7 +63,7 @@ BattleFrontier_BattlePyramid_EventScript_WarpToLobby:: pyramid_updatelight 0, PYRAMID_LIGHT_SET_RADIUS pyramid_clearhelditems special HealPlayerParty - warpsilent MAP_BATTLE_FRONTIER_BATTLE_PYRAMID_LOBBY, 255, 7, 13 + warpsilent MAP_BATTLE_FRONTIER_BATTLE_PYRAMID_LOBBY, 7, 13 waitstate end @@ -97,17 +90,16 @@ BattlePyramid_WarpToNextFloor:: frontier_get FRONTIER_DATA_BATTLE_NUM @ Floor number addvar VAR_RESULT, 1 frontier_set FRONTIER_DATA_BATTLE_NUM, VAR_RESULT - compare VAR_RESULT, 7 - goto_if_eq BattlePyramid_WarpToTop + goto_if_eq VAR_RESULT, 7, BattlePyramid_WarpToTop pyramid_seedfloor frontier_set FRONTIER_DATA_CHALLENGE_STATUS, 0 setvar VAR_RESULT, 0 - warp MAP_BATTLE_FRONTIER_BATTLE_PYRAMID_FLOOR, 255, 1, 1 + warp MAP_BATTLE_FRONTIER_BATTLE_PYRAMID_FLOOR, 1, 1 waitstate end BattlePyramid_WarpToTop:: - warp MAP_BATTLE_FRONTIER_BATTLE_PYRAMID_TOP, 255, 17, 17 + warp MAP_BATTLE_FRONTIER_BATTLE_PYRAMID_TOP, 17, 17 waitstate end @@ -124,8 +116,7 @@ BattlePyramid_TrainerBattle:: BattlePyramid_FindItemBall:: pyramid_setitem callstd STD_FIND_ITEM - compare VAR_0x8007, 0 - goto_if_eq BattlePyramid_FindItemBallEnd + goto_if_eq VAR_0x8007, 0, BattlePyramid_FindItemBallEnd pyramid_hideitem BattlePyramid_FindItemBallEnd:: end diff --git a/data/maps/BattleFrontier_BattlePyramidLobby/scripts.inc b/data/maps/BattleFrontier_BattlePyramidLobby/scripts.inc index c93deee3eca9..550644511b2d 100644 --- a/data/maps/BattleFrontier_BattlePyramidLobby/scripts.inc +++ b/data/maps/BattleFrontier_BattlePyramidLobby/scripts.inc @@ -45,8 +45,7 @@ BattleFrontier_BattlePyramidLobby_EventScript_QuitWithoutSaving:: BattleFrontier_BattlePyramidLobby_EventScript_WonChallenge:: lockall frontier_isbrain - compare VAR_RESULT, TRUE - goto_if_eq BattleFrontier_BattlePyramidLobby_EventScript_DefeatedKing + goto_if_eq VAR_RESULT, TRUE, BattleFrontier_BattlePyramidLobby_EventScript_DefeatedKing msgbox BattleFrontier_BattlePyramidLobby_Text_YouveConqueredPyramid, MSGBOX_DEFAULT goto BattleFrontier_BattlePyramidLobby_EventScript_GiveBattlePoints @@ -54,8 +53,7 @@ BattleFrontier_BattlePyramidLobby_EventScript_DefeatedKing:: msgbox BattleFrontier_BattlePyramidLobby_Text_YouveDefeatedPyramidKing, MSGBOX_DEFAULT BattleFrontier_BattlePyramidLobby_EventScript_GiveBattlePoints:: special DoBattlePyramidMonsHaveHeldItem - compare VAR_RESULT, TRUE - call_if_eq BattleFrontier_BattlePyramidLobby_EventScript_StoreHeldItemsInPyramidBag + call_if_eq VAR_RESULT, TRUE, BattleFrontier_BattlePyramidLobby_EventScript_StoreHeldItemsInPyramidBag clearflag FLAG_STORING_ITEMS_IN_PYRAMID_BAG frontier_checkairshow special LoadPlayerParty @@ -130,8 +128,7 @@ BattleFrontier_BattlePyramidLobby_EventScript_TryEnterChallenge:: case FRONTIER_LVL_TENT, BattleFrontier_BattlePyramidLobby_EventScript_CancelChallenge case MULTI_B_PRESSED, BattleFrontier_BattlePyramidLobby_EventScript_CancelChallenge frontier_checkineligible - compare VAR_0x8004, TRUE - goto_if_eq BattleFrontier_BattlePyramidLobby_EventScript_NotEnoughValidMons + goto_if_eq VAR_0x8004, TRUE, BattleFrontier_BattlePyramidLobby_EventScript_NotEnoughValidMons frontier_set FRONTIER_DATA_LVL_MODE, VAR_RESULT msgbox BattleFrontier_BattlePyramidLobby_Text_SelectThreeMons, MSGBOX_DEFAULT fadescreen FADE_TO_BLACK @@ -140,8 +137,7 @@ BattleFrontier_BattlePyramidLobby_EventScript_TryEnterChallenge:: setvar VAR_0x8005, FRONTIER_PARTY_SIZE special ChoosePartyForBattleFrontier waitstate - compare VAR_RESULT, 0 - goto_if_eq BattleFrontier_BattlePyramidLobby_EventScript_LoadPartyAndCancelChallenge + goto_if_eq VAR_RESULT, 0, BattleFrontier_BattlePyramidLobby_EventScript_LoadPartyAndCancelChallenge msgbox BattleFrontier_BattlePyramidLobby_Text_OkayToSaveBeforeChallenge, MSGBOX_YESNO switch VAR_RESULT case NO, BattleFrontier_BattlePyramidLobby_EventScript_LoadPartyAndCancelChallenge @@ -162,8 +158,7 @@ BattleFrontier_BattlePyramidLobby_EventScript_SaveBeforeChallenge:: delay 2 call Common_EventScript_SaveGame setvar VAR_TEMP_0, 255 - compare VAR_RESULT, 0 - goto_if_eq BattleFrontier_BattlePyramidLobby_EventScript_CancelChallengeSaveFailed + goto_if_eq VAR_RESULT, 0, BattleFrontier_BattlePyramidLobby_EventScript_CancelChallengeSaveFailed BattleFrontier_BattlePyramidLobby_EventScript_EnterChallenge:: special SavePlayerParty frontier_setpartyorder FRONTIER_PARTY_SIZE @@ -173,7 +168,7 @@ BattleFrontier_BattlePyramidLobby_EventScript_EnterChallenge:: frontier_set FRONTIER_DATA_CHALLENGE_STATUS, 0 setvar VAR_RESULT, 0 special HealPlayerParty - warp MAP_BATTLE_FRONTIER_BATTLE_PYRAMID_FLOOR, 255, 1, 1 + warp MAP_BATTLE_FRONTIER_BATTLE_PYRAMID_FLOOR, 1, 1 setvar VAR_TEMP_0, 0 waitstate end @@ -233,8 +228,7 @@ BattleFrontier_BattlePyramidLobby_EventScript_NoHint:: BattleFrontier_BattlePyramidLobby_EventScript_GiveHintLv50:: msgbox BattleFrontier_BattlePyramidLobby_Text_Aah, MSGBOX_DEFAULT pyramid_get PYRAMID_DATA_WIN_STREAK_ACTIVE_50 - compare VAR_RESULT, FALSE - goto_if_ne BattleFrontier_BattlePyramidLobby_EventScript_GiveHintGetLv50Streak + goto_if_ne VAR_RESULT, FALSE, BattleFrontier_BattlePyramidLobby_EventScript_GiveHintGetLv50Streak setvar VAR_RESULT, 0 goto BattleFrontier_BattlePyramidLobby_EventScript_DoHintComment return @@ -247,8 +241,7 @@ BattleFrontier_BattlePyramidLobby_EventScript_GiveHintGetLv50Streak:: BattleFrontier_BattlePyramidLobby_EventScript_GiveHintLvOpen:: msgbox BattleFrontier_BattlePyramidLobby_Text_Aah, MSGBOX_DEFAULT pyramid_get PYRAMID_DATA_WIN_STREAK_ACTIVE_OPEN - compare VAR_RESULT, FALSE - goto_if_ne BattleFrontier_BattlePyramidLobby_EventScript_GiveHintGetLvOpenStreak + goto_if_ne VAR_RESULT, FALSE, BattleFrontier_BattlePyramidLobby_EventScript_GiveHintGetLvOpenStreak setvar VAR_RESULT, 0 goto BattleFrontier_BattlePyramidLobby_EventScript_DoHintComment return @@ -378,8 +371,7 @@ BattleFrontier_BattlePyramidLobby_EventScript_WalkToPanelAndReceiveBag:: waitmovement 0 msgbox BattleFrontier_BattlePyramidLobby_Text_WeWillHoldBagForSafekeeping, MSGBOX_DEFAULT pyramid_get PYRAMID_DATA_WIN_STREAK - compare VAR_RESULT, 0 - goto_if_eq BattleFrontier_BattlePyramidLobby_EventScript_ReceiveNewBattleBag + goto_if_eq VAR_RESULT, 0, BattleFrontier_BattlePyramidLobby_EventScript_ReceiveNewBattleBag msgbox BattleFrontier_BattlePyramidLobby_Text_PleaseTakePreviousBattleBag, MSGBOX_DEFAULT goto BattleFrontier_BattlePyramidLobby_EventScript_ReceiveBattleBag @@ -433,8 +425,7 @@ BattleFrontier_BattlePyramidLobby_EventScript_StoreHeldItemsInPyramidBag:: msgbox BattleFrontier_BattlePyramidLobby_Text_MonHoldingItemCannotTake, MSGBOX_DEFAULT setflag FLAG_STORING_ITEMS_IN_PYRAMID_BAG special TryStoreHeldItemsInPyramidBag - compare VAR_RESULT, 0 - goto_if_eq BattleFrontier_BattlePyramidLobby_EventScript_HeldItemsStoredInPyramidBag + goto_if_eq VAR_RESULT, 0, BattleFrontier_BattlePyramidLobby_EventScript_HeldItemsStoredInPyramidBag message BattleFrontier_BattlePyramidLobby_Text_BagCannotHoldPickItemsToKeep waitmessage goto BattleFrontier_BattlePyramidLobby_EventScript_PickItemsToKeep @@ -472,8 +463,7 @@ BattleFrontier_BattlePyramidLobby_EventScript_PickItemsFromParty:: BattleFrontier_BattlePyramidLobby_EventScript_ExitPickItems:: special DoBattlePyramidMonsHaveHeldItem - compare VAR_RESULT, TRUE - goto_if_eq BattleFrontier_BattlePyramidLobby_EventScript_PartyStillHasHeldItems + goto_if_eq VAR_RESULT, TRUE, BattleFrontier_BattlePyramidLobby_EventScript_PartyStillHasHeldItems return BattleFrontier_BattlePyramidLobby_EventScript_PartyStillHasHeldItems:: diff --git a/data/maps/BattleFrontier_BattlePyramidTop/scripts.inc b/data/maps/BattleFrontier_BattlePyramidTop/scripts.inc index 0c1db1eea84a..385356c4badd 100644 --- a/data/maps/BattleFrontier_BattlePyramidTop/scripts.inc +++ b/data/maps/BattleFrontier_BattlePyramidTop/scripts.inc @@ -20,16 +20,14 @@ BattleFrontier_BattlePyramidTop_OnWarp: BattleFrontier_BattlePyramidTop_EventScript_SetUpObjects:: setvar VAR_TEMP_1, 1 turnobject OBJ_EVENT_ID_PLAYER, DIR_NORTH - compare VAR_TEMP_C, 0 - goto_if_ne BattleFrontier_BattlePyramidTop_EventScript_EndSetUpObjects + goto_if_ne VAR_TEMP_C, 0, BattleFrontier_BattlePyramidTop_EventScript_EndSetUpObjects setobjectxyperm LOCALID_BRANDON, 0, 0 BattleFrontier_BattlePyramidTop_EventScript_EndSetUpObjects:: end BattleFrontier_BattlePyramidTop_OnResume: frontier_getbrainstatus - compare VAR_RESULT, FRONTIER_BRAIN_NOT_READY - goto_if_eq BattleFrontier_BattlePyramidTop_EventScript_CheckChallengeStatus + goto_if_eq VAR_RESULT, FRONTIER_BRAIN_NOT_READY, BattleFrontier_BattlePyramidTop_EventScript_CheckChallengeStatus call BattleFrontier_EventScript_SetBrainObjectGfx BattleFrontier_BattlePyramidTop_EventScript_CheckChallengeStatus:: copyvar VAR_TEMP_C, VAR_RESULT @@ -39,12 +37,9 @@ BattleFrontier_BattlePyramidTop_EventScript_CheckChallengeStatus:: case CHALLENGE_STATUS_SAVING, BattleFrontier_BattlePyramid_EventScript_WarpToLobby case CHALLENGE_STATUS_PAUSED, BattleFrontier_BattlePyramidTop_EventScript_ReadyChallenge frontier_get FRONTIER_DATA_BATTLE_OUTCOME - compare VAR_RESULT, B_OUTCOME_LOST - goto_if_eq BattleFrontier_BattlePyramid_EventScript_WarpToLobbyLost - compare VAR_RESULT, B_OUTCOME_DREW - goto_if_eq BattleFrontier_BattlePyramid_EventScript_WarpToLobbyLost - compare VAR_RESULT, B_OUTCOME_FORFEITED - goto_if_eq BattleFrontier_BattlePyramid_EventScript_WarpToLobbyLost + goto_if_eq VAR_RESULT, B_OUTCOME_LOST, BattleFrontier_BattlePyramid_EventScript_WarpToLobbyLost + goto_if_eq VAR_RESULT, B_OUTCOME_DREW, BattleFrontier_BattlePyramid_EventScript_WarpToLobbyLost + goto_if_eq VAR_RESULT, B_OUTCOME_FORFEITED, BattleFrontier_BattlePyramid_EventScript_WarpToLobbyLost end BattleFrontier_BattlePyramidTop_OnFrame: @@ -74,10 +69,8 @@ BattleFrontier_BattlePyramidTop_EventScript_ReadyChallenge:: BattleFrontier_BattlePyramidTop_EventScript_Attendant:: lock faceplayer - compare VAR_TEMP_D, 0 - goto_if_ne BattleFrontier_BattlePyramidTop_EventScript_StepForwardWhenReady - compare VAR_TEMP_C, FRONTIER_BRAIN_NOT_READY - goto_if_ne BattleFrontier_BattlePyramidTop_EventScript_BrandonHereMoveAside + goto_if_ne VAR_TEMP_D, 0, BattleFrontier_BattlePyramidTop_EventScript_StepForwardWhenReady + goto_if_ne VAR_TEMP_C, FRONTIER_BRAIN_NOT_READY, BattleFrontier_BattlePyramidTop_EventScript_BrandonHereMoveAside msgbox BattleFrontier_BattlePyramidTop_Text_ReachedSummitUpYouGo, MSGBOX_DEFAULT closemessage applymovement LOCALID_ATTENDANT, BattleFrontier_BattlePyramidTop_Movement_AttendantMoveAside @@ -93,7 +86,7 @@ BattleFrontier_BattlePyramidTop_EventScript_Attendant:: closemessage BattleFrontier_BattlePyramidTop_EventScript_WarpToLobbyWon:: frontier_set FRONTIER_DATA_CHALLENGE_STATUS, CHALLENGE_STATUS_WON - warp MAP_BATTLE_FRONTIER_BATTLE_PYRAMID_LOBBY, 255, 7, 13 + warp MAP_BATTLE_FRONTIER_BATTLE_PYRAMID_LOBBY, 7, 13 waitstate end @@ -116,8 +109,7 @@ BattleFrontier_BattlePyramidTop_EventScript_BattleBrandon:: case FRONTIER_BRAIN_STREAK, BattleFrontier_BattlePyramidTop_EventScript_BrandonHeardSilverSpeech case FRONTIER_BRAIN_STREAK_LONG, BattleFrontier_BattlePyramidTop_EventScript_BrandonHeardGoldSpeech frontier_get FRONTIER_DATA_HEARD_BRAIN_SPEECH - compare VAR_RESULT, FALSE - goto_if_ne BattleFrontier_BattlePyramidTop_EventScript_BrandonHeardSilverSpeech + goto_if_ne VAR_RESULT, FALSE, BattleFrontier_BattlePyramidTop_EventScript_BrandonHeardSilverSpeech special SpawnCameraObject applymovement OBJ_EVENT_ID_CAMERA, BattleFrontier_BattlePyramidTop_Movement_CameraPanUp waitmovement 0 @@ -137,14 +129,12 @@ BattleFrontier_BattlePyramidTop_EventScript_BattleBrandonSilver:: msgbox BattleFrontier_BattlePyramidTop_Text_BringCourageToOurBattle, MSGBOX_DEFAULT call BattleFrontier_BattlePyramidTop_EventScript_DoBrandonBattle playbgm MUS_B_PYRAMID_TOP, FALSE - compare VAR_RESULT, 1 - goto_if_eq BattleFrontier_BattlePyramidTop_EventScript_DefeatedBrandonSilver + goto_if_eq VAR_RESULT, 1, BattleFrontier_BattlePyramidTop_EventScript_DefeatedBrandonSilver goto BattleFrontier_BattlePyramid_EventScript_WarpToLobbyLost BattleFrontier_BattlePyramidTop_EventScript_DefeatedBrandonSilver:: frontier_getsymbols - compare VAR_RESULT, 0 - goto_if_ne BattleFrontier_BattlePyramidTop_EventScript_WarpToLobbyWon + goto_if_ne VAR_RESULT, 0, BattleFrontier_BattlePyramidTop_EventScript_WarpToLobbyWon msgbox BattleFrontier_BattlePyramidTop_Text_BrandonFrontierPassPlease, MSGBOX_DEFAULT playfanfare MUS_OBTAIN_SYMBOL message BattleFrontier_BattlePyramidTop_Text_ReceivedBraveSymbol @@ -156,8 +146,7 @@ BattleFrontier_BattlePyramidTop_EventScript_DefeatedBrandonSilver:: BattleFrontier_BattlePyramidTop_EventScript_BrandonIntroGold:: frontier_get FRONTIER_DATA_HEARD_BRAIN_SPEECH - compare VAR_RESULT, FALSE - goto_if_ne BattleFrontier_BattlePyramidTop_EventScript_BrandonHeardGoldSpeech + goto_if_ne VAR_RESULT, FALSE, BattleFrontier_BattlePyramidTop_EventScript_BrandonHeardGoldSpeech special SpawnCameraObject applymovement OBJ_EVENT_ID_CAMERA, BattleFrontier_BattlePyramidTop_Movement_CameraPanUp waitmovement 0 @@ -177,14 +166,12 @@ BattleFrontier_BattlePyramidTop_EventScript_BattleBrandonGold:: msgbox BattleFrontier_BattlePyramidTop_Text_EverythingYouHave, MSGBOX_DEFAULT call BattleFrontier_BattlePyramidTop_EventScript_DoBrandonBattle playbgm MUS_B_PYRAMID_TOP, FALSE - compare VAR_RESULT, 1 - goto_if_eq BattleFrontier_BattlePyramidTop_EventScript_DefeatedBrandonGold + goto_if_eq VAR_RESULT, 1, BattleFrontier_BattlePyramidTop_EventScript_DefeatedBrandonGold goto BattleFrontier_BattlePyramid_EventScript_WarpToLobbyLost BattleFrontier_BattlePyramidTop_EventScript_DefeatedBrandonGold:: frontier_getsymbols - compare VAR_RESULT, 2 - goto_if_eq BattleFrontier_BattlePyramidTop_EventScript_WarpToLobbyWon + goto_if_eq VAR_RESULT, 2, BattleFrontier_BattlePyramidTop_EventScript_WarpToLobbyWon msgbox BattleFrontier_BattlePyramidTop_Text_BrandonRemarkableHaveThis, MSGBOX_DEFAULT playfanfare MUS_OBTAIN_SYMBOL message BattleFrontier_BattlePyramidTop_Text_BraveSymbolTookGoldenShine diff --git a/data/maps/BattleFrontier_BattleTowerBattleRoom/scripts.inc b/data/maps/BattleFrontier_BattleTowerBattleRoom/scripts.inc index c909239beac4..9b466af3bc1d 100644 --- a/data/maps/BattleFrontier_BattleTowerBattleRoom/scripts.inc +++ b/data/maps/BattleFrontier_BattleTowerBattleRoom/scripts.inc @@ -25,8 +25,7 @@ BattleFrontier_BattleTowerBattleRoom_EventScript_EnterRoom:: applymovement OBJ_EVENT_ID_PLAYER, BattleFrontier_BattleTowerBattleRoom_Movement_PlayerEnter waitmovement 0 frontier_get FRONTIER_DATA_BATTLE_NUM - compare VAR_RESULT, 0 - goto_if_eq BattleFrontier_BattleTowerBattleRoom_EventScript_OpponentEnter + goto_if_eq VAR_RESULT, 0, BattleFrontier_BattleTowerBattleRoom_EventScript_OpponentEnter applymovement LOCALID_ATTENDANT_1, BattleFrontier_BattleTowerBattleRoom_Movement_AttendantApproachPlayer waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, BattleFrontier_BattleTowerBattleRoom_Movement_PlayerFaceAttendant @@ -62,8 +61,7 @@ BattleFrontier_BattleTowerBattleRoom_EventScript_DefeatedOpponent:: waitmovement 0 removeobject LOCALID_OPPONENT frontier_getbrainstatus - compare VAR_RESULT, FRONTIER_BRAIN_NOT_READY - call_if_ne BattleFrontier_BattleTowerBattleRoom_EventScript_SecondAttendantEnter + call_if_ne VAR_RESULT, FRONTIER_BRAIN_NOT_READY, BattleFrontier_BattleTowerBattleRoom_EventScript_SecondAttendantEnter applymovement LOCALID_ATTENDANT_1, BattleFrontier_BattleTowerBattleRoom_Movement_AttendantApproachPlayer waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, BattleFrontier_BattleTowerBattleRoom_Movement_PlayerFaceAttendant @@ -75,13 +73,11 @@ BattleFrontier_BattleTowerBattleRoom_EventScript_DefeatedOpponent:: BattleFrontier_BattleTowerBattleRoom_EventScript_AskReadyForOpponent:: frontier_getbrainstatus copyvar VAR_TEMP_F, VAR_RESULT - compare VAR_RESULT, FRONTIER_BRAIN_NOT_READY - goto_if_ne BattleFrontier_BattleTowerBattleRoom_EventScript_MaidenUpNext + goto_if_ne VAR_RESULT, FRONTIER_BRAIN_NOT_READY, BattleFrontier_BattleTowerBattleRoom_EventScript_MaidenUpNext frontier_get FRONTIER_DATA_BATTLE_NUM call BattleFrontier_BattleTowerBattleRoom_EventScript_ReadyForOpponent call BattleFrontier_EventScript_GetCantRecordBattle - compare VAR_RESULT, TRUE - goto_if_eq BattleFrontier_BattleTowerBattleRoom_EventScript_AskReadyForOpponentNoRecord + goto_if_eq VAR_RESULT, TRUE, BattleFrontier_BattleTowerBattleRoom_EventScript_AskReadyForOpponentNoRecord multichoice 19, 4, MULTI_GO_ON_RECORD_REST_RETIRE, TRUE switch VAR_RESULT case 0, BattleFrontier_BattleTowerBattleRoom_EventScript_ContinueChallenge @@ -214,16 +210,14 @@ BattleFrontier_BattleTowerBattleRoom_EventScript_SecondAttendantEnter:: return BattleFrontier_BattleTowerBattleRoom_EventScript_MaidenUpNext:: - compare VAR_TEMP_2, 1 - goto_if_eq BattleFrontier_BattleTowerBattleRoom_EventScript_AskReadyForMaiden + goto_if_eq VAR_TEMP_2, 1, BattleFrontier_BattleTowerBattleRoom_EventScript_AskReadyForMaiden msgbox BattleFrontier_BattleTowerBattleRoom_Text_SalonMaidenOnHerWay, MSGBOX_DEFAULT setvar VAR_TEMP_2, 1 BattleFrontier_BattleTowerBattleRoom_EventScript_AskReadyForMaiden:: message BattleFrontier_BattleTowerBattleRoom_Text_ReadyForSalonMaiden waitmessage call BattleFrontier_EventScript_GetCantRecordBattle - compare VAR_RESULT, TRUE - goto_if_eq BattleFrontier_BattleTowerBattleRoom_EventScript_AskReadyForMaidenNoRecord + goto_if_eq VAR_RESULT, TRUE, BattleFrontier_BattleTowerBattleRoom_EventScript_AskReadyForMaidenNoRecord multichoice 19, 4, MULTI_GO_ON_RECORD_REST_RETIRE, TRUE switch VAR_RESULT case 0, BattleFrontier_BattleTowerBattleRoom_EventScript_BattleAnabel @@ -255,22 +249,19 @@ BattleFrontier_BattleTowerBattleRoom_EventScript_BattleAnabel:: case FRONTIER_BRAIN_STREAK, BattleFrontier_BattleTowerBattleRoom_EventScript_BattleAnabelSilver case FRONTIER_BRAIN_STREAK_LONG, BattleFrontier_BattleTowerBattleRoom_EventScript_BattleAnabelGold frontier_get FRONTIER_DATA_HEARD_BRAIN_SPEECH - compare VAR_RESULT, FALSE - goto_if_ne BattleFrontier_BattleTowerBattleRoom_EventScript_BattleAnabelSilver + goto_if_ne VAR_RESULT, FALSE, BattleFrontier_BattleTowerBattleRoom_EventScript_BattleAnabelSilver msgbox BattleFrontier_BattleTowerBattleRoom_Text_GreetingsImAnabel, MSGBOX_DEFAULT frontier_set FRONTIER_DATA_HEARD_BRAIN_SPEECH BattleFrontier_BattleTowerBattleRoom_EventScript_BattleAnabelSilver:: msgbox BattleFrontier_BattleTowerBattleRoom_Text_LetMeSeeYourTalent, MSGBOX_DEFAULT call BattleFrontier_BattleTowerBattleRoom_EventScript_DoTowerBattle - compare VAR_RESULT, B_OUTCOME_WON - goto_if_eq BattleFrontier_BattleTowerBattleRoom_EventScript_DefeatedAnabelSilver + goto_if_eq VAR_RESULT, B_OUTCOME_WON, BattleFrontier_BattleTowerBattleRoom_EventScript_DefeatedAnabelSilver goto BattleFrontier_BattleTower_EventScript_WarpToLobbyLost BattleFrontier_BattleTowerBattleRoom_EventScript_DefeatedAnabelSilver:: call BattleFrontier_EventScript_IncrementWinStreak frontier_getsymbols - compare VAR_RESULT, 0 - goto_if_ne BattleFrontier_BattleTowerBattleRoom_EventScript_WarpToLobbyWon + goto_if_ne VAR_RESULT, 0, BattleFrontier_BattleTowerBattleRoom_EventScript_WarpToLobbyWon msgbox BattleFrontier_BattleTowerBattleRoom_Text_AnabelTalentShallBeRecognized, MSGBOX_DEFAULT playfanfare MUS_OBTAIN_SYMBOL message BattleFrontier_BattleTowerBattleRoom_Text_ReceivedAbilitySymbol @@ -282,22 +273,19 @@ BattleFrontier_BattleTowerBattleRoom_EventScript_DefeatedAnabelSilver:: BattleFrontier_BattleTowerBattleRoom_EventScript_AnabelGoldIntro:: frontier_get FRONTIER_DATA_HEARD_BRAIN_SPEECH - compare VAR_RESULT, FALSE - goto_if_ne BattleFrontier_BattleTowerBattleRoom_EventScript_BattleAnabelGold + goto_if_ne VAR_RESULT, FALSE, BattleFrontier_BattleTowerBattleRoom_EventScript_BattleAnabelGold msgbox BattleFrontier_BattleTowerBattleRoom_Text_AnabelYouCameBack, MSGBOX_DEFAULT frontier_set FRONTIER_DATA_HEARD_BRAIN_SPEECH BattleFrontier_BattleTowerBattleRoom_EventScript_BattleAnabelGold:: msgbox BattleFrontier_BattleTowerBattleRoom_Text_LetsBeginShallWe, MSGBOX_DEFAULT call BattleFrontier_BattleTowerBattleRoom_EventScript_DoTowerBattle - compare VAR_RESULT, B_OUTCOME_WON - goto_if_eq BattleFrontier_BattleTowerBattleRoom_EventScript_DefeatedAnabelGold + goto_if_eq VAR_RESULT, B_OUTCOME_WON, BattleFrontier_BattleTowerBattleRoom_EventScript_DefeatedAnabelGold goto BattleFrontier_BattleTower_EventScript_WarpToLobbyLost BattleFrontier_BattleTowerBattleRoom_EventScript_DefeatedAnabelGold:: call BattleFrontier_EventScript_IncrementWinStreak frontier_getsymbols - compare VAR_RESULT, 2 - goto_if_eq BattleFrontier_BattleTowerBattleRoom_EventScript_WarpToLobbyWon + goto_if_eq VAR_RESULT, 2, BattleFrontier_BattleTowerBattleRoom_EventScript_WarpToLobbyWon msgbox BattleFrontier_BattleTowerBattleRoom_Text_AnabelCongratsYourPassPlease, MSGBOX_DEFAULT playfanfare MUS_OBTAIN_SYMBOL message BattleFrontier_BattleTowerBattleRoom_Text_AbilitySymbolTookGoldenShine @@ -317,8 +305,7 @@ BattleFrontier_BattleTowerBattleRoom_EventScript_DoTowerBattle:: special DoSpecialTrainerBattle waitstate copyvar VAR_0x8004, VAR_FRONTIER_BATTLE_MODE - compare VAR_0x8004, FRONTIER_MODE_LINK_MULTIS - goto_if_eq BattleFrontier_BattleTowerBattleRoom_EventScript_EndTowerBattle + goto_if_eq VAR_0x8004, FRONTIER_MODE_LINK_MULTIS, BattleFrontier_BattleTowerBattleRoom_EventScript_EndTowerBattle frontier_restorehelditems special HealPlayerParty frontier_resetsketch @@ -422,29 +409,26 @@ BattleFrontier_BattleTowerBattleRoom_Movement_AnabelEnter: BattleFrontier_BattleTowerBattleRoom_EventScript_WarpToLobby:: copyvar VAR_RESULT, VAR_FRONTIER_BATTLE_MODE - compare VAR_RESULT, FRONTIER_MODE_DOUBLES - goto_if_eq BattleFrontier_BattleTowerBattleRoom_EventScript_WarpToLobbyDoubles - compare VAR_RESULT, FRONTIER_MODE_MULTIS - goto_if_eq BattleFrontier_BattleTowerBattleRoom_EventScript_WarpToLobbyMultis - compare VAR_RESULT, FRONTIER_MODE_LINK_MULTIS - goto_if_eq BattleFrontier_BattleTowerBattleRoom_EventScript_WarpToLobbyLinkMultis - warp MAP_BATTLE_FRONTIER_BATTLE_TOWER_LOBBY, 255, 6, 6 + goto_if_eq VAR_RESULT, FRONTIER_MODE_DOUBLES, BattleFrontier_BattleTowerBattleRoom_EventScript_WarpToLobbyDoubles + goto_if_eq VAR_RESULT, FRONTIER_MODE_MULTIS, BattleFrontier_BattleTowerBattleRoom_EventScript_WarpToLobbyMultis + goto_if_eq VAR_RESULT, FRONTIER_MODE_LINK_MULTIS, BattleFrontier_BattleTowerBattleRoom_EventScript_WarpToLobbyLinkMultis + warp MAP_BATTLE_FRONTIER_BATTLE_TOWER_LOBBY, 6, 6 waitstate end BattleFrontier_BattleTowerBattleRoom_EventScript_WarpToLobbyDoubles:: - warp MAP_BATTLE_FRONTIER_BATTLE_TOWER_LOBBY, 255, 10, 6 + warp MAP_BATTLE_FRONTIER_BATTLE_TOWER_LOBBY, 10, 6 waitstate end BattleFrontier_BattleTowerBattleRoom_EventScript_WarpToLobbyMultis:: - warp MAP_BATTLE_FRONTIER_BATTLE_TOWER_LOBBY, 255, 14, 6 + warp MAP_BATTLE_FRONTIER_BATTLE_TOWER_LOBBY, 14, 6 waitstate end BattleFrontier_BattleTowerBattleRoom_EventScript_WarpToLobbyLinkMultis:: tower_closelink - warp MAP_BATTLE_FRONTIER_BATTLE_TOWER_LOBBY, 255, 18, 6 + warp MAP_BATTLE_FRONTIER_BATTLE_TOWER_LOBBY, 18, 6 waitstate end diff --git a/data/maps/BattleFrontier_BattleTowerCorridor/scripts.inc b/data/maps/BattleFrontier_BattleTowerCorridor/scripts.inc index c09c897e9866..d0f3d487a8c3 100644 --- a/data/maps/BattleFrontier_BattleTowerCorridor/scripts.inc +++ b/data/maps/BattleFrontier_BattleTowerCorridor/scripts.inc @@ -6,15 +6,14 @@ BattleFrontier_BattleTowerCorridor_MapScripts:: .byte 0 BattleFrontier_BattleTowerCorridor_OnLoad: - compare VAR_0x8006, 1 - goto_if_eq BattleFrontier_BattleTowerCorridor_EventScript_OpenFarDoor - setmetatile 12, 0, METATILE_BattleFrontier_CorridorOpenDoor_Top, 0 - setmetatile 12, 1, METATILE_BattleFrontier_CorridorOpenDoor_Bottom, 0 + goto_if_eq VAR_0x8006, 1, BattleFrontier_BattleTowerCorridor_EventScript_OpenFarDoor + setmetatile 12, 0, METATILE_BattleFrontier_CorridorOpenDoor_Top, FALSE + setmetatile 12, 1, METATILE_BattleFrontier_CorridorOpenDoor_Bottom, FALSE end BattleFrontier_BattleTowerCorridor_EventScript_OpenFarDoor:: - setmetatile 15, 0, METATILE_BattleFrontier_CorridorOpenDoor_Top, 0 - setmetatile 15, 1, METATILE_BattleFrontier_CorridorOpenDoor_Bottom, 0 + setmetatile 15, 0, METATILE_BattleFrontier_CorridorOpenDoor_Top, FALSE + setmetatile 15, 1, METATILE_BattleFrontier_CorridorOpenDoor_Bottom, FALSE end BattleFrontier_BattleTowerCorridor_OnFrame: @@ -23,8 +22,7 @@ BattleFrontier_BattleTowerCorridor_OnFrame: BattleFrontier_BattleTowerCorridor_EventScript_EnterCorridor:: setvar VAR_TEMP_0, 1 - compare VAR_0x8006, 1 - goto_if_eq BattleFrontier_BattleTowerCorridor_EventScript_WalkToFarDoor + goto_if_eq VAR_0x8006, 1, BattleFrontier_BattleTowerCorridor_EventScript_WalkToFarDoor applymovement LOCALID_ATTENDANT, BattleFrontier_BattleTowerCorridor_Movement_AttendantWalkToDoor applymovement OBJ_EVENT_ID_PLAYER, BattleFrontier_BattleTowerCorridor_Movement_PlayerWalkToDoor waitmovement 0 @@ -37,7 +35,7 @@ BattleFrontier_BattleTowerCorridor_EventScript_WalkToFarDoor:: BattleFrontier_BattleTowerCorridor_EventScript_WarpToBattleRoom:: setvar VAR_TEMP_0, 0 - warp MAP_BATTLE_FRONTIER_BATTLE_TOWER_BATTLE_ROOM, 255, 4, 8 + warp MAP_BATTLE_FRONTIER_BATTLE_TOWER_BATTLE_ROOM, 4, 8 waitstate end diff --git a/data/maps/BattleFrontier_BattleTowerElevator/scripts.inc b/data/maps/BattleFrontier_BattleTowerElevator/scripts.inc index 0021b9e84206..06f4ff0a70c9 100644 --- a/data/maps/BattleFrontier_BattleTowerElevator/scripts.inc +++ b/data/maps/BattleFrontier_BattleTowerElevator/scripts.inc @@ -26,34 +26,30 @@ BattleFrontier_BattleTowerElevator_EventScript_EnterElevator:: end BattleFrontier_BattleTowerElevator_EventScript_WarpToNextRoom:: - compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_SINGLES - call_if_eq BattleFrontier_BattleTowerElevator_EventScript_WarpToCorridor - compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_DOUBLES - call_if_eq BattleFrontier_BattleTowerElevator_EventScript_WarpToCorridor - compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_MULTIS - call_if_eq BattleFrontier_BattleTowerElevator_EventScript_WarpToNextRoomMulti - compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_LINK_MULTIS - call_if_eq BattleFrontier_BattleTowerElevator_EventScript_WarpToCorridorMulti + call_if_eq VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_SINGLES, BattleFrontier_BattleTowerElevator_EventScript_WarpToCorridor + call_if_eq VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_DOUBLES, BattleFrontier_BattleTowerElevator_EventScript_WarpToCorridor + call_if_eq VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_MULTIS, BattleFrontier_BattleTowerElevator_EventScript_WarpToNextRoomMulti + call_if_eq VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_LINK_MULTIS, BattleFrontier_BattleTowerElevator_EventScript_WarpToCorridorMulti return BattleFrontier_BattleTowerElevator_EventScript_WarpToCorridor:: - warp MAP_BATTLE_FRONTIER_BATTLE_TOWER_CORRIDOR, 255, 8, 1 + warp MAP_BATTLE_FRONTIER_BATTLE_TOWER_CORRIDOR, 8, 1 waitstate return BattleFrontier_BattleTowerElevator_EventScript_WarpToNextRoomMulti:: goto_if_unset FLAG_CHOSEN_MULTI_BATTLE_NPC_PARTNER, BattleFrontier_BattleTowerElevator_EventScript_WarpToPartnerRoom - warp MAP_BATTLE_FRONTIER_BATTLE_TOWER_MULTI_CORRIDOR, 255, 7, 2 + warp MAP_BATTLE_FRONTIER_BATTLE_TOWER_MULTI_CORRIDOR, 7, 2 waitstate return BattleFrontier_BattleTowerElevator_EventScript_WarpToCorridorMulti:: - warp MAP_BATTLE_FRONTIER_BATTLE_TOWER_MULTI_CORRIDOR, 255, 7, 2 + warp MAP_BATTLE_FRONTIER_BATTLE_TOWER_MULTI_CORRIDOR, 7, 2 waitstate return BattleFrontier_BattleTowerElevator_EventScript_WarpToPartnerRoom:: - warp MAP_BATTLE_FRONTIER_BATTLE_TOWER_MULTI_PARTNER_ROOM, 255, 10, 1 + warp MAP_BATTLE_FRONTIER_BATTLE_TOWER_MULTI_PARTNER_ROOM, 10, 1 waitstate return diff --git a/data/maps/BattleFrontier_BattleTowerLobby/scripts.inc b/data/maps/BattleFrontier_BattleTowerLobby/scripts.inc index ab2a620436cb..40936936a7c8 100644 --- a/data/maps/BattleFrontier_BattleTowerLobby/scripts.inc +++ b/data/maps/BattleFrontier_BattleTowerLobby/scripts.inc @@ -19,8 +19,7 @@ BattleFrontier_BattleTowerLobby_OnResume: BattleFrontier_BattleTowerLobby_OnTransition: call BattleFrontier_BattleTowerLobby_EventScript_ShowOrHideReporter apprentice_shouldcheckgone - compare VAR_0x8004, FALSE @ Always TRUE here - goto_if_eq BattleFrontier_BattleTowerLobby_EventScript_ShowApprentice + goto_if_eq VAR_0x8004, FALSE, BattleFrontier_BattleTowerLobby_EventScript_ShowApprentice @ VAR_0x8004 always TRUE here goto_if_set FLAG_DAILY_APPRENTICE_LEAVES, BattleFrontier_BattleTowerLobby_EventScript_HideApprentice BattleFrontier_BattleTowerLobby_EventScript_ShowApprentice:: clearflag FLAG_HIDE_APPRENTICE @@ -69,8 +68,7 @@ BattleFrontier_BattleTowerLobby_EventScript_WonChallenge:: lock faceplayer frontier_isbrain - compare VAR_RESULT, TRUE - goto_if_eq BattleFrontier_BattleTowerLobby_EventScript_DefeatedMaiden + goto_if_eq VAR_RESULT, TRUE, BattleFrontier_BattleTowerLobby_EventScript_DefeatedMaiden message BattleFrontier_BattleTowerLobby_Text_CongratsBeatenSeven waitmessage goto BattleFrontier_BattleTowerLobby_EventScript_GiveRibbons @@ -79,8 +77,7 @@ BattleFrontier_BattleTowerLobby_EventScript_DefeatedMaiden:: msgbox BattleFrontier_BattleTowerLobby_Text_CongratsDefeatedMaiden, MSGBOX_DEFAULT BattleFrontier_BattleTowerLobby_EventScript_GiveRibbons:: tower_giveribbons - compare VAR_RESULT, FALSE - goto_if_eq BattleFrontier_BattleTowerLobby_EventScript_GiveBattlePoints + goto_if_eq VAR_RESULT, FALSE, BattleFrontier_BattleTowerLobby_EventScript_GiveBattlePoints message BattleFrontier_BattleTowerLobby_Text_HereAreSomeRibbons waitmessage playfanfare MUS_OBTAIN_ITEM @@ -92,8 +89,7 @@ BattleFrontier_BattleTowerLobby_EventScript_GiveBattlePoints:: msgbox BattleFrontier_Text_ObtainedXBattlePoints, MSGBOX_GETPOINTS call BattleFrontier_BattleTowerLobby_EventScript_AskSaveBattle tower_get TOWER_DATA_WIN_STREAK - compare VAR_RESULT, 49 - goto_if_ne BattleFrontier_BattleTowerLobby_EventScript_LookForwardToChallenge + goto_if_ne VAR_RESULT, 49, BattleFrontier_BattleTowerLobby_EventScript_LookForwardToChallenge msgbox BattleFrontier_BattleTowerLobby_Text_AboutToFace50thTrainer, MSGBOX_DEFAULT BattleFrontier_BattleTowerLobby_EventScript_LookForwardToChallenge:: msgbox BattleFrontier_BattleTowerLobby_Text_LookForwardToAnotherChallenge, MSGBOX_DEFAULT @@ -103,12 +99,10 @@ BattleFrontier_BattleTowerLobby_EventScript_LookForwardToChallenge:: end BattleFrontier_BattleTowerLobby_EventScript_LostChallenge:: - compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_MULTIS - goto_if_ne BattleFrontier_BattleTowerLobby_EventScript_CancelWinStreak + goto_if_ne VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_MULTIS, BattleFrontier_BattleTowerLobby_EventScript_CancelWinStreak goto_if_set FLAG_CHOSEN_MULTI_BATTLE_NPC_PARTNER, BattleFrontier_BattleTowerLobby_EventScript_CancelWinStreak tower_get TOWER_DATA_WIN_STREAK - compare VAR_RESULT, 0 - goto_if_ne BattleFrontier_BattleTowerLobby_EventScript_LostThanksForPlaying + goto_if_ne VAR_RESULT, 0, BattleFrontier_BattleTowerLobby_EventScript_LostThanksForPlaying BattleFrontier_BattleTowerLobby_EventScript_CancelWinStreak:: tower_set TOWER_DATA_WIN_STREAK_ACTIVE, FALSE BattleFrontier_BattleTowerLobby_EventScript_LostThanksForPlaying:: @@ -133,8 +127,7 @@ BattleFrontier_BattleTowerLobby_EventScript_AskSaveBattle:: playse SE_SAVE waitse call BattleFrontier_EventScript_GetCantRecordBattle - compare VAR_RESULT, TRUE - goto_if_eq BattleFrontier_BattleTowerLobby_EventScript_EndSaveBattle + goto_if_eq VAR_RESULT, TRUE, BattleFrontier_BattleTowerLobby_EventScript_EndSaveBattle message BattleFrontier_BattleTowerLobby_Text_RecordLastMatch waitmessage multichoicedefault 20, 8, MULTI_YESNO, 1, FALSE @@ -145,8 +138,7 @@ BattleFrontier_BattleTowerLobby_EventScript_AskSaveBattle:: BattleFrontier_EventScript_SaveBattle:: frontier_savebattle - compare VAR_RESULT, FALSE - goto_if_eq BattleFrontier_EventScript_BattleSaveFailed + goto_if_eq VAR_RESULT, FALSE, BattleFrontier_EventScript_BattleSaveFailed playse SE_SAVE msgbox BattleFrontier_BattleTowerLobby_Text_BattleRecordedOnPass, MSGBOX_DEFAULT goto BattleFrontier_BattleTowerLobby_EventScript_EndSaveBattle @@ -163,8 +155,7 @@ BattleFrontier_EventScript_GetCantRecordBattle:: BattleFrontier_BattleTowerLobby_EventScript_ResumeChallenge:: lock faceplayer - compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_SINGLES - call_if_eq BattleFrontier_BattleTowerLobby_EventScript_SetBravoTrainerOn + call_if_eq VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_SINGLES, BattleFrontier_BattleTowerLobby_EventScript_SetBravoTrainerOn message BattleFrontier_BattleTowerLobby_Text_WeveBeenWaitingForYou waitmessage message BattleFrontier_BattleTowerLobby_Text_ProgressWillBeSaved @@ -205,8 +196,7 @@ BattleFrontier_BattleTowerLobby_EventScript_TryEnterSinglesChallenge:: case FRONTIER_LVL_TENT, BattleFrontier_BattleTowerLobby_EventScript_CancelChallenge case MULTI_B_PRESSED, BattleFrontier_BattleTowerLobby_EventScript_CancelChallenge frontier_checkineligible - compare VAR_0x8004, TRUE - goto_if_eq BattleFrontier_BattleTowerLobby_EventScript_NotEnoughValidMons + goto_if_eq VAR_0x8004, TRUE, BattleFrontier_BattleTowerLobby_EventScript_NotEnoughValidMons frontier_set FRONTIER_DATA_LVL_MODE, VAR_RESULT msgbox BattleFrontier_BattleTowerLobby_Text_SelectThreeMons, MSGBOX_DEFAULT fadescreen FADE_TO_BLACK @@ -215,8 +205,7 @@ BattleFrontier_BattleTowerLobby_EventScript_TryEnterSinglesChallenge:: setvar VAR_0x8005, FRONTIER_PARTY_SIZE special ChoosePartyForBattleFrontier waitstate - compare VAR_RESULT, 0 - goto_if_eq BattleFrontier_BattleTowerLobby_EventScript_LoadPartyCancelChallenge + goto_if_eq VAR_RESULT, 0, BattleFrontier_BattleTowerLobby_EventScript_LoadPartyCancelChallenge msgbox BattleFrontier_BattleTowerLobby_Text_OkayToSaveBeforeEntering, MSGBOX_YESNO switch VAR_RESULT case NO, BattleFrontier_BattleTowerLobby_EventScript_LoadPartyCancelChallenge @@ -234,8 +223,7 @@ BattleFrontier_BattleTowerLobby_EventScript_SaveBeforeSinglesChallenge:: delay 2 call Common_EventScript_SaveGame setvar VAR_TEMP_0, 255 - compare VAR_RESULT, 0 - goto_if_eq BattleFrontier_BattleTowerLobby_EventScript_CancelChallengeSaveFailed + goto_if_eq VAR_RESULT, 0, BattleFrontier_BattleTowerLobby_EventScript_CancelChallengeSaveFailed incrementgamestat GAME_STAT_ENTERED_BATTLE_TOWER setvar VAR_BRAVO_TRAINER_BATTLE_TOWER_ON, TRUE goto BattleFrontier_BattleTowerLobby_EventScript_EnterElevator @@ -271,8 +259,7 @@ BattleFrontier_BattleTowerLobby_EventScript_TryEnterDoublesChallenge:: case FRONTIER_LVL_TENT, BattleFrontier_BattleTowerLobby_EventScript_CancelChallenge case MULTI_B_PRESSED, BattleFrontier_BattleTowerLobby_EventScript_CancelChallenge frontier_checkineligible - compare VAR_0x8004, TRUE - goto_if_eq BattleFrontier_BattleTowerLobby_EventScript_NotEnoughValidMons + goto_if_eq VAR_0x8004, TRUE, BattleFrontier_BattleTowerLobby_EventScript_NotEnoughValidMons frontier_set FRONTIER_DATA_LVL_MODE, VAR_RESULT msgbox BattleFrontier_BattleTowerLobby_Text_PleaseSelectFourMons, MSGBOX_DEFAULT fadescreen FADE_TO_BLACK @@ -281,8 +268,7 @@ BattleFrontier_BattleTowerLobby_EventScript_TryEnterDoublesChallenge:: setvar VAR_0x8005, FRONTIER_DOUBLES_PARTY_SIZE special ChoosePartyForBattleFrontier waitstate - compare VAR_RESULT, 0 - goto_if_eq BattleFrontier_BattleTowerLobby_EventScript_LoadPartyCancelChallenge + goto_if_eq VAR_RESULT, 0, BattleFrontier_BattleTowerLobby_EventScript_LoadPartyCancelChallenge msgbox BattleFrontier_BattleTowerLobby_Text_OkayToSaveBeforeEntering, MSGBOX_YESNO switch VAR_RESULT case NO, BattleFrontier_BattleTowerLobby_EventScript_LoadPartyCancelChallenge @@ -300,8 +286,7 @@ BattleFrontier_BattleTowerLobby_EventScript_SaveBeforeDoublesChallenge:: delay 2 call Common_EventScript_SaveGame setvar VAR_TEMP_0, 255 - compare VAR_RESULT, 0 - goto_if_eq BattleFrontier_BattleTowerLobby_EventScript_CancelChallengeSaveFailed + goto_if_eq VAR_RESULT, 0, BattleFrontier_BattleTowerLobby_EventScript_CancelChallengeSaveFailed incrementgamestat GAME_STAT_ENTERED_BATTLE_TOWER setvar VAR_BRAVO_TRAINER_BATTLE_TOWER_ON, FALSE goto BattleFrontier_BattleTowerLobby_EventScript_EnterElevator @@ -338,8 +323,7 @@ BattleFrontier_BattleTowerLobby_EventScript_TryEnterMultisChallenge:: case FRONTIER_LVL_TENT, BattleFrontier_BattleTowerLobby_EventScript_CancelChallenge case MULTI_B_PRESSED, BattleFrontier_BattleTowerLobby_EventScript_CancelChallenge frontier_checkineligible - compare VAR_0x8004, TRUE - goto_if_eq BattleFrontier_BattleTowerLobby_EventScript_NotEnoughValidMons + goto_if_eq VAR_0x8004, TRUE, BattleFrontier_BattleTowerLobby_EventScript_NotEnoughValidMons frontier_set FRONTIER_DATA_LVL_MODE, VAR_RESULT msgbox BattleFrontier_BattleTowerLobby_Text_PleaseSelectTwoMons, MSGBOX_DEFAULT fadescreen FADE_TO_BLACK @@ -348,8 +332,7 @@ BattleFrontier_BattleTowerLobby_EventScript_TryEnterMultisChallenge:: setvar VAR_0x8005, FRONTIER_MULTI_PARTY_SIZE special ChoosePartyForBattleFrontier waitstate - compare VAR_RESULT, 0 - goto_if_eq BattleFrontier_BattleTowerLobby_EventScript_LoadPartyCancelChallenge + goto_if_eq VAR_RESULT, 0, BattleFrontier_BattleTowerLobby_EventScript_LoadPartyCancelChallenge msgbox BattleFrontier_BattleTowerLobby_Text_OkayToSaveBeforeEntering, MSGBOX_YESNO switch VAR_RESULT case NO, BattleFrontier_BattleTowerLobby_EventScript_LoadPartyCancelChallenge @@ -367,8 +350,7 @@ BattleFrontier_BattleTowerLobby_EventScript_SaveBeforeMultisChallenge:: delay 2 call Common_EventScript_SaveGame setvar VAR_TEMP_0, 255 - compare VAR_RESULT, 0 - goto_if_eq BattleFrontier_BattleTowerLobby_EventScript_CancelChallengeSaveFailed + goto_if_eq VAR_RESULT, 0, BattleFrontier_BattleTowerLobby_EventScript_CancelChallengeSaveFailed incrementgamestat GAME_STAT_ENTERED_BATTLE_TOWER setvar VAR_BRAVO_TRAINER_BATTLE_TOWER_ON, FALSE goto BattleFrontier_BattleTowerLobby_EventScript_EnterElevator @@ -404,8 +386,7 @@ BattleFrontier_BattleTowerLobby_EventScript_TryEnterLinkMultisChallenge:: case FRONTIER_LVL_TENT, BattleFrontier_BattleTowerLobby_EventScript_CancelChallenge case MULTI_B_PRESSED, BattleFrontier_BattleTowerLobby_EventScript_CancelChallenge frontier_checkineligible - compare VAR_0x8004, TRUE - goto_if_eq BattleFrontier_BattleTowerLobby_EventScript_NotEnoughValidMons + goto_if_eq VAR_0x8004, TRUE, BattleFrontier_BattleTowerLobby_EventScript_NotEnoughValidMons frontier_set FRONTIER_DATA_LVL_MODE, VAR_RESULT msgbox BattleFrontier_BattleTowerLobby_Text_PleaseSelectTwoMons2, MSGBOX_DEFAULT fadescreen FADE_TO_BLACK @@ -414,8 +395,7 @@ BattleFrontier_BattleTowerLobby_EventScript_TryEnterLinkMultisChallenge:: setvar VAR_0x8005, FRONTIER_MULTI_PARTY_SIZE special ChoosePartyForBattleFrontier waitstate - compare VAR_RESULT, 0 - goto_if_eq BattleFrontier_BattleTowerLobby_EventScript_LoadPartyCancelChallenge + goto_if_eq VAR_RESULT, 0, BattleFrontier_BattleTowerLobby_EventScript_LoadPartyCancelChallenge msgbox BattleFrontier_BattleTowerLobby_Text_OkayToSaveBeforeEntering, MSGBOX_YESNO switch VAR_RESULT case NO, BattleFrontier_BattleTowerLobby_EventScript_LoadPartyCancelChallenge @@ -434,12 +414,10 @@ BattleFrontier_BattleTowerLobby_EventScript_SaveBeforeLinkMultisChallenge:: tower_save 0 call Common_EventScript_SaveGame setvar VAR_TEMP_0, 255 - compare VAR_RESULT, 0 - goto_if_eq BattleFrontier_BattleTowerLobby_EventScript_CancelChallengeSaveFailed + goto_if_eq VAR_RESULT, 0, BattleFrontier_BattleTowerLobby_EventScript_CancelChallengeSaveFailed incrementgamestat GAME_STAT_ENTERED_BATTLE_TOWER specialvar VAR_RESULT, IsWirelessAdapterConnected - compare VAR_RESULT, TRUE - goto_if_eq BattleFrontier_BattleTowerLobby_EventScript_TryWirelessLink + goto_if_eq VAR_RESULT, TRUE, BattleFrontier_BattleTowerLobby_EventScript_TryWirelessLink goto BattleFrontier_BattleTowerLobby_EventScript_TryCableLink end @@ -491,10 +469,8 @@ BattleFrontier_BattleTowerLobby_EventScript_FeelingsWontTell:: end BattleFrontier_BattleTowerLobby_EventScript_CheckFeelings:: - compare VAR_RESULT, 0 - goto_if_eq BattleFrontier_BattleTowerLobby_EventScript_CanceledEasyChat - compare VAR_RESULT, 1 - goto_if_eq BattleFrontier_BattleTowerLobby_EventScript_SubmittedFeelings + goto_if_eq VAR_RESULT, 0, BattleFrontier_BattleTowerLobby_EventScript_CanceledEasyChat + goto_if_eq VAR_RESULT, 1, BattleFrontier_BattleTowerLobby_EventScript_SubmittedFeelings end BattleFrontier_BattleTowerLobby_EventScript_CanceledEasyChat:: @@ -611,19 +587,17 @@ BattleFrontier_BattleTowerLobby_EventScript_EnterElevator:: BattleFrontier_BattleTowerLobby_EventScript_WaitForLinkOpponentLoad:: tower_loadlinkopponents delay 1 - compare VAR_RESULT, 6 - goto_if_ne BattleFrontier_BattleTowerLobby_EventScript_WaitForLinkOpponentLoad + goto_if_ne VAR_RESULT, 6, BattleFrontier_BattleTowerLobby_EventScript_WaitForLinkOpponentLoad call BattleFrontier_BattleTowerLobby_EventScript_ShowYouToBattleRoom clearflag FLAG_CANCEL_BATTLE_ROOM_CHALLENGE - warp MAP_BATTLE_FRONTIER_BATTLE_TOWER_ELEVATOR, 255, 1, 6 + warp MAP_BATTLE_FRONTIER_BATTLE_TOWER_ELEVATOR, 1, 6 setvar VAR_TEMP_0, 0 waitstate end BattleFrontier_BattleTowerLobby_EventScript_ShowYouToBattleRoom:: call BattleFrontier_BattleTowerLobby_EventScript_BufferModeText - compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_LINK_MULTIS - goto_if_eq BattleFrontier_BattleTowerLobby_EventScript_ShowYouToLinkMultiBattleRoom + goto_if_eq VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_LINK_MULTIS, BattleFrontier_BattleTowerLobby_EventScript_ShowYouToLinkMultiBattleRoom msgbox BattleFrontier_BattleTowerLobby_Text_ShowYouToBattleRoom, MSGBOX_DEFAULT goto BattleFrontier_BattleTowerLobby_EventScript_WalkToElevator @@ -675,41 +649,33 @@ BattleFrontier_BattleTowerLobby_Movement_UnusedEnterElevator: step_end BattleFrontier_BattleTowerLobby_EventScript_BufferModeText:: - compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_SINGLES - call_if_eq BattleFrontier_BattleTowerLobby_EventScript_BufferTextSingle - compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_DOUBLES - call_if_eq BattleFrontier_BattleTowerLobby_EventScript_BufferTextDouble - compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_MULTIS - call_if_eq BattleFrontier_BattleTowerLobby_EventScript_BufferTextMulti - compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_LINK_MULTIS - call_if_eq BattleFrontier_BattleTowerLobby_EventScript_BufferTextLinkMulti + call_if_eq VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_SINGLES, BattleFrontier_BattleTowerLobby_EventScript_BufferTextSingle + call_if_eq VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_DOUBLES, BattleFrontier_BattleTowerLobby_EventScript_BufferTextDouble + call_if_eq VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_MULTIS, BattleFrontier_BattleTowerLobby_EventScript_BufferTextMulti + call_if_eq VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_LINK_MULTIS, BattleFrontier_BattleTowerLobby_EventScript_BufferTextLinkMulti return BattleFrontier_BattleTowerLobby_EventScript_BufferTextSingle:: - bufferstdstring 0, STDSTRING_SINGLE + bufferstdstring STR_VAR_1, STDSTRING_SINGLE return BattleFrontier_BattleTowerLobby_EventScript_BufferTextDouble:: - bufferstdstring 0, STDSTRING_DOUBLE + bufferstdstring STR_VAR_1, STDSTRING_DOUBLE return BattleFrontier_BattleTowerLobby_EventScript_BufferTextMulti:: - bufferstdstring 0, STDSTRING_MULTI + bufferstdstring STR_VAR_1, STDSTRING_MULTI return BattleFrontier_BattleTowerLobby_EventScript_BufferTextLinkMulti:: - bufferstdstring 0, STDSTRING_MULTI_LINK + bufferstdstring STR_VAR_1, STDSTRING_MULTI_LINK return BattleFrontier_BattleTowerLobby_EventScript_SetAttendantTalkedTo:: - compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_SINGLES - call_if_eq BattleFrontier_BattleTowerLobby_EventScript_TalkedToSinglesAttendant - compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_DOUBLES - call_if_eq BattleFrontier_BattleTowerLobby_EventScript_TalkedToDoublesAttendant - compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_MULTIS - call_if_eq BattleFrontier_BattleTowerLobby_EventScript_TalkedToMultisAttendant - compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_LINK_MULTIS - call_if_eq BattleFrontier_BattleTowerLobby_EventScript_TalkedToLinkMultisAttendant + call_if_eq VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_SINGLES, BattleFrontier_BattleTowerLobby_EventScript_TalkedToSinglesAttendant + call_if_eq VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_DOUBLES, BattleFrontier_BattleTowerLobby_EventScript_TalkedToDoublesAttendant + call_if_eq VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_MULTIS, BattleFrontier_BattleTowerLobby_EventScript_TalkedToMultisAttendant + call_if_eq VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_LINK_MULTIS, BattleFrontier_BattleTowerLobby_EventScript_TalkedToLinkMultisAttendant return BattleFrontier_BattleTowerLobby_EventScript_TalkedToSinglesAttendant:: @@ -729,14 +695,10 @@ BattleFrontier_BattleTowerLobby_EventScript_TalkedToLinkMultisAttendant:: return BattleFrontier_BattleTowerLobby_EventScript_GetDoorXCoord:: - compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_SINGLES - call_if_eq BattleFrontier_BattleTowerLobby_EventScript_GetDoorXCoordSingles - compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_DOUBLES - call_if_eq BattleFrontier_BattleTowerLobby_EventScript_GetDoorXCoordDoubles - compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_MULTIS - call_if_eq BattleFrontier_BattleTowerLobby_EventScript_GetDoorXCoordMultis - compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_LINK_MULTIS - call_if_eq BattleFrontier_BattleTowerLobby_EventScript_GetDoorXCoordLinkMultis + call_if_eq VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_SINGLES, BattleFrontier_BattleTowerLobby_EventScript_GetDoorXCoordSingles + call_if_eq VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_DOUBLES, BattleFrontier_BattleTowerLobby_EventScript_GetDoorXCoordDoubles + call_if_eq VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_MULTIS, BattleFrontier_BattleTowerLobby_EventScript_GetDoorXCoordMultis + call_if_eq VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_LINK_MULTIS, BattleFrontier_BattleTowerLobby_EventScript_GetDoorXCoordLinkMultis return BattleFrontier_BattleTowerLobby_EventScript_GetDoorXCoordSingles:: @@ -756,14 +718,10 @@ BattleFrontier_BattleTowerLobby_EventScript_GetDoorXCoordLinkMultis:: return BattleFrontier_BattleTowerLobby_EventScript_GetPartySize:: - compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_SINGLES - call_if_eq BattleFrontier_BattleTowerLobby_EventScript_GetSinglesPartySize - compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_DOUBLES - call_if_eq BattleFrontier_BattleTowerLobby_EventScript_GetDoublesPartySize - compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_MULTIS - call_if_eq BattleFrontier_BattleTowerLobby_EventScript_GetMultisPartySize - compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_LINK_MULTIS - call_if_eq BattleFrontier_BattleTowerLobby_EventScript_GetLinkMultisPartySize + call_if_eq VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_SINGLES, BattleFrontier_BattleTowerLobby_EventScript_GetSinglesPartySize + call_if_eq VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_DOUBLES, BattleFrontier_BattleTowerLobby_EventScript_GetDoublesPartySize + call_if_eq VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_MULTIS, BattleFrontier_BattleTowerLobby_EventScript_GetMultisPartySize + call_if_eq VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_LINK_MULTIS, BattleFrontier_BattleTowerLobby_EventScript_GetLinkMultisPartySize return BattleFrontier_BattleTowerLobby_EventScript_GetSinglesPartySize:: @@ -793,26 +751,18 @@ BattleFrontier_BattleTowerLobby_EventScript_TryCableLink:: setvar VAR_0x8005, 0 special TryBattleLinkup waitstate - compare VAR_RESULT, LINKUP_SUCCESS - goto_if_eq BattleFrontier_BattleTowerLobby_EventScript_CableLinkSuccessful - compare VAR_RESULT, LINKUP_SOMEONE_NOT_READY - goto_if_eq CableClub_EventScript_AbortLinkSomeoneNotReady - compare VAR_RESULT, LINKUP_DIFF_SELECTIONS - goto_if_eq BattleFrontier_BattleTowerLobby_EventScript_AbortLinkDifferentSelections - compare VAR_RESULT, LINKUP_WRONG_NUM_PLAYERS - goto_if_eq BattleFrontier_BattleTowerLobby_EventScript_AbortLinkIncorrectNumberOfPlayers - compare VAR_RESULT, LINKUP_FAILED - goto_if_eq BattleFrontier_BattleTowerLobby_EventScript_CancelChallenge - compare VAR_RESULT, LINKUP_CONNECTION_ERROR - goto_if_eq CableClub_EventScript_AbortLinkConnectionError - compare VAR_RESULT, LINKUP_FAILED_BATTLE_TOWER - goto_if_eq BattleFrontier_BattleTowerLobby_EventScript_AbortLink + goto_if_eq VAR_RESULT, LINKUP_SUCCESS, BattleFrontier_BattleTowerLobby_EventScript_CableLinkSuccessful + goto_if_eq VAR_RESULT, LINKUP_SOMEONE_NOT_READY, CableClub_EventScript_AbortLinkSomeoneNotReady + goto_if_eq VAR_RESULT, LINKUP_DIFF_SELECTIONS, BattleFrontier_BattleTowerLobby_EventScript_AbortLinkDifferentSelections + goto_if_eq VAR_RESULT, LINKUP_WRONG_NUM_PLAYERS, BattleFrontier_BattleTowerLobby_EventScript_AbortLinkIncorrectNumberOfPlayers + goto_if_eq VAR_RESULT, LINKUP_FAILED, BattleFrontier_BattleTowerLobby_EventScript_CancelChallenge + goto_if_eq VAR_RESULT, LINKUP_CONNECTION_ERROR, CableClub_EventScript_AbortLinkConnectionError + goto_if_eq VAR_RESULT, LINKUP_FAILED_BATTLE_TOWER, BattleFrontier_BattleTowerLobby_EventScript_AbortLink end BattleFrontier_BattleTowerLobby_EventScript_AbortLinkDifferentSelections:: special CloseLink - compare VAR_0x8005, 3 - goto_if_eq BattleFrontier_BattleTowerLobby_EventScript_FriendDifferentSelection + goto_if_eq VAR_0x8005, 3, BattleFrontier_BattleTowerLobby_EventScript_FriendDifferentSelection msgbox Text_PlayersMadeDifferentSelections, MSGBOX_DEFAULT release end @@ -832,12 +782,9 @@ BattleFrontier_BattleTowerLobby_EventScript_AbortLinkIncorrectNumberOfPlayers:: BattleFrontier_BattleTowerLobby_EventScript_AbortLink:: special CloseLink - compare VAR_0x8005, 0 - call_if_eq BattleFrontier_BattleTowerLobby_EventScript_FriendChoseDifferentLvlMode - compare VAR_0x8005, 1 - call_if_eq BattleFrontier_BattleTowerLobby_EventScript_FriendAlsoSelectedMon - compare VAR_0x8005, 2 - call_if_eq BattleFrontier_BattleTowerLobby_EventScript_FriendAlsoSelectedMons + call_if_eq VAR_0x8005, 0, BattleFrontier_BattleTowerLobby_EventScript_FriendChoseDifferentLvlMode + call_if_eq VAR_0x8005, 1, BattleFrontier_BattleTowerLobby_EventScript_FriendAlsoSelectedMon + call_if_eq VAR_0x8005, 2, BattleFrontier_BattleTowerLobby_EventScript_FriendAlsoSelectedMons msgbox BattleFrontier_BattleTowerLobby_Text_ChooseDifferentMonsMatchLvlMode, MSGBOX_DEFAULT release end @@ -891,27 +838,19 @@ BattleFrontier_BattleTowerLobby_EventScript_ChooseLeader:: BattleFrontier_BattleTowerLobby_EventScript_TryBecomeLeader:: call CableClub_EventScript_TryBecomeLinkLeader - compare VAR_RESULT, LINKUP_SUCCESS - goto_if_eq BattleFrontier_BattleTowerLobby_EventScript_WirelessLinkSuccessful - compare VAR_RESULT, LINKUP_FAILED - goto_if_eq BattleFrontier_BattleTowerLobby_EventScript_ChooseLeader - compare VAR_RESULT, LINKUP_RETRY_ROLE_ASSIGN - goto_if_eq BattleFrontier_BattleTowerLobby_EventScript_TryBecomeLeader - compare VAR_RESULT, LINKUP_FAILED_BATTLE_TOWER - goto_if_eq BattleFrontier_BattleTowerLobby_EventScript_AbortLink + goto_if_eq VAR_RESULT, LINKUP_SUCCESS, BattleFrontier_BattleTowerLobby_EventScript_WirelessLinkSuccessful + goto_if_eq VAR_RESULT, LINKUP_FAILED, BattleFrontier_BattleTowerLobby_EventScript_ChooseLeader + goto_if_eq VAR_RESULT, LINKUP_RETRY_ROLE_ASSIGN, BattleFrontier_BattleTowerLobby_EventScript_TryBecomeLeader + goto_if_eq VAR_RESULT, LINKUP_FAILED_BATTLE_TOWER, BattleFrontier_BattleTowerLobby_EventScript_AbortLink release return BattleFrontier_BattleTowerLobby_EventScript_TryJoinGroup:: call CableClub_EventScript_TryJoinLinkGroup - compare VAR_RESULT, LINKUP_SUCCESS - goto_if_eq BattleFrontier_BattleTowerLobby_EventScript_WirelessLinkSuccessful - compare VAR_RESULT, LINKUP_FAILED - goto_if_eq BattleFrontier_BattleTowerLobby_EventScript_ChooseLeader - compare VAR_RESULT, LINKUP_RETRY_ROLE_ASSIGN - goto_if_eq BattleFrontier_BattleTowerLobby_EventScript_TryJoinGroup - compare VAR_RESULT, LINKUP_FAILED_BATTLE_TOWER - goto_if_eq BattleFrontier_BattleTowerLobby_EventScript_AbortLink + goto_if_eq VAR_RESULT, LINKUP_SUCCESS, BattleFrontier_BattleTowerLobby_EventScript_WirelessLinkSuccessful + goto_if_eq VAR_RESULT, LINKUP_FAILED, BattleFrontier_BattleTowerLobby_EventScript_ChooseLeader + goto_if_eq VAR_RESULT, LINKUP_RETRY_ROLE_ASSIGN, BattleFrontier_BattleTowerLobby_EventScript_TryJoinGroup + goto_if_eq VAR_RESULT, LINKUP_FAILED_BATTLE_TOWER, BattleFrontier_BattleTowerLobby_EventScript_AbortLink release return diff --git a/data/maps/BattleFrontier_BattleTowerMultiBattleRoom/scripts.inc b/data/maps/BattleFrontier_BattleTowerMultiBattleRoom/scripts.inc index 9bfcfddc2ff7..e1cb64dda002 100644 --- a/data/maps/BattleFrontier_BattleTowerMultiBattleRoom/scripts.inc +++ b/data/maps/BattleFrontier_BattleTowerMultiBattleRoom/scripts.inc @@ -16,17 +16,14 @@ BattleFrontier_BattleTowerMultiBattleRoom_MapScripts:: @ The multi partner is represented by LOCALID_PARTNER, which has the gfx id VAR_OBJ_GFX_ID_E BattleFrontier_BattleTowerMultiBattleRoom_OnTransition: - compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_MULTIS - call_if_eq BattleFrontier_BattleTowerMultiBattleRoom_EventScript_SetObjGfx - compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_LINK_MULTIS - call_if_eq BattleFrontier_BattleTowerMultiBattleRoom_EventScript_SetLinkPlayerGfx + call_if_eq VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_MULTIS, BattleFrontier_BattleTowerMultiBattleRoom_EventScript_SetObjGfx + call_if_eq VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_LINK_MULTIS, BattleFrontier_BattleTowerMultiBattleRoom_EventScript_SetLinkPlayerGfx end BattleFrontier_BattleTowerMultiBattleRoom_EventScript_SetObjGfx:: tower_setpartnergfx checkplayergender - compare VAR_RESULT, FEMALE - goto_if_eq BattleFrontier_BattleTowerMultiBattleRoom_EventScript_SetPlayerGfxFemale + goto_if_eq VAR_RESULT, FEMALE, BattleFrontier_BattleTowerMultiBattleRoom_EventScript_SetPlayerGfxFemale setvar VAR_OBJ_GFX_ID_F, OBJ_EVENT_GFX_BRENDAN_NORMAL return @@ -56,8 +53,7 @@ BattleFrontier_BattleTowerMultiBattleRoom_EventScript_EnterRoom:: applymovement LOCALID_PARTNER, BattleFrontier_BattleTowerMultiBattleRoom_Movement_PartnerEnterRoom waitmovement 0 frontier_get FRONTIER_DATA_BATTLE_NUM - compare VAR_RESULT, 0 - goto_if_eq BattleFrontier_BattleTowerMultiBattleRoom_EventScript_OpponentsEnter + goto_if_eq VAR_RESULT, 0, BattleFrontier_BattleTowerMultiBattleRoom_EventScript_OpponentsEnter applymovement LOCALID_ATTENDANT_1, BattleFrontier_BattleTowerMultiBattleRoom_Movement_AttendantApproachPlayer applymovement LOCALID_ATTENDANT_2, BattleFrontier_BattleTowerMultiBattleRoom_Movement_AttendantApproachPlayer waitmovement 0 @@ -74,8 +70,7 @@ BattleFrontier_BattleTowerMultiBattleRoom_EventScript_OpponentsEnter:: applymovement LOCALID_OPPONENT_1, BattleFrontier_BattleTowerMultiBattleRoom_Movement_Opponent1Enter applymovement LOCALID_OPPONENT_2, BattleFrontier_BattleTowerMultiBattleRoom_Movement_Opponent2Enter waitmovement 0 - compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_LINK_MULTIS - goto_if_eq BattleFrontier_BattleTowerMultiBattleRoom_EventScript_DoOpponentIntrosLink + goto_if_eq VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_LINK_MULTIS, BattleFrontier_BattleTowerMultiBattleRoom_EventScript_DoOpponentIntrosLink tower_getopponentintro 0 delay 15 applymovement LOCALID_OPPONENT_1, BattleFrontier_BattleTowerMultiBattleRoom_Movement_WalkInPlaceLeft @@ -130,8 +125,7 @@ BattleFrontier_BattleTowerMultiBattleRoom_EventScript_DefeatedOpponents:: applymovement LOCALID_PLAYER, BattleFrontier_BattleTowerMultiBattleRoom_Movement_FaceAttendant applymovement LOCALID_PARTNER, BattleFrontier_BattleTowerMultiBattleRoom_Movement_FaceAttendant waitmovement 0 - compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_LINK_MULTIS - goto_if_eq BattleFrontier_BattleTowerMultiBattleRoom_EventScript_RetorePartyMsgLink + goto_if_eq VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_LINK_MULTIS, BattleFrontier_BattleTowerMultiBattleRoom_EventScript_RetorePartyMsgLink msgbox BattleFrontier_BattleTowerBattleRoom_Text_RestoreMonsToFullHealth, MSGBOX_DEFAULT goto BattleFrontier_BattleTowerMultiBattleRoom_EventScript_RestoreParty @@ -142,19 +136,16 @@ BattleFrontier_BattleTowerMultiBattleRoom_EventScript_RetorePartyMsgLink:: BattleFrontier_BattleTowerMultiBattleRoom_EventScript_RestoreParty:: special LoadPlayerParty frontier_setpartyorder FRONTIER_MULTI_PARTY_SIZE - compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_LINK_MULTIS - call_if_eq BattleFrontier_BattleTowerMultiBattleRoom_EventScript_ReconnectLink + call_if_eq VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_LINK_MULTIS, BattleFrontier_BattleTowerMultiBattleRoom_EventScript_ReconnectLink playfanfare MUS_HEAL waitfanfare special HealPlayerParty BattleFrontier_BattleTowerMultiBattleRoom_EventScript_AskReadyForOpponents:: frontier_get FRONTIER_DATA_BATTLE_NUM call BattleFrontier_BattleTowerMultiBattleRoom_EventScript_ReadyForNextOpponentSet - compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_LINK_MULTIS - goto_if_eq BattleFrontier_BattleTowerMultiBattleRoom_EventScript_ContinueChallenge + goto_if_eq VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_LINK_MULTIS, BattleFrontier_BattleTowerMultiBattleRoom_EventScript_ContinueChallenge call BattleFrontier_EventScript_GetCantRecordBattle - compare VAR_RESULT, TRUE - goto_if_eq BattleFrontier_BattleTowerMultiBattleRoom_EventScript_AskReadyForOpponentsNoRecord + goto_if_eq VAR_RESULT, TRUE, BattleFrontier_BattleTowerMultiBattleRoom_EventScript_AskReadyForOpponentsNoRecord multichoice 19, 4, MULTI_GO_ON_RECORD_REST_RETIRE, TRUE switch VAR_RESULT case 0, BattleFrontier_BattleTowerMultiBattleRoom_EventScript_ContinueChallenge @@ -230,8 +221,7 @@ BattleFrontier_BattleTowerMultiBattleRoom_EventScript_PauseChallenge:: end BattleFrontier_BattleTowerMultiBattleRoom_EventScript_ReadyForNextOpponentSet:: - compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_LINK_MULTIS - goto_if_eq BattleFrontier_BattleTowerMultiBattleRoom_EventScript_ReadyForNextOpponentSetLink + goto_if_eq VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_LINK_MULTIS, BattleFrontier_BattleTowerMultiBattleRoom_EventScript_ReadyForNextOpponentSetLink copyvar VAR_TEMP_F, VAR_RESULT switch VAR_TEMP_F case 1, BattleFrontier_BattleTowerMultiBattleRoom_EventScript_ReadyFor2ndOpponentSet @@ -347,8 +337,7 @@ BattleFrontier_BattleTowerMultiBattleRoom_EventScript_ContinueChallengeLink:: waitmessage special LinkRetireStatusWithBattleTowerPartner waitstate - compare VAR_RESULT, BATTLE_TOWER_LINKSTAT_CONTINUE - goto_if_ne BattleFrontier_BattleTowerMultiBattleRoom_EventScript_WarpToLobbyLost + goto_if_ne VAR_RESULT, BATTLE_TOWER_LINKSTAT_CONTINUE, BattleFrontier_BattleTowerMultiBattleRoom_EventScript_WarpToLobbyLost goto BattleFrontier_BattleTowerMultiBattleRoom_EventScript_LinkDelayForMsg end @@ -368,8 +357,7 @@ BattleFrontier_BattleTowerMultiBattleRoom_EventScript_AskRetireChallengeLink:: message BattleFrontier_BattleTowerBattleRoom_Text_CancelYourChallenge waitmessage multichoicedefault 20, 8, MULTI_YESNO, 1, FALSE - compare VAR_RESULT, 0 - goto_if_eq BattleFrontier_BattleTowerMultiBattleRoom_EventScript_RetireChallengeLink + goto_if_eq VAR_RESULT, 0, BattleFrontier_BattleTowerMultiBattleRoom_EventScript_RetireChallengeLink goto BattleFrontier_BattleTowerMultiBattleRoom_EventScript_AskReadyForOpponents end diff --git a/data/maps/BattleFrontier_BattleTowerMultiCorridor/scripts.inc b/data/maps/BattleFrontier_BattleTowerMultiCorridor/scripts.inc index 70922d473cae..b36d2e6fd3ee 100644 --- a/data/maps/BattleFrontier_BattleTowerMultiCorridor/scripts.inc +++ b/data/maps/BattleFrontier_BattleTowerMultiCorridor/scripts.inc @@ -14,17 +14,14 @@ BattleFrontier_BattleTowerMultiCorridor_MapScripts:: @ The multi partner is represented by LOCALID_PARTNER, and has the gfx id VAR_OBJ_GFX_ID_E BattleFrontier_BattleTowerMultiCorridor_OnTransition: - compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_MULTIS - call_if_eq BattleFrontier_BattleTowerMultiCorridor_EventScript_SetObjGfx - compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_LINK_MULTIS - call_if_eq BattleFrontier_BattleTowerMultiCorridor_EventScript_SetLinkPlayerGfx + call_if_eq VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_MULTIS, BattleFrontier_BattleTowerMultiCorridor_EventScript_SetObjGfx + call_if_eq VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_LINK_MULTIS, BattleFrontier_BattleTowerMultiCorridor_EventScript_SetLinkPlayerGfx end BattleFrontier_BattleTowerMultiCorridor_EventScript_SetObjGfx:: tower_setpartnergfx checkplayergender - compare VAR_RESULT, FEMALE - goto_if_eq BattleFrontier_BattleTowerMultiCorridor_EventScript_SetPlayerGfxFemale + goto_if_eq VAR_RESULT, FEMALE, BattleFrontier_BattleTowerMultiCorridor_EventScript_SetPlayerGfxFemale setvar VAR_OBJ_GFX_ID_F, OBJ_EVENT_GFX_BRENDAN_NORMAL return @@ -95,29 +92,25 @@ BattleFrontier_BattleTowerMultiCorridor_EventScript_EnterCorridor:: end BattleFrontier_BattleTowerMultiCorridor_EventScript_WarpToBattleRoom:: - compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_SINGLES - call_if_eq BattleFrontier_BattleTowerMultiCorridor_EventScript_WarpToNormalBattleRoom - compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_DOUBLES - call_if_eq BattleFrontier_BattleTowerMultiCorridor_EventScript_WarpToNormalBattleRoom - compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_MULTIS - call_if_eq BattleFrontier_BattleTowerMultiCorridor_EventScript_WarpToMultiBattleRoom - compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_LINK_MULTIS - call_if_eq BattleFrontier_BattleTowerMultiCorridor_EventScript_WarpToLinkMultiBattleRoom + call_if_eq VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_SINGLES, BattleFrontier_BattleTowerMultiCorridor_EventScript_WarpToNormalBattleRoom + call_if_eq VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_DOUBLES, BattleFrontier_BattleTowerMultiCorridor_EventScript_WarpToNormalBattleRoom + call_if_eq VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_MULTIS, BattleFrontier_BattleTowerMultiCorridor_EventScript_WarpToMultiBattleRoom + call_if_eq VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_LINK_MULTIS, BattleFrontier_BattleTowerMultiCorridor_EventScript_WarpToLinkMultiBattleRoom return BattleFrontier_BattleTowerMultiCorridor_EventScript_WarpToNormalBattleRoom:: - warp MAP_BATTLE_FRONTIER_BATTLE_TOWER_BATTLE_ROOM, 255, 4, 8 + warp MAP_BATTLE_FRONTIER_BATTLE_TOWER_BATTLE_ROOM, 4, 8 waitstate return BattleFrontier_BattleTowerMultiCorridor_EventScript_WarpToMultiBattleRoom:: - warp MAP_BATTLE_FRONTIER_BATTLE_TOWER_MULTI_BATTLE_ROOM, 255, 4, 5 + warp MAP_BATTLE_FRONTIER_BATTLE_TOWER_MULTI_BATTLE_ROOM, 4, 5 waitstate return @ Unnecessary duplicate of the above BattleFrontier_BattleTowerMultiCorridor_EventScript_WarpToLinkMultiBattleRoom:: - warp MAP_BATTLE_FRONTIER_BATTLE_TOWER_MULTI_BATTLE_ROOM, 255, 4, 5 + warp MAP_BATTLE_FRONTIER_BATTLE_TOWER_MULTI_BATTLE_ROOM, 4, 5 waitstate return diff --git a/data/maps/BattleFrontier_BattleTowerMultiPartnerRoom/scripts.inc b/data/maps/BattleFrontier_BattleTowerMultiPartnerRoom/scripts.inc index 06038b43cd9b..b9fc7d554342 100644 --- a/data/maps/BattleFrontier_BattleTowerMultiPartnerRoom/scripts.inc +++ b/data/maps/BattleFrontier_BattleTowerMultiPartnerRoom/scripts.inc @@ -87,8 +87,7 @@ BattleFrontier_BattleTowerMultiPartnerRoom_EventScript_Attendant:: message BattleFrontier_BattleTowerMultiPartnerRoom_Text_QuitLookingForPartner waitmessage multichoicedefault 20, 8, MULTI_YESNO, 1, FALSE - compare VAR_RESULT, 0 - goto_if_eq BattleFrontier_BattleTowerMultiPartnerRoom_EventScript_QuitChallenge + goto_if_eq VAR_RESULT, 0, BattleFrontier_BattleTowerMultiPartnerRoom_EventScript_QuitChallenge msgbox BattleFrontier_BattleTowerMultiPartnerRoom_Text_PleaseFindPartner2, MSGBOX_DEFAULT release end @@ -108,7 +107,7 @@ BattleFrontier_BattleTowerMultiPartnerRoom_EventScript_EnterElevator:: call BattleFrontier_BattleTowerMultiPartnerRoom_EventScript_MoveToElevator closedoor 10, 1 waitdooranim - warp MAP_BATTLE_FRONTIER_BATTLE_TOWER_ELEVATOR, 255, 1, 6 + warp MAP_BATTLE_FRONTIER_BATTLE_TOWER_ELEVATOR, 1, 6 waitstate releaseall end @@ -183,13 +182,11 @@ BattleFrontier_BattleTowerMultiPartnerRoom_EventScript_TalkToPotentialPartner:: waitmessage waitbuttonpress closemessage - compare VAR_FACING, DIR_SOUTH - call_if_ne BattleFrontier_BattleTowerMultiPartnerRoom_EventScript_PartnerExit - compare VAR_FACING, DIR_SOUTH - call_if_eq BattleFrontier_BattleTowerMultiPartnerRoom_EventScript_PartnerExitSouth + call_if_ne VAR_FACING, DIR_SOUTH, BattleFrontier_BattleTowerMultiPartnerRoom_EventScript_PartnerExit + call_if_eq VAR_FACING, DIR_SOUTH, BattleFrontier_BattleTowerMultiPartnerRoom_EventScript_PartnerExitSouth removeobject VAR_LAST_TALKED setflag FLAG_CHOSEN_MULTI_BATTLE_NPC_PARTNER - warpsilent MAP_BATTLE_FRONTIER_BATTLE_TOWER_MULTI_PARTNER_ROOM, 255, 10, 3 + warpsilent MAP_BATTLE_FRONTIER_BATTLE_TOWER_MULTI_PARTNER_ROOM, 10, 3 waitstate release end diff --git a/data/maps/BattleFrontier_ExchangeServiceCorner/scripts.inc b/data/maps/BattleFrontier_ExchangeServiceCorner/scripts.inc index 360b8162cf46..703b1ec900fc 100644 --- a/data/maps/BattleFrontier_ExchangeServiceCorner/scripts.inc +++ b/data/maps/BattleFrontier_ExchangeServiceCorner/scripts.inc @@ -14,38 +14,30 @@ BattleFrontier_ExchangeServiceCorner_EventScript_ClerkGoodbye:: BattleFrontier_ExchangeServiceCorner_EventScript_TryPurchasePrize:: specialvar VAR_TEMP_1, GetFrontierBattlePoints - compare VAR_TEMP_1, VAR_0x8008 - goto_if_ge BattleFrontier_ExchangeServiceCorner_EventScript_TryGivePrize + goto_if_ge VAR_TEMP_1, VAR_0x8008, BattleFrontier_ExchangeServiceCorner_EventScript_TryGivePrize msgbox BattleFrontier_ExchangeServiceCorner_Text_DontHaveEnoughPoints, MSGBOX_DEFAULT - compare VAR_TEMP_2, EXCHANGE_CORNER_DECOR1_CLERK - goto_if_eq BattleFrontier_ExchangeServiceCorner_EventScript_ChooseDecor1 - compare VAR_TEMP_2, EXCHANGE_CORNER_DECOR2_CLERK - goto_if_eq BattleFrontier_ExchangeServiceCorner_EventScript_ChooseDecor2 - compare VAR_TEMP_2, EXCHANGE_CORNER_VITAMIN_CLERK - goto_if_eq BattleFrontier_ExchangeServiceCorner_EventScript_ChooseVitamin + goto_if_eq VAR_TEMP_2, EXCHANGE_CORNER_DECOR1_CLERK, BattleFrontier_ExchangeServiceCorner_EventScript_ChooseDecor1 + goto_if_eq VAR_TEMP_2, EXCHANGE_CORNER_DECOR2_CLERK, BattleFrontier_ExchangeServiceCorner_EventScript_ChooseDecor2 + goto_if_eq VAR_TEMP_2, EXCHANGE_CORNER_VITAMIN_CLERK, BattleFrontier_ExchangeServiceCorner_EventScript_ChooseVitamin goto BattleFrontier_ExchangeServiceCorner_EventScript_ChooseHoldItem end BattleFrontier_ExchangeServiceCorner_EventScript_TryGivePrize:: - compare VAR_TEMP_2, EXCHANGE_CORNER_DECOR1_CLERK - goto_if_eq BattleFrontier_ExchangeServiceCorner_EventScript_TryGiveDecor - compare VAR_TEMP_2, EXCHANGE_CORNER_DECOR2_CLERK - goto_if_eq BattleFrontier_ExchangeServiceCorner_EventScript_TryGiveDecor + goto_if_eq VAR_TEMP_2, EXCHANGE_CORNER_DECOR1_CLERK, BattleFrontier_ExchangeServiceCorner_EventScript_TryGiveDecor + goto_if_eq VAR_TEMP_2, EXCHANGE_CORNER_DECOR2_CLERK, BattleFrontier_ExchangeServiceCorner_EventScript_TryGiveDecor goto BattleFrontier_ExchangeServiceCorner_EventScript_TryGiveItem end BattleFrontier_ExchangeServiceCorner_EventScript_TryGiveDecor:: checkdecorspace VAR_0x8009 - compare VAR_RESULT, FALSE - goto_if_eq BattleFrontier_ExchangeServiceCorner_EventScript_NoRoomForDecor + goto_if_eq VAR_RESULT, FALSE, BattleFrontier_ExchangeServiceCorner_EventScript_NoRoomForDecor copyvar VAR_0x8004, VAR_0x8008 special TakeFrontierBattlePoints adddecoration VAR_0x8009 special UpdateBattlePointsWindow playse SE_SHOP msgbox BattleFrontier_ExchangeServiceCorner_Text_WellSendItToPC, MSGBOX_DEFAULT - compare VAR_TEMP_2, EXCHANGE_CORNER_DECOR1_CLERK - goto_if_eq BattleFrontier_ExchangeServiceCorner_EventScript_ChooseDecor1 + goto_if_eq VAR_TEMP_2, EXCHANGE_CORNER_DECOR1_CLERK, BattleFrontier_ExchangeServiceCorner_EventScript_ChooseDecor1 goto BattleFrontier_ExchangeServiceCorner_EventScript_ChooseDecor2 end @@ -56,17 +48,15 @@ BattleFrontier_ExchangeServiceCorner_EventScript_NoRoomForDecor:: end BattleFrontier_ExchangeServiceCorner_EventScript_TryGiveItem:: - checkitemspace VAR_0x8009, 1 - compare VAR_RESULT, FALSE - goto_if_eq BattleFrontier_ExchangeServiceCorner_EventScript_BagFull + checkitemspace VAR_0x8009 + goto_if_eq VAR_RESULT, FALSE, BattleFrontier_ExchangeServiceCorner_EventScript_BagFull copyvar VAR_0x8004, VAR_0x8008 special TakeFrontierBattlePoints additem VAR_0x8009 special UpdateBattlePointsWindow playse SE_SHOP msgbox BattleFrontier_ExchangeServiceCorner_Text_HereIsYourPrize, MSGBOX_DEFAULT - compare VAR_TEMP_2, EXCHANGE_CORNER_VITAMIN_CLERK - goto_if_eq BattleFrontier_ExchangeServiceCorner_EventScript_ChooseVitamin + goto_if_eq VAR_TEMP_2, EXCHANGE_CORNER_VITAMIN_CLERK, BattleFrontier_ExchangeServiceCorner_EventScript_ChooseVitamin goto BattleFrontier_ExchangeServiceCorner_EventScript_ChooseHoldItem end @@ -107,8 +97,7 @@ BattleFrontier_ExchangeServiceCorner_EventScript_ChooseDecor1:: BattleFrontier_ExchangeServiceCorner_EventScript_KissPoster:: msgbox BattleFrontier_ExchangeServiceCorner_Text_ConfirmKissPoster, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq BattleFrontier_ExchangeServiceCorner_EventScript_ChooseDecor1 + goto_if_eq VAR_RESULT, NO, BattleFrontier_ExchangeServiceCorner_EventScript_ChooseDecor1 setvar VAR_0x8008, 16 setvar VAR_0x8009, DECOR_KISS_POSTER goto BattleFrontier_ExchangeServiceCorner_EventScript_TryPurchasePrize @@ -116,8 +105,7 @@ BattleFrontier_ExchangeServiceCorner_EventScript_KissPoster:: BattleFrontier_ExchangeServiceCorner_EventScript_KissCushion:: msgbox BattleFrontier_ExchangeServiceCorner_Text_ConfirmKissCushion, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq BattleFrontier_ExchangeServiceCorner_EventScript_ChooseDecor1 + goto_if_eq VAR_RESULT, NO, BattleFrontier_ExchangeServiceCorner_EventScript_ChooseDecor1 setvar VAR_0x8008, 32 setvar VAR_0x8009, DECOR_KISS_CUSHION goto BattleFrontier_ExchangeServiceCorner_EventScript_TryPurchasePrize @@ -125,8 +113,7 @@ BattleFrontier_ExchangeServiceCorner_EventScript_KissCushion:: BattleFrontier_ExchangeServiceCorner_EventScript_SmoochumDoll:: msgbox BattleFrontier_ExchangeServiceCorner_Text_ConfirmSmoochumDoll, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq BattleFrontier_ExchangeServiceCorner_EventScript_ChooseDecor1 + goto_if_eq VAR_RESULT, NO, BattleFrontier_ExchangeServiceCorner_EventScript_ChooseDecor1 setvar VAR_0x8008, 32 setvar VAR_0x8009, DECOR_SMOOCHUM_DOLL goto BattleFrontier_ExchangeServiceCorner_EventScript_TryPurchasePrize @@ -134,8 +121,7 @@ BattleFrontier_ExchangeServiceCorner_EventScript_SmoochumDoll:: BattleFrontier_ExchangeServiceCorner_EventScript_TogepiDoll:: msgbox BattleFrontier_ExchangeServiceCorner_Text_ConfirmTogepiDoll, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq BattleFrontier_ExchangeServiceCorner_EventScript_ChooseDecor1 + goto_if_eq VAR_RESULT, NO, BattleFrontier_ExchangeServiceCorner_EventScript_ChooseDecor1 setvar VAR_0x8008, 48 setvar VAR_0x8009, DECOR_TOGEPI_DOLL goto BattleFrontier_ExchangeServiceCorner_EventScript_TryPurchasePrize @@ -143,8 +129,7 @@ BattleFrontier_ExchangeServiceCorner_EventScript_TogepiDoll:: BattleFrontier_ExchangeServiceCorner_EventScript_MeowthDoll:: msgbox BattleFrontier_ExchangeServiceCorner_Text_ConfirmMeowthDoll, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq BattleFrontier_ExchangeServiceCorner_EventScript_ChooseDecor1 + goto_if_eq VAR_RESULT, NO, BattleFrontier_ExchangeServiceCorner_EventScript_ChooseDecor1 setvar VAR_0x8008, 48 setvar VAR_0x8009, DECOR_MEOWTH_DOLL goto BattleFrontier_ExchangeServiceCorner_EventScript_TryPurchasePrize @@ -152,8 +137,7 @@ BattleFrontier_ExchangeServiceCorner_EventScript_MeowthDoll:: BattleFrontier_ExchangeServiceCorner_EventScript_ClefairyDoll:: msgbox BattleFrontier_ExchangeServiceCorner_Text_ConfirmClefairyDoll, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq BattleFrontier_ExchangeServiceCorner_EventScript_ChooseDecor1 + goto_if_eq VAR_RESULT, NO, BattleFrontier_ExchangeServiceCorner_EventScript_ChooseDecor1 setvar VAR_0x8008, 48 setvar VAR_0x8009, DECOR_CLEFAIRY_DOLL goto BattleFrontier_ExchangeServiceCorner_EventScript_TryPurchasePrize @@ -161,8 +145,7 @@ BattleFrontier_ExchangeServiceCorner_EventScript_ClefairyDoll:: BattleFrontier_ExchangeServiceCorner_EventScript_DittoDoll:: msgbox BattleFrontier_ExchangeServiceCorner_Text_ConfirmDittoDoll, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq BattleFrontier_ExchangeServiceCorner_EventScript_ChooseDecor1 + goto_if_eq VAR_RESULT, NO, BattleFrontier_ExchangeServiceCorner_EventScript_ChooseDecor1 setvar VAR_0x8008, 48 setvar VAR_0x8009, DECOR_DITTO_DOLL goto BattleFrontier_ExchangeServiceCorner_EventScript_TryPurchasePrize @@ -170,8 +153,7 @@ BattleFrontier_ExchangeServiceCorner_EventScript_DittoDoll:: BattleFrontier_ExchangeServiceCorner_EventScript_CyndaquilDoll:: msgbox BattleFrontier_ExchangeServiceCorner_Text_ConfirmCyndaquilDoll, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq BattleFrontier_ExchangeServiceCorner_EventScript_ChooseDecor1 + goto_if_eq VAR_RESULT, NO, BattleFrontier_ExchangeServiceCorner_EventScript_ChooseDecor1 setvar VAR_0x8008, 80 setvar VAR_0x8009, DECOR_CYNDAQUIL_DOLL goto BattleFrontier_ExchangeServiceCorner_EventScript_TryPurchasePrize @@ -179,8 +161,7 @@ BattleFrontier_ExchangeServiceCorner_EventScript_CyndaquilDoll:: BattleFrontier_ExchangeServiceCorner_EventScript_ChikoritaDoll:: msgbox BattleFrontier_ExchangeServiceCorner_Text_ConfirmChikoritaDoll, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq BattleFrontier_ExchangeServiceCorner_EventScript_ChooseDecor1 + goto_if_eq VAR_RESULT, NO, BattleFrontier_ExchangeServiceCorner_EventScript_ChooseDecor1 setvar VAR_0x8008, 80 setvar VAR_0x8009, DECOR_CHIKORITA_DOLL goto BattleFrontier_ExchangeServiceCorner_EventScript_TryPurchasePrize @@ -188,8 +169,7 @@ BattleFrontier_ExchangeServiceCorner_EventScript_ChikoritaDoll:: BattleFrontier_ExchangeServiceCorner_EventScript_TotodileDoll:: msgbox BattleFrontier_ExchangeServiceCorner_Text_ConfirmTotodileDoll, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq BattleFrontier_ExchangeServiceCorner_EventScript_ChooseDecor1 + goto_if_eq VAR_RESULT, NO, BattleFrontier_ExchangeServiceCorner_EventScript_ChooseDecor1 setvar VAR_0x8008, 80 setvar VAR_0x8009, DECOR_TOTODILE_DOLL goto BattleFrontier_ExchangeServiceCorner_EventScript_TryPurchasePrize @@ -221,8 +201,7 @@ BattleFrontier_ExchangeServiceCorner_EventScript_ChooseDecor2:: BattleFrontier_ExchangeServiceCorner_EventScript_LaprasDoll:: msgbox BattleFrontier_ExchangeServiceCorner_Text_ConfirmLaprasDoll, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq BattleFrontier_ExchangeServiceCorner_EventScript_ChooseDecor2 + goto_if_eq VAR_RESULT, NO, BattleFrontier_ExchangeServiceCorner_EventScript_ChooseDecor2 setvar VAR_0x8008, 128 setvar VAR_0x8009, DECOR_LAPRAS_DOLL goto BattleFrontier_ExchangeServiceCorner_EventScript_TryPurchasePrize @@ -230,8 +209,7 @@ BattleFrontier_ExchangeServiceCorner_EventScript_LaprasDoll:: BattleFrontier_ExchangeServiceCorner_EventScript_SnorlaxDoll:: msgbox BattleFrontier_ExchangeServiceCorner_Text_ConfirmSnorlaxDoll, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq BattleFrontier_ExchangeServiceCorner_EventScript_ChooseDecor2 + goto_if_eq VAR_RESULT, NO, BattleFrontier_ExchangeServiceCorner_EventScript_ChooseDecor2 setvar VAR_0x8008, 128 setvar VAR_0x8009, DECOR_SNORLAX_DOLL goto BattleFrontier_ExchangeServiceCorner_EventScript_TryPurchasePrize @@ -239,8 +217,7 @@ BattleFrontier_ExchangeServiceCorner_EventScript_SnorlaxDoll:: BattleFrontier_ExchangeServiceCorner_EventScript_VenusaurDoll:: msgbox BattleFrontier_ExchangeServiceCorner_Text_ConfirmVenusaurDoll, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq BattleFrontier_ExchangeServiceCorner_EventScript_ChooseDecor2 + goto_if_eq VAR_RESULT, NO, BattleFrontier_ExchangeServiceCorner_EventScript_ChooseDecor2 setvar VAR_0x8008, 256 setvar VAR_0x8009, DECOR_VENUSAUR_DOLL goto BattleFrontier_ExchangeServiceCorner_EventScript_TryPurchasePrize @@ -248,8 +225,7 @@ BattleFrontier_ExchangeServiceCorner_EventScript_VenusaurDoll:: BattleFrontier_ExchangeServiceCorner_EventScript_CharizardDoll:: msgbox BattleFrontier_ExchangeServiceCorner_Text_ConfirmCharizardDoll, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq BattleFrontier_ExchangeServiceCorner_EventScript_ChooseDecor2 + goto_if_eq VAR_RESULT, NO, BattleFrontier_ExchangeServiceCorner_EventScript_ChooseDecor2 setvar VAR_0x8008, 256 setvar VAR_0x8009, DECOR_CHARIZARD_DOLL goto BattleFrontier_ExchangeServiceCorner_EventScript_TryPurchasePrize @@ -257,8 +233,7 @@ BattleFrontier_ExchangeServiceCorner_EventScript_CharizardDoll:: BattleFrontier_ExchangeServiceCorner_EventScript_BlastoiseDoll:: msgbox BattleFrontier_ExchangeServiceCorner_Text_ConfirmBlastoiseDoll, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq BattleFrontier_ExchangeServiceCorner_EventScript_ChooseDecor2 + goto_if_eq VAR_RESULT, NO, BattleFrontier_ExchangeServiceCorner_EventScript_ChooseDecor2 setvar VAR_0x8008, 256 setvar VAR_0x8009, DECOR_BLASTOISE_DOLL goto BattleFrontier_ExchangeServiceCorner_EventScript_TryPurchasePrize @@ -291,8 +266,7 @@ BattleFrontier_ExchangeServiceCorner_EventScript_ChooseVitamin:: BattleFrontier_ExchangeServiceCorner_EventScript_Protein:: msgbox BattleFrontier_ExchangeServiceCorner_Text_ConfirmProtein, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq BattleFrontier_ExchangeServiceCorner_EventScript_ChooseVitamin + goto_if_eq VAR_RESULT, NO, BattleFrontier_ExchangeServiceCorner_EventScript_ChooseVitamin setvar VAR_0x8008, 1 setvar VAR_0x8009, ITEM_PROTEIN goto BattleFrontier_ExchangeServiceCorner_EventScript_TryPurchasePrize @@ -300,8 +274,7 @@ BattleFrontier_ExchangeServiceCorner_EventScript_Protein:: BattleFrontier_ExchangeServiceCorner_EventScript_Calcium:: msgbox BattleFrontier_ExchangeServiceCorner_Text_ConfirmCalcium, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq BattleFrontier_ExchangeServiceCorner_EventScript_ChooseVitamin + goto_if_eq VAR_RESULT, NO, BattleFrontier_ExchangeServiceCorner_EventScript_ChooseVitamin setvar VAR_0x8008, 1 setvar VAR_0x8009, ITEM_CALCIUM goto BattleFrontier_ExchangeServiceCorner_EventScript_TryPurchasePrize @@ -309,8 +282,7 @@ BattleFrontier_ExchangeServiceCorner_EventScript_Calcium:: BattleFrontier_ExchangeServiceCorner_EventScript_Iron:: msgbox BattleFrontier_ExchangeServiceCorner_Text_ConfirmIron, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq BattleFrontier_ExchangeServiceCorner_EventScript_ChooseVitamin + goto_if_eq VAR_RESULT, NO, BattleFrontier_ExchangeServiceCorner_EventScript_ChooseVitamin setvar VAR_0x8008, 1 setvar VAR_0x8009, ITEM_IRON goto BattleFrontier_ExchangeServiceCorner_EventScript_TryPurchasePrize @@ -318,8 +290,7 @@ BattleFrontier_ExchangeServiceCorner_EventScript_Iron:: BattleFrontier_ExchangeServiceCorner_EventScript_Zinc:: msgbox BattleFrontier_ExchangeServiceCorner_Text_ConfirmZinc, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq BattleFrontier_ExchangeServiceCorner_EventScript_ChooseVitamin + goto_if_eq VAR_RESULT, NO, BattleFrontier_ExchangeServiceCorner_EventScript_ChooseVitamin setvar VAR_0x8008, 1 setvar VAR_0x8009, ITEM_ZINC goto BattleFrontier_ExchangeServiceCorner_EventScript_TryPurchasePrize @@ -327,8 +298,7 @@ BattleFrontier_ExchangeServiceCorner_EventScript_Zinc:: BattleFrontier_ExchangeServiceCorner_EventScript_Carbos:: msgbox BattleFrontier_ExchangeServiceCorner_Text_ConfirmCarbos, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq BattleFrontier_ExchangeServiceCorner_EventScript_ChooseVitamin + goto_if_eq VAR_RESULT, NO, BattleFrontier_ExchangeServiceCorner_EventScript_ChooseVitamin setvar VAR_0x8008, 1 setvar VAR_0x8009, ITEM_CARBOS goto BattleFrontier_ExchangeServiceCorner_EventScript_TryPurchasePrize @@ -336,8 +306,7 @@ BattleFrontier_ExchangeServiceCorner_EventScript_Carbos:: BattleFrontier_ExchangeServiceCorner_EventScript_HPUp:: msgbox BattleFrontier_ExchangeServiceCorner_Text_ConfirmHPUp, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq BattleFrontier_ExchangeServiceCorner_EventScript_ChooseVitamin + goto_if_eq VAR_RESULT, NO, BattleFrontier_ExchangeServiceCorner_EventScript_ChooseVitamin setvar VAR_0x8008, 1 setvar VAR_0x8009, ITEM_HP_UP goto BattleFrontier_ExchangeServiceCorner_EventScript_TryPurchasePrize @@ -373,8 +342,7 @@ BattleFrontier_ExchangeServiceCorner_EventScript_ChooseHoldItem:: BattleFrontier_ExchangeServiceCorner_EventScript_Leftovers:: msgbox BattleFrontier_ExchangeServiceCorner_Text_ConfirmLeftovers, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq BattleFrontier_ExchangeServiceCorner_EventScript_ChooseHoldItem + goto_if_eq VAR_RESULT, NO, BattleFrontier_ExchangeServiceCorner_EventScript_ChooseHoldItem setvar VAR_0x8008, 48 setvar VAR_0x8009, ITEM_LEFTOVERS goto BattleFrontier_ExchangeServiceCorner_EventScript_TryPurchasePrize @@ -382,8 +350,7 @@ BattleFrontier_ExchangeServiceCorner_EventScript_Leftovers:: BattleFrontier_ExchangeServiceCorner_EventScript_WhiteHerb:: msgbox BattleFrontier_ExchangeServiceCorner_Text_ConfirmWhiteHerb, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq BattleFrontier_ExchangeServiceCorner_EventScript_ChooseHoldItem + goto_if_eq VAR_RESULT, NO, BattleFrontier_ExchangeServiceCorner_EventScript_ChooseHoldItem setvar VAR_0x8008, 48 setvar VAR_0x8009, ITEM_WHITE_HERB goto BattleFrontier_ExchangeServiceCorner_EventScript_TryPurchasePrize @@ -391,8 +358,7 @@ BattleFrontier_ExchangeServiceCorner_EventScript_WhiteHerb:: BattleFrontier_ExchangeServiceCorner_EventScript_QuickClaw:: msgbox BattleFrontier_ExchangeServiceCorner_Text_ConfirmQuickClaw, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq BattleFrontier_ExchangeServiceCorner_EventScript_ChooseHoldItem + goto_if_eq VAR_RESULT, NO, BattleFrontier_ExchangeServiceCorner_EventScript_ChooseHoldItem setvar VAR_0x8008, 48 setvar VAR_0x8009, ITEM_QUICK_CLAW goto BattleFrontier_ExchangeServiceCorner_EventScript_TryPurchasePrize @@ -400,8 +366,7 @@ BattleFrontier_ExchangeServiceCorner_EventScript_QuickClaw:: BattleFrontier_ExchangeServiceCorner_EventScript_MentalHerb:: msgbox BattleFrontier_ExchangeServiceCorner_Text_ConfirmMentalHerb, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq BattleFrontier_ExchangeServiceCorner_EventScript_ChooseHoldItem + goto_if_eq VAR_RESULT, NO, BattleFrontier_ExchangeServiceCorner_EventScript_ChooseHoldItem setvar VAR_0x8008, 48 setvar VAR_0x8009, ITEM_MENTAL_HERB goto BattleFrontier_ExchangeServiceCorner_EventScript_TryPurchasePrize @@ -409,8 +374,7 @@ BattleFrontier_ExchangeServiceCorner_EventScript_MentalHerb:: BattleFrontier_ExchangeServiceCorner_EventScript_Brightpowder:: msgbox BattleFrontier_ExchangeServiceCorner_Text_ConfirmBrightpowder, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq BattleFrontier_ExchangeServiceCorner_EventScript_ChooseHoldItem + goto_if_eq VAR_RESULT, NO, BattleFrontier_ExchangeServiceCorner_EventScript_ChooseHoldItem setvar VAR_0x8008, 64 setvar VAR_0x8009, ITEM_BRIGHT_POWDER goto BattleFrontier_ExchangeServiceCorner_EventScript_TryPurchasePrize @@ -418,8 +382,7 @@ BattleFrontier_ExchangeServiceCorner_EventScript_Brightpowder:: BattleFrontier_ExchangeServiceCorner_EventScript_ChoiceBand:: msgbox BattleFrontier_ExchangeServiceCorner_Text_ConfirmChoiceBand, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq BattleFrontier_ExchangeServiceCorner_EventScript_ChooseHoldItem + goto_if_eq VAR_RESULT, NO, BattleFrontier_ExchangeServiceCorner_EventScript_ChooseHoldItem setvar VAR_0x8008, 64 setvar VAR_0x8009, ITEM_CHOICE_BAND goto BattleFrontier_ExchangeServiceCorner_EventScript_TryPurchasePrize @@ -427,8 +390,7 @@ BattleFrontier_ExchangeServiceCorner_EventScript_ChoiceBand:: BattleFrontier_ExchangeServiceCorner_EventScript_KingsRock:: msgbox BattleFrontier_ExchangeServiceCorner_Text_ConfirmKingsRock, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq BattleFrontier_ExchangeServiceCorner_EventScript_ChooseHoldItem + goto_if_eq VAR_RESULT, NO, BattleFrontier_ExchangeServiceCorner_EventScript_ChooseHoldItem setvar VAR_0x8008, 64 setvar VAR_0x8009, ITEM_KINGS_ROCK goto BattleFrontier_ExchangeServiceCorner_EventScript_TryPurchasePrize @@ -436,8 +398,7 @@ BattleFrontier_ExchangeServiceCorner_EventScript_KingsRock:: BattleFrontier_ExchangeServiceCorner_EventScript_FocusBand:: msgbox BattleFrontier_ExchangeServiceCorner_Text_ConfirmFocusBand, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq BattleFrontier_ExchangeServiceCorner_EventScript_ChooseHoldItem + goto_if_eq VAR_RESULT, NO, BattleFrontier_ExchangeServiceCorner_EventScript_ChooseHoldItem setvar VAR_0x8008, 64 setvar VAR_0x8009, ITEM_FOCUS_BAND goto BattleFrontier_ExchangeServiceCorner_EventScript_TryPurchasePrize @@ -445,8 +406,7 @@ BattleFrontier_ExchangeServiceCorner_EventScript_FocusBand:: BattleFrontier_ExchangeServiceCorner_EventScript_ScopeLens:: msgbox BattleFrontier_ExchangeServiceCorner_Text_ConfirmScopeLens, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq BattleFrontier_ExchangeServiceCorner_EventScript_ChooseHoldItem + goto_if_eq VAR_RESULT, NO, BattleFrontier_ExchangeServiceCorner_EventScript_ChooseHoldItem setvar VAR_0x8008, 64 setvar VAR_0x8009, ITEM_SCOPE_LENS goto BattleFrontier_ExchangeServiceCorner_EventScript_TryPurchasePrize diff --git a/data/maps/BattleFrontier_Lounge1/scripts.inc b/data/maps/BattleFrontier_Lounge1/scripts.inc index 0455d577ce10..6aca2b4ced78 100644 --- a/data/maps/BattleFrontier_Lounge1/scripts.inc +++ b/data/maps/BattleFrontier_Lounge1/scripts.inc @@ -14,10 +14,8 @@ BattleFrontier_Lounge1_EventScript_Breeder:: BattleFrontier_Lounge1_EventScript_ChooseMonToShowBreeder:: special ChoosePartyMon waitstate - compare VAR_0x8004, 255 - goto_if_ne BattleFrontier_Lounge1_EventScript_ShowMonToBreeder - compare VAR_0x8004, 255 - goto_if_eq BattleFrontier_Lounge1_EventScript_CancelMonSelect + goto_if_ne VAR_0x8004, PARTY_NOTHING_CHOSEN, BattleFrontier_Lounge1_EventScript_ShowMonToBreeder + goto_if_eq VAR_0x8004, PARTY_NOTHING_CHOSEN, BattleFrontier_Lounge1_EventScript_CancelMonSelect end BattleFrontier_Lounge1_EventScript_BreederIntro:: @@ -34,17 +32,12 @@ BattleFrontier_Lounge1_EventScript_AlreadyMetBreeder:: @ VAR_0x8007: IV of the highest IV stat BattleFrontier_Lounge1_EventScript_ShowMonToBreeder:: specialvar VAR_RESULT, ScriptGetPartyMonSpecies - compare VAR_RESULT, SPECIES_EGG - goto_if_eq BattleFrontier_Lounge1_EventScript_ShowEggToBreeder + goto_if_eq VAR_RESULT, SPECIES_EGG, BattleFrontier_Lounge1_EventScript_ShowEggToBreeder special BufferVarsForIVRater - compare VAR_0x8005, 90 @ Average of 15 - goto_if_le BattleFrontier_Lounge1_EventScript_AverageTotalIVs - compare VAR_0x8005, 120 @ Average of 20 - goto_if_le BattleFrontier_Lounge1_EventScript_AboveAverageTotalIVs - compare VAR_0x8005, 150 @ Average of 25 - goto_if_le BattleFrontier_Lounge1_EventScript_HighTotalIVs - compare VAR_0x8005, 151 @ Average of > 25 - goto_if_ge BattleFrontier_Lounge1_EventScript_VeryHighTotalIVs + goto_if_le VAR_0x8005, 90, BattleFrontier_Lounge1_EventScript_AverageTotalIVs @ Average of 15 + goto_if_le VAR_0x8005, 120, BattleFrontier_Lounge1_EventScript_AboveAverageTotalIVs @ Average of 20 + goto_if_le VAR_0x8005, 150, BattleFrontier_Lounge1_EventScript_HighTotalIVs @ Average of 25 + goto_if_ge VAR_0x8005, 151, BattleFrontier_Lounge1_EventScript_VeryHighTotalIVs @ Average of > 25 end BattleFrontier_Lounge1_EventScript_ShowEggToBreeder:: @@ -54,30 +47,20 @@ BattleFrontier_Lounge1_EventScript_ShowEggToBreeder:: @ Comment on the highest IV stat BattleFrontier_Lounge1_EventScript_HighestIVStat:: - compare VAR_0x8006, STAT_HP - goto_if_eq BattleFrontier_Lounge1_EventScript_HighestIVHP - compare VAR_0x8006, STAT_ATK - goto_if_eq BattleFrontier_Lounge1_EventScript_HighestIVAtk - compare VAR_0x8006, STAT_DEF - goto_if_eq BattleFrontier_Lounge1_EventScript_HighestIVDef - compare VAR_0x8006, STAT_SPEED - goto_if_eq BattleFrontier_Lounge1_EventScript_HighestIVSpeed - compare VAR_0x8006, STAT_SPATK - goto_if_eq BattleFrontier_Lounge1_EventScript_HighestIVSpAtk - compare VAR_0x8006, STAT_SPDEF - goto_if_eq BattleFrontier_Lounge1_EventScript_HighestIVSpDef + goto_if_eq VAR_0x8006, STAT_HP, BattleFrontier_Lounge1_EventScript_HighestIVHP + goto_if_eq VAR_0x8006, STAT_ATK, BattleFrontier_Lounge1_EventScript_HighestIVAtk + goto_if_eq VAR_0x8006, STAT_DEF, BattleFrontier_Lounge1_EventScript_HighestIVDef + goto_if_eq VAR_0x8006, STAT_SPEED, BattleFrontier_Lounge1_EventScript_HighestIVSpeed + goto_if_eq VAR_0x8006, STAT_SPATK, BattleFrontier_Lounge1_EventScript_HighestIVSpAtk + goto_if_eq VAR_0x8006, STAT_SPDEF, BattleFrontier_Lounge1_EventScript_HighestIVSpDef end @ Comment on the highest IV value BattleFrontier_Lounge1_EventScript_HighestIVValue:: - compare VAR_0x8007, 15 - goto_if_le BattleFrontier_Lounge1_EventScript_HighestIVLow - compare VAR_0x8007, 25 - goto_if_le BattleFrontier_Lounge1_EventScript_HighestIVMid - compare VAR_0x8007, 30 - goto_if_le BattleFrontier_Lounge1_EventScript_HighestIVHigh - compare VAR_0x8007, 31 - goto_if_ge BattleFrontier_Lounge1_EventScript_HighestIVMax + goto_if_le VAR_0x8007, 15, BattleFrontier_Lounge1_EventScript_HighestIVLow + goto_if_le VAR_0x8007, 25, BattleFrontier_Lounge1_EventScript_HighestIVMid + goto_if_le VAR_0x8007, 30, BattleFrontier_Lounge1_EventScript_HighestIVHigh + goto_if_ge VAR_0x8007, 31, BattleFrontier_Lounge1_EventScript_HighestIVMax end BattleFrontier_Lounge1_EventScript_EndBreederComments:: diff --git a/data/maps/BattleFrontier_Lounge2/scripts.inc b/data/maps/BattleFrontier_Lounge2/scripts.inc index d98a9f64e128..8efc17293663 100644 --- a/data/maps/BattleFrontier_Lounge2/scripts.inc +++ b/data/maps/BattleFrontier_Lounge2/scripts.inc @@ -22,30 +22,18 @@ BattleFrontier_Lounge2_EventScript_AlreadyMetManiac:: end BattleFrontier_Lounge2_EventScript_GiveAdvice:: - compare VAR_FRONTIER_MANIAC_FACILITY, 0 - call_if_eq BattleFrontier_Lounge2_EventScript_BufferSingle - compare VAR_FRONTIER_MANIAC_FACILITY, 1 - call_if_eq BattleFrontier_Lounge2_EventScript_BufferDouble - compare VAR_FRONTIER_MANIAC_FACILITY, 2 - call_if_eq BattleFrontier_Lounge2_EventScript_BufferMulti - compare VAR_FRONTIER_MANIAC_FACILITY, 3 - call_if_eq BattleFrontier_Lounge2_EventScript_BufferMultiLink - compare VAR_FRONTIER_MANIAC_FACILITY, 4 - call_if_eq BattleFrontier_Lounge2_EventScript_BufferBattleDome - compare VAR_FRONTIER_MANIAC_FACILITY, 5 - call_if_eq BattleFrontier_Lounge2_EventScript_BufferBattleFactory - compare VAR_FRONTIER_MANIAC_FACILITY, 6 - call_if_eq BattleFrontier_Lounge2_EventScript_BufferBattlePalace - compare VAR_FRONTIER_MANIAC_FACILITY, 7 - call_if_eq BattleFrontier_Lounge2_EventScript_BufferBattleArena - compare VAR_FRONTIER_MANIAC_FACILITY, 8 - call_if_eq BattleFrontier_Lounge2_EventScript_BufferBattlePike - compare VAR_FRONTIER_MANIAC_FACILITY, 9 - call_if_eq BattleFrontier_Lounge2_EventScript_BufferBattlePyramid - compare VAR_FRONTIER_MANIAC_FACILITY, 3 - call_if_le BattleFrontier_Lounge2_EventScript_BattleTowerNews - compare VAR_FRONTIER_MANIAC_FACILITY, 4 - call_if_ge BattleFrontier_Lounge2_EventScript_FacilityNews + call_if_eq VAR_FRONTIER_MANIAC_FACILITY, 0, BattleFrontier_Lounge2_EventScript_BufferSingle + call_if_eq VAR_FRONTIER_MANIAC_FACILITY, 1, BattleFrontier_Lounge2_EventScript_BufferDouble + call_if_eq VAR_FRONTIER_MANIAC_FACILITY, 2, BattleFrontier_Lounge2_EventScript_BufferMulti + call_if_eq VAR_FRONTIER_MANIAC_FACILITY, 3, BattleFrontier_Lounge2_EventScript_BufferMultiLink + call_if_eq VAR_FRONTIER_MANIAC_FACILITY, 4, BattleFrontier_Lounge2_EventScript_BufferBattleDome + call_if_eq VAR_FRONTIER_MANIAC_FACILITY, 5, BattleFrontier_Lounge2_EventScript_BufferBattleFactory + call_if_eq VAR_FRONTIER_MANIAC_FACILITY, 6, BattleFrontier_Lounge2_EventScript_BufferBattlePalace + call_if_eq VAR_FRONTIER_MANIAC_FACILITY, 7, BattleFrontier_Lounge2_EventScript_BufferBattleArena + call_if_eq VAR_FRONTIER_MANIAC_FACILITY, 8, BattleFrontier_Lounge2_EventScript_BufferBattlePike + call_if_eq VAR_FRONTIER_MANIAC_FACILITY, 9, BattleFrontier_Lounge2_EventScript_BufferBattlePyramid + call_if_le VAR_FRONTIER_MANIAC_FACILITY, 3, BattleFrontier_Lounge2_EventScript_BattleTowerNews + call_if_ge VAR_FRONTIER_MANIAC_FACILITY, 4, BattleFrontier_Lounge2_EventScript_FacilityNews special ShowFrontierManiacMessage waitmessage waitbuttonpress @@ -61,43 +49,43 @@ BattleFrontier_Lounge2_EventScript_FacilityNews:: return BattleFrontier_Lounge2_EventScript_BufferSingle:: - bufferstdstring 0, STDSTRING_SINGLE + bufferstdstring STR_VAR_1, STDSTRING_SINGLE return BattleFrontier_Lounge2_EventScript_BufferDouble:: - bufferstdstring 0, STDSTRING_DOUBLE + bufferstdstring STR_VAR_1, STDSTRING_DOUBLE return BattleFrontier_Lounge2_EventScript_BufferMulti:: - bufferstdstring 0, STDSTRING_MULTI + bufferstdstring STR_VAR_1, STDSTRING_MULTI return BattleFrontier_Lounge2_EventScript_BufferMultiLink:: - bufferstdstring 0, STDSTRING_MULTI_LINK + bufferstdstring STR_VAR_1, STDSTRING_MULTI_LINK return BattleFrontier_Lounge2_EventScript_BufferBattleDome:: - bufferstdstring 0, STDSTRING_BATTLE_DOME + bufferstdstring STR_VAR_1, STDSTRING_BATTLE_DOME return BattleFrontier_Lounge2_EventScript_BufferBattleFactory:: - bufferstdstring 0, STDSTRING_BATTLE_FACTORY + bufferstdstring STR_VAR_1, STDSTRING_BATTLE_FACTORY return BattleFrontier_Lounge2_EventScript_BufferBattlePalace:: - bufferstdstring 0, STDSTRING_BATTLE_PALACE + bufferstdstring STR_VAR_1, STDSTRING_BATTLE_PALACE return BattleFrontier_Lounge2_EventScript_BufferBattleArena:: - bufferstdstring 0, STDSTRING_BATTLE_ARENA + bufferstdstring STR_VAR_1, STDSTRING_BATTLE_ARENA return BattleFrontier_Lounge2_EventScript_BufferBattlePike:: - bufferstdstring 0, STDSTRING_BATTLE_PIKE + bufferstdstring STR_VAR_1, STDSTRING_BATTLE_PIKE return BattleFrontier_Lounge2_EventScript_BufferBattlePyramid:: - bufferstdstring 0, STDSTRING_BATTLE_PYRAMID + bufferstdstring STR_VAR_1, STDSTRING_BATTLE_PYRAMID return BattleFrontier_Lounge2_EventScript_Maniac1:: diff --git a/data/maps/BattleFrontier_Lounge3/scripts.inc b/data/maps/BattleFrontier_Lounge3/scripts.inc index c0a941738581..7d9befafb1cc 100644 --- a/data/maps/BattleFrontier_Lounge3/scripts.inc +++ b/data/maps/BattleFrontier_Lounge3/scripts.inc @@ -10,8 +10,7 @@ BattleFrontier_Lounge3_EventScript_Gambler:: faceplayer goto_if_set FLAG_MET_BATTLE_FRONTIER_GAMBLER, BattleFrontier_Lounge3_EventScript_AlreadyMetGambler call BattleFrontier_Lounge3_EventScript_CountSilverSymbols - compare VAR_0x8004, 2 - goto_if_le BattleFrontier_Lounge3_EventScript_NotEnoughSilverSymbols + goto_if_le VAR_0x8004, 2, BattleFrontier_Lounge3_EventScript_NotEnoughSilverSymbols setflag FLAG_MET_BATTLE_FRONTIER_GAMBLER msgbox BattleFrontier_Lounge3_Text_YouLookToughExplainGambling, MSGBOX_DEFAULT goto BattleFrontier_Lounge3_EventScript_AskToEnterChallenge @@ -22,11 +21,9 @@ BattleFrontier_Lounge3_EventScript_AskToEnterChallenge:: waitmessage waitbuttonpress msgbox BattleFrontier_Lounge3_Text_HowAboutEnteringEventForMe, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq BattleFrontier_Lounge3_EventScript_DeclineChallenge + goto_if_eq VAR_RESULT, NO, BattleFrontier_Lounge3_EventScript_DeclineChallenge msgbox BattleFrontier_Lounge3_Text_SpotMeSomeBattlePoints, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq BattleFrontier_Lounge3_EventScript_DeclineChallenge + goto_if_eq VAR_RESULT, NO, BattleFrontier_Lounge3_EventScript_DeclineChallenge message BattleFrontier_Lounge3_Text_HowMuchCanYouSpot waitmessage special ShowBattlePointsWindow @@ -61,8 +58,7 @@ BattleFrontier_Lounge3_EventScript_Bet15:: BattleFrontier_Lounge3_EventScript_TryPlaceBet:: specialvar VAR_TEMP_1, GetFrontierBattlePoints - compare VAR_TEMP_1, VAR_0x8008 - goto_if_ge BattleFrontier_Lounge3_EventScript_PlaceBet + goto_if_ge VAR_TEMP_1, VAR_0x8008, BattleFrontier_Lounge3_EventScript_PlaceBet msgbox BattleFrontier_Lounge3_Text_YouDontHaveEnoughPoints, MSGBOX_DEFAULT message BattleFrontier_Lounge3_Text_HowMuchCanYouSpot waitmessage @@ -109,27 +105,21 @@ BattleFrontier_Lounge3_EventScript_NotEnoughSilverSymbols:: BattleFrontier_Lounge3_EventScript_AlreadyMetGambler:: msgbox BattleFrontier_Lounge3_Text_Oh, MSGBOX_DEFAULT - compare VAR_FRONTIER_GAMBLER_STATE, FRONTIER_GAMBLER_PLACED_BET - goto_if_ge BattleFrontier_Lounge3_EventScript_CheckBetResults + goto_if_ge VAR_FRONTIER_GAMBLER_STATE, FRONTIER_GAMBLER_PLACED_BET, BattleFrontier_Lounge3_EventScript_CheckBetResults goto BattleFrontier_Lounge3_EventScript_AskToEnterChallenge end BattleFrontier_Lounge3_EventScript_CheckBetResults:: - compare VAR_FRONTIER_GAMBLER_STATE, FRONTIER_GAMBLER_PLACED_BET - goto_if_eq BattleFrontier_Lounge3_EventScript_ChallengeNotAttempted - compare VAR_FRONTIER_GAMBLER_STATE, FRONTIER_GAMBLER_WON - goto_if_eq BattleFrontier_Lounge3_EventScript_WonChallenge + goto_if_eq VAR_FRONTIER_GAMBLER_STATE, FRONTIER_GAMBLER_PLACED_BET, BattleFrontier_Lounge3_EventScript_ChallengeNotAttempted + goto_if_eq VAR_FRONTIER_GAMBLER_STATE, FRONTIER_GAMBLER_WON, BattleFrontier_Lounge3_EventScript_WonChallenge goto BattleFrontier_Lounge3_EventScript_LostChallenge end BattleFrontier_Lounge3_EventScript_WonChallenge:: msgbox BattleFrontier_Lounge3_Text_HelloChampHeresYourPoints, MSGBOX_DEFAULT - compare VAR_FRONTIER_GAMBLER_AMOUNT_BET, FRONTIER_GAMBLER_BET_5 - call_if_eq BattleFrontier_Lounge3_EventScript_RewardBet5 - compare VAR_FRONTIER_GAMBLER_AMOUNT_BET, FRONTIER_GAMBLER_BET_10 - call_if_eq BattleFrontier_Lounge3_EventScript_RewardBet10 - compare VAR_FRONTIER_GAMBLER_AMOUNT_BET, FRONTIER_GAMBLER_BET_15 - call_if_eq BattleFrontier_Lounge3_EventScript_RewardBet15 + call_if_eq VAR_FRONTIER_GAMBLER_AMOUNT_BET, FRONTIER_GAMBLER_BET_5, BattleFrontier_Lounge3_EventScript_RewardBet5 + call_if_eq VAR_FRONTIER_GAMBLER_AMOUNT_BET, FRONTIER_GAMBLER_BET_10, BattleFrontier_Lounge3_EventScript_RewardBet10 + call_if_eq VAR_FRONTIER_GAMBLER_AMOUNT_BET, FRONTIER_GAMBLER_BET_15, BattleFrontier_Lounge3_EventScript_RewardBet15 msgbox BattleFrontier_Lounge3_Text_ObtainedBattlePoints, MSGBOX_GETPOINTS special GiveFrontierBattlePoints msgbox BattleFrontier_Lounge3_Text_ThinkOfMeForAnotherChallenge, MSGBOX_DEFAULT @@ -144,17 +134,17 @@ BattleFrontier_Lounge3_EventScript_LostChallenge:: end BattleFrontier_Lounge3_EventScript_RewardBet5:: - buffernumberstring 0, (BET_AMOUNT_5 * 2) + buffernumberstring STR_VAR_1, (BET_AMOUNT_5 * 2) setvar VAR_0x8004, (BET_AMOUNT_5 * 2) return BattleFrontier_Lounge3_EventScript_RewardBet10:: - buffernumberstring 0, (BET_AMOUNT_10 * 2) + buffernumberstring STR_VAR_1, (BET_AMOUNT_10 * 2) setvar VAR_0x8004, (BET_AMOUNT_10 * 2) return BattleFrontier_Lounge3_EventScript_RewardBet15:: - buffernumberstring 0, (BET_AMOUNT_15 * 2) + buffernumberstring STR_VAR_1, (BET_AMOUNT_15 * 2) setvar VAR_0x8004, (BET_AMOUNT_15 * 2) return diff --git a/data/maps/BattleFrontier_Lounge5/scripts.inc b/data/maps/BattleFrontier_Lounge5/scripts.inc index 61ac0cb9e247..b81c748e5db2 100644 --- a/data/maps/BattleFrontier_Lounge5/scripts.inc +++ b/data/maps/BattleFrontier_Lounge5/scripts.inc @@ -5,17 +5,14 @@ BattleFrontier_Lounge5_EventScript_NatureGirl:: lock faceplayer msgbox BattleFrontier_Lounge5_Text_NatureGirlGreeting, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq BattleFrontier_Lounge5_EventScript_NatureGirlNoneShown + goto_if_eq VAR_RESULT, NO, BattleFrontier_Lounge5_EventScript_NatureGirlNoneShown special ChoosePartyMon waitstate lock faceplayer - compare VAR_0x8004, 255 - goto_if_eq BattleFrontier_Lounge5_EventScript_NatureGirlNoneShown + goto_if_eq VAR_0x8004, PARTY_NOTHING_CHOSEN, BattleFrontier_Lounge5_EventScript_NatureGirlNoneShown specialvar VAR_RESULT, ScriptGetPartyMonSpecies - compare VAR_RESULT, SPECIES_EGG - goto_if_eq BattleFrontier_Lounge5_EventScript_NatureGirlEgg + goto_if_eq VAR_RESULT, SPECIES_EGG, BattleFrontier_Lounge5_EventScript_NatureGirlEgg special ShowNatureGirlMessage waitmessage waitbuttonpress diff --git a/data/maps/BattleFrontier_Lounge6/scripts.inc b/data/maps/BattleFrontier_Lounge6/scripts.inc index f88c69324d39..0b01b32e3e22 100644 --- a/data/maps/BattleFrontier_Lounge6/scripts.inc +++ b/data/maps/BattleFrontier_Lounge6/scripts.inc @@ -10,18 +10,15 @@ BattleFrontier_Lounge6_EventScript_Trader:: specialvar VAR_RESULT, GetInGameTradeSpeciesInfo copyvar VAR_0x8009, VAR_RESULT msgbox BattleFrontier_Lounge6_Text_WouldYouLikeToTrade, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq BattleFrontier_Lounge6_EventScript_DeclineTrade + goto_if_eq VAR_RESULT, NO, BattleFrontier_Lounge6_EventScript_DeclineTrade special ChoosePartyMon waitstate copyvar VAR_0x800A, VAR_0x8004 - compare VAR_0x8004, 255 - goto_if_eq BattleFrontier_Lounge6_EventScript_DeclineTrade + goto_if_eq VAR_0x8004, PARTY_NOTHING_CHOSEN, BattleFrontier_Lounge6_EventScript_DeclineTrade copyvar VAR_0x8005, VAR_0x800A specialvar VAR_RESULT, GetTradeSpecies copyvar VAR_0x800B, VAR_RESULT - compare VAR_RESULT, VAR_0x8009 - goto_if_ne BattleFrontier_Lounge6_EventScript_NotRequestedMon + goto_if_ne VAR_RESULT, VAR_0x8009, BattleFrontier_Lounge6_EventScript_NotRequestedMon copyvar VAR_0x8004, VAR_0x8008 copyvar VAR_0x8005, VAR_0x800A special CreateInGameTradePokemon @@ -38,7 +35,7 @@ BattleFrontier_Lounge6_EventScript_DeclineTrade:: end BattleFrontier_Lounge6_EventScript_NotRequestedMon:: - bufferspeciesname 0, VAR_0x8009 + bufferspeciesname STR_VAR_1, VAR_0x8009 msgbox BattleFrontier_Lounge6_Text_DontTradeForAnythingButMon, MSGBOX_DEFAULT release end diff --git a/data/maps/BattleFrontier_Lounge7/scripts.inc b/data/maps/BattleFrontier_Lounge7/scripts.inc index 2878444706bb..c52df3cafbeb 100644 --- a/data/maps/BattleFrontier_Lounge7/scripts.inc +++ b/data/maps/BattleFrontier_Lounge7/scripts.inc @@ -249,14 +249,12 @@ BattleFrontier_Lounge7_EventScript_ConfirmMoveSelection:: copyvar VAR_0x8004, VAR_TEMP_D copyvar VAR_0x8005, VAR_TEMP_E special BufferBattleFrontierTutorMoveName - buffernumberstring 1, VAR_0x8008 + buffernumberstring STR_VAR_2, VAR_0x8008 copyvar VAR_0x8004, VAR_TEMP_C msgbox BattleFrontier_Lounge7_Text_MoveWillBeXBattlePoints, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq BattleFrontier_Lounge7_EventScript_ChooseNewMove + goto_if_eq VAR_RESULT, NO, BattleFrontier_Lounge7_EventScript_ChooseNewMove specialvar VAR_TEMP_1, GetFrontierBattlePoints - compare VAR_TEMP_1, VAR_0x8008 - goto_if_ge BattleFrontier_Lounge7_EventScript_TeachTutorMove + goto_if_ge VAR_TEMP_1, VAR_0x8008, BattleFrontier_Lounge7_EventScript_TeachTutorMove msgbox BattleFrontier_Lounge7_Text_HaventGotEnoughPoints, MSGBOX_DEFAULT goto BattleFrontier_Lounge7_EventScript_ChooseNewMove end @@ -269,8 +267,7 @@ BattleFrontier_Lounge7_EventScript_TeachTutorMove:: special CloseBattleFrontierTutorWindow special ChooseMonForMoveTutor waitstate - compare VAR_RESULT, FALSE - goto_if_eq BattleFrontier_Lounge7_EventScript_CancelChooseMon + goto_if_eq VAR_RESULT, FALSE, BattleFrontier_Lounge7_EventScript_CancelChooseMon msgbox BattleFrontier_Lounge7_Text_IllTakeBattlePoints, MSGBOX_DEFAULT copyvar VAR_0x8004, VAR_0x8008 special TakeFrontierBattlePoints @@ -278,8 +275,7 @@ BattleFrontier_Lounge7_EventScript_TeachTutorMove:: end BattleFrontier_Lounge7_EventScript_ChooseNewMove:: - compare VAR_TEMP_E, 0 - goto_if_eq BattleFrontier_Lounge7_EventScript_ChooseNewLeftTutorMove + goto_if_eq VAR_TEMP_E, 0, BattleFrontier_Lounge7_EventScript_ChooseNewLeftTutorMove goto BattleFrontier_Lounge7_EventScript_ChooseNewRightTutorMove end diff --git a/data/maps/BattleFrontier_OutsideEast/scripts.inc b/data/maps/BattleFrontier_OutsideEast/scripts.inc index 9157f0befea6..f34373480642 100644 --- a/data/maps/BattleFrontier_OutsideEast/scripts.inc +++ b/data/maps/BattleFrontier_OutsideEast/scripts.inc @@ -11,8 +11,7 @@ BattleFrontier_OutsideEast_OnResume: BattleFrontier_OutsideEast_EventScript_TryRemoveSudowoodo:: specialvar VAR_RESULT, GetBattleOutcome - compare VAR_RESULT, B_OUTCOME_CAUGHT - goto_if_ne Common_EventScript_NopReturn + goto_if_ne VAR_RESULT, B_OUTCOME_CAUGHT, Common_EventScript_NopReturn removeobject VAR_LAST_TALKED return @@ -135,12 +134,9 @@ BattleFrontier_OutsideEast_EventScript_WaterSudowoodo:: dowildbattle clearflag FLAG_SYS_CTRL_OBJ_DELETE specialvar VAR_RESULT, GetBattleOutcome - compare VAR_RESULT, B_OUTCOME_WON - goto_if_eq BattleFrontier_OutsideEast_EventScript_DefeatedSudowoodo - compare VAR_RESULT, B_OUTCOME_RAN - goto_if_eq BattleFrontier_OutsideEast_EventScript_DefeatedSudowoodo - compare VAR_RESULT, B_OUTCOME_PLAYER_TELEPORTED - goto_if_eq BattleFrontier_OutsideEast_EventScript_DefeatedSudowoodo + goto_if_eq VAR_RESULT, B_OUTCOME_WON, BattleFrontier_OutsideEast_EventScript_DefeatedSudowoodo + goto_if_eq VAR_RESULT, B_OUTCOME_RAN, BattleFrontier_OutsideEast_EventScript_DefeatedSudowoodo + goto_if_eq VAR_RESULT, B_OUTCOME_PLAYER_TELEPORTED, BattleFrontier_OutsideEast_EventScript_DefeatedSudowoodo setflag FLAG_DEFEATED_SUDOWOODO release end diff --git a/data/maps/BattleFrontier_OutsideWest/scripts.inc b/data/maps/BattleFrontier_OutsideWest/scripts.inc index d359ee89ad9f..5ca5cb9fbb5c 100644 --- a/data/maps/BattleFrontier_OutsideWest/scripts.inc +++ b/data/maps/BattleFrontier_OutsideWest/scripts.inc @@ -20,9 +20,8 @@ BattleFrontier_OutsideWest_EventScript_FerryAttendant:: lock faceplayer msgbox BattleFrontier_OutsideWest_Text_MayISeeYourTicket, MSGBOX_DEFAULT - checkitem ITEM_SS_TICKET, 1 - compare VAR_RESULT, FALSE - goto_if_eq BattleFrontier_OutsideWest_EventScript_NoSSTicket + checkitem ITEM_SS_TICKET + goto_if_eq VAR_RESULT, FALSE, BattleFrontier_OutsideWest_EventScript_NoSSTicket message BattleFrontier_OutsideWest_Text_WhereWouldYouLikeToGo waitmessage goto BattleFrontier_OutsideWest_EventScript_ChooseFerryDestination @@ -44,22 +43,20 @@ BattleFrontier_OutsideWest_EventScript_NoSSTicket:: BattleFrontier_OutsideWest_EventScript_FerryToSlateport:: msgbox BattleFrontier_OutsideWest_Text_SlateportItIs, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq BattleFrontier_OutsideWest_EventScript_ChooseNewFerryDestination + goto_if_eq VAR_RESULT, NO, BattleFrontier_OutsideWest_EventScript_ChooseNewFerryDestination msgbox BattleFrontier_OutsideWest_Text_PleaseBoardFerry, MSGBOX_DEFAULT call BattleFrontier_OutsideWest_EventScript_BoardFerry - warp MAP_SLATEPORT_CITY_HARBOR, 255, 8, 11 + warp MAP_SLATEPORT_CITY_HARBOR, 8, 11 waitstate release end BattleFrontier_OutsideWest_EventScript_FerryToLilycove:: msgbox BattleFrontier_OutsideWest_Text_LilycoveItIs, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq BattleFrontier_OutsideWest_EventScript_ChooseNewFerryDestination + goto_if_eq VAR_RESULT, NO, BattleFrontier_OutsideWest_EventScript_ChooseNewFerryDestination msgbox BattleFrontier_OutsideWest_Text_PleaseBoardFerry, MSGBOX_DEFAULT call BattleFrontier_OutsideWest_EventScript_BoardFerry - warp MAP_LILYCOVE_CITY_HARBOR, 255, 8, 11 + warp MAP_LILYCOVE_CITY_HARBOR, 8, 11 waitstate release end @@ -155,14 +152,10 @@ BattleFrontier_OutsideWest_EventScript_Camper:: lock faceplayer delay 20 - compare VAR_FACING, DIR_NORTH - call_if_eq BattleFrontier_OutsideWest_EventScript_CamperFaceFactory - compare VAR_FACING, DIR_SOUTH - call_if_eq BattleFrontier_OutsideWest_EventScript_CamperAlreadyFacingFactory - compare VAR_FACING, DIR_WEST - call_if_eq BattleFrontier_OutsideWest_EventScript_CamperFaceFactory - compare VAR_FACING, DIR_EAST - call_if_eq BattleFrontier_OutsideWest_EventScript_CamperFaceFactory + call_if_eq VAR_FACING, DIR_NORTH, BattleFrontier_OutsideWest_EventScript_CamperFaceFactory + call_if_eq VAR_FACING, DIR_SOUTH, BattleFrontier_OutsideWest_EventScript_CamperAlreadyFacingFactory + call_if_eq VAR_FACING, DIR_WEST, BattleFrontier_OutsideWest_EventScript_CamperFaceFactory + call_if_eq VAR_FACING, DIR_EAST, BattleFrontier_OutsideWest_EventScript_CamperFaceFactory msgbox BattleFrontier_OutsideWest_Text_WhosRaisingThoseRentalMons, MSGBOX_DEFAULT release end @@ -180,14 +173,10 @@ BattleFrontier_OutsideWest_EventScript_Girl:: faceplayer message BattleFrontier_OutsideWest_Text_ScaredOfPikeBecauseSeviper waitmessage - compare VAR_FACING, DIR_NORTH - call_if_eq BattleFrontier_OutsideWest_EventScript_GirlShudderNorth - compare VAR_FACING, DIR_SOUTH - call_if_eq BattleFrontier_OutsideWest_EventScript_GirlShudderSouth - compare VAR_FACING, DIR_WEST - call_if_eq BattleFrontier_OutsideWest_EventScript_GirlShudderWest - compare VAR_FACING, DIR_EAST - call_if_eq BattleFrontier_OutsideWest_EventScript_GirlShudderEast + call_if_eq VAR_FACING, DIR_NORTH, BattleFrontier_OutsideWest_EventScript_GirlShudderNorth + call_if_eq VAR_FACING, DIR_SOUTH, BattleFrontier_OutsideWest_EventScript_GirlShudderSouth + call_if_eq VAR_FACING, DIR_WEST, BattleFrontier_OutsideWest_EventScript_GirlShudderWest + call_if_eq VAR_FACING, DIR_EAST, BattleFrontier_OutsideWest_EventScript_GirlShudderEast waitbuttonpress release end @@ -237,8 +226,7 @@ BattleFrontier_OutsideWest_EventScript_Woman2:: faceplayer msgbox BattleFrontier_OutsideWest_Text_LetsPlayRockPaperScissors, MSGBOX_DEFAULT random 2 - compare VAR_RESULT, 1 - goto_if_eq BattleFrontier_OutsideWest_EventScript_WomanWonRockPaperScissors + goto_if_eq VAR_RESULT, 1, BattleFrontier_OutsideWest_EventScript_WomanWonRockPaperScissors goto BattleFrontier_OutsideWest_EventScript_WomanLostRockPaperScissors end diff --git a/data/maps/BattleFrontier_RankingHall/scripts.inc b/data/maps/BattleFrontier_RankingHall/scripts.inc index a6c62cf86251..915ed98d9f73 100644 --- a/data/maps/BattleFrontier_RankingHall/scripts.inc +++ b/data/maps/BattleFrontier_RankingHall/scripts.inc @@ -86,8 +86,7 @@ BattleFrontier_RankingHall_EventScript_NinjaBoy:: lock faceplayer msgbox BattleFrontier_RankingHall_Text_IsYourNameOnThisList, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq BattleFrontier_RankingHall_EventScript_NinjaBoyNameOnList + goto_if_eq VAR_RESULT, YES, BattleFrontier_RankingHall_EventScript_NinjaBoyNameOnList msgbox BattleFrontier_RankingHall_Text_WorkHarderIfYouSawFriendsName, MSGBOX_DEFAULT release end diff --git a/data/maps/BattleFrontier_ScottsHouse/scripts.inc b/data/maps/BattleFrontier_ScottsHouse/scripts.inc index edb4bdf411c8..affd05d3492b 100644 --- a/data/maps/BattleFrontier_ScottsHouse/scripts.inc +++ b/data/maps/BattleFrontier_ScottsHouse/scripts.inc @@ -35,8 +35,7 @@ BattleFrontier_ScottsHouse_EventScript_CheckSilverSymbols:: goto_if_unset FLAG_SYS_PYRAMID_SILVER, BattleFrontier_ScottsHouse_EventScript_CheckGiveShield msgbox BattleFrontier_ScottsHouse_Text_YouveCollectedAllSilverSymbols, MSGBOX_DEFAULT giveitem ITEM_LANSAT_BERRY - compare VAR_RESULT, FALSE - goto_if_eq BattleFrontier_ScottsHouse_EventScript_BerryPocketFull + goto_if_eq VAR_RESULT, FALSE, BattleFrontier_ScottsHouse_EventScript_BerryPocketFull setflag FLAG_COLLECTED_ALL_SILVER_SYMBOLS setflag FLAG_TEMP_4 release @@ -52,8 +51,7 @@ BattleFrontier_ScottsHouse_EventScript_CheckGoldSymbols:: goto_if_unset FLAG_SYS_PYRAMID_GOLD, BattleFrontier_ScottsHouse_EventScript_CheckGiveShield msgbox BattleFrontier_ScottsHouse_Text_YouveCollectedAllGoldSymbols, MSGBOX_DEFAULT giveitem ITEM_STARF_BERRY - compare VAR_RESULT, FALSE - goto_if_eq BattleFrontier_ScottsHouse_EventScript_BerryPocketFull + goto_if_eq VAR_RESULT, FALSE, BattleFrontier_ScottsHouse_EventScript_BerryPocketFull setflag FLAG_COLLECTED_ALL_GOLD_SYMBOLS setflag FLAG_TEMP_4 release @@ -71,10 +69,8 @@ BattleFrontier_ScottsHouse_EventScript_GivenBerry:: BattleFrontier_ScottsHouse_EventScript_RandomComment:: random 3 - compare VAR_RESULT, 1 - goto_if_eq BattleFrontier_ScottsHouse_EventScript_FrontierBrainComment - compare VAR_RESULT, 2 - goto_if_eq BattleFrontier_ScottsHouse_EventScript_ArtisanCaveComment + goto_if_eq VAR_RESULT, 1, BattleFrontier_ScottsHouse_EventScript_FrontierBrainComment + goto_if_eq VAR_RESULT, 2, BattleFrontier_ScottsHouse_EventScript_ArtisanCaveComment msgbox BattleFrontier_ScottsHouse_Text_WhyIGoSeekingTrainers, MSGBOX_DEFAULT release end @@ -93,20 +89,17 @@ BattleFrontier_ScottsHouse_EventScript_CheckGiveSilverShield:: setvar VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_SINGLES frontier_set FRONTIER_DATA_LVL_MODE, FRONTIER_LVL_50 tower_get TOWER_DATA_WIN_STREAK - compare VAR_RESULT, 50 - goto_if_ge BattleFrontier_ScottsHouse_EventScript_GiveSilverShield + goto_if_ge VAR_RESULT, 50, BattleFrontier_ScottsHouse_EventScript_GiveSilverShield frontier_set FRONTIER_DATA_LVL_MODE, FRONTIER_LVL_OPEN tower_get TOWER_DATA_WIN_STREAK - compare VAR_RESULT, 50 - goto_if_ge BattleFrontier_ScottsHouse_EventScript_GiveSilverShield + goto_if_ge VAR_RESULT, 50, BattleFrontier_ScottsHouse_EventScript_GiveSilverShield goto BattleFrontier_ScottsHouse_EventScript_RandomComment end BattleFrontier_ScottsHouse_EventScript_GiveSilverShield:: msgbox BattleFrontier_ScottsHouse_Text_Beat50TrainersInARow, MSGBOX_DEFAULT givedecoration DECOR_SILVER_SHIELD - compare VAR_RESULT, FALSE - goto_if_eq BattleFrontier_ScottsHouse_EventScript_NoRoomForShield + goto_if_eq VAR_RESULT, FALSE, BattleFrontier_ScottsHouse_EventScript_NoRoomForShield setflag FLAG_RECEIVED_SILVER_SHIELD setflag FLAG_TEMP_3 goto BattleFrontier_ScottsHouse_EventScript_GivenShield @@ -126,20 +119,17 @@ BattleFrontier_ScottsHouse_EventScript_CheckGiveGoldShield:: setvar VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_SINGLES frontier_set FRONTIER_DATA_LVL_MODE, FRONTIER_LVL_50 tower_get TOWER_DATA_WIN_STREAK - compare VAR_RESULT, 100 - goto_if_ge BattleFrontier_ScottsHouse_EventScript_GiveGoldShield + goto_if_ge VAR_RESULT, 100, BattleFrontier_ScottsHouse_EventScript_GiveGoldShield frontier_set FRONTIER_DATA_LVL_MODE, FRONTIER_LVL_OPEN tower_get TOWER_DATA_WIN_STREAK - compare VAR_RESULT, 100 - goto_if_ge BattleFrontier_ScottsHouse_EventScript_GiveGoldShield + goto_if_ge VAR_RESULT, 100, BattleFrontier_ScottsHouse_EventScript_GiveGoldShield goto BattleFrontier_ScottsHouse_EventScript_RandomComment end BattleFrontier_ScottsHouse_EventScript_GiveGoldShield:: msgbox BattleFrontier_ScottsHouse_Text_Beat100TrainersInARow, MSGBOX_DEFAULT givedecoration DECOR_GOLD_SHIELD - compare VAR_RESULT, FALSE - goto_if_eq BattleFrontier_ScottsHouse_EventScript_NoRoomForShield + goto_if_eq VAR_RESULT, FALSE, BattleFrontier_ScottsHouse_EventScript_NoRoomForShield setflag FLAG_RECEIVED_GOLD_SHIELD setflag FLAG_TEMP_3 goto BattleFrontier_ScottsHouse_EventScript_GivenShield @@ -154,47 +144,40 @@ BattleFrontier_ScottsHouse_EventScript_WelcomeToFrontier:: msgbox BattleFrontier_ScottsHouse_Text_WelcomeToBattleFrontier, MSGBOX_DEFAULT closemessage delay 30 - compare VAR_FACING, DIR_NORTH - call_if_eq BattleFrontier_ScottsHouse_EventScript_ScottFaceAwayNorth - compare VAR_FACING, DIR_SOUTH - call_if_eq BattleFrontier_ScottsHouse_EventScript_ScottFaceAwaySouth - compare VAR_FACING, DIR_EAST - call_if_eq BattleFrontier_ScottsHouse_EventScript_ScottFaceAwayEast - compare VAR_FACING, DIR_WEST - call_if_eq BattleFrontier_ScottsHouse_EventScript_ScottFaceAwayWest + call_if_eq VAR_FACING, DIR_NORTH, BattleFrontier_ScottsHouse_EventScript_ScottFaceAwayNorth + call_if_eq VAR_FACING, DIR_SOUTH, BattleFrontier_ScottsHouse_EventScript_ScottFaceAwaySouth + call_if_eq VAR_FACING, DIR_EAST, BattleFrontier_ScottsHouse_EventScript_ScottFaceAwayEast + call_if_eq VAR_FACING, DIR_WEST, BattleFrontier_ScottsHouse_EventScript_ScottFaceAwayWest msgbox BattleFrontier_ScottsHouse_Text_HowMuchEffortItTookToMakeReal, MSGBOX_DEFAULT applymovement LOCALID_SCOTT, Common_Movement_FacePlayer waitmovement 0 msgbox BattleFrontier_ScottsHouse_Text_HaveThisAsMementoOfOurPathsCrossing, MSGBOX_DEFAULT - compare VAR_SCOTT_STATE, 13 - goto_if_eq BattleFrontier_ScottsHouse_EventScript_Give4BattlePoints - compare VAR_SCOTT_STATE, 9 - goto_if_ge BattleFrontier_ScottsHouse_EventScript_Give3BattlePoints - compare VAR_SCOTT_STATE, 6 - goto_if_ge BattleFrontier_ScottsHouse_EventScript_Give2BattlePoints + goto_if_eq VAR_SCOTT_STATE, 13, BattleFrontier_ScottsHouse_EventScript_Give4BattlePoints + goto_if_ge VAR_SCOTT_STATE, 9, BattleFrontier_ScottsHouse_EventScript_Give3BattlePoints + goto_if_ge VAR_SCOTT_STATE, 6, BattleFrontier_ScottsHouse_EventScript_Give2BattlePoints goto BattleFrontier_ScottsHouse_EventScript_Give1BattlePoint end BattleFrontier_ScottsHouse_EventScript_Give4BattlePoints:: - buffernumberstring 0, 4 + buffernumberstring STR_VAR_1, 4 setvar VAR_0x8004, 4 goto BattleFrontier_ScottsHouse_EventScript_GiveBattlePoints end BattleFrontier_ScottsHouse_EventScript_Give3BattlePoints:: - buffernumberstring 0, 3 + buffernumberstring STR_VAR_1, 3 setvar VAR_0x8004, 3 goto BattleFrontier_ScottsHouse_EventScript_GiveBattlePoints end BattleFrontier_ScottsHouse_EventScript_Give2BattlePoints:: - buffernumberstring 0, 2 + buffernumberstring STR_VAR_1, 2 setvar VAR_0x8004, 2 goto BattleFrontier_ScottsHouse_EventScript_GiveBattlePoints end BattleFrontier_ScottsHouse_EventScript_Give1BattlePoint:: - buffernumberstring 0, 1 + buffernumberstring STR_VAR_1, 1 setvar VAR_0x8004, 1 goto BattleFrontier_ScottsHouse_EventScript_GiveBattlePoints end diff --git a/data/maps/BirthIsland_Exterior/scripts.inc b/data/maps/BirthIsland_Exterior/scripts.inc index cd1583b420e3..57d54d6fdc89 100644 --- a/data/maps/BirthIsland_Exterior/scripts.inc +++ b/data/maps/BirthIsland_Exterior/scripts.inc @@ -38,8 +38,7 @@ BirthIsland_Exterior_OnResume: BirthIsland_Exterior_EventScript_TryRemoveDeoxys:: specialvar VAR_RESULT, GetBattleOutcome - compare VAR_RESULT, B_OUTCOME_CAUGHT - goto_if_ne Common_EventScript_NopReturn + goto_if_ne VAR_RESULT, B_OUTCOME_CAUGHT, Common_EventScript_NopReturn removeobject LOCALID_DEOXYS return @@ -92,12 +91,9 @@ BirthIsland_Exterior_EventScript_Deoxys:: waitstate clearflag FLAG_SYS_CTRL_OBJ_DELETE specialvar VAR_RESULT, GetBattleOutcome - compare VAR_RESULT, B_OUTCOME_WON - goto_if_eq BirthIsland_Exterior_EventScript_DefeatedDeoxys - compare VAR_RESULT, B_OUTCOME_RAN - goto_if_eq BirthIsland_Exterior_EventScript_RanFromDeoxys - compare VAR_RESULT, B_OUTCOME_PLAYER_TELEPORTED - goto_if_eq BirthIsland_Exterior_EventScript_RanFromDeoxys + goto_if_eq VAR_RESULT, B_OUTCOME_WON, BirthIsland_Exterior_EventScript_DefeatedDeoxys + goto_if_eq VAR_RESULT, B_OUTCOME_RAN, BirthIsland_Exterior_EventScript_RanFromDeoxys + goto_if_eq VAR_RESULT, B_OUTCOME_PLAYER_TELEPORTED, BirthIsland_Exterior_EventScript_RanFromDeoxys setflag FLAG_BATTLED_DEOXYS release end diff --git a/data/maps/BirthIsland_Harbor/scripts.inc b/data/maps/BirthIsland_Harbor/scripts.inc index 06c5b08e9dcc..e91238cbdcae 100644 --- a/data/maps/BirthIsland_Harbor/scripts.inc +++ b/data/maps/BirthIsland_Harbor/scripts.inc @@ -8,8 +8,7 @@ BirthIsland_Harbor_EventScript_Sailor:: lock faceplayer msgbox BirthIsland_Harbor_Text_SailorReturn, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq BirthIsland_Harbor_EventScript_AsYouLike + goto_if_eq VAR_RESULT, NO, BirthIsland_Harbor_EventScript_AsYouLike msgbox EventTicket_Text_SailHome, MSGBOX_DEFAULT closemessage applymovement VAR_LAST_TALKED, Common_Movement_WalkInPlaceFasterDown @@ -18,7 +17,7 @@ BirthIsland_Harbor_EventScript_Sailor:: hideobjectat LOCALID_SAILOR, MAP_BIRTH_ISLAND_HARBOR setvar VAR_0x8004, LOCALID_SS_TIDAL call Common_EventScript_FerryDepartIsland - warp MAP_LILYCOVE_CITY_HARBOR, 255, 8, 11 + warp MAP_LILYCOVE_CITY_HARBOR, 8, 11 waitstate release end diff --git a/data/maps/CaveOfOrigin_Entrance/scripts.inc b/data/maps/CaveOfOrigin_Entrance/scripts.inc index 091246ae0df3..40ca7a654d3f 100644 --- a/data/maps/CaveOfOrigin_Entrance/scripts.inc +++ b/data/maps/CaveOfOrigin_Entrance/scripts.inc @@ -3,6 +3,6 @@ CaveOfOrigin_Entrance_MapScripts:: .byte 0 CaveOfOrigin_Entrance_OnResume: - setescapewarp MAP_SOOTOPOLIS_CITY, 255, 31, 17 + setescapewarp MAP_SOOTOPOLIS_CITY, 31, 17 end diff --git a/data/maps/ContestHall/scripts.inc b/data/maps/ContestHall/scripts.inc index 535e28b7892a..7ca6a57f69d7 100644 --- a/data/maps/ContestHall/scripts.inc +++ b/data/maps/ContestHall/scripts.inc @@ -19,16 +19,11 @@ ContestHall_OnTransition: ContestHall_EventScript_ReadyContestMusic:: call ContestHall_EventScript_TryWaitForLink special GetContestMultiplayerId - compare VAR_RESULT, 0 - call_if_eq ContestHall_EventScript_SaveContestMusicPlayer1 - compare VAR_RESULT, 1 - call_if_eq ContestHall_EventScript_SaveContestMusicPlayer2 - compare VAR_RESULT, 2 - call_if_eq ContestHall_EventScript_SaveContestMusicPlayer3 - compare VAR_RESULT, 3 - call_if_eq ContestHall_EventScript_SaveContestMusicPlayer4 - compare VAR_RESULT, 4 - call_if_eq ContestHall_EventScript_SaveContestMusic + call_if_eq VAR_RESULT, 0, ContestHall_EventScript_SaveContestMusicPlayer1 + call_if_eq VAR_RESULT, 1, ContestHall_EventScript_SaveContestMusicPlayer2 + call_if_eq VAR_RESULT, 2, ContestHall_EventScript_SaveContestMusicPlayer3 + call_if_eq VAR_RESULT, 3, ContestHall_EventScript_SaveContestMusicPlayer4 + call_if_eq VAR_RESULT, 4, ContestHall_EventScript_SaveContestMusic return ContestHall_EventScript_SaveContestMusicPlayer1:: @@ -52,8 +47,7 @@ ContestHall_EventScript_SaveContestMusic:: return ContestHall_OnResume: - compare VAR_TEMP_9, 1 - call_if_eq ContestHall_EventScript_ReShowAudience + call_if_eq VAR_TEMP_9, 1, ContestHall_EventScript_ReShowAudience end ContestHall_EventScript_ReShowAudience:: @@ -84,8 +78,7 @@ ContestHall_EventScript_SetContestObjects:: ContestHall_EventScript_AddRandomAudienceMembers:: call ContestHall_EventScript_GetRandomAudienceGfxId call ContestHall_EventScript_SetRandomAudienceGfx - compare VAR_TEMP_0, 8 - goto_if_lt ContestHall_EventScript_AddRandomAudienceMembers + goto_if_lt VAR_TEMP_0, 8, ContestHall_EventScript_AddRandomAudienceMembers return ContestHall_EventScript_SetRandomAudienceGfx:: @@ -303,8 +296,7 @@ ContestHall_EventScript_RandomAudienceScientist1:: ContestHall_EventScript_CreateAudience:: specialvar VAR_RESULT, IsWirelessContest - compare VAR_RESULT, TRUE - goto_if_eq ContestHall_EventScript_CreateWirelessContestAudience + goto_if_eq VAR_RESULT, TRUE, ContestHall_EventScript_CreateWirelessContestAudience switch VAR_CONTEST_TYPE case CONTEST_TYPE_NPC_NORMAL, ContestHall_EventScript_CreateNormalContestAudience case CONTEST_TYPE_NPC_SUPER, ContestHall_EventScript_CreateSuperContestAudience @@ -418,36 +410,34 @@ ContestHall_EventScript_SetExitWarp:: return ContestHall_EventScript_SetExitWarpNormalContest:: - warp MAP_LILYCOVE_CITY_CONTEST_LOBBY, 255, 14, 4 + warp MAP_LILYCOVE_CITY_CONTEST_LOBBY, 14, 4 waitstate end ContestHall_EventScript_SetExitWarpSuperContest:: - warp MAP_LILYCOVE_CITY_CONTEST_LOBBY, 255, 14, 4 + warp MAP_LILYCOVE_CITY_CONTEST_LOBBY, 14, 4 waitstate end ContestHall_EventScript_SetExitWarpHyperContest:: - warp MAP_LILYCOVE_CITY_CONTEST_LOBBY, 255, 14, 4 + warp MAP_LILYCOVE_CITY_CONTEST_LOBBY, 14, 4 waitstate end ContestHall_EventScript_SetExitWarpMasterContest:: - warp MAP_LILYCOVE_CITY_CONTEST_LOBBY, 255, 14, 4 + warp MAP_LILYCOVE_CITY_CONTEST_LOBBY, 14, 4 waitstate end ContestHall_EventScript_SetExitWarpLinkContest:: - warp MAP_LILYCOVE_CITY_CONTEST_LOBBY, 255, 15, 4 + warp MAP_LILYCOVE_CITY_CONTEST_LOBBY, 15, 4 waitstate end LilycoveCity_ContestLobby_EventScript_SetPlayerGfx:: checkplayergender - compare VAR_RESULT, MALE - goto_if_eq LilycoveCity_ContestLobby_EventScript_SetPlayerGfxBrendan - compare VAR_RESULT, FEMALE - goto_if_eq LilycoveCity_ContestLobby_EventScript_SetPlayerGfxMay + goto_if_eq VAR_RESULT, MALE, LilycoveCity_ContestLobby_EventScript_SetPlayerGfxBrendan + goto_if_eq VAR_RESULT, FEMALE, LilycoveCity_ContestLobby_EventScript_SetPlayerGfxMay return LilycoveCity_ContestLobby_EventScript_SetPlayerGfxBrendan:: diff --git a/data/maps/DesertRuins/scripts.inc b/data/maps/DesertRuins/scripts.inc index 443915d7e213..2aaa61ebb932 100644 --- a/data/maps/DesertRuins/scripts.inc +++ b/data/maps/DesertRuins/scripts.inc @@ -10,8 +10,7 @@ DesertRuins_OnResume: DesertRuins_EventScript_TryRemoveRegirock:: specialvar VAR_RESULT, GetBattleOutcome - compare VAR_RESULT, B_OUTCOME_CAUGHT - goto_if_ne Common_EventScript_NopReturn + goto_if_ne VAR_RESULT, B_OUTCOME_CAUGHT, Common_EventScript_NopReturn removeobject VAR_LAST_TALKED return @@ -20,12 +19,12 @@ DesertRuins_OnLoad: end DesertRuins_EventScript_HideRegiEntrance:: - setmetatile 7, 19, METATILE_Cave_EntranceCover, 1 - setmetatile 8, 19, METATILE_Cave_EntranceCover, 1 - setmetatile 9, 19, METATILE_Cave_EntranceCover, 1 - setmetatile 7, 20, METATILE_Cave_SealedChamberBraille_Mid, 1 - setmetatile 8, 20, METATILE_Cave_SealedChamberBraille_Mid, 1 - setmetatile 9, 20, METATILE_Cave_SealedChamberBraille_Mid, 1 + setmetatile 7, 19, METATILE_Cave_EntranceCover, TRUE + setmetatile 8, 19, METATILE_Cave_EntranceCover, TRUE + setmetatile 9, 19, METATILE_Cave_EntranceCover, TRUE + setmetatile 7, 20, METATILE_Cave_SealedChamberBraille_Mid, TRUE + setmetatile 8, 20, METATILE_Cave_SealedChamberBraille_Mid, TRUE + setmetatile 9, 20, METATILE_Cave_SealedChamberBraille_Mid, TRUE return DesertRuins_OnTransition: @@ -68,12 +67,9 @@ DesertRuins_EventScript_Regirock:: waitstate clearflag FLAG_SYS_CTRL_OBJ_DELETE specialvar VAR_RESULT, GetBattleOutcome - compare VAR_RESULT, B_OUTCOME_WON - goto_if_eq DesertRuins_EventScript_DefeatedRegirock - compare VAR_RESULT, B_OUTCOME_RAN - goto_if_eq DesertRuins_EventScript_RanFromRegirock - compare VAR_RESULT, B_OUTCOME_PLAYER_TELEPORTED - goto_if_eq DesertRuins_EventScript_RanFromRegirock + goto_if_eq VAR_RESULT, B_OUTCOME_WON, DesertRuins_EventScript_DefeatedRegirock + goto_if_eq VAR_RESULT, B_OUTCOME_RAN, DesertRuins_EventScript_RanFromRegirock + goto_if_eq VAR_RESULT, B_OUTCOME_PLAYER_TELEPORTED, DesertRuins_EventScript_RanFromRegirock setflag FLAG_DEFEATED_REGIROCK release end diff --git a/data/maps/DewfordTown/scripts.inc b/data/maps/DewfordTown/scripts.inc index 281648aeb65f..1250c2d7670d 100644 --- a/data/maps/DewfordTown/scripts.inc +++ b/data/maps/DewfordTown/scripts.inc @@ -54,8 +54,7 @@ DewfordTown_EventScript_CancelSailSelect:: DewfordTown_EventScript_ReturnToPetalburgPrompt:: msgbox DewfordTown_Text_SetSailBackToPetalburg, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq DewfordTown_EventScript_SailBackToPetalburg + goto_if_eq VAR_RESULT, YES, DewfordTown_EventScript_SailBackToPetalburg msgbox DewfordTown_Text_GoDeliverIllBeWaiting, MSGBOX_DEFAULT release end @@ -87,10 +86,8 @@ DewfordTown_EventScript_OldRodFisherman:: faceplayer goto_if_set FLAG_RECEIVED_OLD_ROD, DewfordTown_EventScript_HowsFishing msgbox DewfordTown_Text_GettingItchToFish, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq DewfordTown_EventScript_GiveOldRod - compare VAR_RESULT, NO - goto_if_eq DewfordTown_EventScript_NotGettingItchToFish + goto_if_eq VAR_RESULT, YES, DewfordTown_EventScript_GiveOldRod + goto_if_eq VAR_RESULT, NO, DewfordTown_EventScript_NotGettingItchToFish end DewfordTown_EventScript_GiveOldRod:: @@ -110,10 +107,8 @@ DewfordTown_EventScript_HowsFishing:: message DewfordTown_Text_HowsYourFishing waitmessage multichoice 20, 8, MULTI_HOWS_FISHING, TRUE - compare VAR_RESULT, 0 - goto_if_eq DewfordTown_EventScript_FishingExcellent - compare VAR_RESULT, 1 - goto_if_eq DewfordTown_EventScript_FishingNotSoGood + goto_if_eq VAR_RESULT, 0, DewfordTown_EventScript_FishingExcellent + goto_if_eq VAR_RESULT, 1, DewfordTown_EventScript_FishingNotSoGood end DewfordTown_EventScript_FishingExcellent:: @@ -128,8 +123,8 @@ DewfordTown_EventScript_FishingNotSoGood:: DewfordTown_EventScript_SailToPetalburg:: call EventScript_BackupMrBrineyLocation - setobjectpriority LOCALID_BRINEY_DEWFORD, MAP_DEWFORD_TOWN, 0 - setobjectpriority OBJ_EVENT_ID_PLAYER, MAP_DEWFORD_TOWN, 0 + setobjectsubpriority LOCALID_BRINEY_DEWFORD, MAP_DEWFORD_TOWN, 0 + setobjectsubpriority OBJ_EVENT_ID_PLAYER, MAP_DEWFORD_TOWN, 0 applymovement LOCALID_BRINEY_DEWFORD, DewfordTown_Movement_BrineyBoardBoat waitmovement 0 removeobject LOCALID_BRINEY_DEWFORD @@ -151,8 +146,8 @@ DewfordTown_EventScript_SailToPetalburg:: setflag FLAG_HIDE_MR_BRINEY_BOAT_DEWFORD_TOWN hideobjectat LOCALID_BOAT_DEWFORD, MAP_DEWFORD_TOWN setvar VAR_BOARD_BRINEY_BOAT_STATE, 2 - resetobjectpriority OBJ_EVENT_ID_PLAYER, MAP_DEWFORD_TOWN - warp MAP_ROUTE104_MR_BRINEYS_HOUSE, 255, 5, 4 + resetobjectsubpriority OBJ_EVENT_ID_PLAYER, MAP_DEWFORD_TOWN + warp MAP_ROUTE104_MR_BRINEYS_HOUSE, 5, 4 copyvar VAR_BRINEY_LOCATION, VAR_0x8008 waitstate release @@ -160,8 +155,8 @@ DewfordTown_EventScript_SailToPetalburg:: DewfordTown_EventScript_SailToSlateport:: call EventScript_BackupMrBrineyLocation - setobjectpriority LOCALID_BRINEY_DEWFORD, MAP_DEWFORD_TOWN, 0 - setobjectpriority OBJ_EVENT_ID_PLAYER, MAP_DEWFORD_TOWN, 1 + setobjectsubpriority LOCALID_BRINEY_DEWFORD, MAP_DEWFORD_TOWN, 0 + setobjectsubpriority OBJ_EVENT_ID_PLAYER, MAP_DEWFORD_TOWN, 1 applymovement LOCALID_BRINEY_DEWFORD, DewfordTown_Movement_BrineyBoardBoat waitmovement 0 removeobject LOCALID_BRINEY_DEWFORD @@ -178,7 +173,7 @@ DewfordTown_EventScript_SailToSlateport:: waitmovement 0 setobjectxyperm LOCALID_BRINEY_R109, 21, 26 addobject LOCALID_BRINEY_R109 - setobjectpriority LOCALID_BRINEY_R109, MAP_ROUTE109, 0 + setobjectsubpriority LOCALID_BRINEY_R109, MAP_ROUTE109, 0 applymovement LOCALID_BRINEY_R109, DewfordTown_Movement_BrineyExitBoat waitmovement 0 clearflag FLAG_HIDE_ROUTE_109_MR_BRINEY @@ -190,8 +185,8 @@ DewfordTown_EventScript_SailToSlateport:: call_if_set FLAG_DELIVERED_DEVON_GOODS, DewfordTown_EventScript_LandedSlateport closemessage copyvar VAR_BRINEY_LOCATION, VAR_0x8008 - resetobjectpriority OBJ_EVENT_ID_PLAYER, MAP_DEWFORD_TOWN - resetobjectpriority LOCALID_BRINEY_R109, MAP_ROUTE109 + resetobjectsubpriority OBJ_EVENT_ID_PLAYER, MAP_DEWFORD_TOWN + resetobjectsubpriority LOCALID_BRINEY_R109, MAP_ROUTE109 copyobjectxytoperm LOCALID_BRINEY_R109 release end @@ -607,10 +602,8 @@ DewfordTown_EventScript_TrendyPhraseBoy:: faceplayer call Common_EventScript_BufferTrendyPhrase msgbox DewfordTown_Text_XIsTheBiggestHappeningThingRight, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq DewfordTown_EventScript_ConfirmTrendyPhrase - compare VAR_RESULT, NO - goto_if_eq DewfordTown_EventScript_RejectTrendyPhrase + goto_if_eq VAR_RESULT, YES, DewfordTown_EventScript_ConfirmTrendyPhrase + goto_if_eq VAR_RESULT, NO, DewfordTown_EventScript_RejectTrendyPhrase end DewfordTown_EventScript_ConfirmTrendyPhrase:: @@ -624,16 +617,13 @@ DewfordTown_EventScript_RejectTrendyPhrase:: call Common_ShowEasyChatScreen lock faceplayer - compare VAR_RESULT, TRUE - goto_if_eq DewfordTown_EventScript_GiveNewTrendyPhrase - compare VAR_RESULT, FALSE - goto_if_eq DewfordTown_EventScript_CancelNewTrendyPhrase + goto_if_eq VAR_RESULT, TRUE, DewfordTown_EventScript_GiveNewTrendyPhrase + goto_if_eq VAR_RESULT, FALSE, DewfordTown_EventScript_CancelNewTrendyPhrase end DewfordTown_EventScript_GiveNewTrendyPhrase:: incrementgamestat GAME_STAT_STARTED_TRENDS - compare VAR_0x8004, FALSE - goto_if_eq DewfordTown_EventScript_PhraseNotTrendyEnough + goto_if_eq VAR_0x8004, FALSE, DewfordTown_EventScript_PhraseNotTrendyEnough msgbox DewfordTown_Text_OfCourseIKnowAboutThat, MSGBOX_DEFAULT release end diff --git a/data/maps/DewfordTown_Gym/scripts.inc b/data/maps/DewfordTown_Gym/scripts.inc index d2b51766afad..81474af7261c 100644 --- a/data/maps/DewfordTown_Gym/scripts.inc +++ b/data/maps/DewfordTown_Gym/scripts.inc @@ -3,77 +3,66 @@ DewfordTown_Gym_MapScripts:: .byte 0 DewfordTown_Gym_OnTransition: - call DewfordTown_Gym_EventScript_SetFlashRadius + call DewfordTown_Gym_EventScript_SetFlashLevel end -DewfordTown_Gym_EventScript_SetFlashRadius:: +DewfordTown_Gym_EventScript_SetFlashLevel:: goto_if_defeated TRAINER_BRAWLY_1, DewfordTown_Gym_EventScript_SetLightsOn call DewfordTown_Gym_EventScript_CountTrainersDefeated copyvar VAR_0x8001, VAR_0x8000 - compare VAR_0x8000, 0 - goto_if_eq DewfordTown_Gym_EventScript_SetFlashRadius7 - compare VAR_0x8000, 1 - goto_if_eq DewfordTown_Gym_EventScript_SetFlashRadius6 - compare VAR_0x8000, 2 - goto_if_eq DewfordTown_Gym_EventScript_SetFlashRadius5 - compare VAR_0x8000, 3 - goto_if_eq DewfordTown_Gym_EventScript_SetFlashRadius4 - compare VAR_0x8000, 4 - goto_if_eq DewfordTown_Gym_EventScript_SetFlashRadius3 - compare VAR_0x8000, 5 - goto_if_eq DewfordTown_Gym_EventScript_SetFlashRadius2 - goto DewfordTown_Gym_EventScript_SetFlashRadius1 + goto_if_eq VAR_0x8000, 0, DewfordTown_Gym_EventScript_SetFlashLevel7 + goto_if_eq VAR_0x8000, 1, DewfordTown_Gym_EventScript_SetFlashLevel6 + goto_if_eq VAR_0x8000, 2, DewfordTown_Gym_EventScript_SetFlashLevel5 + goto_if_eq VAR_0x8000, 3, DewfordTown_Gym_EventScript_SetFlashLevel4 + goto_if_eq VAR_0x8000, 4, DewfordTown_Gym_EventScript_SetFlashLevel3 + goto_if_eq VAR_0x8000, 5, DewfordTown_Gym_EventScript_SetFlashLevel2 + goto DewfordTown_Gym_EventScript_SetFlashLevel1 DewfordTown_Gym_EventScript_SetLightsOn:: - setflashradius 0 + setflashlevel 0 return -DewfordTown_Gym_EventScript_SetFlashRadius1:: - setflashradius 1 +@ Brightest +DewfordTown_Gym_EventScript_SetFlashLevel1:: + setflashlevel 1 return -DewfordTown_Gym_EventScript_SetFlashRadius2:: - setflashradius 2 +DewfordTown_Gym_EventScript_SetFlashLevel2:: + setflashlevel 2 return -DewfordTown_Gym_EventScript_SetFlashRadius3:: - setflashradius 3 +DewfordTown_Gym_EventScript_SetFlashLevel3:: + setflashlevel 3 return -DewfordTown_Gym_EventScript_SetFlashRadius4:: - setflashradius 4 +DewfordTown_Gym_EventScript_SetFlashLevel4:: + setflashlevel 4 return -DewfordTown_Gym_EventScript_SetFlashRadius5:: - setflashradius 5 +DewfordTown_Gym_EventScript_SetFlashLevel5:: + setflashlevel 5 return -DewfordTown_Gym_EventScript_SetFlashRadius6:: - setflashradius 6 +DewfordTown_Gym_EventScript_SetFlashLevel6:: + setflashlevel 6 return -DewfordTown_Gym_EventScript_SetFlashRadius7:: - setflashradius 7 +@ Darkest +DewfordTown_Gym_EventScript_SetFlashLevel7:: + setflashlevel 7 return DewfordTown_Gym_EventScript_BrightenRoom:: call DewfordTown_Gym_EventScript_CountTrainersDefeated nop1 - compare VAR_0x8000, VAR_0x8001 - goto_if_eq DewfordTown_Gym_EventScript_NoLightChange + goto_if_eq VAR_0x8000, VAR_0x8001, DewfordTown_Gym_EventScript_NoLightChange copyvar VAR_0x8001, VAR_0x8000 - compare VAR_0x8000, 1 - goto_if_eq DewfordTown_Gym_EventScript_AnimateFlash1Trainer - compare VAR_0x8000, 2 - goto_if_eq DewfordTown_Gym_EventScript_AnimateFlash2Trainers - compare VAR_0x8000, 3 - goto_if_eq DewfordTown_Gym_EventScript_AnimateFlash3Trainers - compare VAR_0x8000, 4 - goto_if_eq DewfordTown_Gym_EventScript_AnimateFlash4Trainers - compare VAR_0x8000, 5 - goto_if_eq DewfordTown_Gym_EventScript_AnimateFlash5Trainers - compare VAR_0x8000, 6 - goto_if_eq DewfordTown_Gym_EventScript_AnimateFlash6Trainers + goto_if_eq VAR_0x8000, 1, DewfordTown_Gym_EventScript_AnimateFlash1Trainer + goto_if_eq VAR_0x8000, 2, DewfordTown_Gym_EventScript_AnimateFlash2Trainers + goto_if_eq VAR_0x8000, 3, DewfordTown_Gym_EventScript_AnimateFlash3Trainers + goto_if_eq VAR_0x8000, 4, DewfordTown_Gym_EventScript_AnimateFlash4Trainers + goto_if_eq VAR_0x8000, 5, DewfordTown_Gym_EventScript_AnimateFlash5Trainers + goto_if_eq VAR_0x8000, 6, DewfordTown_Gym_EventScript_AnimateFlash6Trainers DewfordTown_Gym_EventScript_NoLightChange:: return @@ -82,43 +71,43 @@ DewfordTown_Gym_EventScript_NoLightChange:: DewfordTown_Gym_EventScript_AnimateFlash1Trainer:: playse SE_SWITCH animateflash 6 - call DewfordTown_Gym_EventScript_SetFlashRadius + call DewfordTown_Gym_EventScript_SetFlashLevel return DewfordTown_Gym_EventScript_AnimateFlash2Trainers:: playse SE_SWITCH animateflash 5 - call DewfordTown_Gym_EventScript_SetFlashRadius + call DewfordTown_Gym_EventScript_SetFlashLevel return DewfordTown_Gym_EventScript_AnimateFlash3Trainers:: playse SE_SWITCH animateflash 4 - call DewfordTown_Gym_EventScript_SetFlashRadius + call DewfordTown_Gym_EventScript_SetFlashLevel return DewfordTown_Gym_EventScript_AnimateFlash4Trainers:: playse SE_SWITCH animateflash 3 - call DewfordTown_Gym_EventScript_SetFlashRadius + call DewfordTown_Gym_EventScript_SetFlashLevel return DewfordTown_Gym_EventScript_AnimateFlash5Trainers:: playse SE_SWITCH animateflash 2 - call DewfordTown_Gym_EventScript_SetFlashRadius + call DewfordTown_Gym_EventScript_SetFlashLevel return DewfordTown_Gym_EventScript_AnimateFlash6Trainers:: playse SE_SWITCH animateflash 1 - call DewfordTown_Gym_EventScript_SetFlashRadius + call DewfordTown_Gym_EventScript_SetFlashLevel return DewfordTown_Gym_EventScript_AnimateFlashFullBrightness:: playse SE_SWITCH animateflash 0 - call DewfordTown_Gym_EventScript_SetFlashRadius + call DewfordTown_Gym_EventScript_SetFlashLevel return DewfordTown_Gym_EventScript_CountTrainersDefeated:: @@ -146,8 +135,7 @@ DewfordTown_Gym_EventScript_StopCountingTrainers:: DewfordTown_Gym_EventScript_Brawly:: trainerbattle_single TRAINER_BRAWLY_1, DewfordTown_Gym_Text_BrawlyIntro, DewfordTown_Gym_Text_BrawlyDefeat, DewfordTown_Gym_EventScript_BrawlyDefeated, NO_MUSIC specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq DewfordTown_Gym_EventScript_BrawlyRematch + goto_if_eq VAR_RESULT, TRUE, DewfordTown_Gym_EventScript_BrawlyRematch goto_if_unset FLAG_RECEIVED_TM08, DewfordTown_Gym_EventScript_GiveBulkUp2 msgbox DewfordTown_Gym_Text_BrawlyPostBattle, MSGBOX_DEFAULT release @@ -162,8 +150,7 @@ DewfordTown_Gym_EventScript_BrawlyDefeated:: setflag FLAG_DEFEATED_DEWFORD_GYM setflag FLAG_BADGE02_GET addvar VAR_PETALBURG_GYM_STATE, 1 - compare VAR_PETALBURG_GYM_STATE, 6 - call_if_eq Common_EventScript_ReadyPetalburgGymForBattle + call_if_eq VAR_PETALBURG_GYM_STATE, 6, Common_EventScript_ReadyPetalburgGymForBattle setvar VAR_0x8008, 2 call Common_EventScript_SetGymTrainers call DewfordTown_Gym_EventScript_GiveBulkUp @@ -182,16 +169,14 @@ DewfordTown_Gym_EventScript_BrawlyDefeated:: DewfordTown_Gym_EventScript_GiveBulkUp:: giveitem ITEM_TM08 - compare VAR_RESULT, 0 - goto_if_eq Common_EventScript_BagIsFull + goto_if_eq VAR_RESULT, 0, Common_EventScript_BagIsFull msgbox DewfordTown_Gym_Text_ExplainBulkUp, MSGBOX_DEFAULT setflag FLAG_RECEIVED_TM08 return DewfordTown_Gym_EventScript_GiveBulkUp2: giveitem ITEM_TM08 - compare VAR_RESULT, 0 - goto_if_eq Common_EventScript_ShowBagIsFull + goto_if_eq VAR_RESULT, 0, Common_EventScript_ShowBagIsFull msgbox DewfordTown_Gym_Text_ExplainBulkUp, MSGBOX_DEFAULT setflag FLAG_RECEIVED_TM08 release diff --git a/data/maps/DewfordTown_Hall/scripts.inc b/data/maps/DewfordTown_Hall/scripts.inc index 9d8392ff162a..6249a7fac5ce 100644 --- a/data/maps/DewfordTown_Hall/scripts.inc +++ b/data/maps/DewfordTown_Hall/scripts.inc @@ -11,8 +11,7 @@ DewfordTown_Hall_EventScript_Girl:: faceplayer call Common_EventScript_BufferTrendyPhrase special IsTrendyPhraseBoring - compare VAR_RESULT, TRUE - goto_if_eq DewfordTown_Hall_EventScript_GirlBoredOfTrend + goto_if_eq VAR_RESULT, TRUE, DewfordTown_Hall_EventScript_GirlBoredOfTrend msgbox DewfordTown_Hall_Text_CantImagineLifeWithoutTrend, MSGBOX_DEFAULT release end @@ -36,10 +35,8 @@ DewfordTown_Hall_EventScript_Man:: call Common_EventScript_BufferTrendyPhrase special BufferDeepLinkPhrase msgbox DewfordTown_Hall_Text_DeepLinkBetweenXAndY, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq DewfordTown_Hall_EventScript_ConfirmTrendLink - compare VAR_RESULT, NO - goto_if_eq DewfordTown_Hall_EventScript_RejectTrendLink + goto_if_eq VAR_RESULT, YES, DewfordTown_Hall_EventScript_ConfirmTrendLink + goto_if_eq VAR_RESULT, NO, DewfordTown_Hall_EventScript_RejectTrendLink end DewfordTown_Hall_EventScript_ConfirmTrendLink:: @@ -196,15 +193,12 @@ DewfordTown_Hall_EventScript_DontMovePlayer1:: DewfordTown_Hall_EventScript_DebateReact1:: applymovement LOCALID_PSYCHIC_M, DewfordTown_Hall_Movement_PsychicWalkInPlaceLeft waitmovement 0 - compare VAR_0x8008, 0 - goto_if_eq DewfordTown_Hall_EventScript_PlayerReactWest - compare VAR_0x8008, 1 - goto_if_eq DewfordTown_Hall_EventScript_DontMovePlayer2 + goto_if_eq VAR_0x8008, 0, DewfordTown_Hall_EventScript_PlayerReactWest + goto_if_eq VAR_0x8008, 1, DewfordTown_Hall_EventScript_DontMovePlayer2 end DewfordTown_Hall_EventScript_PlayerReactWest:: - compare VAR_FACING, DIR_EAST - goto_if_eq DewfordTown_Hall_EventScript_DontMovePlayer1 + goto_if_eq VAR_FACING, DIR_EAST, DewfordTown_Hall_EventScript_DontMovePlayer1 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFasterRight waitmovement 0 return @@ -215,17 +209,13 @@ DewfordTown_Hall_EventScript_DontMovePlayer2:: DewfordTown_Hall_EventScript_DebateReact2:: applymovement LOCALID_SCHOOL_KID_M, DewfordTown_Hall_Movement_SchoolKidWalkInPlaceRight waitmovement 0 - compare VAR_0x8008, 0 - goto_if_eq DewfordTown_Hall_EventScript_PlayerReactNorthSouth - compare VAR_0x8008, 1 - goto_if_eq DewfordTown_Hall_EventScript_PlayerReactEast + goto_if_eq VAR_0x8008, 0, DewfordTown_Hall_EventScript_PlayerReactNorthSouth + goto_if_eq VAR_0x8008, 1, DewfordTown_Hall_EventScript_PlayerReactEast end DewfordTown_Hall_EventScript_PlayerReactNorthSouth:: - compare VAR_FACING, DIR_NORTH - call_if_eq DewfordTown_Hall_EventScript_PlayerWalkInPlaceUp - compare VAR_FACING, DIR_SOUTH - call_if_eq DewfordTown_Hall_EventScript_PlayerWalkInPlaceDown + call_if_eq VAR_FACING, DIR_NORTH, DewfordTown_Hall_EventScript_PlayerWalkInPlaceUp + call_if_eq VAR_FACING, DIR_SOUTH, DewfordTown_Hall_EventScript_PlayerWalkInPlaceDown return DewfordTown_Hall_EventScript_PlayerWalkInPlaceUp:: @@ -239,8 +229,7 @@ DewfordTown_Hall_EventScript_PlayerWalkInPlaceDown:: return DewfordTown_Hall_EventScript_PlayerReactEast:: - compare VAR_FACING, DIR_WEST - goto_if_eq DewfordTown_Hall_EventScript_DontMovePlayer1 + goto_if_eq VAR_FACING, DIR_WEST, DewfordTown_Hall_EventScript_DontMovePlayer1 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFasterLeft waitmovement 0 return @@ -260,8 +249,7 @@ DewfordTown_Hall_EventScript_SludgeBombMan:: goto_if_set FLAG_RECEIVED_TM36, DewfordTown_Hall_EventScript_ReceivedSludgeBomb msgbox DewfordTown_Hall_Text_GiveYouSludgeBomb, MSGBOX_DEFAULT giveitem ITEM_TM36 - compare VAR_RESULT, FALSE - goto_if_eq Common_EventScript_ShowBagIsFull + goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull setflag FLAG_RECEIVED_TM36 release end diff --git a/data/maps/DewfordTown_House2/scripts.inc b/data/maps/DewfordTown_House2/scripts.inc index ae173f151c3a..cb68664aaf69 100644 --- a/data/maps/DewfordTown_House2/scripts.inc +++ b/data/maps/DewfordTown_House2/scripts.inc @@ -7,8 +7,7 @@ DewfordTown_House2_EventScript_Man:: goto_if_set FLAG_RECEIVED_SILK_SCARF, DewfordTown_House2_EventScript_ExplainSilkScarf msgbox DewfordTown_House2_Text_WantYouToHaveSilkScarf, MSGBOX_DEFAULT giveitem ITEM_SILK_SCARF - compare VAR_RESULT, FALSE - goto_if_eq DewfordTown_House2_EventScript_NoRoomForScarf + goto_if_eq VAR_RESULT, FALSE, DewfordTown_House2_EventScript_NoRoomForScarf setflag FLAG_RECEIVED_SILK_SCARF release end diff --git a/data/maps/EverGrandeCity_ChampionsRoom/scripts.inc b/data/maps/EverGrandeCity_ChampionsRoom/scripts.inc index 6b9281ae6da1..103942280894 100644 --- a/data/maps/EverGrandeCity_ChampionsRoom/scripts.inc +++ b/data/maps/EverGrandeCity_ChampionsRoom/scripts.inc @@ -50,24 +50,20 @@ EverGrandeCity_ChampionsRoom_EventScript_Wallace:: EverGrandeCity_ChampionsRoom_EventScript_Defeated:: playse SE_DOOR - setmetatile 6, 1, METATILE_EliteFour_OpenDoorChampion_Frame, 0 - setmetatile 6, 2, METATILE_EliteFour_OpenDoorChampion_Opening, 0 + setmetatile 6, 1, METATILE_EliteFour_OpenDoorChampion_Frame, FALSE + setmetatile 6, 2, METATILE_EliteFour_OpenDoorChampion_Opening, FALSE special DrawWholeMapView msgbox EverGrandeCity_ChampionsRoom_Text_PostBattleSpeech, MSGBOX_DEFAULT closemessage playse SE_DOOR checkplayergender - compare VAR_RESULT, MALE - call_if_eq EverGrandeCity_ChampionsRoom_EventScript_PlayMayMusic - compare VAR_RESULT, FEMALE - call_if_eq EverGrandeCity_ChampionsRoom_EventScript_PlayBrendanMusic + call_if_eq VAR_RESULT, MALE, EverGrandeCity_ChampionsRoom_EventScript_PlayMayMusic + call_if_eq VAR_RESULT, FEMALE, EverGrandeCity_ChampionsRoom_EventScript_PlayBrendanMusic addobject LOCALID_RIVAL call EverGrandeCity_ChampionsRoom_EventScript_RivalApproachPlayer checkplayergender - compare VAR_RESULT, MALE - goto_if_eq EverGrandeCity_ChampionsRoom_EventScript_MayAdvice - compare VAR_RESULT, FEMALE - goto_if_eq EverGrandeCity_ChampionsRoom_EventScript_BrendanAdvice + goto_if_eq VAR_RESULT, MALE, EverGrandeCity_ChampionsRoom_EventScript_MayAdvice + goto_if_eq VAR_RESULT, FEMALE, EverGrandeCity_ChampionsRoom_EventScript_BrendanAdvice end EverGrandeCity_ChampionsRoom_EventScript_PlayMayMusic:: @@ -132,16 +128,14 @@ EverGrandeCity_ChampionsRoom_EventScript_BirchArrivesExitForHoF:: waitmovement 0 msgbox EverGrandeCity_ChampionsRoom_Text_WallaceWaitOutside, MSGBOX_DEFAULT checkplayergender - compare VAR_RESULT, MALE - call_if_eq EverGrandeCity_ChampionsRoom_EventScript_MayCongratulations - compare VAR_RESULT, FEMALE - call_if_eq EverGrandeCity_ChampionsRoom_EventScript_BrendanCongratulations + call_if_eq VAR_RESULT, MALE, EverGrandeCity_ChampionsRoom_EventScript_MayCongratulations + call_if_eq VAR_RESULT, FEMALE, EverGrandeCity_ChampionsRoom_EventScript_BrendanCongratulations closemessage applymovement LOCALID_WALLACE, EverGrandeCity_ChampionsRoom_Movement_WallaceExit applymovement OBJ_EVENT_ID_PLAYER, EverGrandeCity_ChampionsRoom_Movement_PlayerExit waitmovement 0 setflag FLAG_HIDE_PETALBURG_GYM_GREETER - warp MAP_EVER_GRANDE_CITY_HALL_OF_FAME, 255, 7, 16 + warp MAP_EVER_GRANDE_CITY_HALL_OF_FAME, 7, 16 waitstate releaseall end diff --git a/data/maps/EverGrandeCity_DrakesRoom/scripts.inc b/data/maps/EverGrandeCity_DrakesRoom/scripts.inc index 75b16e775055..80b1f568c837 100644 --- a/data/maps/EverGrandeCity_DrakesRoom/scripts.inc +++ b/data/maps/EverGrandeCity_DrakesRoom/scripts.inc @@ -26,8 +26,7 @@ EverGrandeCity_DrakesRoom_EventScript_WalkInCloseDoor:: EverGrandeCity_DrakesRoom_OnLoad: call_if_set FLAG_DEFEATED_ELITE_4_DRAKE, EverGrandeCity_DrakesRoom_EventScript_ResetAdvanceToNextRoom - compare VAR_ELITE_4_STATE, 4 - call_if_eq EverGrandeCity_DrakesRoom_EventScript_CloseDoor + call_if_eq VAR_ELITE_4_STATE, 4, EverGrandeCity_DrakesRoom_EventScript_CloseDoor end EverGrandeCity_DrakesRoom_EventScript_ResetAdvanceToNextRoom:: diff --git a/data/maps/EverGrandeCity_GlaciasRoom/scripts.inc b/data/maps/EverGrandeCity_GlaciasRoom/scripts.inc index 59f4440c458d..b2d556448c82 100644 --- a/data/maps/EverGrandeCity_GlaciasRoom/scripts.inc +++ b/data/maps/EverGrandeCity_GlaciasRoom/scripts.inc @@ -25,8 +25,7 @@ EverGrandeCity_GlaciasRoom_EventScript_WalkInCloseDoor:: EverGrandeCity_GlaciasRoom_OnLoad: call_if_set FLAG_DEFEATED_ELITE_4_GLACIA, EverGrandeCity_GlaciasRoom_EventScript_ResetAdvanceToNextRoom - compare VAR_ELITE_4_STATE, 3 - call_if_eq EverGrandeCity_GlaciasRoom_EventScript_CloseDoor + call_if_eq VAR_ELITE_4_STATE, 3, EverGrandeCity_GlaciasRoom_EventScript_CloseDoor end EverGrandeCity_GlaciasRoom_EventScript_ResetAdvanceToNextRoom:: diff --git a/data/maps/EverGrandeCity_HallOfFame/scripts.inc b/data/maps/EverGrandeCity_HallOfFame/scripts.inc index b494408f1361..92b01af9700a 100644 --- a/data/maps/EverGrandeCity_HallOfFame/scripts.inc +++ b/data/maps/EverGrandeCity_HallOfFame/scripts.inc @@ -46,10 +46,8 @@ EverGrandeCity_HallOfFame_EventScript_EnterHallOfFame:: setvar VAR_TEMP_1, 1 call EverGrandeCity_HallOfFame_EventScript_SetGameClearFlags checkplayergender - compare VAR_RESULT, MALE - goto_if_eq EverGrandeCity_HallOfFame_EventScript_GameClearMale - compare VAR_RESULT, FEMALE - goto_if_eq EverGrandeCity_HallOfFame_EventScript_GameClearFemale + goto_if_eq VAR_RESULT, MALE, EverGrandeCity_HallOfFame_EventScript_GameClearMale + goto_if_eq VAR_RESULT, FEMALE, EverGrandeCity_HallOfFame_EventScript_GameClearFemale end EverGrandeCity_HallOfFame_EventScript_GameClearMale:: diff --git a/data/maps/EverGrandeCity_PhoebesRoom/scripts.inc b/data/maps/EverGrandeCity_PhoebesRoom/scripts.inc index b64f5145a008..ed272eb90198 100644 --- a/data/maps/EverGrandeCity_PhoebesRoom/scripts.inc +++ b/data/maps/EverGrandeCity_PhoebesRoom/scripts.inc @@ -25,8 +25,7 @@ EverGrandeCity_PhoebesRoom_EventScript_WalkInCloseDoor:: EverGrandeCity_PhoebesRoom_OnLoad: call_if_set FLAG_DEFEATED_ELITE_4_PHOEBE, EverGrandeCity_PhoebesRoom_EventScript_ResetAdvanceToNextRoom - compare VAR_ELITE_4_STATE, 2 - call_if_eq EverGrandeCity_PhoebesRoom_EventScript_CloseDoor + call_if_eq VAR_ELITE_4_STATE, 2, EverGrandeCity_PhoebesRoom_EventScript_CloseDoor end EverGrandeCity_PhoebesRoom_EventScript_ResetAdvanceToNextRoom:: diff --git a/data/maps/EverGrandeCity_PokemonCenter_1F/scripts.inc b/data/maps/EverGrandeCity_PokemonCenter_1F/scripts.inc index 1244b82fd258..ec45732e8c31 100644 --- a/data/maps/EverGrandeCity_PokemonCenter_1F/scripts.inc +++ b/data/maps/EverGrandeCity_PokemonCenter_1F/scripts.inc @@ -37,12 +37,9 @@ EverGrandeCity_PokemonCenter_1F_EventScript_Scott:: faceplayer msgbox EverGrandeCity_PokemonCenter_1F_Text_ScottHappyForYou, MSGBOX_DEFAULT closemessage - compare VAR_FACING, DIR_NORTH - call_if_eq EverGrandeCity_PokemonCenter_1F_EventScript_ScottExitNorth - compare VAR_FACING, DIR_EAST - call_if_eq EverGrandeCity_PokemonCenter_1F_EventScript_ScottExit - compare VAR_FACING, DIR_WEST - call_if_eq EverGrandeCity_PokemonCenter_1F_EventScript_ScottExit + call_if_eq VAR_FACING, DIR_NORTH, EverGrandeCity_PokemonCenter_1F_EventScript_ScottExitNorth + call_if_eq VAR_FACING, DIR_EAST, EverGrandeCity_PokemonCenter_1F_EventScript_ScottExit + call_if_eq VAR_FACING, DIR_WEST, EverGrandeCity_PokemonCenter_1F_EventScript_ScottExit addvar VAR_SCOTT_STATE, 1 setflag FLAG_MET_SCOTT_IN_EVERGRANDE playse SE_EXIT diff --git a/data/maps/EverGrandeCity_PokemonLeague_1F/scripts.inc b/data/maps/EverGrandeCity_PokemonLeague_1F/scripts.inc index ac7d4f9b453e..c13e71697586 100644 --- a/data/maps/EverGrandeCity_PokemonLeague_1F/scripts.inc +++ b/data/maps/EverGrandeCity_PokemonLeague_1F/scripts.inc @@ -55,10 +55,8 @@ EverGrandeCity_PokemonLeague_1F_EventScript_DoorGuard:: lockall goto_if_set FLAG_ENTERED_ELITE_FOUR, EverGrandeCity_PokemonLeague_1F_EventScript_GoForth getplayerxy VAR_TEMP_0, VAR_TEMP_1 - compare VAR_TEMP_0, 11 - call_if_ge EverGrandeCity_PokemonLeague_1F_EventScript_PlayerMoveToFrontFromRight - compare VAR_TEMP_0, 8 - call_if_le EverGrandeCity_PokemonLeague_1F_EventScript_PlayerMoveToFrontFromLeft + call_if_ge VAR_TEMP_0, 11, EverGrandeCity_PokemonLeague_1F_EventScript_PlayerMoveToFrontFromRight + call_if_le VAR_TEMP_0, 8, EverGrandeCity_PokemonLeague_1F_EventScript_PlayerMoveToFrontFromLeft message EverGrandeCity_PokemonLeague_1F_Text_MustHaveAllGymBadges waitmessage delay 120 diff --git a/data/maps/EverGrandeCity_SidneysRoom/scripts.inc b/data/maps/EverGrandeCity_SidneysRoom/scripts.inc index 3444d078b166..03b4a4e03b49 100644 --- a/data/maps/EverGrandeCity_SidneysRoom/scripts.inc +++ b/data/maps/EverGrandeCity_SidneysRoom/scripts.inc @@ -12,8 +12,7 @@ EverGrandeCity_SidneysRoom_OnTransition: EverGrandeCity_SidneysRoom_OnLoad: call_if_set FLAG_DEFEATED_ELITE_4_SIDNEY, EverGrandeCity_SidneysRoom_EventScript_ResetAdvanceToNextRoom - compare VAR_ELITE_4_STATE, 1 - call_if_eq EverGrandeCity_SidneysRoom_EventScript_CloseDoor + call_if_eq VAR_ELITE_4_STATE, 1, EverGrandeCity_SidneysRoom_EventScript_CloseDoor end EverGrandeCity_SidneysRoom_EventScript_ResetAdvanceToNextRoom:: diff --git a/data/maps/FallarborTown_BattleTentBattleRoom/scripts.inc b/data/maps/FallarborTown_BattleTentBattleRoom/scripts.inc index 3f51ba3935f3..707995daeb13 100644 --- a/data/maps/FallarborTown_BattleTentBattleRoom/scripts.inc +++ b/data/maps/FallarborTown_BattleTentBattleRoom/scripts.inc @@ -18,10 +18,8 @@ FallarborTown_BattleTentBattleRoom_OnTransition: FallarborTown_BattleTentBattleRoom_EventScript_SetPlayerGfx:: checkplayergender - compare VAR_RESULT, MALE - goto_if_eq FallarborTown_BattleTentBattleRoom_EventScript_SetPlayerGfxMale - compare VAR_RESULT, FEMALE - goto_if_eq FallarborTown_BattleTentBattleRoom_EventScript_SetPlayerGfxFemale + goto_if_eq VAR_RESULT, MALE, FallarborTown_BattleTentBattleRoom_EventScript_SetPlayerGfxMale + goto_if_eq VAR_RESULT, FEMALE, FallarborTown_BattleTentBattleRoom_EventScript_SetPlayerGfxFemale return FallarborTown_BattleTentBattleRoom_EventScript_SetPlayerGfxMale:: @@ -44,8 +42,7 @@ FallarborTown_BattleTentBattleRoom_EventScript_EnterRoom:: applymovement LOCALID_PLAYER, FallarborTown_BattleTentBattleRoom_Movement_PlayerEnter waitmovement 0 frontier_get FRONTIER_DATA_BATTLE_NUM - compare VAR_RESULT, 0 - goto_if_ne FallarborTown_BattleTentBattleRoom_EventScript_ResumeChallenge + goto_if_ne VAR_RESULT, 0, FallarborTown_BattleTentBattleRoom_EventScript_ResumeChallenge FallarborTown_BattleTentBattleRoom_EventScript_NextOpponentEnter:: tower_setopponent addobject LOCALID_OPPONENT @@ -71,7 +68,7 @@ FallarborTown_BattleTentBattleRoom_EventScript_NextOpponentEnter:: FallarborTown_BattleTentBattleRoom_EventScript_WarpToLobbyLost:: frontier_set FRONTIER_DATA_CHALLENGE_STATUS, CHALLENGE_STATUS_LOST special LoadPlayerParty - warp MAP_FALLARBOR_TOWN_BATTLE_TENT_LOBBY, 255, 6, 6 + warp MAP_FALLARBOR_TOWN_BATTLE_TENT_LOBBY, 6, 6 waitstate FallarborTown_BattleTentBattleRoom_EventScript_DefeatedOpponent:: @@ -103,10 +100,8 @@ FallarborTown_BattleTentBattleRoom_EventScript_IncrementBattleNum:: special HealPlayerParty FallarborTown_BattleTentBattleRoom_EventScript_AskContinueChallenge:: frontier_get FRONTIER_DATA_BATTLE_NUM - compare VAR_RESULT, 1 - call_if_eq FallarborTown_BattleTentBattleRoom_EventScript_ReadyFor2ndOpponent - compare VAR_RESULT, 2 - call_if_eq FallarborTown_BattleTentBattleRoom_EventScript_ReadyFor3rdOpponent + call_if_eq VAR_RESULT, 1, FallarborTown_BattleTentBattleRoom_EventScript_ReadyFor2ndOpponent + call_if_eq VAR_RESULT, 2, FallarborTown_BattleTentBattleRoom_EventScript_ReadyFor3rdOpponent multichoice 20, 6, MULTI_GO_ON_REST_RETIRE, TRUE switch VAR_RESULT case 0, FallarborTown_BattleTentBattleRoom_EventScript_ContinueChallenge @@ -142,13 +137,12 @@ FallarborTown_BattleTentBattleRoom_EventScript_WarpToLobbyWon:: delay 60 frontier_set FRONTIER_DATA_CHALLENGE_STATUS, CHALLENGE_STATUS_WON special LoadPlayerParty - warp MAP_FALLARBOR_TOWN_BATTLE_TENT_LOBBY, 255, 6, 6 + warp MAP_FALLARBOR_TOWN_BATTLE_TENT_LOBBY, 6, 6 waitstate @ Unreachable code block? The flow into the next block also doesnt make sense arena_get ARENA_DATA_WIN_STREAK - compare VAR_RESULT, MAX_STREAK - goto_if_eq FallarborTown_BattleTentBattleRoom_EventScript_IncrementBattleNum + goto_if_eq VAR_RESULT, MAX_STREAK, FallarborTown_BattleTentBattleRoom_EventScript_IncrementBattleNum addvar VAR_RESULT, 1 arena_set ARENA_DATA_WIN_STREAK, VAR_RESULT @ See above diff --git a/data/maps/FallarborTown_BattleTentCorridor/scripts.inc b/data/maps/FallarborTown_BattleTentCorridor/scripts.inc index 077cdfe7986c..023dc919f823 100644 --- a/data/maps/FallarborTown_BattleTentCorridor/scripts.inc +++ b/data/maps/FallarborTown_BattleTentCorridor/scripts.inc @@ -22,7 +22,7 @@ FallarborTown_BattleTentCorridor_EventScript_EnterCorridor:: closedoor 2, 1 waitdooranim setvar VAR_0x8006, 0 - warp MAP_FALLARBOR_TOWN_BATTLE_TENT_BATTLE_ROOM, 255, 4, 4 + warp MAP_FALLARBOR_TOWN_BATTLE_TENT_BATTLE_ROOM, 4, 4 waitstate releaseall end diff --git a/data/maps/FallarborTown_BattleTentLobby/scripts.inc b/data/maps/FallarborTown_BattleTentLobby/scripts.inc index 6a2c8713fadd..1bcd04559c8d 100644 --- a/data/maps/FallarborTown_BattleTentLobby/scripts.inc +++ b/data/maps/FallarborTown_BattleTentLobby/scripts.inc @@ -106,8 +106,7 @@ FallarborTown_BattleTentLobby_EventScript_Attendant:: lock faceplayer fallarbortent_getprize - compare VAR_RESULT, ITEM_NONE - goto_if_ne FallarborTown_BattleTentLobby_EventScript_PrizeWaiting + goto_if_ne VAR_RESULT, ITEM_NONE, FallarborTown_BattleTentLobby_EventScript_PrizeWaiting special SavePlayerParty msgbox FallarborTown_BattleTentLobby_Text_WelcomeToBattleTent, MSGBOX_DEFAULT FallarborTown_BattleTentLobby_EventScript_AskEnterChallenge:: @@ -125,8 +124,7 @@ FallarborTown_BattleTentLobby_EventScript_TryEnterChallenge:: setvar VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_SINGLES setvar VAR_RESULT, 2 frontier_checkineligible - compare VAR_0x8004, TRUE - goto_if_eq FallarborTown_BattleTentLobby_EventScript_NotEnoughValidMons + goto_if_eq VAR_0x8004, TRUE, FallarborTown_BattleTentLobby_EventScript_NotEnoughValidMons frontier_set FRONTIER_DATA_LVL_MODE, FRONTIER_LVL_TENT msgbox FallarborTown_BattleTentLobby_Text_SelectThreeMons, MSGBOX_DEFAULT fadescreen FADE_TO_BLACK @@ -134,8 +132,7 @@ FallarborTown_BattleTentLobby_EventScript_TryEnterChallenge:: setvar VAR_0x8005, FRONTIER_PARTY_SIZE special ChoosePartyForBattleFrontier waitstate - compare VAR_RESULT, 0 - goto_if_eq FallarborTown_BattleTentLobby_EventScript_LoadPartyCancelChallenge + goto_if_eq VAR_RESULT, 0, FallarborTown_BattleTentLobby_EventScript_LoadPartyCancelChallenge msgbox FallarborTown_BattleTentLobby_Text_SaveBeforeChallenge, MSGBOX_YESNO switch VAR_RESULT case NO, FallarborTown_BattleTentLobby_EventScript_LoadPartyCancelChallenge @@ -153,15 +150,14 @@ FallarborTown_BattleTentLobby_EventScript_SaveBeforeChallenge:: delay 2 call Common_EventScript_SaveGame setvar VAR_TEMP_0, 255 - compare VAR_RESULT, 0 - goto_if_eq FallarborTown_BattleTentLobby_EventScript_CancelChallengeSaveFailed + goto_if_eq VAR_RESULT, 0, FallarborTown_BattleTentLobby_EventScript_CancelChallengeSaveFailed FallarborTown_BattleTentLobby_EventScript_EnterChallenge:: special SavePlayerParty frontier_setpartyorder FRONTIER_PARTY_SIZE msgbox FallarborTown_BattleTentLobby_Text_GuideYouToBattleTent, MSGBOX_DEFAULT closemessage call FallarborTown_BattleTentLobby_EventScript_WalkToDoor - warp MAP_FALLARBOR_TOWN_BATTLE_TENT_CORRIDOR, 255, 2, 7 + warp MAP_FALLARBOR_TOWN_BATTLE_TENT_CORRIDOR, 2, 7 setvar VAR_TEMP_0, 0 waitstate end diff --git a/data/maps/FallarborTown_CozmosHouse/scripts.inc b/data/maps/FallarborTown_CozmosHouse/scripts.inc index 43a9dca7f304..61f297e69d3b 100644 --- a/data/maps/FallarborTown_CozmosHouse/scripts.inc +++ b/data/maps/FallarborTown_CozmosHouse/scripts.inc @@ -5,9 +5,8 @@ FallarborTown_CozmosHouse_EventScript_ProfCozmo:: lock faceplayer goto_if_set FLAG_RECEIVED_TM27, FallarborTown_CozmosHouse_EventScript_GaveMeteorite - checkitem ITEM_METEORITE, 1 - compare VAR_RESULT, TRUE - goto_if_eq FallarborTown_CozmosHouse_EventScript_PlayerHasMeteorite + checkitem ITEM_METEORITE + goto_if_eq VAR_RESULT, TRUE, FallarborTown_CozmosHouse_EventScript_PlayerHasMeteorite msgbox FallarborTown_CozmosHouse_Text_MeteoriteWillNeverBeMineNow, MSGBOX_DEFAULT release end @@ -15,12 +14,10 @@ FallarborTown_CozmosHouse_EventScript_ProfCozmo:: FallarborTown_CozmosHouse_EventScript_PlayerHasMeteorite:: call_if_unset FLAG_TEMP_2, FallarborTown_CozmosHouse_EventScript_NoticeMeteorite call_if_set FLAG_TEMP_2, FallarborTown_CozmosHouse_EventScript_AskForMeteorite - compare VAR_RESULT, NO - goto_if_eq FallarborTown_CozmosHouse_EventScript_DeclineGiveMeteorite + goto_if_eq VAR_RESULT, NO, FallarborTown_CozmosHouse_EventScript_DeclineGiveMeteorite msgbox FallarborTown_CozmosHouse_Text_PleaseUseThisTM, MSGBOX_DEFAULT giveitem ITEM_TM27 - compare VAR_RESULT, FALSE - goto_if_eq Common_EventScript_ShowBagIsFull + goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull setvar VAR_0x8004, ITEM_METEORITE call Common_EventScript_PlayerHandedOverTheItem setflag FLAG_RECEIVED_TM27 diff --git a/data/maps/FallarborTown_MoveRelearnersHouse/scripts.inc b/data/maps/FallarborTown_MoveRelearnersHouse/scripts.inc index 1bd54b4b8df6..f17754328da2 100644 --- a/data/maps/FallarborTown_MoveRelearnersHouse/scripts.inc +++ b/data/maps/FallarborTown_MoveRelearnersHouse/scripts.inc @@ -14,9 +14,8 @@ FallarborTown_MoveRelearnersHouse_EventScript_MoveRelearner:: end FallarborTown_MoveRelearnersHouse_EventScript_AskTeachMove:: - checkitem ITEM_HEART_SCALE, 1 - compare VAR_RESULT, FALSE - goto_if_eq FallarborTown_MoveRelearnersHouse_EventScript_ComeBackWithHeartScale + checkitem ITEM_HEART_SCALE + goto_if_eq VAR_RESULT, FALSE, FallarborTown_MoveRelearnersHouse_EventScript_ComeBackWithHeartScale msgbox FallarborTown_MoveRelearnersHouse_Text_ThatsAHeartScaleWantMeToTeachMove, MSGBOX_YESNO switch VAR_RESULT case NO, FallarborTown_MoveRelearnersHouse_EventScript_ComeBackWithHeartScale @@ -27,13 +26,10 @@ FallarborTown_MoveRelearnersHouse_EventScript_ChooseMon:: msgbox FallarborTown_MoveRelearnersHouse_Text_TutorWhichMon, MSGBOX_DEFAULT special ChooseMonForMoveRelearner waitstate - compare VAR_0x8004, 255 - goto_if_eq FallarborTown_MoveRelearnersHouse_EventScript_ComeBackWithHeartScale + goto_if_eq VAR_0x8004, PARTY_NOTHING_CHOSEN, FallarborTown_MoveRelearnersHouse_EventScript_ComeBackWithHeartScale special IsSelectedMonEgg - compare VAR_RESULT, TRUE - goto_if_eq FallarborTown_MoveRelearnersHouse_EventScript_CantTeachEgg - compare VAR_0x8005, 0 - goto_if_eq FallarborTown_MoveRelearnersHouse_EventScript_NoMoveToTeachMon + goto_if_eq VAR_RESULT, TRUE, FallarborTown_MoveRelearnersHouse_EventScript_CantTeachEgg + goto_if_eq VAR_0x8005, 0, FallarborTown_MoveRelearnersHouse_EventScript_NoMoveToTeachMon goto FallarborTown_MoveRelearnersHouse_EventScript_ChooseMove end @@ -41,8 +37,7 @@ FallarborTown_MoveRelearnersHouse_EventScript_ChooseMove:: msgbox FallarborTown_MoveRelearnersHouse_Text_TeachWhichMove, MSGBOX_DEFAULT special TeachMoveRelearnerMove waitstate - compare VAR_0x8004, 0 - goto_if_eq FallarborTown_MoveRelearnersHouse_EventScript_ChooseMon + goto_if_eq VAR_0x8004, 0, FallarborTown_MoveRelearnersHouse_EventScript_ChooseMon msgbox FallarborTown_MoveRelearnersHouse_Text_HandedOverHeartScale, MSGBOX_DEFAULT removeitem ITEM_HEART_SCALE goto FallarborTown_MoveRelearnersHouse_EventScript_ComeBackWithHeartScale diff --git a/data/maps/FarawayIsland_Entrance/scripts.inc b/data/maps/FarawayIsland_Entrance/scripts.inc index 15deb95e6f69..504b0dc6a60f 100644 --- a/data/maps/FarawayIsland_Entrance/scripts.inc +++ b/data/maps/FarawayIsland_Entrance/scripts.inc @@ -23,8 +23,7 @@ FarawayIsland_Entrance_EventScript_Sailor:: lock faceplayer msgbox FarawayIsland_Entrance_Text_SailorReturn, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq FarawayIsland_Entrance_EventScript_AsYouLike + goto_if_eq VAR_RESULT, NO, FarawayIsland_Entrance_EventScript_AsYouLike msgbox EventTicket_Text_SailHome, MSGBOX_DEFAULT closemessage applymovement VAR_LAST_TALKED, Common_Movement_WalkInPlaceFasterDown @@ -33,7 +32,7 @@ FarawayIsland_Entrance_EventScript_Sailor:: hideobjectat LOCALID_SAILOR, MAP_FARAWAY_ISLAND_ENTRANCE setvar VAR_0x8004, LOCALID_SS_TIDAL call Common_EventScript_FerryDepartIsland - warp MAP_LILYCOVE_CITY_HARBOR, 255, 8, 11 + warp MAP_LILYCOVE_CITY_HARBOR, 8, 11 waitstate release end diff --git a/data/maps/FarawayIsland_Interior/scripts.inc b/data/maps/FarawayIsland_Interior/scripts.inc index e35825be738b..983b4709a2c3 100644 --- a/data/maps/FarawayIsland_Interior/scripts.inc +++ b/data/maps/FarawayIsland_Interior/scripts.inc @@ -13,14 +13,10 @@ FarawayIsland_Interior_OnReturnToField: FarawayIsland_Interior_EventScript_TrySetMewAboveGrass:: specialvar VAR_RESULT, GetBattleOutcome - compare VAR_RESULT, B_OUTCOME_WON - goto_if_eq FarawayIsland_Interior_EventScript_SetMewAboveGrass - compare VAR_RESULT, B_OUTCOME_RAN - goto_if_eq FarawayIsland_Interior_EventScript_SetMewAboveGrass - compare VAR_RESULT, B_OUTCOME_PLAYER_TELEPORTED - goto_if_eq FarawayIsland_Interior_EventScript_SetMewAboveGrass - compare VAR_RESULT, B_OUTCOME_MON_TELEPORTED - goto_if_eq FarawayIsland_Interior_EventScript_SetMewAboveGrass + goto_if_eq VAR_RESULT, B_OUTCOME_WON, FarawayIsland_Interior_EventScript_SetMewAboveGrass + goto_if_eq VAR_RESULT, B_OUTCOME_RAN, FarawayIsland_Interior_EventScript_SetMewAboveGrass + goto_if_eq VAR_RESULT, B_OUTCOME_PLAYER_TELEPORTED, FarawayIsland_Interior_EventScript_SetMewAboveGrass + goto_if_eq VAR_RESULT, B_OUTCOME_MON_TELEPORTED, FarawayIsland_Interior_EventScript_SetMewAboveGrass return FarawayIsland_Interior_EventScript_SetMewAboveGrass:: @@ -34,8 +30,7 @@ FarawayIsland_Interior_OnResume: FarawayIsland_Interior_EventScript_TryRemoveMew:: specialvar VAR_RESULT, GetBattleOutcome - compare VAR_RESULT, B_OUTCOME_CAUGHT - goto_if_ne Common_EventScript_NopReturn + goto_if_ne VAR_RESULT, B_OUTCOME_CAUGHT, Common_EventScript_NopReturn removeobject VAR_LAST_TALKED return @@ -127,14 +122,10 @@ FarawayIsland_Interior_EventScript_Mew:: message FarawayIsland_Interior_Text_Mew waitse playmoncry SPECIES_MEW, CRY_MODE_ENCOUNTER - compare VAR_FACING, DIR_NORTH - call_if_eq FarawayIsland_Interior_EventScript_FoundMewNorth - compare VAR_FACING, DIR_SOUTH - call_if_eq FarawayIsland_Interior_EventScript_FoundMewSouth - compare VAR_FACING, DIR_WEST - call_if_eq FarawayIsland_Interior_EventScript_FoundMewWest - compare VAR_FACING, DIR_EAST - call_if_eq FarawayIsland_Interior_EventScript_FoundMewEast + call_if_eq VAR_FACING, DIR_NORTH, FarawayIsland_Interior_EventScript_FoundMewNorth + call_if_eq VAR_FACING, DIR_SOUTH, FarawayIsland_Interior_EventScript_FoundMewSouth + call_if_eq VAR_FACING, DIR_WEST, FarawayIsland_Interior_EventScript_FoundMewWest + call_if_eq VAR_FACING, DIR_EAST, FarawayIsland_Interior_EventScript_FoundMewEast special DestroyMewEmergingGrassSprite delay 40 waitmoncry @@ -147,14 +138,10 @@ FarawayIsland_Interior_EventScript_Mew:: waitstate clearflag FLAG_SYS_CTRL_OBJ_DELETE specialvar VAR_RESULT, GetBattleOutcome - compare VAR_RESULT, B_OUTCOME_WON - goto_if_eq FarawayIsland_Interior_EventScript_MewDefeated - compare VAR_RESULT, B_OUTCOME_RAN - goto_if_eq FarawayIsland_Interior_EventScript_PlayerOrMewRan - compare VAR_RESULT, B_OUTCOME_PLAYER_TELEPORTED - goto_if_eq FarawayIsland_Interior_EventScript_PlayerOrMewRan - compare VAR_RESULT, B_OUTCOME_MON_TELEPORTED - goto_if_eq FarawayIsland_Interior_EventScript_PlayerOrMewRan + goto_if_eq VAR_RESULT, B_OUTCOME_WON, FarawayIsland_Interior_EventScript_MewDefeated + goto_if_eq VAR_RESULT, B_OUTCOME_RAN, FarawayIsland_Interior_EventScript_PlayerOrMewRan + goto_if_eq VAR_RESULT, B_OUTCOME_PLAYER_TELEPORTED, FarawayIsland_Interior_EventScript_PlayerOrMewRan + goto_if_eq VAR_RESULT, B_OUTCOME_MON_TELEPORTED, FarawayIsland_Interior_EventScript_PlayerOrMewRan setflag FLAG_CAUGHT_MEW release end diff --git a/data/maps/FortreeCity/scripts.inc b/data/maps/FortreeCity/scripts.inc index 6371d5b0cd27..f1694aaa84c0 100644 --- a/data/maps/FortreeCity/scripts.inc +++ b/data/maps/FortreeCity/scripts.inc @@ -55,17 +55,15 @@ FortreeCity_EventScript_GymSign:: FortreeCity_EventScript_Kecleon:: lock faceplayer - checkitem ITEM_DEVON_SCOPE, 1 - compare VAR_RESULT, TRUE - goto_if_eq FortreeCity_EventScript_AskUseDevonScope + checkitem ITEM_DEVON_SCOPE + goto_if_eq VAR_RESULT, TRUE, FortreeCity_EventScript_AskUseDevonScope msgbox FortreeCity_Text_SomethingUnseeable, MSGBOX_DEFAULT release end FortreeCity_EventScript_AskUseDevonScope:: msgbox FortreeCity_Text_UnseeableUseDevonScope, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq FortreeCity_EventScript_UseDevonScope + goto_if_eq VAR_RESULT, YES, FortreeCity_EventScript_UseDevonScope release end diff --git a/data/maps/FortreeCity_Gym/scripts.inc b/data/maps/FortreeCity_Gym/scripts.inc index caac7247387b..1c729bc44ec9 100644 --- a/data/maps/FortreeCity_Gym/scripts.inc +++ b/data/maps/FortreeCity_Gym/scripts.inc @@ -18,8 +18,7 @@ FortreeCity_Gym_EventScript_InitRotatingGates:: FortreeCity_Gym_EventScript_Winona:: trainerbattle_single TRAINER_WINONA_1, FortreeCity_Gym_Text_WinonaIntro, FortreeCity_Gym_Text_WinonaDefeat, FortreeCity_Gym_EventScript_WinonaDefeated, NO_MUSIC specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq FortreeCity_Gym_EventScript_WinonaRematch + goto_if_eq VAR_RESULT, TRUE, FortreeCity_Gym_EventScript_WinonaRematch goto_if_unset FLAG_RECEIVED_TM40, FortreeCity_Gym_EventScript_GiveAerialAce2 msgbox FortreeCity_Gym_Text_WinonaPostBattle, MSGBOX_DEFAULT release @@ -50,8 +49,7 @@ FortreeCity_Gym_EventScript_WinonaDefeated:: FortreeCity_Gym_EventScript_GiveAerialAce2:: giveitem ITEM_TM40 - compare VAR_RESULT, FALSE - goto_if_eq Common_EventScript_ShowBagIsFull + goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull msgbox FortreeCity_Gym_Text_ExplainAerialAce, MSGBOX_DEFAULT setflag FLAG_RECEIVED_TM40 release @@ -59,8 +57,7 @@ FortreeCity_Gym_EventScript_GiveAerialAce2:: FortreeCity_Gym_EventScript_GiveAerialAce:: giveitem ITEM_TM40 - compare VAR_RESULT, FALSE - goto_if_eq Common_EventScript_BagIsFull + goto_if_eq VAR_RESULT, FALSE, Common_EventScript_BagIsFull msgbox FortreeCity_Gym_Text_ExplainAerialAce, MSGBOX_DEFAULT setflag FLAG_RECEIVED_TM40 return diff --git a/data/maps/FortreeCity_House1/scripts.inc b/data/maps/FortreeCity_House1/scripts.inc index e25334ee9aa9..a072f561065c 100644 --- a/data/maps/FortreeCity_House1/scripts.inc +++ b/data/maps/FortreeCity_House1/scripts.inc @@ -10,24 +10,21 @@ FortreeCity_House1_EventScript_Trader:: specialvar VAR_RESULT, GetInGameTradeSpeciesInfo copyvar VAR_0x8009, VAR_RESULT msgbox FortreeCity_House1_Text_YouWillTradeWontYou, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq FortreeCity_House1_EventScript_DeclineTrade + goto_if_eq VAR_RESULT, NO, FortreeCity_House1_EventScript_DeclineTrade special ChoosePartyMon waitstate copyvar VAR_0x800A, VAR_0x8004 - compare VAR_0x8004, 255 - goto_if_eq FortreeCity_House1_EventScript_DeclineTrade + goto_if_eq VAR_0x8004, PARTY_NOTHING_CHOSEN, FortreeCity_House1_EventScript_DeclineTrade copyvar VAR_0x8005, VAR_0x800A specialvar VAR_RESULT, GetTradeSpecies copyvar VAR_0x800B, VAR_RESULT - compare VAR_RESULT, VAR_0x8009 - goto_if_ne FortreeCity_House1_EventScript_NotRequestedMon + goto_if_ne VAR_RESULT, VAR_0x8009, FortreeCity_House1_EventScript_NotRequestedMon copyvar VAR_0x8004, VAR_0x8008 copyvar VAR_0x8005, VAR_0x800A special CreateInGameTradePokemon special DoInGameTradeScene waitstate - bufferspeciesname 0, VAR_0x8009 + bufferspeciesname STR_VAR_1, VAR_0x8009 msgbox FortreeCity_House1_Text_MonYouTakeCare, MSGBOX_DEFAULT setflag FLAG_FORTREE_NPC_TRADE_COMPLETED release @@ -39,7 +36,7 @@ FortreeCity_House1_EventScript_DeclineTrade:: end FortreeCity_House1_EventScript_NotRequestedMon:: - bufferspeciesname 0, VAR_0x8009 + bufferspeciesname STR_VAR_1, VAR_0x8009 msgbox FortreeCity_House1_Text_ThisIsntAMon, MSGBOX_DEFAULT release end diff --git a/data/maps/FortreeCity_House2/scripts.inc b/data/maps/FortreeCity_House2/scripts.inc index 29e9ea93cfe7..cdd0fc99f71d 100644 --- a/data/maps/FortreeCity_House2/scripts.inc +++ b/data/maps/FortreeCity_House2/scripts.inc @@ -20,8 +20,7 @@ FortreeCity_House2_EventScript_HiddenPowerGiver:: case 0, FortreeCity_House2_EventScript_WrongGuess msgbox FortreeCity_House2_Text_YourHiddenPowerHasAwoken, MSGBOX_DEFAULT giveitem ITEM_TM10 - compare VAR_RESULT, 0 - goto_if_eq Common_EventScript_ShowBagIsFull + goto_if_eq VAR_RESULT, 0, Common_EventScript_ShowBagIsFull setflag FLAG_RECEIVED_TM10 msgbox FortreeCity_House2_Text_ExplainHiddenPower, MSGBOX_DEFAULT release diff --git a/data/maps/FortreeCity_House4/scripts.inc b/data/maps/FortreeCity_House4/scripts.inc index c416cf147559..ed9167417376 100644 --- a/data/maps/FortreeCity_House4/scripts.inc +++ b/data/maps/FortreeCity_House4/scripts.inc @@ -34,8 +34,7 @@ FortreeCity_House4_EventScript_WingullReturned:: waitmovement 0 msgbox FortreeCity_House4_Text_WelcomeWingullTakeMentalHerb, MSGBOX_DEFAULT giveitem ITEM_MENTAL_HERB - compare VAR_RESULT, FALSE - goto_if_eq Common_EventScript_ShowBagIsFull + goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull setflag FLAG_RECEIVED_MENTAL_HERB releaseall end diff --git a/data/maps/GraniteCave_B1F/scripts.inc b/data/maps/GraniteCave_B1F/scripts.inc index f1b52ce6626a..24519aef6568 100644 --- a/data/maps/GraniteCave_B1F/scripts.inc +++ b/data/maps/GraniteCave_B1F/scripts.inc @@ -6,6 +6,6 @@ GraniteCave_B1F_MapScripts:: GraniteCave_B1F_SetHoleWarp: setstepcallback STEP_CB_CRACKED_FLOOR - setholewarp MAP_GRANITE_CAVE_B2F, 255, 0, 0 + setholewarp MAP_GRANITE_CAVE_B2F end diff --git a/data/maps/GraniteCave_StevensRoom/scripts.inc b/data/maps/GraniteCave_StevensRoom/scripts.inc index b57eb0de6d32..384e648ee262 100644 --- a/data/maps/GraniteCave_StevensRoom/scripts.inc +++ b/data/maps/GraniteCave_StevensRoom/scripts.inc @@ -12,8 +12,7 @@ GraniteCave_StevensRoom_EventScript_Steven:: setflag FLAG_DELIVERED_STEVEN_LETTER msgbox GraniteCave_StevensRoom_Text_ThankYouTakeThis, MSGBOX_DEFAULT giveitem ITEM_TM47 - compare VAR_RESULT, FALSE - call_if_eq GraniteCave_StevensRoom_EventScript_BagFull + call_if_eq VAR_RESULT, FALSE, GraniteCave_StevensRoom_EventScript_BagFull msgbox GraniteCave_StevensRoom_Text_CouldBecomeChampionLetsRegister, MSGBOX_DEFAULT closemessage delay 30 @@ -25,14 +24,10 @@ GraniteCave_StevensRoom_EventScript_Steven:: setflag FLAG_REGISTERED_STEVEN_POKENAV msgbox GraniteCave_StevensRoom_Text_IveGotToHurryAlong, MSGBOX_DEFAULT closemessage - compare VAR_FACING, DIR_NORTH - call_if_eq GraniteCave_StevensRoom_EventScript_StevenExitNorth - compare VAR_FACING, DIR_SOUTH - call_if_eq GraniteCave_StevensRoom_EventScript_StevenExitSouth - compare VAR_FACING, DIR_WEST - call_if_eq GraniteCave_StevensRoom_EventScript_StevenExitWestEast - compare VAR_FACING, DIR_EAST - call_if_eq GraniteCave_StevensRoom_EventScript_StevenExitWestEast + call_if_eq VAR_FACING, DIR_NORTH, GraniteCave_StevensRoom_EventScript_StevenExitNorth + call_if_eq VAR_FACING, DIR_SOUTH, GraniteCave_StevensRoom_EventScript_StevenExitSouth + call_if_eq VAR_FACING, DIR_WEST, GraniteCave_StevensRoom_EventScript_StevenExitWestEast + call_if_eq VAR_FACING, DIR_EAST, GraniteCave_StevensRoom_EventScript_StevenExitWestEast playse SE_EXIT removeobject LOCALID_STEVEN release diff --git a/data/maps/InsideOfTruck/scripts.inc b/data/maps/InsideOfTruck/scripts.inc index 3068b11841c5..c59d5a97bea1 100644 --- a/data/maps/InsideOfTruck/scripts.inc +++ b/data/maps/InsideOfTruck/scripts.inc @@ -4,9 +4,9 @@ InsideOfTruck_MapScripts:: .byte 0 InsideOfTruck_OnLoad: - setmetatile 4, 1, METATILE_InsideOfTruck_ExitLight_Top, 0 - setmetatile 4, 2, METATILE_InsideOfTruck_ExitLight_Mid, 0 - setmetatile 4, 3, METATILE_InsideOfTruck_ExitLight_Bottom, 0 + setmetatile 4, 1, METATILE_InsideOfTruck_ExitLight_Top, FALSE + setmetatile 4, 2, METATILE_InsideOfTruck_ExitLight_Mid, FALSE + setmetatile 4, 3, METATILE_InsideOfTruck_ExitLight_Bottom, FALSE end InsideOfTruck_OnResume: @@ -17,10 +17,8 @@ InsideOfTruck_EventScript_SetIntroFlags:: lockall setflag FLAG_HIDE_MAP_NAME_POPUP checkplayergender - compare VAR_RESULT, MALE - goto_if_eq InsideOfTruck_EventScript_SetIntroFlagsMale - compare VAR_RESULT, FEMALE - goto_if_eq InsideOfTruck_EventScript_SetIntroFlagsFemale + goto_if_eq VAR_RESULT, MALE, InsideOfTruck_EventScript_SetIntroFlagsMale + goto_if_eq VAR_RESULT, FEMALE, InsideOfTruck_EventScript_SetIntroFlagsFemale end InsideOfTruck_EventScript_SetIntroFlagsMale:: @@ -32,7 +30,7 @@ InsideOfTruck_EventScript_SetIntroFlagsMale:: setflag FLAG_HIDE_LITTLEROOT_TOWN_BRENDANS_HOUSE_RIVAL_SIBLING setflag FLAG_HIDE_LITTLEROOT_TOWN_BRENDANS_HOUSE_2F_POKE_BALL setvar VAR_LITTLEROOT_HOUSES_STATE_BRENDAN, 1 - setdynamicwarp MAP_LITTLEROOT_TOWN, 255, 3, 10 + setdynamicwarp MAP_LITTLEROOT_TOWN, 3, 10 releaseall end @@ -45,7 +43,7 @@ InsideOfTruck_EventScript_SetIntroFlagsFemale:: setflag FLAG_HIDE_LITTLEROOT_TOWN_MAYS_HOUSE_RIVAL_SIBLING setflag FLAG_HIDE_LITTLEROOT_TOWN_MAYS_HOUSE_2F_POKE_BALL setvar VAR_LITTLEROOT_HOUSES_STATE_MAY, 1 - setdynamicwarp MAP_LITTLEROOT_TOWN, 255, 12, 10 + setdynamicwarp MAP_LITTLEROOT_TOWN, 12, 10 releaseall end diff --git a/data/maps/IslandCave/scripts.inc b/data/maps/IslandCave/scripts.inc index d660aadf0667..8f8236a5c030 100644 --- a/data/maps/IslandCave/scripts.inc +++ b/data/maps/IslandCave/scripts.inc @@ -10,8 +10,7 @@ IslandCave_OnResume: IslandCave_EventScript_TryRemoveRegice:: specialvar VAR_RESULT, GetBattleOutcome - compare VAR_RESULT, B_OUTCOME_CAUGHT - goto_if_ne Common_EventScript_NopReturn + goto_if_ne VAR_RESULT, B_OUTCOME_CAUGHT, Common_EventScript_NopReturn removeobject VAR_LAST_TALKED return @@ -20,12 +19,12 @@ IslandCave_OnLoad: end IslandCave_EventScript_HideRegiEntrance:: - setmetatile 7, 19, METATILE_Cave_EntranceCover, 1 - setmetatile 8, 19, METATILE_Cave_EntranceCover, 1 - setmetatile 9, 19, METATILE_Cave_EntranceCover, 1 - setmetatile 7, 20, METATILE_Cave_SealedChamberBraille_Mid, 1 - setmetatile 8, 20, METATILE_Cave_SealedChamberBraille_Mid, 1 - setmetatile 9, 20, METATILE_Cave_SealedChamberBraille_Mid, 1 + setmetatile 7, 19, METATILE_Cave_EntranceCover, TRUE + setmetatile 8, 19, METATILE_Cave_EntranceCover, TRUE + setmetatile 9, 19, METATILE_Cave_EntranceCover, TRUE + setmetatile 7, 20, METATILE_Cave_SealedChamberBraille_Mid, TRUE + setmetatile 8, 20, METATILE_Cave_SealedChamberBraille_Mid, TRUE + setmetatile 9, 20, METATILE_Cave_SealedChamberBraille_Mid, TRUE return IslandCave_OnTransition: @@ -39,12 +38,12 @@ IslandCave_EventScript_ShowRegice:: return IslandCave_EventScript_OpenRegiEntrance:: - setmetatile 7, 19, METATILE_Cave_SealedChamberEntrance_TopLeft, 1 - setmetatile 8, 19, METATILE_Cave_SealedChamberEntrance_TopMid, 1 - setmetatile 9, 19, METATILE_Cave_SealedChamberEntrance_TopRight, 1 - setmetatile 7, 20, METATILE_Cave_SealedChamberEntrance_BottomLeft, 1 - setmetatile 8, 20, METATILE_Cave_SealedChamberEntrance_BottomMid, 0 - setmetatile 9, 20, METATILE_Cave_SealedChamberEntrance_BottomRight, 1 + setmetatile 7, 19, METATILE_Cave_SealedChamberEntrance_TopLeft, TRUE + setmetatile 8, 19, METATILE_Cave_SealedChamberEntrance_TopMid, TRUE + setmetatile 9, 19, METATILE_Cave_SealedChamberEntrance_TopRight, TRUE + setmetatile 7, 20, METATILE_Cave_SealedChamberEntrance_BottomLeft, TRUE + setmetatile 8, 20, METATILE_Cave_SealedChamberEntrance_BottomMid, FALSE + setmetatile 9, 20, METATILE_Cave_SealedChamberEntrance_BottomRight, TRUE special DrawWholeMapView playse SE_BANG setflag FLAG_SYS_BRAILLE_REGICE_COMPLETED @@ -101,12 +100,9 @@ IslandCave_EventScript_Regice:: waitstate clearflag FLAG_SYS_CTRL_OBJ_DELETE specialvar VAR_RESULT, GetBattleOutcome - compare VAR_RESULT, B_OUTCOME_WON - goto_if_eq IslandCave_EventScript_DefeatedRegice - compare VAR_RESULT, B_OUTCOME_RAN - goto_if_eq IslandCave_EventScript_RanFromRegice - compare VAR_RESULT, B_OUTCOME_PLAYER_TELEPORTED - goto_if_eq IslandCave_EventScript_RanFromRegice + goto_if_eq VAR_RESULT, B_OUTCOME_WON, IslandCave_EventScript_DefeatedRegice + goto_if_eq VAR_RESULT, B_OUTCOME_RAN, IslandCave_EventScript_RanFromRegice + goto_if_eq VAR_RESULT, B_OUTCOME_PLAYER_TELEPORTED, IslandCave_EventScript_RanFromRegice setflag FLAG_DEFEATED_REGICE release end diff --git a/data/maps/JaggedPass/scripts.inc b/data/maps/JaggedPass/scripts.inc index 754ee00cf5bb..f969a4dec60d 100644 --- a/data/maps/JaggedPass/scripts.inc +++ b/data/maps/JaggedPass/scripts.inc @@ -8,14 +8,12 @@ JaggedPass_MapScripts:: JaggedPass_OnResume: setstepcallback STEP_CB_ASH - compare VAR_JAGGED_PASS_STATE, 0 - call_if_eq JaggedPass_EventScript_CheckHasMagmaEmblem + call_if_eq VAR_JAGGED_PASS_STATE, 0, JaggedPass_EventScript_CheckHasMagmaEmblem end JaggedPass_EventScript_CheckHasMagmaEmblem:: - checkitem ITEM_MAGMA_EMBLEM, 1 - compare VAR_RESULT, TRUE - goto_if_eq JaggedPass_EventScript_SetReadyToOpenHideout + checkitem ITEM_MAGMA_EMBLEM + goto_if_eq VAR_RESULT, TRUE, JaggedPass_EventScript_SetReadyToOpenHideout return JaggedPass_EventScript_SetReadyToOpenHideout:: @@ -23,8 +21,7 @@ JaggedPass_EventScript_SetReadyToOpenHideout:: return JaggedPass_OnTransition: - compare VAR_JAGGED_PASS_ASH_WEATHER, 1 - call_if_eq JaggedPass_EventScript_SetWeatherAsh + call_if_eq VAR_JAGGED_PASS_ASH_WEATHER, 1, JaggedPass_EventScript_SetWeatherAsh end JaggedPass_EventScript_SetWeatherAsh:: @@ -33,13 +30,12 @@ JaggedPass_EventScript_SetWeatherAsh:: return JaggedPass_OnLoad: - compare VAR_JAGGED_PASS_STATE, 1 - goto_if_le JaggedPass_EventScript_ConcealHideoutEntrance + goto_if_le VAR_JAGGED_PASS_STATE, 1, JaggedPass_EventScript_ConcealHideoutEntrance end JaggedPass_EventScript_ConcealHideoutEntrance:: - setmetatile 16, 17, METATILE_Lavaridge_RockWall, 1 - setmetatile 16, 18, METATILE_Lavaridge_RockWall, 1 + setmetatile 16, 17, METATILE_Lavaridge_RockWall, TRUE + setmetatile 16, 18, METATILE_Lavaridge_RockWall, TRUE end JaggedPass_EventScript_OpenMagmaHideout:: @@ -59,8 +55,8 @@ JaggedPass_EventScript_OpenMagmaHideout:: special ShakeCamera waitstate playse SE_EFFECTIVE - setmetatile 16, 17, METATILE_Lavaridge_CaveEntrance_Top, 1 - setmetatile 16, 18, METATILE_Lavaridge_CaveEntrance_Bottom, 0 + setmetatile 16, 17, METATILE_Lavaridge_CaveEntrance_Top, TRUE + setmetatile 16, 18, METATILE_Lavaridge_CaveEntrance_Bottom, FALSE special DrawWholeMapView delay 30 setvar VAR_JAGGED_PASS_STATE, 2 @@ -106,8 +102,7 @@ JaggedPass_EventScript_Eric:: JaggedPass_EventScript_Diana:: trainerbattle_single TRAINER_DIANA_1, JaggedPass_Text_DianaIntro, JaggedPass_Text_DianaDefeat, JaggedPass_EventScript_RegisterDiana specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq JaggedPass_EventScript_DianaRematch + goto_if_eq VAR_RESULT, TRUE, JaggedPass_EventScript_DianaRematch msgbox JaggedPass_Text_DianaPostBattle, MSGBOX_DEFAULT release end @@ -127,8 +122,7 @@ JaggedPass_EventScript_DianaRematch:: JaggedPass_EventScript_Ethan:: trainerbattle_single TRAINER_ETHAN_1, JaggedPass_Text_EthanIntro, JaggedPass_Text_EthanDefeat, JaggedPass_EventScript_RegisterEthan specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq JaggedPass_EventScript_EthanRematch + goto_if_eq VAR_RESULT, TRUE, JaggedPass_EventScript_EthanRematch msgbox JaggedPass_Text_EthanPostBattle, MSGBOX_DEFAULT release end diff --git a/data/maps/LavaridgeTown/scripts.inc b/data/maps/LavaridgeTown/scripts.inc index 2b7f8f331fd8..3ce226c4c135 100644 --- a/data/maps/LavaridgeTown/scripts.inc +++ b/data/maps/LavaridgeTown/scripts.inc @@ -12,10 +12,8 @@ LavaridgeTown_OnTransition: call_if_set FLAG_DEFEATED_EVIL_TEAM_MT_CHIMNEY, LavaridgeTown_EventScript_ShowMtChimneyTrainers call Common_EventScript_SetupRivalGfxId call Common_EventScript_SetupRivalOnBikeGfxId - compare VAR_LAVARIDGE_TOWN_STATE, 1 - call_if_eq LavaridgeTown_EventScript_CheckSetRivalPos - compare VAR_LAVARIDGE_TOWN_STATE, 1 - call_if_eq LavaridgeTown_EventScript_HideMapNamePopup + call_if_eq VAR_LAVARIDGE_TOWN_STATE, 1, LavaridgeTown_EventScript_CheckSetRivalPos + call_if_eq VAR_LAVARIDGE_TOWN_STATE, 1, LavaridgeTown_EventScript_HideMapNamePopup end LavaridgeTown_EventScript_ClearLavaridgeWhiteOut:: @@ -24,8 +22,7 @@ LavaridgeTown_EventScript_ClearLavaridgeWhiteOut:: LavaridgeTown_EventScript_CheckSetRivalPos:: getplayerxy VAR_0x8004, VAR_0x8005 - compare VAR_0x8004, 9 - goto_if_eq LavaridgeTown_EventScript_SetRivalPos + goto_if_eq VAR_0x8004, 9, LavaridgeTown_EventScript_SetRivalPos return LavaridgeTown_EventScript_SetRivalPos:: @@ -50,25 +47,17 @@ LavaridgeTown_OnFrame: LavaridgeTown_EventScript_RivalGiveGoGoggles:: lockall getplayerxy VAR_0x8008, VAR_0x8009 - compare VAR_0x8008, 9 - call_if_eq LavaridgeTown_EventScript_RivalNoticePlayer - compare VAR_0x8008, 9 - call_if_ne LavaridgeTown_EventScript_RivalExitHerbShop + call_if_eq VAR_0x8008, 9, LavaridgeTown_EventScript_RivalNoticePlayer + call_if_ne VAR_0x8008, 9, LavaridgeTown_EventScript_RivalExitHerbShop delay 20 checkplayergender - compare VAR_RESULT, MALE - call_if_eq LavaridgeTown_EventScript_PlayMayMusic - compare VAR_RESULT, FEMALE - call_if_eq LavaridgeTown_EventScript_PlayBrendanMusic - compare VAR_0x8008, 9 - call_if_eq LavaridgeTown_EventScript_RivalApproachPlayer1 - compare VAR_0x8008, 9 - call_if_ne LavaridgeTown_EventScript_RivalApproachPlayer2 + call_if_eq VAR_RESULT, MALE, LavaridgeTown_EventScript_PlayMayMusic + call_if_eq VAR_RESULT, FEMALE, LavaridgeTown_EventScript_PlayBrendanMusic + call_if_eq VAR_0x8008, 9, LavaridgeTown_EventScript_RivalApproachPlayer1 + call_if_ne VAR_0x8008, 9, LavaridgeTown_EventScript_RivalApproachPlayer2 checkplayergender - compare VAR_RESULT, MALE - goto_if_eq LavaridgeTown_EventScript_MayGiveGoGoggles - compare VAR_RESULT, FEMALE - goto_if_eq LavaridgeTown_EventScript_BrendanGiveGoGoggles + goto_if_eq VAR_RESULT, MALE, LavaridgeTown_EventScript_MayGiveGoGoggles + goto_if_eq VAR_RESULT, FEMALE, LavaridgeTown_EventScript_BrendanGiveGoGoggles end LavaridgeTown_EventScript_MayGiveGoGoggles:: @@ -92,10 +81,8 @@ LavaridgeTown_EventScript_RivalExit:: removeobject LOCALID_RIVAL addobject LOCALID_RIVAL_ON_BIKE delay 30 - compare VAR_0x8008, 9 - call_if_eq LavaridgeTown_EventScript_RivalExit1 - compare VAR_0x8008, 9 - call_if_ne LavaridgeTown_EventScript_RivalExit2 + call_if_eq VAR_0x8008, 9, LavaridgeTown_EventScript_RivalExit1 + call_if_ne VAR_0x8008, 9, LavaridgeTown_EventScript_RivalExit2 removeobject LOCALID_RIVAL_ON_BIKE setvar VAR_LAVARIDGE_TOWN_STATE, 2 clearflag FLAG_HIDE_MAP_NAME_POPUP @@ -214,8 +201,7 @@ LavaridgeTown_Movement_RivalExitHerbShop: LavaridgeTown_EventScript_HotSpringsTrigger:: specialvar VAR_RESULT, GetPlayerFacingDirection - compare VAR_RESULT, DIR_SOUTH - goto_if_eq LavaridgeTown_EventScript_EnteredHotSprings + goto_if_eq VAR_RESULT, DIR_SOUTH, LavaridgeTown_EventScript_EnteredHotSprings end LavaridgeTown_EventScript_EnteredHotSprings:: @@ -251,11 +237,9 @@ LavaridgeTown_EventScript_EggWoman:: faceplayer goto_if_set FLAG_RECEIVED_LAVARIDGE_EGG, LavaridgeTown_EventScript_ReceivedEgg msgbox LavaridgeTown_Text_HaveEggWillYouTakeIt, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq LavaridgeTown_EventScript_DeclineEgg + goto_if_eq VAR_RESULT, NO, LavaridgeTown_EventScript_DeclineEgg getpartysize - compare VAR_RESULT, PARTY_SIZE - goto_if_eq LavaridgeTown_EventScript_NoRoomForEgg + goto_if_eq VAR_RESULT, PARTY_SIZE, LavaridgeTown_EventScript_NoRoomForEgg msgbox LavaridgeTown_Text_HopeYoullWalkPlentyWithEgg, MSGBOX_DEFAULT setflag FLAG_RECEIVED_LAVARIDGE_EGG playfanfare MUS_OBTAIN_ITEM diff --git a/data/maps/LavaridgeTown_Gym_1F/scripts.inc b/data/maps/LavaridgeTown_Gym_1F/scripts.inc index 608f32e24c39..6628360c1505 100644 --- a/data/maps/LavaridgeTown_Gym_1F/scripts.inc +++ b/data/maps/LavaridgeTown_Gym_1F/scripts.inc @@ -51,8 +51,7 @@ LavaridgeTown_Gym_1F_EventScript_EndCheckBuryTrainers:: LavaridgeTown_Gym_1F_EventScript_Flannery:: trainerbattle_single TRAINER_FLANNERY_1, LavaridgeTown_Gym_1F_Text_FlanneryIntro, LavaridgeTown_Gym_1F_Text_FlanneryDefeat, LavaridgeTown_Gym_1F_EventScript_FlanneryDefeated, NO_MUSIC specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq LavaridgeTown_Gym_1F_EventScript_FlanneryRematch + goto_if_eq VAR_RESULT, TRUE, LavaridgeTown_Gym_1F_EventScript_FlanneryRematch goto_if_unset FLAG_RECEIVED_TM50, LavaridgeTown_Gym_1F_EventScript_GiveOverheat2 msgbox LavaridgeTown_Gym_1F_Text_FlanneryPostBattle, MSGBOX_DEFAULT release @@ -67,8 +66,7 @@ LavaridgeTown_Gym_1F_EventScript_FlanneryDefeated:: setflag FLAG_DEFEATED_LAVARIDGE_GYM setflag FLAG_BADGE04_GET addvar VAR_PETALBURG_GYM_STATE, 1 - compare VAR_PETALBURG_GYM_STATE, 6 - call_if_eq Common_EventScript_ReadyPetalburgGymForBattle + call_if_eq VAR_PETALBURG_GYM_STATE, 6, Common_EventScript_ReadyPetalburgGymForBattle setvar VAR_0x8008, 4 call Common_EventScript_SetGymTrainers setflag FLAG_HIDE_VERDANTURF_TOWN_WANDAS_HOUSE_WALLY @@ -87,8 +85,7 @@ LavaridgeTown_Gym_1F_EventScript_FlanneryDefeated:: LavaridgeTown_Gym_1F_EventScript_GiveOverheat2:: giveitem ITEM_TM50 - compare VAR_RESULT, FALSE - goto_if_eq Common_EventScript_ShowBagIsFull + goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull msgbox LavaridgeTown_Gym_1F_Text_ExplainOverheat, MSGBOX_DEFAULT setflag FLAG_RECEIVED_TM50 release @@ -96,8 +93,7 @@ LavaridgeTown_Gym_1F_EventScript_GiveOverheat2:: LavaridgeTown_Gym_1F_EventScript_GiveOverheat:: giveitem ITEM_TM50 - compare VAR_RESULT, FALSE - goto_if_eq Common_EventScript_BagIsFull + goto_if_eq VAR_RESULT, FALSE, Common_EventScript_BagIsFull msgbox LavaridgeTown_Gym_1F_Text_ExplainOverheat, MSGBOX_DEFAULT setflag FLAG_RECEIVED_TM50 return @@ -116,8 +112,7 @@ LavaridgeTown_Gym_EventScript_CheckTrainerScript:: call LavaridgeTown_Gym_1F_EventScript_SetTrainerTempVars release special ShouldTryGetTrainerScript - compare VAR_RESULT, 1 - goto_if_eq EventScript_GotoTrainerScript + goto_if_eq VAR_RESULT, 1, EventScript_GotoTrainerScript end LavaridgeTown_Gym_1F_EventScript_Axle:: diff --git a/data/maps/LavaridgeTown_HerbShop/scripts.inc b/data/maps/LavaridgeTown_HerbShop/scripts.inc index 2637f5c09d73..dbe1b564aca4 100644 --- a/data/maps/LavaridgeTown_HerbShop/scripts.inc +++ b/data/maps/LavaridgeTown_HerbShop/scripts.inc @@ -31,8 +31,7 @@ LavaridgeTown_HerbShop_EventScript_OldMan:: goto_if_set FLAG_RECEIVED_CHARCOAL, LavaridgeTown_HerbShop_EventScript_ExplainCharcoal msgbox LavaridgeTown_HerbShop_Text_YouveComeToLookAtHerbalMedicine, MSGBOX_DEFAULT giveitem ITEM_CHARCOAL - compare VAR_RESULT, FALSE - goto_if_eq Common_EventScript_ShowBagIsFull + goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull setflag FLAG_RECEIVED_CHARCOAL release end diff --git a/data/maps/LilycoveCity/scripts.inc b/data/maps/LilycoveCity/scripts.inc index eb3f140a86dc..094592d64662 100644 --- a/data/maps/LilycoveCity/scripts.inc +++ b/data/maps/LilycoveCity/scripts.inc @@ -19,18 +19,18 @@ LilycoveCity_OnLoad: end LilycoveCity_EventScript_SetWailmerMetatiles:: - setmetatile 76, 12, METATILE_Lilycove_Wailmer0, 1 - setmetatile 77, 12, METATILE_Lilycove_Wailmer1, 1 - setmetatile 76, 13, METATILE_Lilycove_Wailmer2, 1 - setmetatile 77, 13, METATILE_Lilycove_Wailmer3, 1 - setmetatile 76, 14, METATILE_Lilycove_Wailmer0_Alt, 1 - setmetatile 77, 14, METATILE_Lilycove_Wailmer1_Alt, 1 - setmetatile 76, 15, METATILE_Lilycove_Wailmer2, 1 - setmetatile 77, 15, METATILE_Lilycove_Wailmer3, 1 - setmetatile 77, 16, METATILE_Lilycove_Wailmer0_Alt, 1 - setmetatile 78, 16, METATILE_Lilycove_Wailmer1_Alt, 1 - setmetatile 77, 17, METATILE_Lilycove_Wailmer2, 1 - setmetatile 78, 17, METATILE_Lilycove_Wailmer3, 1 + setmetatile 76, 12, METATILE_Lilycove_Wailmer0, TRUE + setmetatile 77, 12, METATILE_Lilycove_Wailmer1, TRUE + setmetatile 76, 13, METATILE_Lilycove_Wailmer2, TRUE + setmetatile 77, 13, METATILE_Lilycove_Wailmer3, TRUE + setmetatile 76, 14, METATILE_Lilycove_Wailmer0_Alt, TRUE + setmetatile 77, 14, METATILE_Lilycove_Wailmer1_Alt, TRUE + setmetatile 76, 15, METATILE_Lilycove_Wailmer2, TRUE + setmetatile 77, 15, METATILE_Lilycove_Wailmer3, TRUE + setmetatile 77, 16, METATILE_Lilycove_Wailmer0_Alt, TRUE + setmetatile 78, 16, METATILE_Lilycove_Wailmer1_Alt, TRUE + setmetatile 77, 17, METATILE_Lilycove_Wailmer2, TRUE + setmetatile 78, 17, METATILE_Lilycove_Wailmer3, TRUE return LilycoveCity_EventScript_BerryGentleman:: @@ -42,8 +42,7 @@ LilycoveCity_EventScript_BerryGentleman:: random 10 addvar VAR_RESULT, FIRST_BERRY_INDEX giveitem VAR_RESULT - compare VAR_RESULT, FALSE - goto_if_eq Common_EventScript_ShowBagIsFull + goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull setflag FLAG_DAILY_LILYCOVE_RECEIVED_BERRY msgbox LilycoveCity_Text_BecauseYoureTrainer, MSGBOX_DEFAULT release @@ -234,18 +233,15 @@ LilycoveCity_EventScript_Rival:: lock faceplayer checkplayergender - compare VAR_RESULT, MALE - goto_if_eq LilycoveCity_EventScript_May - compare VAR_RESULT, FEMALE - goto_if_eq LilycoveCity_EventScript_Brendan + goto_if_eq VAR_RESULT, MALE, LilycoveCity_EventScript_May + goto_if_eq VAR_RESULT, FEMALE, LilycoveCity_EventScript_Brendan end LilycoveCity_EventScript_May:: playbgm MUS_ENCOUNTER_MAY, TRUE call_if_set FLAG_DECLINED_RIVAL_BATTLE_LILYCOVE, LilycoveCity_EventScript_MayAskToBattleAgain call_if_unset FLAG_DECLINED_RIVAL_BATTLE_LILYCOVE, LilycoveCity_EventScript_MayAskToBattle - compare VAR_RESULT, NO - goto_if_eq LilycoveCity_EventScript_DeclineMayBattle + goto_if_eq VAR_RESULT, NO, LilycoveCity_EventScript_DeclineMayBattle msgbox LilycoveCity_Text_MayWontBeBeaten, MSGBOX_DEFAULT switch VAR_STARTER_MON case 0, LilycoveCity_EventScript_BattleMayTreecko @@ -273,8 +269,7 @@ LilycoveCity_EventScript_Brendan:: playbgm MUS_ENCOUNTER_BRENDAN, TRUE call_if_set FLAG_DECLINED_RIVAL_BATTLE_LILYCOVE, LilycoveCity_EventScript_BrendanAskToBattleAgain call_if_unset FLAG_DECLINED_RIVAL_BATTLE_LILYCOVE, LilycoveCity_EventScript_BrendanAskToBattle - compare VAR_RESULT, NO - goto_if_eq LilycoveCity_EventScript_DeclineBrendanBattle + goto_if_eq VAR_RESULT, NO, LilycoveCity_EventScript_DeclineBrendanBattle msgbox LilycoveCity_Text_BrendanWontBeBeaten, MSGBOX_DEFAULT switch VAR_STARTER_MON case 0, LilycoveCity_EventScript_BattleBrendanTreecko @@ -332,10 +327,8 @@ LilycoveCity_EventScript_DefeatedMay:: msgbox LilycoveCity_Text_MayGoingBackToLittleroot, MSGBOX_DEFAULT setvar VAR_RESULT, FALSE call_if_set FLAG_BADGE06_GET, LilycoveCity_EventScript_CheckFinalBadge - compare VAR_RESULT, FALSE - call_if_eq LilycoveCity_EventScript_MayCollectBadges - compare VAR_RESULT, TRUE - call_if_eq LilycoveCity_EventScript_MayPokemonLeague + call_if_eq VAR_RESULT, FALSE, LilycoveCity_EventScript_MayCollectBadges + call_if_eq VAR_RESULT, TRUE, LilycoveCity_EventScript_MayPokemonLeague clearflag FLAG_HIDE_LITTLEROOT_TOWN_MAYS_HOUSE_RIVAL_BEDROOM clearflag FLAG_HIDE_LITTLEROOT_TOWN_MAYS_HOUSE_2F_PICHU_DOLL goto LilycoveCity_EventScript_RivalFlyAway @@ -366,10 +359,8 @@ LilycoveCity_EventScript_DefeatedBrendan:: msgbox LilycoveCity_Text_BrendanGoingBackToLittleroot, MSGBOX_DEFAULT setvar VAR_RESULT, FALSE call_if_set FLAG_BADGE06_GET, LilycoveCity_EventScript_CheckFinalBadge - compare VAR_RESULT, FALSE - call_if_eq LilycoveCity_EventScript_BrendanCollectBadges - compare VAR_RESULT, TRUE - call_if_eq LilycoveCity_EventScript_BrendanPokemonLeague + call_if_eq VAR_RESULT, FALSE, LilycoveCity_EventScript_BrendanCollectBadges + call_if_eq VAR_RESULT, TRUE, LilycoveCity_EventScript_BrendanPokemonLeague clearflag FLAG_HIDE_LITTLEROOT_TOWN_BRENDANS_HOUSE_RIVAL_BEDROOM clearflag FLAG_HIDE_LITTLEROOT_TOWN_BRENDANS_HOUSE_2F_SWABLU_DOLL goto LilycoveCity_EventScript_RivalFlyAway @@ -408,10 +399,8 @@ LilycoveCity_EventScript_SchoolKidM:: lock faceplayer msgbox LilycoveCity_Text_DoYouKnowAboutBerryBlender, MSGBOX_YESNO - compare VAR_RESULT, YES - call_if_eq LilycoveCity_EventScript_KnowAboutBerryBlender - compare VAR_RESULT, NO - call_if_eq LilycoveCity_EventScript_DontKnowAboutBerryBlender + call_if_eq VAR_RESULT, YES, LilycoveCity_EventScript_KnowAboutBerryBlender + call_if_eq VAR_RESULT, NO, LilycoveCity_EventScript_DontKnowAboutBerryBlender release end diff --git a/data/maps/LilycoveCity_ContestLobby/scripts.inc b/data/maps/LilycoveCity_ContestLobby/scripts.inc index 7bfa1419ad61..fa884a0966aa 100644 --- a/data/maps/LilycoveCity_ContestLobby/scripts.inc +++ b/data/maps/LilycoveCity_ContestLobby/scripts.inc @@ -17,9 +17,8 @@ LilycoveCity_ContestLobby_OnTransition: end LilycoveCity_ContestLobby_EventScript_TryShowBlendMaster:: - getpricereduction POKENEWS_BLENDMASTER - compare VAR_RESULT, TRUE - goto_if_eq LilycoveCity_ContestLobby_EventScript_ShowBlendMaster + getpokenewsactive POKENEWS_BLENDMASTER + 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 @@ -384,31 +374,31 @@ LilycoveCity_ContestLobby_EventScript_WarpToContestHall:: return LilycoveCity_ContestLobby_EventScript_WarpToCoolContestHall:: - setwarp MAP_CONTEST_HALL_COOL, 255, 7, 5 + setwarp MAP_CONTEST_HALL_COOL, 7, 5 special DoContestHallWarp waitstate return LilycoveCity_ContestLobby_EventScript_WarpToBeautyContestHall:: - setwarp MAP_CONTEST_HALL_BEAUTY, 255, 7, 5 + setwarp MAP_CONTEST_HALL_BEAUTY, 7, 5 special DoContestHallWarp waitstate return LilycoveCity_ContestLobby_EventScript_WarpToCuteContestHall:: - setwarp MAP_CONTEST_HALL_CUTE, 255, 7, 5 + setwarp MAP_CONTEST_HALL_CUTE, 7, 5 special DoContestHallWarp waitstate return LilycoveCity_ContestLobby_EventScript_WarpToSmartContestHall:: - setwarp MAP_CONTEST_HALL_SMART, 255, 7, 5 + setwarp MAP_CONTEST_HALL_SMART, 7, 5 special DoContestHallWarp waitstate return LilycoveCity_ContestLobby_EventScript_WarpToToughContestHall:: - setwarp MAP_CONTEST_HALL_TOUGH, 255, 7, 5 + setwarp MAP_CONTEST_HALL_TOUGH, 7, 5 special DoContestHallWarp waitstate return @@ -418,14 +408,14 @@ LilycoveCity_ContestLobby_EventScript_LeadToContestHall:: applymovement LOCALID_RECEPTIONIST, LilycoveCity_ContestLobby_Movement_ReceptionistApproachCounter waitmovement 0 playse SE_BRIDGE_WALK - setmetatile 12, 2, METATILE_Contest_WallShadow, 1 - setmetatile 12, 3, METATILE_Contest_FloorShadow, 1 + setmetatile 12, 2, METATILE_Contest_WallShadow, TRUE + setmetatile 12, 3, METATILE_Contest_FloorShadow, TRUE special DrawWholeMapView applymovement LOCALID_RECEPTIONIST, LilycoveCity_ContestLobby_Movement_ReceptionistExitCounter waitmovement 0 playse SE_BRIDGE_WALK - setmetatile 12, 2, METATILE_Contest_CounterFlap_Top, 1 - setmetatile 12, 3, METATILE_Contest_CounterFlap_Bottom, 1 + setmetatile 12, 2, METATILE_Contest_CounterFlap_Top, TRUE + setmetatile 12, 3, METATILE_Contest_CounterFlap_Bottom, TRUE special DrawWholeMapView delay 20 applymovement LOCALID_RECEPTIONIST, LilycoveCity_ContestLobby_Movement_ReceptionistFacePlayer @@ -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, 255 - 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 @@ -836,7 +807,7 @@ LilycoveCity_ContestLobby_EventScript_CancelLinkTransmissionError:: LilycoveCity_ContestLobby_EventScript_StartLinkContest:: special GetContestPlayerId addvar VAR_0x8004, 1 - buffernumberstring 1, VAR_0x8004 + buffernumberstring STR_VAR_2, VAR_0x8004 messageautoscroll LilycoveCity_ContestLobby_Text_YourMonIsEntryNumX waitmessage subvar VAR_0x8004, 1 @@ -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 @@ -939,14 +899,14 @@ LilycoveCity_ContestLobby_EventScript_LeadToLinkContestHall:: applymovement LOCALID_LINK_RECEPTIONIST, LilycoveCity_ContestLobby_Movement_LinkReceptionistApproachCounter waitmovement 0 playse SE_BRIDGE_WALK - setmetatile 17, 2, METATILE_Contest_WallShadow, 1 - setmetatile 17, 3, METATILE_Contest_FloorShadow, 1 + setmetatile 17, 2, METATILE_Contest_WallShadow, TRUE + setmetatile 17, 3, METATILE_Contest_FloorShadow, TRUE special DrawWholeMapView applymovement LOCALID_LINK_RECEPTIONIST, LilycoveCity_ContestLobby_Movement_LinkReceptionistExitCounter waitmovement 0 playse SE_BRIDGE_WALK - setmetatile 17, 2, METATILE_Contest_CounterFlap_Top, 1 - setmetatile 17, 3, METATILE_Contest_CounterFlap_Bottom, 1 + setmetatile 17, 2, METATILE_Contest_CounterFlap_Top, TRUE + setmetatile 17, 3, METATILE_Contest_CounterFlap_Bottom, TRUE special DrawWholeMapView delay 20 applymovement LOCALID_LINK_RECEPTIONIST, LilycoveCity_ContestLobby_Movement_LinkReceptionistFacePlayer diff --git a/data/maps/LilycoveCity_CoveLilyMotel_2F/scripts.inc b/data/maps/LilycoveCity_CoveLilyMotel_2F/scripts.inc index a5e8b40cf6a7..ca7481b53334 100644 --- a/data/maps/LilycoveCity_CoveLilyMotel_2F/scripts.inc +++ b/data/maps/LilycoveCity_CoveLilyMotel_2F/scripts.inc @@ -7,8 +7,7 @@ LilycoveCity_CoveLilyMotel_2F_EventScript_GameDesigner:: call_if_unset FLAG_TEMP_2, LilycoveCity_CoveLilyMotel_2F_EventScript_ShowMeCompletedDex call_if_set FLAG_TEMP_2, LilycoveCity_CoveLilyMotel_2F_EventScript_ShowDiploma specialvar VAR_RESULT, HasAllHoennMons - compare VAR_RESULT, TRUE - goto_if_eq LilycoveCity_CoveLilyMotel_2F_EventScript_AllHoennMonsFanfare + goto_if_eq VAR_RESULT, TRUE, LilycoveCity_CoveLilyMotel_2F_EventScript_AllHoennMonsFanfare release end diff --git a/data/maps/LilycoveCity_DepartmentStoreElevator/scripts.inc b/data/maps/LilycoveCity_DepartmentStoreElevator/scripts.inc index b6ad2e4e6f5e..d7d152408d6f 100644 --- a/data/maps/LilycoveCity_DepartmentStoreElevator/scripts.inc +++ b/data/maps/LilycoveCity_DepartmentStoreElevator/scripts.inc @@ -59,9 +59,8 @@ LilycoveCity_DepartmentStoreElevator_EventScript_ChooseFloor:: LilycoveCity_DepartmentStoreElevator_EventScript_1stFloor:: setvar VAR_0x8006, DEPT_STORE_FLOORNUM_1F - setdynamicwarp MAP_LILYCOVE_CITY_DEPARTMENT_STORE_1F, 255, 2, 1 - compare VAR_DEPT_STORE_FLOOR, DEPT_STORE_FLOORNUM_1F - goto_if_eq LilycoveCity_DepartmentStoreElevator_EventScript_ExitFloorSelect + setdynamicwarp MAP_LILYCOVE_CITY_DEPARTMENT_STORE_1F, 2, 1 + goto_if_eq VAR_DEPT_STORE_FLOOR, DEPT_STORE_FLOORNUM_1F, LilycoveCity_DepartmentStoreElevator_EventScript_ExitFloorSelect call LilycoveCity_DepartmentStoreElevator_EventScript_MoveElevator setvar VAR_DEPT_STORE_FLOOR, DEPT_STORE_FLOORNUM_1F goto LilycoveCity_DepartmentStoreElevator_EventScript_ExitFloorSelect @@ -69,9 +68,8 @@ LilycoveCity_DepartmentStoreElevator_EventScript_1stFloor:: LilycoveCity_DepartmentStoreElevator_EventScript_2ndFloor:: setvar VAR_0x8006, DEPT_STORE_FLOORNUM_2F - setdynamicwarp MAP_LILYCOVE_CITY_DEPARTMENT_STORE_2F, 255, 2, 1 - compare VAR_DEPT_STORE_FLOOR, DEPT_STORE_FLOORNUM_2F - goto_if_eq LilycoveCity_DepartmentStoreElevator_EventScript_ExitFloorSelect + setdynamicwarp MAP_LILYCOVE_CITY_DEPARTMENT_STORE_2F, 2, 1 + goto_if_eq VAR_DEPT_STORE_FLOOR, DEPT_STORE_FLOORNUM_2F, LilycoveCity_DepartmentStoreElevator_EventScript_ExitFloorSelect call LilycoveCity_DepartmentStoreElevator_EventScript_MoveElevator setvar VAR_DEPT_STORE_FLOOR, DEPT_STORE_FLOORNUM_2F goto LilycoveCity_DepartmentStoreElevator_EventScript_ExitFloorSelect @@ -79,9 +77,8 @@ LilycoveCity_DepartmentStoreElevator_EventScript_2ndFloor:: LilycoveCity_DepartmentStoreElevator_EventScript_3rdFloor:: setvar VAR_0x8006, DEPT_STORE_FLOORNUM_3F - setdynamicwarp MAP_LILYCOVE_CITY_DEPARTMENT_STORE_3F, 255, 2, 1 - compare VAR_DEPT_STORE_FLOOR, DEPT_STORE_FLOORNUM_3F - goto_if_eq LilycoveCity_DepartmentStoreElevator_EventScript_ExitFloorSelect + setdynamicwarp MAP_LILYCOVE_CITY_DEPARTMENT_STORE_3F, 2, 1 + goto_if_eq VAR_DEPT_STORE_FLOOR, DEPT_STORE_FLOORNUM_3F, LilycoveCity_DepartmentStoreElevator_EventScript_ExitFloorSelect call LilycoveCity_DepartmentStoreElevator_EventScript_MoveElevator setvar VAR_DEPT_STORE_FLOOR, DEPT_STORE_FLOORNUM_3F goto LilycoveCity_DepartmentStoreElevator_EventScript_ExitFloorSelect @@ -89,9 +86,8 @@ LilycoveCity_DepartmentStoreElevator_EventScript_3rdFloor:: LilycoveCity_DepartmentStoreElevator_EventScript_4thFloor:: setvar VAR_0x8006, DEPT_STORE_FLOORNUM_4F - setdynamicwarp MAP_LILYCOVE_CITY_DEPARTMENT_STORE_4F, 255, 2, 1 - compare VAR_DEPT_STORE_FLOOR, DEPT_STORE_FLOORNUM_4F - goto_if_eq LilycoveCity_DepartmentStoreElevator_EventScript_ExitFloorSelect + setdynamicwarp MAP_LILYCOVE_CITY_DEPARTMENT_STORE_4F, 2, 1 + goto_if_eq VAR_DEPT_STORE_FLOOR, DEPT_STORE_FLOORNUM_4F, LilycoveCity_DepartmentStoreElevator_EventScript_ExitFloorSelect call LilycoveCity_DepartmentStoreElevator_EventScript_MoveElevator setvar VAR_DEPT_STORE_FLOOR, DEPT_STORE_FLOORNUM_4F goto LilycoveCity_DepartmentStoreElevator_EventScript_ExitFloorSelect @@ -99,9 +95,8 @@ LilycoveCity_DepartmentStoreElevator_EventScript_4thFloor:: LilycoveCity_DepartmentStoreElevator_EventScript_5thFloor:: setvar VAR_0x8006, DEPT_STORE_FLOORNUM_5F - setdynamicwarp MAP_LILYCOVE_CITY_DEPARTMENT_STORE_5F, 255, 2, 1 - compare VAR_DEPT_STORE_FLOOR, DEPT_STORE_FLOORNUM_5F - goto_if_eq LilycoveCity_DepartmentStoreElevator_EventScript_ExitFloorSelect + setdynamicwarp MAP_LILYCOVE_CITY_DEPARTMENT_STORE_5F, 2, 1 + goto_if_eq VAR_DEPT_STORE_FLOOR, DEPT_STORE_FLOORNUM_5F, LilycoveCity_DepartmentStoreElevator_EventScript_ExitFloorSelect call LilycoveCity_DepartmentStoreElevator_EventScript_MoveElevator setvar VAR_DEPT_STORE_FLOOR, DEPT_STORE_FLOORNUM_5F goto LilycoveCity_DepartmentStoreElevator_EventScript_ExitFloorSelect diff --git a/data/maps/LilycoveCity_DepartmentStoreRooftop/scripts.inc b/data/maps/LilycoveCity_DepartmentStoreRooftop/scripts.inc index e91ca7745c90..8c67ee149639 100644 --- a/data/maps/LilycoveCity_DepartmentStoreRooftop/scripts.inc +++ b/data/maps/LilycoveCity_DepartmentStoreRooftop/scripts.inc @@ -3,11 +3,9 @@ LilycoveCity_DepartmentStoreRooftop_MapScripts:: .byte 0 LilycoveCity_DepartmentStoreRooftop_OnTransition: - getpricereduction POKENEWS_LILYCOVE - compare VAR_RESULT, TRUE - call_if_eq LilycoveCity_DepartmentStoreRooftop_EventScript_ShowSaleWoman - compare VAR_RESULT, FALSE - call_if_eq LilycoveCity_DepartmentStoreRooftop_EventScript_HideSaleWoman + getpokenewsactive POKENEWS_LILYCOVE + call_if_eq VAR_RESULT, TRUE, LilycoveCity_DepartmentStoreRooftop_EventScript_ShowSaleWoman + call_if_eq VAR_RESULT, FALSE, LilycoveCity_DepartmentStoreRooftop_EventScript_HideSaleWoman end LilycoveCity_DepartmentStoreRooftop_EventScript_ShowSaleWoman:: @@ -51,9 +49,8 @@ LilycoveCity_DepartmentStoreRooftop_PokemartDecor_ClearOutSale: LilycoveCity_DepartmentStoreRooftop_EventScript_Man:: lock faceplayer - getpricereduction POKENEWS_LILYCOVE - compare VAR_RESULT, TRUE - call_if_eq LilycoveCity_DepartmentStoreRooftop_EventScript_ManClearOutSale + getpokenewsactive POKENEWS_LILYCOVE + call_if_eq VAR_RESULT, TRUE, LilycoveCity_DepartmentStoreRooftop_EventScript_ManClearOutSale msgbox LilycoveCity_DepartmentStoreRooftop_Text_SetDatesForClearOutSales, MSGBOX_DEFAULT release end @@ -71,7 +68,7 @@ LilycoveCity_DepartmentStoreRooftop_EventScript_VendingMachine:: lockall message LilycoveCity_DepartmentStoreRooftop_Text_WhichDrinkWouldYouLike waitmessage - showmoneybox 0, 0, 0 + showmoneybox 0, 0 goto LilycoveCity_DepartmentStoreRooftop_EventScript_ChooseDrink end @@ -102,78 +99,66 @@ LilycoveCity_DepartmentStoreRooftop_EventScript_Lemonade:: end LilycoveCity_DepartmentStoreRooftop_EventScript_CheckMoneyFreshWater:: - checkmoney 200, 0 + checkmoney 200 return LilycoveCity_DepartmentStoreRooftop_EventScript_CheckMoneySodaPop:: - checkmoney 300, 0 + checkmoney 300 return LilycoveCity_DepartmentStoreRooftop_EventScript_CheckMoneyLemonade:: - checkmoney 350, 0 + checkmoney 350 return LilycoveCity_DepartmentStoreRooftop_EventScript_RemoveMoneyFreshWater:: - removemoney 200, 0 + removemoney 200 return LilycoveCity_DepartmentStoreRooftop_EventScript_RemoveMoneySodaPop:: - removemoney 300, 0 + removemoney 300 return LilycoveCity_DepartmentStoreRooftop_EventScript_RemoveMoneyLemonade:: - removemoney 350, 0 + removemoney 350 return LilycoveCity_DepartmentStoreRooftop_EventScript_TryBuyDrink:: - compare VAR_TEMP_1, 0 - call_if_eq LilycoveCity_DepartmentStoreRooftop_EventScript_CheckMoneyFreshWater - compare VAR_TEMP_1, 1 - call_if_eq LilycoveCity_DepartmentStoreRooftop_EventScript_CheckMoneySodaPop - compare VAR_TEMP_1, 2 - call_if_eq LilycoveCity_DepartmentStoreRooftop_EventScript_CheckMoneyLemonade - compare VAR_RESULT, FALSE - goto_if_eq LilycoveCity_DepartmentStoreRooftop_EventScript_NotEnoughMoneyForDrink - checkitemspace VAR_TEMP_0, 1 - compare VAR_RESULT, FALSE - goto_if_eq LilycoveCity_DepartmentStoreRooftop_EventScript_NoRoomForDrink - compare VAR_TEMP_1, 0 - call_if_eq LilycoveCity_DepartmentStoreRooftop_EventScript_RemoveMoneyFreshWater - compare VAR_TEMP_1, 1 - call_if_eq LilycoveCity_DepartmentStoreRooftop_EventScript_RemoveMoneySodaPop - compare VAR_TEMP_1, 2 - call_if_eq LilycoveCity_DepartmentStoreRooftop_EventScript_RemoveMoneyLemonade - updatemoneybox 0, 0 - bufferitemname 0, VAR_TEMP_0 + call_if_eq VAR_TEMP_1, 0, LilycoveCity_DepartmentStoreRooftop_EventScript_CheckMoneyFreshWater + call_if_eq VAR_TEMP_1, 1, LilycoveCity_DepartmentStoreRooftop_EventScript_CheckMoneySodaPop + call_if_eq VAR_TEMP_1, 2, LilycoveCity_DepartmentStoreRooftop_EventScript_CheckMoneyLemonade + goto_if_eq VAR_RESULT, FALSE, LilycoveCity_DepartmentStoreRooftop_EventScript_NotEnoughMoneyForDrink + checkitemspace VAR_TEMP_0 + goto_if_eq VAR_RESULT, FALSE, LilycoveCity_DepartmentStoreRooftop_EventScript_NoRoomForDrink + call_if_eq VAR_TEMP_1, 0, LilycoveCity_DepartmentStoreRooftop_EventScript_RemoveMoneyFreshWater + call_if_eq VAR_TEMP_1, 1, LilycoveCity_DepartmentStoreRooftop_EventScript_RemoveMoneySodaPop + call_if_eq VAR_TEMP_1, 2, LilycoveCity_DepartmentStoreRooftop_EventScript_RemoveMoneyLemonade + updatemoneybox + bufferitemname STR_VAR_1, VAR_TEMP_0 playse SE_VEND msgbox LilycoveCity_DepartmentStoreRooftop_Text_CanOfDrinkDroppedDown, MSGBOX_DEFAULT additem VAR_TEMP_0 - bufferitemname 1, VAR_TEMP_0 - bufferstdstring 2, STDSTRING_ITEMS + bufferitemname STR_VAR_2, VAR_TEMP_0 + bufferstdstring STR_VAR_3, STDSTRING_ITEMS msgbox gText_PutItemInPocket, MSGBOX_DEFAULT random 64 @ 1/64 chance of an additional drink dropping - compare VAR_RESULT, 0 - goto_if_ne LilycoveCity_DepartmentStoreRooftop_EventScript_ChooseNewDrink - checkitemspace VAR_TEMP_0, 1 - compare VAR_RESULT, FALSE - goto_if_eq LilycoveCity_DepartmentStoreRooftop_EventScript_NoRoomForDrink + goto_if_ne VAR_RESULT, 0, LilycoveCity_DepartmentStoreRooftop_EventScript_ChooseNewDrink + checkitemspace VAR_TEMP_0 + goto_if_eq VAR_RESULT, FALSE, LilycoveCity_DepartmentStoreRooftop_EventScript_NoRoomForDrink playse SE_VEND msgbox LilycoveCity_DepartmentStoreRooftop_Text_ExtraCanOfDrinkDroppedDown, MSGBOX_DEFAULT additem VAR_TEMP_0 - bufferitemname 1, VAR_TEMP_0 - bufferstdstring 2, STDSTRING_ITEMS + bufferitemname STR_VAR_2, VAR_TEMP_0 + bufferstdstring STR_VAR_3, STDSTRING_ITEMS msgbox gText_PutItemInPocket, MSGBOX_DEFAULT random 64 @ 1/64 * the prev 1/64 chance of a third additional drink dropping, ~ 0.02% chance - compare VAR_RESULT, 0 - goto_if_ne LilycoveCity_DepartmentStoreRooftop_EventScript_ChooseNewDrink - checkitemspace VAR_TEMP_0, 1 - compare VAR_RESULT, 0 - goto_if_eq LilycoveCity_DepartmentStoreRooftop_EventScript_NoRoomForDrink + goto_if_ne VAR_RESULT, 0, LilycoveCity_DepartmentStoreRooftop_EventScript_ChooseNewDrink + checkitemspace VAR_TEMP_0 + goto_if_eq VAR_RESULT, 0, LilycoveCity_DepartmentStoreRooftop_EventScript_NoRoomForDrink playse SE_VEND msgbox LilycoveCity_DepartmentStoreRooftop_Text_ExtraCanOfDrinkDroppedDown, MSGBOX_DEFAULT additem VAR_TEMP_0 - bufferitemname 1, VAR_TEMP_0 - bufferstdstring 2, STDSTRING_ITEMS + bufferitemname STR_VAR_2, VAR_TEMP_0 + bufferstdstring STR_VAR_3, STDSTRING_ITEMS msgbox gText_PutItemInPocket, MSGBOX_DEFAULT goto LilycoveCity_DepartmentStoreRooftop_EventScript_ChooseNewDrink end diff --git a/data/maps/LilycoveCity_DepartmentStore_1F/scripts.inc b/data/maps/LilycoveCity_DepartmentStore_1F/scripts.inc index fb82ba47a6ab..b0656cfd4a84 100644 --- a/data/maps/LilycoveCity_DepartmentStore_1F/scripts.inc +++ b/data/maps/LilycoveCity_DepartmentStore_1F/scripts.inc @@ -11,12 +11,10 @@ LilycoveCity_DepartmentStore_1F_EventScript_LotteryClerk:: lock faceplayer dotimebasedevents - compare VAR_POKELOT_PRIZE_ITEM, ITEM_NONE - goto_if_ne LilycoveCity_DepartmentStore_1F_EventScript_GivePrizeFromEarlier + goto_if_ne VAR_POKELOT_PRIZE_ITEM, ITEM_NONE, LilycoveCity_DepartmentStore_1F_EventScript_GivePrizeFromEarlier goto_if_set FLAG_DAILY_PICKED_LOTO_TICKET, LilycoveCity_DepartmentStore_1F_EventScript_ComeBackTomorrow msgbox LilycoveCity_DepartmentStore_1F_Text_LotteryCornerDrawTicket, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq LilycoveCity_DepartmentStore_1F_EventScript_PleaseVisitAgain + goto_if_eq VAR_RESULT, NO, LilycoveCity_DepartmentStore_1F_EventScript_PleaseVisitAgain setflag FLAG_DAILY_PICKED_LOTO_TICKET message LilycoveCity_DepartmentStore_1F_Text_PleasePickTicket waitmessage @@ -34,25 +32,17 @@ LilycoveCity_DepartmentStore_1F_EventScript_LotteryClerk:: delay 10 applymovement LOCALID_LOTTERY_CLERK, Common_Movement_FacePlayer waitmovement 0 - compare VAR_0x8004, 0 - goto_if_eq LilycoveCity_DepartmentStore_1F_EventScript_NoMatch + goto_if_eq VAR_0x8004, 0, LilycoveCity_DepartmentStore_1F_EventScript_NoMatch incrementgamestat GAME_STAT_WON_POKEMON_LOTTERY - compare VAR_0x8006, 0 - call_if_eq LilycoveCity_DepartmentStore_1F_EventScript_TicketMatchPartyMon - compare VAR_0x8006, 1 - call_if_eq LilycoveCity_DepartmentStore_1F_EventScript_TicketMatchPCMon - bufferitemname 0, VAR_0x8005 - compare VAR_0x8004, 1 - call_if_eq LilycoveCity_DepartmentStore_1F_EventScript_TwoDigitMatch - compare VAR_0x8004, 2 - call_if_eq LilycoveCity_DepartmentStore_1F_EventScript_ThreeDigitMatch - compare VAR_0x8004, 3 - call_if_eq LilycoveCity_DepartmentStore_1F_EventScript_FourDigitMatch - compare VAR_0x8004, 4 - call_if_eq LilycoveCity_DepartmentStore_1F_EventScript_FullMatch + call_if_eq VAR_0x8006, 0, LilycoveCity_DepartmentStore_1F_EventScript_TicketMatchPartyMon + call_if_eq VAR_0x8006, 1, LilycoveCity_DepartmentStore_1F_EventScript_TicketMatchPCMon + bufferitemname STR_VAR_1, VAR_0x8005 + call_if_eq VAR_0x8004, 1, LilycoveCity_DepartmentStore_1F_EventScript_TwoDigitMatch + call_if_eq VAR_0x8004, 2, LilycoveCity_DepartmentStore_1F_EventScript_ThreeDigitMatch + call_if_eq VAR_0x8004, 3, LilycoveCity_DepartmentStore_1F_EventScript_FourDigitMatch + call_if_eq VAR_0x8004, 4, LilycoveCity_DepartmentStore_1F_EventScript_FullMatch giveitem VAR_0x8005 - compare VAR_RESULT, FALSE - goto_if_eq LilycoveCity_DepartmentStore_1F_EventScript_RecordPrizeNoRoom + goto_if_eq VAR_RESULT, FALSE, LilycoveCity_DepartmentStore_1F_EventScript_RecordPrizeNoRoom special TryPutLotteryWinnerReportOnAir goto LilycoveCity_DepartmentStore_1F_EventScript_PleaseVisitAgain2 end @@ -115,8 +105,7 @@ LilycoveCity_DepartmentStore_1F_EventScript_NoRoomForPrize:: LilycoveCity_DepartmentStore_1F_EventScript_GivePrizeFromEarlier:: msgbox LilycoveCity_DepartmentStore_1F_Text_PrizeWeveBeenHolding, MSGBOX_DEFAULT giveitem VAR_POKELOT_PRIZE_ITEM - compare VAR_RESULT, FALSE - goto_if_eq LilycoveCity_DepartmentStore_1F_EventScript_NoRoomForPrize + goto_if_eq VAR_RESULT, FALSE, LilycoveCity_DepartmentStore_1F_EventScript_NoRoomForPrize copyvar VAR_0x8004, VAR_POKELOT_PRIZE_PLACE copyvar VAR_0x8005, VAR_POKELOT_PRIZE_ITEM special TryPutLotteryWinnerReportOnAir diff --git a/data/maps/LilycoveCity_DepartmentStore_5F/scripts.inc b/data/maps/LilycoveCity_DepartmentStore_5F/scripts.inc index d1d074c8ce71..a9683d13c9b6 100644 --- a/data/maps/LilycoveCity_DepartmentStore_5F/scripts.inc +++ b/data/maps/LilycoveCity_DepartmentStore_5F/scripts.inc @@ -129,10 +129,8 @@ LilycoveCity_DepartmentStore_5F_EventScript_Woman:: lockall applymovement LOCALID_WOMAN, Common_Movement_FacePlayer waitmovement 0 - compare VAR_SOOTOPOLIS_CITY_STATE, 0 - goto_if_eq LilycoveCity_DepartmentStore_5F_EventScript_WomanNormal - compare VAR_SOOTOPOLIS_CITY_STATE, 4 - goto_if_ge LilycoveCity_DepartmentStore_5F_EventScript_WomanNormal + goto_if_eq VAR_SOOTOPOLIS_CITY_STATE, 0, LilycoveCity_DepartmentStore_5F_EventScript_WomanNormal + goto_if_ge VAR_SOOTOPOLIS_CITY_STATE, 4, LilycoveCity_DepartmentStore_5F_EventScript_WomanNormal goto LilycoveCity_DepartmentStore_5F_EventScript_WomanLegendaryWeather end diff --git a/data/maps/LilycoveCity_Harbor/scripts.inc b/data/maps/LilycoveCity_Harbor/scripts.inc index 216a6ff03366..63010dc4c77d 100644 --- a/data/maps/LilycoveCity_Harbor/scripts.inc +++ b/data/maps/LilycoveCity_Harbor/scripts.inc @@ -8,7 +8,7 @@ LilycoveCity_Harbor_MapScripts:: .byte 0 LilycoveCity_Harbor_OnTransition: - setescapewarp MAP_LILYCOVE_CITY, 255, 12, 33 + setescapewarp MAP_LILYCOVE_CITY, 12, 33 end LilycoveCity_Harbor_EventScript_FerryAttendant:: @@ -21,25 +21,18 @@ LilycoveCity_Harbor_EventScript_FerryAttendant:: call LilycoveCity_Harbor_EventScript_GetMysticTicketState call LilycoveCity_Harbor_EventScript_GetFirstTimeShowingTicket call LilycoveCity_Harbor_EventScript_GetHasTicketsState - compare VAR_TEMP_C, 2 - goto_if_eq LilycoveCity_Harbor_EventScript_OldSeaMapFirstTime - compare VAR_TEMP_B, 1 - goto_if_eq LilycoveCity_Harbor_EventScript_EonTicketFirstTime - compare VAR_TEMP_B, 2 - goto_if_eq LilycoveCity_Harbor_EventScript_AuroraTicketFirstTime - compare VAR_TEMP_B, 4 - goto_if_eq LilycoveCity_Harbor_EventScript_OldSeaMapFirstTime - compare VAR_TEMP_B, 8 - goto_if_eq LilycoveCity_Harbor_EventScript_MysticTicketFirstTime - compare VAR_TEMP_B, 0 - goto_if_ne LilycoveCity_Harbor_EventScript_MultipleEventTicketsFirstTime + goto_if_eq VAR_TEMP_C, 2, LilycoveCity_Harbor_EventScript_OldSeaMapFirstTime + goto_if_eq VAR_TEMP_B, 1, LilycoveCity_Harbor_EventScript_EonTicketFirstTime + goto_if_eq VAR_TEMP_B, 2, LilycoveCity_Harbor_EventScript_AuroraTicketFirstTime + goto_if_eq VAR_TEMP_B, 4, LilycoveCity_Harbor_EventScript_OldSeaMapFirstTime + goto_if_eq VAR_TEMP_B, 8, LilycoveCity_Harbor_EventScript_MysticTicketFirstTime + goto_if_ne VAR_TEMP_B, 0, LilycoveCity_Harbor_EventScript_MultipleEventTicketsFirstTime goto LilycoveCity_Harbor_EventScript_NoFirstTimeEventTickets end @ First goto_if_eq is unnecessary; identical scripts LilycoveCity_Harbor_EventScript_NoFirstTimeEventTickets:: - compare VAR_TEMP_A, 0 - goto_if_eq LilycoveCity_Harbor_EventScript_NoEventTickets + goto_if_eq VAR_TEMP_A, 0, LilycoveCity_Harbor_EventScript_NoEventTickets msgbox LilycoveCity_Harbor_Text_MayISeeYourTicket, MSGBOX_DEFAULT message LilycoveCity_Harbor_Text_FlashTicketWhereTo waitmessage @@ -64,49 +57,47 @@ LilycoveCity_Harbor_EventScript_FerryRegularLocationSelect:: LilycoveCity_Harbor_EventScript_GoToSouthernIsland:: call LilycoveCity_Harbor_EventScript_BoardFerry - warp MAP_SOUTHERN_ISLAND_EXTERIOR, 255, 13, 22 + warp MAP_SOUTHERN_ISLAND_EXTERIOR, 13, 22 waitstate release end LilycoveCity_Harbor_EventScript_GoToNavelRock:: call LilycoveCity_Harbor_EventScript_BoardFerry - warp MAP_NAVEL_ROCK_HARBOR, 255, 8, 4 + warp MAP_NAVEL_ROCK_HARBOR, 8, 4 waitstate release end LilycoveCity_Harbor_EventScript_GoToBirthIsland:: call LilycoveCity_Harbor_EventScript_BoardFerry - warp MAP_BIRTH_ISLAND_HARBOR, 255, 8, 4 + warp MAP_BIRTH_ISLAND_HARBOR, 8, 4 waitstate release end LilycoveCity_Harbor_EventScript_GoToFarawayIsland:: call LilycoveCity_Harbor_EventScript_BoardFerry - warp MAP_FARAWAY_ISLAND_ENTRANCE, 255, 13, 38 + warp MAP_FARAWAY_ISLAND_ENTRANCE, 13, 38 waitstate release end LilycoveCity_Harbor_EventScript_GoToSlateport:: msgbox LilycoveCity_Harbor_Text_SlateportItIs, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq LilycoveCity_Harbor_EventScript_FerryDestinationChangeMind + goto_if_eq VAR_RESULT, NO, LilycoveCity_Harbor_EventScript_FerryDestinationChangeMind setvar VAR_SS_TIDAL_STATE, SS_TIDAL_BOARD_LILYCOVE call LilycoveCity_Harbor_EventScript_BoardFerry - warp MAP_SS_TIDAL_CORRIDOR, 255, 1, 10 + warp MAP_SS_TIDAL_CORRIDOR, 1, 10 waitstate release end LilycoveCity_Harbor_EventScript_GoToBattleFrontier:: msgbox LilycoveCity_Harbor_Text_BattleFrontierItIs, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq LilycoveCity_Harbor_EventScript_FerryDestinationChangeMind + goto_if_eq VAR_RESULT, NO, LilycoveCity_Harbor_EventScript_FerryDestinationChangeMind call LilycoveCity_Harbor_EventScript_BoardFerry - warp MAP_BATTLE_FRONTIER_OUTSIDE_WEST, 255, 19, 67 + warp MAP_BATTLE_FRONTIER_OUTSIDE_WEST, 19, 67 waitstate release end @@ -114,9 +105,8 @@ LilycoveCity_Harbor_EventScript_GoToBattleFrontier:: LilycoveCity_Harbor_EventScript_GetEonTicketState:: setvar VAR_TEMP_E, 0 goto_if_unset FLAG_ENABLE_SHIP_SOUTHERN_ISLAND, Common_EventScript_NopReturn - checkitem ITEM_EON_TICKET, 1 - compare VAR_RESULT, FALSE - goto_if_eq Common_EventScript_NopReturn + checkitem ITEM_EON_TICKET + goto_if_eq VAR_RESULT, FALSE, Common_EventScript_NopReturn setvar VAR_TEMP_E, 1 goto_if_set FLAG_SHOWN_EON_TICKET, Common_EventScript_NopReturn setvar VAR_TEMP_E, 2 @@ -125,9 +115,8 @@ LilycoveCity_Harbor_EventScript_GetEonTicketState:: LilycoveCity_Harbor_EventScript_GetAuroraTicketState:: setvar VAR_TEMP_D, 0 goto_if_unset FLAG_ENABLE_SHIP_BIRTH_ISLAND, Common_EventScript_NopReturn - checkitem ITEM_AURORA_TICKET, 1 - compare VAR_RESULT, FALSE - goto_if_eq Common_EventScript_NopReturn + checkitem ITEM_AURORA_TICKET + goto_if_eq VAR_RESULT, FALSE, Common_EventScript_NopReturn setvar VAR_TEMP_D, 1 goto_if_set FLAG_SHOWN_AURORA_TICKET, Common_EventScript_NopReturn setvar VAR_TEMP_D, 2 @@ -136,9 +125,8 @@ LilycoveCity_Harbor_EventScript_GetAuroraTicketState:: LilycoveCity_Harbor_EventScript_GetOldSeaMapState:: setvar VAR_TEMP_C, 0 goto_if_unset FLAG_ENABLE_SHIP_FARAWAY_ISLAND, Common_EventScript_NopReturn - checkitem ITEM_OLD_SEA_MAP, 1 - compare VAR_RESULT, FALSE - goto_if_eq Common_EventScript_NopReturn + checkitem ITEM_OLD_SEA_MAP + goto_if_eq VAR_RESULT, FALSE, Common_EventScript_NopReturn setvar VAR_TEMP_C, 1 goto_if_set FLAG_SHOWN_OLD_SEA_MAP, Common_EventScript_NopReturn setvar VAR_TEMP_C, 2 @@ -147,9 +135,8 @@ LilycoveCity_Harbor_EventScript_GetOldSeaMapState:: LilycoveCity_Harbor_EventScript_GetMysticTicketState:: setvar VAR_TEMP_9, 0 goto_if_unset FLAG_ENABLE_SHIP_NAVEL_ROCK, Common_EventScript_NopReturn - checkitem ITEM_MYSTIC_TICKET, 1 - compare VAR_RESULT, FALSE - goto_if_eq Common_EventScript_NopReturn + checkitem ITEM_MYSTIC_TICKET + goto_if_eq VAR_RESULT, FALSE, Common_EventScript_NopReturn setvar VAR_TEMP_9, 1 goto_if_set FLAG_SHOWN_MYSTIC_TICKET, Common_EventScript_NopReturn setvar VAR_TEMP_9, 2 @@ -157,14 +144,10 @@ LilycoveCity_Harbor_EventScript_GetMysticTicketState:: LilycoveCity_Harbor_EventScript_GetFirstTimeShowingTicket:: setvar VAR_TEMP_B, 0 - compare VAR_TEMP_E, 2 - call_if_eq LilycoveCity_Harbor_EventScript_SetFirstTimeShowingEonTicket - compare VAR_TEMP_D, 2 - call_if_eq LilycoveCity_Harbor_EventScript_SetFirstTimeShowingAuroraTicket - compare VAR_TEMP_C, 2 - call_if_eq LilycoveCity_Harbor_EventScript_SetFirstTimeShowingOldSeaMap - compare VAR_TEMP_9, 2 - call_if_eq LilycoveCity_Harbor_EventScript_SetFirstTimeShowingMysticTicket + call_if_eq VAR_TEMP_E, 2, LilycoveCity_Harbor_EventScript_SetFirstTimeShowingEonTicket + call_if_eq VAR_TEMP_D, 2, LilycoveCity_Harbor_EventScript_SetFirstTimeShowingAuroraTicket + call_if_eq VAR_TEMP_C, 2, LilycoveCity_Harbor_EventScript_SetFirstTimeShowingOldSeaMap + call_if_eq VAR_TEMP_9, 2, LilycoveCity_Harbor_EventScript_SetFirstTimeShowingMysticTicket return LilycoveCity_Harbor_EventScript_SetFirstTimeShowingEonTicket:: @@ -185,14 +168,10 @@ LilycoveCity_Harbor_EventScript_SetFirstTimeShowingMysticTicket:: LilycoveCity_Harbor_EventScript_GetHasTicketsState:: setvar VAR_TEMP_A, 0 - compare VAR_TEMP_E, 1 - call_if_eq LilycoveCity_Harbor_EventScript_SetHasEonTicket - compare VAR_TEMP_D, 1 - call_if_eq LilycoveCity_Harbor_EventScript_SetHasAuroraTicket - compare VAR_TEMP_C, 1 - call_if_eq LilycoveCity_Harbor_EventScript_SetHasOldSeaMap - compare VAR_TEMP_9, 1 - call_if_eq LilycoveCity_Harbor_EventScript_SetHasMysticTicket + call_if_eq VAR_TEMP_E, 1, LilycoveCity_Harbor_EventScript_SetHasEonTicket + call_if_eq VAR_TEMP_D, 1, LilycoveCity_Harbor_EventScript_SetHasAuroraTicket + call_if_eq VAR_TEMP_C, 1, LilycoveCity_Harbor_EventScript_SetHasOldSeaMap + call_if_eq VAR_TEMP_9, 1, LilycoveCity_Harbor_EventScript_SetHasMysticTicket return LilycoveCity_Harbor_EventScript_SetHasEonTicket:: @@ -223,7 +202,7 @@ LilycoveCity_Harbor_EventScript_EonTicketFirstTime:: LilycoveCity_Harbor_EventScript_GoToSouthernIslandFirstTime:: closemessage call LilycoveCity_Harbor_EventScript_BoardFerryWithSailor - warp MAP_SOUTHERN_ISLAND_EXTERIOR, 255, 13, 22 + warp MAP_SOUTHERN_ISLAND_EXTERIOR, 13, 22 waitstate release end @@ -240,7 +219,7 @@ LilycoveCity_Harbor_EventScript_AuroraTicketFirstTime:: LilycoveCity_Harbor_EventScript_GoToBirthIslandFirstTime:: closemessage call LilycoveCity_Harbor_EventScript_BoardFerryWithSailor - warp MAP_BIRTH_ISLAND_HARBOR, 255, 8, 4 + warp MAP_BIRTH_ISLAND_HARBOR, 8, 4 waitstate release end @@ -259,29 +238,21 @@ LilycoveCity_Harbor_EventScript_OldSeaMapFirstTime:: waitmovement 0 applymovement LOCALID_FERRY_SAILOR, Common_Movement_Delay48 waitmovement 0 - compare VAR_FACING, DIR_NORTH - call_if_eq LilycoveCity_Harbor_EventScript_MoveSailorOutOfWayNorth - compare VAR_FACING, DIR_EAST - call_if_eq LilycoveCity_Harbor_EventScript_MoveSailorOutOfWayEast + call_if_eq VAR_FACING, DIR_NORTH, LilycoveCity_Harbor_EventScript_MoveSailorOutOfWayNorth + call_if_eq VAR_FACING, DIR_EAST, LilycoveCity_Harbor_EventScript_MoveSailorOutOfWayEast addobject LOCALID_BRINEY - compare VAR_FACING, DIR_NORTH - call_if_eq LilycoveCity_Harbor_EventScript_BrineyFaceSailorNorth - compare VAR_FACING, DIR_EAST - call_if_eq LilycoveCity_Harbor_EventScript_BrineyFaceSailorEast + call_if_eq VAR_FACING, DIR_NORTH, LilycoveCity_Harbor_EventScript_BrineyFaceSailorNorth + call_if_eq VAR_FACING, DIR_EAST, LilycoveCity_Harbor_EventScript_BrineyFaceSailorEast msgbox EventTicket_Text_BrineyHoldOnASecond, MSGBOX_DEFAULT - compare VAR_FACING, DIR_NORTH - call_if_eq LilycoveCity_Harbor_EventScript_BrineyFacePlayerNorth - compare VAR_FACING, DIR_EAST - call_if_eq LilycoveCity_Harbor_EventScript_BrineyFacePlayerEast + call_if_eq VAR_FACING, DIR_NORTH, LilycoveCity_Harbor_EventScript_BrineyFacePlayerNorth + call_if_eq VAR_FACING, DIR_EAST, LilycoveCity_Harbor_EventScript_BrineyFacePlayerEast msgbox EventTicket_Text_BrineyLetsSail, MSGBOX_DEFAULT closemessage - compare VAR_FACING, DIR_NORTH - call_if_eq LilycoveCity_Harbor_EventScript_BoardFerryWithBrineyAndSailorNorth - compare VAR_FACING, DIR_EAST - call_if_eq LilycoveCity_Harbor_EventScript_BoardFerryWithBrineyAndSailorEast + call_if_eq VAR_FACING, DIR_NORTH, LilycoveCity_Harbor_EventScript_BoardFerryWithBrineyAndSailorNorth + call_if_eq VAR_FACING, DIR_EAST, LilycoveCity_Harbor_EventScript_BoardFerryWithBrineyAndSailorEast setvar VAR_0x8004, LOCALID_SS_TIDAL call Common_EventScript_FerryDepart - warp MAP_FARAWAY_ISLAND_ENTRANCE, 255, 13, 38 + warp MAP_FARAWAY_ISLAND_ENTRANCE, 13, 38 waitstate release end @@ -289,7 +260,7 @@ LilycoveCity_Harbor_EventScript_OldSeaMapFirstTime:: LilycoveCity_Harbor_EventScript_GoToFarawayIslandFirstTime:: closemessage call LilycoveCity_Harbor_EventScript_BoardFerryWithSailor - warp MAP_FARAWAY_ISLAND_ENTRANCE, 255, 13, 38 + warp MAP_FARAWAY_ISLAND_ENTRANCE, 13, 38 waitstate release end @@ -306,7 +277,7 @@ LilycoveCity_Harbor_EventScript_MysticTicketFirstTime:: LilycoveCity_Harbor_EventScript_GoToNavelRockFirstTime:: closemessage call LilycoveCity_Harbor_EventScript_BoardFerryWithSailor - warp MAP_NAVEL_ROCK_HARBOR, 255, 8, 4 + warp MAP_NAVEL_ROCK_HARBOR, 8, 4 waitstate release end @@ -364,10 +335,8 @@ LilycoveCity_Harbor_EventScript_BoardFerryWithSailor:: waitmovement 0 delay 30 removeobject LOCALID_FERRY_SAILOR - compare VAR_FACING, DIR_NORTH - call_if_eq LilycoveCity_Harbor_EventScript_PlayerBoardFerryNorth - compare VAR_FACING, DIR_EAST - call_if_eq LilycoveCity_Harbor_EventScript_PlayerBoardFerryEast + call_if_eq VAR_FACING, DIR_NORTH, LilycoveCity_Harbor_EventScript_PlayerBoardFerryNorth + call_if_eq VAR_FACING, DIR_EAST, LilycoveCity_Harbor_EventScript_PlayerBoardFerryEast delay 30 hideobjectat OBJ_EVENT_ID_PLAYER, 0 setvar VAR_0x8004, LOCALID_SS_TIDAL @@ -395,11 +364,10 @@ LilycoveCity_Harbor_EventScript_NoTicket:: @ Unused LilycoveCity_Harbor_EventScript_GoToSlateportUnused:: msgbox LilycoveCity_Harbor_Text_SlateportItIs, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq LilycoveCity_Harbor_EventScript_FerryDestinationChangeMind + goto_if_eq VAR_RESULT, NO, LilycoveCity_Harbor_EventScript_FerryDestinationChangeMind setvar VAR_SS_TIDAL_STATE, SS_TIDAL_BOARD_LILYCOVE call LilycoveCity_Harbor_EventScript_BoardFerry - warp MAP_SS_TIDAL_CORRIDOR, 255, 1, 10 + warp MAP_SS_TIDAL_CORRIDOR, 1, 10 waitstate release end @@ -407,10 +375,9 @@ LilycoveCity_Harbor_EventScript_GoToSlateportUnused:: @ Unused LilycoveCity_Harbor_EventScript_GoToBattleFrontierUnused:: msgbox LilycoveCity_Harbor_Text_BattleFrontierItIs, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq LilycoveCity_Harbor_EventScript_FerryDestinationChangeMind + goto_if_eq VAR_RESULT, NO, LilycoveCity_Harbor_EventScript_FerryDestinationChangeMind call LilycoveCity_Harbor_EventScript_BoardFerry - warp MAP_BATTLE_FRONTIER_OUTSIDE_WEST, 255, 19, 67 + warp MAP_BATTLE_FRONTIER_OUTSIDE_WEST, 19, 67 waitstate release end @@ -428,10 +395,8 @@ LilycoveCity_Harbor_EventScript_BoardFerry:: waitmovement 0 delay 30 hideobjectat VAR_LAST_TALKED, MAP_LILYCOVE_CITY_HARBOR - compare VAR_FACING, DIR_NORTH - call_if_eq LilycoveCity_Harbor_EventScript_PlayerBoardFerryNorth - compare VAR_FACING, DIR_EAST - call_if_eq LilycoveCity_Harbor_EventScript_PlayerBoardFerryEast + call_if_eq VAR_FACING, DIR_NORTH, LilycoveCity_Harbor_EventScript_PlayerBoardFerryNorth + call_if_eq VAR_FACING, DIR_EAST, LilycoveCity_Harbor_EventScript_PlayerBoardFerryEast delay 30 hideobjectat OBJ_EVENT_ID_PLAYER, 0 setvar VAR_0x8004, LOCALID_SS_TIDAL diff --git a/data/maps/LilycoveCity_House2/scripts.inc b/data/maps/LilycoveCity_House2/scripts.inc index c7664c641fcf..965d82acfbcb 100644 --- a/data/maps/LilycoveCity_House2/scripts.inc +++ b/data/maps/LilycoveCity_House2/scripts.inc @@ -7,8 +7,7 @@ LilycoveCity_House2_EventScript_FatMan:: goto_if_set FLAG_RECEIVED_TM44, LilycoveCity_House2_EventScript_ReceivedRest msgbox LilycoveCity_House2_Text_NotAwakeYetHaveThis, MSGBOX_DEFAULT giveitem ITEM_TM44 - compare VAR_RESULT, FALSE - goto_if_eq Common_EventScript_ShowBagIsFull + goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull setflag FLAG_RECEIVED_TM44 msgbox LilycoveCity_House2_Text_SleepIsEssential, MSGBOX_DEFAULT release diff --git a/data/maps/LilycoveCity_House3/scripts.inc b/data/maps/LilycoveCity_House3/scripts.inc index de76c58b6bbc..57e68047326a 100644 --- a/data/maps/LilycoveCity_House3/scripts.inc +++ b/data/maps/LilycoveCity_House3/scripts.inc @@ -11,8 +11,7 @@ LilycoveCity_House3_EventScript_PokefanF:: lock faceplayer msgbox LilycoveCity_House3_Text_LearnFromMasterOfPokeblocks, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq LilycoveCity_House3_EventScript_DeclinePokeblockLearn + goto_if_eq VAR_RESULT, NO, LilycoveCity_House3_EventScript_DeclinePokeblockLearn msgbox LilycoveCity_House3_Text_ExplainPokeblocks, MSGBOX_DEFAULT closemessage applymovement VAR_LAST_TALKED, Common_Movement_FaceOriginalDirection diff --git a/data/maps/LilycoveCity_LilycoveMuseum_1F/scripts.inc b/data/maps/LilycoveCity_LilycoveMuseum_1F/scripts.inc index e5d855633eb9..2d9d446f9d51 100644 --- a/data/maps/LilycoveCity_LilycoveMuseum_1F/scripts.inc +++ b/data/maps/LilycoveCity_LilycoveMuseum_1F/scripts.inc @@ -14,10 +14,8 @@ LilycoveCity_LilycoveMuseum_1F_EventScript_Curator:: message LilycoveCity_LilycoveMuseum_1F_Text_ImCuratorHaveYouViewedOurPaintings waitmessage multichoice 20, 8, MULTI_VIEWED_PAINTINGS, TRUE - compare VAR_RESULT, 0 - goto_if_eq LilycoveCity_LilycoveMuseum_1F_EventScript_SawPaintings - compare VAR_RESULT, 1 - goto_if_eq LilycoveCity_LilycoveMuseum_1F_EventScript_NotYet + goto_if_eq VAR_RESULT, 0, LilycoveCity_LilycoveMuseum_1F_EventScript_SawPaintings + goto_if_eq VAR_RESULT, 1, LilycoveCity_LilycoveMuseum_1F_EventScript_NotYet end LilycoveCity_LilycoveMuseum_1F_EventScript_NotYet:: @@ -26,10 +24,8 @@ LilycoveCity_LilycoveMuseum_1F_EventScript_NotYet:: LilycoveCity_LilycoveMuseum_1F_EventScript_SawPaintings:: msgbox LilycoveCity_LilycoveMuseum_1F_Text_HaveYouAnInterestInPaintings, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq LilycoveCity_LilycoveMuseum_1F_EventScript_NotInterested - compare VAR_RESULT, YES - goto_if_eq LilycoveCity_LilycoveMuseum_1F_EventScript_InterestedInPaintings + goto_if_eq VAR_RESULT, NO, LilycoveCity_LilycoveMuseum_1F_EventScript_NotInterested + goto_if_eq VAR_RESULT, YES, LilycoveCity_LilycoveMuseum_1F_EventScript_InterestedInPaintings end LilycoveCity_LilycoveMuseum_1F_EventScript_NotInterested:: @@ -52,7 +48,7 @@ LilycoveCity_LilycoveMuseum_1F_EventScript_FollowCuratorNorth:: lockall applymovement OBJ_EVENT_ID_PLAYER, LilycoveCity_LilycoveMuseum_1F_Movement_FollowCuratorNorth waitmovement 0 - warp MAP_LILYCOVE_CITY_LILYCOVE_MUSEUM_2F, 255, 11, 8 + warp MAP_LILYCOVE_CITY_LILYCOVE_MUSEUM_2F, 11, 8 waitstate end @@ -60,7 +56,7 @@ LilycoveCity_LilycoveMuseum_1F_EventScript_FollowCuratorWest:: lockall applymovement OBJ_EVENT_ID_PLAYER, LilycoveCity_LilycoveMuseum_1F_Movement_FollowCuratorWest waitmovement 0 - warp MAP_LILYCOVE_CITY_LILYCOVE_MUSEUM_2F, 255, 11, 8 + warp MAP_LILYCOVE_CITY_LILYCOVE_MUSEUM_2F, 11, 8 waitstate end @@ -68,7 +64,7 @@ LilycoveCity_LilycoveMuseum_1F_EventScript_FollowCuratorEast:: lockall applymovement OBJ_EVENT_ID_PLAYER, LilycoveCity_LilycoveMuseum_1F_Movement_FollowCuratorEast waitmovement 0 - warp MAP_LILYCOVE_CITY_LILYCOVE_MUSEUM_2F, 255, 11, 8 + warp MAP_LILYCOVE_CITY_LILYCOVE_MUSEUM_2F, 11, 8 waitstate end diff --git a/data/maps/LilycoveCity_LilycoveMuseum_2F/scripts.inc b/data/maps/LilycoveCity_LilycoveMuseum_2F/scripts.inc index 929bba3e17ce..9212ca67df1e 100644 --- a/data/maps/LilycoveCity_LilycoveMuseum_2F/scripts.inc +++ b/data/maps/LilycoveCity_LilycoveMuseum_2F/scripts.inc @@ -30,32 +30,32 @@ LilycoveCity_LilycoveMuseum_2F_EventScript_CheckToughPainting:: end LilycoveCity_LilycoveMuseum_2F_EventScript_SetCoolPainting:: - setmetatile 10, 6, METATILE_LilycoveMuseum_Painting2_Left, 1 - setmetatile 11, 6, METATILE_LilycoveMuseum_Painting2_Right, 1 + setmetatile 10, 6, METATILE_LilycoveMuseum_Painting2_Left, TRUE + setmetatile 11, 6, METATILE_LilycoveMuseum_Painting2_Right, TRUE goto LilycoveCity_LilycoveMuseum_2F_EventScript_CheckBeautyPainting end LilycoveCity_LilycoveMuseum_2F_EventScript_SetBeautyPainting:: - setmetatile 18, 6, METATILE_LilycoveMuseum_Painting1_Left, 1 - setmetatile 19, 6, METATILE_LilycoveMuseum_Painting1_Right, 1 + setmetatile 18, 6, METATILE_LilycoveMuseum_Painting1_Left, TRUE + setmetatile 19, 6, METATILE_LilycoveMuseum_Painting1_Right, TRUE goto LilycoveCity_LilycoveMuseum_2F_EventScript_CheckCutePainting end LilycoveCity_LilycoveMuseum_2F_EventScript_SetCutePainting:: - setmetatile 14, 10, METATILE_LilycoveMuseum_Painting3_Left, 1 - setmetatile 15, 10, METATILE_LilycoveMuseum_Painting3_Right, 1 + setmetatile 14, 10, METATILE_LilycoveMuseum_Painting3_Left, TRUE + setmetatile 15, 10, METATILE_LilycoveMuseum_Painting3_Right, TRUE goto LilycoveCity_LilycoveMuseum_2F_EventScript_CheckSmartPainting end LilycoveCity_LilycoveMuseum_2F_EventScript_SetSmartPainting:: - setmetatile 6, 10, METATILE_LilycoveMuseum_Painting0_Left, 1 - setmetatile 7, 10, METATILE_LilycoveMuseum_Painting0_Right, 1 + setmetatile 6, 10, METATILE_LilycoveMuseum_Painting0_Left, TRUE + setmetatile 7, 10, METATILE_LilycoveMuseum_Painting0_Right, TRUE goto LilycoveCity_LilycoveMuseum_2F_EventScript_CheckToughPainting end LilycoveCity_LilycoveMuseum_2F_EventScript_SetToughPainting:: - setmetatile 2, 6, METATILE_LilycoveMuseum_Painting4_Left, 1 - setmetatile 3, 6, METATILE_LilycoveMuseum_Painting4_Right, 1 + setmetatile 2, 6, METATILE_LilycoveMuseum_Painting4_Left, TRUE + setmetatile 3, 6, METATILE_LilycoveMuseum_Painting4_Right, TRUE end LilycoveCity_LilycoveMuseum_2F_OnFrame: @@ -121,8 +121,7 @@ LilycoveCity_LilycoveMuseum_2F_EventScript_GiveGlassOrnament:: applymovement LOCALID_CURATOR, Common_Movement_FacePlayer msgbox LilycoveCity_LilycoveMuseum_2F_Text_TokenOfGratitude, MSGBOX_DEFAULT givedecoration DECOR_GLASS_ORNAMENT - compare VAR_RESULT, FALSE - goto_if_eq LilycoveCity_LilycoveMuseum_2F_EventScript_NoRoomForGlassOrnament + goto_if_eq VAR_RESULT, FALSE, LilycoveCity_LilycoveMuseum_2F_EventScript_NoRoomForGlassOrnament setflag FLAG_RECEIVED_GLASS_ORNAMENT closemessage releaseall diff --git a/data/maps/LilycoveCity_MoveDeletersHouse/scripts.inc b/data/maps/LilycoveCity_MoveDeletersHouse/scripts.inc index ff340c9f33f4..db042653e1ca 100644 --- a/data/maps/LilycoveCity_MoveDeletersHouse/scripts.inc +++ b/data/maps/LilycoveCity_MoveDeletersHouse/scripts.inc @@ -18,20 +18,16 @@ LilycoveCity_MoveDeletersHouse_EventScript_ChooseMonAndMoveToForget:: msgbox LilycoveCity_MoveDeletersHouse_Text_WhichMonShouldForget, MSGBOX_DEFAULT special ChoosePartyMon waitstate - compare VAR_0x8004, 255 - goto_if_eq LilycoveCity_MoveDeletersHouse_EventScript_ComeAgain + goto_if_eq VAR_0x8004, PARTY_NOTHING_CHOSEN, LilycoveCity_MoveDeletersHouse_EventScript_ComeAgain special IsSelectedMonEgg - compare VAR_RESULT, TRUE - goto_if_eq LilycoveCity_MoveDeletersHouse_EventScript_EggCantForgetMoves + goto_if_eq VAR_RESULT, TRUE, LilycoveCity_MoveDeletersHouse_EventScript_EggCantForgetMoves special GetNumMovesSelectedMonHas - compare VAR_RESULT, 1 - goto_if_eq LilycoveCity_MoveDeletersHouse_EventScript_MonOnlyKnowsOneMove + goto_if_eq VAR_RESULT, 1, LilycoveCity_MoveDeletersHouse_EventScript_MonOnlyKnowsOneMove msgbox LilycoveCity_MoveDeletersHouse_Text_WhichMoveShouldBeForgotten, MSGBOX_DEFAULT fadescreen FADE_TO_BLACK special MoveDeleterChooseMoveToForget fadescreen FADE_FROM_BLACK - compare VAR_0x8005, MAX_MON_MOVES - goto_if_eq LilycoveCity_MoveDeletersHouse_EventScript_ChooseMonAndMoveToForget + goto_if_eq VAR_0x8005, MAX_MON_MOVES, LilycoveCity_MoveDeletersHouse_EventScript_ChooseMonAndMoveToForget special BufferMoveDeleterNicknameAndMove msgbox LilycoveCity_MoveDeletersHouse_Text_MonsMoveShouldBeForgotten, MSGBOX_YESNO switch VAR_RESULT @@ -42,8 +38,7 @@ LilycoveCity_MoveDeletersHouse_EventScript_ChooseMonAndMoveToForget:: LilycoveCity_MoveDeletersHouse_EventScript_TryForgetMove:: special IsLastMonThatKnowsSurf - compare VAR_RESULT, TRUE - goto_if_eq LilycoveCity_MoveDeletersHouse_EventScript_LastMonWithSurf + goto_if_eq VAR_RESULT, TRUE, LilycoveCity_MoveDeletersHouse_EventScript_LastMonWithSurf special MoveDeleterForgetMove playfanfare MUS_MOVE_DELETED waitfanfare diff --git a/data/maps/LilycoveCity_PokemonCenter_1F/scripts.inc b/data/maps/LilycoveCity_PokemonCenter_1F/scripts.inc index 03f2657e714d..a7f853afada1 100644 --- a/data/maps/LilycoveCity_PokemonCenter_1F/scripts.inc +++ b/data/maps/LilycoveCity_PokemonCenter_1F/scripts.inc @@ -13,10 +13,8 @@ LilycoveCity_PokemonCenter_1F_OnTransition: @ SetLilycoveLadyGfx returns TRUE if its the Contest Lady LilycoveCity_PokemonCenter_1F_EventScript_SetLilycoveLadyGfx:: special SetLilycoveLadyGfx - compare VAR_RESULT, FALSE - goto_if_eq LilycoveCity_PokemonCenter_1F_EventScript_HideContestLadyMon - compare VAR_RESULT, TRUE - goto_if_eq LilycoveCity_PokemonCenter_1F_EventScript_ShowContestLadyMon + goto_if_eq VAR_RESULT, FALSE, LilycoveCity_PokemonCenter_1F_EventScript_HideContestLadyMon + goto_if_eq VAR_RESULT, TRUE, LilycoveCity_PokemonCenter_1F_EventScript_ShowContestLadyMon end LilycoveCity_PokemonCenter_1F_EventScript_HideContestLadyMon:: diff --git a/data/maps/LilycoveCity_PokemonTrainerFanClub/scripts.inc b/data/maps/LilycoveCity_PokemonTrainerFanClub/scripts.inc index 63e70848805a..ba8001324a06 100644 --- a/data/maps/LilycoveCity_PokemonTrainerFanClub/scripts.inc +++ b/data/maps/LilycoveCity_PokemonTrainerFanClub/scripts.inc @@ -73,10 +73,8 @@ LilycoveCity_PokemonTrainerFanClub_Movement_LittleGirlHideFromPlayer: LilycoveCity_PokemonTrainerFanClub_OnTransition: call LilycoveCity_PokemonTrainerFanClub_EventScript_HideOrShowInterviewer - compare VAR_LILYCOVE_FAN_CLUB_STATE, 1 - goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_SetFanMemberPositionsForFirstFanMeeting - compare VAR_LILYCOVE_FAN_CLUB_STATE, 2 - goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_UpdateFanMemberPositions + goto_if_eq VAR_LILYCOVE_FAN_CLUB_STATE, 1, LilycoveCity_PokemonTrainerFanClub_EventScript_SetFanMemberPositionsForFirstFanMeeting + goto_if_eq VAR_LILYCOVE_FAN_CLUB_STATE, 2, LilycoveCity_PokemonTrainerFanClub_EventScript_UpdateFanMemberPositions end LilycoveCity_PokemonTrainerFanClub_EventScript_UpdateFanMemberPositions:: @@ -84,42 +82,33 @@ LilycoveCity_PokemonTrainerFanClub_EventScript_UpdateFanMemberPositions:: 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 + call_if_eq VAR_RESULT, FALSE, LilycoveCity_PokemonTrainerFanClub_EventScript_MoveMember1ToFarTable setvar VAR_0x8004, FANCLUB_MEMBER2 specialvar VAR_RESULT, IsFanClubMemberFanOfPlayer - compare VAR_RESULT, FALSE - call_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_MoveMember2ToFarTable + call_if_eq VAR_RESULT, FALSE, LilycoveCity_PokemonTrainerFanClub_EventScript_MoveMember2ToFarTable setvar VAR_0x8004, FANCLUB_MEMBER3 specialvar VAR_RESULT, IsFanClubMemberFanOfPlayer - compare VAR_RESULT, FALSE - call_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_MoveMember3ToFarTable + call_if_eq VAR_RESULT, FALSE, LilycoveCity_PokemonTrainerFanClub_EventScript_MoveMember3ToFarTable setvar VAR_0x8004, FANCLUB_MEMBER4 specialvar VAR_RESULT, IsFanClubMemberFanOfPlayer - compare VAR_RESULT, FALSE - call_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_MoveMember4ToFarTable + call_if_eq VAR_RESULT, FALSE, LilycoveCity_PokemonTrainerFanClub_EventScript_MoveMember4ToFarTable setvar VAR_0x8004, FANCLUB_MEMBER5 specialvar VAR_RESULT, IsFanClubMemberFanOfPlayer - compare VAR_RESULT, FALSE - call_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_MoveMember5ToFarTable + call_if_eq VAR_RESULT, FALSE, LilycoveCity_PokemonTrainerFanClub_EventScript_MoveMember5ToFarTable setvar VAR_0x8004, FANCLUB_MEMBER6 specialvar VAR_RESULT, IsFanClubMemberFanOfPlayer - compare VAR_RESULT, FALSE - call_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_MoveMember6ToFarTable + call_if_eq VAR_RESULT, FALSE, LilycoveCity_PokemonTrainerFanClub_EventScript_MoveMember6ToFarTable setvar VAR_0x8004, FANCLUB_MEMBER7 specialvar VAR_RESULT, IsFanClubMemberFanOfPlayer - compare VAR_RESULT, FALSE - call_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_MoveMember7ToFarTable + call_if_eq VAR_RESULT, FALSE, LilycoveCity_PokemonTrainerFanClub_EventScript_MoveMember7ToFarTable setvar VAR_0x8004, FANCLUB_MEMBER8 specialvar VAR_RESULT, IsFanClubMemberFanOfPlayer - compare VAR_RESULT, FALSE - call_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_MoveMember8ToFarTable + call_if_eq VAR_RESULT, FALSE, LilycoveCity_PokemonTrainerFanClub_EventScript_MoveMember8ToFarTable end LilycoveCity_PokemonTrainerFanClub_EventScript_HideOrShowInterviewer:: specialvar VAR_RESULT, ShouldHideFanClubInterviewer - compare VAR_RESULT, TRUE - goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_HideInterviewer + goto_if_eq VAR_RESULT, TRUE, LilycoveCity_PokemonTrainerFanClub_EventScript_HideInterviewer clearflag FLAG_HIDE_LILYCOVE_FAN_CLUB_INTERVIEWER clearflag FLAG_FAN_CLUB_STRENGTH_SHARED return @@ -134,38 +123,29 @@ LilycoveCity_PokemonTrainerFanClub_EventScript_CheckSetUpTVShow:: 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 + call_if_eq VAR_RESULT, FALSE, LilycoveCity_PokemonTrainerFanClub_EventScript_CountNotPlayersFan setvar VAR_0x8004, FANCLUB_MEMBER2 specialvar VAR_RESULT, IsFanClubMemberFanOfPlayer - compare VAR_RESULT, FALSE - call_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_CountNotPlayersFan + call_if_eq VAR_RESULT, FALSE, LilycoveCity_PokemonTrainerFanClub_EventScript_CountNotPlayersFan setvar VAR_0x8004, FANCLUB_MEMBER3 specialvar VAR_RESULT, IsFanClubMemberFanOfPlayer - compare VAR_RESULT, FALSE - call_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_CountNotPlayersFan + call_if_eq VAR_RESULT, FALSE, LilycoveCity_PokemonTrainerFanClub_EventScript_CountNotPlayersFan setvar VAR_0x8004, FANCLUB_MEMBER4 specialvar VAR_RESULT, IsFanClubMemberFanOfPlayer - compare VAR_RESULT, FALSE - call_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_CountNotPlayersFan + call_if_eq VAR_RESULT, FALSE, LilycoveCity_PokemonTrainerFanClub_EventScript_CountNotPlayersFan setvar VAR_0x8004, FANCLUB_MEMBER5 specialvar VAR_RESULT, IsFanClubMemberFanOfPlayer - compare VAR_RESULT, FALSE - call_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_CountNotPlayersFan + call_if_eq VAR_RESULT, FALSE, LilycoveCity_PokemonTrainerFanClub_EventScript_CountNotPlayersFan setvar VAR_0x8004, FANCLUB_MEMBER6 specialvar VAR_RESULT, IsFanClubMemberFanOfPlayer - compare VAR_RESULT, FALSE - call_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_CountNotPlayersFan + call_if_eq VAR_RESULT, FALSE, LilycoveCity_PokemonTrainerFanClub_EventScript_CountNotPlayersFan setvar VAR_0x8004, FANCLUB_MEMBER7 specialvar VAR_RESULT, IsFanClubMemberFanOfPlayer - compare VAR_RESULT, FALSE - call_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_CountNotPlayersFan + call_if_eq VAR_RESULT, FALSE, 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_TrySetUpTVShow + call_if_eq VAR_RESULT, FALSE, LilycoveCity_PokemonTrainerFanClub_EventScript_CountNotPlayersFan + goto_if_ge VAR_0x8005, 5, LilycoveCity_PokemonTrainerFanClub_EventScript_TrySetUpTVShow return LilycoveCity_PokemonTrainerFanClub_EventScript_CountNotPlayersFan:: @@ -222,22 +202,18 @@ LilycoveCity_PokemonTrainerFanClub_EventScript_Man:: faceplayer setvar VAR_0x8004, FANCLUB_MEMBER6 special BufferFanClubTrainerName - compare VAR_LILYCOVE_FAN_CLUB_STATE, 0 - goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_ManPlayerNotChampion + goto_if_eq VAR_LILYCOVE_FAN_CLUB_STATE, 0, LilycoveCity_PokemonTrainerFanClub_EventScript_ManPlayerNotChampion specialvar VAR_RESULT, IsFanClubMemberFanOfPlayer - compare VAR_RESULT, TRUE - goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_ManPlayersFan + goto_if_eq VAR_RESULT, TRUE, LilycoveCity_PokemonTrainerFanClub_EventScript_ManPlayersFan specialvar VAR_RESULT, GetNumFansOfPlayerInTrainerFanClub - compare VAR_RESULT, (NUM_TRAINER_FAN_CLUB_MEMBERS - 1) - goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_ManOnlyNonFan + goto_if_eq VAR_RESULT, (NUM_TRAINER_FAN_CLUB_MEMBERS - 1), LilycoveCity_PokemonTrainerFanClub_EventScript_ManOnlyNonFan msgbox LilycoveCity_PokemonTrainerFanClub_Text_TrainersPowerIsOutOfTheOrdinary, MSGBOX_DEFAULT release end LilycoveCity_PokemonTrainerFanClub_EventScript_ManPlayersFan:: specialvar VAR_RESULT, GetNumFansOfPlayerInTrainerFanClub - compare VAR_RESULT, 1 - goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_ManOnlyFan + goto_if_eq VAR_RESULT, 1, LilycoveCity_PokemonTrainerFanClub_EventScript_ManOnlyFan msgbox LilycoveCity_PokemonTrainerFanClub_Text_YoureOneWeWantToWin, MSGBOX_DEFAULT release end @@ -262,22 +238,18 @@ LilycoveCity_PokemonTrainerFanClub_EventScript_Lass:: faceplayer setvar VAR_0x8004, FANCLUB_MEMBER1 special BufferFanClubTrainerName - compare VAR_LILYCOVE_FAN_CLUB_STATE, 0 - goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_LassPlayerNotChampion + goto_if_eq VAR_LILYCOVE_FAN_CLUB_STATE, 0, LilycoveCity_PokemonTrainerFanClub_EventScript_LassPlayerNotChampion specialvar VAR_RESULT, IsFanClubMemberFanOfPlayer - compare VAR_RESULT, TRUE - goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_LassPlayersFan + goto_if_eq VAR_RESULT, TRUE, LilycoveCity_PokemonTrainerFanClub_EventScript_LassPlayersFan specialvar VAR_RESULT, GetNumFansOfPlayerInTrainerFanClub - compare VAR_RESULT, (NUM_TRAINER_FAN_CLUB_MEMBERS - 1) - goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_LassOnlyNonFan + goto_if_eq VAR_RESULT, (NUM_TRAINER_FAN_CLUB_MEMBERS - 1), LilycoveCity_PokemonTrainerFanClub_EventScript_LassOnlyNonFan msgbox LilycoveCity_PokemonTrainerFanClub_Text_ICantHelpLikingBrawly, MSGBOX_DEFAULT release end LilycoveCity_PokemonTrainerFanClub_EventScript_LassPlayersFan:: specialvar VAR_RESULT, GetNumFansOfPlayerInTrainerFanClub - compare VAR_RESULT, 1 - goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_LassOnlyFan + goto_if_eq VAR_RESULT, 1, LilycoveCity_PokemonTrainerFanClub_EventScript_LassOnlyFan msgbox LilycoveCity_PokemonTrainerFanClub_Text_ImPullingForYou, MSGBOX_DEFAULT release end @@ -302,22 +274,18 @@ LilycoveCity_PokemonTrainerFanClub_EventScript_PokefanM:: faceplayer setvar VAR_0x8004, FANCLUB_MEMBER2 special BufferFanClubTrainerName - compare VAR_LILYCOVE_FAN_CLUB_STATE, 0 - goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_PokefanMPlayerNotChampion + goto_if_eq VAR_LILYCOVE_FAN_CLUB_STATE, 0, LilycoveCity_PokemonTrainerFanClub_EventScript_PokefanMPlayerNotChampion specialvar VAR_RESULT, IsFanClubMemberFanOfPlayer - compare VAR_RESULT, TRUE - goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_PokefanMPlayersFan + goto_if_eq VAR_RESULT, TRUE, LilycoveCity_PokemonTrainerFanClub_EventScript_PokefanMPlayersFan specialvar VAR_RESULT, GetNumFansOfPlayerInTrainerFanClub - compare VAR_RESULT, (NUM_TRAINER_FAN_CLUB_MEMBERS - 1) - goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_PokefanMOnlyNonFan + goto_if_eq VAR_RESULT, (NUM_TRAINER_FAN_CLUB_MEMBERS - 1), LilycoveCity_PokemonTrainerFanClub_EventScript_PokefanMOnlyNonFan msgbox LilycoveCity_PokemonTrainerFanClub_Text_LongWayToGoComparedToNorman, MSGBOX_DEFAULT release end LilycoveCity_PokemonTrainerFanClub_EventScript_PokefanMPlayersFan:: specialvar VAR_RESULT, GetNumFansOfPlayerInTrainerFanClub - compare VAR_RESULT, 1 - goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_PokefanMOnlyFan + goto_if_eq VAR_RESULT, 1, LilycoveCity_PokemonTrainerFanClub_EventScript_PokefanMOnlyFan msgbox LilycoveCity_PokemonTrainerFanClub_Text_YouveSurpassedYourFather, MSGBOX_DEFAULT release end @@ -342,22 +310,18 @@ LilycoveCity_PokemonTrainerFanClub_EventScript_LittleGirl:: faceplayer setvar VAR_0x8004, FANCLUB_MEMBER3 special BufferFanClubTrainerName - compare VAR_LILYCOVE_FAN_CLUB_STATE, 0 - goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_LittleGirlPlayerNotChampion + goto_if_eq VAR_LILYCOVE_FAN_CLUB_STATE, 0, LilycoveCity_PokemonTrainerFanClub_EventScript_LittleGirlPlayerNotChampion specialvar VAR_RESULT, IsFanClubMemberFanOfPlayer - compare VAR_RESULT, TRUE - goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_LittleGirlPlayersFan + goto_if_eq VAR_RESULT, TRUE, LilycoveCity_PokemonTrainerFanClub_EventScript_LittleGirlPlayersFan specialvar VAR_RESULT, GetNumFansOfPlayerInTrainerFanClub - compare VAR_RESULT, (NUM_TRAINER_FAN_CLUB_MEMBERS - 1) - goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_LittleGirlOnlyNonFan + goto_if_eq VAR_RESULT, (NUM_TRAINER_FAN_CLUB_MEMBERS - 1), LilycoveCity_PokemonTrainerFanClub_EventScript_LittleGirlOnlyNonFan msgbox LilycoveCity_PokemonTrainerFanClub_Text_EveryoneThinksTrainerIsCool, MSGBOX_DEFAULT release end LilycoveCity_PokemonTrainerFanClub_EventScript_LittleGirlPlayersFan:: specialvar VAR_RESULT, GetNumFansOfPlayerInTrainerFanClub - compare VAR_RESULT, 1 - goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_LittleGirlOnlyFan + goto_if_eq VAR_RESULT, 1, LilycoveCity_PokemonTrainerFanClub_EventScript_LittleGirlOnlyFan msgbox LilycoveCity_PokemonTrainerFanClub_Text_OhWoweeItsPlayer, MSGBOX_DEFAULT release end @@ -383,19 +347,16 @@ LilycoveCity_PokemonTrainerFanClub_EventScript_NinjaBoy:: setvar VAR_0x8004, FANCLUB_MEMBER4 special BufferFanClubTrainerName specialvar VAR_RESULT, IsFanClubMemberFanOfPlayer - compare VAR_RESULT, TRUE - goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_NinjaBoyPlayersFan + goto_if_eq VAR_RESULT, TRUE, LilycoveCity_PokemonTrainerFanClub_EventScript_NinjaBoyPlayersFan specialvar VAR_RESULT, GetNumFansOfPlayerInTrainerFanClub - compare VAR_RESULT, (NUM_TRAINER_FAN_CLUB_MEMBERS - 1) - goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_NinjaBoyOnlyNonFan + goto_if_eq VAR_RESULT, (NUM_TRAINER_FAN_CLUB_MEMBERS - 1), LilycoveCity_PokemonTrainerFanClub_EventScript_NinjaBoyOnlyNonFan msgbox LilycoveCity_PokemonTrainerFanClub_Text_TrainerIsWickedlyCool, MSGBOX_DEFAULT release end LilycoveCity_PokemonTrainerFanClub_EventScript_NinjaBoyPlayersFan:: specialvar VAR_RESULT, GetNumFansOfPlayerInTrainerFanClub - compare VAR_RESULT, 1 - goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_NinjaBoyOnlyFan + goto_if_eq VAR_RESULT, 1, LilycoveCity_PokemonTrainerFanClub_EventScript_NinjaBoyOnlyFan msgbox LilycoveCity_PokemonTrainerFanClub_Text_WantToBeStrongLikeYou, MSGBOX_DEFAULT release end @@ -416,19 +377,16 @@ LilycoveCity_PokemonTrainerFanClub_EventScript_Boy:: setvar VAR_0x8004, FANCLUB_MEMBER5 special BufferFanClubTrainerName specialvar VAR_RESULT, IsFanClubMemberFanOfPlayer - compare VAR_RESULT, TRUE - goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_BoyPlayersFan + goto_if_eq VAR_RESULT, TRUE, LilycoveCity_PokemonTrainerFanClub_EventScript_BoyPlayersFan specialvar VAR_RESULT, GetNumFansOfPlayerInTrainerFanClub - compare VAR_RESULT, (NUM_TRAINER_FAN_CLUB_MEMBERS - 1) - goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_BoyOnlyNonFan + goto_if_eq VAR_RESULT, (NUM_TRAINER_FAN_CLUB_MEMBERS - 1), LilycoveCity_PokemonTrainerFanClub_EventScript_BoyOnlyNonFan msgbox LilycoveCity_PokemonTrainerFanClub_Text_ThinkTrainerIsNumberOne, MSGBOX_DEFAULT release end LilycoveCity_PokemonTrainerFanClub_EventScript_BoyPlayersFan:: specialvar VAR_RESULT, GetNumFansOfPlayerInTrainerFanClub - compare VAR_RESULT, 1 - goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_BoyOnlyFan + goto_if_eq VAR_RESULT, 1, LilycoveCity_PokemonTrainerFanClub_EventScript_BoyOnlyFan msgbox LilycoveCity_PokemonTrainerFanClub_Text_YoureAmazingAfterAll, MSGBOX_DEFAULT release end @@ -449,19 +407,16 @@ LilycoveCity_PokemonTrainerFanClub_EventScript_Woman:: setvar VAR_0x8004, FANCLUB_MEMBER7 special BufferFanClubTrainerName specialvar VAR_RESULT, IsFanClubMemberFanOfPlayer - compare VAR_RESULT, TRUE - goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_WomanPlayersFan + goto_if_eq VAR_RESULT, TRUE, LilycoveCity_PokemonTrainerFanClub_EventScript_WomanPlayersFan specialvar VAR_RESULT, GetNumFansOfPlayerInTrainerFanClub - compare VAR_RESULT, (NUM_TRAINER_FAN_CLUB_MEMBERS - 1) - goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_WomanOnlyNonFan + goto_if_eq VAR_RESULT, (NUM_TRAINER_FAN_CLUB_MEMBERS - 1), LilycoveCity_PokemonTrainerFanClub_EventScript_WomanOnlyNonFan msgbox LilycoveCity_PokemonTrainerFanClub_Text_TrainerIsStandout, MSGBOX_DEFAULT release end LilycoveCity_PokemonTrainerFanClub_EventScript_WomanPlayersFan:: specialvar VAR_RESULT, GetNumFansOfPlayerInTrainerFanClub - compare VAR_RESULT, 1 - goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_WomanOnlyFan + goto_if_eq VAR_RESULT, 1, LilycoveCity_PokemonTrainerFanClub_EventScript_WomanOnlyFan msgbox LilycoveCity_PokemonTrainerFanClub_Text_YouChangedMyMind, MSGBOX_DEFAULT release end @@ -482,19 +437,16 @@ LilycoveCity_PokemonTrainerFanClub_EventScript_ExpertF:: setvar VAR_0x8004, FANCLUB_MEMBER8 special BufferFanClubTrainerName specialvar VAR_RESULT, IsFanClubMemberFanOfPlayer - compare VAR_RESULT, TRUE - goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_ExpertFPlayersFan + goto_if_eq VAR_RESULT, TRUE, LilycoveCity_PokemonTrainerFanClub_EventScript_ExpertFPlayersFan specialvar VAR_RESULT, GetNumFansOfPlayerInTrainerFanClub - compare VAR_RESULT, (NUM_TRAINER_FAN_CLUB_MEMBERS - 1) - goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_ExpertFOnlyNonFan + goto_if_eq VAR_RESULT, (NUM_TRAINER_FAN_CLUB_MEMBERS - 1), LilycoveCity_PokemonTrainerFanClub_EventScript_ExpertFOnlyNonFan msgbox LilycoveCity_PokemonTrainerFanClub_Text_HaventRealizedPotential, MSGBOX_DEFAULT release end LilycoveCity_PokemonTrainerFanClub_EventScript_ExpertFPlayersFan:: specialvar VAR_RESULT, GetNumFansOfPlayerInTrainerFanClub - compare VAR_RESULT, 1 - goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_ExpertFOnlyFan + goto_if_eq VAR_RESULT, 1, LilycoveCity_PokemonTrainerFanClub_EventScript_ExpertFOnlyFan msgbox LilycoveCity_PokemonTrainerFanClub_Text_YouImpressive, MSGBOX_DEFAULT release end @@ -521,8 +473,7 @@ LilycoveCity_PokemonTrainerFanClub_EventScript_Interviewer:: LilycoveCity_PokemonTrainerFanClub_EventScript_Interview:: setvar VAR_0x8005, TVSHOW_FAN_CLUB_SPECIAL special InterviewBefore - compare VAR_RESULT, TRUE - goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_AlreadyInterviewed2 + goto_if_eq VAR_RESULT, TRUE, LilycoveCity_PokemonTrainerFanClub_EventScript_AlreadyInterviewed2 copyvar VAR_0x800A, VAR_0x8006 setvar VAR_0x8004, FANCLUB_MEMBER1 special BufferFanClubTrainerName @@ -532,10 +483,8 @@ LilycoveCity_PokemonTrainerFanClub_EventScript_Interview:: call Common_ShowEasyChatScreen lock faceplayer - compare VAR_RESULT, 1 - goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_SubmitOpinion - compare VAR_RESULT, 0 - goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_CancelGiveOpinion + goto_if_eq VAR_RESULT, 1, LilycoveCity_PokemonTrainerFanClub_EventScript_SubmitOpinion + goto_if_eq VAR_RESULT, 0, LilycoveCity_PokemonTrainerFanClub_EventScript_CancelGiveOpinion end LilycoveCity_PokemonTrainerFanClub_EventScript_SubmitOpinion:: @@ -547,10 +496,8 @@ LilycoveCity_PokemonTrainerFanClub_EventScript_CancelGiveOpinion:: 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 - compare VAR_RESULT, NO - goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_AskForOpinion + goto_if_eq VAR_RESULT, YES, LilycoveCity_PokemonTrainerFanClub_EventScript_ForgetTrainer + goto_if_eq VAR_RESULT, NO, LilycoveCity_PokemonTrainerFanClub_EventScript_AskForOpinion end LilycoveCity_PokemonTrainerFanClub_EventScript_AskForOpinion:: @@ -562,10 +509,8 @@ LilycoveCity_PokemonTrainerFanClub_EventScript_AskForOpinion:: call Common_ShowEasyChatScreen lock faceplayer - compare VAR_RESULT, 1 - goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_SubmitOpinion - compare VAR_RESULT, 0 - goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_CancelGiveOpinion + goto_if_eq VAR_RESULT, 1, LilycoveCity_PokemonTrainerFanClub_EventScript_SubmitOpinion + goto_if_eq VAR_RESULT, 0, LilycoveCity_PokemonTrainerFanClub_EventScript_CancelGiveOpinion end LilycoveCity_PokemonTrainerFanClub_EventScript_RateTrainer:: @@ -592,10 +537,8 @@ LilycoveCity_PokemonTrainerFanClub_EventScript_CancelRateTrainer:: 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 - compare VAR_RESULT, NO - goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_RateTrainer + goto_if_eq VAR_RESULT, YES, LilycoveCity_PokemonTrainerFanClub_EventScript_ForgetTrainer + goto_if_eq VAR_RESULT, NO, LilycoveCity_PokemonTrainerFanClub_EventScript_RateTrainer end LilycoveCity_PokemonTrainerFanClub_EventScript_ForgetTrainer:: diff --git a/data/maps/LittlerootTown/scripts.inc b/data/maps/LittlerootTown/scripts.inc index 1936b5ad8303..69961bf36230 100644 --- a/data/maps/LittlerootTown/scripts.inc +++ b/data/maps/LittlerootTown/scripts.inc @@ -42,23 +42,15 @@ LittlerootTown_MapScripts:: LittlerootTown_OnTransition: setflag FLAG_VISITED_LITTLEROOT_TOWN call Common_EventScript_SetupRivalGfxId - compare VAR_LITTLEROOT_INTRO_STATE, 2 - call_if_eq LittlerootTown_EventScript_MoveMomToMaysDoor + call_if_eq VAR_LITTLEROOT_INTRO_STATE, 2, LittlerootTown_EventScript_MoveMomToMaysDoor call_if_unset FLAG_RESCUED_BIRCH, LittlerootTown_EventScript_SetTwinPos - compare VAR_LITTLEROOT_TOWN_STATE, 3 - call_if_eq LittlerootTown_EventScript_SetMomStandingInFrontOfDoorPos - compare VAR_LITTLEROOT_HOUSES_STATE_MAY, 4 - call_if_eq LittlerootTown_EventScript_SetExitedHouseAfterLatiSSTicketEvent - compare VAR_LITTLEROOT_HOUSES_STATE_BRENDAN, 4 - call_if_eq LittlerootTown_EventScript_SetExitedHouseAfterLatiSSTicketEvent - compare VAR_OLDALE_RIVAL_STATE, 1 - call_if_eq LittlerootTown_EventScript_MoveRivalFromOldale - compare VAR_LITTLEROOT_RIVAL_STATE, 3 - call_if_eq LittlerootTown_EventScript_SetRivalLeftForRoute103 - compare VAR_DEX_UPGRADE_JOHTO_STARTER_STATE, 1 - call_if_eq LittlerootTown_EventScript_HideMapNamePopup - compare VAR_DEX_UPGRADE_JOHTO_STARTER_STATE, 2 - call_if_eq LittlerootTown_EventScript_LeftLabAfterDexUpgrade + call_if_eq VAR_LITTLEROOT_TOWN_STATE, 3, LittlerootTown_EventScript_SetMomStandingInFrontOfDoorPos + call_if_eq VAR_LITTLEROOT_HOUSES_STATE_MAY, 4, LittlerootTown_EventScript_SetExitedHouseAfterLatiSSTicketEvent + call_if_eq VAR_LITTLEROOT_HOUSES_STATE_BRENDAN, 4, LittlerootTown_EventScript_SetExitedHouseAfterLatiSSTicketEvent + call_if_eq VAR_OLDALE_RIVAL_STATE, 1, LittlerootTown_EventScript_MoveRivalFromOldale + call_if_eq VAR_LITTLEROOT_RIVAL_STATE, 3, LittlerootTown_EventScript_SetRivalLeftForRoute103 + call_if_eq VAR_DEX_UPGRADE_JOHTO_STARTER_STATE, 1, LittlerootTown_EventScript_HideMapNamePopup + call_if_eq VAR_DEX_UPGRADE_JOHTO_STARTER_STATE, 2, LittlerootTown_EventScript_LeftLabAfterDexUpgrade end LittlerootTown_EventScript_LeftLabAfterDexUpgrade:: @@ -88,8 +80,7 @@ LittlerootTown_EventScript_MoveMomToMaysDoor:: return LittlerootTown_EventScript_SetTwinPos:: - compare VAR_LITTLEROOT_TOWN_STATE, 0 - goto_if_eq LittlerootTown_EventScript_SetTwinGuardingRoutePos + goto_if_eq VAR_LITTLEROOT_TOWN_STATE, 0, LittlerootTown_EventScript_SetTwinGuardingRoutePos setobjectxyperm LOCALID_TWIN, 10, 1 setobjectmovementtype LOCALID_TWIN, MOVEMENT_TYPE_FACE_UP return @@ -103,10 +94,8 @@ LittlerootTown_EventScript_SetMomStandingInFrontOfDoorPos:: clearflag FLAG_HIDE_LITTLEROOT_TOWN_MOM_OUTSIDE setobjectmovementtype LOCALID_MOM, MOVEMENT_TYPE_FACE_DOWN checkplayergender - compare VAR_RESULT, MALE - call_if_eq LittlerootTown_EventScript_SetMomInFrontOfDoorMale - compare VAR_RESULT, FEMALE - call_if_eq LittlerootTown_EventScript_SetMomInFrontOfDoorFemale + call_if_eq VAR_RESULT, MALE, LittlerootTown_EventScript_SetMomInFrontOfDoorMale + call_if_eq VAR_RESULT, FEMALE, LittlerootTown_EventScript_SetMomInFrontOfDoorFemale return LittlerootTown_EventScript_SetMomInFrontOfDoorMale:: @@ -129,7 +118,7 @@ LittlerootTown_EventScript_StepOffTruckMale:: setvar VAR_0x8005, 8 call LittlerootTown_EventScript_GoInsideWithMom setflag FLAG_HIDE_LITTLEROOT_TOWN_BRENDANS_HOUSE_TRUCK - warpsilent MAP_LITTLEROOT_TOWN_BRENDANS_HOUSE_1F, 255, 8, 8 + warpsilent MAP_LITTLEROOT_TOWN_BRENDANS_HOUSE_1F, 8, 8 waitstate releaseall end @@ -140,7 +129,7 @@ LittlerootTown_EventScript_StepOffTruckFemale:: setvar VAR_0x8005, 8 call LittlerootTown_EventScript_GoInsideWithMom setflag FLAG_HIDE_LITTLEROOT_TOWN_MAYS_HOUSE_TRUCK - warpsilent MAP_LITTLEROOT_TOWN_MAYS_HOUSE_1F, 255, 2, 8 + warpsilent MAP_LITTLEROOT_TOWN_MAYS_HOUSE_1F, 2, 8 waitstate releaseall end @@ -230,7 +219,7 @@ LittlerootTown_EventScript_BeginDexUpgradeScene:: clearflag FLAG_HIDE_LITTLEROOT_TOWN_BIRCH delay 20 clearflag FLAG_HIDE_MAP_NAME_POPUP - warp MAP_LITTLEROOT_TOWN_PROFESSOR_BIRCHS_LAB, 255, 6, 5 + warp MAP_LITTLEROOT_TOWN_PROFESSOR_BIRCHS_LAB, 6, 5 waitstate releaseall end @@ -243,8 +232,7 @@ LittlerootTown_EventScript_SetRivalBirchPosForDexUpgrade:: addobject LOCALID_BIRCH addobject LOCALID_RIVAL checkplayergender - compare VAR_RESULT, MALE - goto_if_eq LittlerootTown_EventScript_SetRivalBirchPosForDexUpgradeMale + goto_if_eq VAR_RESULT, MALE, LittlerootTown_EventScript_SetRivalBirchPosForDexUpgradeMale goto LittlerootTown_EventScript_SetRivalBirchPosForDexUpgradeFemale end @@ -271,8 +259,7 @@ LittlerootTown_EventScript_Twin:: faceplayer goto_if_set FLAG_ADVENTURE_STARTED, LittlerootTown_EventScript_GoodLuck goto_if_set FLAG_RESCUED_BIRCH, LittlerootTown_EventScript_YouSavedBirch - compare VAR_LITTLEROOT_TOWN_STATE, 0 - goto_if_ne LittlerootTown_EventScript_GoSaveBirch + goto_if_ne VAR_LITTLEROOT_TOWN_STATE, 0, LittlerootTown_EventScript_GoSaveBirch msgbox LittlerootTown_Text_IfYouGoInGrassPokemonWillJumpOut, MSGBOX_DEFAULT release end @@ -416,10 +403,8 @@ LittlerootTown_EventScript_BirchsLabSign:: LittlerootTown_EventScript_BrendansHouseSign:: lockall checkplayergender - compare VAR_RESULT, MALE - call_if_eq LittlerootTown_EventScript_PlayersHouseSignMale - compare VAR_RESULT, FEMALE - call_if_eq LittlerootTown_EventScript_BirchsHouseSignFemale + call_if_eq VAR_RESULT, MALE, LittlerootTown_EventScript_PlayersHouseSignMale + call_if_eq VAR_RESULT, FEMALE, LittlerootTown_EventScript_BirchsHouseSignFemale releaseall end @@ -434,10 +419,8 @@ LittlerootTown_EventScript_BirchsHouseSignFemale:: LittlerootTown_EventScript_MaysHouseSign:: lockall checkplayergender - compare VAR_RESULT, MALE - call_if_eq LittlerootTown_EventScript_BirchsHouseSignMale - compare VAR_RESULT, FEMALE - call_if_eq LittlerootTown_EventScript_PlayersHouseSignFemale + call_if_eq VAR_RESULT, MALE, LittlerootTown_EventScript_BirchsHouseSignMale + call_if_eq VAR_RESULT, FEMALE, LittlerootTown_EventScript_PlayersHouseSignFemale releaseall end @@ -489,28 +472,20 @@ LittlerootTown_EventScript_GiveRunningShoesTrigger5:: LittlerootTown_EventScript_GiveRunningShoesTrigger:: checkplayergender - compare VAR_RESULT, MALE - call_if_eq LittlerootTown_EventScript_MomNoticePlayerMale - compare VAR_RESULT, FEMALE - call_if_eq LittlerootTown_EventScript_MomNoticePlayerFemale + call_if_eq VAR_RESULT, MALE, LittlerootTown_EventScript_MomNoticePlayerMale + call_if_eq VAR_RESULT, FEMALE, LittlerootTown_EventScript_MomNoticePlayerFemale checkplayergender - compare VAR_RESULT, MALE - call_if_eq LittlerootTown_EventScript_SetHomeDoorCoordsMale - compare VAR_RESULT, FEMALE - call_if_eq LittlerootTown_EventScript_SetHomeDoorCoordsFemale + call_if_eq VAR_RESULT, MALE, LittlerootTown_EventScript_SetHomeDoorCoordsMale + call_if_eq VAR_RESULT, FEMALE, LittlerootTown_EventScript_SetHomeDoorCoordsFemale msgbox LittlerootTown_Text_WaitPlayer, MSGBOX_DEFAULT closemessage checkplayergender - compare VAR_RESULT, MALE - call_if_eq LittlerootTown_EventScript_MomApproachPlayerMale - compare VAR_RESULT, FEMALE - call_if_eq LittlerootTown_EventScript_MomApproachPlayerFemale + call_if_eq VAR_RESULT, MALE, LittlerootTown_EventScript_MomApproachPlayerMale + call_if_eq VAR_RESULT, FEMALE, LittlerootTown_EventScript_MomApproachPlayerFemale call LittlerootTown_EventScript_GiveRunningShoes checkplayergender - compare VAR_RESULT, MALE - call_if_eq LittlerootTown_EventScript_MomReturnHomeMale - compare VAR_RESULT, FEMALE - call_if_eq LittlerootTown_EventScript_MomReturnHomeFemale + call_if_eq VAR_RESULT, MALE, LittlerootTown_EventScript_MomReturnHomeMale + call_if_eq VAR_RESULT, FEMALE, LittlerootTown_EventScript_MomReturnHomeFemale goto LittlerootTown_EventScript_SetReceivedRunningShoes end @@ -535,33 +510,21 @@ LittlerootTown_EventScript_MomNoticePlayerFemale:: return LittlerootTown_EventScript_MomApproachPlayerMale:: - compare VAR_0x8008, 0 - call_if_eq LittlerootTown_EventScript_MomApproachPlayer0 - compare VAR_0x8008, 1 - call_if_eq LittlerootTown_EventScript_MomApproachPlayer1 - compare VAR_0x8008, 2 - call_if_eq LittlerootTown_EventScript_MomApproachPlayerMale2 - compare VAR_0x8008, 3 - call_if_eq LittlerootTown_EventScript_MomApproachPlayerMale3 - compare VAR_0x8008, 4 - call_if_eq LittlerootTown_EventScript_MomApproachPlayerMale4 - compare VAR_0x8008, 5 - call_if_eq LittlerootTown_EventScript_MomApproachPlayerMale5 + call_if_eq VAR_0x8008, 0, LittlerootTown_EventScript_MomApproachPlayer0 + call_if_eq VAR_0x8008, 1, LittlerootTown_EventScript_MomApproachPlayer1 + call_if_eq VAR_0x8008, 2, LittlerootTown_EventScript_MomApproachPlayerMale2 + call_if_eq VAR_0x8008, 3, LittlerootTown_EventScript_MomApproachPlayerMale3 + call_if_eq VAR_0x8008, 4, LittlerootTown_EventScript_MomApproachPlayerMale4 + call_if_eq VAR_0x8008, 5, LittlerootTown_EventScript_MomApproachPlayerMale5 return LittlerootTown_EventScript_MomApproachPlayerFemale:: - compare VAR_0x8008, 0 - call_if_eq LittlerootTown_EventScript_MomApproachPlayer0 - compare VAR_0x8008, 1 - call_if_eq LittlerootTown_EventScript_MomApproachPlayer1 - compare VAR_0x8008, 2 - call_if_eq LittlerootTown_EventScript_MomApproachPlayerFemale2 - compare VAR_0x8008, 3 - call_if_eq LittlerootTown_EventScript_MomApproachPlayerFemale3 - compare VAR_0x8008, 4 - call_if_eq LittlerootTown_EventScript_MomApproachPlayerFemale4 - compare VAR_0x8008, 5 - call_if_eq LittlerootTown_EventScript_MomApproachPlayerFemale5 + call_if_eq VAR_0x8008, 0, LittlerootTown_EventScript_MomApproachPlayer0 + call_if_eq VAR_0x8008, 1, LittlerootTown_EventScript_MomApproachPlayer1 + call_if_eq VAR_0x8008, 2, LittlerootTown_EventScript_MomApproachPlayerFemale2 + call_if_eq VAR_0x8008, 3, LittlerootTown_EventScript_MomApproachPlayerFemale3 + call_if_eq VAR_0x8008, 4, LittlerootTown_EventScript_MomApproachPlayerFemale4 + call_if_eq VAR_0x8008, 5, LittlerootTown_EventScript_MomApproachPlayerFemale5 return LittlerootTown_EventScript_MomApproachPlayer0:: @@ -635,33 +598,21 @@ LittlerootTown_EventScript_MomApproachPlayerFemale5:: return LittlerootTown_EventScript_MomReturnHomeMale:: - compare VAR_0x8008, 0 - call_if_eq LittlerootTown_EventScript_MomReturnHome0 - compare VAR_0x8008, 1 - call_if_eq LittlerootTown_EventScript_MomReturnHome1 - compare VAR_0x8008, 2 - call_if_eq LittlerootTown_EventScript_MomReturnHomeMale2 - compare VAR_0x8008, 3 - call_if_eq LittlerootTown_EventScript_MomReturnHomeMale3 - compare VAR_0x8008, 4 - call_if_eq LittlerootTown_EventScript_MomReturnHomeMale4 - compare VAR_0x8008, 5 - call_if_eq LittlerootTown_EventScript_MomReturnHomeMale5 + call_if_eq VAR_0x8008, 0, LittlerootTown_EventScript_MomReturnHome0 + call_if_eq VAR_0x8008, 1, LittlerootTown_EventScript_MomReturnHome1 + call_if_eq VAR_0x8008, 2, LittlerootTown_EventScript_MomReturnHomeMale2 + call_if_eq VAR_0x8008, 3, LittlerootTown_EventScript_MomReturnHomeMale3 + call_if_eq VAR_0x8008, 4, LittlerootTown_EventScript_MomReturnHomeMale4 + call_if_eq VAR_0x8008, 5, LittlerootTown_EventScript_MomReturnHomeMale5 return LittlerootTown_EventScript_MomReturnHomeFemale:: - compare VAR_0x8008, 0 - call_if_eq LittlerootTown_EventScript_MomReturnHome0 - compare VAR_0x8008, 1 - call_if_eq LittlerootTown_EventScript_MomReturnHome1 - compare VAR_0x8008, 2 - call_if_eq LittlerootTown_EventScript_MomReturnHomeFemale2 - compare VAR_0x8008, 3 - call_if_eq LittlerootTown_EventScript_MomReturnHomeFemale3 - compare VAR_0x8008, 4 - call_if_eq LittlerootTown_EventScript_MomReturnHomeFemale4 - compare VAR_0x8008, 5 - call_if_eq LittlerootTown_EventScript_MomReturnHomeFemale5 + call_if_eq VAR_0x8008, 0, LittlerootTown_EventScript_MomReturnHome0 + call_if_eq VAR_0x8008, 1, LittlerootTown_EventScript_MomReturnHome1 + call_if_eq VAR_0x8008, 2, LittlerootTown_EventScript_MomReturnHomeFemale2 + call_if_eq VAR_0x8008, 3, LittlerootTown_EventScript_MomReturnHomeFemale3 + call_if_eq VAR_0x8008, 4, LittlerootTown_EventScript_MomReturnHomeFemale4 + call_if_eq VAR_0x8008, 5, LittlerootTown_EventScript_MomReturnHomeFemale5 return LittlerootTown_EventScript_MomReturnHome0:: @@ -924,10 +875,8 @@ LittlerootTown_EventScript_Mom:: lock faceplayer checkplayergender - compare VAR_RESULT, MALE - call_if_eq LittlerootTown_EventScript_SetHomeDoorCoordsMale - compare VAR_RESULT, FEMALE - call_if_eq LittlerootTown_EventScript_SetHomeDoorCoordsFemale + call_if_eq VAR_RESULT, MALE, LittlerootTown_EventScript_SetHomeDoorCoordsMale + call_if_eq VAR_RESULT, FEMALE, LittlerootTown_EventScript_SetHomeDoorCoordsFemale call LittlerootTown_EventScript_GiveRunningShoes applymovement LOCALID_MOM, Common_Movement_WalkInPlaceFasterUp waitmovement 0 diff --git a/data/maps/LittlerootTown_BrendansHouse_1F/scripts.inc b/data/maps/LittlerootTown_BrendansHouse_1F/scripts.inc index 2e4ff739d133..cce8cd59b921 100644 --- a/data/maps/LittlerootTown_BrendansHouse_1F/scripts.inc +++ b/data/maps/LittlerootTown_BrendansHouse_1F/scripts.inc @@ -9,33 +9,28 @@ LittlerootTown_BrendansHouse_1F_MapScripts:: .byte 0 LittlerootTown_BrendansHouse_1F_OnLoad: - compare VAR_LITTLEROOT_INTRO_STATE, 6 - call_if_lt LittlerootTown_BrendansHouse_1F_EventScript_SetMovingBoxes + call_if_lt VAR_LITTLEROOT_INTRO_STATE, 6, LittlerootTown_BrendansHouse_1F_EventScript_SetMovingBoxes call_if_set FLAG_RECEIVED_RUNNING_SHOES, LittlerootTown_BrendansHouse_1F_EventScript_CheckShowShoesManual end LittlerootTown_BrendansHouse_1F_EventScript_SetMovingBoxes:: - setmetatile 5, 4, METATILE_BrendansMaysHouse_MovingBox_Open, 1 - setmetatile 5, 2, METATILE_BrendansMaysHouse_MovingBox_Closed, 1 + setmetatile 5, 4, METATILE_BrendansMaysHouse_MovingBox_Open, TRUE + setmetatile 5, 2, METATILE_BrendansMaysHouse_MovingBox_Closed, TRUE return LittlerootTown_BrendansHouse_1F_EventScript_CheckShowShoesManual:: checkplayergender - compare VAR_RESULT, MALE - goto_if_eq LittlerootTown_BrendansHouse_1F_EventScript_ShowRunningShoesManual + goto_if_eq VAR_RESULT, MALE, LittlerootTown_BrendansHouse_1F_EventScript_ShowRunningShoesManual return LittlerootTown_BrendansHouse_1F_EventScript_ShowRunningShoesManual:: - setmetatile 3, 7, METATILE_BrendansMaysHouse_BookOnTable, 1 + setmetatile 3, 7, METATILE_BrendansMaysHouse_BookOnTable, TRUE return LittlerootTown_BrendansHouse_1F_OnTransition: - compare VAR_LITTLEROOT_INTRO_STATE, 3 - call_if_eq LittlerootTown_BrendansHouse_1F_EventScript_MoveMomToDoor - compare VAR_LITTLEROOT_INTRO_STATE, 5 - call_if_eq LittlerootTown_BrendansHouse_1F_EventScript_MoveMomToStairs - compare VAR_LITTLEROOT_INTRO_STATE, 6 - call_if_eq LittlerootTown_BrendansHouse_1F_EventScript_MoveMomToTV + call_if_eq VAR_LITTLEROOT_INTRO_STATE, 3, LittlerootTown_BrendansHouse_1F_EventScript_MoveMomToDoor + call_if_eq VAR_LITTLEROOT_INTRO_STATE, 5, LittlerootTown_BrendansHouse_1F_EventScript_MoveMomToStairs + call_if_eq VAR_LITTLEROOT_INTRO_STATE, 6, LittlerootTown_BrendansHouse_1F_EventScript_MoveMomToTV end LittlerootTown_BrendansHouse_1F_EventScript_MoveMomToStairs:: @@ -70,7 +65,7 @@ LittlerootTown_BrendansHouse_1F_EventScript_GoUpstairsToSetClock:: applymovement OBJ_EVENT_ID_PLAYER, LittlerootTown_BrendansHouse_1F_Movement_PushTowardStairs applymovement LOCALID_MOM, LittlerootTown_BrendansHouse_1F_Movement_PushTowardStairs waitmovement 0 - warp MAP_LITTLEROOT_TOWN_BRENDANS_HOUSE_2F, 255, 7, 1 + warp MAP_LITTLEROOT_TOWN_BRENDANS_HOUSE_2F, 7, 1 waitstate releaseall end @@ -156,23 +151,16 @@ LittlerootTown_BrendansHouse_1F_EventScript_MeetRival:: waitmovement 0 applymovement LOCALID_RIVAL, Common_Movement_Delay48 waitmovement 0 - compare VAR_0x8008, 1 - call_if_ne LittlerootTown_BrendansHouse_1F_EventScript_PlayerFaceBrendan + call_if_ne VAR_0x8008, 1, LittlerootTown_BrendansHouse_1F_EventScript_PlayerFaceBrendan playbgm MUS_ENCOUNTER_BRENDAN, TRUE - compare VAR_0x8008, 0 - call_if_eq LittlerootTown_BrendansHouse_1F_EventScript_BrendanApproachPlayer0 - compare VAR_0x8008, 1 - call_if_eq LittlerootTown_BrendansHouse_1F_EventScript_BrendanApproachPlayer1 - compare VAR_0x8008, 2 - call_if_eq LittlerootTown_BrendansHouse_1F_EventScript_BrendanApproachPlayer2 + call_if_eq VAR_0x8008, 0, LittlerootTown_BrendansHouse_1F_EventScript_BrendanApproachPlayer0 + call_if_eq VAR_0x8008, 1, LittlerootTown_BrendansHouse_1F_EventScript_BrendanApproachPlayer1 + call_if_eq VAR_0x8008, 2, LittlerootTown_BrendansHouse_1F_EventScript_BrendanApproachPlayer2 msgbox RivalsHouse_1F_Text_BrendanWhoAreYou, MSGBOX_DEFAULT closemessage - compare VAR_0x8008, 0 - call_if_eq LittlerootTown_BrendansHouse_1F_EventScript_BrendanGoUpstairs0 - compare VAR_0x8008, 1 - call_if_eq LittlerootTown_BrendansHouse_1F_EventScript_BrendanGoUpstairs1 - compare VAR_0x8008, 2 - call_if_eq LittlerootTown_BrendansHouse_1F_EventScript_BrendanGoUpstairs2 + call_if_eq VAR_0x8008, 0, LittlerootTown_BrendansHouse_1F_EventScript_BrendanGoUpstairs0 + call_if_eq VAR_0x8008, 1, LittlerootTown_BrendansHouse_1F_EventScript_BrendanGoUpstairs1 + call_if_eq VAR_0x8008, 2, LittlerootTown_BrendansHouse_1F_EventScript_BrendanGoUpstairs2 playse SE_EXIT removeobject LOCALID_RIVAL setflag FLAG_HIDE_LITTLEROOT_TOWN_BRENDANS_HOUSE_BRENDAN diff --git a/data/maps/LittlerootTown_BrendansHouse_2F/scripts.inc b/data/maps/LittlerootTown_BrendansHouse_2F/scripts.inc index b4db71e2901f..993172683322 100644 --- a/data/maps/LittlerootTown_BrendansHouse_2F/scripts.inc +++ b/data/maps/LittlerootTown_BrendansHouse_2F/scripts.inc @@ -6,28 +6,23 @@ LittlerootTown_BrendansHouse_2F_MapScripts:: .byte 0 LittlerootTown_BrendansHouse_2F_OnTransition: - compare VAR_LITTLEROOT_RIVAL_STATE, 2 - call_if_lt LittlerootTown_BrendansHouse_2F_EventScript_CheckSetReadyToMeetBrendan - compare VAR_LITTLEROOT_RIVAL_STATE, 3 - call_if_ge LittlerootTown_BrendansHouse_2F_EventScript_CheckShouldUpdateBrendanPos - compare VAR_LITTLEROOT_INTRO_STATE, 4 - call_if_eq PlayersHouse_2F_EventScript_BlockStairsUntilClockIsSet + call_if_lt VAR_LITTLEROOT_RIVAL_STATE, 2, LittlerootTown_BrendansHouse_2F_EventScript_CheckSetReadyToMeetBrendan + call_if_ge VAR_LITTLEROOT_RIVAL_STATE, 3, LittlerootTown_BrendansHouse_2F_EventScript_CheckShouldUpdateBrendanPos + call_if_eq VAR_LITTLEROOT_INTRO_STATE, 4, PlayersHouse_2F_EventScript_BlockStairsUntilClockIsSet call SecretBase_EventScript_SetDecorationFlags setvar VAR_SECRET_BASE_INITIALIZED, 0 end LittlerootTown_BrendansHouse_2F_EventScript_CheckShouldUpdateBrendanPos:: goto_if_set FLAG_MET_RIVAL_LILYCOVE, LittlerootTown_BrendansHouse_2F_EventScript_TryUpdateBrendanPos - compare VAR_BIRCH_LAB_STATE, 2 - goto_if_ge LittlerootTown_BrendansHouse_2F_EventScript_Ret + goto_if_ge VAR_BIRCH_LAB_STATE, 2, LittlerootTown_BrendansHouse_2F_EventScript_Ret goto LittlerootTown_BrendansHouse_2F_EventScript_TryUpdateBrendanPos LittlerootTown_BrendansHouse_2F_EventScript_TryUpdateBrendanPos:: checkplayergender - compare VAR_RESULT, MALE - goto_if_eq LittlerootTown_BrendansHouse_2F_EventScript_Ret - compare VAR_DEX_UPGRADE_JOHTO_STARTER_STATE, 2 - goto_if_ge LittlerootTown_MaysHouse_2F_EventScript_Ret @ Odd that the MaysHouse equivalent was used here instead + goto_if_eq VAR_RESULT, MALE, LittlerootTown_BrendansHouse_2F_EventScript_Ret + @ Odd that the MaysHouse equivalent was used below instead + goto_if_ge VAR_DEX_UPGRADE_JOHTO_STARTER_STATE, 2 LittlerootTown_MaysHouse_2F_EventScript_Ret setobjectxyperm LOCALID_RIVAL, 0, 2 setobjectmovementtype LOCALID_RIVAL, MOVEMENT_TYPE_FACE_UP return @@ -37,8 +32,7 @@ LittlerootTown_BrendansHouse_2F_EventScript_Ret:: LittlerootTown_BrendansHouse_2F_EventScript_CheckSetReadyToMeetBrendan:: checkplayergender - compare VAR_RESULT, FEMALE - goto_if_eq LittlerootTown_BrendansHouse_2F_EventScript_SetReadyToMeetBrendan + goto_if_eq VAR_RESULT, FEMALE, LittlerootTown_BrendansHouse_2F_EventScript_SetReadyToMeetBrendan return LittlerootTown_BrendansHouse_2F_EventScript_SetReadyToMeetBrendan:: @@ -51,14 +45,12 @@ LittlerootTown_BrendansHouse_2F_OnWarp: LittlerootTown_BrendansHouse_2F_EventScript_CheckInitDecor:: checkplayergender - compare VAR_RESULT, MALE - goto_if_eq SecretBase_EventScript_InitDecorations + goto_if_eq VAR_RESULT, MALE, SecretBase_EventScript_InitDecorations end LittlerootTown_BrendansHouse_2F_EventScript_RivalsPokeBall:: lockall - compare VAR_LITTLEROOT_RIVAL_STATE, 2 - goto_if_eq LittlerootTown_BrendansHouse_2F_EventScript_MeetBrendan + goto_if_eq VAR_LITTLEROOT_RIVAL_STATE, 2, LittlerootTown_BrendansHouse_2F_EventScript_MeetBrendan msgbox RivalsHouse_2F_Text_ItsRivalsPokeBall, MSGBOX_DEFAULT releaseall end @@ -75,14 +67,10 @@ LittlerootTown_BrendansHouse_2F_EventScript_MeetBrendan:: waitmovement 0 delay 10 playbgm MUS_ENCOUNTER_BRENDAN, TRUE - compare VAR_FACING, DIR_NORTH - call_if_eq LittlerootTown_BrendansHouse_2F_EventScript_MeetBrendanNorth - compare VAR_FACING, DIR_SOUTH - call_if_eq LittlerootTown_BrendansHouse_2F_EventScript_MeetBrendanSouth - compare VAR_FACING, DIR_WEST - call_if_eq LittlerootTown_BrendansHouse_2F_EventScript_MeetBrendanWest - compare VAR_FACING, DIR_EAST - call_if_eq LittlerootTown_BrendansHouse_2F_EventScript_MeetBrendanEast + call_if_eq VAR_FACING, DIR_NORTH, LittlerootTown_BrendansHouse_2F_EventScript_MeetBrendanNorth + call_if_eq VAR_FACING, DIR_SOUTH, LittlerootTown_BrendansHouse_2F_EventScript_MeetBrendanSouth + call_if_eq VAR_FACING, DIR_WEST, LittlerootTown_BrendansHouse_2F_EventScript_MeetBrendanWest + call_if_eq VAR_FACING, DIR_EAST, LittlerootTown_BrendansHouse_2F_EventScript_MeetBrendanEast setvar VAR_LITTLEROOT_RIVAL_STATE, 3 setflag FLAG_HIDE_LITTLEROOT_TOWN_BRENDANS_HOUSE_2F_POKE_BALL clearflag FLAG_HIDE_LITTLEROOT_TOWN_BRENDANS_HOUSE_RIVAL_BEDROOM @@ -250,10 +238,8 @@ LittlerootTown_BrendansHouse_2F_Movement_PlayerWatchBrendanEast: LittlerootTown_BrendansHouse_2F_EventScript_PC:: lockall checkplayergender - compare VAR_RESULT, MALE - goto_if_eq LittlerootTown_BrendansHouse_2F_EventScript_CheckPlayersPC - compare VAR_RESULT, FEMALE - goto_if_eq LittlerootTown_BrendansHouse_2F_EventScript_CheckRivalsPC + goto_if_eq VAR_RESULT, MALE, LittlerootTown_BrendansHouse_2F_EventScript_CheckPlayersPC + goto_if_eq VAR_RESULT, FEMALE, LittlerootTown_BrendansHouse_2F_EventScript_CheckRivalsPC end LittlerootTown_BrendansHouse_2F_EventScript_CheckPlayersPC:: diff --git a/data/maps/LittlerootTown_MaysHouse_1F/scripts.inc b/data/maps/LittlerootTown_MaysHouse_1F/scripts.inc index 5fcec19512b1..b4c4775c334a 100644 --- a/data/maps/LittlerootTown_MaysHouse_1F/scripts.inc +++ b/data/maps/LittlerootTown_MaysHouse_1F/scripts.inc @@ -9,33 +9,28 @@ LittlerootTown_MaysHouse_1F_MapScripts:: .byte 0 LittlerootTown_MaysHouse_1F_OnLoad: - compare VAR_LITTLEROOT_INTRO_STATE, 6 - call_if_lt LittlerootTown_MaysHouse_1F_EventScript_SetMovingBoxes + call_if_lt VAR_LITTLEROOT_INTRO_STATE, 6, LittlerootTown_MaysHouse_1F_EventScript_SetMovingBoxes call_if_set FLAG_RECEIVED_RUNNING_SHOES, LittlerootTown_MaysHouse_1F_EventScript_CheckShowShoesManual end LittlerootTown_MaysHouse_1F_EventScript_SetMovingBoxes:: - setmetatile 5, 4, METATILE_BrendansMaysHouse_MovingBox_Open, 1 - setmetatile 5, 2, METATILE_BrendansMaysHouse_MovingBox_Closed, 1 + setmetatile 5, 4, METATILE_BrendansMaysHouse_MovingBox_Open, TRUE + setmetatile 5, 2, METATILE_BrendansMaysHouse_MovingBox_Closed, TRUE return LittlerootTown_MaysHouse_1F_EventScript_CheckShowShoesManual:: checkplayergender - compare VAR_RESULT, FEMALE - goto_if_eq LittlerootTown_MaysHouse_1F_EventScript_ShowRunningShoesManual + goto_if_eq VAR_RESULT, FEMALE, LittlerootTown_MaysHouse_1F_EventScript_ShowRunningShoesManual return LittlerootTown_MaysHouse_1F_EventScript_ShowRunningShoesManual:: - setmetatile 6, 7, METATILE_BrendansMaysHouse_BookOnTable, 1 + setmetatile 6, 7, METATILE_BrendansMaysHouse_BookOnTable, TRUE return LittlerootTown_MaysHouse_1F_OnTransition: - compare VAR_LITTLEROOT_INTRO_STATE, 3 - call_if_eq LittlerootTown_MaysHouse_1F_EventScript_MoveMomToDoor - compare VAR_LITTLEROOT_INTRO_STATE, 5 - call_if_eq LittlerootTown_MaysHouse_1F_EventScript_MoveMomToStairs - compare VAR_LITTLEROOT_INTRO_STATE, 6 - call_if_eq LittlerootTown_MaysHouse_1F_EventScript_MoveMomToTV + call_if_eq VAR_LITTLEROOT_INTRO_STATE, 3, LittlerootTown_MaysHouse_1F_EventScript_MoveMomToDoor + call_if_eq VAR_LITTLEROOT_INTRO_STATE, 5, LittlerootTown_MaysHouse_1F_EventScript_MoveMomToStairs + call_if_eq VAR_LITTLEROOT_INTRO_STATE, 6, LittlerootTown_MaysHouse_1F_EventScript_MoveMomToTV end LittlerootTown_MaysHouse_1F_EventScript_MoveMomToStairs:: @@ -69,7 +64,7 @@ LittlerootTown_MaysHouse_1F_EventScript_GoUpstairsToSetClock:: applymovement OBJ_EVENT_ID_PLAYER, LittlerootTown_MaysHouse_1F_Movement_PushTowardStairs applymovement LOCALID_MOM, LittlerootTown_MaysHouse_1F_Movement_PushTowardStairs waitmovement 0 - warp MAP_LITTLEROOT_TOWN_MAYS_HOUSE_2F, 255, 1, 1 + warp MAP_LITTLEROOT_TOWN_MAYS_HOUSE_2F, 1, 1 waitstate releaseall end @@ -123,8 +118,7 @@ RivalsHouse_1F_EventScript_RivalMom:: faceplayer goto_if_set FLAG_DEFEATED_RIVAL_ROUTE103, RivalsHouse_1F_EventScript_GoHomeEverySoOften goto_if_set FLAG_SYS_POKEMON_GET, RivalsHouse_1F_EventScript_RivalIsOnRoute103 - compare VAR_LITTLEROOT_RIVAL_STATE, 3 - goto_if_eq RivalsHouse_1F_EventScript_RivalTooBusy + goto_if_eq VAR_LITTLEROOT_RIVAL_STATE, 3, RivalsHouse_1F_EventScript_RivalTooBusy special GetRivalSonDaughterString msgbox RivalsHouse_1F_Text_LikeChildLikeFather, MSGBOX_DEFAULT release @@ -190,23 +184,16 @@ LittlerootTown_MaysHouse_1F_EventScript_MeetRival:: waitmovement 0 applymovement LOCALID_RIVAL, Common_Movement_Delay48 waitmovement 0 - compare VAR_0x8008, 1 - call_if_ne LittlerootTown_MaysHouse_1F_EventScript_PlayerFaceMay + call_if_ne VAR_0x8008, 1, LittlerootTown_MaysHouse_1F_EventScript_PlayerFaceMay playbgm MUS_ENCOUNTER_MAY, TRUE - compare VAR_0x8008, 0 - call_if_eq LittlerootTown_MaysHouse_1F_EventScript_MayApproachPlayer0 - compare VAR_0x8008, 1 - call_if_eq LittlerootTown_MaysHouse_1F_EventScript_MayApproachPlayer1 - compare VAR_0x8008, 2 - call_if_eq LittlerootTown_MaysHouse_1F_EventScript_MayApproachPlayer2 + call_if_eq VAR_0x8008, 0, LittlerootTown_MaysHouse_1F_EventScript_MayApproachPlayer0 + call_if_eq VAR_0x8008, 1, LittlerootTown_MaysHouse_1F_EventScript_MayApproachPlayer1 + call_if_eq VAR_0x8008, 2, LittlerootTown_MaysHouse_1F_EventScript_MayApproachPlayer2 msgbox RivalsHouse_1F_Text_MayWhoAreYou, MSGBOX_DEFAULT closemessage - compare VAR_0x8008, 0 - call_if_eq LittlerootTown_MaysHouse_1F_EventScript_MayGoUpstairs0 - compare VAR_0x8008, 1 - call_if_eq LittlerootTown_MaysHouse_1F_EventScript_MayGoUpstairs1 - compare VAR_0x8008, 2 - call_if_eq LittlerootTown_MaysHouse_1F_EventScript_MayGoUpstairs2 + call_if_eq VAR_0x8008, 0, LittlerootTown_MaysHouse_1F_EventScript_MayGoUpstairs0 + call_if_eq VAR_0x8008, 1, LittlerootTown_MaysHouse_1F_EventScript_MayGoUpstairs1 + call_if_eq VAR_0x8008, 2, LittlerootTown_MaysHouse_1F_EventScript_MayGoUpstairs2 playse SE_EXIT removeobject LOCALID_RIVAL setflag FLAG_HIDE_LITTLEROOT_TOWN_MAYS_HOUSE_MAY diff --git a/data/maps/LittlerootTown_MaysHouse_2F/scripts.inc b/data/maps/LittlerootTown_MaysHouse_2F/scripts.inc index af6877a8875a..7403f3fcf61a 100644 --- a/data/maps/LittlerootTown_MaysHouse_2F/scripts.inc +++ b/data/maps/LittlerootTown_MaysHouse_2F/scripts.inc @@ -6,28 +6,22 @@ LittlerootTown_MaysHouse_2F_MapScripts:: .byte 0 LittlerootTown_MaysHouse_2F_OnTransition: - compare VAR_LITTLEROOT_RIVAL_STATE, 2 - call_if_lt LittlerootTown_MaysHouse_2F_EventScript_CheckSetReadyToMeetMay - compare VAR_LITTLEROOT_RIVAL_STATE, 3 - call_if_ge LittlerootTown_MaysHouse_2F_EventScript_CheckShouldUpdateMayPos - compare VAR_LITTLEROOT_INTRO_STATE, 4 - call_if_eq PlayersHouse_2F_EventScript_BlockStairsUntilClockIsSet + call_if_lt VAR_LITTLEROOT_RIVAL_STATE, 2, LittlerootTown_MaysHouse_2F_EventScript_CheckSetReadyToMeetMay + call_if_ge VAR_LITTLEROOT_RIVAL_STATE, 3, LittlerootTown_MaysHouse_2F_EventScript_CheckShouldUpdateMayPos + call_if_eq VAR_LITTLEROOT_INTRO_STATE, 4, PlayersHouse_2F_EventScript_BlockStairsUntilClockIsSet call SecretBase_EventScript_SetDecorationFlags setvar VAR_SECRET_BASE_INITIALIZED, 0 end LittlerootTown_MaysHouse_2F_EventScript_CheckShouldUpdateMayPos:: goto_if_set FLAG_MET_RIVAL_LILYCOVE, LittlerootTown_MaysHouse_2F_EventScript_TryUpdateMayPos - compare VAR_BIRCH_LAB_STATE, 2 - goto_if_ge LittlerootTown_MaysHouse_2F_EventScript_Ret + goto_if_ge VAR_BIRCH_LAB_STATE, 2, LittlerootTown_MaysHouse_2F_EventScript_Ret goto LittlerootTown_MaysHouse_2F_EventScript_TryUpdateMayPos LittlerootTown_MaysHouse_2F_EventScript_TryUpdateMayPos:: checkplayergender - compare VAR_RESULT, FEMALE - goto_if_eq LittlerootTown_MaysHouse_2F_EventScript_Ret - compare VAR_DEX_UPGRADE_JOHTO_STARTER_STATE, 2 - goto_if_ge LittlerootTown_MaysHouse_2F_EventScript_Ret + goto_if_eq VAR_RESULT, FEMALE, LittlerootTown_MaysHouse_2F_EventScript_Ret + goto_if_ge VAR_DEX_UPGRADE_JOHTO_STARTER_STATE, 2, LittlerootTown_MaysHouse_2F_EventScript_Ret setobjectxyperm LOCALID_RIVAL, 8, 2 setobjectmovementtype LOCALID_RIVAL, MOVEMENT_TYPE_FACE_UP return @@ -37,8 +31,7 @@ LittlerootTown_MaysHouse_2F_EventScript_Ret:: LittlerootTown_MaysHouse_2F_EventScript_CheckSetReadyToMeetMay:: checkplayergender - compare VAR_RESULT, MALE - goto_if_eq LittlerootTown_MaysHouse_2F_EventScript_SetReadyToMeetMay + goto_if_eq VAR_RESULT, MALE, LittlerootTown_MaysHouse_2F_EventScript_SetReadyToMeetMay return LittlerootTown_MaysHouse_2F_EventScript_SetReadyToMeetMay:: @@ -51,14 +44,12 @@ LittlerootTown_MaysHouse_2F_OnWarp: LittlerootTown_MaysHouse_2F_EventScript_CheckInitDecor:: checkplayergender - compare VAR_RESULT, FEMALE - goto_if_eq SecretBase_EventScript_InitDecorations + goto_if_eq VAR_RESULT, FEMALE, SecretBase_EventScript_InitDecorations end LittlerootTown_MaysHouse_2F_EventScript_RivalsPokeBall:: lockall - compare VAR_LITTLEROOT_RIVAL_STATE, 2 - goto_if_eq LittlerootTown_MaysHouse_2F_EventScript_MeetMay + goto_if_eq VAR_LITTLEROOT_RIVAL_STATE, 2, LittlerootTown_MaysHouse_2F_EventScript_MeetMay msgbox RivalsHouse_2F_Text_ItsRivalsPokeBall, MSGBOX_DEFAULT releaseall end @@ -75,14 +66,10 @@ LittlerootTown_MaysHouse_2F_EventScript_MeetMay:: waitmovement 0 delay 10 playbgm MUS_ENCOUNTER_MAY, TRUE - compare VAR_FACING, DIR_NORTH - call_if_eq LittlerootTown_MaysHouse_2F_EventScript_MeetMayNorth - compare VAR_FACING, DIR_SOUTH - call_if_eq LittlerootTown_MaysHouse_2F_EventScript_MeetMaySouth - compare VAR_FACING, DIR_WEST - call_if_eq LittlerootTown_MaysHouse_2F_EventScript_MeetMayWest - compare VAR_FACING, DIR_EAST - call_if_eq LittlerootTown_MaysHouse_2F_EventScript_MeetMayEast + call_if_eq VAR_FACING, DIR_NORTH, LittlerootTown_MaysHouse_2F_EventScript_MeetMayNorth + call_if_eq VAR_FACING, DIR_SOUTH, LittlerootTown_MaysHouse_2F_EventScript_MeetMaySouth + call_if_eq VAR_FACING, DIR_WEST, LittlerootTown_MaysHouse_2F_EventScript_MeetMayWest + call_if_eq VAR_FACING, DIR_EAST, LittlerootTown_MaysHouse_2F_EventScript_MeetMayEast setvar VAR_LITTLEROOT_RIVAL_STATE, 3 setflag FLAG_HIDE_LITTLEROOT_TOWN_MAYS_HOUSE_2F_POKE_BALL clearflag FLAG_HIDE_LITTLEROOT_TOWN_MAYS_HOUSE_RIVAL_BEDROOM @@ -252,10 +239,8 @@ RivalsHouse_2F_EventScript_Rival:: lockall goto_if_set FLAG_MET_RIVAL_LILYCOVE, RivalsHouse_2F_EventScript_RivalPostLilycove checkplayergender - compare VAR_RESULT, MALE - goto_if_eq RivalsHouse_2F_EventScript_May - compare VAR_RESULT, FEMALE - goto_if_eq RivalsHouse_2F_EventScript_Brendan + goto_if_eq VAR_RESULT, MALE, RivalsHouse_2F_EventScript_May + goto_if_eq VAR_RESULT, FEMALE, RivalsHouse_2F_EventScript_Brendan end RivalsHouse_2F_EventScript_May:: @@ -272,10 +257,8 @@ RivalsHouse_2F_EventScript_RivalPostLilycove:: applymovement VAR_LAST_TALKED, Common_Movement_FacePlayer waitmovement 0 checkplayergender - compare VAR_RESULT, MALE - call_if_eq RivalsHouse_2F_EventScript_MayPostLilycove - compare VAR_RESULT, FEMALE - call_if_eq RivalsHouse_2F_EventScript_BrendanPostLilycove + call_if_eq VAR_RESULT, MALE, RivalsHouse_2F_EventScript_MayPostLilycove + call_if_eq VAR_RESULT, FEMALE, RivalsHouse_2F_EventScript_BrendanPostLilycove setflag FLAG_MET_RIVAL_IN_HOUSE_AFTER_LILYCOVE releaseall end @@ -301,10 +284,8 @@ RivalsHouse_2F_EventScript_BrendanWhereShouldIGoNext:: LittlerootTown_MaysHouse_2F_EventScript_PC:: lockall checkplayergender - compare VAR_RESULT, MALE - goto_if_eq LittlerootTown_MaysHouse_2F_EventScript_CheckRivalsPC - compare VAR_RESULT, FEMALE - goto_if_eq LittlerootTown_MaysHouse_2F_EventScript_CheckPlayersPC + goto_if_eq VAR_RESULT, MALE, LittlerootTown_MaysHouse_2F_EventScript_CheckRivalsPC + goto_if_eq VAR_RESULT, FEMALE, LittlerootTown_MaysHouse_2F_EventScript_CheckPlayersPC end LittlerootTown_MaysHouse_2F_EventScript_CheckRivalsPC:: diff --git a/data/maps/LittlerootTown_ProfessorBirchsLab/scripts.inc b/data/maps/LittlerootTown_ProfessorBirchsLab/scripts.inc index 0a828c426bae..7c7f47d2eed9 100644 --- a/data/maps/LittlerootTown_ProfessorBirchsLab/scripts.inc +++ b/data/maps/LittlerootTown_ProfessorBirchsLab/scripts.inc @@ -29,18 +29,14 @@ LittlerootTown_ProfessorBirchsLab_MapScripts:: LittlerootTown_ProfessorBirchsLab_OnTransition: call Common_EventScript_SetupRivalGfxId call ProfBirch_EventScript_UpdateLocation - compare VAR_DEX_UPGRADE_JOHTO_STARTER_STATE, 6 - goto_if_ge LittlerootTown_ProfessorBirchsLab_EventScript_SetAfterJohtoStarterLayout - compare VAR_DEX_UPGRADE_JOHTO_STARTER_STATE, 4 - goto_if_ge LittlerootTown_ProfessorBirchsLab_EventScript_SetJohtoStarterLayout - compare VAR_DEX_UPGRADE_JOHTO_STARTER_STATE, 3 - goto_if_eq LittlerootTown_ProfessorBirchsLab_EventScript_CheckReadyForJohtoStarter + goto_if_ge VAR_DEX_UPGRADE_JOHTO_STARTER_STATE, 6, LittlerootTown_ProfessorBirchsLab_EventScript_SetAfterJohtoStarterLayout + goto_if_ge VAR_DEX_UPGRADE_JOHTO_STARTER_STATE, 4, LittlerootTown_ProfessorBirchsLab_EventScript_SetJohtoStarterLayout + goto_if_eq VAR_DEX_UPGRADE_JOHTO_STARTER_STATE, 3, LittlerootTown_ProfessorBirchsLab_EventScript_CheckReadyForJohtoStarter end LittlerootTown_ProfessorBirchsLab_EventScript_CheckReadyForJohtoStarter:: specialvar VAR_RESULT, HasAllHoennMons - compare VAR_RESULT, TRUE - goto_if_eq LittlerootTown_ProfessorBirchsLab_EventScript_SetReadyForJohtoStarter + goto_if_eq VAR_RESULT, TRUE, LittlerootTown_ProfessorBirchsLab_EventScript_SetReadyForJohtoStarter setobjectmovementtype LOCALID_RIVAL, MOVEMENT_TYPE_WANDER_UP_AND_DOWN setobjectxyperm LOCALID_RIVAL, 5, 10 end @@ -117,16 +113,14 @@ LittlerootTown_ProfessorBirchsLab_OnFrame: @ This is just where the game tells you its yours and lets you nickname it LittlerootTown_ProfessorBirchsLab_EventScript_GiveStarterEvent:: lockall - bufferleadmonspeciesname 0 + bufferleadmonspeciesname STR_VAR_1 message LittlerootTown_ProfessorBirchsLab_Text_LikeYouToHavePokemon waitmessage playfanfare MUS_OBTAIN_ITEM waitfanfare msgbox LittlerootTown_ProfessorBirchsLab_Text_WhyNotGiveNicknameToMon, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq LittlerootTown_ProfessorBirchsLab_EventScript_NicknameStarter - compare VAR_RESULT, NO - goto_if_eq LittlerootTown_ProfessorBirchsLab_EventScript_GoSeeRival + goto_if_eq VAR_RESULT, YES, LittlerootTown_ProfessorBirchsLab_EventScript_NicknameStarter + goto_if_eq VAR_RESULT, NO, LittlerootTown_ProfessorBirchsLab_EventScript_GoSeeRival end LittlerootTown_ProfessorBirchsLab_EventScript_NicknameStarter:: @@ -137,10 +131,8 @@ LittlerootTown_ProfessorBirchsLab_EventScript_NicknameStarter:: LittlerootTown_ProfessorBirchsLab_EventScript_GoSeeRival:: msgbox LittlerootTown_ProfessorBirchsLab_Text_MightBeGoodIdeaToGoSeeRival, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq LittlerootTown_ProfessorBirchsLab_EventScript_AgreeToSeeRival - compare VAR_RESULT, NO - goto_if_eq LittlerootTown_ProfessorBirchsLab_EventScript_DeclineSeeingRival + goto_if_eq VAR_RESULT, YES, LittlerootTown_ProfessorBirchsLab_EventScript_AgreeToSeeRival + goto_if_eq VAR_RESULT, NO, LittlerootTown_ProfessorBirchsLab_EventScript_DeclineSeeingRival end LittlerootTown_ProfessorBirchsLab_EventScript_AgreeToSeeRival:: @@ -152,10 +144,8 @@ LittlerootTown_ProfessorBirchsLab_EventScript_AgreeToSeeRival:: LittlerootTown_ProfessorBirchsLab_EventScript_DeclineSeeingRival:: msgbox LittlerootTown_ProfessorBirchsLab_Text_DontBeThatWay, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq LittlerootTown_ProfessorBirchsLab_EventScript_AgreeToSeeRival - compare VAR_RESULT, NO - goto_if_eq LittlerootTown_ProfessorBirchsLab_EventScript_DeclineSeeingRival + goto_if_eq VAR_RESULT, YES, LittlerootTown_ProfessorBirchsLab_EventScript_AgreeToSeeRival + goto_if_eq VAR_RESULT, NO, LittlerootTown_ProfessorBirchsLab_EventScript_DeclineSeeingRival end LittlerootTown_ProfessorBirchsLab_EventScript_GivePokedexEvent:: @@ -195,10 +185,8 @@ LittlerootTown_ProfessorBirchsLab_EventScript_UpgradeToNationalDex:: applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFasterLeft waitmovement 0 checkplayergender - compare VAR_RESULT, MALE - call_if_eq LittlerootTown_ProfessorBirchsLab_EventScript_MayUpgradeComment - compare VAR_RESULT, FEMALE - call_if_eq LittlerootTown_ProfessorBirchsLab_EventScript_BrendanUpgradeComment + call_if_eq VAR_RESULT, MALE, LittlerootTown_ProfessorBirchsLab_EventScript_MayUpgradeComment + call_if_eq VAR_RESULT, FEMALE, LittlerootTown_ProfessorBirchsLab_EventScript_BrendanUpgradeComment playse SE_PC_ON waitse delay 20 @@ -288,8 +276,7 @@ LittlerootTown_ProfessorBirchsLab_Movement_PlayerEnterLabForJohtoStarter: LittlerootTown_ProfessorBirchsLab_EventScript_Aide:: lock faceplayer - compare VAR_BIRCH_LAB_STATE, 3 - goto_if_ge LittlerootTown_ProfessorBirchsLab_EventScript_AideReceivedStarter + goto_if_ge VAR_BIRCH_LAB_STATE, 3, LittlerootTown_ProfessorBirchsLab_EventScript_AideReceivedStarter goto_if_set FLAG_BIRCH_AIDE_MET, LittlerootTown_ProfessorBirchsLab_EventScript_AideAlreadyMet msgbox LittlerootTown_ProfessorBirchsLab_Text_BirchAwayOnFieldwork, MSGBOX_DEFAULT setflag FLAG_BIRCH_AIDE_MET @@ -308,40 +295,34 @@ LittlerootTown_ProfessorBirchsLab_EventScript_AideReceivedStarter:: LittlerootTown_ProfessorBirchsLab_EventScript_Cyndaquil:: release - compare VAR_DEX_UPGRADE_JOHTO_STARTER_STATE, 6 - goto_if_ge LittlerootTown_ProfessorBirchsLab_EventScript_AlreadyChoseJohtoStarter + goto_if_ge VAR_DEX_UPGRADE_JOHTO_STARTER_STATE, 6, LittlerootTown_ProfessorBirchsLab_EventScript_AlreadyChoseJohtoStarter applymovement LOCALID_BIRCH, Common_Movement_WalkInPlaceFasterRight waitmovement 0 showmonpic SPECIES_CYNDAQUIL, 10, 3 msgbox LittlerootTown_ProfessorBirchsLab_Text_YoullTakeCyndaquil, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq LittlerootTown_ProfessorBirchsLab_EventScript_TakeYourTime + goto_if_eq VAR_RESULT, NO, LittlerootTown_ProfessorBirchsLab_EventScript_TakeYourTime goto LittlerootTown_ProfessorBirchsLab_EventScript_GiveCyndaquil end LittlerootTown_ProfessorBirchsLab_EventScript_Totodile:: release - compare VAR_DEX_UPGRADE_JOHTO_STARTER_STATE, 6 - goto_if_ge LittlerootTown_ProfessorBirchsLab_EventScript_AlreadyChoseJohtoStarter + goto_if_ge VAR_DEX_UPGRADE_JOHTO_STARTER_STATE, 6, LittlerootTown_ProfessorBirchsLab_EventScript_AlreadyChoseJohtoStarter applymovement LOCALID_BIRCH, Common_Movement_WalkInPlaceFasterRight waitmovement 0 showmonpic SPECIES_TOTODILE, 10, 3 msgbox LittlerootTown_ProfessorBirchsLab_Text_YoullTakeTotodile, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq LittlerootTown_ProfessorBirchsLab_EventScript_TakeYourTime + goto_if_eq VAR_RESULT, NO, LittlerootTown_ProfessorBirchsLab_EventScript_TakeYourTime goto LittlerootTown_ProfessorBirchsLab_EventScript_GiveTotodile end LittlerootTown_ProfessorBirchsLab_EventScript_Chikorita:: release - compare VAR_DEX_UPGRADE_JOHTO_STARTER_STATE, 6 - goto_if_ge LittlerootTown_ProfessorBirchsLab_EventScript_AlreadyChoseJohtoStarter + goto_if_ge VAR_DEX_UPGRADE_JOHTO_STARTER_STATE, 6, LittlerootTown_ProfessorBirchsLab_EventScript_AlreadyChoseJohtoStarter applymovement LOCALID_BIRCH, Common_Movement_WalkInPlaceFasterRight waitmovement 0 showmonpic SPECIES_CHIKORITA, 10, 3 msgbox LittlerootTown_ProfessorBirchsLab_Text_YoullTakeChikorita, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq LittlerootTown_ProfessorBirchsLab_EventScript_TakeYourTime + goto_if_eq VAR_RESULT, NO, LittlerootTown_ProfessorBirchsLab_EventScript_TakeYourTime goto LittlerootTown_ProfessorBirchsLab_EventScript_GiveChikorita end @@ -357,13 +338,11 @@ LittlerootTown_ProfessorBirchsLab_EventScript_TakeYourTime:: end LittlerootTown_ProfessorBirchsLab_EventScript_GiveCyndaquil:: - bufferspeciesname 0, SPECIES_CYNDAQUIL + bufferspeciesname STR_VAR_1, SPECIES_CYNDAQUIL setvar VAR_TEMP_1, SPECIES_CYNDAQUIL givemon SPECIES_CYNDAQUIL, 5, ITEM_NONE - compare VAR_RESULT, 0 - goto_if_eq LittlerootTown_ProfessorBirchsLab_EventScript_SendCyndaquilToParty - compare VAR_RESULT, 1 - goto_if_eq LittlerootTown_ProfessorBirchsLab_EventScript_SendCyndaquilToPC + goto_if_eq VAR_RESULT, 0, LittlerootTown_ProfessorBirchsLab_EventScript_SendCyndaquilToParty + goto_if_eq VAR_RESULT, 1, LittlerootTown_ProfessorBirchsLab_EventScript_SendCyndaquilToPC hidemonpic goto Common_EventScript_NoMoreRoomForPokemon end @@ -372,8 +351,7 @@ LittlerootTown_ProfessorBirchsLab_EventScript_SendCyndaquilToParty:: call LittlerootTown_ProfessorBirchsLab_EventScript_ReceivedJohtoStarter removeobject LOCALID_BALL_CYNDAQUIL msgbox gText_NicknameThisPokemon, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq LittlerootTown_ProfessorBirchsLab_EventScript_ReceivedCyndaquil + goto_if_eq VAR_RESULT, NO, LittlerootTown_ProfessorBirchsLab_EventScript_ReceivedCyndaquil call Common_EventScript_GetGiftMonPartySlot call Common_EventScript_NameReceivedPartyMon goto LittlerootTown_ProfessorBirchsLab_EventScript_ReceivedCyndaquil @@ -383,8 +361,7 @@ LittlerootTown_ProfessorBirchsLab_EventScript_SendCyndaquilToPC:: call LittlerootTown_ProfessorBirchsLab_EventScript_ReceivedJohtoStarter removeobject LOCALID_BALL_CYNDAQUIL msgbox gText_NicknameThisPokemon, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq LittlerootTown_ProfessorBirchsLab_EventScript_CyndaquilTransferredToPC + goto_if_eq VAR_RESULT, NO, LittlerootTown_ProfessorBirchsLab_EventScript_CyndaquilTransferredToPC call Common_EventScript_NameReceivedBoxMon goto LittlerootTown_ProfessorBirchsLab_EventScript_CyndaquilTransferredToPC end @@ -402,13 +379,11 @@ LittlerootTown_ProfessorBirchsLab_EventScript_ReceivedCyndaquil:: end LittlerootTown_ProfessorBirchsLab_EventScript_GiveTotodile:: - bufferspeciesname 0, SPECIES_TOTODILE + bufferspeciesname STR_VAR_1, SPECIES_TOTODILE setvar VAR_TEMP_1, SPECIES_TOTODILE givemon SPECIES_TOTODILE, 5, ITEM_NONE - compare VAR_RESULT, 0 - goto_if_eq LittlerootTown_ProfessorBirchsLab_EventScript_SendTotodileToParty - compare VAR_RESULT, 1 - goto_if_eq LittlerootTown_ProfessorBirchsLab_EventScript_SendTotodileToPC + goto_if_eq VAR_RESULT, 0, LittlerootTown_ProfessorBirchsLab_EventScript_SendTotodileToParty + goto_if_eq VAR_RESULT, 1, LittlerootTown_ProfessorBirchsLab_EventScript_SendTotodileToPC hidemonpic goto Common_EventScript_NoMoreRoomForPokemon end @@ -417,8 +392,7 @@ LittlerootTown_ProfessorBirchsLab_EventScript_SendTotodileToParty:: call LittlerootTown_ProfessorBirchsLab_EventScript_ReceivedJohtoStarter removeobject LOCALID_BALL_TOTODILE msgbox gText_NicknameThisPokemon, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq LittlerootTown_ProfessorBirchsLab_EventScript_ReceivedTotodile + goto_if_eq VAR_RESULT, NO, LittlerootTown_ProfessorBirchsLab_EventScript_ReceivedTotodile call Common_EventScript_GetGiftMonPartySlot call Common_EventScript_NameReceivedPartyMon goto LittlerootTown_ProfessorBirchsLab_EventScript_ReceivedTotodile @@ -428,8 +402,7 @@ LittlerootTown_ProfessorBirchsLab_EventScript_SendTotodileToPC:: call LittlerootTown_ProfessorBirchsLab_EventScript_ReceivedJohtoStarter removeobject LOCALID_BALL_TOTODILE msgbox gText_NicknameThisPokemon, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq LittlerootTown_ProfessorBirchsLab_EventScript_TotodileTransferredToPC + goto_if_eq VAR_RESULT, NO, LittlerootTown_ProfessorBirchsLab_EventScript_TotodileTransferredToPC call Common_EventScript_NameReceivedBoxMon goto LittlerootTown_ProfessorBirchsLab_EventScript_TotodileTransferredToPC end @@ -447,13 +420,11 @@ LittlerootTown_ProfessorBirchsLab_EventScript_ReceivedTotodile:: end LittlerootTown_ProfessorBirchsLab_EventScript_GiveChikorita:: - bufferspeciesname 0, SPECIES_CHIKORITA + bufferspeciesname STR_VAR_1, SPECIES_CHIKORITA setvar VAR_TEMP_1, SPECIES_CHIKORITA givemon SPECIES_CHIKORITA, 5, ITEM_NONE - compare VAR_RESULT, 0 - goto_if_eq LittlerootTown_ProfessorBirchsLab_EventScript_SendChikoritaToParty - compare VAR_RESULT, 1 - goto_if_eq LittlerootTown_ProfessorBirchsLab_EventScript_SendChikoritaToPC + goto_if_eq VAR_RESULT, 0, LittlerootTown_ProfessorBirchsLab_EventScript_SendChikoritaToParty + goto_if_eq VAR_RESULT, 1, LittlerootTown_ProfessorBirchsLab_EventScript_SendChikoritaToPC hidemonpic goto Common_EventScript_NoMoreRoomForPokemon end @@ -462,8 +433,7 @@ LittlerootTown_ProfessorBirchsLab_EventScript_SendChikoritaToParty:: call LittlerootTown_ProfessorBirchsLab_EventScript_ReceivedJohtoStarter removeobject LOCALID_BALL_CHIKORITA msgbox gText_NicknameThisPokemon, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq LittlerootTown_ProfessorBirchsLab_EventScript_ReceivedChikorita + goto_if_eq VAR_RESULT, NO, LittlerootTown_ProfessorBirchsLab_EventScript_ReceivedChikorita call Common_EventScript_GetGiftMonPartySlot call Common_EventScript_NameReceivedPartyMon goto LittlerootTown_ProfessorBirchsLab_EventScript_ReceivedChikorita @@ -473,8 +443,7 @@ LittlerootTown_ProfessorBirchsLab_EventScript_SendChikoritaToPC:: call LittlerootTown_ProfessorBirchsLab_EventScript_ReceivedJohtoStarter removeobject LOCALID_BALL_CHIKORITA msgbox gText_NicknameThisPokemon, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq LittlerootTown_ProfessorBirchsLab_EventScript_ChikoritaTransferredToPC + goto_if_eq VAR_RESULT, NO, LittlerootTown_ProfessorBirchsLab_EventScript_ChikoritaTransferredToPC call Common_EventScript_NameReceivedBoxMon goto LittlerootTown_ProfessorBirchsLab_EventScript_ChikoritaTransferredToPC end @@ -501,10 +470,8 @@ LittlerootTown_ProfessorBirchsLab_EventScript_ReceivedJohtoStarter:: LittlerootTown_ProfessorBirchsLab_EventScript_Birch:: lock faceplayer - compare VAR_DEX_UPGRADE_JOHTO_STARTER_STATE, 5 - goto_if_eq LittlerootTown_ProfessorBirchsLab_EventScript_CanHaveAnyOneOfRarePokemon - compare VAR_DEX_UPGRADE_JOHTO_STARTER_STATE, 2 - goto_if_eq LittlerootTown_ProfessorBirchsLab_EventScript_GrassyPatchWaiting + goto_if_eq VAR_DEX_UPGRADE_JOHTO_STARTER_STATE, 5, LittlerootTown_ProfessorBirchsLab_EventScript_CanHaveAnyOneOfRarePokemon + goto_if_eq VAR_DEX_UPGRADE_JOHTO_STARTER_STATE, 2, LittlerootTown_ProfessorBirchsLab_EventScript_GrassyPatchWaiting goto_if_unset FLAG_HAS_MATCH_CALL, LittlerootTown_ProfessorBirchsLab_EventScript_TryRatePokedexOrRegister goto_if_unset FLAG_ENABLE_PROF_BIRCH_MATCH_CALL, EventScript_RegisterProfBirch goto LittlerootTown_ProfessorBirchsLab_EventScript_TryRatePokedexOrRegister @@ -522,12 +489,9 @@ LittlerootTown_ProfessorBirchsLab_EventScript_GrassyPatchWaiting:: LittlerootTown_ProfessorBirchsLab_EventScript_TryRatePokedexOrRegister:: goto_if_unset FLAG_HIDE_LITTLEROOT_TOWN_BIRCHS_LAB_UNKNOWN_0x380, ProfBirch_EventScript_RatePokedexOrRegister - compare VAR_DEX_UPGRADE_JOHTO_STARTER_STATE, 3 - goto_if_eq ProfBirch_EventScript_RatePokedexOrRegister - compare VAR_DEX_UPGRADE_JOHTO_STARTER_STATE, 6 - goto_if_ge ProfBirch_EventScript_RatePokedexOrRegister - compare VAR_BIRCH_LAB_STATE, 5 - goto_if_eq LittlerootTown_ProfessorBirchsLab_EventScript_PokemonAwait + goto_if_eq VAR_DEX_UPGRADE_JOHTO_STARTER_STATE, 3, ProfBirch_EventScript_RatePokedexOrRegister + goto_if_ge VAR_DEX_UPGRADE_JOHTO_STARTER_STATE, 6, ProfBirch_EventScript_RatePokedexOrRegister + goto_if_eq VAR_BIRCH_LAB_STATE, 5, LittlerootTown_ProfessorBirchsLab_EventScript_PokemonAwait msgbox LittlerootTown_ProfessorBirchsLab_Text_BirchRivalGoneHome, MSGBOX_DEFAULT release end @@ -556,10 +520,8 @@ LittlerootTown_ProfessorBirchsLab_EventScript_GivePokedex:: applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFasterRight waitmovement 0 checkplayergender - compare VAR_RESULT, MALE - call_if_eq LittlerootTown_ProfessorBirchsLab_EventScript_MayGivePokeBalls - compare VAR_RESULT, FEMALE - call_if_eq LittlerootTown_ProfessorBirchsLab_EventScript_BrendanGivePokeBalls + call_if_eq VAR_RESULT, MALE, LittlerootTown_ProfessorBirchsLab_EventScript_MayGivePokeBalls + call_if_eq VAR_RESULT, FEMALE, LittlerootTown_ProfessorBirchsLab_EventScript_BrendanGivePokeBalls setvar VAR_BIRCH_LAB_STATE, 5 setflag FLAG_ADVENTURE_STARTED setvar VAR_OLDALE_TOWN_STATE, 1 @@ -571,8 +533,7 @@ LittlerootTown_ProfessorBirchsLab_EventScript_GivePokedex:: LittlerootTown_ProfessorBirchsLab_EventScript_MayGivePokeBalls:: msgbox LittlerootTown_ProfessorBirchsLab_Text_MayGotPokedexTooTakeThese, MSGBOX_DEFAULT giveitem ITEM_POKE_BALL, 5 - compare VAR_RESULT, FALSE - call_if_eq LittlerootTown_ProfessorBirchsLab_EventScript_MayNoRoomForPokeBalls + call_if_eq VAR_RESULT, FALSE, LittlerootTown_ProfessorBirchsLab_EventScript_MayNoRoomForPokeBalls msgbox LittlerootTown_ProfessorBirchsLab_Text_CatchCutePokemonWithPokeBalls, MSGBOX_DEFAULT setvar VAR_RESULT, 0 return @@ -580,8 +541,7 @@ LittlerootTown_ProfessorBirchsLab_EventScript_MayGivePokeBalls:: LittlerootTown_ProfessorBirchsLab_EventScript_BrendanGivePokeBalls:: msgbox LittlerootTown_ProfessorBirchsLab_Text_BrendanGotPokedexTooTakeThese, MSGBOX_DEFAULT giveitem ITEM_POKE_BALL, 5 - compare VAR_RESULT, FALSE - call_if_eq LittlerootTown_ProfessorBirchsLab_EventScript_BrendanNoRoomForPokeBalls + call_if_eq VAR_RESULT, FALSE, LittlerootTown_ProfessorBirchsLab_EventScript_BrendanNoRoomForPokeBalls msgbox LittlerootTown_ProfessorBirchsLab_Text_CatchCoolPokemonWithPokeBalls, MSGBOX_DEFAULT setvar VAR_RESULT, 1 return @@ -621,17 +581,12 @@ LittlerootTown_ProfessorBirchsLab_EventScript_Machine:: LittlerootTown_ProfessorBirchsLab_EventScript_Rival:: lock faceplayer - compare VAR_DEX_UPGRADE_JOHTO_STARTER_STATE, 5 - goto_if_eq LittlerootTown_ProfessorBirchsLab_EventScript_RivalFuturePlans - compare VAR_DEX_UPGRADE_JOHTO_STARTER_STATE, 6 - goto_if_ge LittlerootTown_ProfessorBirchsLab_EventScript_RivalHaveYouGoneToBattleFrontier - compare VAR_DEX_UPGRADE_JOHTO_STARTER_STATE, 2 - goto_if_ge LittlerootTown_ProfessorBirchsLab_EventScript_RivalTakeBreakFromFieldwork + goto_if_eq VAR_DEX_UPGRADE_JOHTO_STARTER_STATE, 5, LittlerootTown_ProfessorBirchsLab_EventScript_RivalFuturePlans + goto_if_ge VAR_DEX_UPGRADE_JOHTO_STARTER_STATE, 6, LittlerootTown_ProfessorBirchsLab_EventScript_RivalHaveYouGoneToBattleFrontier + goto_if_ge VAR_DEX_UPGRADE_JOHTO_STARTER_STATE, 2, LittlerootTown_ProfessorBirchsLab_EventScript_RivalTakeBreakFromFieldwork checkplayergender - compare VAR_RESULT, MALE - call_if_eq LittlerootTown_ProfessorBirchsLab_EventScript_MayWhereShouldIGoNext - compare VAR_RESULT, FEMALE - call_if_eq LittlerootTown_ProfessorBirchsLab_EventScript_BrendanWhereShouldIGoNext + call_if_eq VAR_RESULT, MALE, LittlerootTown_ProfessorBirchsLab_EventScript_MayWhereShouldIGoNext + call_if_eq VAR_RESULT, FEMALE, LittlerootTown_ProfessorBirchsLab_EventScript_BrendanWhereShouldIGoNext release end @@ -645,10 +600,8 @@ LittlerootTown_ProfessorBirchsLab_EventScript_BrendanWhereShouldIGoNext:: LittlerootTown_ProfessorBirchsLab_EventScript_RivalFuturePlans:: checkplayergender - compare VAR_RESULT, MALE - call_if_eq LittlerootTown_ProfessorBirchsLab_EventScript_MayWhatNextImStayingHere - compare VAR_RESULT, FEMALE - call_if_eq LittlerootTown_ProfessorBirchsLab_EventScript_BrendanPreferCollectingSlowly + call_if_eq VAR_RESULT, MALE, LittlerootTown_ProfessorBirchsLab_EventScript_MayWhatNextImStayingHere + call_if_eq VAR_RESULT, FEMALE, LittlerootTown_ProfessorBirchsLab_EventScript_BrendanPreferCollectingSlowly release end @@ -662,10 +615,8 @@ LittlerootTown_ProfessorBirchsLab_EventScript_BrendanPreferCollectingSlowly: LittlerootTown_ProfessorBirchsLab_EventScript_RivalHaveYouGoneToBattleFrontier:: checkplayergender - compare VAR_RESULT, MALE - call_if_eq LittlerootTown_ProfessorBirchsLab_EventScript_MayHaveYouGoneToBattleFrontier - compare VAR_RESULT, FEMALE - call_if_eq LittlerootTown_ProfessorBirchsLab_EventScript_BrendanHaveYouGoneToBattleFrontier + call_if_eq VAR_RESULT, MALE, LittlerootTown_ProfessorBirchsLab_EventScript_MayHaveYouGoneToBattleFrontier + call_if_eq VAR_RESULT, FEMALE, LittlerootTown_ProfessorBirchsLab_EventScript_BrendanHaveYouGoneToBattleFrontier release end @@ -679,10 +630,8 @@ LittlerootTown_ProfessorBirchsLab_EventScript_BrendanHaveYouGoneToBattleFrontier LittlerootTown_ProfessorBirchsLab_EventScript_RivalTakeBreakFromFieldwork:: checkplayergender - compare VAR_RESULT, MALE - call_if_eq LittlerootTown_ProfessorBirchsLab_EventScript_MayTakeBreakFromFieldwork - compare VAR_RESULT, FEMALE - call_if_eq LittlerootTown_ProfessorBirchsLab_EventScript_BrendanTakeBreakFromFieldwork + call_if_eq VAR_RESULT, MALE, LittlerootTown_ProfessorBirchsLab_EventScript_MayTakeBreakFromFieldwork + call_if_eq VAR_RESULT, FEMALE, LittlerootTown_ProfessorBirchsLab_EventScript_BrendanTakeBreakFromFieldwork release end diff --git a/data/maps/MarineCave_End/scripts.inc b/data/maps/MarineCave_End/scripts.inc index 296ef02f8270..1d988a44488d 100644 --- a/data/maps/MarineCave_End/scripts.inc +++ b/data/maps/MarineCave_End/scripts.inc @@ -11,8 +11,7 @@ MarineCave_End_OnResume: MarineCave_End_EventScript_TryRemoveKyogre:: specialvar VAR_RESULT, GetBattleOutcome - compare VAR_RESULT, B_OUTCOME_CAUGHT - goto_if_ne Common_EventScript_NopReturn + goto_if_ne VAR_RESULT, B_OUTCOME_CAUGHT, Common_EventScript_NopReturn removeobject LOCALID_KYOGRE return @@ -43,12 +42,9 @@ MarineCave_End_EventScript_Kyogre:: clearflag FLAG_SYS_CTRL_OBJ_DELETE setvar VAR_TEMP_1, 0 specialvar VAR_RESULT, GetBattleOutcome - compare VAR_RESULT, B_OUTCOME_WON - goto_if_eq MarineCave_End_EventScript_DefeatedKyogre - compare VAR_RESULT, B_OUTCOME_RAN - goto_if_eq MarineCave_End_EventScript_RanFromKyogre - compare VAR_RESULT, B_OUTCOME_PLAYER_TELEPORTED - goto_if_eq MarineCave_End_EventScript_RanFromKyogre + goto_if_eq VAR_RESULT, B_OUTCOME_WON, MarineCave_End_EventScript_DefeatedKyogre + goto_if_eq VAR_RESULT, B_OUTCOME_RAN, MarineCave_End_EventScript_RanFromKyogre + goto_if_eq VAR_RESULT, B_OUTCOME_PLAYER_TELEPORTED, MarineCave_End_EventScript_RanFromKyogre setvar VAR_SHOULD_END_ABNORMAL_WEATHER, 1 setflag FLAG_DEFEATED_KYOGRE releaseall diff --git a/data/maps/MarineCave_Entrance/scripts.inc b/data/maps/MarineCave_Entrance/scripts.inc index a075d2c30d69..172a19d26c56 100644 --- a/data/maps/MarineCave_Entrance/scripts.inc +++ b/data/maps/MarineCave_Entrance/scripts.inc @@ -3,6 +3,6 @@ MarineCave_Entrance_MapScripts:: .byte 0 MarineCave_Entrance_OnResume: - setdivewarp MAP_UNDERWATER_MARINE_CAVE, 255, 9, 6 + setdivewarp MAP_UNDERWATER_MARINE_CAVE, 9, 6 end diff --git a/data/maps/MauvilleCity/scripts.inc b/data/maps/MauvilleCity/scripts.inc index eb243ec59300..2ad39aec1c9e 100644 --- a/data/maps/MauvilleCity/scripts.inc +++ b/data/maps/MauvilleCity/scripts.inc @@ -107,10 +107,8 @@ MauvilleCity_EventScript_Wally:: end MauvilleCity_EventScript_BattleWallyPrompt:: - compare VAR_RESULT, YES - call_if_eq MauvilleCity_EventScript_BattleWally - compare VAR_RESULT, NO - goto_if_eq MauvilleCity_EventScript_DeclineWallyBattle + call_if_eq VAR_RESULT, YES, MauvilleCity_EventScript_BattleWally + goto_if_eq VAR_RESULT, NO, MauvilleCity_EventScript_DeclineWallyBattle closemessage switch VAR_FACING case DIR_NORTH, MauvilleCity_EventScript_WallyAndUncleExitNorth @@ -164,19 +162,15 @@ MauvilleCity_EventScript_DefeatedWally:: setflag FLAG_DEFEATED_WALLY_MAUVILLE setvar VAR_WALLY_CALL_STEP_COUNTER, 0 setflag FLAG_ENABLE_FIRST_WALLY_POKENAV_CALL - compare VAR_FACING, DIR_NORTH - call_if_eq MauvilleCity_EventScript_ScottApproachPlayerNorth - compare VAR_FACING, DIR_EAST - call_if_eq MauvilleCity_EventScript_ScottApproachPlayerEast + call_if_eq VAR_FACING, DIR_NORTH, MauvilleCity_EventScript_ScottApproachPlayerNorth + call_if_eq VAR_FACING, DIR_EAST, MauvilleCity_EventScript_ScottApproachPlayerEast applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFasterDown waitmovement 0 msgbox MauvilleCity_Text_ScottYouDidntHoldBack, MSGBOX_DEFAULT closemessage addvar VAR_SCOTT_STATE, 1 - compare VAR_FACING, DIR_NORTH - call_if_eq MauvilleCity_EventScript_ScottExitNorth - compare VAR_FACING, DIR_EAST - call_if_eq MauvilleCity_EventScript_ScottExitEast + call_if_eq VAR_FACING, DIR_NORTH, MauvilleCity_EventScript_ScottExitNorth + call_if_eq VAR_FACING, DIR_EAST, MauvilleCity_EventScript_ScottExitEast removeobject LOCALID_SCOTT releaseall end @@ -425,8 +419,7 @@ MauvilleCity_EventScript_Wattson:: lock faceplayer goto_if_set FLAG_GOT_TM24_FROM_WATTSON, MauvilleCity_EventScript_ReceivedThunderbolt - compare VAR_NEW_MAUVILLE_STATE, 2 - goto_if_eq MauvilleCity_EventScript_CompletedNewMauville + goto_if_eq VAR_NEW_MAUVILLE_STATE, 2, MauvilleCity_EventScript_CompletedNewMauville goto_if_set FLAG_GOT_BASEMENT_KEY_FROM_WATTSON, MauvilleCity_EventScript_BegunNewMauville msgbox MauvilleCity_Text_WattsonNeedFavorTakeKey, MSGBOX_DEFAULT giveitem ITEM_BASEMENT_KEY @@ -443,8 +436,7 @@ MauvilleCity_EventScript_BegunNewMauville:: MauvilleCity_EventScript_CompletedNewMauville:: msgbox MauvilleCity_Text_WattsonThanksTakeTM, MSGBOX_DEFAULT giveitem ITEM_TM24 - compare VAR_RESULT, FALSE - goto_if_eq Common_EventScript_ShowBagIsFull + goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull setflag FLAG_GOT_TM24_FROM_WATTSON msgbox MauvilleCity_Text_WattsonYoungTakeCharge, MSGBOX_DEFAULT release diff --git a/data/maps/MauvilleCity_BikeShop/scripts.inc b/data/maps/MauvilleCity_BikeShop/scripts.inc index 45efbe8f3b93..089338410164 100644 --- a/data/maps/MauvilleCity_BikeShop/scripts.inc +++ b/data/maps/MauvilleCity_BikeShop/scripts.inc @@ -8,18 +8,14 @@ MauvilleCity_BikeShop_EventScript_Rydel:: goto_if_set FLAG_DECLINED_BIKE, MauvilleCity_BikeShop_EventScript_SkipGreeting msgbox MauvilleCity_BikeShop_Text_RydelGreeting, MSGBOX_DEFAULT msgbox MauvilleCity_BikeShop_Text_DidYouComeFromFarAway, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq MauvilleCity_BikeShop_EventScript_YesFar - compare VAR_RESULT, NO - goto_if_eq MauvilleCity_BikeShop_EventScript_NotFar + goto_if_eq VAR_RESULT, YES, MauvilleCity_BikeShop_EventScript_YesFar + goto_if_eq VAR_RESULT, NO, MauvilleCity_BikeShop_EventScript_NotFar end MauvilleCity_BikeShop_EventScript_SkipGreeting:: msgbox MauvilleCity_BikeShop_Text_DidYouComeFromFarAway, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq MauvilleCity_BikeShop_EventScript_YesFar - compare VAR_RESULT, NO - goto_if_eq MauvilleCity_BikeShop_EventScript_NotFar + goto_if_eq VAR_RESULT, YES, MauvilleCity_BikeShop_EventScript_YesFar + goto_if_eq VAR_RESULT, NO, MauvilleCity_BikeShop_EventScript_NotFar end MauvilleCity_BikeShop_EventScript_ChooseBike:: @@ -62,21 +58,17 @@ MauvilleCity_BikeShop_EventScript_ComeBackToSwitchBikes:: MauvilleCity_BikeShop_EventScript_AskSwitchBikes:: msgbox MauvilleCity_BikeShop_Text_WantToSwitchBikes, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq MauvilleCity_BikeShop_EventScript_SwitchBikes - compare VAR_RESULT, NO - goto_if_eq MauvilleCity_BikeShop_EventScript_KeepBike + goto_if_eq VAR_RESULT, YES, MauvilleCity_BikeShop_EventScript_SwitchBikes + goto_if_eq VAR_RESULT, NO, MauvilleCity_BikeShop_EventScript_KeepBike end @ If the player does not have a bike on them Rydel assumes its stored in the PC MauvilleCity_BikeShop_EventScript_SwitchBikes:: msgbox MauvilleCity_BikeShop_Text_IllSwitchBikes, MSGBOX_DEFAULT - checkitem ITEM_ACRO_BIKE, 1 - compare VAR_RESULT, TRUE - goto_if_eq MauvilleCity_BikeShop_EventScript_SwitchAcroForMach - checkitem ITEM_MACH_BIKE, 1 - compare VAR_RESULT, TRUE - goto_if_eq MauvilleCity_BikeShop_EventScript_SwitchMachForAcro + checkitem ITEM_ACRO_BIKE + goto_if_eq VAR_RESULT, TRUE, MauvilleCity_BikeShop_EventScript_SwitchAcroForMach + checkitem ITEM_MACH_BIKE + goto_if_eq VAR_RESULT, TRUE, MauvilleCity_BikeShop_EventScript_SwitchMachForAcro msgbox MauvilleCity_BikeShop_Text_OhYourBikeIsInPC, MSGBOX_DEFAULT release end diff --git a/data/maps/MauvilleCity_GameCorner/scripts.inc b/data/maps/MauvilleCity_GameCorner/scripts.inc index 896dfa680750..b7c8603a3340 100644 --- a/data/maps/MauvilleCity_GameCorner/scripts.inc +++ b/data/maps/MauvilleCity_GameCorner/scripts.inc @@ -16,12 +16,11 @@ MauvilleCity_GameCorner_EventScript_CoinsClerk:: lock faceplayer msgbox MauvilleCity_GameCorner_Text_ThisIsMauvilleGameCorner, MSGBOX_DEFAULT - checkitem ITEM_COIN_CASE, 1 - compare VAR_RESULT, FALSE - goto_if_eq MauvilleCity_GameCorner_EventScript_NeedCoinCase + checkitem ITEM_COIN_CASE + goto_if_eq VAR_RESULT, FALSE, MauvilleCity_GameCorner_EventScript_NeedCoinCase message MauvilleCity_GameCorner_Text_WereYouLookingForCoins waitmessage - showmoneybox 0, 0, 0 + showmoneybox 0, 0 showcoinsbox 1, 6 goto MauvilleCity_GameCorner_EventScript_ChooseCoinsDefault50 @@ -44,14 +43,12 @@ 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 - checkmoney COINS_PRICE_50, 0 - compare VAR_RESULT, FALSE - goto_if_eq MauvilleCity_GameCorner_EventScript_NotEnoughMoney + goto_if_ge VAR_TEMP_1, (MAX_COINS + 1 - 50), MauvilleCity_GameCorner_EventScript_NoRoomForCoins + checkmoney COINS_PRICE_50 + goto_if_eq VAR_RESULT, FALSE, MauvilleCity_GameCorner_EventScript_NotEnoughMoney addcoins 50 - removemoney COINS_PRICE_50, 0 - updatemoneybox 0, 0 + removemoney COINS_PRICE_50 + updatemoneybox updatecoinsbox 1, 6 playse SE_SHOP msgbox MauvilleCity_GameCorner_Text_ThankYouHereAreYourCoins, MSGBOX_DEFAULT @@ -62,14 +59,12 @@ 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 - checkmoney COINS_PRICE_500, 0 - compare VAR_RESULT, FALSE - goto_if_eq MauvilleCity_GameCorner_EventScript_NotEnoughMoney + goto_if_ge VAR_TEMP_1, (MAX_COINS + 1 - 500), MauvilleCity_GameCorner_EventScript_NoRoomForCoins + checkmoney COINS_PRICE_500 + goto_if_eq VAR_RESULT, FALSE, MauvilleCity_GameCorner_EventScript_NotEnoughMoney addcoins 500 - removemoney COINS_PRICE_500, 0 - updatemoneybox 0, 0 + removemoney COINS_PRICE_500 + updatemoneybox updatecoinsbox 1, 6 playse SE_SHOP msgbox MauvilleCity_GameCorner_Text_ThankYouHereAreYourCoins, MSGBOX_DEFAULT @@ -108,9 +103,8 @@ MauvilleCity_GameCorner_EventScript_PrizeCornerDolls:: lock faceplayer msgbox MauvilleCity_GameCorner_Text_ExchangeCoinsForPrizes, MSGBOX_DEFAULT - checkitem ITEM_COIN_CASE, 1 - compare VAR_RESULT, TRUE - goto_if_eq MauvilleCity_GameCorner_EventScript_ChooseDollPrizeMessage + checkitem ITEM_COIN_CASE + goto_if_eq VAR_RESULT, TRUE, MauvilleCity_GameCorner_EventScript_ChooseDollPrizeMessage release end @@ -138,23 +132,22 @@ MauvilleCity_GameCorner_EventScript_ChooseDollPrize:: MauvilleCity_GameCorner_EventScript_TreeckoDoll:: setvar VAR_TEMP_1, 1 - bufferdecorationname 0, DECOR_TREECKO_DOLL + bufferdecorationname STR_VAR_1, DECOR_TREECKO_DOLL goto MauvilleCity_GameCorner_EventScript_ConfirmDollPrize MauvilleCity_GameCorner_EventScript_TorchicDoll:: setvar VAR_TEMP_1, 2 - bufferdecorationname 0, DECOR_TORCHIC_DOLL + bufferdecorationname STR_VAR_1, DECOR_TORCHIC_DOLL goto MauvilleCity_GameCorner_EventScript_ConfirmDollPrize MauvilleCity_GameCorner_EventScript_MudkipDoll:: setvar VAR_TEMP_1, 3 - bufferdecorationname 0, DECOR_MUDKIP_DOLL + bufferdecorationname STR_VAR_1, DECOR_MUDKIP_DOLL goto MauvilleCity_GameCorner_EventScript_ConfirmDollPrize 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 - bufferdecorationname 1, DECOR_TREECKO_DOLL + 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 - bufferdecorationname 1, DECOR_TORCHIC_DOLL + 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 - bufferdecorationname 1, DECOR_MUDKIP_DOLL + 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 @@ -229,9 +216,8 @@ MauvilleCity_GameCorner_EventScript_PrizeCornerTMs:: lock faceplayer msgbox MauvilleCity_GameCorner_Text_ExchangeCoinsForPrizes, MSGBOX_DEFAULT - checkitem ITEM_COIN_CASE, 1 - compare VAR_RESULT, TRUE - goto_if_eq MauvilleCity_GameCorner_EventScript_ChooseTMPrizeMessage + checkitem ITEM_COIN_CASE + goto_if_eq VAR_RESULT, TRUE, MauvilleCity_GameCorner_EventScript_ChooseTMPrizeMessage release end @@ -261,39 +247,38 @@ MauvilleCity_GameCorner_EventScript_ChooseTMPrize:: MauvilleCity_GameCorner_EventScript_TM32:: setvar VAR_TEMP_1, 1 - bufferitemname 0, ITEM_TM32 + bufferitemname STR_VAR_1, ITEM_TM32 setvar VAR_0x8004, ITEM_TM32 goto MauvilleCity_GameCorner_EventScript_ConfirmTMPrize MauvilleCity_GameCorner_EventScript_TM29:: setvar VAR_TEMP_1, 2 - bufferitemname 0, ITEM_TM29 + bufferitemname STR_VAR_1, ITEM_TM29 setvar VAR_0x8004, ITEM_TM29 goto MauvilleCity_GameCorner_EventScript_ConfirmTMPrize MauvilleCity_GameCorner_EventScript_TM35:: setvar VAR_TEMP_1, 3 - bufferitemname 0, ITEM_TM35 + bufferitemname STR_VAR_1, ITEM_TM35 setvar VAR_0x8004, ITEM_TM35 goto MauvilleCity_GameCorner_EventScript_ConfirmTMPrize MauvilleCity_GameCorner_EventScript_TM24:: setvar VAR_TEMP_1, 4 - bufferitemname 0, ITEM_TM24 + bufferitemname STR_VAR_1, ITEM_TM24 setvar VAR_0x8004, ITEM_TM24 goto MauvilleCity_GameCorner_EventScript_ConfirmTMPrize MauvilleCity_GameCorner_EventScript_TM13:: setvar VAR_TEMP_1, 5 - bufferitemname 0, ITEM_TM13 + bufferitemname STR_VAR_1, ITEM_TM13 setvar VAR_0x8004, ITEM_TM13 goto MauvilleCity_GameCorner_EventScript_ConfirmTMPrize 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 - checkitemspace ITEM_TM32, 1 - compare VAR_RESULT, FALSE - goto_if_eq MauvilleCity_GameCorner_EventScript_NoRoomForTM + goto_if_lt VAR_TEMP_2, TM32_COINS, MauvilleCity_GameCorner_EventScript_NotEnoughCoinsForTM + checkitemspace ITEM_TM32 + 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 - checkitemspace ITEM_TM29, 1 - compare VAR_RESULT, FALSE - goto_if_eq MauvilleCity_GameCorner_EventScript_NoRoomForTM + goto_if_lt VAR_TEMP_2, TM29_COINS, MauvilleCity_GameCorner_EventScript_NotEnoughCoinsForTM + checkitemspace ITEM_TM29 + 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 - checkitemspace ITEM_TM35, 1 - compare VAR_RESULT, FALSE - goto_if_eq MauvilleCity_GameCorner_EventScript_NoRoomForTM + goto_if_lt VAR_TEMP_2, TM35_COINS, MauvilleCity_GameCorner_EventScript_NotEnoughCoinsForTM + checkitemspace ITEM_TM35 + 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 - checkitemspace ITEM_TM24, 1 - compare VAR_RESULT, FALSE - goto_if_eq MauvilleCity_GameCorner_EventScript_NoRoomForTM + goto_if_lt VAR_TEMP_2, TM24_COINS, MauvilleCity_GameCorner_EventScript_NotEnoughCoinsForTM + checkitemspace ITEM_TM24 + 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 - checkitemspace ITEM_TM13, 1 - compare VAR_RESULT, FALSE - goto_if_eq MauvilleCity_GameCorner_EventScript_NoRoomForTM + goto_if_lt VAR_TEMP_2, TM13_COINS, MauvilleCity_GameCorner_EventScript_NotEnoughCoinsForTM + checkitemspace ITEM_TM13 + 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 @@ -415,10 +389,9 @@ MauvilleCity_GameCorner_EventScript_Girl:: end MauvilleCity_GameCorner_EventScript_GiveTreeckoDoll:: - bufferdecorationname 1, DECOR_TREECKO_DOLL + 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 @@ -426,10 +399,9 @@ MauvilleCity_GameCorner_EventScript_GiveTreeckoDoll:: end MauvilleCity_GameCorner_EventScript_GiveTorchicDoll:: - bufferdecorationname 1, DECOR_TORCHIC_DOLL + 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 @@ -437,10 +409,9 @@ MauvilleCity_GameCorner_EventScript_GiveTorchicDoll:: end MauvilleCity_GameCorner_EventScript_GiveMudkipDoll:: - bufferdecorationname 1, DECOR_MUDKIP_DOLL + 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 @@ -466,9 +437,8 @@ MauvilleCity_GameCorner_EventScript_ReceivedStarterDoll:: MauvilleCity_GameCorner_EventScript_PokefanM:: lock faceplayer - checkitem ITEM_COIN_CASE, 1 - compare VAR_RESULT, TRUE - goto_if_eq MauvilleCity_GameCorner_EventScript_TryGive20Coins + checkitem ITEM_COIN_CASE + 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 @@ -534,9 +503,8 @@ MauvilleCity_GameCorner_EventScript_Woman:: MauvilleCity_GameCorner_EventScript_SlotMachine0:: lockall - checkitem ITEM_COIN_CASE, 1 - compare VAR_RESULT, FALSE - goto_if_eq MauvilleCity_GameCorner_EventScript_NoCoinCase + checkitem ITEM_COIN_CASE + goto_if_eq VAR_RESULT, FALSE, MauvilleCity_GameCorner_EventScript_NoCoinCase setvar VAR_0x8004, 0 specialvar VAR_RESULT, GetSlotMachineId playslotmachine VAR_RESULT @@ -545,9 +513,8 @@ MauvilleCity_GameCorner_EventScript_SlotMachine0:: MauvilleCity_GameCorner_EventScript_SlotMachine1:: lockall - checkitem ITEM_COIN_CASE, 1 - compare VAR_RESULT, FALSE - goto_if_eq MauvilleCity_GameCorner_EventScript_NoCoinCase + checkitem ITEM_COIN_CASE + goto_if_eq VAR_RESULT, FALSE, MauvilleCity_GameCorner_EventScript_NoCoinCase setvar VAR_0x8004, 1 specialvar VAR_RESULT, GetSlotMachineId playslotmachine VAR_RESULT @@ -556,9 +523,8 @@ MauvilleCity_GameCorner_EventScript_SlotMachine1:: MauvilleCity_GameCorner_EventScript_SlotMachine2:: lockall - checkitem ITEM_COIN_CASE, 1 - compare VAR_RESULT, FALSE - goto_if_eq MauvilleCity_GameCorner_EventScript_NoCoinCase + checkitem ITEM_COIN_CASE + goto_if_eq VAR_RESULT, FALSE, MauvilleCity_GameCorner_EventScript_NoCoinCase setvar VAR_0x8004, 2 specialvar VAR_RESULT, GetSlotMachineId playslotmachine VAR_RESULT @@ -567,9 +533,8 @@ MauvilleCity_GameCorner_EventScript_SlotMachine2:: MauvilleCity_GameCorner_EventScript_SlotMachine3:: lockall - checkitem ITEM_COIN_CASE, 1 - compare VAR_RESULT, FALSE - goto_if_eq MauvilleCity_GameCorner_EventScript_NoCoinCase + checkitem ITEM_COIN_CASE + goto_if_eq VAR_RESULT, FALSE, MauvilleCity_GameCorner_EventScript_NoCoinCase setvar VAR_0x8004, 3 specialvar VAR_RESULT, GetSlotMachineId playslotmachine VAR_RESULT @@ -578,9 +543,8 @@ MauvilleCity_GameCorner_EventScript_SlotMachine3:: MauvilleCity_GameCorner_EventScript_SlotMachine4:: lockall - checkitem ITEM_COIN_CASE, 1 - compare VAR_RESULT, FALSE - goto_if_eq MauvilleCity_GameCorner_EventScript_NoCoinCase + checkitem ITEM_COIN_CASE + goto_if_eq VAR_RESULT, FALSE, MauvilleCity_GameCorner_EventScript_NoCoinCase setvar VAR_0x8004, 4 specialvar VAR_RESULT, GetSlotMachineId playslotmachine VAR_RESULT @@ -589,9 +553,8 @@ MauvilleCity_GameCorner_EventScript_SlotMachine4:: MauvilleCity_GameCorner_EventScript_SlotMachine5:: lockall - checkitem ITEM_COIN_CASE, 1 - compare VAR_RESULT, FALSE - goto_if_eq MauvilleCity_GameCorner_EventScript_NoCoinCase + checkitem ITEM_COIN_CASE + goto_if_eq VAR_RESULT, FALSE, MauvilleCity_GameCorner_EventScript_NoCoinCase setvar VAR_0x8004, 5 specialvar VAR_RESULT, GetSlotMachineId playslotmachine VAR_RESULT @@ -600,9 +563,8 @@ MauvilleCity_GameCorner_EventScript_SlotMachine5:: MauvilleCity_GameCorner_EventScript_SlotMachine6:: lockall - checkitem ITEM_COIN_CASE, 1 - compare VAR_RESULT, FALSE - goto_if_eq MauvilleCity_GameCorner_EventScript_NoCoinCase + checkitem ITEM_COIN_CASE + goto_if_eq VAR_RESULT, FALSE, MauvilleCity_GameCorner_EventScript_NoCoinCase setvar VAR_0x8004, 6 specialvar VAR_RESULT, GetSlotMachineId playslotmachine VAR_RESULT @@ -611,9 +573,8 @@ MauvilleCity_GameCorner_EventScript_SlotMachine6:: MauvilleCity_GameCorner_EventScript_SlotMachine7:: lockall - checkitem ITEM_COIN_CASE, 1 - compare VAR_RESULT, FALSE - goto_if_eq MauvilleCity_GameCorner_EventScript_NoCoinCase + checkitem ITEM_COIN_CASE + goto_if_eq VAR_RESULT, FALSE, MauvilleCity_GameCorner_EventScript_NoCoinCase setvar VAR_0x8004, 7 specialvar VAR_RESULT, GetSlotMachineId playslotmachine VAR_RESULT @@ -622,9 +583,8 @@ MauvilleCity_GameCorner_EventScript_SlotMachine7:: MauvilleCity_GameCorner_EventScript_SlotMachine8:: lockall - checkitem ITEM_COIN_CASE, 1 - compare VAR_RESULT, FALSE - goto_if_eq MauvilleCity_GameCorner_EventScript_NoCoinCase + checkitem ITEM_COIN_CASE + goto_if_eq VAR_RESULT, FALSE, MauvilleCity_GameCorner_EventScript_NoCoinCase setvar VAR_0x8004, 8 specialvar VAR_RESULT, GetSlotMachineId playslotmachine VAR_RESULT @@ -633,9 +593,8 @@ MauvilleCity_GameCorner_EventScript_SlotMachine8:: MauvilleCity_GameCorner_EventScript_SlotMachine9:: lockall - checkitem ITEM_COIN_CASE, 1 - compare VAR_RESULT, FALSE - goto_if_eq MauvilleCity_GameCorner_EventScript_NoCoinCase + checkitem ITEM_COIN_CASE + goto_if_eq VAR_RESULT, FALSE, MauvilleCity_GameCorner_EventScript_NoCoinCase setvar VAR_0x8004, 9 specialvar VAR_RESULT, GetSlotMachineId playslotmachine VAR_RESULT @@ -644,9 +603,8 @@ MauvilleCity_GameCorner_EventScript_SlotMachine9:: MauvilleCity_GameCorner_EventScript_SlotMachine10:: lockall - checkitem ITEM_COIN_CASE, 1 - compare VAR_RESULT, FALSE - goto_if_eq MauvilleCity_GameCorner_EventScript_NoCoinCase + checkitem ITEM_COIN_CASE + goto_if_eq VAR_RESULT, FALSE, MauvilleCity_GameCorner_EventScript_NoCoinCase setvar VAR_0x8004, 10 specialvar VAR_RESULT, GetSlotMachineId playslotmachine VAR_RESULT @@ -655,9 +613,8 @@ MauvilleCity_GameCorner_EventScript_SlotMachine10:: MauvilleCity_GameCorner_EventScript_SlotMachine11:: lockall - checkitem ITEM_COIN_CASE, 1 - compare VAR_RESULT, FALSE - goto_if_eq MauvilleCity_GameCorner_EventScript_NoCoinCase + checkitem ITEM_COIN_CASE + goto_if_eq VAR_RESULT, FALSE, MauvilleCity_GameCorner_EventScript_NoCoinCase setvar VAR_0x8004, 11 specialvar VAR_RESULT, GetSlotMachineId playslotmachine VAR_RESULT diff --git a/data/maps/MauvilleCity_Gym/scripts.inc b/data/maps/MauvilleCity_Gym/scripts.inc index 3c09ecfa2042..de924d7d93c3 100644 --- a/data/maps/MauvilleCity_Gym/scripts.inc +++ b/data/maps/MauvilleCity_Gym/scripts.inc @@ -17,32 +17,32 @@ MauvilleCity_Gym_EventScript_UpdateBarriers:: end MauvilleCity_Gym_EventScript_SetAltBarriers:: - setmetatile 3, 11, METATILE_MauvilleGym_RedBeamV1_On, 1 - setmetatile 3, 12, METATILE_MauvilleGym_RedBeamV2_On, 1 - setmetatile 3, 13, METATILE_MauvilleGym_PoleTop_On, 1 - setmetatile 4, 10, METATILE_MauvilleGym_RedBeamH1_On, 0 - setmetatile 5, 10, METATILE_MauvilleGym_RedBeamH2_On, 0 - setmetatile 4, 11, METATILE_MauvilleGym_RedBeamH3_On, 1 - setmetatile 5, 11, METATILE_MauvilleGym_RedBeamH4_On, 1 - setmetatile 7, 10, METATILE_MauvilleGym_RedBeamH1_On, 0 - setmetatile 8, 10, METATILE_MauvilleGym_RedBeamH2_On, 0 - setmetatile 7, 11, METATILE_MauvilleGym_RedBeamH3_On, 1 - setmetatile 8, 11, METATILE_MauvilleGym_RedBeamH4_On, 1 - setmetatile 4, 13, METATILE_MauvilleGym_GreenBeamH1_Off, 0 - setmetatile 5, 13, METATILE_MauvilleGym_GreenBeamH2_Off, 0 - setmetatile 4, 14, METATILE_MauvilleGym_GreenBeamH3_Off, 0 - setmetatile 5, 14, METATILE_MauvilleGym_GreenBeamH4_Off, 0 - setmetatile 1, 10, METATILE_MauvilleGym_GreenBeamH1_Off, 0 - setmetatile 2, 10, METATILE_MauvilleGym_GreenBeamH2_Off, 0 - setmetatile 1, 11, METATILE_MauvilleGym_GreenBeamH3_Off, 0 - setmetatile 2, 11, METATILE_MauvilleGym_GreenBeamH4_Off, 0 - setmetatile 6, 8, METATILE_MauvilleGym_PoleBottom_On, 1 - setmetatile 6, 9, METATILE_MauvilleGym_FloorTile, 0 - setmetatile 6, 10, METATILE_MauvilleGym_PoleTop_Off, 0 - setmetatile 4, 6, METATILE_MauvilleGym_GreenBeamH1_Off, 0 - setmetatile 5, 6, METATILE_MauvilleGym_GreenBeamH2_Off, 0 - setmetatile 4, 7, METATILE_MauvilleGym_GreenBeamH3_Off, 0 - setmetatile 5, 7, METATILE_MauvilleGym_GreenBeamH4_Off, 0 + setmetatile 3, 11, METATILE_MauvilleGym_RedBeamV1_On, TRUE + setmetatile 3, 12, METATILE_MauvilleGym_RedBeamV2_On, TRUE + setmetatile 3, 13, METATILE_MauvilleGym_PoleTop_On, TRUE + setmetatile 4, 10, METATILE_MauvilleGym_RedBeamH1_On, FALSE + setmetatile 5, 10, METATILE_MauvilleGym_RedBeamH2_On, FALSE + setmetatile 4, 11, METATILE_MauvilleGym_RedBeamH3_On, TRUE + setmetatile 5, 11, METATILE_MauvilleGym_RedBeamH4_On, TRUE + setmetatile 7, 10, METATILE_MauvilleGym_RedBeamH1_On, FALSE + setmetatile 8, 10, METATILE_MauvilleGym_RedBeamH2_On, FALSE + setmetatile 7, 11, METATILE_MauvilleGym_RedBeamH3_On, TRUE + setmetatile 8, 11, METATILE_MauvilleGym_RedBeamH4_On, TRUE + setmetatile 4, 13, METATILE_MauvilleGym_GreenBeamH1_Off, FALSE + setmetatile 5, 13, METATILE_MauvilleGym_GreenBeamH2_Off, FALSE + setmetatile 4, 14, METATILE_MauvilleGym_GreenBeamH3_Off, FALSE + setmetatile 5, 14, METATILE_MauvilleGym_GreenBeamH4_Off, FALSE + setmetatile 1, 10, METATILE_MauvilleGym_GreenBeamH1_Off, FALSE + setmetatile 2, 10, METATILE_MauvilleGym_GreenBeamH2_Off, FALSE + setmetatile 1, 11, METATILE_MauvilleGym_GreenBeamH3_Off, FALSE + setmetatile 2, 11, METATILE_MauvilleGym_GreenBeamH4_Off, FALSE + setmetatile 6, 8, METATILE_MauvilleGym_PoleBottom_On, TRUE + setmetatile 6, 9, METATILE_MauvilleGym_FloorTile, FALSE + setmetatile 6, 10, METATILE_MauvilleGym_PoleTop_Off, FALSE + setmetatile 4, 6, METATILE_MauvilleGym_GreenBeamH1_Off, FALSE + setmetatile 5, 6, METATILE_MauvilleGym_GreenBeamH2_Off, FALSE + setmetatile 4, 7, METATILE_MauvilleGym_GreenBeamH3_Off, FALSE + setmetatile 5, 7, METATILE_MauvilleGym_GreenBeamH4_Off, FALSE end MauvilleCity_Gym_EventScript_Switch1Pressed:: @@ -76,11 +76,9 @@ MauvilleCity_Gym_EventScript_DeactivatePuzzle:: MauvilleCity_Gym_EventScript_Wattson:: trainerbattle_single TRAINER_WATTSON_1, MauvilleCity_Gym_Text_WattsonIntro, MauvilleCity_Gym_Text_WattsonDefeat, MauvilleCity_Gym_EventScript_WattsonDefeated, NO_MUSIC specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq MauvilleCity_Gym_EventScript_WattsonRematch + goto_if_eq VAR_RESULT, TRUE, MauvilleCity_Gym_EventScript_WattsonRematch goto_if_unset FLAG_RECEIVED_TM34, MauvilleCity_Gym_EventScript_GiveShockWave2 - compare VAR_NEW_MAUVILLE_STATE, 2 - goto_if_eq MauvilleCity_Gym_EventScript_CompletedNewMauville + goto_if_eq VAR_NEW_MAUVILLE_STATE, 2, MauvilleCity_Gym_EventScript_CompletedNewMauville msgbox MauvilleCity_Gym_Text_WattsonPostBattle, MSGBOX_DEFAULT release end @@ -95,8 +93,7 @@ MauvilleCity_Gym_EventScript_WattsonDefeated:: setflag FLAG_DEFEATED_MAUVILLE_GYM setflag FLAG_BADGE03_GET addvar VAR_PETALBURG_GYM_STATE, 1 - compare VAR_PETALBURG_GYM_STATE, 6 - call_if_eq Common_EventScript_ReadyPetalburgGymForBattle + call_if_eq VAR_PETALBURG_GYM_STATE, 6, Common_EventScript_ReadyPetalburgGymForBattle setvar VAR_0x8008, 3 call Common_EventScript_SetGymTrainers special MauvilleGymDeactivatePuzzle @@ -116,8 +113,7 @@ MauvilleCity_Gym_EventScript_WattsonDefeated:: MauvilleCity_Gym_EventScript_GiveShockWave2:: giveitem ITEM_TM34 - compare VAR_RESULT, FALSE - goto_if_eq Common_EventScript_ShowBagIsFull + goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull msgbox MauvilleCity_Gym_Text_ExplainShockWave, MSGBOX_DEFAULT setflag FLAG_RECEIVED_TM34 release @@ -125,8 +121,7 @@ MauvilleCity_Gym_EventScript_GiveShockWave2:: MauvilleCity_Gym_EventScript_GiveShockWave:: giveitem ITEM_TM34 - compare VAR_RESULT, FALSE - goto_if_eq Common_EventScript_BagIsFull + goto_if_eq VAR_RESULT, FALSE, Common_EventScript_BagIsFull msgbox MauvilleCity_Gym_Text_ExplainShockWave, MSGBOX_DEFAULT setflag FLAG_RECEIVED_TM34 return @@ -144,8 +139,7 @@ MauvilleCity_Gym_EventScript_WattsonRematch:: MauvilleCity_Gym_EventScript_Switch1:: lockall goto_if_set FLAG_DEFEATED_MAUVILLE_GYM, MauvilleCity_Gym_EventScript_SwitchDoNothing - compare VAR_MAUVILLE_GYM_STATE, 1 - goto_if_eq MauvilleCity_Gym_EventScript_SwitchDoNothing + goto_if_eq VAR_MAUVILLE_GYM_STATE, 1, MauvilleCity_Gym_EventScript_SwitchDoNothing setvar VAR_MAUVILLE_GYM_STATE, 1 setvar VAR_0x8004, 0 goto MauvilleCity_Gym_EventScript_PressFloorSwitch @@ -154,8 +148,7 @@ MauvilleCity_Gym_EventScript_Switch1:: MauvilleCity_Gym_EventScript_Switch2:: lockall goto_if_set FLAG_DEFEATED_MAUVILLE_GYM, MauvilleCity_Gym_EventScript_SwitchDoNothing - compare VAR_MAUVILLE_GYM_STATE, 2 - goto_if_eq MauvilleCity_Gym_EventScript_SwitchDoNothing + goto_if_eq VAR_MAUVILLE_GYM_STATE, 2, MauvilleCity_Gym_EventScript_SwitchDoNothing setvar VAR_MAUVILLE_GYM_STATE, 2 setvar VAR_0x8004, 1 goto MauvilleCity_Gym_EventScript_PressFloorSwitch @@ -164,8 +157,7 @@ MauvilleCity_Gym_EventScript_Switch2:: MauvilleCity_Gym_EventScript_Switch3:: lockall goto_if_set FLAG_DEFEATED_MAUVILLE_GYM, MauvilleCity_Gym_EventScript_SwitchDoNothing - compare VAR_MAUVILLE_GYM_STATE, 3 - goto_if_eq MauvilleCity_Gym_EventScript_SwitchDoNothing + goto_if_eq VAR_MAUVILLE_GYM_STATE, 3, MauvilleCity_Gym_EventScript_SwitchDoNothing setvar VAR_MAUVILLE_GYM_STATE, 3 setvar VAR_0x8004, 2 goto MauvilleCity_Gym_EventScript_PressFloorSwitch @@ -174,8 +166,7 @@ MauvilleCity_Gym_EventScript_Switch3:: MauvilleCity_Gym_EventScript_Switch4:: lockall goto_if_set FLAG_DEFEATED_MAUVILLE_GYM, MauvilleCity_Gym_EventScript_SwitchDoNothing - compare VAR_MAUVILLE_GYM_STATE, 4 - goto_if_eq MauvilleCity_Gym_EventScript_SwitchDoNothing + goto_if_eq VAR_MAUVILLE_GYM_STATE, 4, MauvilleCity_Gym_EventScript_SwitchDoNothing setvar VAR_MAUVILLE_GYM_STATE, 4 setvar VAR_0x8004, 3 goto MauvilleCity_Gym_EventScript_PressFloorSwitch diff --git a/data/maps/MauvilleCity_House2/scripts.inc b/data/maps/MauvilleCity_House2/scripts.inc index 178b79f9b4ed..193e0c04ce14 100644 --- a/data/maps/MauvilleCity_House2/scripts.inc +++ b/data/maps/MauvilleCity_House2/scripts.inc @@ -6,9 +6,8 @@ MauvilleCity_House2_EventScript_Woman:: faceplayer goto_if_set FLAG_RECEIVED_COIN_CASE, MauvilleCity_House2_EventScript_ReceivedCoinCase msgbox MauvilleCity_House2_Text_BuyHarborMailAtSlateport, MSGBOX_DEFAULT - checkitem ITEM_HARBOR_MAIL, 1 - compare VAR_RESULT, TRUE - goto_if_eq MauvilleCity_House2_EventScript_AskToTradeForHarborMail + checkitem ITEM_HARBOR_MAIL + goto_if_eq VAR_RESULT, TRUE, MauvilleCity_House2_EventScript_AskToTradeForHarborMail release end @@ -19,10 +18,8 @@ MauvilleCity_House2_EventScript_AskToTradeForHarborMail:: applymovement VAR_LAST_TALKED, Common_Movement_Delay48 waitmovement 0 msgbox MauvilleCity_House2_Text_TradeHarborMailForCoinCase, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq MauvilleCity_House2_EventScript_AcceptTrade - compare VAR_RESULT, NO - goto_if_eq MauvilleCity_House2_EventScript_DeclineTrade + goto_if_eq VAR_RESULT, YES, MauvilleCity_House2_EventScript_AcceptTrade + goto_if_eq VAR_RESULT, NO, MauvilleCity_House2_EventScript_DeclineTrade end MauvilleCity_House2_EventScript_AcceptTrade:: diff --git a/data/maps/MeteorFalls_1F_1R/scripts.inc b/data/maps/MeteorFalls_1F_1R/scripts.inc index 23ae9728deb6..b81f5de267e8 100644 --- a/data/maps/MeteorFalls_1F_1R/scripts.inc +++ b/data/maps/MeteorFalls_1F_1R/scripts.inc @@ -13,10 +13,10 @@ MeteorFalls_1F_1R_OnLoad: end MeteorFalls_1F_1R_EventScript_OpenStevensCave:: - setmetatile 4, 1, METATILE_MeteorFalls_CaveEntrance_Top, 1 - setmetatile 3, 2, METATILE_MeteorFalls_CaveEntrance_Left, 1 - setmetatile 4, 2, METATILE_MeteorFalls_CaveEntrance_Bottom, 0 - setmetatile 5, 2, METATILE_MeteorFalls_CaveEntrance_Right, 1 + setmetatile 4, 1, METATILE_MeteorFalls_CaveEntrance_Top, TRUE + setmetatile 3, 2, METATILE_MeteorFalls_CaveEntrance_Left, TRUE + setmetatile 4, 2, METATILE_MeteorFalls_CaveEntrance_Bottom, FALSE + setmetatile 5, 2, METATILE_MeteorFalls_CaveEntrance_Right, TRUE return MeteorFalls_1F_1R_EventScript_MagmaStealsMeteoriteScene:: diff --git a/data/maps/MeteorFalls_1F_2R/scripts.inc b/data/maps/MeteorFalls_1F_2R/scripts.inc index 706d362bed63..4e3e9b321baa 100644 --- a/data/maps/MeteorFalls_1F_2R/scripts.inc +++ b/data/maps/MeteorFalls_1F_2R/scripts.inc @@ -4,8 +4,7 @@ MeteorFalls_1F_2R_MapScripts:: MeteorFalls_1F_2R_EventScript_Nicolas:: trainerbattle_single TRAINER_NICOLAS_1, MeteorFalls_1F_2R_Text_NicolasIntro, MeteorFalls_1F_2R_Text_NicolasDefeat, MeteorFalls_1F_2R_EventScript_RegisterNicolas specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq MeteorFalls_1F_2R_EventScript_RematchNicolas + goto_if_eq VAR_RESULT, TRUE, MeteorFalls_1F_2R_EventScript_RematchNicolas msgbox MeteorFalls_1F_2R_Text_NicolasPostBattle, MSGBOX_DEFAULT release end @@ -26,8 +25,7 @@ MeteorFalls_1F_2R_EventScript_RematchNicolas:: MeteorFalls_1F_2R_EventScript_John:: trainerbattle_double TRAINER_JOHN_AND_JAY_1, MeteorFalls_1F_2R_Text_JohnIntro, MeteorFalls_1F_2R_Text_JohnDefeat, MeteorFalls_1F_2R_Text_JohnNotEnoughMons, MeteorFalls_1F_2R_EventScript_RegisterJohn specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq MeteorFalls_1F_2R_EventScript_RematchJohn + goto_if_eq VAR_RESULT, TRUE, MeteorFalls_1F_2R_EventScript_RematchJohn msgbox MeteorFalls_1F_2R_Text_JohnPostBattle, MSGBOX_DEFAULT release end @@ -46,8 +44,7 @@ MeteorFalls_1F_2R_EventScript_RematchJohn:: MeteorFalls_1F_2R_EventScript_Jay:: trainerbattle_double TRAINER_JOHN_AND_JAY_1, MeteorFalls_1F_2R_Text_JayIntro, MeteorFalls_1F_2R_Text_JayDefeat, MeteorFalls_1F_2R_Text_JayNotEnoughMons, MeteorFalls_1F_2R_EventScript_RegisterJay specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq MeteorFalls_1F_2R_EventScript_RematchJay + goto_if_eq VAR_RESULT, TRUE, MeteorFalls_1F_2R_EventScript_RematchJay msgbox MeteorFalls_1F_2R_Text_JayPostBattle, MSGBOX_DEFAULT release end diff --git a/data/maps/MirageTower_2F/scripts.inc b/data/maps/MirageTower_2F/scripts.inc index 3d53359d4c14..39d2be7f43bc 100644 --- a/data/maps/MirageTower_2F/scripts.inc +++ b/data/maps/MirageTower_2F/scripts.inc @@ -6,6 +6,6 @@ MirageTower_2F_MapScripts:: MirageTower_2F_SetHoleWarp: setstepcallback STEP_CB_CRACKED_FLOOR - setholewarp MAP_MIRAGE_TOWER_1F, 255, 0, 0 + setholewarp MAP_MIRAGE_TOWER_1F end diff --git a/data/maps/MirageTower_3F/scripts.inc b/data/maps/MirageTower_3F/scripts.inc index 02b08640083e..1b2f04aeee05 100644 --- a/data/maps/MirageTower_3F/scripts.inc +++ b/data/maps/MirageTower_3F/scripts.inc @@ -6,6 +6,6 @@ MirageTower_3F_MapScripts:: MirageTower_3F_SetHoleWarp: setstepcallback STEP_CB_CRACKED_FLOOR - setholewarp MAP_MIRAGE_TOWER_2F, 255, 0, 0 + setholewarp MAP_MIRAGE_TOWER_2F end diff --git a/data/maps/MirageTower_4F/scripts.inc b/data/maps/MirageTower_4F/scripts.inc index 2c96710d13e7..61bde877c512 100644 --- a/data/maps/MirageTower_4F/scripts.inc +++ b/data/maps/MirageTower_4F/scripts.inc @@ -8,8 +8,7 @@ MirageTower_4F_EventScript_RootFossil:: lock faceplayer msgbox MirageTower_4F_Text_TakeRootFossil, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq MirageTower_4F_EventScript_LeaveRootFossil + goto_if_eq VAR_RESULT, NO, MirageTower_4F_EventScript_LeaveRootFossil giveitem ITEM_ROOT_FOSSIL closemessage setflag FLAG_HIDE_MIRAGE_TOWER_ROOT_FOSSIL @@ -29,8 +28,7 @@ MirageTower_4F_EventScript_ClawFossil:: lock faceplayer msgbox MirageTower_4F_Text_TakeClawFossil, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq MirageTower_4F_EventScript_LeaveClawFossil + goto_if_eq VAR_RESULT, NO, MirageTower_4F_EventScript_LeaveClawFossil giveitem ITEM_CLAW_FOSSIL closemessage setflag FLAG_HIDE_MIRAGE_TOWER_CLAW_FOSSIL @@ -57,7 +55,7 @@ MirageTower_4F_EventScript_CollapseMirageTower:: waitstate setvar VAR_MIRAGE_TOWER_STATE, 1 clearflag FLAG_LANDMARK_MIRAGE_TOWER - warp MAP_ROUTE111, 255, 19, 59 + warp MAP_ROUTE111, 19, 59 waitstate release end diff --git a/data/maps/MossdeepCity/scripts.inc b/data/maps/MossdeepCity/scripts.inc index f5af3a391bf3..836490cbddb2 100644 --- a/data/maps/MossdeepCity/scripts.inc +++ b/data/maps/MossdeepCity/scripts.inc @@ -233,12 +233,10 @@ MossdeepCity_EventScript_KingsRockBoy:: faceplayer goto_if_set FLAG_RECEIVED_KINGS_ROCK, MossdeepCity_EventScript_ReceivedKingsRock msgbox MossdeepCity_Text_WantKingsRockStevenGaveMe, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq MossdeepCity_EventScript_DeclineKingsRock + goto_if_eq VAR_RESULT, NO, MossdeepCity_EventScript_DeclineKingsRock msgbox MossdeepCity_Text_YouCanKeepIt, MSGBOX_DEFAULT giveitem ITEM_KINGS_ROCK - compare VAR_RESULT, FALSE - goto_if_eq Common_EventScript_ShowBagIsFull + goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull setflag FLAG_RECEIVED_KINGS_ROCK release end @@ -262,10 +260,8 @@ MossdeepCity_EventScript_Scott:: faceplayer msgbox MossdeepCity_Text_ScottSomethingWrongWithTown, MSGBOX_DEFAULT closemessage - compare VAR_FACING, DIR_NORTH - call_if_eq MossdeepCity_EventScript_ScottExitNorth - compare VAR_FACING, DIR_EAST - call_if_eq MossdeepCity_EventScript_ScottExitEast + call_if_eq VAR_FACING, DIR_NORTH, MossdeepCity_EventScript_ScottExitNorth + call_if_eq VAR_FACING, DIR_EAST, MossdeepCity_EventScript_ScottExitEast addvar VAR_SCOTT_STATE, 1 removeobject LOCALID_SCOTT release diff --git a/data/maps/MossdeepCity_Gym/scripts.inc b/data/maps/MossdeepCity_Gym/scripts.inc index 22c2e17ab915..b47011d680e3 100644 --- a/data/maps/MossdeepCity_Gym/scripts.inc +++ b/data/maps/MossdeepCity_Gym/scripts.inc @@ -26,33 +26,32 @@ MossdeepCity_Gym_EventScript_CheckSwitch4:: @ All the below set metatile scripts are leftover from RS and are functionally unused MossdeepCity_Gym_EventScript_SetSwitch1Metatiles:: - setmetatile 5, 5, METATILE_RS_MossdeepGym_RedArrow_Right, 0 - setmetatile 2, 7, METATILE_RS_MossdeepGym_Switch_Down, 1 + setmetatile 5, 5, METATILE_RS_MossdeepGym_RedArrow_Right, FALSE + setmetatile 2, 7, METATILE_RS_MossdeepGym_Switch_Down, TRUE goto MossdeepCity_Gym_EventScript_CheckSwitch2 end MossdeepCity_Gym_EventScript_SetSwitch2Metatiles:: - setmetatile 8, 14, METATILE_RS_MossdeepGym_RedArrow_Right, 0 - setmetatile 8, 10, METATILE_RS_MossdeepGym_Switch_Down, 1 + setmetatile 8, 14, METATILE_RS_MossdeepGym_RedArrow_Right, FALSE + setmetatile 8, 10, METATILE_RS_MossdeepGym_Switch_Down, TRUE goto MossdeepCity_Gym_EventScript_CheckSwitch3 end MossdeepCity_Gym_EventScript_SetSwitch3Metatiles:: - setmetatile 15, 17, METATILE_RS_MossdeepGym_RedArrow_Left, 0 - setmetatile 17, 15, METATILE_RS_MossdeepGym_Switch_Down, 1 + setmetatile 15, 17, METATILE_RS_MossdeepGym_RedArrow_Left, FALSE + setmetatile 17, 15, METATILE_RS_MossdeepGym_Switch_Down, TRUE goto MossdeepCity_Gym_EventScript_CheckSwitch4 end MossdeepCity_Gym_EventScript_SetSwitch4Metatiles:: - setmetatile 1, 23, METATILE_RS_MossdeepGym_RedArrow_Up, 0 - setmetatile 5, 24, METATILE_RS_MossdeepGym_Switch_Down, 1 + setmetatile 1, 23, METATILE_RS_MossdeepGym_RedArrow_Up, FALSE + setmetatile 5, 24, METATILE_RS_MossdeepGym_Switch_Down, TRUE end MossdeepCity_Gym_EventScript_TateAndLiza:: trainerbattle_double TRAINER_TATE_AND_LIZA_1, MossdeepCity_Gym_Text_TateAndLizaIntro, MossdeepCity_Gym_Text_TateAndLizaDefeat, MossdeepCity_Gym_Text_TateAndLizaNeedTwoMons, MossdeepCity_Gym_EventScript_TateAndLizaDefeated, NO_MUSIC specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq MossdeepCity_Gym_EventScript_TateAndLizaRematch + goto_if_eq VAR_RESULT, TRUE, MossdeepCity_Gym_EventScript_TateAndLizaRematch goto_if_unset FLAG_RECEIVED_TM04, MossdeepCity_Gym_EventScript_GiveCalmMind2 msgbox MossdeepCity_Gym_Text_TateAndLizaPostBattle, MSGBOX_DEFAULT release @@ -92,8 +91,7 @@ MossdeepCity_Gym_EventScript_TateAndLizaDefeated:: MossdeepCity_Gym_EventScript_GiveCalmMind2:: giveitem ITEM_TM04 - compare VAR_RESULT, FALSE - goto_if_eq Common_EventScript_ShowBagIsFull + goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull msgbox MossdeepCity_Gym_Text_ExplainCalmMind, MSGBOX_DEFAULT setflag FLAG_RECEIVED_TM04 release @@ -101,8 +99,7 @@ MossdeepCity_Gym_EventScript_GiveCalmMind2:: MossdeepCity_Gym_EventScript_GiveCalmMind:: giveitem ITEM_TM04 - compare VAR_RESULT, FALSE - goto_if_eq Common_EventScript_BagIsFull + goto_if_eq VAR_RESULT, FALSE, Common_EventScript_BagIsFull msgbox MossdeepCity_Gym_Text_ExplainCalmMind, MSGBOX_DEFAULT setflag FLAG_RECEIVED_TM04 return @@ -119,8 +116,8 @@ MossdeepCity_Gym_EventScript_Switch1:: setflag FLAG_MOSSDEEP_GYM_SWITCH_1 applymovement OBJ_EVENT_ID_PLAYER, MossdeepCity_Gym_Movement_WaitAfterSwitchUse waitmovement 0 - setmetatile 5, 5, METATILE_RS_MossdeepGym_RedArrow_Right, 0 - setmetatile 2, 7, METATILE_RS_MossdeepGym_Switch_Down, 1 + setmetatile 5, 5, METATILE_RS_MossdeepGym_RedArrow_Right, FALSE + setmetatile 2, 7, METATILE_RS_MossdeepGym_Switch_Down, TRUE goto MossdeepCity_Gym_EventScript_DrawMapAfterSwitchUsed end @@ -134,8 +131,8 @@ MossdeepCity_Gym_EventScript_ClearSwitch1:: clearflag FLAG_MOSSDEEP_GYM_SWITCH_1 applymovement OBJ_EVENT_ID_PLAYER, MossdeepCity_Gym_Movement_WaitAfterSwitchUse waitmovement 0 - setmetatile 5, 5, METATILE_RS_MossdeepGym_RedArrow_Left, 0 - setmetatile 2, 7, METATILE_RS_MossdeepGym_Switch_Up, 1 + setmetatile 5, 5, METATILE_RS_MossdeepGym_RedArrow_Left, FALSE + setmetatile 2, 7, METATILE_RS_MossdeepGym_Switch_Up, TRUE goto MossdeepCity_Gym_EventScript_DrawMapAfterSwitchUsed end @@ -145,8 +142,8 @@ MossdeepCity_Gym_EventScript_Switch2:: setflag FLAG_MOSSDEEP_GYM_SWITCH_2 applymovement OBJ_EVENT_ID_PLAYER, MossdeepCity_Gym_Movement_WaitAfterSwitchUse waitmovement 0 - setmetatile 8, 14, METATILE_RS_MossdeepGym_RedArrow_Right, 0 - setmetatile 8, 10, METATILE_RS_MossdeepGym_Switch_Down, 1 + setmetatile 8, 14, METATILE_RS_MossdeepGym_RedArrow_Right, FALSE + setmetatile 8, 10, METATILE_RS_MossdeepGym_Switch_Down, TRUE goto MossdeepCity_Gym_EventScript_DrawMapAfterSwitchUsed end @@ -154,8 +151,8 @@ MossdeepCity_Gym_EventScript_ClearSwitch2:: clearflag FLAG_MOSSDEEP_GYM_SWITCH_2 applymovement OBJ_EVENT_ID_PLAYER, MossdeepCity_Gym_Movement_WaitAfterSwitchUse waitmovement 0 - setmetatile 8, 14, METATILE_RS_MossdeepGym_RedArrow_Down, 0 - setmetatile 8, 10, METATILE_RS_MossdeepGym_Switch_Up, 1 + setmetatile 8, 14, METATILE_RS_MossdeepGym_RedArrow_Down, FALSE + setmetatile 8, 10, METATILE_RS_MossdeepGym_Switch_Up, TRUE goto MossdeepCity_Gym_EventScript_DrawMapAfterSwitchUsed end @@ -165,8 +162,8 @@ MossdeepCity_Gym_EventScript_Switch3:: setflag FLAG_MOSSDEEP_GYM_SWITCH_3 applymovement OBJ_EVENT_ID_PLAYER, MossdeepCity_Gym_Movement_WaitAfterSwitchUse waitmovement 0 - setmetatile 15, 17, METATILE_RS_MossdeepGym_RedArrow_Left, 0 - setmetatile 17, 15, METATILE_RS_MossdeepGym_Switch_Down, 1 + setmetatile 15, 17, METATILE_RS_MossdeepGym_RedArrow_Left, FALSE + setmetatile 17, 15, METATILE_RS_MossdeepGym_Switch_Down, TRUE goto MossdeepCity_Gym_EventScript_DrawMapAfterSwitchUsed end @@ -174,8 +171,8 @@ MossdeepCity_Gym_EventScript_ClearSwitch3:: clearflag FLAG_MOSSDEEP_GYM_SWITCH_3 applymovement OBJ_EVENT_ID_PLAYER, MossdeepCity_Gym_Movement_WaitAfterSwitchUse waitmovement 0 - setmetatile 15, 17, METATILE_RS_MossdeepGym_RedArrow_Right, 0 - setmetatile 17, 15, METATILE_RS_MossdeepGym_Switch_Up, 1 + setmetatile 15, 17, METATILE_RS_MossdeepGym_RedArrow_Right, FALSE + setmetatile 17, 15, METATILE_RS_MossdeepGym_Switch_Up, TRUE goto MossdeepCity_Gym_EventScript_DrawMapAfterSwitchUsed end @@ -185,8 +182,8 @@ MossdeepCity_Gym_EventScript_Switch4:: setflag FLAG_MOSSDEEP_GYM_SWITCH_4 applymovement OBJ_EVENT_ID_PLAYER, MossdeepCity_Gym_Movement_WaitAfterSwitchUse waitmovement 0 - setmetatile 1, 23, METATILE_RS_MossdeepGym_RedArrow_Up, 0 - setmetatile 5, 24, METATILE_RS_MossdeepGym_Switch_Down, 1 + setmetatile 1, 23, METATILE_RS_MossdeepGym_RedArrow_Up, FALSE + setmetatile 5, 24, METATILE_RS_MossdeepGym_Switch_Down, TRUE goto MossdeepCity_Gym_EventScript_DrawMapAfterSwitchUsed end @@ -194,14 +191,14 @@ MossdeepCity_Gym_EventScript_ClearSwitch4:: clearflag FLAG_MOSSDEEP_GYM_SWITCH_4 applymovement OBJ_EVENT_ID_PLAYER, MossdeepCity_Gym_Movement_WaitAfterSwitchUse waitmovement 0 - setmetatile 1, 23, METATILE_RS_MossdeepGym_RedArrow_Right, 0 - setmetatile 5, 24, METATILE_RS_MossdeepGym_Switch_Up, 1 + setmetatile 1, 23, METATILE_RS_MossdeepGym_RedArrow_Right, FALSE + setmetatile 5, 24, METATILE_RS_MossdeepGym_Switch_Up, TRUE goto MossdeepCity_Gym_EventScript_DrawMapAfterSwitchUsed end MossdeepCity_Gym_EventScript_WarpToEntrance:: lockall - warpmossdeepgym MAP_MOSSDEEP_CITY_GYM, 255, 7, 30 + warpmossdeepgym MAP_MOSSDEEP_CITY_GYM, 7, 30 waitstate releaseall end diff --git a/data/maps/MossdeepCity_House1/scripts.inc b/data/maps/MossdeepCity_House1/scripts.inc index 99224a795e05..433defa66635 100644 --- a/data/maps/MossdeepCity_House1/scripts.inc +++ b/data/maps/MossdeepCity_House1/scripts.inc @@ -4,11 +4,10 @@ MossdeepCity_House1_MapScripts:: MossdeepCity_House1_EventScript_BlackBelt:: lock faceplayer - bufferleadmonspeciesname 0 + bufferleadmonspeciesname STR_VAR_1 msgbox MossdeepCity_House1_Text_HmmYourPokemon, MSGBOX_DEFAULT specialvar VAR_RESULT, GetPokeblockNameByMonNature - compare VAR_RESULT, 0 - goto_if_eq MossdeepCity_House1_EventScript_NeutralNature + goto_if_eq VAR_RESULT, 0, MossdeepCity_House1_EventScript_NeutralNature msgbox MossdeepCity_House1_Text_ItLikesXPokeblocks, MSGBOX_DEFAULT release end diff --git a/data/maps/MossdeepCity_House2/scripts.inc b/data/maps/MossdeepCity_House2/scripts.inc index 5f568ac772bd..56a8381963ef 100644 --- a/data/maps/MossdeepCity_House2/scripts.inc +++ b/data/maps/MossdeepCity_House2/scripts.inc @@ -21,10 +21,8 @@ MossdeepCity_House2_EventScript_Wingull:: closemessage setflag FLAG_WINGULL_DELIVERED_MAIL clearflag FLAG_HIDE_FORTREE_CITY_HOUSE_4_WINGULL - compare VAR_FACING, DIR_NORTH - call_if_eq MossdeepCity_House2_EventScript_WingullExitNorth - compare VAR_FACING, DIR_WEST - call_if_eq MossdeepCity_House2_EventScript_WingullExitWest + call_if_eq VAR_FACING, DIR_NORTH, MossdeepCity_House2_EventScript_WingullExitNorth + call_if_eq VAR_FACING, DIR_WEST, MossdeepCity_House2_EventScript_WingullExitWest removeobject LOCALID_WINGULL release end diff --git a/data/maps/MossdeepCity_House3/scripts.inc b/data/maps/MossdeepCity_House3/scripts.inc index 51df05fe040a..73b0cc26e934 100644 --- a/data/maps/MossdeepCity_House3/scripts.inc +++ b/data/maps/MossdeepCity_House3/scripts.inc @@ -6,8 +6,7 @@ MossdeepCity_House3_EventScript_SuperRodFisherman:: faceplayer goto_if_set FLAG_RECEIVED_SUPER_ROD, MossdeepCity_House3_EventScript_ReceivedSuperRod msgbox MossdeepCity_House3_Text_YouWantSuperRod, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq MossdeepCity_House3_EventScript_DeclineSuperRod + goto_if_eq VAR_RESULT, NO, MossdeepCity_House3_EventScript_DeclineSuperRod msgbox MossdeepCity_House3_Text_SuperRodIsSuper, MSGBOX_DEFAULT giveitem ITEM_SUPER_ROD setflag FLAG_RECEIVED_SUPER_ROD diff --git a/data/maps/MossdeepCity_House4/scripts.inc b/data/maps/MossdeepCity_House4/scripts.inc index 7b7348f4e650..8d0046857a5b 100644 --- a/data/maps/MossdeepCity_House4/scripts.inc +++ b/data/maps/MossdeepCity_House4/scripts.inc @@ -18,8 +18,7 @@ MossdeepCity_House4_EventScript_NinjaBoy:: lock faceplayer special CheckPlayerHasSecretBase - compare VAR_RESULT, FALSE - goto_if_eq MossdeepCity_House4_EventScript_NoSecretBase + goto_if_eq VAR_RESULT, FALSE, MossdeepCity_House4_EventScript_NoSecretBase special GetSecretBaseNearbyMapName msgbox MossdeepCity_House4_Text_YouMadeSecretBaseNearX, MSGBOX_DEFAULT release diff --git a/data/maps/MossdeepCity_SpaceCenter_1F/scripts.inc b/data/maps/MossdeepCity_SpaceCenter_1F/scripts.inc index b44b343a65b4..263b07105679 100644 --- a/data/maps/MossdeepCity_SpaceCenter_1F/scripts.inc +++ b/data/maps/MossdeepCity_SpaceCenter_1F/scripts.inc @@ -11,8 +11,7 @@ MossdeepCity_SpaceCenter_1F_MapScripts:: .byte 0 MossdeepCity_SpaceCenter_1F_OnTransition: - compare VAR_MOSSDEEP_CITY_STATE, 2 - goto_if_eq MossdeepCity_SpaceCenter_1F_EventScript_MoveObjectsForTeamMagma + goto_if_eq VAR_MOSSDEEP_CITY_STATE, 2, MossdeepCity_SpaceCenter_1F_EventScript_MoveObjectsForTeamMagma end MossdeepCity_SpaceCenter_1F_EventScript_MoveObjectsForTeamMagma:: @@ -25,12 +24,9 @@ MossdeepCity_SpaceCenter_1F_EventScript_MoveObjectsForTeamMagma:: setobjectxyperm LOCALID_SCIENTIST_1, 3, 4 setobjectmovementtype LOCALID_SCIENTIST_1, MOVEMENT_TYPE_FACE_RIGHT setobjectmovementtype LOCALID_SCIENTIST_2, MOVEMENT_TYPE_FACE_RIGHT - compare VAR_MOSSDEEP_SPACE_CENTER_STAIR_GUARD_STATE, 1 - goto_if_eq MossdeepCity_SpaceCenter_1F_EventScript_MoveStairGuardLeft - compare VAR_MOSSDEEP_SPACE_CENTER_STAIR_GUARD_STATE, 2 - goto_if_eq MossdeepCity_SpaceCenter_1F_EventScript_MoveStairGuardDown - compare VAR_MOSSDEEP_SPACE_CENTER_STAIR_GUARD_STATE, 3 - goto_if_eq MossdeepCity_SpaceCenter_1F_EventScript_MoveStairGuardRight + goto_if_eq VAR_MOSSDEEP_SPACE_CENTER_STAIR_GUARD_STATE, 1, MossdeepCity_SpaceCenter_1F_EventScript_MoveStairGuardLeft + goto_if_eq VAR_MOSSDEEP_SPACE_CENTER_STAIR_GUARD_STATE, 2, MossdeepCity_SpaceCenter_1F_EventScript_MoveStairGuardDown + goto_if_eq VAR_MOSSDEEP_SPACE_CENTER_STAIR_GUARD_STATE, 3, MossdeepCity_SpaceCenter_1F_EventScript_MoveStairGuardRight end MossdeepCity_SpaceCenter_1F_EventScript_MoveStairGuardLeft:: @@ -47,26 +43,22 @@ MossdeepCity_SpaceCenter_1F_EventScript_MoveStairGuardRight:: end MossdeepCity_SpaceCenter_1F_OnLoad: - compare VAR_MOSSDEEP_CITY_STATE, 2 - goto_if_le MossdeepCity_SpaceCenter_1F_EventScript_SetMagmaNote + goto_if_le VAR_MOSSDEEP_CITY_STATE, 2, MossdeepCity_SpaceCenter_1F_EventScript_SetMagmaNote end MossdeepCity_SpaceCenter_1F_EventScript_SetMagmaNote:: - setmetatile 2, 5, METATILE_Facility_DataPad, 1 + setmetatile 2, 5, METATILE_Facility_DataPad, TRUE return MossdeepCity_SpaceCenter_1F_EventScript_RocketLaunchCounter:: lock faceplayer - compare VAR_MOSSDEEP_CITY_STATE, 2 - goto_if_eq MossdeepCity_SpaceCenter_1F_EventScript_RocketLaunchCounterMagma + goto_if_eq VAR_MOSSDEEP_CITY_STATE, 2, MossdeepCity_SpaceCenter_1F_EventScript_RocketLaunchCounterMagma dotimebasedevents specialvar VAR_RESULT, GetWeekCount - buffernumberstring 0, VAR_RESULT - compare VAR_RESULT, 0 - call_if_eq MossdeepCity_SpaceCenter_1F_EventScript_NoLaunchesYet - compare VAR_RESULT, 1 - call_if_ge MossdeepCity_SpaceCenter_1F_EventScript_ShowLaunchNumber + buffernumberstring STR_VAR_1, VAR_RESULT + call_if_eq VAR_RESULT, 0, MossdeepCity_SpaceCenter_1F_EventScript_NoLaunchesYet + call_if_ge VAR_RESULT, 1, MossdeepCity_SpaceCenter_1F_EventScript_ShowLaunchNumber closemessage applymovement VAR_LAST_TALKED, Common_Movement_FaceOriginalDirection waitmovement 0 @@ -84,11 +76,9 @@ MossdeepCity_SpaceCenter_1F_EventScript_ShowLaunchNumber:: MossdeepCity_SpaceCenter_1F_EventScript_RocketLaunchCounterMagma:: dotimebasedevents specialvar VAR_RESULT, GetWeekCount - buffernumberstring 0, VAR_RESULT - compare VAR_RESULT, 0 - call_if_eq MossdeepCity_SpaceCenter_1F_EventScript_NoLaunchesYetMagma - compare VAR_RESULT, 1 - call_if_ge MossdeepCity_SpaceCenter_1F_EventScript_ShowLaunchNumberMagma + buffernumberstring STR_VAR_1, VAR_RESULT + call_if_eq VAR_RESULT, 0, MossdeepCity_SpaceCenter_1F_EventScript_NoLaunchesYetMagma + call_if_ge VAR_RESULT, 1, MossdeepCity_SpaceCenter_1F_EventScript_ShowLaunchNumberMagma closemessage applymovement VAR_LAST_TALKED, Common_Movement_WalkInPlaceFasterRight waitmovement 0 @@ -106,8 +96,7 @@ MossdeepCity_SpaceCenter_1F_EventScript_ShowLaunchNumberMagma:: MossdeepCity_SpaceCenter_1F_EventScript_Scientist:: lock faceplayer - compare VAR_MOSSDEEP_CITY_STATE, 2 - goto_if_eq MossdeepCity_SpaceCenter_1F_EventScript_ScientistMagma + goto_if_eq VAR_MOSSDEEP_CITY_STATE, 2, MossdeepCity_SpaceCenter_1F_EventScript_ScientistMagma msgbox MossdeepCity_SpaceCenter_1F_Text_RocketLaunchDemandsPerfection, MSGBOX_DEFAULT release end @@ -122,13 +111,11 @@ MossdeepCity_SpaceCenter_1F_EventScript_ScientistMagma:: MossdeepCity_SpaceCenter_1F_EventScript_SunStoneMan:: lock faceplayer - compare VAR_MOSSDEEP_CITY_STATE, 2 - goto_if_eq MossdeepCity_SpaceCenter_1F_EventScript_SunStoneManMagma + goto_if_eq VAR_MOSSDEEP_CITY_STATE, 2, MossdeepCity_SpaceCenter_1F_EventScript_SunStoneManMagma goto_if_set FLAG_RECEIVED_SUN_STONE_MOSSDEEP, MossdeepCity_SpaceCenter_1F_EventScript_GaveSunStone msgbox MossdeepCity_SpaceCenter_1F_Text_FoundThisYouCanHaveIt, MSGBOX_DEFAULT giveitem ITEM_SUN_STONE - compare VAR_RESULT, FALSE - goto_if_eq Common_EventScript_ShowBagIsFull + goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull setflag FLAG_RECEIVED_SUN_STONE_MOSSDEEP msgbox MossdeepCity_SpaceCenter_1F_Text_HoennFamousForMeteorShowers, MSGBOX_DEFAULT release @@ -143,8 +130,7 @@ MossdeepCity_SpaceCenter_1F_EventScript_SunStoneManMagma:: goto_if_set FLAG_RECEIVED_SUN_STONE_MOSSDEEP, MossdeepCity_SpaceCenter_1F_EventScript_GaveSunStoneMagma msgbox MossdeepCity_SpaceCenter_1F_Text_MagmaCantStealFuelTakeThis, MSGBOX_DEFAULT giveitem ITEM_SUN_STONE - compare VAR_RESULT, FALSE - goto_if_eq Common_EventScript_ShowBagIsFull + goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull setflag FLAG_RECEIVED_SUN_STONE_MOSSDEEP msgbox MossdeepCity_SpaceCenter_1F_Text_CantStrollOnBeachWithMagma, MSGBOX_DEFAULT applymovement VAR_LAST_TALKED, Common_Movement_WalkInPlaceFasterRight @@ -163,10 +149,8 @@ MossdeepCity_SpaceCenter_1F_EventScript_Woman:: lock faceplayer goto_if_set FLAG_SYS_GAME_CLEAR, MossdeepCity_SpaceCenter_1F_EventScript_WomanNormal - compare VAR_MOSSDEEP_CITY_STATE, 2 - goto_if_eq MossdeepCity_SpaceCenter_1F_EventScript_WomanMagma - compare VAR_MOSSDEEP_CITY_STATE, 2 - goto_if_lt MossdeepCity_SpaceCenter_1F_EventScript_WomanNormal + goto_if_eq VAR_MOSSDEEP_CITY_STATE, 2, MossdeepCity_SpaceCenter_1F_EventScript_WomanMagma + goto_if_lt VAR_MOSSDEEP_CITY_STATE, 2, MossdeepCity_SpaceCenter_1F_EventScript_WomanNormal goto MossdeepCity_SpaceCenter_1F_EventScript_WomanMagma end @@ -184,10 +168,8 @@ MossdeepCity_SpaceCenter_1F_EventScript_OldMan:: lock faceplayer goto_if_set FLAG_SYS_GAME_CLEAR, MossdeepCity_SpaceCenter_1F_EventScript_OldManNormal - compare VAR_MOSSDEEP_CITY_STATE, 2 - goto_if_eq MossdeepCity_SpaceCenter_1F_EventScript_OldManMagma - compare VAR_MOSSDEEP_CITY_STATE, 2 - goto_if_lt MossdeepCity_SpaceCenter_1F_EventScript_OldManNormal + goto_if_eq VAR_MOSSDEEP_CITY_STATE, 2, MossdeepCity_SpaceCenter_1F_EventScript_OldManMagma + goto_if_lt VAR_MOSSDEEP_CITY_STATE, 2, MossdeepCity_SpaceCenter_1F_EventScript_OldManNormal goto MossdeepCity_SpaceCenter_1F_EventScript_OldManMagma end diff --git a/data/maps/MossdeepCity_SpaceCenter_2F/scripts.inc b/data/maps/MossdeepCity_SpaceCenter_2F/scripts.inc index 044979c123c3..4a22bf8eeaeb 100644 --- a/data/maps/MossdeepCity_SpaceCenter_2F/scripts.inc +++ b/data/maps/MossdeepCity_SpaceCenter_2F/scripts.inc @@ -15,10 +15,8 @@ MossdeepCity_SpaceCenter_2F_MapScripts:: .byte 0 MossdeepCity_SpaceCenter_2F_OnTransition: - compare VAR_MOSSDEEP_CITY_STATE, 2 - call_if_eq MossdeepCity_SpaceCenter_2F_EventScript_MoveCivilians - compare VAR_MOSSDEEP_SPACE_CENTER_STATE, 2 - call_if_eq MossdeepCity_SpaceCenter_2F_EventScript_MoveDefeatedGrunts + call_if_eq VAR_MOSSDEEP_CITY_STATE, 2, MossdeepCity_SpaceCenter_2F_EventScript_MoveCivilians + call_if_eq VAR_MOSSDEEP_SPACE_CENTER_STATE, 2, MossdeepCity_SpaceCenter_2F_EventScript_MoveDefeatedGrunts end MossdeepCity_SpaceCenter_2F_EventScript_MoveCivilians:: @@ -48,13 +46,12 @@ MossdeepCity_SpaceCenter_2F_EventScript_ThreeMagmaGrunts:: applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_Delay48 waitmovement 0 msgbox MossdeepCity_SpaceCenter_2F_Text_YoureOutnumberedTakeUsOn, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq MossdeepCity_SpaceCenter_2F_EventScript_BattleThreeMagmaGrunts + goto_if_eq VAR_RESULT, YES, MossdeepCity_SpaceCenter_2F_EventScript_BattleThreeMagmaGrunts msgbox MossdeepCity_SpaceCenter_2F_Text_GoodAnswer, MSGBOX_DEFAULT closemessage applymovement OBJ_EVENT_ID_PLAYER, MossdeepCity_SpaceCenter_2F_Movement_PlayerExit waitmovement 0 - warp MAP_MOSSDEEP_CITY_SPACE_CENTER_1F, 255, 13, 1 + warp MAP_MOSSDEEP_CITY_SPACE_CENTER_1F, 13, 1 waitstate releaseall end @@ -109,10 +106,8 @@ MossdeepCity_SpaceCenter_2F_EventScript_Scientist:: lock faceplayer goto_if_set FLAG_SYS_GAME_CLEAR, MossdeepCity_SpaceCenter_2F_EventScript_ScientistNormal - compare VAR_MOSSDEEP_CITY_STATE, 2 - goto_if_eq MossdeepCity_SpaceCenter_2F_EventScript_ScientistMagma - compare VAR_MOSSDEEP_CITY_STATE, 2 - goto_if_lt MossdeepCity_SpaceCenter_2F_EventScript_ScientistNormal + goto_if_eq VAR_MOSSDEEP_CITY_STATE, 2, MossdeepCity_SpaceCenter_2F_EventScript_ScientistMagma + goto_if_lt VAR_MOSSDEEP_CITY_STATE, 2, MossdeepCity_SpaceCenter_2F_EventScript_ScientistNormal goto MossdeepCity_SpaceCenter_2F_EventScript_ScientistMagma end @@ -130,10 +125,8 @@ MossdeepCity_SpaceCenter_2F_EventScript_Gentleman:: lock faceplayer goto_if_set FLAG_SYS_GAME_CLEAR, MossdeepCity_SpaceCenter_2F_EventScript_GentlemanNormal - compare VAR_MOSSDEEP_CITY_STATE, 2 - goto_if_eq MossdeepCity_SpaceCenter_2F_EventScript_GentlemanMagma - compare VAR_MOSSDEEP_CITY_STATE, 2 - goto_if_lt MossdeepCity_SpaceCenter_2F_EventScript_GentlemanNormal + goto_if_eq VAR_MOSSDEEP_CITY_STATE, 2, MossdeepCity_SpaceCenter_2F_EventScript_GentlemanMagma + goto_if_lt VAR_MOSSDEEP_CITY_STATE, 2, MossdeepCity_SpaceCenter_2F_EventScript_GentlemanNormal goto MossdeepCity_SpaceCenter_2F_EventScript_GentlemanMagma end @@ -151,10 +144,8 @@ MossdeepCity_SpaceCenter_2F_EventScript_RichBoy:: lock faceplayer goto_if_set FLAG_SYS_GAME_CLEAR, MossdeepCity_SpaceCenter_2F_EventScript_RichBoyNormal - compare VAR_MOSSDEEP_CITY_STATE, 2 - goto_if_eq MossdeepCity_SpaceCenter_2F_EventScript_RichBoyMagma - compare VAR_MOSSDEEP_CITY_STATE, 2 - goto_if_lt MossdeepCity_SpaceCenter_2F_EventScript_RichBoyNormal + goto_if_eq VAR_MOSSDEEP_CITY_STATE, 2, MossdeepCity_SpaceCenter_2F_EventScript_RichBoyMagma + goto_if_lt VAR_MOSSDEEP_CITY_STATE, 2, MossdeepCity_SpaceCenter_2F_EventScript_RichBoyNormal goto MossdeepCity_SpaceCenter_2F_EventScript_RichBoyMagma end @@ -246,8 +237,7 @@ MossdeepCity_SpaceCenter_2F_EventScript_ReadyForBattlePrompt:: applymovement VAR_LAST_TALKED, Common_Movement_FacePlayer waitmovement 0 msgbox MossdeepCity_SpaceCenter_2F_Text_StevenAreYouReadyToBattle, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq MossdeepCity_SpaceCenter_2F_EventScript_ChoosePartyForMultiBattle + goto_if_eq VAR_RESULT, YES, MossdeepCity_SpaceCenter_2F_EventScript_ChoosePartyForMultiBattle msgbox MossdeepCity_SpaceCenter_2F_Text_StevenHurryGetReadyQuickly, MSGBOX_DEFAULT closemessage applymovement VAR_LAST_TALKED, Common_Movement_WalkInPlaceFasterDown @@ -262,8 +252,7 @@ MossdeepCity_SpaceCenter_2F_EventScript_ChoosePartyForMultiBattle:: fadescreen FADE_TO_BLACK special ChooseHalfPartyForBattle waitstate - compare VAR_RESULT, 0 - goto_if_ne MossdeepCity_SpaceCenter_2F_EventScript_DoStevenMultiBattle + goto_if_ne VAR_RESULT, 0, MossdeepCity_SpaceCenter_2F_EventScript_DoStevenMultiBattle special LoadPlayerParty goto MossdeepCity_SpaceCenter_2F_EventScript_ReadyForBattlePrompt @@ -358,10 +347,8 @@ MossdeepCity_SpaceCenter_2F_EventScript_TabithaTrainer:: MossdeepCity_SpaceCenter_2F_EventScript_RivalRayquazaCall:: lockall checkplayergender - compare VAR_RESULT, MALE - call_if_eq MossdeepCity_SpaceCenter_2F_EventScript_MayRayquazaCall - compare VAR_RESULT, FEMALE - call_if_eq MossdeepCity_SpaceCenter_2F_EventScript_BrendanRayquazaCall + call_if_eq VAR_RESULT, MALE, MossdeepCity_SpaceCenter_2F_EventScript_MayRayquazaCall + call_if_eq VAR_RESULT, FEMALE, MossdeepCity_SpaceCenter_2F_EventScript_BrendanRayquazaCall closemessage clearflag FLAG_DEFEATED_MAGMA_SPACE_CENTER releaseall diff --git a/data/maps/MossdeepCity_StevensHouse/scripts.inc b/data/maps/MossdeepCity_StevensHouse/scripts.inc index 22b26f392701..aac12ec2affb 100644 --- a/data/maps/MossdeepCity_StevensHouse/scripts.inc +++ b/data/maps/MossdeepCity_StevensHouse/scripts.inc @@ -12,12 +12,11 @@ MossdeepCity_StevensHouse_OnLoad: end MossdeepCity_StevensHouse_EventScript_HideStevensNote:: - setmetatile 6, 4, METATILE_GenericBuilding_TableEdge, 1 + setmetatile 6, 4, METATILE_GenericBuilding_TableEdge, TRUE return MossdeepCity_StevensHouse_OnTransition: - compare VAR_STEVENS_HOUSE_STATE, 2 - call_if_eq MossdeepCity_StevensHouse_EventScript_SetStevenPos + call_if_eq VAR_STEVENS_HOUSE_STATE, 2, MossdeepCity_StevensHouse_EventScript_SetStevenPos end MossdeepCity_StevensHouse_EventScript_SetStevenPos:: @@ -76,8 +75,7 @@ MossdeepCity_StevensHouse_Movement_StevenReturn: MossdeepCity_StevensHouse_EventScript_BeldumPokeball:: lockall msgbox MossdeepCity_StevensHouse_Text_TakeBallContainingBeldum, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq MossdeepCity_StevensHouse_EventScript_LeaveBeldum + goto_if_eq VAR_RESULT, NO, MossdeepCity_StevensHouse_EventScript_LeaveBeldum goto MossdeepCity_StevensHouse_EventScript_GiveBeldum end @@ -89,18 +87,15 @@ MossdeepCity_StevensHouse_EventScript_LeaveBeldum:: MossdeepCity_StevensHouse_EventScript_GiveBeldum:: setvar VAR_TEMP_1, SPECIES_BELDUM givemon SPECIES_BELDUM, 5, ITEM_NONE - compare VAR_RESULT, 0 - goto_if_eq MossdeepCity_StevensHouse_EventScript_SendBeldumParty - compare VAR_RESULT, 1 - goto_if_eq MossdeepCity_StevensHouse_EventScript_SendBeldumPC + goto_if_eq VAR_RESULT, 0, MossdeepCity_StevensHouse_EventScript_SendBeldumParty + goto_if_eq VAR_RESULT, 1, MossdeepCity_StevensHouse_EventScript_SendBeldumPC goto Common_EventScript_NoMoreRoomForPokemon end MossdeepCity_StevensHouse_EventScript_SendBeldumParty:: call MossdeepCity_StevensHouse_EventScript_ReceivedBeldumFanfare msgbox gText_NicknameThisPokemon, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq MossdeepCity_StevensHouse_EventScript_ReceivedBeldum + goto_if_eq VAR_RESULT, NO, MossdeepCity_StevensHouse_EventScript_ReceivedBeldum call Common_EventScript_GetGiftMonPartySlot call Common_EventScript_NameReceivedPartyMon goto MossdeepCity_StevensHouse_EventScript_ReceivedBeldum @@ -109,8 +104,7 @@ MossdeepCity_StevensHouse_EventScript_SendBeldumParty:: MossdeepCity_StevensHouse_EventScript_SendBeldumPC:: call MossdeepCity_StevensHouse_EventScript_ReceivedBeldumFanfare msgbox gText_NicknameThisPokemon, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq MossdeepCity_StevensHouse_EventScript_BeldumTransferredToPC + goto_if_eq VAR_RESULT, NO, MossdeepCity_StevensHouse_EventScript_BeldumTransferredToPC call Common_EventScript_NameReceivedBoxMon goto MossdeepCity_StevensHouse_EventScript_BeldumTransferredToPC end @@ -121,13 +115,13 @@ MossdeepCity_StevensHouse_EventScript_BeldumTransferredToPC:: end MossdeepCity_StevensHouse_EventScript_ReceivedBeldumFanfare:: - bufferspeciesname 1, SPECIES_BELDUM + bufferspeciesname STR_VAR_2, SPECIES_BELDUM removeobject LOCALID_BELDUM_BALL playfanfare MUS_OBTAIN_ITEM message MossdeepCity_StevensHouse_Text_ObtainedBeldum waitmessage waitfanfare - bufferspeciesname 0, SPECIES_BELDUM + bufferspeciesname STR_VAR_1, SPECIES_BELDUM return MossdeepCity_StevensHouse_EventScript_ReceivedBeldum:: diff --git a/data/maps/MtChimney/scripts.inc b/data/maps/MtChimney/scripts.inc index 320e2dc19464..1931633258c0 100644 --- a/data/maps/MtChimney/scripts.inc +++ b/data/maps/MtChimney/scripts.inc @@ -63,18 +63,14 @@ MtChimney_EventScript_Maxie:: fadescreen FADE_FROM_BLACK setobjectxyperm LOCALID_ARCHIE, 10, 12 addobject LOCALID_ARCHIE - compare VAR_FACING, DIR_EAST - call_if_eq MtChimney_EventScript_ArchieApproachPlayerEast - compare VAR_FACING, DIR_NORTH - call_if_eq MtChimney_EventScript_ArchieApproachPlayerNorth + call_if_eq VAR_FACING, DIR_EAST, MtChimney_EventScript_ArchieApproachPlayerEast + call_if_eq VAR_FACING, DIR_NORTH, MtChimney_EventScript_ArchieApproachPlayerNorth applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFasterLeft waitmovement 0 msgbox MtChimney_Text_ArchieThankYou, MSGBOX_DEFAULT closemessage - compare VAR_FACING, DIR_EAST - call_if_eq MtChimney_EventScript_ArchieExitEast - compare VAR_FACING, DIR_NORTH - call_if_eq MtChimney_EventScript_ArchieExitNorth + call_if_eq VAR_FACING, DIR_EAST, MtChimney_EventScript_ArchieExitEast + call_if_eq VAR_FACING, DIR_NORTH, MtChimney_EventScript_ArchieExitNorth removeobject LOCALID_ARCHIE setflag FLAG_HIDE_MT_CHIMNEY_TEAM_AQUA setflag FLAG_DEFEATED_EVIL_TEAM_MT_CHIMNEY @@ -107,20 +103,16 @@ MtChimney_EventScript_ArchieExitNorth:: MtChimney_EventScript_LavaCookieLady:: lock faceplayer - showmoneybox 0, 0, 0 + showmoneybox 0, 0 msgbox MtChimney_Text_LavaCookiesJust200, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq MtChimney_EventScript_DeclineLavaCookie - checkmoney 200, 0 - compare VAR_RESULT, FALSE - goto_if_eq MtChimney_EventScript_NotEnoughMoney + goto_if_eq VAR_RESULT, NO, MtChimney_EventScript_DeclineLavaCookie + checkmoney 200 + goto_if_eq VAR_RESULT, FALSE, MtChimney_EventScript_NotEnoughMoney msgbox MtChimney_Text_ThankYouDear, MSGBOX_DEFAULT - checkitemspace ITEM_LAVA_COOKIE, 1 - compare VAR_RESULT, TRUE - call_if_eq MtChimney_EventScript_RemoveMoney + checkitemspace ITEM_LAVA_COOKIE + call_if_eq VAR_RESULT, TRUE, MtChimney_EventScript_RemoveMoney giveitem ITEM_LAVA_COOKIE - compare VAR_RESULT, FALSE - goto_if_eq MtChimney_EventScript_BagIsFull + goto_if_eq VAR_RESULT, FALSE, MtChimney_EventScript_BagIsFull hidemoneybox release end @@ -132,8 +124,8 @@ MtChimney_EventScript_BagIsFull:: end MtChimney_EventScript_RemoveMoney:: - removemoney 200, 0 - updatemoneybox 0, 0 + removemoney 200 + updatemoneybox return MtChimney_EventScript_DeclineLavaCookie:: @@ -453,8 +445,7 @@ MtChimney_EventScript_MeteoriteMachine:: goto_if_unset FLAG_DEFEATED_EVIL_TEAM_MT_CHIMNEY, MtChimney_EventScript_MachineOn goto_if_set FLAG_RECEIVED_METEORITE, MtChimney_EventScript_MachineOff msgbox MtChimney_Text_RemoveTheMeteorite, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq MtChimney_EventScript_LeaveMeteoriteAlone + goto_if_eq VAR_RESULT, NO, MtChimney_EventScript_LeaveMeteoriteAlone msgbox MtChimney_Text_PlayerRemovedMeteorite, MSGBOX_DEFAULT giveitem ITEM_METEORITE setflag FLAG_RECEIVED_METEORITE @@ -483,8 +474,7 @@ MtChimney_EventScript_RouteSign:: MtChimney_EventScript_Shelby:: trainerbattle_single TRAINER_SHELBY_1, MtChimney_Text_ShelbyIntro, MtChimney_Text_ShelbyDefeat, MtChimney_EventScript_DefeatedShelby specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq MtChimney_EventScript_RematchShelby + goto_if_eq VAR_RESULT, TRUE, MtChimney_EventScript_RematchShelby msgbox MtChimney_Text_ShelbyPostBattle, MSGBOX_DEFAULT release end @@ -525,8 +515,7 @@ MtChimney_EventScript_Grunt1:: MtChimney_EventScript_Sawyer:: trainerbattle_single TRAINER_SAWYER_1, MtChimney_Text_SawyerIntro, MtChimney_Text_SawyerDefeat, MtChimney_EventScript_SawyerDefeated specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq MtChimney_EventScript_SawyerRematch + goto_if_eq VAR_RESULT, TRUE, MtChimney_EventScript_SawyerRematch msgbox MtChimney_Text_SawyerPostBattle, MSGBOX_DEFAULT release end diff --git a/data/maps/MtChimney_CableCarStation/scripts.inc b/data/maps/MtChimney_CableCarStation/scripts.inc index a3a2b360e028..b3e36a496aee 100644 --- a/data/maps/MtChimney_CableCarStation/scripts.inc +++ b/data/maps/MtChimney_CableCarStation/scripts.inc @@ -6,8 +6,7 @@ MtChimney_CableCarStation_MapScripts:: .byte 0 MtChimney_CableCarStation_OnTransition: - compare VAR_CABLE_CAR_STATION_STATE, 1 - call_if_eq MtChimney_CableCarStation_EventScript_MoveAttendantAside + call_if_eq VAR_CABLE_CAR_STATION_STATE, 1, MtChimney_CableCarStation_EventScript_MoveAttendantAside end MtChimney_CableCarStation_EventScript_MoveAttendantAside:: @@ -34,10 +33,8 @@ MtChimney_CableCarStation_EventScript_Attendant:: lock faceplayer msgbox MtChimney_CableCarStation_Text_CableCarReadyGetOn, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq MtChimney_CableCarStation_EventScript_RideCableCar - compare VAR_RESULT, NO - goto_if_eq MtChimney_CableCarStation_EventScript_DeclineRide + goto_if_eq VAR_RESULT, YES, MtChimney_CableCarStation_EventScript_RideCableCar + goto_if_eq VAR_RESULT, NO, MtChimney_CableCarStation_EventScript_DeclineRide end MtChimney_CableCarStation_EventScript_RideCableCar:: diff --git a/data/maps/MtPyre_1F/scripts.inc b/data/maps/MtPyre_1F/scripts.inc index 1354b2ac1bce..f97149b050c8 100644 --- a/data/maps/MtPyre_1F/scripts.inc +++ b/data/maps/MtPyre_1F/scripts.inc @@ -7,8 +7,7 @@ MtPyre_1F_EventScript_CleanseTagWoman:: goto_if_set FLAG_RECEIVED_CLEANSE_TAG, MtPyre_1F_EventScript_ReceivedCleanseTag msgbox MtPyre_1F_Text_TakeThisForYourOwnGood, MSGBOX_DEFAULT giveitem ITEM_CLEANSE_TAG - compare VAR_RESULT, FALSE - goto_if_eq Common_EventScript_ShowBagIsFull + goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull setflag FLAG_RECEIVED_CLEANSE_TAG release end diff --git a/data/maps/MtPyre_2F/scripts.inc b/data/maps/MtPyre_2F/scripts.inc index 9fe7bf9d2f98..381d0345963f 100644 --- a/data/maps/MtPyre_2F/scripts.inc +++ b/data/maps/MtPyre_2F/scripts.inc @@ -6,7 +6,7 @@ MtPyre_2F_MapScripts:: MtPyre_2F_SetHoleWarp: setstepcallback STEP_CB_CRACKED_FLOOR - setholewarp MAP_MT_PYRE_1F, 255, 0, 0 + setholewarp MAP_MT_PYRE_1F end MtPyre_2F_EventScript_Woman:: diff --git a/data/maps/MtPyre_3F/scripts.inc b/data/maps/MtPyre_3F/scripts.inc index b91a589bc099..ff15f9939300 100644 --- a/data/maps/MtPyre_3F/scripts.inc +++ b/data/maps/MtPyre_3F/scripts.inc @@ -14,8 +14,7 @@ MtPyre_3F_EventScript_Kayla:: MtPyre_3F_EventScript_Gabrielle:: trainerbattle_single TRAINER_GABRIELLE_1, MtPyre_3F_Text_GabrielleIntro, MtPyre_3F_Text_GabrielleDefeat, MtPyre_3F_EventScript_RegisterGabrielle specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq MtPyre_3F_EventScript_RematchGabrielle + goto_if_eq VAR_RESULT, TRUE, MtPyre_3F_EventScript_RematchGabrielle msgbox MtPyre_3F_Text_GabriellePostBattle, MSGBOX_DEFAULT release end diff --git a/data/maps/MtPyre_6F/scripts.inc b/data/maps/MtPyre_6F/scripts.inc index 4b7df8e7cf61..4de3f6e8b12b 100644 --- a/data/maps/MtPyre_6F/scripts.inc +++ b/data/maps/MtPyre_6F/scripts.inc @@ -4,8 +4,7 @@ MtPyre_6F_MapScripts:: MtPyre_6F_EventScript_Valerie:: trainerbattle_single TRAINER_VALERIE_1, MtPyre_6F_Text_ValerieIntro, MtPyre_6F_Text_ValerieDefeat, MtPyre_6F_EventScript_RegisterValerie specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq MtPyre_6F_EventScript_RematchValerie + goto_if_eq VAR_RESULT, TRUE, MtPyre_6F_EventScript_RematchValerie msgbox MtPyre_6F_Text_ValeriePostBattle, MSGBOX_DEFAULT release end diff --git a/data/maps/MtPyre_Exterior/scripts.inc b/data/maps/MtPyre_Exterior/scripts.inc index 01279d645c87..83bced7359a6 100644 --- a/data/maps/MtPyre_Exterior/scripts.inc +++ b/data/maps/MtPyre_Exterior/scripts.inc @@ -8,8 +8,7 @@ MtPyre_Exterior_OnTransition: MtPyre_Exterior_EventScript_CheckEnterFromSummit:: getplayerxy VAR_TEMP_0, VAR_TEMP_1 - compare VAR_TEMP_1, 12 - goto_if_lt MtPyre_Exterior_EventScript_EnterFromSummit + goto_if_lt VAR_TEMP_1, 12, MtPyre_Exterior_EventScript_EnterFromSummit return MtPyre_Exterior_EventScript_EnterFromSummit:: diff --git a/data/maps/MtPyre_Summit/scripts.inc b/data/maps/MtPyre_Summit/scripts.inc index cd58627aff9c..3de60df3f2fb 100644 --- a/data/maps/MtPyre_Summit/scripts.inc +++ b/data/maps/MtPyre_Summit/scripts.inc @@ -11,8 +11,7 @@ MtPyre_Summit_MapScripts:: .byte 0 MtPyre_Summit_OnTransition: - compare VAR_MT_PYRE_STATE, 2 - call_if_eq MtPyre_Summit_EventScript_SetArchieMaxiePositions + call_if_eq VAR_MT_PYRE_STATE, 2, MtPyre_Summit_EventScript_SetArchieMaxiePositions end MtPyre_Summit_EventScript_SetArchieMaxiePositions:: @@ -45,12 +44,9 @@ MtPyre_Summit_EventScript_TeamAquaExits:: applymovement LOCALID_ARCHIE, Common_Movement_WalkInPlaceFasterDown waitmovement 0 delay 50 - compare VAR_0x8008, 0 - call_if_eq MtPyre_Summit_EventScript_ArchieFacePlayer0 - compare VAR_0x8008, 1 - call_if_eq MtPyre_Summit_EventScript_ArchieFacePlayer1 - compare VAR_0x8008, 2 - call_if_eq MtPyre_Summit_EventScript_ArchieFacePlayer2 + call_if_eq VAR_0x8008, 0, MtPyre_Summit_EventScript_ArchieFacePlayer0 + call_if_eq VAR_0x8008, 1, MtPyre_Summit_EventScript_ArchieFacePlayer1 + call_if_eq VAR_0x8008, 2, MtPyre_Summit_EventScript_ArchieFacePlayer2 msgbox MtPyre_Summit_Text_ArchieWeGotTheOrbLetsGo, MSGBOX_DEFAULT closemessage fadescreen FADE_TO_BLACK @@ -65,12 +61,9 @@ MtPyre_Summit_EventScript_TeamAquaExits:: fadescreen FADE_FROM_BLACK delay 20 setvar VAR_MT_PYRE_STATE, 1 - compare VAR_0x8008, 0 - call_if_eq MtPyre_Summit_EventScript_OldLadyApproachPlayer0 - compare VAR_0x8008, 1 - call_if_eq MtPyre_Summit_EventScript_OldLadyApproachPlayer1 - compare VAR_0x8008, 2 - call_if_eq MtPyre_Summit_EventScript_OldLadyApproachPlayer2 + call_if_eq VAR_0x8008, 0, MtPyre_Summit_EventScript_OldLadyApproachPlayer0 + call_if_eq VAR_0x8008, 1, MtPyre_Summit_EventScript_OldLadyApproachPlayer1 + call_if_eq VAR_0x8008, 2, MtPyre_Summit_EventScript_OldLadyApproachPlayer2 msgbox MtPyre_Summit_Text_BothOrbsTakenMagmaLeftThis, MSGBOX_DEFAULT giveitem ITEM_MAGMA_EMBLEM setflag FLAG_RECEIVED_RED_OR_BLUE_ORB @@ -142,19 +135,15 @@ MtPyre_Summit_EventScript_OldMan:: faceplayer goto_if_set FLAG_SOOTOPOLIS_ARCHIE_MAXIE_LEAVE, MtPyre_Summit_EventScript_OldManAfterRayquaza msgbox MtPyre_Summit_Text_WillYouHearOutMyTale, MSGBOX_YESNO - compare VAR_RESULT, YES - call_if_eq MtPyre_Summit_EventScript_OldManTale - compare VAR_RESULT, NO - call_if_eq MtPyre_Summit_EventScript_DeclineOldManTale + call_if_eq VAR_RESULT, YES, MtPyre_Summit_EventScript_OldManTale + call_if_eq VAR_RESULT, NO, MtPyre_Summit_EventScript_DeclineOldManTale release end MtPyre_Summit_EventScript_OldManAfterRayquaza:: msgbox MtPyre_Summit_Text_HearTheNewLegendOfHoenn, MSGBOX_YESNO - compare VAR_RESULT, YES - call_if_eq MtPyre_Summit_EventScript_OldManNewTale - compare VAR_RESULT, NO - call_if_eq MtPyre_Summit_EventScript_DeclineOldManTale + call_if_eq VAR_RESULT, YES, MtPyre_Summit_EventScript_OldManNewTale + call_if_eq VAR_RESULT, NO, MtPyre_Summit_EventScript_DeclineOldManTale release end @@ -174,8 +163,7 @@ MtPyre_Summit_EventScript_OldLady:: lock faceplayer goto_if_set FLAG_RETURNED_RED_OR_BLUE_ORB, MtPyre_Summit_EventScript_OldLadyAfterOrbsReturned - compare VAR_MT_PYRE_STATE, 3 - call_if_ge MtPyre_Summit_EventScript_OldLadyOrbsReturned + call_if_ge VAR_MT_PYRE_STATE, 3, MtPyre_Summit_EventScript_OldLadyOrbsReturned goto_if_set FLAG_KYOGRE_ESCAPED_SEAFLOOR_CAVERN, MtPyre_Summit_EventScript_OldLadyLegendariesAwake msgbox MtPyre_Summit_Text_OrbsHaveBeenTaken, MSGBOX_DEFAULT release @@ -219,32 +207,23 @@ MtPyre_Summit_EventScript_ArchieMaxieReturnOrbs:: applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFasterUp waitmovement 0 delay 60 - compare VAR_0x8008, 0 - call_if_eq MtPyre_Summit_EventScript_ArchieMaxieBeginExit0 - compare VAR_0x8008, 1 - call_if_eq MtPyre_Summit_EventScript_ArchieMaxieBeginExit1 - compare VAR_0x8008, 2 - call_if_eq MtPyre_Summit_EventScript_ArchieMaxieBeginExit2 + call_if_eq VAR_0x8008, 0, MtPyre_Summit_EventScript_ArchieMaxieBeginExit0 + call_if_eq VAR_0x8008, 1, MtPyre_Summit_EventScript_ArchieMaxieBeginExit1 + call_if_eq VAR_0x8008, 2, MtPyre_Summit_EventScript_ArchieMaxieBeginExit2 playse SE_PIN applymovement LOCALID_MAXIE, Common_Movement_ExclamationMark waitmovement 0 applymovement LOCALID_MAXIE, Common_Movement_Delay48 waitmovement 0 delay 30 - compare VAR_0x8008, 0 - call_if_eq MtPyre_Summit_EventScript_MaxieApproachPlayer0 - compare VAR_0x8008, 1 - call_if_eq MtPyre_Summit_EventScript_MaxieApproachPlayer1 - compare VAR_0x8008, 2 - call_if_eq MtPyre_Summit_EventScript_MaxieApproachPlayer2 + call_if_eq VAR_0x8008, 0, MtPyre_Summit_EventScript_MaxieApproachPlayer0 + call_if_eq VAR_0x8008, 1, MtPyre_Summit_EventScript_MaxieApproachPlayer1 + call_if_eq VAR_0x8008, 2, MtPyre_Summit_EventScript_MaxieApproachPlayer2 msgbox MtPyre_Summit_Text_MaxieSilence, MSGBOX_DEFAULT closemessage - compare VAR_0x8008, 0 - call_if_eq MtPyre_Summit_EventScript_MaxieApproachArchie0 - compare VAR_0x8008, 1 - call_if_eq MtPyre_Summit_EventScript_MaxieApproachArchie1 - compare VAR_0x8008, 2 - call_if_eq MtPyre_Summit_EventScript_MaxieApproachArchie2 + call_if_eq VAR_0x8008, 0, MtPyre_Summit_EventScript_MaxieApproachArchie0 + call_if_eq VAR_0x8008, 1, MtPyre_Summit_EventScript_MaxieApproachArchie1 + call_if_eq VAR_0x8008, 2, MtPyre_Summit_EventScript_MaxieApproachArchie2 delay 30 applymovement LOCALID_ARCHIE, MtPyre_Summit_Movement_ArchieExit applymovement LOCALID_MAXIE, MtPyre_Summit_Movement_MaxieExit diff --git a/data/maps/NavelRock_Bottom/scripts.inc b/data/maps/NavelRock_Bottom/scripts.inc index d79c00c687b7..f6687a36f5a6 100644 --- a/data/maps/NavelRock_Bottom/scripts.inc +++ b/data/maps/NavelRock_Bottom/scripts.inc @@ -25,8 +25,7 @@ NavelRock_Bottom_OnResume: NavelRock_Bottom_EventScript_TryRemoveLugia:: specialvar VAR_RESULT, GetBattleOutcome - compare VAR_RESULT, B_OUTCOME_CAUGHT - goto_if_ne Common_EventScript_NopReturn + goto_if_ne VAR_RESULT, B_OUTCOME_CAUGHT, Common_EventScript_NopReturn removeobject LOCALID_LUGIA return @@ -63,12 +62,9 @@ NavelRock_Bottom_EventScript_Lugia:: waitstate clearflag FLAG_SYS_CTRL_OBJ_DELETE specialvar VAR_RESULT, GetBattleOutcome - compare VAR_RESULT, B_OUTCOME_WON - goto_if_eq NavelRock_Bottom_EventScript_DefeatedLugia - compare VAR_RESULT, B_OUTCOME_RAN - goto_if_eq NavelRock_Bottom_EventScript_RanFromLugia - compare VAR_RESULT, B_OUTCOME_PLAYER_TELEPORTED - goto_if_eq NavelRock_Bottom_EventScript_RanFromLugia + goto_if_eq VAR_RESULT, B_OUTCOME_WON, NavelRock_Bottom_EventScript_DefeatedLugia + goto_if_eq VAR_RESULT, B_OUTCOME_RAN, NavelRock_Bottom_EventScript_RanFromLugia + goto_if_eq VAR_RESULT, B_OUTCOME_PLAYER_TELEPORTED, NavelRock_Bottom_EventScript_RanFromLugia setflag FLAG_CAUGHT_LUGIA release end diff --git a/data/maps/NavelRock_Harbor/scripts.inc b/data/maps/NavelRock_Harbor/scripts.inc index b12e62248f21..a981759175a3 100644 --- a/data/maps/NavelRock_Harbor/scripts.inc +++ b/data/maps/NavelRock_Harbor/scripts.inc @@ -8,8 +8,7 @@ NavelRock_Harbor_EventScript_Sailor:: lock faceplayer msgbox NavelRock_Harbor_Text_SailorReturn, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq NavelRock_Harbor_EventScript_AsYouLike + goto_if_eq VAR_RESULT, NO, NavelRock_Harbor_EventScript_AsYouLike msgbox EventTicket_Text_SailHome, MSGBOX_DEFAULT closemessage applymovement VAR_LAST_TALKED, Common_Movement_WalkInPlaceFasterDown @@ -18,7 +17,7 @@ NavelRock_Harbor_EventScript_Sailor:: hideobjectat LOCALID_SAILOR, MAP_NAVEL_ROCK_HARBOR setvar VAR_0x8004, LOCALID_SS_TIDAL call Common_EventScript_FerryDepartIsland - warp MAP_LILYCOVE_CITY_HARBOR, 255, 8, 11 + warp MAP_LILYCOVE_CITY_HARBOR, 8, 11 waitstate release end diff --git a/data/maps/NavelRock_Top/scripts.inc b/data/maps/NavelRock_Top/scripts.inc index e8b3e7e29694..2805f5677124 100644 --- a/data/maps/NavelRock_Top/scripts.inc +++ b/data/maps/NavelRock_Top/scripts.inc @@ -28,8 +28,7 @@ NavelRock_Top_OnResume: NavelRock_Top_EventScript_TryRemoveHoOh:: specialvar VAR_RESULT, GetBattleOutcome - compare VAR_RESULT, B_OUTCOME_CAUGHT - goto_if_ne Common_EventScript_NopReturn + goto_if_ne VAR_RESULT, B_OUTCOME_CAUGHT, Common_EventScript_NopReturn removeobject LOCALID_HO_OH return @@ -68,12 +67,9 @@ NavelRock_Top_EventScript_HoOh:: clearflag FLAG_SYS_CTRL_OBJ_DELETE setvar VAR_LAST_TALKED, LOCALID_HO_OH specialvar VAR_RESULT, GetBattleOutcome - compare VAR_RESULT, B_OUTCOME_WON - goto_if_eq NavelRock_Top_EventScript_DefeatedHoOh - compare VAR_RESULT, B_OUTCOME_RAN - goto_if_eq NavelRock_Top_EventScript_RanFromHoOh - compare VAR_RESULT, B_OUTCOME_PLAYER_TELEPORTED - goto_if_eq NavelRock_Top_EventScript_RanFromHoOh + goto_if_eq VAR_RESULT, B_OUTCOME_WON, NavelRock_Top_EventScript_DefeatedHoOh + goto_if_eq VAR_RESULT, B_OUTCOME_RAN, NavelRock_Top_EventScript_RanFromHoOh + goto_if_eq VAR_RESULT, B_OUTCOME_PLAYER_TELEPORTED, NavelRock_Top_EventScript_RanFromHoOh setflag FLAG_CAUGHT_HO_OH releaseall end diff --git a/data/maps/NewMauville_Entrance/scripts.inc b/data/maps/NewMauville_Entrance/scripts.inc index 0a98d4ba6252..4c498190e070 100644 --- a/data/maps/NewMauville_Entrance/scripts.inc +++ b/data/maps/NewMauville_Entrance/scripts.inc @@ -4,17 +4,16 @@ NewMauville_Entrance_MapScripts:: .byte 0 NewMauville_Entrance_OnLoad: - compare VAR_NEW_MAUVILLE_STATE, 0 - call_if_eq NewMauville_Entrance_EventScript_CloseDoor + call_if_eq VAR_NEW_MAUVILLE_STATE, 0, NewMauville_Entrance_EventScript_CloseDoor end NewMauville_Entrance_EventScript_CloseDoor:: - setmetatile 3, 0, METATILE_Facility_NewMauvilleDoor_Closed_Tile0, 1 - setmetatile 4, 0, METATILE_Facility_NewMauvilleDoor_Closed_Tile1, 1 - setmetatile 5, 0, METATILE_Facility_NewMauvilleDoor_Closed_Tile2, 1 - setmetatile 3, 1, METATILE_Facility_NewMauvilleDoor_Closed_Tile3, 1 - setmetatile 4, 1, METATILE_Facility_NewMauvilleDoor_Closed_Tile4, 1 - setmetatile 5, 1, METATILE_Facility_NewMauvilleDoor_Closed_Tile5, 1 + setmetatile 3, 0, METATILE_Facility_NewMauvilleDoor_Closed_Tile0, TRUE + setmetatile 4, 0, METATILE_Facility_NewMauvilleDoor_Closed_Tile1, TRUE + setmetatile 5, 0, METATILE_Facility_NewMauvilleDoor_Closed_Tile2, TRUE + setmetatile 3, 1, METATILE_Facility_NewMauvilleDoor_Closed_Tile3, TRUE + setmetatile 4, 1, METATILE_Facility_NewMauvilleDoor_Closed_Tile4, TRUE + setmetatile 5, 1, METATILE_Facility_NewMauvilleDoor_Closed_Tile5, TRUE return NewMauville_Entrance_OnTransition: @@ -26,19 +25,17 @@ NewMauville_Entrance_EventScript_Door:: applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFasterUp waitmovement 0 msgbox NewMauville_Entrance_Text_DoorIsLocked, MSGBOX_DEFAULT - checkitem ITEM_BASEMENT_KEY, 1 - compare VAR_RESULT, FALSE - goto_if_eq NewMauville_Entrance_EventScript_DontOpenDoor + checkitem ITEM_BASEMENT_KEY + goto_if_eq VAR_RESULT, FALSE, NewMauville_Entrance_EventScript_DontOpenDoor msgbox NewMauville_Entrance_Text_UseBasementKey, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq NewMauville_Entrance_EventScript_DontOpenDoor + goto_if_eq VAR_RESULT, NO, NewMauville_Entrance_EventScript_DontOpenDoor msgbox NewMauville_Entrance_Text_UsedBasementKey, MSGBOX_DEFAULT - setmetatile 3, 0, METATILE_Facility_NewMauvilleDoor_Open_Tile0, 0 - setmetatile 4, 0, METATILE_Facility_NewMauvilleDoor_Open_Tile1, 0 - setmetatile 5, 0, METATILE_Facility_NewMauvilleDoor_Open_Tile2, 0 - setmetatile 3, 1, METATILE_Facility_NewMauvilleDoor_Open_Tile3, 1 - setmetatile 4, 1, METATILE_Facility_NewMauvilleDoor_Open_Tile4, 0 - setmetatile 5, 1, METATILE_Facility_NewMauvilleDoor_Open_Tile5, 1 + setmetatile 3, 0, METATILE_Facility_NewMauvilleDoor_Open_Tile0, FALSE + setmetatile 4, 0, METATILE_Facility_NewMauvilleDoor_Open_Tile1, FALSE + setmetatile 5, 0, METATILE_Facility_NewMauvilleDoor_Open_Tile2, FALSE + setmetatile 3, 1, METATILE_Facility_NewMauvilleDoor_Open_Tile3, TRUE + setmetatile 4, 1, METATILE_Facility_NewMauvilleDoor_Open_Tile4, FALSE + setmetatile 5, 1, METATILE_Facility_NewMauvilleDoor_Open_Tile5, TRUE special DrawWholeMapView playse SE_BANG setvar VAR_NEW_MAUVILLE_STATE, 1 diff --git a/data/maps/NewMauville_Inside/scripts.inc b/data/maps/NewMauville_Inside/scripts.inc index d924651cef7a..51748380add7 100644 --- a/data/maps/NewMauville_Inside/scripts.inc +++ b/data/maps/NewMauville_Inside/scripts.inc @@ -5,17 +5,14 @@ NewMauville_Inside_MapScripts:: .byte 0 NewMauville_Inside_OnResume: - compare VAR_TEMP_1, 1 - call_if_eq NewMauville_Inside_EventScript_SetBarrierStateBlueButton - compare VAR_TEMP_2, 1 - call_if_eq NewMauville_Inside_EventScript_SetBarrierStateGreenButton + call_if_eq VAR_TEMP_1, 1, NewMauville_Inside_EventScript_SetBarrierStateBlueButton + call_if_eq VAR_TEMP_2, 1, NewMauville_Inside_EventScript_SetBarrierStateGreenButton call_if_set FLAG_SYS_CTRL_OBJ_DELETE, NewMauville_Inside_EventScript_TryRemoveVoltorb end NewMauville_Inside_EventScript_TryRemoveVoltorb:: specialvar VAR_RESULT, GetBattleOutcome - compare VAR_RESULT, B_OUTCOME_CAUGHT - goto_if_ne Common_EventScript_NopReturn + goto_if_ne VAR_RESULT, B_OUTCOME_CAUGHT, Common_EventScript_NopReturn removeobject VAR_LAST_TALKED return @@ -40,8 +37,7 @@ NewMauville_Inside_EventScript_ShowVoltorb3:: return NewMauville_Inside_OnLoad: - compare VAR_NEW_MAUVILLE_STATE, 2 - call_if_eq NewMauville_Inside_EventScript_SetGeneratorOffMetatiles + call_if_eq VAR_NEW_MAUVILLE_STATE, 2, NewMauville_Inside_EventScript_SetGeneratorOffMetatiles end NewMauville_Inside_EventScript_BlueButton:: @@ -65,83 +61,83 @@ NewMauville_Inside_EventScript_GreenButton:: end NewMauville_Inside_EventScript_SetBarrierStateBlueButton:: - setmetatile 23, 34, METATILE_BikeShop_Barrier_Hidden_Top, 1 - setmetatile 23, 35, METATILE_BikeShop_Barrier_Hidden_Bottom, 1 - setmetatile 23, 36, METATILE_BikeShop_Floor_Shadow_Top, 0 - setmetatile 23, 37, METATILE_BikeShop_Wall_Edge_Top, 0 - setmetatile 10, 16, METATILE_BikeShop_Barrier_Hidden_Top, 1 - setmetatile 10, 17, METATILE_BikeShop_Barrier_Hidden_Bottom, 1 - setmetatile 10, 18, METATILE_BikeShop_Floor_Shadow_Top, 0 - setmetatile 10, 19, METATILE_BikeShop_Wall_Edge_Top, 0 - setmetatile 10, 0, METATILE_BikeShop_Barrier_Hidden_Top, 1 - setmetatile 10, 1, METATILE_BikeShop_Barrier_Hidden_Bottom, 1 - setmetatile 10, 2, METATILE_BikeShop_Floor_Shadow_Top, 0 - setmetatile 10, 3, METATILE_BikeShop_Wall_Edge_Top, 0 - setmetatile 37, 33, METATILE_BikeShop_Barrier_Green_Top, 1 - setmetatile 37, 34, METATILE_BikeShop_Barrier_Green_TopMid, 1 - setmetatile 37, 35, METATILE_BikeShop_Barrier_Green_BottomMid, 1 - setmetatile 37, 36, METATILE_BikeShop_Barrier_Green_Bottom, 1 - setmetatile 28, 22, METATILE_BikeShop_Barrier_Green_Top, 1 - setmetatile 28, 23, METATILE_BikeShop_Barrier_Green_TopMid, 1 - setmetatile 28, 24, METATILE_BikeShop_Barrier_Green_BottomMid, 1 - setmetatile 28, 25, METATILE_BikeShop_Barrier_Green_Bottom, 1 - setmetatile 10, 24, METATILE_BikeShop_Barrier_Green_Top, 1 - setmetatile 10, 25, METATILE_BikeShop_Barrier_Green_TopMid, 1 - setmetatile 10, 26, METATILE_BikeShop_Barrier_Green_BottomMid, 1 - setmetatile 10, 27, METATILE_BikeShop_Barrier_Green_Bottom, 1 - setmetatile 21, 2, METATILE_BikeShop_Barrier_Green_Top, 1 - setmetatile 21, 3, METATILE_BikeShop_Barrier_Green_TopMid, 1 - setmetatile 21, 4, METATILE_BikeShop_Barrier_Green_BottomMid, 1 - setmetatile 21, 5, METATILE_BikeShop_Barrier_Green_Bottom, 1 - setmetatile 6, 11, METATILE_BikeShop_Button_Pressed, 0 - setmetatile 13, 10, METATILE_BikeShop_Button_Pressed, 0 - setmetatile 16, 22, METATILE_BikeShop_Button_Pressed, 0 - setmetatile 4, 26, METATILE_BikeShop_Button_Pressed, 0 - setmetatile 30, 38, METATILE_BikeShop_Button_Pressed, 0 - setmetatile 2, 11, METATILE_BikeShop_Button_Green, 0 - setmetatile 17, 10, METATILE_BikeShop_Button_Green, 0 - setmetatile 25, 18, METATILE_BikeShop_Button_Green, 0 - setmetatile 18, 36, METATILE_BikeShop_Button_Green, 0 + setmetatile 23, 34, METATILE_BikeShop_Barrier_Hidden_Top, TRUE + setmetatile 23, 35, METATILE_BikeShop_Barrier_Hidden_Bottom, TRUE + setmetatile 23, 36, METATILE_BikeShop_Floor_Shadow_Top, FALSE + setmetatile 23, 37, METATILE_BikeShop_Wall_Edge_Top, FALSE + setmetatile 10, 16, METATILE_BikeShop_Barrier_Hidden_Top, TRUE + setmetatile 10, 17, METATILE_BikeShop_Barrier_Hidden_Bottom, TRUE + setmetatile 10, 18, METATILE_BikeShop_Floor_Shadow_Top, FALSE + setmetatile 10, 19, METATILE_BikeShop_Wall_Edge_Top, FALSE + setmetatile 10, 0, METATILE_BikeShop_Barrier_Hidden_Top, TRUE + setmetatile 10, 1, METATILE_BikeShop_Barrier_Hidden_Bottom, TRUE + setmetatile 10, 2, METATILE_BikeShop_Floor_Shadow_Top, FALSE + setmetatile 10, 3, METATILE_BikeShop_Wall_Edge_Top, FALSE + setmetatile 37, 33, METATILE_BikeShop_Barrier_Green_Top, TRUE + setmetatile 37, 34, METATILE_BikeShop_Barrier_Green_TopMid, TRUE + setmetatile 37, 35, METATILE_BikeShop_Barrier_Green_BottomMid, TRUE + setmetatile 37, 36, METATILE_BikeShop_Barrier_Green_Bottom, TRUE + setmetatile 28, 22, METATILE_BikeShop_Barrier_Green_Top, TRUE + setmetatile 28, 23, METATILE_BikeShop_Barrier_Green_TopMid, TRUE + setmetatile 28, 24, METATILE_BikeShop_Barrier_Green_BottomMid, TRUE + setmetatile 28, 25, METATILE_BikeShop_Barrier_Green_Bottom, TRUE + setmetatile 10, 24, METATILE_BikeShop_Barrier_Green_Top, TRUE + setmetatile 10, 25, METATILE_BikeShop_Barrier_Green_TopMid, TRUE + setmetatile 10, 26, METATILE_BikeShop_Barrier_Green_BottomMid, TRUE + setmetatile 10, 27, METATILE_BikeShop_Barrier_Green_Bottom, TRUE + setmetatile 21, 2, METATILE_BikeShop_Barrier_Green_Top, TRUE + setmetatile 21, 3, METATILE_BikeShop_Barrier_Green_TopMid, TRUE + setmetatile 21, 4, METATILE_BikeShop_Barrier_Green_BottomMid, TRUE + setmetatile 21, 5, METATILE_BikeShop_Barrier_Green_Bottom, TRUE + setmetatile 6, 11, METATILE_BikeShop_Button_Pressed, FALSE + setmetatile 13, 10, METATILE_BikeShop_Button_Pressed, FALSE + setmetatile 16, 22, METATILE_BikeShop_Button_Pressed, FALSE + setmetatile 4, 26, METATILE_BikeShop_Button_Pressed, FALSE + setmetatile 30, 38, METATILE_BikeShop_Button_Pressed, FALSE + setmetatile 2, 11, METATILE_BikeShop_Button_Green, FALSE + setmetatile 17, 10, METATILE_BikeShop_Button_Green, FALSE + setmetatile 25, 18, METATILE_BikeShop_Button_Green, FALSE + setmetatile 18, 36, METATILE_BikeShop_Button_Green, FALSE return NewMauville_Inside_EventScript_SetBarrierStateGreenButton:: - setmetatile 23, 34, METATILE_BikeShop_Barrier_Blue_Top, 1 - setmetatile 23, 35, METATILE_BikeShop_Barrier_Blue_TopMid, 1 - setmetatile 23, 36, METATILE_BikeShop_Barrier_Blue_BottomMid, 1 - setmetatile 23, 37, METATILE_BikeShop_Barrier_Blue_Bottom, 1 - setmetatile 10, 16, METATILE_BikeShop_Barrier_Blue_Top, 1 - setmetatile 10, 17, METATILE_BikeShop_Barrier_Blue_TopMid, 1 - setmetatile 10, 18, METATILE_BikeShop_Barrier_Blue_BottomMid, 1 - setmetatile 10, 19, METATILE_BikeShop_Barrier_Blue_Bottom, 1 - setmetatile 10, 0, METATILE_BikeShop_Barrier_Blue_Top, 1 - setmetatile 10, 1, METATILE_BikeShop_Barrier_Blue_TopMid, 1 - setmetatile 10, 2, METATILE_BikeShop_Barrier_Blue_BottomMid, 1 - setmetatile 10, 3, METATILE_BikeShop_Barrier_Blue_Bottom, 1 - setmetatile 37, 33, METATILE_BikeShop_Barrier_Hidden_Top, 1 - setmetatile 37, 34, METATILE_BikeShop_Barrier_Hidden_Bottom, 1 - setmetatile 37, 35, METATILE_BikeShop_Floor_Shadow_Top, 0 - setmetatile 37, 36, METATILE_BikeShop_Wall_Edge_Top, 0 - setmetatile 28, 22, METATILE_BikeShop_Barrier_Hidden_Top, 1 - setmetatile 28, 23, METATILE_BikeShop_Barrier_Hidden_Bottom, 1 - setmetatile 28, 24, METATILE_BikeShop_Floor_Shadow_Top, 0 - setmetatile 28, 25, METATILE_BikeShop_Wall_Edge_Top, 0 - setmetatile 10, 24, METATILE_BikeShop_Barrier_Hidden_Top, 1 - setmetatile 10, 25, METATILE_BikeShop_Barrier_Hidden_Bottom, 1 - setmetatile 10, 26, METATILE_BikeShop_Floor_Shadow_Top, 0 - setmetatile 10, 27, METATILE_BikeShop_Wall_Edge_Top, 0 - setmetatile 21, 2, METATILE_BikeShop_Barrier_Hidden_Top, 1 - setmetatile 21, 3, METATILE_BikeShop_Barrier_Hidden_Bottom, 1 - setmetatile 21, 4, METATILE_BikeShop_Floor_Shadow_Top, 0 - setmetatile 21, 5, METATILE_BikeShop_Wall_Edge_Top, 0 - setmetatile 2, 11, METATILE_BikeShop_Button_Pressed, 0 - setmetatile 17, 10, METATILE_BikeShop_Button_Pressed, 0 - setmetatile 25, 18, METATILE_BikeShop_Button_Pressed, 0 - setmetatile 18, 36, METATILE_BikeShop_Button_Pressed, 0 - setmetatile 6, 11, METATILE_BikeShop_Button_Blue, 0 - setmetatile 13, 10, METATILE_BikeShop_Button_Blue, 0 - setmetatile 16, 22, METATILE_BikeShop_Button_Blue, 0 - setmetatile 4, 26, METATILE_BikeShop_Button_Blue, 0 - setmetatile 30, 38, METATILE_BikeShop_Button_Blue, 0 + setmetatile 23, 34, METATILE_BikeShop_Barrier_Blue_Top, TRUE + setmetatile 23, 35, METATILE_BikeShop_Barrier_Blue_TopMid, TRUE + setmetatile 23, 36, METATILE_BikeShop_Barrier_Blue_BottomMid, TRUE + setmetatile 23, 37, METATILE_BikeShop_Barrier_Blue_Bottom, TRUE + setmetatile 10, 16, METATILE_BikeShop_Barrier_Blue_Top, TRUE + setmetatile 10, 17, METATILE_BikeShop_Barrier_Blue_TopMid, TRUE + setmetatile 10, 18, METATILE_BikeShop_Barrier_Blue_BottomMid, TRUE + setmetatile 10, 19, METATILE_BikeShop_Barrier_Blue_Bottom, TRUE + setmetatile 10, 0, METATILE_BikeShop_Barrier_Blue_Top, TRUE + setmetatile 10, 1, METATILE_BikeShop_Barrier_Blue_TopMid, TRUE + setmetatile 10, 2, METATILE_BikeShop_Barrier_Blue_BottomMid, TRUE + setmetatile 10, 3, METATILE_BikeShop_Barrier_Blue_Bottom, TRUE + setmetatile 37, 33, METATILE_BikeShop_Barrier_Hidden_Top, TRUE + setmetatile 37, 34, METATILE_BikeShop_Barrier_Hidden_Bottom, TRUE + setmetatile 37, 35, METATILE_BikeShop_Floor_Shadow_Top, FALSE + setmetatile 37, 36, METATILE_BikeShop_Wall_Edge_Top, FALSE + setmetatile 28, 22, METATILE_BikeShop_Barrier_Hidden_Top, TRUE + setmetatile 28, 23, METATILE_BikeShop_Barrier_Hidden_Bottom, TRUE + setmetatile 28, 24, METATILE_BikeShop_Floor_Shadow_Top, FALSE + setmetatile 28, 25, METATILE_BikeShop_Wall_Edge_Top, FALSE + setmetatile 10, 24, METATILE_BikeShop_Barrier_Hidden_Top, TRUE + setmetatile 10, 25, METATILE_BikeShop_Barrier_Hidden_Bottom, TRUE + setmetatile 10, 26, METATILE_BikeShop_Floor_Shadow_Top, FALSE + setmetatile 10, 27, METATILE_BikeShop_Wall_Edge_Top, FALSE + setmetatile 21, 2, METATILE_BikeShop_Barrier_Hidden_Top, TRUE + setmetatile 21, 3, METATILE_BikeShop_Barrier_Hidden_Bottom, TRUE + setmetatile 21, 4, METATILE_BikeShop_Floor_Shadow_Top, FALSE + setmetatile 21, 5, METATILE_BikeShop_Wall_Edge_Top, FALSE + setmetatile 2, 11, METATILE_BikeShop_Button_Pressed, FALSE + setmetatile 17, 10, METATILE_BikeShop_Button_Pressed, FALSE + setmetatile 25, 18, METATILE_BikeShop_Button_Pressed, FALSE + setmetatile 18, 36, METATILE_BikeShop_Button_Pressed, FALSE + setmetatile 6, 11, METATILE_BikeShop_Button_Blue, FALSE + setmetatile 13, 10, METATILE_BikeShop_Button_Blue, FALSE + setmetatile 16, 22, METATILE_BikeShop_Button_Blue, FALSE + setmetatile 4, 26, METATILE_BikeShop_Button_Blue, FALSE + setmetatile 30, 38, METATILE_BikeShop_Button_Blue, FALSE return NewMauville_Inside_EventScript_RedButton:: @@ -153,22 +149,21 @@ NewMauville_Inside_EventScript_RedButton:: end NewMauville_Inside_EventScript_SetGeneratorOffMetatiles:: - setmetatile 33, 6, METATILE_BikeShop_Button_Pressed, 0 - setmetatile 32, 2, METATILE_BikeShop_Generator_Off_Tile0, 1 - setmetatile 33, 2, METATILE_BikeShop_Generator_Off_Tile1, 1 - setmetatile 34, 2, METATILE_BikeShop_Generator_Off_Tile2, 1 - setmetatile 35, 2, METATILE_BikeShop_Generator_Off_Tile3, 1 - setmetatile 32, 3, METATILE_BikeShop_Generator_Off_Tile4, 1 - setmetatile 33, 3, METATILE_BikeShop_Generator_Off_Tile5, 1 - setmetatile 34, 3, METATILE_BikeShop_Generator_Off_Tile6, 1 - setmetatile 35, 3, METATILE_BikeShop_Generator_Off_Tile7, 1 + setmetatile 33, 6, METATILE_BikeShop_Button_Pressed, FALSE + setmetatile 32, 2, METATILE_BikeShop_Generator_Off_Tile0, TRUE + setmetatile 33, 2, METATILE_BikeShop_Generator_Off_Tile1, TRUE + setmetatile 34, 2, METATILE_BikeShop_Generator_Off_Tile2, TRUE + setmetatile 35, 2, METATILE_BikeShop_Generator_Off_Tile3, TRUE + setmetatile 32, 3, METATILE_BikeShop_Generator_Off_Tile4, TRUE + setmetatile 33, 3, METATILE_BikeShop_Generator_Off_Tile5, TRUE + setmetatile 34, 3, METATILE_BikeShop_Generator_Off_Tile6, TRUE + setmetatile 35, 3, METATILE_BikeShop_Generator_Off_Tile7, TRUE special DrawWholeMapView return NewMauville_Inside_EventScript_Generator:: lockall - compare VAR_NEW_MAUVILLE_STATE, 2 - goto_if_eq NewMauville_Inside_EventScript_GeneratorOff + goto_if_eq VAR_NEW_MAUVILLE_STATE, 2, NewMauville_Inside_EventScript_GeneratorOff msgbox NewMauville_Inside_Text_GeneratorRadiatingHeat, MSGBOX_DEFAULT releaseall end @@ -190,12 +185,9 @@ NewMauville_Inside_EventScript_Voltorb1:: dowildbattle clearflag FLAG_SYS_CTRL_OBJ_DELETE specialvar VAR_RESULT, GetBattleOutcome - compare VAR_RESULT, B_OUTCOME_WON - goto_if_eq NewMauville_Inside_EventScript_DefeatedVoltorb1 - compare VAR_RESULT, B_OUTCOME_RAN - goto_if_eq NewMauville_Inside_EventScript_DefeatedVoltorb1 - compare VAR_RESULT, B_OUTCOME_PLAYER_TELEPORTED - goto_if_eq NewMauville_Inside_EventScript_DefeatedVoltorb1 + goto_if_eq VAR_RESULT, B_OUTCOME_WON, NewMauville_Inside_EventScript_DefeatedVoltorb1 + goto_if_eq VAR_RESULT, B_OUTCOME_RAN, NewMauville_Inside_EventScript_DefeatedVoltorb1 + goto_if_eq VAR_RESULT, B_OUTCOME_PLAYER_TELEPORTED, NewMauville_Inside_EventScript_DefeatedVoltorb1 setflag FLAG_DEFEATED_VOLTORB_1_NEW_MAUVILLE release end @@ -217,12 +209,9 @@ NewMauville_Inside_EventScript_Voltorb2:: dowildbattle clearflag FLAG_SYS_CTRL_OBJ_DELETE specialvar VAR_RESULT, GetBattleOutcome - compare VAR_RESULT, B_OUTCOME_WON - goto_if_eq NewMauville_Inside_EventScript_DefeatedVoltorb2 - compare VAR_RESULT, B_OUTCOME_RAN - goto_if_eq NewMauville_Inside_EventScript_DefeatedVoltorb2 - compare VAR_RESULT, B_OUTCOME_PLAYER_TELEPORTED - goto_if_eq NewMauville_Inside_EventScript_DefeatedVoltorb2 + goto_if_eq VAR_RESULT, B_OUTCOME_WON, NewMauville_Inside_EventScript_DefeatedVoltorb2 + goto_if_eq VAR_RESULT, B_OUTCOME_RAN, NewMauville_Inside_EventScript_DefeatedVoltorb2 + goto_if_eq VAR_RESULT, B_OUTCOME_PLAYER_TELEPORTED, NewMauville_Inside_EventScript_DefeatedVoltorb2 setflag FLAG_DEFEATED_VOLTORB_2_NEW_MAUVILLE release end @@ -244,12 +233,9 @@ NewMauville_Inside_EventScript_Voltorb3:: dowildbattle clearflag FLAG_SYS_CTRL_OBJ_DELETE specialvar VAR_RESULT, GetBattleOutcome - compare VAR_RESULT, B_OUTCOME_WON - goto_if_eq NewMauville_Inside_EventScript_DefeatedVoltorb3 - compare VAR_RESULT, B_OUTCOME_RAN - goto_if_eq NewMauville_Inside_EventScript_DefeatedVoltorb3 - compare VAR_RESULT, B_OUTCOME_PLAYER_TELEPORTED - goto_if_eq NewMauville_Inside_EventScript_DefeatedVoltorb3 + goto_if_eq VAR_RESULT, B_OUTCOME_WON, NewMauville_Inside_EventScript_DefeatedVoltorb3 + goto_if_eq VAR_RESULT, B_OUTCOME_RAN, NewMauville_Inside_EventScript_DefeatedVoltorb3 + goto_if_eq VAR_RESULT, B_OUTCOME_PLAYER_TELEPORTED, NewMauville_Inside_EventScript_DefeatedVoltorb3 setflag FLAG_DEFEATED_VOLTORB_3_NEW_MAUVILLE release end diff --git a/data/maps/OldaleTown/scripts.inc b/data/maps/OldaleTown/scripts.inc index 7d4ce4389e77..3f43386cb37e 100644 --- a/data/maps/OldaleTown/scripts.inc +++ b/data/maps/OldaleTown/scripts.inc @@ -76,8 +76,7 @@ OldaleTown_EventScript_GoToMartEast:: OldaleTown_EventScript_ExplainPokemonMart:: msgbox OldaleTown_Text_ThisIsAPokemonMart, MSGBOX_DEFAULT giveitem ITEM_POTION - compare VAR_RESULT, FALSE - goto_if_eq OldaleTown_EventScript_BagIsFull + goto_if_eq VAR_RESULT, FALSE, OldaleTown_EventScript_BagIsFull msgbox OldaleTown_Text_PotionExplanation, MSGBOX_DEFAULT setflag FLAG_RECEIVED_POTION_OLDALE fadedefaultbgm @@ -260,10 +259,8 @@ OldaleTown_EventScript_RivalTrigger3:: OldaleTown_EventScript_ShowRivalMessage:: checkplayergender - compare VAR_RESULT, MALE - goto_if_eq OldaleTown_EventScript_ShowMayMessage - compare VAR_RESULT, FEMALE - goto_if_eq OldaleTown_EventScript_ShowBrendanMessage + goto_if_eq VAR_RESULT, MALE, OldaleTown_EventScript_ShowMayMessage + goto_if_eq VAR_RESULT, FEMALE, OldaleTown_EventScript_ShowBrendanMessage end OldaleTown_EventScript_ShowMayMessage:: @@ -278,10 +275,8 @@ OldaleTown_EventScript_ShowBrendanMessage:: OldaleTown_EventScript_RivalFinish:: closemessage - compare VAR_0x8009, 0 - call_if_eq OldaleTown_EventScript_DoExitMovement1 - compare VAR_0x8009, 1 - call_if_eq OldaleTown_EventScript_DoExitMovement2 + call_if_eq VAR_0x8009, 0, OldaleTown_EventScript_DoExitMovement1 + call_if_eq VAR_0x8009, 1, OldaleTown_EventScript_DoExitMovement2 applymovement LOCALID_RIVAL, OldaleTown_Movement_RivalExit waitmovement 0 removeobject LOCALID_RIVAL @@ -291,8 +286,7 @@ OldaleTown_EventScript_RivalFinish:: end OldaleTown_EventScript_DoExitMovement1:: - compare VAR_FACING, DIR_SOUTH - goto_if_ne OldaleTown_EventScript_DoExitMovement2 + goto_if_ne VAR_FACING, DIR_SOUTH, OldaleTown_EventScript_DoExitMovement2 applymovement LOCALID_RIVAL, OldaleTown_Movement_RivalExit waitmovement 0 return diff --git a/data/maps/PacifidlogTown_House2/scripts.inc b/data/maps/PacifidlogTown_House2/scripts.inc index 27f966e961a3..3dedcec30f05 100644 --- a/data/maps/PacifidlogTown_House2/scripts.inc +++ b/data/maps/PacifidlogTown_House2/scripts.inc @@ -11,19 +11,16 @@ PacifidlogTown_House2_EventScript_FanClubYoungerBrother:: call_if_unset FLAG_MET_FANCLUB_YOUNGER_BROTHER, PacifidlogTown_House2_EventScript_FirstMonAssessment setflag FLAG_MET_FANCLUB_YOUNGER_BROTHER specialvar VAR_RESULT, GetLeadMonFriendshipScore - compare VAR_RESULT, 4 - goto_if_ge PacifidlogTown_House2_EventScript_GiveReturn + goto_if_ge VAR_RESULT, 4, PacifidlogTown_House2_EventScript_GiveReturn specialvar VAR_RESULT, GetLeadMonFriendshipScore - compare VAR_RESULT, 2 - goto_if_ge PacifidlogTown_House2_EventScript_PutInEffort + goto_if_ge VAR_RESULT, 2, PacifidlogTown_House2_EventScript_PutInEffort goto PacifidlogTown_House2_EventScript_GiveFrustration end PacifidlogTown_House2_EventScript_UpdateFanClubTMFlag:: goto_if_unset FLAG_RECEIVED_FANCLUB_TM_THIS_WEEK, Common_EventScript_NopReturn specialvar VAR_RESULT, GetDaysUntilPacifidlogTMAvailable - compare VAR_RESULT, 0 - call_if_eq PacifidlogTown_House2_EventScript_ClearReceivedFanClubTM + call_if_eq VAR_RESULT, 0, PacifidlogTown_House2_EventScript_ClearReceivedFanClubTM return PacifidlogTown_House2_EventScript_MonAssessment:: @@ -42,8 +39,7 @@ PacifidlogTown_House2_EventScript_ClearReceivedFanClubTM:: PacifidlogTown_House2_EventScript_GiveReturn:: msgbox PacifidlogTown_House2_Text_AdoringPokemonTakeThis, MSGBOX_DEFAULT giveitem ITEM_TM27 - compare VAR_RESULT, FALSE - goto_if_eq Common_EventScript_ShowBagIsFull + goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull setflag FLAG_RECEIVED_FANCLUB_TM_THIS_WEEK special SetPacifidlogTMReceivedDay msgbox PacifidlogTown_House2_Text_ExplainReturnFrustration, MSGBOX_DEFAULT @@ -58,8 +54,7 @@ PacifidlogTown_House2_EventScript_PutInEffort:: PacifidlogTown_House2_EventScript_GiveFrustration:: msgbox PacifidlogTown_House2_Text_ViciousPokemonTakeThis, MSGBOX_DEFAULT giveitem ITEM_TM21 - compare VAR_RESULT, FALSE - goto_if_eq Common_EventScript_ShowBagIsFull + goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull setflag FLAG_RECEIVED_FANCLUB_TM_THIS_WEEK special SetPacifidlogTMReceivedDay msgbox PacifidlogTown_House2_Text_ExplainReturnFrustration, MSGBOX_DEFAULT @@ -68,7 +63,7 @@ PacifidlogTown_House2_EventScript_GiveFrustration:: PacifidlogTown_House2_EventScript_ComeBackInXDays:: specialvar VAR_RESULT, GetDaysUntilPacifidlogTMAvailable - buffernumberstring 0, VAR_RESULT + buffernumberstring STR_VAR_1, VAR_RESULT msgbox PacifidlogTown_House2_Text_GetGoodTMInXDays, MSGBOX_DEFAULT release end diff --git a/data/maps/PacifidlogTown_House3/scripts.inc b/data/maps/PacifidlogTown_House3/scripts.inc index c53ef051968c..5582f3b6b9c1 100644 --- a/data/maps/PacifidlogTown_House3/scripts.inc +++ b/data/maps/PacifidlogTown_House3/scripts.inc @@ -10,24 +10,21 @@ PacifidlogTown_House3_EventScript_Trader:: specialvar VAR_RESULT, GetInGameTradeSpeciesInfo copyvar VAR_0x8009, VAR_RESULT msgbox PacifidlogTown_House3_Text_WillingToTradeIt, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq PacifidlogTown_House3_EventScript_DeclineTrade + goto_if_eq VAR_RESULT, NO, PacifidlogTown_House3_EventScript_DeclineTrade special ChoosePartyMon waitstate copyvar VAR_0x800A, VAR_0x8004 - compare VAR_0x8004, 255 - goto_if_eq PacifidlogTown_House3_EventScript_DeclineTrade + goto_if_eq VAR_0x8004, PARTY_NOTHING_CHOSEN, PacifidlogTown_House3_EventScript_DeclineTrade copyvar VAR_0x8005, VAR_0x800A specialvar VAR_RESULT, GetTradeSpecies copyvar VAR_0x800B, VAR_RESULT - compare VAR_RESULT, VAR_0x8009 - goto_if_ne PacifidlogTown_House3_EventScript_NotRequestedMon + goto_if_ne VAR_RESULT, VAR_0x8009, PacifidlogTown_House3_EventScript_NotRequestedMon copyvar VAR_0x8004, VAR_0x8008 copyvar VAR_0x8005, VAR_0x800A special CreateInGameTradePokemon special DoInGameTradeScene waitstate - bufferspeciesname 0, VAR_0x8009 + bufferspeciesname STR_VAR_1, VAR_0x8009 msgbox PacifidlogTown_House3_Text_ItsSubtlyDifferentThankYou, MSGBOX_DEFAULT setflag FLAG_PACIFIDLOG_NPC_TRADE_COMPLETED release @@ -39,7 +36,7 @@ PacifidlogTown_House3_EventScript_DeclineTrade:: end PacifidlogTown_House3_EventScript_NotRequestedMon:: - bufferspeciesname 0, VAR_0x8009 + bufferspeciesname STR_VAR_1, VAR_0x8009 msgbox PacifidlogTown_House3_Text_WontAcceptAnyLessThanRealMon, MSGBOX_DEFAULT release end diff --git a/data/maps/PacifidlogTown_House4/scripts.inc b/data/maps/PacifidlogTown_House4/scripts.inc index 12d7197bd120..f17abcd30e4b 100644 --- a/data/maps/PacifidlogTown_House4/scripts.inc +++ b/data/maps/PacifidlogTown_House4/scripts.inc @@ -13,10 +13,8 @@ PacifidlogTown_House4_EventScript_Boy:: lock faceplayer msgbox PacifidlogTown_House4_Text_WhereDidYouComeFrom, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq PacifidlogTown_House4_EventScript_Yes - compare VAR_RESULT, NO - goto_if_eq PacifidlogTown_House4_EventScript_No + goto_if_eq VAR_RESULT, YES, PacifidlogTown_House4_EventScript_Yes + goto_if_eq VAR_RESULT, NO, PacifidlogTown_House4_EventScript_No end PacifidlogTown_House4_EventScript_Yes:: diff --git a/data/maps/PacifidlogTown_House5/scripts.inc b/data/maps/PacifidlogTown_House5/scripts.inc index 5da4fb9022c0..474a2663ecf5 100644 --- a/data/maps/PacifidlogTown_House5/scripts.inc +++ b/data/maps/PacifidlogTown_House5/scripts.inc @@ -5,8 +5,7 @@ PacifidlogTown_House5_EventScript_MirageIslandWatcher:: lock faceplayer specialvar VAR_RESULT, IsMirageIslandPresent - compare VAR_RESULT, TRUE - goto_if_eq PacifidlogTown_House5_EventScript_MirageIslandPresent + goto_if_eq VAR_RESULT, TRUE, PacifidlogTown_House5_EventScript_MirageIslandPresent msgbox PacifidlogTown_House5_Text_CantSeeMirageIslandToday, MSGBOX_DEFAULT release end diff --git a/data/maps/PetalburgCity/scripts.inc b/data/maps/PetalburgCity/scripts.inc index a77939c4de13..3609b26226f2 100644 --- a/data/maps/PetalburgCity/scripts.inc +++ b/data/maps/PetalburgCity/scripts.inc @@ -11,14 +11,10 @@ PetalburgCity_MapScripts:: PetalburgCity_OnTransition: setflag FLAG_VISITED_PETALBURG_CITY - compare VAR_PETALBURG_CITY_STATE, 0 - call_if_eq PetalburgCity_EventScript_MoveGymBoyToWestEntrance - compare VAR_PETALBURG_CITY_STATE, 2 - call_if_eq PetalburgCity_EventScript_DisableMapNameAndMusic - compare VAR_PETALBURG_CITY_STATE, 4 - call_if_eq PetalburgCity_EventScript_DisableMapNameAndMusic - compare VAR_PETALBURG_GYM_STATE, 8 - call_if_eq PetalburgCity_EventScript_SetGymDoorsUnlocked + call_if_eq VAR_PETALBURG_CITY_STATE, 0, PetalburgCity_EventScript_MoveGymBoyToWestEntrance + call_if_eq VAR_PETALBURG_CITY_STATE, 2, PetalburgCity_EventScript_DisableMapNameAndMusic + call_if_eq VAR_PETALBURG_CITY_STATE, 4, PetalburgCity_EventScript_DisableMapNameAndMusic + call_if_eq VAR_PETALBURG_GYM_STATE, 8, PetalburgCity_EventScript_SetGymDoorsUnlocked end PetalburgCity_EventScript_MoveGymBoyToWestEntrance:: @@ -60,7 +56,7 @@ PetalburgCity_EventScript_WallyTutorial:: clearflag FLAG_DONT_TRANSITION_MUSIC special LoadPlayerParty setvar VAR_PETALBURG_GYM_STATE, 1 - warp MAP_PETALBURG_CITY_GYM, 255, 4, 108 + warp MAP_PETALBURG_CITY_GYM, 4, 108 waitstate releaseall end @@ -85,7 +81,7 @@ PetalburgCity_EventScript_WalkToWallyHouse:: clearflag FLAG_HIDE_MAP_NAME_POPUP fadedefaultbgm clearflag FLAG_DONT_TRANSITION_MUSIC - warp MAP_PETALBURG_CITY_WALLYS_HOUSE, 255, 2, 4 + warp MAP_PETALBURG_CITY_WALLYS_HOUSE, 2, 4 waitstate releaseall end @@ -277,24 +273,16 @@ PetalburgCity_EventScript_ShowGymToPlayer:: waitmovement 0 applymovement LOCALID_GYM_BOY, Common_Movement_Delay48 waitmovement 0 - compare VAR_0x8008, 0 - call_if_eq PetalburgCity_EventScript_BoyApproachPlayer0 - compare VAR_0x8008, 1 - call_if_eq PetalburgCity_EventScript_BoyApproachPlayer1 - compare VAR_0x8008, 2 - call_if_eq PetalburgCity_EventScript_BoyApproachPlayer2 - compare VAR_0x8008, 3 - call_if_eq PetalburgCity_EventScript_BoyApproachPlayer3 + call_if_eq VAR_0x8008, 0, PetalburgCity_EventScript_BoyApproachPlayer0 + call_if_eq VAR_0x8008, 1, PetalburgCity_EventScript_BoyApproachPlayer1 + call_if_eq VAR_0x8008, 2, PetalburgCity_EventScript_BoyApproachPlayer2 + call_if_eq VAR_0x8008, 3, PetalburgCity_EventScript_BoyApproachPlayer3 msgbox PetalburgCity_Text_AreYouRookieTrainer, MSGBOX_DEFAULT closemessage - compare VAR_0x8008, 0 - call_if_eq PetalburgCity_EventScript_LeadPlayerToGym0 - compare VAR_0x8008, 1 - call_if_eq PetalburgCity_EventScript_LeadPlayerToGym1 - compare VAR_0x8008, 2 - call_if_eq PetalburgCity_EventScript_LeadPlayerToGym2 - compare VAR_0x8008, 3 - call_if_eq PetalburgCity_EventScript_LeadPlayerToGym3 + call_if_eq VAR_0x8008, 0, PetalburgCity_EventScript_LeadPlayerToGym0 + call_if_eq VAR_0x8008, 1, PetalburgCity_EventScript_LeadPlayerToGym1 + call_if_eq VAR_0x8008, 2, PetalburgCity_EventScript_LeadPlayerToGym2 + call_if_eq VAR_0x8008, 3, PetalburgCity_EventScript_LeadPlayerToGym3 msgbox PetalburgCity_Text_ThisIsPetalburgGym, MSGBOX_DEFAULT applymovement LOCALID_GYM_BOY, Common_Movement_WalkInPlaceFasterRight applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFasterRight @@ -571,14 +559,10 @@ PetalburgCity_EventScript_Scott:: delay 30 msgbox PetalburgCity_Text_ImLookingForTalentedTrainers, MSGBOX_DEFAULT closemessage - compare VAR_0x8008, 0 - call_if_eq PetalburgCity_EventScript_ScottExit0 - compare VAR_0x8008, 1 - call_if_eq PetalburgCity_EventScript_ScottExit1 - compare VAR_0x8008, 2 - call_if_eq PetalburgCity_EventScript_ScottExit2 - compare VAR_0x8008, 3 - call_if_eq PetalburgCity_EventScript_ScottExit3 + call_if_eq VAR_0x8008, 0, PetalburgCity_EventScript_ScottExit0 + call_if_eq VAR_0x8008, 1, PetalburgCity_EventScript_ScottExit1 + call_if_eq VAR_0x8008, 2, PetalburgCity_EventScript_ScottExit2 + call_if_eq VAR_0x8008, 3, PetalburgCity_EventScript_ScottExit3 setvar VAR_SCOTT_PETALBURG_ENCOUNTER, 1 removeobject LOCALID_SCOTT releaseall diff --git a/data/maps/PetalburgCity_Gym/scripts.inc b/data/maps/PetalburgCity_Gym/scripts.inc index cae696a50a39..836da26bfb19 100644 --- a/data/maps/PetalburgCity_Gym/scripts.inc +++ b/data/maps/PetalburgCity_Gym/scripts.inc @@ -10,10 +10,8 @@ PetalburgCity_Gym_MapScripts:: .byte 0 PetalburgCity_Gym_OnLoad: - compare VAR_PETALBURG_GYM_STATE, 6 - goto_if_eq PetalburgCity_Gym_EventScript_OpenUnlockedDoors - compare VAR_PETALBURG_GYM_STATE, 7 - call_if_ge PetalburgCity_Gym_EventScript_UnlockAllDoors + goto_if_eq VAR_PETALBURG_GYM_STATE, 6, PetalburgCity_Gym_EventScript_OpenUnlockedDoors + call_if_ge VAR_PETALBURG_GYM_STATE, 7, PetalburgCity_Gym_EventScript_UnlockAllDoors end @ NOTE: Strength and OHKO rooms are misleading. Both are more accurately Critical-Hit @@ -42,10 +40,8 @@ PetalburgCity_Gym_EventScript_UnlockAllDoors:: return PetalburgCity_Gym_OnTransition: - compare VAR_PETALBURG_GYM_STATE, 1 - call_if_eq PetalburgCity_Gym_EventScript_MoveWallyToEntrance - compare VAR_PETALBURG_GYM_STATE, 6 - call_if_lt PetalburgCity_Gym_EventScript_MoveNormanToEntrance + call_if_eq VAR_PETALBURG_GYM_STATE, 1, PetalburgCity_Gym_EventScript_MoveWallyToEntrance + call_if_lt VAR_PETALBURG_GYM_STATE, 6, PetalburgCity_Gym_EventScript_MoveNormanToEntrance call_if_set FLAG_SYS_GAME_CLEAR, PetalburgCity_Gym_EventScript_CheckNormanForRematch end @@ -60,10 +56,8 @@ PetalburgCity_Gym_EventScript_MoveNormanToEntrance:: PetalburgCity_Gym_EventScript_CheckNormanForRematch:: setorcopyvar VAR_TRAINER_BATTLE_OPPONENT_A, TRAINER_NORMAN_1 specialvar VAR_RESULT, IsTrainerReadyForRematch - compare VAR_RESULT, TRUE - goto_if_eq PetalburgCity_Gym_EventScript_DontMoveNormanToFront - compare VAR_PETALBURG_GYM_STATE, 8 - goto_if_eq PetalburgCity_Gym_EventScript_DontMoveNormanToFront + goto_if_eq VAR_RESULT, TRUE, PetalburgCity_Gym_EventScript_DontMoveNormanToFront + goto_if_eq VAR_PETALBURG_GYM_STATE, 8, PetalburgCity_Gym_EventScript_DontMoveNormanToFront setobjectxyperm LOCALID_NORMAN, 4, 107 return @@ -152,66 +146,42 @@ PetalburgCity_Gym_EventScript_BeginWallyTutorialEast:: PetalburgCity_Gym_EventScript_BeginWallyTutorial:: addobject LOCALID_WALLY playse SE_DOOR - compare VAR_0x8008, 0 - call_if_eq PetalburgCity_Gym_EventScript_WallyArriveSouth - compare VAR_0x8008, 1 - call_if_eq PetalburgCity_Gym_EventScript_WallyArriveNorth - compare VAR_0x8008, 2 - call_if_eq PetalburgCity_Gym_EventScript_WallyArriveWestEast - compare VAR_0x8008, 3 - call_if_eq PetalburgCity_Gym_EventScript_WallyArriveWestEast + call_if_eq VAR_0x8008, 0, PetalburgCity_Gym_EventScript_WallyArriveSouth + call_if_eq VAR_0x8008, 1, PetalburgCity_Gym_EventScript_WallyArriveNorth + call_if_eq VAR_0x8008, 2, PetalburgCity_Gym_EventScript_WallyArriveWestEast + call_if_eq VAR_0x8008, 3, PetalburgCity_Gym_EventScript_WallyArriveWestEast msgbox PetalburgCity_Gym_Text_WallyIdLikeAPokemon, MSGBOX_DEFAULT msgbox PetalburgCity_Gym_Text_DadOhYoureWallyRight, MSGBOX_DEFAULT msgbox PetalburgCity_Gym_Text_WallyIveNeverCaughtAPokemon, MSGBOX_DEFAULT msgbox PetalburgCity_Gym_Text_DadHmISee, MSGBOX_DEFAULT - compare VAR_0x8008, 0 - call_if_eq PetalburgCity_Gym_EventScript_NormanAddressPlayerSouth - compare VAR_0x8008, 1 - call_if_eq PetalburgCity_Gym_EventScript_NormanAddressPlayerNorth - compare VAR_0x8008, 2 - call_if_eq PetalburgCity_Gym_EventScript_NormanAddressPlayerWest - compare VAR_0x8008, 3 - call_if_eq PetalburgCity_Gym_EventScript_NormanAddressPlayerEast + call_if_eq VAR_0x8008, 0, PetalburgCity_Gym_EventScript_NormanAddressPlayerSouth + call_if_eq VAR_0x8008, 1, PetalburgCity_Gym_EventScript_NormanAddressPlayerNorth + call_if_eq VAR_0x8008, 2, PetalburgCity_Gym_EventScript_NormanAddressPlayerWest + call_if_eq VAR_0x8008, 3, PetalburgCity_Gym_EventScript_NormanAddressPlayerEast msgbox PetalburgCity_Gym_Text_DadPlayerGoWithWally, MSGBOX_DEFAULT - compare VAR_0x8008, 0 - call_if_eq PetalburgCity_Gym_EventScript_NormanAddressWallySouth - compare VAR_0x8008, 1 - call_if_eq PetalburgCity_Gym_EventScript_NormanAddressWallyNorth - compare VAR_0x8008, 2 - call_if_eq PetalburgCity_Gym_EventScript_NormanAddressWallyWest - compare VAR_0x8008, 3 - call_if_eq PetalburgCity_Gym_EventScript_NormanAddressWallyEast + call_if_eq VAR_0x8008, 0, PetalburgCity_Gym_EventScript_NormanAddressWallySouth + call_if_eq VAR_0x8008, 1, PetalburgCity_Gym_EventScript_NormanAddressWallyNorth + call_if_eq VAR_0x8008, 2, PetalburgCity_Gym_EventScript_NormanAddressWallyWest + call_if_eq VAR_0x8008, 3, PetalburgCity_Gym_EventScript_NormanAddressWallyEast msgbox PetalburgCity_Gym_Text_IllLoanYouMyZigzagoon, MSGBOX_DEFAULT msgbox PetalburgCity_Gym_Text_WallyThankYouAndDadGivesPokeBall, MSGBOX_DEFAULT msgbox PetalburgCity_Gym_Text_WallyOhWowThankYou, MSGBOX_DEFAULT - compare VAR_0x8008, 0 - call_if_eq PetalburgCity_Gym_EventScript_NormanFaceDoorSouth - compare VAR_0x8008, 1 - call_if_eq PetalburgCity_Gym_EventScript_NormanFaceDoorNorth - compare VAR_0x8008, 2 - call_if_eq PetalburgCity_Gym_EventScript_NormanFaceDoorWest - compare VAR_0x8008, 3 - call_if_eq PetalburgCity_Gym_EventScript_NormanFaceDoorEast - compare VAR_0x8008, 0 - call_if_eq PetalburgCity_Gym_EventScript_WallyFacePlayer - compare VAR_0x8008, 1 - call_if_eq PetalburgCity_Gym_EventScript_WallyFaceDown - compare VAR_0x8008, 2 - call_if_eq PetalburgCity_Gym_EventScript_WallyFacePlayer - compare VAR_0x8008, 3 - call_if_eq PetalburgCity_Gym_EventScript_WallyFacePlayer + call_if_eq VAR_0x8008, 0, PetalburgCity_Gym_EventScript_NormanFaceDoorSouth + call_if_eq VAR_0x8008, 1, PetalburgCity_Gym_EventScript_NormanFaceDoorNorth + call_if_eq VAR_0x8008, 2, PetalburgCity_Gym_EventScript_NormanFaceDoorWest + call_if_eq VAR_0x8008, 3, PetalburgCity_Gym_EventScript_NormanFaceDoorEast + call_if_eq VAR_0x8008, 0, PetalburgCity_Gym_EventScript_WallyFacePlayer + call_if_eq VAR_0x8008, 1, PetalburgCity_Gym_EventScript_WallyFaceDown + call_if_eq VAR_0x8008, 2, PetalburgCity_Gym_EventScript_WallyFacePlayer + call_if_eq VAR_0x8008, 3, PetalburgCity_Gym_EventScript_WallyFacePlayer msgbox PetalburgCity_Gym_Text_WouldYouReallyComeWithMe, MSGBOX_DEFAULT closemessage setflag FLAG_DONT_TRANSITION_MUSIC playbgm MUS_FOLLOW_ME, FALSE - compare VAR_0x8008, 0 - call_if_eq PetalburgCity_Gym_EventScript_ExitGymWithWallySouth - compare VAR_0x8008, 1 - call_if_eq PetalburgCity_Gym_EventScript_ExitGymWithWallyNorth - compare VAR_0x8008, 2 - call_if_eq PetalburgCity_Gym_EventScript_ExitGymWithWallyWest - compare VAR_0x8008, 3 - call_if_eq PetalburgCity_Gym_EventScript_ExitGymWithWallyEast + call_if_eq VAR_0x8008, 0, PetalburgCity_Gym_EventScript_ExitGymWithWallySouth + call_if_eq VAR_0x8008, 1, PetalburgCity_Gym_EventScript_ExitGymWithWallyNorth + call_if_eq VAR_0x8008, 2, PetalburgCity_Gym_EventScript_ExitGymWithWallyWest + call_if_eq VAR_0x8008, 3, PetalburgCity_Gym_EventScript_ExitGymWithWallyEast removeobject LOCALID_WALLY setflag FLAG_HIDE_PETALBURG_CITY_WALLYS_MOM setvar VAR_PETALBURG_GYM_STATE, 1 @@ -220,7 +190,7 @@ PetalburgCity_Gym_EventScript_BeginWallyTutorial:: clearflag FLAG_HIDE_PETALBURG_GYM_WALLY setflag FLAG_HIDE_LITTLEROOT_TOWN_BIRCHS_LAB_RIVAL special InitBirchState - warp MAP_PETALBURG_CITY, 255, 15, 8 + warp MAP_PETALBURG_CITY, 15, 8 waitstate release end @@ -361,8 +331,7 @@ PetalburgCity_Gym_EventScript_NormanFaceDoorEast:: PetalburgCity_Gym_EventScript_NormanPostBattle:: call PetalburgCity_Gym_EventScript_ShouldGiveEnigmaBerry - compare VAR_RESULT, TRUE - goto_if_eq PetalburgCity_Gym_EventScript_GiveEnigmaBerry + goto_if_eq VAR_RESULT, TRUE, PetalburgCity_Gym_EventScript_GiveEnigmaBerry goto_if_unset FLAG_RECEIVED_TM42, PetalburgCity_Gym_EventScript_GiveFacade2 goto_if_set FLAG_SYS_GAME_CLEAR, PetalburgCity_Gym_EventScript_NoAmountOfTrainingIsEnough msgbox PetalburgCity_Gym_Text_DadGoingToKeepTraining, MSGBOX_DEFAULT @@ -381,16 +350,12 @@ PetalburgCity_Gym_EventScript_NormanRematch:: PetalburgCity_Gym_EventScript_ShouldGiveEnigmaBerry:: specialvar VAR_RESULT, IsEnigmaBerryValid - compare VAR_RESULT, FALSE - goto_if_eq PetalburgCity_Gym_EventScript_DontGiveEnigmaBerry - checkitem ITEM_ENIGMA_BERRY, 1 - compare VAR_RESULT, TRUE - goto_if_eq PetalburgCity_Gym_EventScript_DontGiveEnigmaBerry - checkpcitem ITEM_ENIGMA_BERRY, 1 - compare VAR_RESULT, TRUE - goto_if_eq PetalburgCity_Gym_EventScript_DontGiveEnigmaBerry - compare VAR_ENIGMA_BERRY_AVAILABLE, 0 - goto_if_eq PetalburgCity_Gym_EventScript_DontGiveEnigmaBerry + goto_if_eq VAR_RESULT, FALSE, PetalburgCity_Gym_EventScript_DontGiveEnigmaBerry + checkitem ITEM_ENIGMA_BERRY + goto_if_eq VAR_RESULT, TRUE, PetalburgCity_Gym_EventScript_DontGiveEnigmaBerry + checkpcitem ITEM_ENIGMA_BERRY + goto_if_eq VAR_RESULT, TRUE, PetalburgCity_Gym_EventScript_DontGiveEnigmaBerry + goto_if_eq VAR_ENIGMA_BERRY_AVAILABLE, 0, PetalburgCity_Gym_EventScript_DontGiveEnigmaBerry msgbox PetalburgCity_Gym_Text_GiveEnigmaBerry, MSGBOX_DEFAULT setvar VAR_RESULT, TRUE return @@ -401,8 +366,7 @@ PetalburgCity_Gym_EventScript_DontGiveEnigmaBerry:: PetalburgCity_Gym_EventScript_GiveEnigmaBerry:: giveitem ITEM_ENIGMA_BERRY - compare VAR_RESULT, FALSE - goto_if_eq Common_EventScript_ShowBagIsFull + goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull setvar VAR_ENIGMA_BERRY_AVAILABLE, 0 release end @@ -442,8 +406,7 @@ PetalburgCity_Gym_EventScript_NormanBattle:: PetalburgCity_Gym_EventScript_GiveFacade:: giveitem ITEM_TM42 - compare VAR_RESULT, FALSE - goto_if_eq Common_EventScript_BagIsFull + goto_if_eq VAR_RESULT, FALSE, Common_EventScript_BagIsFull setflag FLAG_RECEIVED_TM42 msgbox PetalburgCity_Gym_Text_ExplainFacade, MSGBOX_DEFAULT return @@ -469,35 +432,26 @@ PetalburgCity_Gym_EventScript_WallysDadArrives:: applymovement LOCALID_WALLYS_DAD, Common_Movement_Delay48 waitmovement 0 delay 10 - compare VAR_0x8008, 1 - call_if_eq PetalburgCity_Gym_EventScript_WallysDadApproachPlayerNorth - compare VAR_0x8008, 2 - call_if_eq PetalburgCity_Gym_EventScript_WallysDadApproachPlayerEast - compare VAR_0x8008, 3 - call_if_eq PetalburgCity_Gym_EventScript_WallysDadApproachPlayerWest + call_if_eq VAR_0x8008, 1, PetalburgCity_Gym_EventScript_WallysDadApproachPlayerNorth + call_if_eq VAR_0x8008, 2, PetalburgCity_Gym_EventScript_WallysDadApproachPlayerEast + call_if_eq VAR_0x8008, 3, PetalburgCity_Gym_EventScript_WallysDadApproachPlayerWest msgbox PetalburgCity_Gym_Text_PleaseComeWithMe, MSGBOX_DEFAULT closemessage delay 20 - compare VAR_0x8008, 1 - call_if_eq PetalburgCity_Gym_EventScript_WallysDadFaceNormanNorth - compare VAR_0x8008, 2 - call_if_eq PetalburgCity_Gym_EventScript_WallysDadFaceNormanEast - compare VAR_0x8008, 3 - call_if_eq PetalburgCity_Gym_EventScript_WallysDadFaceNormanWest + call_if_eq VAR_0x8008, 1, PetalburgCity_Gym_EventScript_WallysDadFaceNormanNorth + call_if_eq VAR_0x8008, 2, PetalburgCity_Gym_EventScript_WallysDadFaceNormanEast + call_if_eq VAR_0x8008, 3, PetalburgCity_Gym_EventScript_WallysDadFaceNormanWest msgbox PetalburgCity_Gym_Text_LetMeBorrowPlayer, MSGBOX_DEFAULT closemessage setflag FLAG_DONT_TRANSITION_MUSIC playbgm MUS_FOLLOW_ME, FALSE - compare VAR_0x8008, 1 - call_if_eq PetalburgCity_Gym_EventScript_ExitGymWithWallysDadNorth - compare VAR_0x8008, 2 - call_if_eq PetalburgCity_Gym_EventScript_ExitGymWithWallysDadEast - compare VAR_0x8008, 3 - call_if_eq PetalburgCity_Gym_EventScript_ExitGymWithWallysDadWest + call_if_eq VAR_0x8008, 1, PetalburgCity_Gym_EventScript_ExitGymWithWallysDadNorth + call_if_eq VAR_0x8008, 2, PetalburgCity_Gym_EventScript_ExitGymWithWallysDadEast + call_if_eq VAR_0x8008, 3, PetalburgCity_Gym_EventScript_ExitGymWithWallysDadWest removeobject LOCALID_WALLYS_DAD setvar VAR_PETALBURG_CITY_STATE, 4 clearflag FLAG_HIDE_PETALBURG_CITY_WALLYS_DAD - warp MAP_PETALBURG_CITY, 255, 15, 8 + warp MAP_PETALBURG_CITY, 15, 8 waitstate release end @@ -782,21 +736,18 @@ PetalburgCity_Gym_EventScript_NoAmountOfTrainingIsEnough:: PetalburgCity_Gym_EventScript_SpeedRoomDoor:: lockall - compare VAR_PETALBURG_GYM_STATE, 6 - goto_if_lt PetalburgCity_Gym_EventScript_DoorLocked + goto_if_lt VAR_PETALBURG_GYM_STATE, 6, PetalburgCity_Gym_EventScript_DoorLocked setvar VAR_0x8008, 7 setvar VAR_0x8009, 85 msgbox PetalburgCity_Gym_Text_EnterSpeedRoom, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq PetalburgCity_Gym_EventScript_EnterRoom - compare VAR_RESULT, NO - goto_if_eq PetalburgCity_Gym_EventScript_DontEnterRoom + goto_if_eq VAR_RESULT, YES, PetalburgCity_Gym_EventScript_EnterRoom + goto_if_eq VAR_RESULT, NO, PetalburgCity_Gym_EventScript_DontEnterRoom end PetalburgCity_Gym_EventScript_EnterRoom:: closemessage delay 30 - warpdoor MAP_PETALBURG_CITY_GYM, 255, VAR_0x8008, VAR_0x8009 + warpdoor MAP_PETALBURG_CITY_GYM, VAR_0x8008, VAR_0x8009 waitstate releaseall end @@ -813,15 +764,12 @@ PetalburgCity_Gym_EventScript_DoorLocked:: @ VAR_0x8008 and VAR_0x8009 below are the x and y coordinates of the warp PetalburgCity_Gym_EventScript_AccuracyRoomDoor:: lockall - compare VAR_PETALBURG_GYM_STATE, 6 - goto_if_lt PetalburgCity_Gym_EventScript_DoorLocked + goto_if_lt VAR_PETALBURG_GYM_STATE, 6, PetalburgCity_Gym_EventScript_DoorLocked setvar VAR_0x8008, 1 setvar VAR_0x8009, 98 msgbox PetalburgCity_Gym_Text_EnterAccuracyRoom, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq PetalburgCity_Gym_EventScript_EnterRoom - compare VAR_RESULT, NO - goto_if_eq PetalburgCity_Gym_EventScript_DontEnterRoom + goto_if_eq VAR_RESULT, YES, PetalburgCity_Gym_EventScript_EnterRoom + goto_if_eq VAR_RESULT, NO, PetalburgCity_Gym_EventScript_DontEnterRoom end PetalburgCity_Gym_EventScript_ConfusionRoomDoor:: @@ -830,10 +778,8 @@ PetalburgCity_Gym_EventScript_ConfusionRoomDoor:: setvar VAR_0x8008, 7 setvar VAR_0x8009, 46 msgbox PetalburgCity_Gym_Text_EnterConfusionRoom, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq PetalburgCity_Gym_EventScript_EnterRoom - compare VAR_RESULT, NO - goto_if_eq PetalburgCity_Gym_EventScript_DontEnterRoom + goto_if_eq VAR_RESULT, YES, PetalburgCity_Gym_EventScript_EnterRoom + goto_if_eq VAR_RESULT, NO, PetalburgCity_Gym_EventScript_DontEnterRoom end PetalburgCity_Gym_EventScript_LeftDefenseRoomDoor:: @@ -842,10 +788,8 @@ PetalburgCity_Gym_EventScript_LeftDefenseRoomDoor:: setvar VAR_0x8008, 1 setvar VAR_0x8009, 59 msgbox PetalburgCity_Gym_Text_EnterDefenseRoom, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq PetalburgCity_Gym_EventScript_EnterRoom - compare VAR_RESULT, NO - goto_if_eq PetalburgCity_Gym_EventScript_DontEnterRoom + goto_if_eq VAR_RESULT, YES, PetalburgCity_Gym_EventScript_EnterRoom + goto_if_eq VAR_RESULT, NO, PetalburgCity_Gym_EventScript_DontEnterRoom end PetalburgCity_Gym_EventScript_RightDefenseRoomDoor:: @@ -854,10 +798,8 @@ PetalburgCity_Gym_EventScript_RightDefenseRoomDoor:: setvar VAR_0x8008, 7 setvar VAR_0x8009, 59 msgbox PetalburgCity_Gym_Text_EnterDefenseRoom, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq PetalburgCity_Gym_EventScript_EnterRoom - compare VAR_RESULT, NO - goto_if_eq PetalburgCity_Gym_EventScript_DontEnterRoom + goto_if_eq VAR_RESULT, YES, PetalburgCity_Gym_EventScript_EnterRoom + goto_if_eq VAR_RESULT, NO, PetalburgCity_Gym_EventScript_DontEnterRoom end PetalburgCity_Gym_EventScript_RecoveryRoomDoor:: @@ -866,10 +808,8 @@ PetalburgCity_Gym_EventScript_RecoveryRoomDoor:: setvar VAR_0x8008, 1 setvar VAR_0x8009, 72 msgbox PetalburgCity_Gym_Text_EnterRecoveryRoom, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq PetalburgCity_Gym_EventScript_EnterRoom - compare VAR_RESULT, NO - goto_if_eq PetalburgCity_Gym_EventScript_DontEnterRoom + goto_if_eq VAR_RESULT, YES, PetalburgCity_Gym_EventScript_EnterRoom + goto_if_eq VAR_RESULT, NO, PetalburgCity_Gym_EventScript_DontEnterRoom end PetalburgCity_Gym_EventScript_LeftStrengthRoomDoor:: @@ -878,10 +818,8 @@ PetalburgCity_Gym_EventScript_LeftStrengthRoomDoor:: setvar VAR_0x8008, 1 setvar VAR_0x8009, 20 msgbox PetalburgCity_Gym_Text_EnterStrengthRoom, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq PetalburgCity_Gym_EventScript_EnterRoom - compare VAR_RESULT, NO - goto_if_eq PetalburgCity_Gym_EventScript_DontEnterRoom + goto_if_eq VAR_RESULT, YES, PetalburgCity_Gym_EventScript_EnterRoom + goto_if_eq VAR_RESULT, NO, PetalburgCity_Gym_EventScript_DontEnterRoom end PetalburgCity_Gym_EventScript_RightStrengthRoomDoor:: @@ -890,10 +828,8 @@ PetalburgCity_Gym_EventScript_RightStrengthRoomDoor:: setvar VAR_0x8008, 7 setvar VAR_0x8009, 20 msgbox PetalburgCity_Gym_Text_EnterStrengthRoom, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq PetalburgCity_Gym_EventScript_EnterRoom - compare VAR_RESULT, NO - goto_if_eq PetalburgCity_Gym_EventScript_DontEnterRoom + goto_if_eq VAR_RESULT, YES, PetalburgCity_Gym_EventScript_EnterRoom + goto_if_eq VAR_RESULT, NO, PetalburgCity_Gym_EventScript_DontEnterRoom end PetalburgCity_Gym_EventScript_LeftOHKORoomDoor:: @@ -902,10 +838,8 @@ PetalburgCity_Gym_EventScript_LeftOHKORoomDoor:: setvar VAR_0x8008, 1 setvar VAR_0x8009, 33 msgbox PetalburgCity_Gym_Text_EnterOHKORoom, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq PetalburgCity_Gym_EventScript_EnterRoom - compare VAR_RESULT, NO - goto_if_eq PetalburgCity_Gym_EventScript_DontEnterRoom + goto_if_eq VAR_RESULT, YES, PetalburgCity_Gym_EventScript_EnterRoom + goto_if_eq VAR_RESULT, NO, PetalburgCity_Gym_EventScript_DontEnterRoom end PetalburgCity_Gym_EventScript_RightOHKORoomDoor:: @@ -914,10 +848,8 @@ PetalburgCity_Gym_EventScript_RightOHKORoomDoor:: setvar VAR_0x8008, 7 setvar VAR_0x8009, 33 msgbox PetalburgCity_Gym_Text_EnterOHKORoom, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq PetalburgCity_Gym_EventScript_EnterRoom - compare VAR_RESULT, NO - goto_if_eq PetalburgCity_Gym_EventScript_DontEnterRoom + goto_if_eq VAR_RESULT, YES, PetalburgCity_Gym_EventScript_EnterRoom + goto_if_eq VAR_RESULT, NO, PetalburgCity_Gym_EventScript_DontEnterRoom end PetalburgCity_Gym_EventScript_LeftGymLeadersRoomDoor:: @@ -926,10 +858,8 @@ PetalburgCity_Gym_EventScript_LeftGymLeadersRoomDoor:: setvar VAR_0x8008, 1 setvar VAR_0x8009, 7 msgbox PetalburgCity_Gym_Text_EnterGymLeadersRoom, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq PetalburgCity_Gym_EventScript_EnterRoom - compare VAR_RESULT, NO - goto_if_eq PetalburgCity_Gym_EventScript_DontEnterRoom + goto_if_eq VAR_RESULT, YES, PetalburgCity_Gym_EventScript_EnterRoom + goto_if_eq VAR_RESULT, NO, PetalburgCity_Gym_EventScript_DontEnterRoom end PetalburgCity_Gym_EventScript_RightGymLeadersRoomDoor:: @@ -938,10 +868,8 @@ PetalburgCity_Gym_EventScript_RightGymLeadersRoomDoor:: setvar VAR_0x8008, 7 setvar VAR_0x8009, 7 msgbox PetalburgCity_Gym_Text_EnterGymLeadersRoom, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq PetalburgCity_Gym_EventScript_EnterRoom - compare VAR_RESULT, NO - goto_if_eq PetalburgCity_Gym_EventScript_DontEnterRoom + goto_if_eq VAR_RESULT, YES, PetalburgCity_Gym_EventScript_EnterRoom + goto_if_eq VAR_RESULT, NO, PetalburgCity_Gym_EventScript_DontEnterRoom end PetalburgCity_Gym_EventScript_Randall:: @@ -1067,122 +995,106 @@ PetalburgCity_Gym_EventScript_JodyPostBadge:: @ VAR_0x8005 below is 0 when the door should be slid open and 1 when it should be unlocked immediately PetalburgCity_Gym_EventScript_OpenGymEntranceDoors:: setvar VAR_0x8004, 1 - compare VAR_0x8005, 0 - call_if_eq PetalburgCity_Gym_EventScript_SlideOpenRoomDoors - compare VAR_0x8005, 1 - call_if_eq PetalburgCity_Gym_EventScript_UnlockRoomDoors + call_if_eq VAR_0x8005, 0, PetalburgCity_Gym_EventScript_SlideOpenRoomDoors + call_if_eq VAR_0x8005, 1, PetalburgCity_Gym_EventScript_UnlockRoomDoors call PetalburgCity_Gym_EventScript_SetEntranceRoomDoorMetatiles return PetalburgCity_Gym_EventScript_OpenSpeedRoomDoors:: setvar VAR_0x8004, 2 - compare VAR_0x8005, 0 - call_if_eq PetalburgCity_Gym_EventScript_SlideOpenRoomDoors - compare VAR_0x8005, 1 - call_if_eq PetalburgCity_Gym_EventScript_UnlockRoomDoors + call_if_eq VAR_0x8005, 0, PetalburgCity_Gym_EventScript_SlideOpenRoomDoors + call_if_eq VAR_0x8005, 1, PetalburgCity_Gym_EventScript_UnlockRoomDoors call PetalburgCity_Gym_EventScript_SetSpeedRoomDoorMetatiles return PetalburgCity_Gym_EventScript_OpenAccuracyRoomDoors:: setvar VAR_0x8004, 3 - compare VAR_0x8005, 0 - call_if_eq PetalburgCity_Gym_EventScript_SlideOpenRoomDoors - compare VAR_0x8005, 1 - call_if_eq PetalburgCity_Gym_EventScript_UnlockRoomDoors + call_if_eq VAR_0x8005, 0, PetalburgCity_Gym_EventScript_SlideOpenRoomDoors + call_if_eq VAR_0x8005, 1, PetalburgCity_Gym_EventScript_UnlockRoomDoors call PetalburgCity_Gym_EventScript_SetAccuracyRoomDoorMetatiles return PetalburgCity_Gym_EventScript_OpenConfusionRoomDoors:: setvar VAR_0x8004, 4 - compare VAR_0x8005, 0 - call_if_eq PetalburgCity_Gym_EventScript_SlideOpenRoomDoors - compare VAR_0x8005, 1 - call_if_eq PetalburgCity_Gym_EventScript_UnlockRoomDoors + call_if_eq VAR_0x8005, 0, PetalburgCity_Gym_EventScript_SlideOpenRoomDoors + call_if_eq VAR_0x8005, 1, PetalburgCity_Gym_EventScript_UnlockRoomDoors call PetalburgCity_Gym_EventScript_SetConfusionRoomDoorMetatiles return PetalburgCity_Gym_EventScript_OpenDefenseRoomDoors:: setvar VAR_0x8004, 5 - compare VAR_0x8005, 0 - call_if_eq PetalburgCity_Gym_EventScript_SlideOpenRoomDoors - compare VAR_0x8005, 1 - call_if_eq PetalburgCity_Gym_EventScript_UnlockRoomDoors + call_if_eq VAR_0x8005, 0, PetalburgCity_Gym_EventScript_SlideOpenRoomDoors + call_if_eq VAR_0x8005, 1, PetalburgCity_Gym_EventScript_UnlockRoomDoors call PetalburgCity_Gym_EventScript_SetDefenseRoomDoorMetatiles return PetalburgCity_Gym_EventScript_OpenRecoveryRoomDoors:: setvar VAR_0x8004, 6 - compare VAR_0x8005, 0 - call_if_eq PetalburgCity_Gym_EventScript_SlideOpenRoomDoors - compare VAR_0x8005, 1 - call_if_eq PetalburgCity_Gym_EventScript_UnlockRoomDoors + call_if_eq VAR_0x8005, 0, PetalburgCity_Gym_EventScript_SlideOpenRoomDoors + call_if_eq VAR_0x8005, 1, PetalburgCity_Gym_EventScript_UnlockRoomDoors call PetalburgCity_Gym_EventScript_SetRecoveryRoomDoorMetatiles return PetalburgCity_Gym_EventScript_OpenStrengthRoomDoors:: setvar VAR_0x8004, 7 - compare VAR_0x8005, 0 - call_if_eq PetalburgCity_Gym_EventScript_SlideOpenRoomDoors - compare VAR_0x8005, 1 - call_if_eq PetalburgCity_Gym_EventScript_UnlockRoomDoors + call_if_eq VAR_0x8005, 0, PetalburgCity_Gym_EventScript_SlideOpenRoomDoors + call_if_eq VAR_0x8005, 1, PetalburgCity_Gym_EventScript_UnlockRoomDoors call PetalburgCity_Gym_EventScript_SetStrengthRoomDoorMetatiles return PetalburgCity_Gym_EventScript_OpenOHKORoomDoors:: setvar VAR_0x8004, 8 - compare VAR_0x8005, 0 - call_if_eq PetalburgCity_Gym_EventScript_SlideOpenRoomDoors - compare VAR_0x8005, 1 - call_if_eq PetalburgCity_Gym_EventScript_UnlockRoomDoors + call_if_eq VAR_0x8005, 0, PetalburgCity_Gym_EventScript_SlideOpenRoomDoors + call_if_eq VAR_0x8005, 1, PetalburgCity_Gym_EventScript_UnlockRoomDoors call PetalburgCity_Gym_EventScript_SetOHKORoomDoorMetatiles return PetalburgCity_Gym_EventScript_SetEntranceRoomDoorMetatiles:: - setmetatile 6, 85, METATILE_PetalburgGym_RoomEntrance_Left, 0 - setmetatile 7, 85, METATILE_PetalburgGym_RoomEntrance_Right, 0 - setmetatile 1, 98, METATILE_PetalburgGym_RoomEntrance_Left, 0 - setmetatile 2, 98, METATILE_PetalburgGym_RoomEntrance_Right, 0 + setmetatile 6, 85, METATILE_PetalburgGym_RoomEntrance_Left, FALSE + setmetatile 7, 85, METATILE_PetalburgGym_RoomEntrance_Right, FALSE + setmetatile 1, 98, METATILE_PetalburgGym_RoomEntrance_Left, FALSE + setmetatile 2, 98, METATILE_PetalburgGym_RoomEntrance_Right, FALSE return PetalburgCity_Gym_EventScript_SetSpeedRoomDoorMetatiles:: - setmetatile 6, 46, METATILE_PetalburgGym_RoomEntrance_Left, 0 - setmetatile 7, 46, METATILE_PetalburgGym_RoomEntrance_Right, 0 - setmetatile 1, 59, METATILE_PetalburgGym_RoomEntrance_Left, 0 - setmetatile 2, 59, METATILE_PetalburgGym_RoomEntrance_Right, 0 + setmetatile 6, 46, METATILE_PetalburgGym_RoomEntrance_Left, FALSE + setmetatile 7, 46, METATILE_PetalburgGym_RoomEntrance_Right, FALSE + setmetatile 1, 59, METATILE_PetalburgGym_RoomEntrance_Left, FALSE + setmetatile 2, 59, METATILE_PetalburgGym_RoomEntrance_Right, FALSE return PetalburgCity_Gym_EventScript_SetAccuracyRoomDoorMetatiles:: - setmetatile 6, 59, METATILE_PetalburgGym_RoomEntrance_Left, 0 - setmetatile 7, 59, METATILE_PetalburgGym_RoomEntrance_Right, 0 - setmetatile 1, 72, METATILE_PetalburgGym_RoomEntrance_Left, 0 - setmetatile 2, 72, METATILE_PetalburgGym_RoomEntrance_Right, 0 + setmetatile 6, 59, METATILE_PetalburgGym_RoomEntrance_Left, FALSE + setmetatile 7, 59, METATILE_PetalburgGym_RoomEntrance_Right, FALSE + setmetatile 1, 72, METATILE_PetalburgGym_RoomEntrance_Left, FALSE + setmetatile 2, 72, METATILE_PetalburgGym_RoomEntrance_Right, FALSE return PetalburgCity_Gym_EventScript_SetConfusionRoomDoorMetatiles:: - setmetatile 1, 20, METATILE_PetalburgGym_RoomEntrance_Left, 0 - setmetatile 2, 20, METATILE_PetalburgGym_RoomEntrance_Right, 0 + setmetatile 1, 20, METATILE_PetalburgGym_RoomEntrance_Left, FALSE + setmetatile 2, 20, METATILE_PetalburgGym_RoomEntrance_Right, FALSE return PetalburgCity_Gym_EventScript_SetDefenseRoomDoorMetatiles:: - setmetatile 6, 20, METATILE_PetalburgGym_RoomEntrance_Left, 0 - setmetatile 7, 20, METATILE_PetalburgGym_RoomEntrance_Right, 0 - setmetatile 1, 33, METATILE_PetalburgGym_RoomEntrance_Left, 0 - setmetatile 2, 33, METATILE_PetalburgGym_RoomEntrance_Right, 0 + setmetatile 6, 20, METATILE_PetalburgGym_RoomEntrance_Left, FALSE + setmetatile 7, 20, METATILE_PetalburgGym_RoomEntrance_Right, FALSE + setmetatile 1, 33, METATILE_PetalburgGym_RoomEntrance_Left, FALSE + setmetatile 2, 33, METATILE_PetalburgGym_RoomEntrance_Right, FALSE return PetalburgCity_Gym_EventScript_SetRecoveryRoomDoorMetatiles:: - setmetatile 6, 33, METATILE_PetalburgGym_RoomEntrance_Left, 0 - setmetatile 7, 33, METATILE_PetalburgGym_RoomEntrance_Right, 0 + setmetatile 6, 33, METATILE_PetalburgGym_RoomEntrance_Left, FALSE + setmetatile 7, 33, METATILE_PetalburgGym_RoomEntrance_Right, FALSE return PetalburgCity_Gym_EventScript_SetStrengthRoomDoorMetatiles:: - setmetatile 1, 7, METATILE_PetalburgGym_RoomEntrance_Left, 0 - setmetatile 2, 7, METATILE_PetalburgGym_RoomEntrance_Right, 0 + setmetatile 1, 7, METATILE_PetalburgGym_RoomEntrance_Left, FALSE + setmetatile 2, 7, METATILE_PetalburgGym_RoomEntrance_Right, FALSE return PetalburgCity_Gym_EventScript_SetOHKORoomDoorMetatiles:: - setmetatile 6, 7, METATILE_PetalburgGym_RoomEntrance_Left, 0 - setmetatile 7, 7, METATILE_PetalburgGym_RoomEntrance_Right, 0 + setmetatile 6, 7, METATILE_PetalburgGym_RoomEntrance_Left, FALSE + setmetatile 7, 7, METATILE_PetalburgGym_RoomEntrance_Right, FALSE return PetalburgCity_Gym_EventScript_SlideOpenRoomDoors:: diff --git a/data/maps/PetalburgCity_PokemonCenter_1F/scripts.inc b/data/maps/PetalburgCity_PokemonCenter_1F/scripts.inc index 58b58054f2fa..3dadd3184bac 100644 --- a/data/maps/PetalburgCity_PokemonCenter_1F/scripts.inc +++ b/data/maps/PetalburgCity_PokemonCenter_1F/scripts.inc @@ -31,18 +31,14 @@ PetalburgCity_PokemonCenter_1F_EventScript_Woman:: faceplayer msgbox PetalburgCity_PokemonCenter_1F_Text_ManyTypesOfPokemon, MSGBOX_DEFAULT specialvar VAR_RESULT, IsStarterInParty - compare VAR_RESULT, TRUE - goto_if_eq PetalburgCity_PokemonCenter_1F_EventScript_SayStarterTypeInfo + goto_if_eq VAR_RESULT, TRUE, PetalburgCity_PokemonCenter_1F_EventScript_SayStarterTypeInfo release end PetalburgCity_PokemonCenter_1F_EventScript_SayStarterTypeInfo:: - compare VAR_STARTER_MON, 0 - call_if_eq PetalburgCity_PokemonCenter_1F_EventScript_SayTreeckoType - compare VAR_STARTER_MON, 1 - call_if_eq PetalburgCity_PokemonCenter_1F_EventScript_SayTorchicType - compare VAR_STARTER_MON, 2 - call_if_eq PetalburgCity_PokemonCenter_1F_EventScript_SayMudkipType + call_if_eq VAR_STARTER_MON, 0, PetalburgCity_PokemonCenter_1F_EventScript_SayTreeckoType + call_if_eq VAR_STARTER_MON, 1, PetalburgCity_PokemonCenter_1F_EventScript_SayTorchicType + call_if_eq VAR_STARTER_MON, 2, PetalburgCity_PokemonCenter_1F_EventScript_SayMudkipType release end diff --git a/data/maps/PetalburgWoods/scripts.inc b/data/maps/PetalburgWoods/scripts.inc index dd2d9273f508..94bd3901486d 100644 --- a/data/maps/PetalburgWoods/scripts.inc +++ b/data/maps/PetalburgWoods/scripts.inc @@ -92,8 +92,7 @@ PetalburgWoods_EventScript_DevonResearcherPostBattle:: waitmovement 0 msgbox PetalburgWoods_Text_ThatWasAwfullyClose, MSGBOX_DEFAULT giveitem ITEM_GREAT_BALL - compare VAR_RESULT, FALSE - goto_if_eq PetalburgWoods_EventScript_BagFull + goto_if_eq VAR_RESULT, FALSE, PetalburgWoods_EventScript_BagFull goto PetalburgWoods_EventScript_DevonResearcherFinish end @@ -255,8 +254,7 @@ PetalburgWoods_EventScript_Girl:: goto_if_set FLAG_RECEIVED_MIRACLE_SEED, PetalburgWoods_EventScript_ExplainMiracleSeed msgbox PetalburgWoods_Text_TryUsingThisItem, MSGBOX_DEFAULT giveitem ITEM_MIRACLE_SEED - compare VAR_RESULT, FALSE - goto_if_eq Common_EventScript_ShowBagIsFull + goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull setflag FLAG_RECEIVED_MIRACLE_SEED release end @@ -282,12 +280,10 @@ PetalburgWoods_EventScript_Lyle:: PetalburgWoods_EventScript_James:: trainerbattle_single TRAINER_JAMES_1, PetalburgWoods_Text_InstantlyPopularWithBugPokemon, PetalburgWoods_Text_CantBePopularIfILose, PetalburgWoods_EventScript_TryRegisterJames specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq PetalburgWoods_EventScript_JamesRematch + goto_if_eq VAR_RESULT, TRUE, PetalburgWoods_EventScript_JamesRematch setvar VAR_0x8004, TRAINER_JAMES_1 specialvar VAR_RESULT, IsTrainerRegistered - compare VAR_RESULT, FALSE - goto_if_eq PetalburgWoods_EventScript_TryRegisterJames2 + goto_if_eq VAR_RESULT, FALSE, PetalburgWoods_EventScript_TryRegisterJames2 msgbox PetalburgWoods_Text_PeopleRespectYou, MSGBOX_DEFAULT release end diff --git a/data/maps/Route101/scripts.inc b/data/maps/Route101/scripts.inc index a41bc2fcbc19..dd0ef5dcec1d 100644 --- a/data/maps/Route101/scripts.inc +++ b/data/maps/Route101/scripts.inc @@ -241,11 +241,9 @@ Route101_EventScript_BirchsBag:: setvar VAR_ROUTE101_STATE, 3 clearflag FLAG_HIDE_MAP_NAME_POPUP checkplayergender - compare VAR_RESULT, MALE - call_if_eq Route101_EventScript_HideMayInBedroom - compare VAR_RESULT, FEMALE - call_if_eq Route101_EventScript_HideBrendanInBedroom - warp MAP_LITTLEROOT_TOWN_PROFESSOR_BIRCHS_LAB, 255, 6, 5 + call_if_eq VAR_RESULT, MALE, Route101_EventScript_HideMayInBedroom + call_if_eq VAR_RESULT, FEMALE, Route101_EventScript_HideBrendanInBedroom + warp MAP_LITTLEROOT_TOWN_PROFESSOR_BIRCHS_LAB, 6, 5 waitstate release end diff --git a/data/maps/Route102/scripts.inc b/data/maps/Route102/scripts.inc index cc1eaa4bb71c..6131ef9e01ef 100644 --- a/data/maps/Route102/scripts.inc +++ b/data/maps/Route102/scripts.inc @@ -20,12 +20,10 @@ Route102_EventScript_Boy:: Route102_EventScript_Calvin:: trainerbattle_single TRAINER_CALVIN_1, Route102_Text_CalvinIntro, Route102_Text_CalvinDefeated, Route102_EventScript_CalvinRegisterMatchCallAfterBattle specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq Route102_EventScript_CalvinRematch + goto_if_eq VAR_RESULT, TRUE, Route102_EventScript_CalvinRematch setvar VAR_0x8004, TRAINER_CALVIN_1 specialvar VAR_RESULT, IsTrainerRegistered - compare VAR_RESULT, FALSE - goto_if_eq Route102_EventScript_CalvinTryRegister + goto_if_eq VAR_RESULT, FALSE, Route102_EventScript_CalvinTryRegister msgbox Route102_Text_CalvinPostBattle, MSGBOX_DEFAULT release end diff --git a/data/maps/Route103/scripts.inc b/data/maps/Route103/scripts.inc index 4553f431c038..e2b75e0c3dda 100644 --- a/data/maps/Route103/scripts.inc +++ b/data/maps/Route103/scripts.inc @@ -15,17 +15,15 @@ Route103_OnLoad: end Route103_EventScript_OpenAlteringCave:: - setmetatile 45, 5, METATILE_General_CaveEntrance_Top, 1 - setmetatile 45, 6, METATILE_General_CaveEntrance_Bottom, 0 + setmetatile 45, 5, METATILE_General_CaveEntrance_Top, TRUE + setmetatile 45, 6, METATILE_General_CaveEntrance_Bottom, FALSE return Route103_EventScript_Rival:: lockall checkplayergender - compare VAR_RESULT, MALE - goto_if_eq Route103_EventScript_RivalMay - compare VAR_RESULT, FEMALE - goto_if_eq Route103_EventScript_RivalBrendan + goto_if_eq VAR_RESULT, MALE, Route103_EventScript_RivalMay + goto_if_eq VAR_RESULT, FEMALE, Route103_EventScript_RivalBrendan end Route103_EventScript_RivalMay:: @@ -211,8 +209,7 @@ Route103_EventScript_Daisy:: Route103_EventScript_Amy:: trainerbattle_double TRAINER_AMY_AND_LIV_1, Route103_Text_AmyIntro, Route103_Text_AmyDefeated, Route103_Text_AmyNotEnoughPokemon, Route102_EventScript_AmyRegisterMatchCallAfterBattle specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq Route102_EventScript_AmyRematch + goto_if_eq VAR_RESULT, TRUE, Route102_EventScript_AmyRematch msgbox Route103_Text_AmyPostBattle, MSGBOX_AUTOCLOSE end @@ -230,8 +227,7 @@ Route102_EventScript_AmyRematch:: Route103_EventScript_Liv:: trainerbattle_double TRAINER_AMY_AND_LIV_1, Route103_Text_LivIntro, Route103_Text_LivDefeated, Route103_Text_LivNotEnoughPokemon, Route102_EventScript_LivRegisterMatchCallAfterBattle specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq Route102_EventScript_LivRematch + goto_if_eq VAR_RESULT, TRUE, Route102_EventScript_LivRematch msgbox Route103_Text_LivPostBattle, MSGBOX_AUTOCLOSE end @@ -254,8 +250,7 @@ Route103_EventScript_Andrew:: Route103_EventScript_Miguel:: trainerbattle_single TRAINER_MIGUEL_1, Route103_Text_MiguelIntro, Route103_Text_MiguelDefeated, Route102_EventScript_MiguelRegisterMatchCallAfterBattle specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq Route103_EventScript_MiguelRematch + goto_if_eq VAR_RESULT, TRUE, Route103_EventScript_MiguelRematch msgbox Route103_Text_MiguelPostBattle, MSGBOX_DEFAULT release end diff --git a/data/maps/Route104/scripts.inc b/data/maps/Route104/scripts.inc index d58bc5060065..68aeb0a21258 100644 --- a/data/maps/Route104/scripts.inc +++ b/data/maps/Route104/scripts.inc @@ -33,8 +33,7 @@ Route104_EventScript_HideWhiteHerbFlorist:: return Route104_EventScript_TrySetRivalPos:: - compare VAR_BOARD_BRINEY_BOAT_STATE, 1 - goto_if_ge Route104_EventScript_DontSetRivalPos + goto_if_ge VAR_BOARD_BRINEY_BOAT_STATE, 1, Route104_EventScript_DontSetRivalPos goto_if_set FLAG_MET_RIVAL_RUSTBORO, Route104_EventScript_DontSetRivalPos goto_if_unset FLAG_REGISTER_RIVAL_POKENAV, Route104_EventScript_DontSetRivalPos setobjectxyperm LOCALID_RIVAL, 17, 52 @@ -77,10 +76,8 @@ Route104_EventScript_RivalTrigger:: @ Unused, shares script with Rustboro encounter instead Route104_EventScript_PlayRivalMusic:: checkplayergender - compare VAR_RESULT, MALE - goto_if_eq Route104_EventScript_PlayMayMusic - compare VAR_RESULT, FEMALE - goto_if_eq Route104_EventScript_PlayBrendanMusic + goto_if_eq VAR_RESULT, MALE, Route104_EventScript_PlayMayMusic + goto_if_eq VAR_RESULT, FEMALE, Route104_EventScript_PlayBrendanMusic return Route104_EventScript_PlayMayMusic:: @@ -93,10 +90,8 @@ Route104_EventScript_PlayBrendanMusic:: Route104_EventScript_RivalEncounter:: checkplayergender - compare VAR_RESULT, MALE - goto_if_eq Route104_EventScript_MayEncounter - compare VAR_RESULT, FEMALE - goto_if_eq Route104_EventScript_BrendanEncounter + goto_if_eq VAR_RESULT, MALE, Route104_EventScript_MayEncounter + goto_if_eq VAR_RESULT, FEMALE, Route104_EventScript_BrendanEncounter end Route104_EventScript_MayEncounter:: @@ -121,8 +116,7 @@ Route104_EventScript_MayEncounter:: waitmovement 0 copyobjectxytoperm LOCALID_RIVAL msgbox Route104_Text_MayMinesDecentLetsBattle, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq Route104_EventScript_BattleMay + goto_if_eq VAR_RESULT, YES, Route104_EventScript_BattleMay msgbox Route104_Text_MayHaventRaisedPokemon, MSGBOX_DEFAULT call Route104_EventScript_RestoreMusic releaseall @@ -144,8 +138,7 @@ Route104_Movement_PlayerFaceRival: Route104_EventScript_MayAskToBattle:: msgbox Route104_Text_MayLetsBattle, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq Route104_EventScript_BattleMay + goto_if_eq VAR_RESULT, YES, Route104_EventScript_BattleMay msgbox Route104_Text_MayHaventRaisedPokemon, MSGBOX_DEFAULT releaseall end @@ -160,8 +153,7 @@ Route104_EventScript_BattleMay:: Route104_EventScript_MayDefeated:: msgbox Route104_Text_MayPostBattle, MSGBOX_DEFAULT - compare VAR_0x8008, 0 - call_if_eq Route104_EventScript_RestoreMusic + call_if_eq VAR_0x8008, 0, Route104_EventScript_RestoreMusic releaseall end @@ -210,8 +202,7 @@ Route104_EventScript_BrendanEncounter:: waitmovement 0 copyobjectxytoperm LOCALID_RIVAL msgbox Route104_Text_BrendanDoingGreatLetsBattle, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq Route104_EventScript_BattleBrendan + goto_if_eq VAR_RESULT, YES, Route104_EventScript_BattleBrendan msgbox Route104_Text_BrendanNoConfidence, MSGBOX_DEFAULT call Route104_EventScript_RestoreMusic releaseall @@ -219,8 +210,7 @@ Route104_EventScript_BrendanEncounter:: Route104_EventScript_BrendanAskToBattle:: msgbox Route104_Text_BrendanLetsBattle, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq Route104_EventScript_BattleBrendan + goto_if_eq VAR_RESULT, YES, Route104_EventScript_BattleBrendan msgbox Route104_Text_BrendanNoConfidence, MSGBOX_DEFAULT releaseall end @@ -235,8 +225,7 @@ Route104_EventScript_BattleBrendan:: Route104_EventScript_BrendanDefeated:: msgbox Route104_Text_BrendanPostBattle, MSGBOX_DEFAULT - compare VAR_0x8008, 0 - call_if_eq Route104_EventScript_RestoreMusic + call_if_eq VAR_0x8008, 0, Route104_EventScript_RestoreMusic releaseall end @@ -274,8 +263,7 @@ Route104_EventScript_ExpertF:: goto_if_set FLAG_RECEIVED_CHESTO_BERRY_ROUTE_104, Route104_EventScript_ReceivedBerry msgbox Route104_Text_PlantBerriesInSoilTakeThis, MSGBOX_DEFAULT giveitem ITEM_CHESTO_BERRY - compare VAR_RESULT, FALSE - goto_if_eq Common_EventScript_ShowBagIsFull + goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull setflag FLAG_RECEIVED_CHESTO_BERRY_ROUTE_104 msgbox Route104_Text_TrainersOftenMakeMonHoldBerries, MSGBOX_DEFAULT release @@ -292,8 +280,7 @@ Route104_EventScript_WhiteHerbFlorist:: goto_if_set FLAG_RECEIVED_WHITE_HERB, Route104_EventScript_ReceivedWhiteHerb msgbox Route104_Text_DontNeedThisTakeIt, MSGBOX_DEFAULT giveitem ITEM_WHITE_HERB - compare VAR_RESULT, FALSE - goto_if_eq Common_EventScript_ShowBagIsFull + goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull setflag FLAG_RECEIVED_WHITE_HERB release end @@ -345,8 +332,7 @@ Route104_EventScript_Boy2:: goto_if_set FLAG_RECEIVED_TM09, Route104_EventScript_ReceivedBulletSeed msgbox Route104_Text_LikeFillingMouthWithSeedsTakeThis, MSGBOX_DEFAULT giveitem ITEM_TM09 - compare VAR_RESULT, FALSE - goto_if_eq Common_EventScript_ShowBagIsFull + goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull setflag FLAG_RECEIVED_TM09 release end @@ -361,8 +347,8 @@ Route104_EventScript_Girl2:: end Route104_EventScript_SailToDewford:: - setobjectpriority LOCALID_BRINEY_R104, MAP_ROUTE104, 0 - setobjectpriority OBJ_EVENT_ID_PLAYER, MAP_ROUTE104, 0 + setobjectsubpriority LOCALID_BRINEY_R104, MAP_ROUTE104, 0 + setobjectsubpriority OBJ_EVENT_ID_PLAYER, MAP_ROUTE104, 0 applymovement LOCALID_BRINEY_R104, Route104_Movement_BrineyBoardBoat waitmovement 0 removeobject LOCALID_BRINEY_R104 @@ -409,7 +395,7 @@ Route104_EventScript_ArriveInDewford:: waitmovement 0 setobjectxyperm LOCALID_BRINEY_DEWFORD, 12, 8 addobject LOCALID_BRINEY_DEWFORD - setobjectpriority LOCALID_BRINEY_DEWFORD, MAP_DEWFORD_TOWN, 0 + setobjectsubpriority LOCALID_BRINEY_DEWFORD, MAP_DEWFORD_TOWN, 0 clearflag FLAG_HIDE_MR_BRINEY_DEWFORD_TOWN applymovement LOCALID_BRINEY_DEWFORD, Route104_Movement_BrineyExitBoat waitmovement 0 @@ -419,8 +405,8 @@ Route104_EventScript_ArriveInDewford:: setflag FLAG_HIDE_ROUTE_104_MR_BRINEY_BOAT hideobjectat LOCALID_BOAT_R104, MAP_ROUTE104 copyvar VAR_BRINEY_LOCATION, VAR_0x8008 - resetobjectpriority OBJ_EVENT_ID_PLAYER, MAP_ROUTE104 - resetobjectpriority LOCALID_BRINEY_DEWFORD, MAP_DEWFORD_TOWN + resetobjectsubpriority OBJ_EVENT_ID_PLAYER, MAP_ROUTE104 + resetobjectsubpriority LOCALID_BRINEY_DEWFORD, MAP_DEWFORD_TOWN copyobjectxytoperm LOCALID_BRINEY_DEWFORD setvar VAR_BOARD_BRINEY_BOAT_STATE, 0 goto_if_unset FLAG_DELIVERED_STEVEN_LETTER, Route104_EventScript_DeliverLetterReminder @@ -873,12 +859,10 @@ Route104_EventScript_Billy:: Route104_EventScript_Haley:: trainerbattle_single TRAINER_HALEY_1, Route104_Text_HaleyIntro, Route104_Text_HaleyDefeat, Route104_EventScript_TryRegisterHaleyAfterBattle specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq Route104_EventScript_RematchHaley + goto_if_eq VAR_RESULT, TRUE, Route104_EventScript_RematchHaley setvar VAR_0x8004, TRAINER_HALEY_1 specialvar VAR_RESULT, IsTrainerRegistered - compare VAR_RESULT, FALSE - goto_if_eq Route104_EventScript_TryRegisterHaley + goto_if_eq VAR_RESULT, FALSE, Route104_EventScript_TryRegisterHaley msgbox Route104_Text_HaleyPostBattle, MSGBOX_DEFAULT release end @@ -916,12 +900,10 @@ Route104_EventScript_RematchHaley:: Route104_EventScript_Winston:: trainerbattle_single TRAINER_WINSTON_1, Route104_Text_WinstonIntro, Route104_Text_WinstonDefeat, Route104_EventScript_TryRegisterWinstonAfterBattle specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq Route104_EventScript_RematchWinston + goto_if_eq VAR_RESULT, TRUE, Route104_EventScript_RematchWinston setvar VAR_0x8004, TRAINER_WINSTON_1 specialvar VAR_RESULT, IsTrainerRegistered - compare VAR_RESULT, FALSE - goto_if_eq Route104_EventScript_TryRegisterWinston + goto_if_eq VAR_RESULT, FALSE, Route104_EventScript_TryRegisterWinston msgbox Route104_Text_WinstonPostBattle, MSGBOX_DEFAULT release end @@ -959,12 +941,10 @@ Route104_EventScript_RematchWinston:: Route104_EventScript_Cindy:: trainerbattle_single TRAINER_CINDY_1, Route104_Text_CindyIntro, Route104_Text_CindyDefeat, Route104_EventScript_TryRegisterCindyAfterBattle specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq Route104_EventScript_RematchCindy + goto_if_eq VAR_RESULT, TRUE, Route104_EventScript_RematchCindy setvar VAR_0x8004, TRAINER_CINDY_1 specialvar VAR_RESULT, IsTrainerRegistered - compare VAR_RESULT, FALSE - goto_if_eq Route104_EventScript_TryRegisterCindy + goto_if_eq VAR_RESULT, FALSE, Route104_EventScript_TryRegisterCindy msgbox Route104_Text_CindyPostBattle, MSGBOX_DEFAULT release end diff --git a/data/maps/Route104_MrBrineysHouse/scripts.inc b/data/maps/Route104_MrBrineysHouse/scripts.inc index f2e169d10549..4c693cb4faaf 100644 --- a/data/maps/Route104_MrBrineysHouse/scripts.inc +++ b/data/maps/Route104_MrBrineysHouse/scripts.inc @@ -7,8 +7,7 @@ Route104_MrBrineysHouse_MapScripts:: Route104_MrBrineysHouse_OnTransition: setflag FLAG_LANDMARK_MR_BRINEY_HOUSE - compare VAR_BRINEY_HOUSE_STATE, 1 - call_if_eq Route104_MrBrineysHouse_EventScript_SetBrineyPeekoPos + call_if_eq VAR_BRINEY_HOUSE_STATE, 1, Route104_MrBrineysHouse_EventScript_SetBrineyPeekoPos call_if_set FLAG_RECEIVED_POKENAV, Route104_MrBrineysHouse_EventScript_HideRustboroRival end @@ -36,8 +35,7 @@ Route104_MrBrineysHouse_EventScript_SailingIntro:: setflag FLAG_MR_BRINEY_SAILING_INTRO msgbox Route104_MrBrineysHouse_Text_WaitUpPeeko, MSGBOX_DEFAULT msgbox Route104_MrBrineysHouse_Text_ItsYouLetsSailToDewford, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq Route104_MrBrineysHouse_EventScript_DeclineDeliverySailing + goto_if_eq VAR_RESULT, NO, Route104_MrBrineysHouse_EventScript_DeclineDeliverySailing goto Route104_MrBrineysHouse_EventScript_SailToDewford end @@ -53,15 +51,13 @@ Route104_MrBrineysHouse_EventScript_WhereAreWeBound:: Route104_MrBrineysHouse_EventScript_SailBothDeliveries:: msgbox Route104_MrBrineysHouse_Text_NeedToMakeDeliveriesSailToDewford, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq Route104_MrBrineysHouse_EventScript_DeclineDeliverySailing + goto_if_eq VAR_RESULT, NO, Route104_MrBrineysHouse_EventScript_DeclineDeliverySailing goto Route104_MrBrineysHouse_EventScript_SailToDewford end Route104_MrBrineysHouse_EventScript_SailDeliverPackage:: msgbox Route104_MrBrineysHouse_Text_NeedToDeliverPackageSailToDewford, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq Route104_MrBrineysHouse_EventScript_DeclineDeliverySailing + goto_if_eq VAR_RESULT, NO, Route104_MrBrineysHouse_EventScript_DeclineDeliverySailing goto Route104_MrBrineysHouse_EventScript_SailToDewford end @@ -86,7 +82,7 @@ Route104_MrBrineysHouse_EventScript_SailToDewford:: setvar VAR_ROUTE104_STATE, 2 setflag FLAG_HIDE_RUSTBORO_CITY_RIVAL setflag FLAG_HIDE_ROUTE_104_RIVAL - warp MAP_ROUTE104, 255, 13, 51 + warp MAP_ROUTE104, 13, 51 waitstate releaseall end diff --git a/data/maps/Route104_PrettyPetalFlowerShop/scripts.inc b/data/maps/Route104_PrettyPetalFlowerShop/scripts.inc index 34f5ba42c4f3..5f0ec28fa51d 100644 --- a/data/maps/Route104_PrettyPetalFlowerShop/scripts.inc +++ b/data/maps/Route104_PrettyPetalFlowerShop/scripts.inc @@ -23,19 +23,15 @@ Route104_PrettyPetalFlowerShop_EventScript_ShopOwner:: goto_if_set FLAG_MET_PRETTY_PETAL_SHOP_OWNER, Route104_PrettyPetalFlowerShop_EventScript_AlreadyMet setflag FLAG_MET_PRETTY_PETAL_SHOP_OWNER msgbox Route104_PrettyPetalFlowerShop_Text_IntroLearnAboutBerries, MSGBOX_YESNO - compare VAR_RESULT, YES - call_if_eq Route104_PrettyPetalFlowerShop_EventScript_ExplainBerries - compare VAR_RESULT, NO - call_if_eq Route104_PrettyPetalFlowerShop_EventScript_DontExplainBerries + call_if_eq VAR_RESULT, YES, Route104_PrettyPetalFlowerShop_EventScript_ExplainBerries + call_if_eq VAR_RESULT, NO, Route104_PrettyPetalFlowerShop_EventScript_DontExplainBerries release end Route104_PrettyPetalFlowerShop_EventScript_AlreadyMet:: msgbox Route104_PrettyPetalFlowerShop_Text_LearnAboutBerries, MSGBOX_YESNO - compare VAR_RESULT, YES - call_if_eq Route104_PrettyPetalFlowerShop_EventScript_ExplainBerries - compare VAR_RESULT, NO - call_if_eq Route104_PrettyPetalFlowerShop_EventScript_DontExplainBerries + call_if_eq VAR_RESULT, YES, Route104_PrettyPetalFlowerShop_EventScript_ExplainBerries + call_if_eq VAR_RESULT, NO, Route104_PrettyPetalFlowerShop_EventScript_DontExplainBerries release end @@ -92,8 +88,7 @@ Route104_PrettyPetalFlowerShop_EventScript_RandomBerryGirl:: random 8 addvar VAR_RESULT, FIRST_BERRY_INDEX giveitem VAR_RESULT - compare VAR_RESULT, 0 - goto_if_eq Common_EventScript_ShowBagIsFull + goto_if_eq VAR_RESULT, 0, Common_EventScript_ShowBagIsFull setflag FLAG_DAILY_FLOWER_SHOP_RECEIVED_BERRY msgbox Route104_PrettyPetalFlowerShop_Text_MachineMixesBerries, MSGBOX_DEFAULT release diff --git a/data/maps/Route105/scripts.inc b/data/maps/Route105/scripts.inc index b60cd181fa5a..bfad0daaaef8 100644 --- a/data/maps/Route105/scripts.inc +++ b/data/maps/Route105/scripts.inc @@ -6,24 +6,19 @@ Route105_MapScripts:: Route105_OnLoad: call_if_unset FLAG_REGI_DOORS_OPENED, Route105_CloseRegiEntrance - compare VAR_ABNORMAL_WEATHER_LOCATION, ABNORMAL_WEATHER_ROUTE_105_NORTH - call_if_eq AbnormalWeather_EventScript_PlaceTilesRoute105North - compare VAR_ABNORMAL_WEATHER_LOCATION, ABNORMAL_WEATHER_ROUTE_105_SOUTH - call_if_eq AbnormalWeather_EventScript_PlaceTilesRoute105South + call_if_eq VAR_ABNORMAL_WEATHER_LOCATION, ABNORMAL_WEATHER_ROUTE_105_NORTH, AbnormalWeather_EventScript_PlaceTilesRoute105North + call_if_eq VAR_ABNORMAL_WEATHER_LOCATION, ABNORMAL_WEATHER_ROUTE_105_SOUTH, AbnormalWeather_EventScript_PlaceTilesRoute105South end Route105_CloseRegiEntrance:: - setmetatile 9, 19, METATILE_General_RockWall_RockBase, 1 - setmetatile 9, 20, METATILE_General_RockWall_SandBase, 1 + setmetatile 9, 19, METATILE_General_RockWall_RockBase, TRUE + setmetatile 9, 20, METATILE_General_RockWall_SandBase, TRUE return Route105_OnTransition: - compare VAR_SHOULD_END_ABNORMAL_WEATHER, 1 - call_if_eq AbnormalWeather_EventScript_HideMapNamePopup - compare VAR_ABNORMAL_WEATHER_LOCATION, ABNORMAL_WEATHER_ROUTE_105_NORTH - call_if_eq AbnormalWeather_StartKyogreWeather - compare VAR_ABNORMAL_WEATHER_LOCATION, ABNORMAL_WEATHER_ROUTE_105_SOUTH - call_if_eq AbnormalWeather_StartKyogreWeather + call_if_eq VAR_SHOULD_END_ABNORMAL_WEATHER, 1, AbnormalWeather_EventScript_HideMapNamePopup + call_if_eq VAR_ABNORMAL_WEATHER_LOCATION, ABNORMAL_WEATHER_ROUTE_105_NORTH, AbnormalWeather_StartKyogreWeather + call_if_eq VAR_ABNORMAL_WEATHER_LOCATION, ABNORMAL_WEATHER_ROUTE_105_SOUTH, AbnormalWeather_StartKyogreWeather end Route105_OnFrame: @@ -63,8 +58,7 @@ Route105_EventScript_Josue:: Route105_EventScript_Andres:: trainerbattle_single TRAINER_ANDRES_1, Route105_Text_AndresIntro, Route105_Text_AndresDefeated, Route105_EventScript_AndresRegisterMatchCallAfterBattle specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq Route105_EventScript_AndresRematch + goto_if_eq VAR_RESULT, TRUE, Route105_EventScript_AndresRematch msgbox Route105_Text_AndresPostBattle, MSGBOX_DEFAULT release end diff --git a/data/maps/Route106/scripts.inc b/data/maps/Route106/scripts.inc index 2107ce1c3bf5..0202f57f0139 100644 --- a/data/maps/Route106/scripts.inc +++ b/data/maps/Route106/scripts.inc @@ -18,8 +18,7 @@ Route106_EventScript_Kyla:: Route106_EventScript_Elliot:: trainerbattle_single TRAINER_ELLIOT_1, Route106_Text_ElliotIntro, Route106_Text_ElliotDefeated, Route106_EventScript_ElliotRegisterMatchCallAfterBattle specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq Route106_EventScript_ElliotRematch + goto_if_eq VAR_RESULT, TRUE, Route106_EventScript_ElliotRematch msgbox Route106_Text_ElliotPostBattle, MSGBOX_DEFAULT release end diff --git a/data/maps/Route107/scripts.inc b/data/maps/Route107/scripts.inc index cffeafb08f4e..b61e3e705e41 100644 --- a/data/maps/Route107/scripts.inc +++ b/data/maps/Route107/scripts.inc @@ -9,8 +9,7 @@ Route107_EventScript_Darrin:: Route107_EventScript_Tony:: trainerbattle_single TRAINER_TONY_1, Route107_Text_TonyIntro, Route107_Text_TonyDefeated, Route107_EventScript_TonyRegisterMatchCallAfterBattle specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq Route107_EventScript_TonyRematch + goto_if_eq VAR_RESULT, TRUE, Route107_EventScript_TonyRematch msgbox Route107_Text_TonyPostBattle, MSGBOX_DEFAULT release end diff --git a/data/maps/Route108/scripts.inc b/data/maps/Route108/scripts.inc index 866391554565..cc2a3e9c3d46 100644 --- a/data/maps/Route108/scripts.inc +++ b/data/maps/Route108/scripts.inc @@ -29,8 +29,7 @@ Route108_EventScript_Carolina:: Route108_EventScript_Cory:: trainerbattle_single TRAINER_CORY_1, Route108_Text_CoryIntro, Route108_Text_CoryDefeated, Route108_EventScript_CoryRegisterMatchCallAfterBattle specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq Route108_EventScript_CoryRematch + goto_if_eq VAR_RESULT, TRUE, Route108_EventScript_CoryRematch msgbox Route108_Text_CoryPostBattle, MSGBOX_DEFAULT release end diff --git a/data/maps/Route109/scripts.inc b/data/maps/Route109/scripts.inc index 37852c873f0e..f0353fef4d61 100644 --- a/data/maps/Route109/scripts.inc +++ b/data/maps/Route109/scripts.inc @@ -6,8 +6,8 @@ Route109_MapScripts:: Route109_EventScript_StartDepartForDewford:: call EventScript_BackupMrBrineyLocation - setobjectpriority LOCALID_BRINEY_R109, MAP_ROUTE109, 0 - setobjectpriority OBJ_EVENT_ID_PLAYER, MAP_ROUTE109, 0 + setobjectsubpriority LOCALID_BRINEY_R109, MAP_ROUTE109, 0 + setobjectsubpriority OBJ_EVENT_ID_PLAYER, MAP_ROUTE109, 0 applymovement LOCALID_BRINEY_R109, Route109_Movement_BrineyEnterBoat waitmovement 0 removeobject LOCALID_BRINEY_R109 @@ -50,7 +50,7 @@ Route109_EventScript_DoSailToDewford:: clearflag FLAG_HIDE_MR_BRINEY_BOAT_DEWFORD_TOWN setobjectxyperm LOCALID_BRINEY_DEWFORD, 12, 8 addobject LOCALID_BRINEY_DEWFORD - setobjectpriority LOCALID_BRINEY_DEWFORD, MAP_DEWFORD_TOWN, 0 + setobjectsubpriority LOCALID_BRINEY_DEWFORD, MAP_DEWFORD_TOWN, 0 applymovement LOCALID_BRINEY_DEWFORD, Route109_Movement_BrineyExitBoat waitmovement 0 clearflag FLAG_HIDE_MR_BRINEY_DEWFORD_TOWN @@ -59,8 +59,8 @@ Route109_EventScript_DoSailToDewford:: msgbox DewfordTown_Text_BrineyLandedInDewford, MSGBOX_DEFAULT closemessage copyvar VAR_BRINEY_LOCATION, VAR_0x8008 - resetobjectpriority OBJ_EVENT_ID_PLAYER, MAP_ROUTE109 - resetobjectpriority LOCALID_BRINEY_DEWFORD, MAP_DEWFORD_TOWN + resetobjectsubpriority OBJ_EVENT_ID_PLAYER, MAP_ROUTE109 + resetobjectsubpriority LOCALID_BRINEY_DEWFORD, MAP_DEWFORD_TOWN copyobjectxytoperm LOCALID_BRINEY_DEWFORD release end @@ -282,8 +282,7 @@ Route109_EventScript_MrBriney:: Route109_EventScript_HaveNotDeliveredDevonGood:: message Route109_Text_BrineySailToDewfordQuestion msgbox Route109_Text_BrineySailToDewfordQuestion, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq Route109_EventScript_StayHere + goto_if_eq VAR_RESULT, NO, Route109_EventScript_StayHere goto Route109_EventScript_SailToDewford end @@ -334,8 +333,7 @@ Route109_EventScript_SoftSandGirl:: goto_if_set FLAG_RECEIVED_SOFT_SAND, Route109_EventScript_AlreadyReceivedSoftSand msgbox Route109_Text_YouCanHaveThis, MSGBOX_DEFAULT giveitem ITEM_SOFT_SAND - compare VAR_RESULT, 0 - goto_if_eq Common_EventScript_ShowBagIsFull + goto_if_eq VAR_RESULT, 0, Common_EventScript_ShowBagIsFull closemessage applymovement VAR_LAST_TALKED, Common_Movement_FaceOriginalDirection waitmovement 0 @@ -399,8 +397,7 @@ Route109_EventScript_Edmond:: Route109_EventScript_Ricky:: trainerbattle_single TRAINER_RICKY_1, Route109_Text_RickyIntro, Route109_Text_RickyDefeated, Route109_EventScript_RickyRegisterMatchCallAfterBattle specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq Route109_EventScript_RickyRematch + goto_if_eq VAR_RESULT, TRUE, Route109_EventScript_RickyRematch msgbox Route109_Text_RickyPostBattle, MSGBOX_DEFAULT release end @@ -421,8 +418,7 @@ Route109_EventScript_RickyRematch:: Route109_EventScript_Lola:: trainerbattle_single TRAINER_LOLA_1, Route109_Text_LolaIntro, Route109_Text_LolaDefeated, Route109_EventScript_LolaRegisterMatchCallAfterBattle specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq Route109_EventScript_LolaRematch + goto_if_eq VAR_RESULT, TRUE, Route109_EventScript_LolaRematch msgbox Route109_Text_LolaPostBattle, MSGBOX_DEFAULT release end diff --git a/data/maps/Route109_SeashoreHouse/scripts.inc b/data/maps/Route109_SeashoreHouse/scripts.inc index c4cfd1576e5e..afb2a4aa0dd4 100644 --- a/data/maps/Route109_SeashoreHouse/scripts.inc +++ b/data/maps/Route109_SeashoreHouse/scripts.inc @@ -25,8 +25,7 @@ Route109_SeashoreHouse_EventScript_AlreadyGaveIntroduction:: Route109_SeashoreHouse_EventScript_DefeatedTrainers:: msgbox Route109_SeashoreHouse_Text_TakeTheseSodaPopBottles, MSGBOX_DEFAULT giveitem ITEM_SODA_POP, 6 - compare VAR_RESULT, FALSE - goto_if_eq Route109_SeashoreHouse_EventScript_BagFull + goto_if_eq VAR_RESULT, FALSE, Route109_SeashoreHouse_EventScript_BagFull setflag FLAG_RECEIVED_6_SODA_POP release end @@ -37,25 +36,22 @@ Route109_SeashoreHouse_EventScript_BagFull:: end Route109_SeashoreHouse_EventScript_AlreadyReceivedSodaPop:: - showmoneybox 0, 0, 0 + showmoneybox 0, 0 msgbox Route109_SeashoreHouse_Text_WantToBuySodaPop, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq Route109_SeashoreHouse_EventScript_BuySodaPop + goto_if_eq VAR_RESULT, YES, Route109_SeashoreHouse_EventScript_BuySodaPop msgbox Route109_SeashoreHouse_Text_ThatsTooBad, MSGBOX_DEFAULT hidemoneybox release end Route109_SeashoreHouse_EventScript_BuySodaPop:: - checkmoney 300, 0 - compare VAR_RESULT, FALSE - goto_if_eq Route109_SeashoreHouse_EventScript_NotEnoughMoney - checkitemspace ITEM_SODA_POP, 1 - compare VAR_RESULT, FALSE - goto_if_eq Route109_SeashoreHouse_EventScript_NotEnoughSpace + checkmoney 300 + goto_if_eq VAR_RESULT, FALSE, Route109_SeashoreHouse_EventScript_NotEnoughMoney + checkitemspace ITEM_SODA_POP + goto_if_eq VAR_RESULT, FALSE, Route109_SeashoreHouse_EventScript_NotEnoughSpace msgbox Route109_SeashoreHouse_Text_HereYouGo, MSGBOX_DEFAULT - removemoney 300, 0 - updatemoneybox 0, 0 + removemoney 300 + updatemoneybox giveitem ITEM_SODA_POP hidemoneybox release diff --git a/data/maps/Route110/scripts.inc b/data/maps/Route110/scripts.inc index abb42cc127e5..7d16c8b10c28 100644 --- a/data/maps/Route110/scripts.inc +++ b/data/maps/Route110/scripts.inc @@ -16,8 +16,7 @@ Route110_OnResume: Route110_OnTransition: call Common_EventScript_SetupRivalGfxId call Common_EventScript_SetupRivalOnBikeGfxId - compare VAR_CYCLING_CHALLENGE_STATE, 1 - call_if_eq Route110_EventScript_SaveCyclingMusic + call_if_eq VAR_CYCLING_CHALLENGE_STATE, 1, Route110_EventScript_SaveCyclingMusic end Route110_EventScript_SaveCyclingMusic:: @@ -136,8 +135,7 @@ Route110_EventScript_TrickHouseSign:: Route110_EventScript_CyclingRoadResultsSign:: lockall specialvar VAR_RESULT, GetRecordedCyclingRoadResults - compare VAR_RESULT, FALSE - goto_if_eq Route110_EventScript_NoRecordSet + goto_if_eq VAR_RESULT, FALSE, Route110_EventScript_NoRecordSet msgbox Route110_Text_BestRecord, MSGBOX_DEFAULT releaseall end @@ -151,10 +149,8 @@ Route110_EventScript_ChallengeGuy:: lock faceplayer specialvar VAR_RESULT, GetPlayerAvatarBike - compare VAR_RESULT, 1 - goto_if_eq Route110_EventScript_PlayerRidingAcroBike - compare VAR_CYCLING_CHALLENGE_STATE, 0 - goto_if_eq Route110_EventScript_PlayerNotRidingBike + goto_if_eq VAR_RESULT, 1, Route110_EventScript_PlayerRidingAcroBike + goto_if_eq VAR_CYCLING_CHALLENGE_STATE, 0, Route110_EventScript_PlayerNotRidingBike msgbox Route110_Text_AlwaysAimHigher, MSGBOX_DEFAULT release end @@ -182,8 +178,7 @@ Route110_EventScript_Jaclyn:: Route110_EventScript_Edwin:: trainerbattle_single TRAINER_EDWIN_1, Route110_Text_EdwinIntro, Route110_Text_EdwinDefeated, Route110_EventScript_EdwinRegisterMatchCallAfterBattle specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq Route110_EventScript_EdwinRematch + goto_if_eq VAR_RESULT, TRUE, Route110_EventScript_EdwinRematch msgbox Route110_Text_EdwinPostBattle, MSGBOX_DEFAULT release end @@ -219,8 +214,7 @@ Route110_EventScript_Anthony:: Route110_EventScript_Benjamin:: trainerbattle_single TRAINER_BENJAMIN_1, Route110_Text_BenjaminIntro, Route110_Text_BenjaminDefeated, Route110_EventScript_BenjaminRegisterMatchCallAfterBattle specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq Route110_EventScript_BenjaminRematch + goto_if_eq VAR_RESULT, TRUE, Route110_EventScript_BenjaminRematch msgbox Route110_Text_BenjaminPostBattle, MSGBOX_DEFAULT release end @@ -246,8 +240,7 @@ Route110_EventScript_Jasmine:: Route110_EventScript_Abigail:: trainerbattle_single TRAINER_ABIGAIL_1, Route110_Text_AbigailIntro, Route110_Text_AbigailDefeated, Route110_EventScript_AbigailRegisterMatchCallAfterBattle specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq Route110_EventScript_AbigailRematch + goto_if_eq VAR_RESULT, TRUE, Route110_EventScript_AbigailRematch msgbox Route110_Text_AbigailPostBattle, MSGBOX_DEFAULT release end @@ -268,8 +261,7 @@ Route110_EventScript_AbigailRematch:: Route110_EventScript_Isabel:: trainerbattle_single TRAINER_ISABEL_1, Route110_Text_IsabelIntro, Route110_Text_IsabelDefeated, Route110_EventScript_IsabelRegisterMatchCallAfterBattle specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq Route110_EventScript_IsabelRematch + goto_if_eq VAR_RESULT, TRUE, Route110_EventScript_IsabelRematch msgbox Route110_Text_IsabelPostBattle, MSGBOX_DEFAULT release end @@ -384,10 +376,8 @@ Route110_EventScript_RivalTrigger3:: Route110_EventScript_RivalScene:: lockall checkplayergender - compare VAR_RESULT, MALE - call_if_eq Route110_EventScript_PlayMayMusic - compare VAR_RESULT, FEMALE - call_if_eq Route110_EventScript_PlayBrendanMusic + call_if_eq VAR_RESULT, MALE, Route110_EventScript_PlayMayMusic + call_if_eq VAR_RESULT, FEMALE, Route110_EventScript_PlayBrendanMusic applymovement LOCALID_RIVAL, Common_Movement_WalkInPlaceFasterDown waitmovement 0 applymovement LOCALID_RIVAL, Common_Movement_ExclamationMark @@ -395,17 +385,12 @@ Route110_EventScript_RivalScene:: applymovement LOCALID_RIVAL, Common_Movement_Delay48 waitmovement 0 delay 30 - compare VAR_0x8008, 1 - call_if_eq Route110_EventScript_RivalApproachPlayer1 - compare VAR_0x8008, 2 - call_if_eq Route110_EventScript_RivalApproachPlayer2 - compare VAR_0x8008, 3 - call_if_eq Route110_EventScript_RivalApproachPlayer3 + call_if_eq VAR_0x8008, 1, Route110_EventScript_RivalApproachPlayer1 + call_if_eq VAR_0x8008, 2, Route110_EventScript_RivalApproachPlayer2 + call_if_eq VAR_0x8008, 3, Route110_EventScript_RivalApproachPlayer3 checkplayergender - compare VAR_RESULT, MALE - goto_if_eq Route110_EventScript_MayBattle - compare VAR_RESULT, FEMALE - goto_if_eq Route110_EventScript_BrendanBattle + goto_if_eq VAR_RESULT, MALE, Route110_EventScript_MayBattle + goto_if_eq VAR_RESULT, FEMALE, Route110_EventScript_BrendanBattle releaseall end @@ -483,23 +468,17 @@ Route110_EventScript_GiveItemfinder:: Route110_EventScript_RivalExit:: closemessage - compare VAR_0x8008, 1 - call_if_eq Route110_EventScript_MoveRival1 - compare VAR_0x8008, 2 - call_if_eq Route110_EventScript_MoveRival2 - compare VAR_0x8008, 3 - call_if_eq Route110_EventScript_MoveRival3 + call_if_eq VAR_0x8008, 1, Route110_EventScript_MoveRival1 + call_if_eq VAR_0x8008, 2, Route110_EventScript_MoveRival2 + call_if_eq VAR_0x8008, 3, Route110_EventScript_MoveRival3 setobjectmovementtype LOCALID_RIVAL, MOVEMENT_TYPE_FACE_RIGHT setobjectmovementtype LOCALID_RIVAL_ON_BIKE, MOVEMENT_TYPE_FACE_RIGHT removeobject LOCALID_RIVAL addobject LOCALID_RIVAL_ON_BIKE delay 45 - compare VAR_0x8008, 1 - call_if_eq Route110_EventScript_RivalExit1 - compare VAR_0x8008, 2 - call_if_eq Route110_EventScript_RivalExit2 - compare VAR_0x8008, 3 - call_if_eq Route110_EventScript_RivalExit3 + call_if_eq VAR_0x8008, 1, Route110_EventScript_RivalExit1 + call_if_eq VAR_0x8008, 2, Route110_EventScript_RivalExit2 + call_if_eq VAR_0x8008, 3, Route110_EventScript_RivalExit3 removeobject LOCALID_RIVAL_ON_BIKE setvar VAR_ROUTE110_STATE, 1 savebgm MUS_DUMMY @@ -625,14 +604,10 @@ Route110_EventScript_BirchScene:: waitmovement 0 applymovement LOCALID_BIRCH, Common_Movement_Delay48 waitmovement 0 - compare VAR_0x8008, 1 - call_if_eq Route110_EventScript_BirchApproachPlayer1 - compare VAR_0x8008, 2 - call_if_eq Route110_EventScript_BirchApproachPlayer2 - compare VAR_0x8008, 3 - call_if_eq Route110_EventScript_BirchApproachPlayer3 - compare VAR_0x8008, 4 - call_if_eq Route110_EventScript_BirchApproachPlayer4 + call_if_eq VAR_0x8008, 1, Route110_EventScript_BirchApproachPlayer1 + call_if_eq VAR_0x8008, 2, Route110_EventScript_BirchApproachPlayer2 + call_if_eq VAR_0x8008, 3, Route110_EventScript_BirchApproachPlayer3 + call_if_eq VAR_0x8008, 4, Route110_EventScript_BirchApproachPlayer4 msgbox Route110_Text_ImagineSeeingYouHere, MSGBOX_DEFAULT closemessage delay 20 @@ -656,14 +631,10 @@ Route110_EventScript_BirchScene:: setflag FLAG_ENABLE_PROF_BIRCH_MATCH_CALL msgbox Route110_Text_KeepAnEyeOutForRival, MSGBOX_DEFAULT closemessage - compare VAR_0x8008, 1 - call_if_eq Route110_EventScript_BirchExit1 - compare VAR_0x8008, 2 - call_if_eq Route110_EventScript_BirchExit2 - compare VAR_0x8008, 3 - call_if_eq Route110_EventScript_BirchExit3 - compare VAR_0x8008, 4 - call_if_eq Route110_EventScript_BirchExit4 + call_if_eq VAR_0x8008, 1, Route110_EventScript_BirchExit1 + call_if_eq VAR_0x8008, 2, Route110_EventScript_BirchExit2 + call_if_eq VAR_0x8008, 3, Route110_EventScript_BirchExit3 + call_if_eq VAR_0x8008, 4, Route110_EventScript_BirchExit4 removeobject LOCALID_BIRCH setvar VAR_REGISTER_BIRCH_STATE, 2 releaseall diff --git a/data/maps/Route110_SeasideCyclingRoadNorthEntrance/scripts.inc b/data/maps/Route110_SeasideCyclingRoadNorthEntrance/scripts.inc index 4bad754c4dca..5eb1f3dea2a2 100644 --- a/data/maps/Route110_SeasideCyclingRoadNorthEntrance/scripts.inc +++ b/data/maps/Route110_SeasideCyclingRoadNorthEntrance/scripts.inc @@ -11,8 +11,7 @@ Route110_SeasideCyclingRoadNorthEntrance_EventScript_Clerk:: Route110_SeasideCyclingRoadNorthEntrance_EventScript_BikeCheck:: lockall specialvar VAR_RESULT, GetPlayerAvatarBike - compare VAR_RESULT, 0 - goto_if_eq Route110_SeasideCyclingRoadNorthEntrance_EventScript_NoBike + goto_if_eq VAR_RESULT, 0, Route110_SeasideCyclingRoadNorthEntrance_EventScript_NoBike setflag FLAG_SYS_CYCLING_ROAD setvar VAR_TEMP_1, 1 releaseall diff --git a/data/maps/Route110_SeasideCyclingRoadSouthEntrance/scripts.inc b/data/maps/Route110_SeasideCyclingRoadSouthEntrance/scripts.inc index 92b4b3e44c19..df53f55ccf17 100644 --- a/data/maps/Route110_SeasideCyclingRoadSouthEntrance/scripts.inc +++ b/data/maps/Route110_SeasideCyclingRoadSouthEntrance/scripts.inc @@ -3,10 +3,8 @@ Route110_SeasideCyclingRoadSouthEntrance_MapScripts:: .byte 0 Route110_SeasideCyclingRoadSouthEntrance_OnTransition: - compare VAR_CYCLING_CHALLENGE_STATE, 3 - call_if_eq Route110_SeasideCyclingRoadSouthEntrance_EventScript_RestartChallenge - compare VAR_CYCLING_CHALLENGE_STATE, 2 - call_if_eq Route110_SeasideCyclingRoadSouthEntrance_EventScript_RestartChallenge + call_if_eq VAR_CYCLING_CHALLENGE_STATE, 3, Route110_SeasideCyclingRoadSouthEntrance_EventScript_RestartChallenge + call_if_eq VAR_CYCLING_CHALLENGE_STATE, 2, Route110_SeasideCyclingRoadSouthEntrance_EventScript_RestartChallenge end Route110_SeasideCyclingRoadSouthEntrance_EventScript_RestartChallenge:: @@ -23,10 +21,8 @@ Route110_SeasideCyclingRoadSouthEntrance_EventScript_Clerk:: Route110_SeasideCyclingRoadSouthEntrance_EventScript_BikeCheck:: lockall specialvar VAR_RESULT, GetPlayerAvatarBike - compare VAR_RESULT, 2 - call_if_eq Route110_SeasideCyclingRoadSouthEntrance_EventScript_OnMachBike - compare VAR_RESULT, 0 - goto_if_eq Route110_SeasideCyclingRoadSouthEntrance_EventScript_NoBike + call_if_eq VAR_RESULT, 2, Route110_SeasideCyclingRoadSouthEntrance_EventScript_OnMachBike + goto_if_eq VAR_RESULT, 0, Route110_SeasideCyclingRoadSouthEntrance_EventScript_NoBike setflag FLAG_SYS_CYCLING_ROAD setvar VAR_TEMP_1, 1 releaseall diff --git a/data/maps/Route110_TrickHouseEnd/scripts.inc b/data/maps/Route110_TrickHouseEnd/scripts.inc index f30d74f01c81..be8f75e961ea 100644 --- a/data/maps/Route110_TrickHouseEnd/scripts.inc +++ b/data/maps/Route110_TrickHouseEnd/scripts.inc @@ -8,8 +8,7 @@ Route110_TrickHouseEnd_MapScripts:: .byte 0 Route110_TrickHouseEnd_OnResume: - compare VAR_TEMP_1, 1 - call_if_eq Route110_TrickHouseEnd_EventScript_SetDoorClosedMetatile + call_if_eq VAR_TEMP_1, 1, Route110_TrickHouseEnd_EventScript_SetDoorClosedMetatile end Route110_TrickHouseEnd_OnTransition: @@ -39,7 +38,7 @@ Route110_TrickHouseEnd_EventScript_CloseDoor:: end Route110_TrickHouseEnd_EventScript_SetDoorClosedMetatile:: - setmetatile 10, 1, METATILE_GenericBuilding_TrickHouse_Door_Closed, 1 + setmetatile 10, 1, METATILE_GenericBuilding_TrickHouse_Door_Closed, TRUE return Route110_TrickHouseEnd_EventScript_TrickMaster:: @@ -63,8 +62,7 @@ Route110_TrickHouseEnd_EventScript_CompletedPuzzle1:: msgbox Route110_TrickHouseEnd_Text_YouHaveEarnedThisReward, MSGBOX_DEFAULT setvar VAR_TRICK_HOUSE_PRIZE_PICKUP, 0 giveitem ITEM_RARE_CANDY - compare VAR_RESULT, FALSE - call_if_eq Route110_TrickHouseEnd_EventScript_BagFull + call_if_eq VAR_RESULT, FALSE, Route110_TrickHouseEnd_EventScript_BagFull msgbox Route110_TrickHouseEnd_Text_MakeNewTricksToStumpYou, MSGBOX_DEFAULT closemessage call Route110_TrickHouseEnd_EventScript_TrickMasterExit @@ -76,8 +74,7 @@ Route110_TrickHouseEnd_EventScript_CompletedPuzzle2:: msgbox Route110_TrickHouseEnd_Text_YouHaveEarnedThisReward, MSGBOX_DEFAULT setvar VAR_TRICK_HOUSE_PRIZE_PICKUP, 0 giveitem ITEM_TIMER_BALL - compare VAR_RESULT, FALSE - call_if_eq Route110_TrickHouseEnd_EventScript_BagFull + call_if_eq VAR_RESULT, FALSE, Route110_TrickHouseEnd_EventScript_BagFull msgbox Route110_TrickHouseEnd_Text_MakeNewTricksToStumpYou, MSGBOX_DEFAULT closemessage call Route110_TrickHouseEnd_EventScript_TrickMasterExit @@ -89,8 +86,7 @@ Route110_TrickHouseEnd_EventScript_CompletedPuzzle3:: msgbox Route110_TrickHouseEnd_Text_YouHaveEarnedThisReward, MSGBOX_DEFAULT setvar VAR_TRICK_HOUSE_PRIZE_PICKUP, 0 giveitem ITEM_HARD_STONE - compare VAR_RESULT, FALSE - call_if_eq Route110_TrickHouseEnd_EventScript_BagFull + call_if_eq VAR_RESULT, FALSE, Route110_TrickHouseEnd_EventScript_BagFull msgbox Route110_TrickHouseEnd_Text_MakeNewTricksToStumpYou, MSGBOX_DEFAULT closemessage call Route110_TrickHouseEnd_EventScript_TrickMasterExit @@ -102,8 +98,7 @@ Route110_TrickHouseEnd_EventScript_CompletedPuzzle4:: msgbox Route110_TrickHouseEnd_Text_YouHaveEarnedThisReward, MSGBOX_DEFAULT setvar VAR_TRICK_HOUSE_PRIZE_PICKUP, 0 giveitem ITEM_SMOKE_BALL - compare VAR_RESULT, FALSE - call_if_eq Route110_TrickHouseEnd_EventScript_BagFull + call_if_eq VAR_RESULT, FALSE, Route110_TrickHouseEnd_EventScript_BagFull msgbox Route110_TrickHouseEnd_Text_MakeNewTricksToStumpYou, MSGBOX_DEFAULT closemessage call Route110_TrickHouseEnd_EventScript_TrickMasterExit @@ -115,8 +110,7 @@ Route110_TrickHouseEnd_EventScript_CompletedPuzzle5:: msgbox Route110_TrickHouseEnd_Text_YouHaveEarnedThisReward, MSGBOX_DEFAULT setvar VAR_TRICK_HOUSE_PRIZE_PICKUP, 0 giveitem ITEM_TM12 - compare VAR_RESULT, FALSE - call_if_eq Route110_TrickHouseEnd_EventScript_BagFull + call_if_eq VAR_RESULT, FALSE, Route110_TrickHouseEnd_EventScript_BagFull msgbox Route110_TrickHouseEnd_Text_MakeNewTricksToStumpYou, MSGBOX_DEFAULT closemessage call Route110_TrickHouseEnd_EventScript_TrickMasterExit @@ -128,8 +122,7 @@ Route110_TrickHouseEnd_EventScript_CompletedPuzzle6:: msgbox Route110_TrickHouseEnd_Text_YouHaveEarnedThisReward, MSGBOX_DEFAULT setvar VAR_TRICK_HOUSE_PRIZE_PICKUP, 0 giveitem ITEM_MAGNET - compare VAR_RESULT, FALSE - call_if_eq Route110_TrickHouseEnd_EventScript_BagFull + call_if_eq VAR_RESULT, FALSE, Route110_TrickHouseEnd_EventScript_BagFull msgbox Route110_TrickHouseEnd_Text_MakeNewTricksToStumpYou, MSGBOX_DEFAULT closemessage call Route110_TrickHouseEnd_EventScript_TrickMasterExit @@ -141,8 +134,7 @@ Route110_TrickHouseEnd_EventScript_CompletedPuzzle7:: msgbox Route110_TrickHouseEnd_Text_YouHaveEarnedThisReward, MSGBOX_DEFAULT setvar VAR_TRICK_HOUSE_PRIZE_PICKUP, 0 giveitem ITEM_PP_MAX - compare VAR_RESULT, FALSE - call_if_eq Route110_TrickHouseEnd_EventScript_BagFull + call_if_eq VAR_RESULT, FALSE, Route110_TrickHouseEnd_EventScript_BagFull msgbox Route110_TrickHouseEnd_Text_MakeNewTricksToStumpYou, MSGBOX_DEFAULT closemessage call Route110_TrickHouseEnd_EventScript_TrickMasterExit @@ -152,14 +144,10 @@ Route110_TrickHouseEnd_EventScript_CompletedPuzzle7:: Route110_TrickHouseEnd_EventScript_CompletedPuzzle8:: msgbox Route110_TrickHouseEnd_Text_AllNightPolishingFloors, MSGBOX_DEFAULT closemessage - compare VAR_FACING, DIR_SOUTH - call_if_eq Route110_TrickHouseEnd_EventScript_TrickMasterFaceAwaySouth - compare VAR_FACING, DIR_NORTH - call_if_eq Route110_TrickHouseEnd_EventScript_TrickMasterFaceAwayNorth - compare VAR_FACING, DIR_WEST - call_if_eq Route110_TrickHouseEnd_EventScript_TrickMasterFaceAwayWest - compare VAR_FACING, DIR_EAST - call_if_eq Route110_TrickHouseEnd_EventScript_TrickMasterFaceAwayEast + call_if_eq VAR_FACING, DIR_SOUTH, Route110_TrickHouseEnd_EventScript_TrickMasterFaceAwaySouth + call_if_eq VAR_FACING, DIR_NORTH, Route110_TrickHouseEnd_EventScript_TrickMasterFaceAwayNorth + call_if_eq VAR_FACING, DIR_WEST, Route110_TrickHouseEnd_EventScript_TrickMasterFaceAwayWest + call_if_eq VAR_FACING, DIR_EAST, Route110_TrickHouseEnd_EventScript_TrickMasterFaceAwayEast delay 30 msgbox Route110_TrickHouseEnd_Text_FountainOfIdeasRunDry, MSGBOX_DEFAULT closemessage @@ -169,8 +157,7 @@ Route110_TrickHouseEnd_EventScript_CompletedPuzzle8:: msgbox Route110_TrickHouseEnd_Text_DefeatedMePreferWhichTent, MSGBOX_DEFAULT setvar VAR_TRICK_HOUSE_PRIZE_PICKUP, 0 call Route110_TrickHouseEnd_EventScript_ChooseTent - compare VAR_RESULT, FALSE - call_if_eq Route110_TrickHouseEnd_EventScript_NoRoomForTent + call_if_eq VAR_RESULT, FALSE, Route110_TrickHouseEnd_EventScript_NoRoomForTent msgbox Route110_TrickHouseEnd_Text_LeavingOnJourney, MSGBOX_DEFAULT call Route110_TrickHouseEnd_EventScript_TrickMasterExit special ResetTrickHouseNuggetFlag diff --git a/data/maps/Route110_TrickHouseEntrance/scripts.inc b/data/maps/Route110_TrickHouseEntrance/scripts.inc index e756feadca51..44dda8c5c164 100644 --- a/data/maps/Route110_TrickHouseEntrance/scripts.inc +++ b/data/maps/Route110_TrickHouseEntrance/scripts.inc @@ -17,18 +17,12 @@ Route110_TrickHouseEntrance_MapScripts:: Route110_TrickHouseEntrance_OnTransition: setflag FLAG_LANDMARK_TRICK_HOUSE - compare VAR_TRICK_HOUSE_ENTER_FROM_CORRIDOR, 1 - goto_if_eq Route110_TrickHouseEntrance_EventScript_EnterFromCorridor - compare VAR_TRICK_HOUSE_PRIZE_PICKUP, 1 - goto_if_eq Route110_TrickHouseEntrance_EventScript_SetReadyToGiveReward - compare VAR_TRICK_HOUSE_FOUND_TRICK_MASTER, 1 - goto_if_eq Route110_TrickHouseEntrance_EventScript_MoveTrickMasterToDoor - compare VAR_TRICK_HOUSE_ENTRANCE_STATE, 5 - call_if_eq Route110_TrickHouseEntrance_EventScript_CheckReadyForNextPuzzle - compare VAR_TRICK_HOUSE_ENTRANCE_STATE, 3 - call_if_eq Route110_TrickHouseEntrance_EventScript_CheckReadyForNextPuzzle - compare VAR_TRICK_HOUSE_ENTRANCE_STATE, 0 - call_if_eq Route110_TrickHouseEntrance_EventScript_CheckReadyForNextPuzzle + goto_if_eq VAR_TRICK_HOUSE_ENTER_FROM_CORRIDOR, 1, Route110_TrickHouseEntrance_EventScript_EnterFromCorridor + goto_if_eq VAR_TRICK_HOUSE_PRIZE_PICKUP, 1, Route110_TrickHouseEntrance_EventScript_SetReadyToGiveReward + goto_if_eq VAR_TRICK_HOUSE_FOUND_TRICK_MASTER, 1, Route110_TrickHouseEntrance_EventScript_MoveTrickMasterToDoor + call_if_eq VAR_TRICK_HOUSE_ENTRANCE_STATE, 5, Route110_TrickHouseEntrance_EventScript_CheckReadyForNextPuzzle + call_if_eq VAR_TRICK_HOUSE_ENTRANCE_STATE, 3, Route110_TrickHouseEntrance_EventScript_CheckReadyForNextPuzzle + call_if_eq VAR_TRICK_HOUSE_ENTRANCE_STATE, 0, Route110_TrickHouseEntrance_EventScript_CheckReadyForNextPuzzle switch VAR_TRICK_HOUSE_ENTRANCE_STATE case 0, Route110_TrickHouseEntrance_EventScript_ReadyBeingWatchedTrigger case 1, Route110_TrickHouseEntrance_EventScript_SetNotBeingWatched1 @@ -38,8 +32,7 @@ Route110_TrickHouseEntrance_OnTransition: Route110_TrickHouseEntrance_EventScript_SetReadyToGiveReward:: setvar VAR_TRICK_HOUSE_BEING_WATCHED_STATE, 1 - compare VAR_TRICK_HOUSE_LEVEL, 8 - goto_if_eq Route110_TrickHouseEntrance_EventScript_ReadyToGiveTentReward + goto_if_eq VAR_TRICK_HOUSE_LEVEL, 8, Route110_TrickHouseEntrance_EventScript_ReadyToGiveTentReward setvar VAR_TRICK_HOUSE_ENTRANCE_STATE, 2 end @@ -55,22 +48,14 @@ Route110_TrickHouseEntrance_EventScript_EnterFromCorridor:: Route110_TrickHouseEntrance_EventScript_CheckReadyForNextPuzzle:: setvar VAR_TRICK_HOUSE_ENTRANCE_STATE, 0 - compare VAR_TRICK_HOUSE_LEVEL, 1 - call_if_eq Route110_TrickHouseEntrance_EventScript_CheckReadyForPuzzle2 - compare VAR_TRICK_HOUSE_LEVEL, 2 - call_if_eq Route110_TrickHouseEntrance_EventScript_CheckReadyForPuzzle3 - compare VAR_TRICK_HOUSE_LEVEL, 3 - call_if_eq Route110_TrickHouseEntrance_EventScript_CheckReadyForPuzzle4 - compare VAR_TRICK_HOUSE_LEVEL, 4 - call_if_eq Route110_TrickHouseEntrance_EventScript_CheckReadyForPuzzle5 - compare VAR_TRICK_HOUSE_LEVEL, 5 - call_if_eq Route110_TrickHouseEntrance_EventScript_CheckReadyForPuzzle6 - compare VAR_TRICK_HOUSE_LEVEL, 6 - call_if_eq Route110_TrickHouseEntrance_EventScript_CheckReadyForPuzzle7 - compare VAR_TRICK_HOUSE_LEVEL, 7 - call_if_eq Route110_TrickHouseEntrance_EventScript_CheckReadyForPuzzle8 - compare VAR_TRICK_HOUSE_LEVEL, 8 - call_if_eq Route110_TrickHouseEntrance_EventScript_FinishedPuzzles + call_if_eq VAR_TRICK_HOUSE_LEVEL, 1, Route110_TrickHouseEntrance_EventScript_CheckReadyForPuzzle2 + call_if_eq VAR_TRICK_HOUSE_LEVEL, 2, Route110_TrickHouseEntrance_EventScript_CheckReadyForPuzzle3 + call_if_eq VAR_TRICK_HOUSE_LEVEL, 3, Route110_TrickHouseEntrance_EventScript_CheckReadyForPuzzle4 + call_if_eq VAR_TRICK_HOUSE_LEVEL, 4, Route110_TrickHouseEntrance_EventScript_CheckReadyForPuzzle5 + call_if_eq VAR_TRICK_HOUSE_LEVEL, 5, Route110_TrickHouseEntrance_EventScript_CheckReadyForPuzzle6 + call_if_eq VAR_TRICK_HOUSE_LEVEL, 6, Route110_TrickHouseEntrance_EventScript_CheckReadyForPuzzle7 + call_if_eq VAR_TRICK_HOUSE_LEVEL, 7, Route110_TrickHouseEntrance_EventScript_CheckReadyForPuzzle8 + call_if_eq VAR_TRICK_HOUSE_LEVEL, 8, Route110_TrickHouseEntrance_EventScript_FinishedPuzzles return Route110_TrickHouseEntrance_EventScript_CheckReadyForPuzzle2:: @@ -216,8 +201,7 @@ Route110_TrickHouseEntrance_OnFrame: Route110_TrickHouseEntrance_EventScript_BeginChallenge:: lockall delay 20 - compare VAR_TRICK_HOUSE_LEVEL, 0 - call_if_eq Route110_TrickHouseEntrance_EventScript_MeetTrickMaster + call_if_eq VAR_TRICK_HOUSE_LEVEL, 0, Route110_TrickHouseEntrance_EventScript_MeetTrickMaster msgbox Route110_TrickHouseEntrance_Text_ComeToChallengeTrickHouse, MSGBOX_DEFAULT closemessage delay 20 @@ -251,25 +235,17 @@ Route110_TrickHouseEntrance_EventScript_FoundTrickMaster:: waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_Delay48 waitmovement 0 - compare VAR_TRICK_HOUSE_LEVEL, 0 - call_if_eq Route110_TrickHouseEntrance_EventScript_FoundBeneathDesk - compare VAR_TRICK_HOUSE_LEVEL, 1 - call_if_eq Route110_TrickHouseEntrance_EventScript_FoundBehindTree - compare VAR_TRICK_HOUSE_LEVEL, 2 - call_if_eq Route110_TrickHouseEntrance_EventScript_FoundInDresser - compare VAR_TRICK_HOUSE_LEVEL, 3 - call_if_eq Route110_TrickHouseEntrance_EventScript_FoundBeyondWindow - compare VAR_TRICK_HOUSE_LEVEL, 4 - call_if_eq Route110_TrickHouseEntrance_EventScript_FoundInPlanter - compare VAR_TRICK_HOUSE_LEVEL, 5 - call_if_eq Route110_TrickHouseEntrance_EventScript_FoundInCupboard - compare VAR_TRICK_HOUSE_LEVEL, 6 - call_if_eq Route110_TrickHouseEntrance_EventScript_FoundBehindWindow - compare VAR_TRICK_HOUSE_LEVEL, 7 - call_if_eq Route110_TrickHouseEntrance_EventScript_FoundBeneathCushion + call_if_eq VAR_TRICK_HOUSE_LEVEL, 0, Route110_TrickHouseEntrance_EventScript_FoundBeneathDesk + call_if_eq VAR_TRICK_HOUSE_LEVEL, 1, Route110_TrickHouseEntrance_EventScript_FoundBehindTree + call_if_eq VAR_TRICK_HOUSE_LEVEL, 2, Route110_TrickHouseEntrance_EventScript_FoundInDresser + call_if_eq VAR_TRICK_HOUSE_LEVEL, 3, Route110_TrickHouseEntrance_EventScript_FoundBeyondWindow + call_if_eq VAR_TRICK_HOUSE_LEVEL, 4, Route110_TrickHouseEntrance_EventScript_FoundInPlanter + call_if_eq VAR_TRICK_HOUSE_LEVEL, 5, Route110_TrickHouseEntrance_EventScript_FoundInCupboard + call_if_eq VAR_TRICK_HOUSE_LEVEL, 6, Route110_TrickHouseEntrance_EventScript_FoundBehindWindow + call_if_eq VAR_TRICK_HOUSE_LEVEL, 7, Route110_TrickHouseEntrance_EventScript_FoundBeneathCushion closemessage setvar VAR_TRICK_HOUSE_FOUND_TRICK_MASTER, 1 - warpsilent MAP_ROUTE110_TRICK_HOUSE_ENTRANCE, 255, 6, 2 + warpsilent MAP_ROUTE110_TRICK_HOUSE_ENTRANCE, 6, 2 waitstate releaseall end @@ -352,88 +328,67 @@ Route110_TrickHouseEntrance_EventScript_GiveReward:: applymovement LOCALID_TRICK_MASTER, Common_Movement_FacePlayer waitmovement 0 msgbox Route110_TrickHouseEntrance_Text_YoureHereToAcceptReward, MSGBOX_DEFAULT - compare VAR_TRICK_HOUSE_LEVEL, 1 - goto_if_eq Route110_TrickHouseEntrance_EventScript_GivePuzzle1Reward - compare VAR_TRICK_HOUSE_LEVEL, 2 - goto_if_eq Route110_TrickHouseEntrance_EventScript_GivePuzzle2Reward - compare VAR_TRICK_HOUSE_LEVEL, 3 - goto_if_eq Route110_TrickHouseEntrance_EventScript_GivePuzzle3Reward - compare VAR_TRICK_HOUSE_LEVEL, 4 - goto_if_eq Route110_TrickHouseEntrance_EventScript_GivePuzzle4Reward - compare VAR_TRICK_HOUSE_LEVEL, 5 - goto_if_eq Route110_TrickHouseEntrance_EventScript_GivePuzzle5Reward - compare VAR_TRICK_HOUSE_LEVEL, 6 - goto_if_eq Route110_TrickHouseEntrance_EventScript_GivePuzzle6Reward - compare VAR_TRICK_HOUSE_LEVEL, 7 - goto_if_eq Route110_TrickHouseEntrance_EventScript_GivePuzzle7Reward + goto_if_eq VAR_TRICK_HOUSE_LEVEL, 1, Route110_TrickHouseEntrance_EventScript_GivePuzzle1Reward + goto_if_eq VAR_TRICK_HOUSE_LEVEL, 2, Route110_TrickHouseEntrance_EventScript_GivePuzzle2Reward + goto_if_eq VAR_TRICK_HOUSE_LEVEL, 3, Route110_TrickHouseEntrance_EventScript_GivePuzzle3Reward + goto_if_eq VAR_TRICK_HOUSE_LEVEL, 4, Route110_TrickHouseEntrance_EventScript_GivePuzzle4Reward + goto_if_eq VAR_TRICK_HOUSE_LEVEL, 5, Route110_TrickHouseEntrance_EventScript_GivePuzzle5Reward + goto_if_eq VAR_TRICK_HOUSE_LEVEL, 6, Route110_TrickHouseEntrance_EventScript_GivePuzzle6Reward + goto_if_eq VAR_TRICK_HOUSE_LEVEL, 7, Route110_TrickHouseEntrance_EventScript_GivePuzzle7Reward end Route110_TrickHouseEntrance_EventScript_GivePuzzle1Reward:: giveitem ITEM_RARE_CANDY - compare VAR_RESULT, TRUE - goto_if_eq Route110_TrickHouseEntrance_EventScript_GotReward - compare VAR_RESULT, FALSE - call_if_eq Common_EventScript_BagIsFull + goto_if_eq VAR_RESULT, TRUE, Route110_TrickHouseEntrance_EventScript_GotReward + call_if_eq VAR_RESULT, FALSE, Common_EventScript_BagIsFull msgbox Route110_TrickHouseEntrance_Text_DidYouNotComeToClaimReward, MSGBOX_DEFAULT releaseall end Route110_TrickHouseEntrance_EventScript_GivePuzzle2Reward:: giveitem ITEM_TIMER_BALL - compare VAR_RESULT, TRUE - goto_if_eq Route110_TrickHouseEntrance_EventScript_GotReward - compare VAR_RESULT, FALSE - call_if_eq Common_EventScript_BagIsFull + goto_if_eq VAR_RESULT, TRUE, Route110_TrickHouseEntrance_EventScript_GotReward + call_if_eq VAR_RESULT, FALSE, Common_EventScript_BagIsFull msgbox Route110_TrickHouseEntrance_Text_DidYouNotComeToClaimReward, MSGBOX_DEFAULT releaseall end Route110_TrickHouseEntrance_EventScript_GivePuzzle3Reward:: giveitem ITEM_HARD_STONE - compare VAR_RESULT, TRUE - goto_if_eq Route110_TrickHouseEntrance_EventScript_GotReward - compare VAR_RESULT, FALSE - call_if_eq Common_EventScript_BagIsFull + goto_if_eq VAR_RESULT, TRUE, Route110_TrickHouseEntrance_EventScript_GotReward + call_if_eq VAR_RESULT, FALSE, Common_EventScript_BagIsFull msgbox Route110_TrickHouseEntrance_Text_DidYouNotComeToClaimReward, MSGBOX_DEFAULT releaseall end Route110_TrickHouseEntrance_EventScript_GivePuzzle4Reward:: giveitem ITEM_SMOKE_BALL - compare VAR_RESULT, TRUE - goto_if_eq Route110_TrickHouseEntrance_EventScript_GotReward - compare VAR_RESULT, FALSE - call_if_eq Common_EventScript_BagIsFull + goto_if_eq VAR_RESULT, TRUE, Route110_TrickHouseEntrance_EventScript_GotReward + call_if_eq VAR_RESULT, FALSE, Common_EventScript_BagIsFull msgbox Route110_TrickHouseEntrance_Text_DidYouNotComeToClaimReward, MSGBOX_DEFAULT releaseall end Route110_TrickHouseEntrance_EventScript_GivePuzzle5Reward:: giveitem ITEM_TM12 - compare VAR_RESULT, TRUE - goto_if_eq Route110_TrickHouseEntrance_EventScript_GotReward - compare VAR_RESULT, FALSE - call_if_eq Common_EventScript_BagIsFull + goto_if_eq VAR_RESULT, TRUE, Route110_TrickHouseEntrance_EventScript_GotReward + call_if_eq VAR_RESULT, FALSE, Common_EventScript_BagIsFull msgbox Route110_TrickHouseEntrance_Text_DidYouNotComeToClaimReward, MSGBOX_DEFAULT releaseall end Route110_TrickHouseEntrance_EventScript_GivePuzzle6Reward:: giveitem ITEM_MAGNET - compare VAR_RESULT, TRUE - goto_if_eq Route110_TrickHouseEntrance_EventScript_GotReward - compare VAR_RESULT, FALSE - call_if_eq Common_EventScript_BagIsFull + goto_if_eq VAR_RESULT, TRUE, Route110_TrickHouseEntrance_EventScript_GotReward + call_if_eq VAR_RESULT, FALSE, Common_EventScript_BagIsFull msgbox Route110_TrickHouseEntrance_Text_DidYouNotComeToClaimReward, MSGBOX_DEFAULT releaseall end Route110_TrickHouseEntrance_EventScript_GivePuzzle7Reward:: giveitem ITEM_PP_MAX - compare VAR_RESULT, TRUE - goto_if_eq Route110_TrickHouseEntrance_EventScript_GotReward - compare VAR_RESULT, FALSE - call_if_eq Common_EventScript_BagIsFull + goto_if_eq VAR_RESULT, TRUE, Route110_TrickHouseEntrance_EventScript_GotReward + call_if_eq VAR_RESULT, FALSE, Common_EventScript_BagIsFull msgbox Route110_TrickHouseEntrance_Text_DidYouNotComeToClaimReward, MSGBOX_DEFAULT releaseall end @@ -451,10 +406,8 @@ Route110_TrickHouseEntrance_EventScript_MechadollReward:: waitmovement 0 msgbox Route110_TrickHouseEntrance_Text_MechadollWhichTent, MSGBOX_DEFAULT call Route110_TrickHouseEntrance_EventScript_ChooseTent - compare VAR_RESULT, TRUE - goto_if_eq Route110_TrickHouseEntrance_EventScript_ReceivedTent - compare VAR_RESULT, FALSE - call_if_eq Common_EventScript_NoRoomForDecor + goto_if_eq VAR_RESULT, TRUE, Route110_TrickHouseEntrance_EventScript_ReceivedTent + call_if_eq VAR_RESULT, FALSE, Common_EventScript_NoRoomForDecor msgbox Route110_TrickHouseEntrance_Text_PCFullAgain, MSGBOX_DEFAULT releaseall end @@ -506,13 +459,12 @@ Route110_TrickHouseEntrance_EventScript_ItsAScroll:: Route110_TrickHouseEntrance_EventScript_GoInHolePrompt:: msgbox Route110_TrickHouseEntrance_Text_GoInHoleBehindScroll, MSGBOX_YESNO closemessage - compare VAR_RESULT, YES - goto_if_eq Route110_TrickHouseEntrance_EventScript_EnterPuzzleRoom + goto_if_eq VAR_RESULT, YES, Route110_TrickHouseEntrance_EventScript_EnterPuzzleRoom releaseall end Route110_TrickHouseEntrance_EventScript_EnterPuzzleRoom:: - setmetatile 5, 1, METATILE_GenericBuilding_TrickHouse_Stairs_Down, 0 + setmetatile 5, 1, METATILE_GenericBuilding_TrickHouse_Stairs_Down, FALSE special DrawWholeMapView delay 20 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkUp @@ -535,49 +487,49 @@ Route110_TrickHouseEntrance_Movement_EnterRoom: step_end Route110_TrickHouseEntrance_EventScript_EnterPuzzleRoom1:: - warp MAP_ROUTE110_TRICK_HOUSE_PUZZLE1, 255, 0, 21 + warp MAP_ROUTE110_TRICK_HOUSE_PUZZLE1, 0, 21 waitstate releaseall end Route110_TrickHouseEntrance_EventScript_EnterPuzzleRoom2:: - warp MAP_ROUTE110_TRICK_HOUSE_PUZZLE2, 255, 0, 21 + warp MAP_ROUTE110_TRICK_HOUSE_PUZZLE2, 0, 21 waitstate releaseall end Route110_TrickHouseEntrance_EventScript_EnterPuzzleRoom3:: - warp MAP_ROUTE110_TRICK_HOUSE_PUZZLE3, 255, 0, 21 + warp MAP_ROUTE110_TRICK_HOUSE_PUZZLE3, 0, 21 waitstate releaseall end Route110_TrickHouseEntrance_EventScript_EnterPuzzleRoom4:: - warp MAP_ROUTE110_TRICK_HOUSE_PUZZLE4, 255, 0, 21 + warp MAP_ROUTE110_TRICK_HOUSE_PUZZLE4, 0, 21 waitstate releaseall end Route110_TrickHouseEntrance_EventScript_EnterPuzzleRoom5:: - warp MAP_ROUTE110_TRICK_HOUSE_PUZZLE5, 255, 0, 21 + warp MAP_ROUTE110_TRICK_HOUSE_PUZZLE5, 0, 21 waitstate releaseall end Route110_TrickHouseEntrance_EventScript_EnterPuzzleRoom6:: - warp MAP_ROUTE110_TRICK_HOUSE_PUZZLE6, 255, 0, 21 + warp MAP_ROUTE110_TRICK_HOUSE_PUZZLE6, 0, 21 waitstate releaseall end Route110_TrickHouseEntrance_EventScript_EnterPuzzleRoom7:: - warp MAP_ROUTE110_TRICK_HOUSE_PUZZLE7, 255, 0, 21 + warp MAP_ROUTE110_TRICK_HOUSE_PUZZLE7, 0, 21 waitstate releaseall end Route110_TrickHouseEntrance_EventScript_EnterPuzzleRoom8:: - warp MAP_ROUTE110_TRICK_HOUSE_PUZZLE8, 255, 0, 21 + warp MAP_ROUTE110_TRICK_HOUSE_PUZZLE8, 0, 21 waitstate releaseall end @@ -588,8 +540,7 @@ Route110_TrickHouseEntrance_EventScript_LeftOnJourneyNote:: end Route110_TrickHouseEntrance_EventScript_CheckLevelForMessage:: - compare VAR_TRICK_HOUSE_LEVEL, 8 - goto_if_eq Route110_TrickHouseEntrance_EventScript_LeftOnJourneyNote2 + goto_if_eq VAR_TRICK_HOUSE_LEVEL, 8, Route110_TrickHouseEntrance_EventScript_LeftOnJourneyNote2 msgbox Route110_TrickHouseEntrance_Text_ItsAScroll, MSGBOX_DEFAULT releaseall end @@ -613,89 +564,81 @@ Route110_TrickHousePuzzle_EventScript_Door:: end Route110_TrickHousePuzzle1_EventScript_Door:: - compare VAR_TRICK_HOUSE_PUZZLE_1_STATE, 0 - goto_if_eq Route110_TrickHousePuzzle_EventScript_DoorLocked + goto_if_eq VAR_TRICK_HOUSE_PUZZLE_1_STATE, 0, Route110_TrickHousePuzzle_EventScript_DoorLocked msgbox Route110_TrickHousePuzzle1_Text_WroteSecretCodeLockOpened, MSGBOX_DEFAULT playse SE_PIN setvar VAR_TRICK_HOUSE_PUZZLE_1_STATE, 2 - setmetatile 13, 1, METATILE_TrickHousePuzzle_Stairs_Down, 0 + setmetatile 13, 1, METATILE_TrickHousePuzzle_Stairs_Down, FALSE special DrawWholeMapView releaseall end Route110_TrickHousePuzzle2_EventScript_Door:: - compare VAR_TRICK_HOUSE_PUZZLE_2_STATE, 0 - goto_if_eq Route110_TrickHousePuzzle_EventScript_DoorLocked + goto_if_eq VAR_TRICK_HOUSE_PUZZLE_2_STATE, 0, Route110_TrickHousePuzzle_EventScript_DoorLocked msgbox Route110_TrickHousePuzzle2_Text_WroteSecretCodeLockOpened, MSGBOX_DEFAULT playse SE_PIN setvar VAR_TRICK_HOUSE_PUZZLE_2_STATE, 2 - setmetatile 13, 1, METATILE_TrickHousePuzzle_Stairs_Down, 0 + setmetatile 13, 1, METATILE_TrickHousePuzzle_Stairs_Down, FALSE special DrawWholeMapView releaseall end Route110_TrickHousePuzzle3_EventScript_Door:: - compare VAR_TRICK_HOUSE_PUZZLE_3_STATE, 0 - goto_if_eq Route110_TrickHousePuzzle_EventScript_DoorLocked + goto_if_eq VAR_TRICK_HOUSE_PUZZLE_3_STATE, 0, Route110_TrickHousePuzzle_EventScript_DoorLocked msgbox Route110_TrickHousePuzzle3_Text_WroteSecretCodeLockOpened, MSGBOX_DEFAULT playse SE_PIN setvar VAR_TRICK_HOUSE_PUZZLE_3_STATE, 2 - setmetatile 13, 1, METATILE_TrickHousePuzzle_Stairs_Down, 0 + setmetatile 13, 1, METATILE_TrickHousePuzzle_Stairs_Down, FALSE special DrawWholeMapView releaseall end Route110_TrickHousePuzzle4_EventScript_Door:: - compare VAR_TRICK_HOUSE_PUZZLE_4_STATE, 0 - goto_if_eq Route110_TrickHousePuzzle_EventScript_DoorLocked + goto_if_eq VAR_TRICK_HOUSE_PUZZLE_4_STATE, 0, Route110_TrickHousePuzzle_EventScript_DoorLocked msgbox Route110_TrickHousePuzzle4_Text_WroteSecretCodeLockOpened, MSGBOX_DEFAULT playse SE_PIN setvar VAR_TRICK_HOUSE_PUZZLE_4_STATE, 2 - setmetatile 13, 1, METATILE_TrickHousePuzzle_Stairs_Down, 0 + setmetatile 13, 1, METATILE_TrickHousePuzzle_Stairs_Down, FALSE special DrawWholeMapView releaseall end Route110_TrickHousePuzzle5_EventScript_Door:: - compare VAR_TRICK_HOUSE_PUZZLE_5_STATE, 0 - goto_if_eq Route110_TrickHousePuzzle_EventScript_DoorLocked + goto_if_eq VAR_TRICK_HOUSE_PUZZLE_5_STATE, 0, Route110_TrickHousePuzzle_EventScript_DoorLocked msgbox Route110_TrickHousePuzzle5_Text_WroteSecretCodeLockOpened, MSGBOX_DEFAULT playse SE_PIN setvar VAR_TRICK_HOUSE_PUZZLE_5_STATE, 2 - setmetatile 13, 1, METATILE_TrickHousePuzzle_Stairs_Down, 0 + setmetatile 13, 1, METATILE_TrickHousePuzzle_Stairs_Down, FALSE special DrawWholeMapView releaseall end Route110_TrickHousePuzzle6_EventScript_Door:: - compare VAR_TRICK_HOUSE_PUZZLE_6_STATE, 0 - goto_if_eq Route110_TrickHousePuzzle_EventScript_DoorLocked + goto_if_eq VAR_TRICK_HOUSE_PUZZLE_6_STATE, 0, Route110_TrickHousePuzzle_EventScript_DoorLocked msgbox Route110_TrickHousePuzzle6_Text_WroteSecretCodeLockOpened, MSGBOX_DEFAULT playse SE_PIN setvar VAR_TRICK_HOUSE_PUZZLE_6_STATE, 2 - setmetatile 13, 1, METATILE_TrickHousePuzzle_Stairs_Down, 0 + setmetatile 13, 1, METATILE_TrickHousePuzzle_Stairs_Down, FALSE special DrawWholeMapView releaseall end Route110_TrickHousePuzzle7_EventScript_Door:: - compare VAR_TRICK_HOUSE_PUZZLE_7_STATE, 0 - goto_if_eq Route110_TrickHousePuzzle_EventScript_DoorLocked + goto_if_eq VAR_TRICK_HOUSE_PUZZLE_7_STATE, 0, Route110_TrickHousePuzzle_EventScript_DoorLocked msgbox Route110_TrickHousePuzzle7_EventScript_WroteSecretCodeLockOpened, MSGBOX_DEFAULT playse SE_PIN setvar VAR_TRICK_HOUSE_PUZZLE_7_STATE, 2 - setmetatile 13, 1, METATILE_TrickHousePuzzle_Stairs_Down, 0 + setmetatile 13, 1, METATILE_TrickHousePuzzle_Stairs_Down, FALSE special DrawWholeMapView releaseall end Route110_TrickHousePuzzle8_EventScript_Door:: - compare VAR_TRICK_HOUSE_PUZZLE_8_STATE, 0 - goto_if_eq Route110_TrickHousePuzzle_EventScript_DoorLocked + goto_if_eq VAR_TRICK_HOUSE_PUZZLE_8_STATE, 0, Route110_TrickHousePuzzle_EventScript_DoorLocked msgbox Route110_TrickHousePuzzle8_EventScript_WroteSecretCodeLockOpened, MSGBOX_DEFAULT playse SE_PIN setvar VAR_TRICK_HOUSE_PUZZLE_8_STATE, 2 - setmetatile 13, 1, METATILE_TrickHousePuzzle_Stairs_Down, 0 + setmetatile 13, 1, METATILE_TrickHousePuzzle_Stairs_Down, FALSE special DrawWholeMapView releaseall end @@ -722,12 +665,9 @@ Route110_TrickHouseEntrance_EventScript_TrickMasterHiding:: lockall msgbox Route110_TrickHouseEntrance_Text_YoureBeingWatched, MSGBOX_DEFAULT releaseall - compare VAR_TRICK_HOUSE_LEVEL, 0 - call_if_eq Route110_TrickHouseEntrance_EventScript_DoHidingSpotSparkle1 - compare VAR_TRICK_HOUSE_LEVEL, 1 - call_if_eq Route110_TrickHouseEntrance_EventScript_DoHidingSpotSparkle2 - compare VAR_TRICK_HOUSE_LEVEL, 2 - call_if_eq Route110_TrickHouseEntrance_EventScript_DoHidingSpotSparkle3 + call_if_eq VAR_TRICK_HOUSE_LEVEL, 0, Route110_TrickHouseEntrance_EventScript_DoHidingSpotSparkle1 + call_if_eq VAR_TRICK_HOUSE_LEVEL, 1, Route110_TrickHouseEntrance_EventScript_DoHidingSpotSparkle2 + call_if_eq VAR_TRICK_HOUSE_LEVEL, 2, Route110_TrickHouseEntrance_EventScript_DoHidingSpotSparkle3 setvar VAR_TRICK_HOUSE_BEING_WATCHED_STATE, 1 end diff --git a/data/maps/Route110_TrickHousePuzzle1/scripts.inc b/data/maps/Route110_TrickHousePuzzle1/scripts.inc index 6fc6adcd5622..2ed769167a0b 100644 --- a/data/maps/Route110_TrickHousePuzzle1/scripts.inc +++ b/data/maps/Route110_TrickHousePuzzle1/scripts.inc @@ -3,18 +3,16 @@ Route110_TrickHousePuzzle1_MapScripts:: .byte 0 Route110_TrickHousePuzzle1_OnLoad: - compare VAR_TRICK_HOUSE_PUZZLE_1_STATE, 2 - goto_if_eq Route110_TrickHousePuzzle1_EventScript_OpenDoor + goto_if_eq VAR_TRICK_HOUSE_PUZZLE_1_STATE, 2, Route110_TrickHousePuzzle1_EventScript_OpenDoor end Route110_TrickHousePuzzle1_EventScript_OpenDoor:: - setmetatile 13, 1, METATILE_TrickHousePuzzle_Stairs_Down, 0 + setmetatile 13, 1, METATILE_TrickHousePuzzle_Stairs_Down, FALSE end Route110_TrickHousePuzzle1_EventScript_Scroll:: lockall - compare VAR_TRICK_HOUSE_PUZZLE_1_STATE, 0 - goto_if_eq Route110_TrickHousePuzzle1_EventScript_FoundScroll + goto_if_eq VAR_TRICK_HOUSE_PUZZLE_1_STATE, 0, Route110_TrickHousePuzzle1_EventScript_FoundScroll goto Route110_TrickHousePuzzle_EventScript_ReadScrollAgain end diff --git a/data/maps/Route110_TrickHousePuzzle2/scripts.inc b/data/maps/Route110_TrickHousePuzzle2/scripts.inc index a0222733a9dd..012a62d93d6f 100644 --- a/data/maps/Route110_TrickHousePuzzle2/scripts.inc +++ b/data/maps/Route110_TrickHousePuzzle2/scripts.inc @@ -4,14 +4,10 @@ Route110_TrickHousePuzzle2_MapScripts:: .byte 0 Route110_TrickHousePuzzle2_OnResume: - compare VAR_TEMP_1, 1 - call_if_eq Route110_TrickHousePuzzle2_EventScript_PressButton1 - compare VAR_TEMP_2, 1 - call_if_eq Route110_TrickHousePuzzle2_EventScript_PressButton2 - compare VAR_TEMP_3, 1 - call_if_eq Route110_TrickHousePuzzle2_EventScript_PressButton3 - compare VAR_TEMP_4, 1 - call_if_eq Route110_TrickHousePuzzle2_EventScript_PressButton4 + call_if_eq VAR_TEMP_1, 1, Route110_TrickHousePuzzle2_EventScript_PressButton1 + call_if_eq VAR_TEMP_2, 1, Route110_TrickHousePuzzle2_EventScript_PressButton2 + call_if_eq VAR_TEMP_3, 1, Route110_TrickHousePuzzle2_EventScript_PressButton3 + call_if_eq VAR_TEMP_4, 1, Route110_TrickHousePuzzle2_EventScript_PressButton4 end Route110_TrickHousePuzzle2_OnTransition: @@ -23,8 +19,7 @@ Route110_TrickHousePuzzle2_OnTransition: Route110_TrickHousePuzzle2_EventScript_Scroll:: lockall - compare VAR_TRICK_HOUSE_PUZZLE_2_STATE, 0 - goto_if_eq Route110_TrickHousePuzzle2_EventScript_FoundScroll + goto_if_eq VAR_TRICK_HOUSE_PUZZLE_2_STATE, 0, Route110_TrickHousePuzzle2_EventScript_FoundScroll goto Route110_TrickHousePuzzle_EventScript_ReadScrollAgain end @@ -70,23 +65,23 @@ Route110_TrickHousePuzzle2_EventScript_Button4:: end Route110_TrickHousePuzzle2_EventScript_PressButton1:: - setmetatile 11, 12, METATILE_TrickHousePuzzle_Button_Pressed, 0 - setmetatile 1, 13, METATILE_TrickHousePuzzle_Door_Shuttered, 0 + setmetatile 11, 12, METATILE_TrickHousePuzzle_Button_Pressed, FALSE + setmetatile 1, 13, METATILE_TrickHousePuzzle_Door_Shuttered, FALSE return Route110_TrickHousePuzzle2_EventScript_PressButton2:: - setmetatile 0, 4, METATILE_TrickHousePuzzle_Button_Pressed, 0 - setmetatile 5, 6, METATILE_TrickHousePuzzle_Door_Shuttered, 0 + setmetatile 0, 4, METATILE_TrickHousePuzzle_Button_Pressed, FALSE + setmetatile 5, 6, METATILE_TrickHousePuzzle_Door_Shuttered, FALSE return Route110_TrickHousePuzzle2_EventScript_PressButton3:: - setmetatile 14, 5, METATILE_TrickHousePuzzle_Button_Pressed, 0 - setmetatile 7, 15, METATILE_TrickHousePuzzle_Door_Shuttered, 0 + setmetatile 14, 5, METATILE_TrickHousePuzzle_Button_Pressed, FALSE + setmetatile 7, 15, METATILE_TrickHousePuzzle_Door_Shuttered, FALSE return Route110_TrickHousePuzzle2_EventScript_PressButton4:: - setmetatile 7, 11, METATILE_TrickHousePuzzle_Button_Pressed, 0 - setmetatile 14, 12, METATILE_TrickHousePuzzle_Door_Shuttered, 0 + setmetatile 7, 11, METATILE_TrickHousePuzzle_Button_Pressed, FALSE + setmetatile 14, 12, METATILE_TrickHousePuzzle_Door_Shuttered, FALSE return Route110_TrickHousePuzzle2_EventScript_Ted:: diff --git a/data/maps/Route110_TrickHousePuzzle3/scripts.inc b/data/maps/Route110_TrickHousePuzzle3/scripts.inc index 4e706268c0ca..1831639b18a2 100644 --- a/data/maps/Route110_TrickHousePuzzle3/scripts.inc +++ b/data/maps/Route110_TrickHousePuzzle3/scripts.inc @@ -5,10 +5,8 @@ Route110_TrickHousePuzzle3_MapScripts:: Route110_TrickHousePuzzle3_OnResume: call Route110_TrickHousePuzzle3_EventScript_UpdateButtonMetatiles - compare VAR_TEMP_9, 0 - call_if_eq Route110_TrickHousePuzzle3_EventScript_SetDoorsState0 - compare VAR_TEMP_9, 1 - call_if_eq Route110_TrickHousePuzzle3_EventScript_SetDoorsState1 + call_if_eq VAR_TEMP_9, 0, Route110_TrickHousePuzzle3_EventScript_SetDoorsState0 + call_if_eq VAR_TEMP_9, 1, Route110_TrickHousePuzzle3_EventScript_SetDoorsState1 end Route110_TrickHousePuzzle3_OnTransition: @@ -21,188 +19,184 @@ Route110_TrickHousePuzzle3_OnTransition: end Route110_TrickHousePuzzle3_EventScript_UpdateButtonMetatiles:: - setmetatile 4, 14, METATILE_TrickHousePuzzle_Button_Up, 0 - setmetatile 3, 11, METATILE_TrickHousePuzzle_Button_Up, 0 - setmetatile 12, 5, METATILE_TrickHousePuzzle_Button_Up, 0 - setmetatile 8, 2, METATILE_TrickHousePuzzle_Button_Up, 0 - compare VAR_TEMP_8, 1 - call_if_eq Route110_TrickHousePuzzle3_EventScript_PressedButton1Metatile - compare VAR_TEMP_8, 2 - call_if_eq Route110_TrickHousePuzzle3_EventScript_PressedButton2Metatile - compare VAR_TEMP_8, 3 - call_if_eq Route110_TrickHousePuzzle3_EventScript_PressedButton3Metatile - compare VAR_TEMP_8, 4 - call_if_eq Route110_TrickHousePuzzle3_EventScript_PressedButton4Metatile + setmetatile 4, 14, METATILE_TrickHousePuzzle_Button_Up, FALSE + setmetatile 3, 11, METATILE_TrickHousePuzzle_Button_Up, FALSE + setmetatile 12, 5, METATILE_TrickHousePuzzle_Button_Up, FALSE + setmetatile 8, 2, METATILE_TrickHousePuzzle_Button_Up, FALSE + call_if_eq VAR_TEMP_8, 1, Route110_TrickHousePuzzle3_EventScript_PressedButton1Metatile + call_if_eq VAR_TEMP_8, 2, Route110_TrickHousePuzzle3_EventScript_PressedButton2Metatile + call_if_eq VAR_TEMP_8, 3, Route110_TrickHousePuzzle3_EventScript_PressedButton3Metatile + call_if_eq VAR_TEMP_8, 4, Route110_TrickHousePuzzle3_EventScript_PressedButton4Metatile return Route110_TrickHousePuzzle3_EventScript_PressedButton1Metatile:: - setmetatile 4, 14, METATILE_TrickHousePuzzle_Button_Pressed, 0 + setmetatile 4, 14, METATILE_TrickHousePuzzle_Button_Pressed, FALSE return Route110_TrickHousePuzzle3_EventScript_PressedButton2Metatile:: - setmetatile 3, 11, METATILE_TrickHousePuzzle_Button_Pressed, 0 + setmetatile 3, 11, METATILE_TrickHousePuzzle_Button_Pressed, FALSE return Route110_TrickHousePuzzle3_EventScript_PressedButton3Metatile:: - setmetatile 12, 5, METATILE_TrickHousePuzzle_Button_Pressed, 0 + setmetatile 12, 5, METATILE_TrickHousePuzzle_Button_Pressed, FALSE return Route110_TrickHousePuzzle3_EventScript_PressedButton4Metatile:: - setmetatile 8, 2, METATILE_TrickHousePuzzle_Button_Pressed, 0 + setmetatile 8, 2, METATILE_TrickHousePuzzle_Button_Pressed, FALSE return Route110_TrickHousePuzzle3_EventScript_SetDoorsState0:: - setmetatile 1, 6, METATILE_TrickHousePuzzle_BlueDoorH_Open_Tile0, 0 - setmetatile 2, 6, METATILE_TrickHousePuzzle_BlueDoorH_Open_Tile1, 0 - setmetatile 1, 7, METATILE_TrickHousePuzzle_BlueDoorH_Open_Tile2, 0 - setmetatile 2, 7, METATILE_TrickHousePuzzle_BlueDoorH_Open_Tile3, 0 - setmetatile 1, 9, METATILE_TrickHousePuzzle_BlueDoorH_Open_Tile0, 0 - setmetatile 2, 9, METATILE_TrickHousePuzzle_BlueDoorH_Open_Tile1, 0 - setmetatile 1, 10, METATILE_TrickHousePuzzle_BlueDoorH_Open_Tile2, 0 - setmetatile 2, 10, METATILE_TrickHousePuzzle_BlueDoorH_Open_Tile3, 0 - setmetatile 4, 15, METATILE_TrickHousePuzzle_BlueDoorH_Open_Tile0, 0 - setmetatile 5, 15, METATILE_TrickHousePuzzle_BlueDoorH_Open_Tile1, 0 - setmetatile 4, 16, METATILE_TrickHousePuzzle_BlueDoorH_Open_Tile2, 0 - setmetatile 5, 16, METATILE_TrickHousePuzzle_BlueDoorH_Open_Tile3, 0 - setmetatile 13, 9, METATILE_TrickHousePuzzle_BlueDoorH_Open_Tile0, 0 - setmetatile 14, 9, METATILE_TrickHousePuzzle_BlueDoorH_Open_Tile1, 0 - setmetatile 13, 10, METATILE_TrickHousePuzzle_BlueDoorH_Open_Tile2, 0 - setmetatile 14, 10, METATILE_TrickHousePuzzle_BlueDoorH_Open_Tile3, 0 - setmetatile 13, 15, METATILE_TrickHousePuzzle_BlueDoorH_Open_Tile0, 0 - setmetatile 14, 15, METATILE_TrickHousePuzzle_BlueDoorH_Open_Tile1, 0 - setmetatile 13, 16, METATILE_TrickHousePuzzle_BlueDoorH_Open_Tile2, 0 - setmetatile 14, 16, METATILE_TrickHousePuzzle_BlueDoorH_Open_Tile3, 0 - setmetatile 3, 7, METATILE_TrickHousePuzzle_BlueDoorV_Retracted, 1 - setmetatile 3, 8, METATILE_TrickHousePuzzle_Floor_ShadowTop, 0 - setmetatile 3, 13, METATILE_TrickHousePuzzle_BlueDoorV_Retracted, 1 - setmetatile 3, 14, METATILE_TrickHousePuzzle_Floor_ShadowTop, 0 - setmetatile 6, 4, METATILE_TrickHousePuzzle_BlueDoorV_Retracted, 1 - setmetatile 6, 5, METATILE_TrickHousePuzzle_Floor_ShadowTop, 0 - setmetatile 9, 16, METATILE_TrickHousePuzzle_BlueDoorV_Retracted, 1 - setmetatile 9, 17, METATILE_TrickHousePuzzle_Floor_ShadowTop, 0 - setmetatile 12, 7, METATILE_TrickHousePuzzle_BlueDoorV_Retracted, 1 - setmetatile 12, 8, METATILE_TrickHousePuzzle_Floor_ShadowTop, 0 - setmetatile 1, 3, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile0, 0 - setmetatile 2, 3, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile1, 0 - setmetatile 1, 4, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile2, 1 - setmetatile 2, 4, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile3, 1 - setmetatile 1, 12, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile0, 0 - setmetatile 2, 12, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile1, 0 - setmetatile 1, 13, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile2, 1 - setmetatile 2, 13, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile3, 1 - setmetatile 4, 6, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile0, 0 - setmetatile 5, 6, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile1, 0 - setmetatile 4, 7, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile2, 1 - setmetatile 5, 7, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile3, 1 - setmetatile 4, 12, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile0, 0 - setmetatile 5, 12, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile1, 0 - setmetatile 4, 13, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile2, 1 - setmetatile 5, 13, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile3, 1 - setmetatile 4, 18, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile0, 0 - setmetatile 5, 18, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile1, 0 - setmetatile 4, 19, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile2, 1 - setmetatile 5, 19, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile3, 1 - setmetatile 7, 9, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile0, 0 - setmetatile 8, 9, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile1, 0 - setmetatile 7, 10, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile2, 1 - setmetatile 8, 10, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile3, 1 - setmetatile 10, 6, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile0, 0 - setmetatile 11, 6, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile1, 0 - setmetatile 10, 7, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile2, 1 - setmetatile 11, 7, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile3, 1 - setmetatile 10, 12, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile0, 0 - setmetatile 11, 12, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile1, 0 - setmetatile 10, 13, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile2, 1 - setmetatile 11, 13, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile3, 1 - setmetatile 10, 18, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile0, 0 - setmetatile 11, 18, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile1, 0 - setmetatile 10, 19, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile2, 1 - setmetatile 11, 19, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile3, 1 - setmetatile 13, 3, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile0, 0 - setmetatile 14, 3, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile1, 0 - setmetatile 13, 4, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile2, 1 - setmetatile 14, 4, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile3, 1 - setmetatile 3, 16, METATILE_TrickHousePuzzle_RedDoorV_Open0, 1 - setmetatile 3, 17, METATILE_TrickHousePuzzle_RedDoorV_Open1, 1 - setmetatile 9, 4, METATILE_TrickHousePuzzle_RedDoorV_Open0, 1 - setmetatile 9, 5, METATILE_TrickHousePuzzle_RedDoorV_Open1, 1 + setmetatile 1, 6, METATILE_TrickHousePuzzle_BlueDoorH_Open_Tile0, FALSE + setmetatile 2, 6, METATILE_TrickHousePuzzle_BlueDoorH_Open_Tile1, FALSE + setmetatile 1, 7, METATILE_TrickHousePuzzle_BlueDoorH_Open_Tile2, FALSE + setmetatile 2, 7, METATILE_TrickHousePuzzle_BlueDoorH_Open_Tile3, FALSE + setmetatile 1, 9, METATILE_TrickHousePuzzle_BlueDoorH_Open_Tile0, FALSE + setmetatile 2, 9, METATILE_TrickHousePuzzle_BlueDoorH_Open_Tile1, FALSE + setmetatile 1, 10, METATILE_TrickHousePuzzle_BlueDoorH_Open_Tile2, FALSE + setmetatile 2, 10, METATILE_TrickHousePuzzle_BlueDoorH_Open_Tile3, FALSE + setmetatile 4, 15, METATILE_TrickHousePuzzle_BlueDoorH_Open_Tile0, FALSE + setmetatile 5, 15, METATILE_TrickHousePuzzle_BlueDoorH_Open_Tile1, FALSE + setmetatile 4, 16, METATILE_TrickHousePuzzle_BlueDoorH_Open_Tile2, FALSE + setmetatile 5, 16, METATILE_TrickHousePuzzle_BlueDoorH_Open_Tile3, FALSE + setmetatile 13, 9, METATILE_TrickHousePuzzle_BlueDoorH_Open_Tile0, FALSE + setmetatile 14, 9, METATILE_TrickHousePuzzle_BlueDoorH_Open_Tile1, FALSE + setmetatile 13, 10, METATILE_TrickHousePuzzle_BlueDoorH_Open_Tile2, FALSE + setmetatile 14, 10, METATILE_TrickHousePuzzle_BlueDoorH_Open_Tile3, FALSE + setmetatile 13, 15, METATILE_TrickHousePuzzle_BlueDoorH_Open_Tile0, FALSE + setmetatile 14, 15, METATILE_TrickHousePuzzle_BlueDoorH_Open_Tile1, FALSE + setmetatile 13, 16, METATILE_TrickHousePuzzle_BlueDoorH_Open_Tile2, FALSE + setmetatile 14, 16, METATILE_TrickHousePuzzle_BlueDoorH_Open_Tile3, FALSE + setmetatile 3, 7, METATILE_TrickHousePuzzle_BlueDoorV_Retracted, TRUE + setmetatile 3, 8, METATILE_TrickHousePuzzle_Floor_ShadowTop, FALSE + setmetatile 3, 13, METATILE_TrickHousePuzzle_BlueDoorV_Retracted, TRUE + setmetatile 3, 14, METATILE_TrickHousePuzzle_Floor_ShadowTop, FALSE + setmetatile 6, 4, METATILE_TrickHousePuzzle_BlueDoorV_Retracted, TRUE + setmetatile 6, 5, METATILE_TrickHousePuzzle_Floor_ShadowTop, FALSE + setmetatile 9, 16, METATILE_TrickHousePuzzle_BlueDoorV_Retracted, TRUE + setmetatile 9, 17, METATILE_TrickHousePuzzle_Floor_ShadowTop, FALSE + setmetatile 12, 7, METATILE_TrickHousePuzzle_BlueDoorV_Retracted, TRUE + setmetatile 12, 8, METATILE_TrickHousePuzzle_Floor_ShadowTop, FALSE + setmetatile 1, 3, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile0, FALSE + setmetatile 2, 3, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile1, FALSE + setmetatile 1, 4, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile2, TRUE + setmetatile 2, 4, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile3, TRUE + setmetatile 1, 12, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile0, FALSE + setmetatile 2, 12, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile1, FALSE + setmetatile 1, 13, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile2, TRUE + setmetatile 2, 13, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile3, TRUE + setmetatile 4, 6, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile0, FALSE + setmetatile 5, 6, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile1, FALSE + setmetatile 4, 7, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile2, TRUE + setmetatile 5, 7, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile3, TRUE + setmetatile 4, 12, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile0, FALSE + setmetatile 5, 12, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile1, FALSE + setmetatile 4, 13, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile2, TRUE + setmetatile 5, 13, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile3, TRUE + setmetatile 4, 18, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile0, FALSE + setmetatile 5, 18, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile1, FALSE + setmetatile 4, 19, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile2, TRUE + setmetatile 5, 19, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile3, TRUE + setmetatile 7, 9, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile0, FALSE + setmetatile 8, 9, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile1, FALSE + setmetatile 7, 10, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile2, TRUE + setmetatile 8, 10, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile3, TRUE + setmetatile 10, 6, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile0, FALSE + setmetatile 11, 6, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile1, FALSE + setmetatile 10, 7, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile2, TRUE + setmetatile 11, 7, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile3, TRUE + setmetatile 10, 12, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile0, FALSE + setmetatile 11, 12, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile1, FALSE + setmetatile 10, 13, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile2, TRUE + setmetatile 11, 13, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile3, TRUE + setmetatile 10, 18, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile0, FALSE + setmetatile 11, 18, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile1, FALSE + setmetatile 10, 19, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile2, TRUE + setmetatile 11, 19, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile3, TRUE + setmetatile 13, 3, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile0, FALSE + setmetatile 14, 3, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile1, FALSE + setmetatile 13, 4, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile2, TRUE + setmetatile 14, 4, METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile3, TRUE + setmetatile 3, 16, METATILE_TrickHousePuzzle_RedDoorV_Open0, TRUE + setmetatile 3, 17, METATILE_TrickHousePuzzle_RedDoorV_Open1, TRUE + setmetatile 9, 4, METATILE_TrickHousePuzzle_RedDoorV_Open0, TRUE + setmetatile 9, 5, METATILE_TrickHousePuzzle_RedDoorV_Open1, TRUE return Route110_TrickHousePuzzle3_EventScript_SetDoorsState1:: - setmetatile 1, 6, METATILE_TrickHousePuzzle_BlueDoorH_Closed_Tile0, 0 - setmetatile 2, 6, METATILE_TrickHousePuzzle_BlueDoorH_Closed_Tile1, 0 - setmetatile 1, 7, METATILE_TrickHousePuzzle_BlueDoorH_Closed_Tile2, 1 - setmetatile 2, 7, METATILE_TrickHousePuzzle_BlueDoorH_Closed_Tile3, 1 - setmetatile 1, 9, METATILE_TrickHousePuzzle_BlueDoorH_Closed_Tile0, 0 - setmetatile 2, 9, METATILE_TrickHousePuzzle_BlueDoorH_Closed_Tile1, 0 - setmetatile 1, 10, METATILE_TrickHousePuzzle_BlueDoorH_Closed_Tile2, 1 - setmetatile 2, 10, METATILE_TrickHousePuzzle_BlueDoorH_Closed_Tile3, 1 - setmetatile 4, 15, METATILE_TrickHousePuzzle_BlueDoorH_Closed_Tile0, 0 - setmetatile 5, 15, METATILE_TrickHousePuzzle_BlueDoorH_Closed_Tile1, 0 - setmetatile 4, 16, METATILE_TrickHousePuzzle_BlueDoorH_Closed_Tile2, 1 - setmetatile 5, 16, METATILE_TrickHousePuzzle_BlueDoorH_Closed_Tile3, 1 - setmetatile 13, 9, METATILE_TrickHousePuzzle_BlueDoorH_Closed_Tile0, 0 - setmetatile 14, 9, METATILE_TrickHousePuzzle_BlueDoorH_Closed_Tile1, 0 - setmetatile 13, 10, METATILE_TrickHousePuzzle_BlueDoorH_Closed_Tile2, 1 - setmetatile 14, 10, METATILE_TrickHousePuzzle_BlueDoorH_Closed_Tile3, 1 - setmetatile 13, 15, METATILE_TrickHousePuzzle_BlueDoorH_Closed_Tile0, 0 - setmetatile 14, 15, METATILE_TrickHousePuzzle_BlueDoorH_Closed_Tile1, 0 - setmetatile 13, 16, METATILE_TrickHousePuzzle_BlueDoorH_Closed_Tile2, 1 - setmetatile 14, 16, METATILE_TrickHousePuzzle_BlueDoorH_Closed_Tile3, 1 - setmetatile 3, 7, METATILE_TrickHousePuzzle_BlueDoorV_Open0, 1 - setmetatile 3, 8, METATILE_TrickHousePuzzle_BlueDoorV_Open1, 1 - setmetatile 3, 13, METATILE_TrickHousePuzzle_BlueDoorV_Open0, 1 - setmetatile 3, 14, METATILE_TrickHousePuzzle_BlueDoorV_Open1, 1 - setmetatile 6, 4, METATILE_TrickHousePuzzle_BlueDoorV_Open0, 1 - setmetatile 6, 5, METATILE_TrickHousePuzzle_BlueDoorV_Open1, 1 - setmetatile 9, 16, METATILE_TrickHousePuzzle_BlueDoorV_Open0, 1 - setmetatile 9, 17, METATILE_TrickHousePuzzle_BlueDoorV_Open1, 1 - setmetatile 12, 7, METATILE_TrickHousePuzzle_BlueDoorV_Open0, 1 - setmetatile 12, 8, METATILE_TrickHousePuzzle_BlueDoorV_Open1, 1 - setmetatile 1, 3, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile0, 0 - setmetatile 2, 3, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile1, 0 - setmetatile 1, 4, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile2, 0 - setmetatile 2, 4, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile3, 0 - setmetatile 1, 12, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile0, 0 - setmetatile 2, 12, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile1, 0 - setmetatile 1, 13, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile2, 0 - setmetatile 2, 13, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile3, 0 - setmetatile 4, 6, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile0, 0 - setmetatile 5, 6, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile1, 0 - setmetatile 4, 7, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile2, 0 - setmetatile 5, 7, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile3, 0 - setmetatile 4, 12, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile0, 0 - setmetatile 5, 12, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile1, 0 - setmetatile 4, 13, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile2, 0 - setmetatile 5, 13, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile3, 0 - setmetatile 4, 18, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile0, 0 - setmetatile 5, 18, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile1, 0 - setmetatile 4, 19, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile2, 0 - setmetatile 5, 19, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile3, 0 - setmetatile 7, 9, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile0, 0 - setmetatile 8, 9, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile1, 0 - setmetatile 7, 10, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile2, 0 - setmetatile 8, 10, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile3, 0 - setmetatile 10, 6, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile0, 0 - setmetatile 11, 6, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile1, 0 - setmetatile 10, 7, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile2, 0 - setmetatile 11, 7, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile3, 0 - setmetatile 10, 12, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile0, 0 - setmetatile 11, 12, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile1, 0 - setmetatile 10, 13, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile2, 0 - setmetatile 11, 13, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile3, 0 - setmetatile 10, 18, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile0, 0 - setmetatile 11, 18, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile1, 0 - setmetatile 10, 19, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile2, 0 - setmetatile 11, 19, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile3, 0 - setmetatile 13, 3, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile0, 0 - setmetatile 14, 3, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile1, 0 - setmetatile 13, 4, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile2, 0 - setmetatile 14, 4, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile3, 0 - setmetatile 3, 16, METATILE_TrickHousePuzzle_RedDoorV_Retracted, 1 - setmetatile 3, 17, METATILE_TrickHousePuzzle_Floor_ShadowTop_Alt, 0 - setmetatile 9, 4, METATILE_TrickHousePuzzle_RedDoorV_Retracted, 1 - setmetatile 9, 5, METATILE_TrickHousePuzzle_Floor_ShadowTop_Alt, 0 + setmetatile 1, 6, METATILE_TrickHousePuzzle_BlueDoorH_Closed_Tile0, FALSE + setmetatile 2, 6, METATILE_TrickHousePuzzle_BlueDoorH_Closed_Tile1, FALSE + setmetatile 1, 7, METATILE_TrickHousePuzzle_BlueDoorH_Closed_Tile2, TRUE + setmetatile 2, 7, METATILE_TrickHousePuzzle_BlueDoorH_Closed_Tile3, TRUE + setmetatile 1, 9, METATILE_TrickHousePuzzle_BlueDoorH_Closed_Tile0, FALSE + setmetatile 2, 9, METATILE_TrickHousePuzzle_BlueDoorH_Closed_Tile1, FALSE + setmetatile 1, 10, METATILE_TrickHousePuzzle_BlueDoorH_Closed_Tile2, TRUE + setmetatile 2, 10, METATILE_TrickHousePuzzle_BlueDoorH_Closed_Tile3, TRUE + setmetatile 4, 15, METATILE_TrickHousePuzzle_BlueDoorH_Closed_Tile0, FALSE + setmetatile 5, 15, METATILE_TrickHousePuzzle_BlueDoorH_Closed_Tile1, FALSE + setmetatile 4, 16, METATILE_TrickHousePuzzle_BlueDoorH_Closed_Tile2, TRUE + setmetatile 5, 16, METATILE_TrickHousePuzzle_BlueDoorH_Closed_Tile3, TRUE + setmetatile 13, 9, METATILE_TrickHousePuzzle_BlueDoorH_Closed_Tile0, FALSE + setmetatile 14, 9, METATILE_TrickHousePuzzle_BlueDoorH_Closed_Tile1, FALSE + setmetatile 13, 10, METATILE_TrickHousePuzzle_BlueDoorH_Closed_Tile2, TRUE + setmetatile 14, 10, METATILE_TrickHousePuzzle_BlueDoorH_Closed_Tile3, TRUE + setmetatile 13, 15, METATILE_TrickHousePuzzle_BlueDoorH_Closed_Tile0, FALSE + setmetatile 14, 15, METATILE_TrickHousePuzzle_BlueDoorH_Closed_Tile1, FALSE + setmetatile 13, 16, METATILE_TrickHousePuzzle_BlueDoorH_Closed_Tile2, TRUE + setmetatile 14, 16, METATILE_TrickHousePuzzle_BlueDoorH_Closed_Tile3, TRUE + setmetatile 3, 7, METATILE_TrickHousePuzzle_BlueDoorV_Open0, TRUE + setmetatile 3, 8, METATILE_TrickHousePuzzle_BlueDoorV_Open1, TRUE + setmetatile 3, 13, METATILE_TrickHousePuzzle_BlueDoorV_Open0, TRUE + setmetatile 3, 14, METATILE_TrickHousePuzzle_BlueDoorV_Open1, TRUE + setmetatile 6, 4, METATILE_TrickHousePuzzle_BlueDoorV_Open0, TRUE + setmetatile 6, 5, METATILE_TrickHousePuzzle_BlueDoorV_Open1, TRUE + setmetatile 9, 16, METATILE_TrickHousePuzzle_BlueDoorV_Open0, TRUE + setmetatile 9, 17, METATILE_TrickHousePuzzle_BlueDoorV_Open1, TRUE + setmetatile 12, 7, METATILE_TrickHousePuzzle_BlueDoorV_Open0, TRUE + setmetatile 12, 8, METATILE_TrickHousePuzzle_BlueDoorV_Open1, TRUE + setmetatile 1, 3, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile0, FALSE + setmetatile 2, 3, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile1, FALSE + setmetatile 1, 4, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile2, FALSE + setmetatile 2, 4, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile3, FALSE + setmetatile 1, 12, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile0, FALSE + setmetatile 2, 12, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile1, FALSE + setmetatile 1, 13, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile2, FALSE + setmetatile 2, 13, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile3, FALSE + setmetatile 4, 6, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile0, FALSE + setmetatile 5, 6, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile1, FALSE + setmetatile 4, 7, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile2, FALSE + setmetatile 5, 7, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile3, FALSE + setmetatile 4, 12, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile0, FALSE + setmetatile 5, 12, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile1, FALSE + setmetatile 4, 13, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile2, FALSE + setmetatile 5, 13, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile3, FALSE + setmetatile 4, 18, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile0, FALSE + setmetatile 5, 18, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile1, FALSE + setmetatile 4, 19, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile2, FALSE + setmetatile 5, 19, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile3, FALSE + setmetatile 7, 9, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile0, FALSE + setmetatile 8, 9, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile1, FALSE + setmetatile 7, 10, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile2, FALSE + setmetatile 8, 10, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile3, FALSE + setmetatile 10, 6, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile0, FALSE + setmetatile 11, 6, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile1, FALSE + setmetatile 10, 7, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile2, FALSE + setmetatile 11, 7, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile3, FALSE + setmetatile 10, 12, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile0, FALSE + setmetatile 11, 12, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile1, FALSE + setmetatile 10, 13, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile2, FALSE + setmetatile 11, 13, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile3, FALSE + setmetatile 10, 18, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile0, FALSE + setmetatile 11, 18, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile1, FALSE + setmetatile 10, 19, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile2, FALSE + setmetatile 11, 19, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile3, FALSE + setmetatile 13, 3, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile0, FALSE + setmetatile 14, 3, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile1, FALSE + setmetatile 13, 4, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile2, FALSE + setmetatile 14, 4, METATILE_TrickHousePuzzle_RedDoorH_Open_Tile3, FALSE + setmetatile 3, 16, METATILE_TrickHousePuzzle_RedDoorV_Retracted, TRUE + setmetatile 3, 17, METATILE_TrickHousePuzzle_Floor_ShadowTop_Alt, FALSE + setmetatile 9, 4, METATILE_TrickHousePuzzle_RedDoorV_Retracted, TRUE + setmetatile 9, 5, METATILE_TrickHousePuzzle_Floor_ShadowTop_Alt, FALSE return Route110_TrickHousePuzzle3_EventScript_Button1:: @@ -241,14 +235,10 @@ Route110_TrickHousePuzzle3_EventScript_SetButton:: setvar VAR_TEMP_2, 0 setvar VAR_TEMP_3, 0 setvar VAR_TEMP_4, 0 - compare VAR_TEMP_8, 1 - call_if_eq Route110_TrickHousePuzzle3_EventScript_SetButton1 - compare VAR_TEMP_8, 2 - call_if_eq Route110_TrickHousePuzzle3_EventScript_SetButton2 - compare VAR_TEMP_8, 3 - call_if_eq Route110_TrickHousePuzzle3_EventScript_SetButton3 - compare VAR_TEMP_8, 4 - call_if_eq Route110_TrickHousePuzzle3_EventScript_SetButton4 + call_if_eq VAR_TEMP_8, 1, Route110_TrickHousePuzzle3_EventScript_SetButton1 + call_if_eq VAR_TEMP_8, 2, Route110_TrickHousePuzzle3_EventScript_SetButton2 + call_if_eq VAR_TEMP_8, 3, Route110_TrickHousePuzzle3_EventScript_SetButton3 + call_if_eq VAR_TEMP_8, 4, Route110_TrickHousePuzzle3_EventScript_SetButton4 return Route110_TrickHousePuzzle3_EventScript_SetButton1:: @@ -268,15 +258,11 @@ Route110_TrickHousePuzzle3_EventScript_SetButton4:: return Route110_TrickHousePuzzle3_EventScript_AlternateDoors:: - compare VAR_TEMP_9, 1 - call_if_eq Route110_TrickHousePuzzle3_EventScript_SetDoorsState0 - compare VAR_TEMP_9, 0 - call_if_eq Route110_TrickHousePuzzle3_EventScript_SetDoorsState1 + call_if_eq VAR_TEMP_9, 1, Route110_TrickHousePuzzle3_EventScript_SetDoorsState0 + call_if_eq VAR_TEMP_9, 0, Route110_TrickHousePuzzle3_EventScript_SetDoorsState1 special DrawWholeMapView - compare VAR_TEMP_9, 1 - goto_if_eq Route110_TrickHousePuzzle3_EventScript_ClearAltDoorState - compare VAR_TEMP_9, 0 - goto_if_eq Route110_TrickHousePuzzle3_EventScript_SetAltDoorState + goto_if_eq VAR_TEMP_9, 1, Route110_TrickHousePuzzle3_EventScript_ClearAltDoorState + goto_if_eq VAR_TEMP_9, 0, Route110_TrickHousePuzzle3_EventScript_SetAltDoorState end Route110_TrickHousePuzzle3_EventScript_ClearAltDoorState:: @@ -291,8 +277,7 @@ Route110_TrickHousePuzzle3_EventScript_SetAltDoorState:: Route110_TrickHousePuzzle3_EventScript_Scroll:: lockall - compare VAR_TRICK_HOUSE_PUZZLE_3_STATE, 0 - goto_if_eq Route110_TrickHousePuzzle3_EventScript_FoundScroll + goto_if_eq VAR_TRICK_HOUSE_PUZZLE_3_STATE, 0, Route110_TrickHousePuzzle3_EventScript_FoundScroll goto Route110_TrickHousePuzzle_EventScript_ReadScrollAgain end diff --git a/data/maps/Route110_TrickHousePuzzle4/scripts.inc b/data/maps/Route110_TrickHousePuzzle4/scripts.inc index 10f49adb50ef..2350d4ceb2fd 100644 --- a/data/maps/Route110_TrickHousePuzzle4/scripts.inc +++ b/data/maps/Route110_TrickHousePuzzle4/scripts.inc @@ -3,8 +3,7 @@ Route110_TrickHousePuzzle4_MapScripts:: Route110_TrickHousePuzzle4_EventScript_Scroll:: lockall - compare VAR_TRICK_HOUSE_PUZZLE_4_STATE, 0 - goto_if_eq Route110_TrickHousePuzzle4_EventScript_FoundScroll + goto_if_eq VAR_TRICK_HOUSE_PUZZLE_4_STATE, 0, Route110_TrickHousePuzzle4_EventScript_FoundScroll goto Route110_TrickHousePuzzle_EventScript_ReadScrollAgain end diff --git a/data/maps/Route110_TrickHousePuzzle5/scripts.inc b/data/maps/Route110_TrickHousePuzzle5/scripts.inc index 3c574441ec92..e0fa432bd2ae 100644 --- a/data/maps/Route110_TrickHousePuzzle5/scripts.inc +++ b/data/maps/Route110_TrickHousePuzzle5/scripts.inc @@ -19,8 +19,7 @@ Route110_TrickHousePuzzle5_OnTransition: Route110_TrickHousePuzzle5_EventScript_Scroll:: lockall - compare VAR_TRICK_HOUSE_PUZZLE_5_STATE, 0 - goto_if_eq Route110_TrickHousePuzzle5_EventScript_FoundScroll + goto_if_eq VAR_TRICK_HOUSE_PUZZLE_5_STATE, 0, Route110_TrickHousePuzzle5_EventScript_FoundScroll goto Route110_TrickHousePuzzle_EventScript_ReadScrollAgain end @@ -33,8 +32,7 @@ Route110_TrickHousePuzzle5_EventScript_Mechadoll1:: lockall applymovement LOCALID_MECHADOLL_1, Common_Movement_FacePlayer waitmovement 0 - compare VAR_TEMP_1, 1 - goto_if_eq Route110_TrickHousePuzzle5_EventScript_CorrectGoThrough + goto_if_eq VAR_TEMP_1, 1, Route110_TrickHousePuzzle5_EventScript_CorrectGoThrough setvar VAR_TEMP_9, 0 goto Route110_TrickHousePuzzle5_EventScript_Mechadoll1Activate end @@ -43,8 +41,7 @@ Route110_TrickHousePuzzle5_EventScript_Mechadoll2:: lockall applymovement LOCALID_MECHADOLL_2, Common_Movement_FacePlayer waitmovement 0 - compare VAR_TEMP_2, 1 - goto_if_eq Route110_TrickHousePuzzle5_EventScript_CorrectGoThrough + goto_if_eq VAR_TEMP_2, 1, Route110_TrickHousePuzzle5_EventScript_CorrectGoThrough setvar VAR_TEMP_9, 0 goto Route110_TrickHousePuzzle5_EventScript_Mechadoll2Activate end @@ -53,8 +50,7 @@ Route110_TrickHousePuzzle5_EventScript_Mechadoll3:: lockall applymovement LOCALID_MECHADOLL_3, Common_Movement_FacePlayer waitmovement 0 - compare VAR_TEMP_3, 1 - goto_if_eq Route110_TrickHousePuzzle5_EventScript_CorrectGoThrough + goto_if_eq VAR_TEMP_3, 1, Route110_TrickHousePuzzle5_EventScript_CorrectGoThrough setvar VAR_TEMP_9, 0 goto Route110_TrickHousePuzzle5_EventScript_Mechadoll3Activate end @@ -63,8 +59,7 @@ Route110_TrickHousePuzzle5_EventScript_Mechadoll4:: lockall applymovement LOCALID_MECHADOLL_4, Common_Movement_FacePlayer waitmovement 0 - compare VAR_TEMP_4, 1 - goto_if_eq Route110_TrickHousePuzzle5_EventScript_CorrectGoThrough + goto_if_eq VAR_TEMP_4, 1, Route110_TrickHousePuzzle5_EventScript_CorrectGoThrough setvar VAR_TEMP_9, 0 goto Route110_TrickHousePuzzle5_EventScript_Mechadoll4Activate end @@ -73,8 +68,7 @@ Route110_TrickHousePuzzle5_EventScript_Mechadoll5:: lockall applymovement LOCALID_MECHADOLL_5, Common_Movement_FacePlayer waitmovement 0 - compare VAR_TEMP_5, 1 - goto_if_eq Route110_TrickHousePuzzle5_EventScript_CorrectGoThrough + goto_if_eq VAR_TEMP_5, 1, Route110_TrickHousePuzzle5_EventScript_CorrectGoThrough setvar VAR_TEMP_9, 0 goto Route110_TrickHousePuzzle5_EventScript_Mechadoll5Activate end @@ -226,14 +220,10 @@ Route110_TrickHousePuzzle5_EventScript_Mechadoll1Activate:: waitmovement 0 applymovement LOCALID_MECHADOLL_1, Common_Movement_Delay48 waitmovement 0 - compare VAR_TEMP_9, 1 - call_if_eq Route110_TrickHousePuzzle5_EventScript_MechadollWalkLeft1 - compare VAR_TEMP_9, 2 - call_if_eq Route110_TrickHousePuzzle5_EventScript_MechadollWalkLeft2 - compare VAR_TEMP_9, 3 - call_if_eq Route110_TrickHousePuzzle5_EventScript_MechadollWalkLeft3 - compare VAR_TEMP_9, 4 - call_if_eq Route110_TrickHousePuzzle5_EventScript_MechadollWalkLeft4 + call_if_eq VAR_TEMP_9, 1, Route110_TrickHousePuzzle5_EventScript_MechadollWalkLeft1 + call_if_eq VAR_TEMP_9, 2, Route110_TrickHousePuzzle5_EventScript_MechadollWalkLeft2 + call_if_eq VAR_TEMP_9, 3, Route110_TrickHousePuzzle5_EventScript_MechadollWalkLeft3 + call_if_eq VAR_TEMP_9, 4, Route110_TrickHousePuzzle5_EventScript_MechadollWalkLeft4 msgbox Route110_TrickHousePuzzle5_Text_Mechadoll1Intro, MSGBOX_DEFAULT random 3 switch VAR_RESULT @@ -250,16 +240,11 @@ Route110_TrickHousePuzzle5_EventScript_Mechadoll2Activate:: waitmovement 0 applymovement LOCALID_MECHADOLL_2, Common_Movement_Delay48 waitmovement 0 - compare VAR_TEMP_9, 1 - call_if_eq Route110_TrickHousePuzzle5_EventScript_MechadollWalkRight1 - compare VAR_TEMP_9, 2 - call_if_eq Route110_TrickHousePuzzle5_EventScript_MechadollWalkRight2 - compare VAR_TEMP_9, 3 - call_if_eq Route110_TrickHousePuzzle5_EventScript_MechadollWalkRight3 - compare VAR_TEMP_9, 4 - call_if_eq Route110_TrickHousePuzzle5_EventScript_MechadollWalkRight4 - compare VAR_TEMP_9, 5 - call_if_eq Route110_TrickHousePuzzle5_EventScript_MechadollWalkRight5 + call_if_eq VAR_TEMP_9, 1, Route110_TrickHousePuzzle5_EventScript_MechadollWalkRight1 + call_if_eq VAR_TEMP_9, 2, Route110_TrickHousePuzzle5_EventScript_MechadollWalkRight2 + call_if_eq VAR_TEMP_9, 3, Route110_TrickHousePuzzle5_EventScript_MechadollWalkRight3 + call_if_eq VAR_TEMP_9, 4, Route110_TrickHousePuzzle5_EventScript_MechadollWalkRight4 + call_if_eq VAR_TEMP_9, 5, Route110_TrickHousePuzzle5_EventScript_MechadollWalkRight5 msgbox Route110_TrickHousePuzzle5_Text_Mechadoll2Intro, MSGBOX_DEFAULT random 3 switch VAR_RESULT @@ -276,14 +261,10 @@ Route110_TrickHousePuzzle5_EventScript_Mechadoll3Activate:: waitmovement 0 applymovement LOCALID_MECHADOLL_3, Common_Movement_Delay48 waitmovement 0 - compare VAR_TEMP_9, 1 - call_if_eq Route110_TrickHousePuzzle5_EventScript_MechadollWalkLeft1 - compare VAR_TEMP_9, 2 - call_if_eq Route110_TrickHousePuzzle5_EventScript_MechadollWalkLeft2 - compare VAR_TEMP_9, 3 - call_if_eq Route110_TrickHousePuzzle5_EventScript_MechadollWalkLeft3 - compare VAR_TEMP_9, 4 - call_if_eq Route110_TrickHousePuzzle5_EventScript_MechadollWalkLeft4 + call_if_eq VAR_TEMP_9, 1, Route110_TrickHousePuzzle5_EventScript_MechadollWalkLeft1 + call_if_eq VAR_TEMP_9, 2, Route110_TrickHousePuzzle5_EventScript_MechadollWalkLeft2 + call_if_eq VAR_TEMP_9, 3, Route110_TrickHousePuzzle5_EventScript_MechadollWalkLeft3 + call_if_eq VAR_TEMP_9, 4, Route110_TrickHousePuzzle5_EventScript_MechadollWalkLeft4 msgbox Route110_TrickHousePuzzle5_Text_Mechadoll3Intro, MSGBOX_DEFAULT random 3 switch VAR_RESULT @@ -300,14 +281,10 @@ Route110_TrickHousePuzzle5_EventScript_Mechadoll4Activate:: waitmovement 0 applymovement LOCALID_MECHADOLL_4, Common_Movement_Delay48 waitmovement 0 - compare VAR_TEMP_9, 1 - call_if_eq Route110_TrickHousePuzzle5_EventScript_MechadollWalkLeft1 - compare VAR_TEMP_9, 2 - call_if_eq Route110_TrickHousePuzzle5_EventScript_MechadollWalkLeft2 - compare VAR_TEMP_9, 3 - call_if_eq Route110_TrickHousePuzzle5_EventScript_MechadollWalkLeft3 - compare VAR_TEMP_9, 4 - call_if_eq Route110_TrickHousePuzzle5_EventScript_MechadollWalkLeft4 + call_if_eq VAR_TEMP_9, 1, Route110_TrickHousePuzzle5_EventScript_MechadollWalkLeft1 + call_if_eq VAR_TEMP_9, 2, Route110_TrickHousePuzzle5_EventScript_MechadollWalkLeft2 + call_if_eq VAR_TEMP_9, 3, Route110_TrickHousePuzzle5_EventScript_MechadollWalkLeft3 + call_if_eq VAR_TEMP_9, 4, Route110_TrickHousePuzzle5_EventScript_MechadollWalkLeft4 msgbox Route110_TrickHousePuzzle5_Text_Mechadoll4Intro, MSGBOX_DEFAULT random 3 switch VAR_RESULT @@ -465,7 +442,7 @@ Route110_TrickHousePuzzle5_EventScript_IncorrectAnswer:: waitmovement 0 msgbox Route110_TrickHousePuzzle5_Text_WaitForNextChallenge, MSGBOX_DEFAULT closemessage - warp MAP_ROUTE110_TRICK_HOUSE_PUZZLE5, 255, 0, 21 + warp MAP_ROUTE110_TRICK_HOUSE_PUZZLE5, 0, 21 waitstate releaseall end @@ -487,133 +464,83 @@ Route110_TrickHousePuzzle5_EventScript_CorrectGoThrough:: @ Mechadoll 5 never walks, all the Mechadoll5Walk scripts are unused @ No mechadoll walks left 5 paces, all the WalkLeft5 scripts are unused Route110_TrickHousePuzzle5_EventScript_MechadollWalkLeft1:: - compare VAR_TEMP_8, LOCALID_MECHADOLL_1 - call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll1WalkLeft1 - compare VAR_TEMP_8, LOCALID_MECHADOLL_2 - call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll2WalkLeft1 - compare VAR_TEMP_8, LOCALID_MECHADOLL_3 - call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll3WalkLeft1 - compare VAR_TEMP_8, LOCALID_MECHADOLL_4 - call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll4WalkLeft1 - compare VAR_TEMP_8, LOCALID_MECHADOLL_5 - call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll5WalkLeft1 + call_if_eq VAR_TEMP_8, LOCALID_MECHADOLL_1, Route110_TrickHousePuzzle5_EventScript_Mechadoll1WalkLeft1 + call_if_eq VAR_TEMP_8, LOCALID_MECHADOLL_2, Route110_TrickHousePuzzle5_EventScript_Mechadoll2WalkLeft1 + call_if_eq VAR_TEMP_8, LOCALID_MECHADOLL_3, Route110_TrickHousePuzzle5_EventScript_Mechadoll3WalkLeft1 + call_if_eq VAR_TEMP_8, LOCALID_MECHADOLL_4, Route110_TrickHousePuzzle5_EventScript_Mechadoll4WalkLeft1 + call_if_eq VAR_TEMP_8, LOCALID_MECHADOLL_5, Route110_TrickHousePuzzle5_EventScript_Mechadoll5WalkLeft1 return Route110_TrickHousePuzzle5_EventScript_MechadollWalkLeft2:: - compare VAR_TEMP_8, LOCALID_MECHADOLL_1 - call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll1WalkLeft2 - compare VAR_TEMP_8, LOCALID_MECHADOLL_2 - call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll2WalkLeft2 - compare VAR_TEMP_8, LOCALID_MECHADOLL_3 - call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll3WalkLeft2 - compare VAR_TEMP_8, LOCALID_MECHADOLL_4 - call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll4WalkLeft2 - compare VAR_TEMP_8, LOCALID_MECHADOLL_5 - call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll5WalkLeft2 + call_if_eq VAR_TEMP_8, LOCALID_MECHADOLL_1, Route110_TrickHousePuzzle5_EventScript_Mechadoll1WalkLeft2 + call_if_eq VAR_TEMP_8, LOCALID_MECHADOLL_2, Route110_TrickHousePuzzle5_EventScript_Mechadoll2WalkLeft2 + call_if_eq VAR_TEMP_8, LOCALID_MECHADOLL_3, Route110_TrickHousePuzzle5_EventScript_Mechadoll3WalkLeft2 + call_if_eq VAR_TEMP_8, LOCALID_MECHADOLL_4, Route110_TrickHousePuzzle5_EventScript_Mechadoll4WalkLeft2 + call_if_eq VAR_TEMP_8, LOCALID_MECHADOLL_5, Route110_TrickHousePuzzle5_EventScript_Mechadoll5WalkLeft2 return Route110_TrickHousePuzzle5_EventScript_MechadollWalkLeft3:: - compare VAR_TEMP_8, LOCALID_MECHADOLL_1 - call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll1WalkLeft3 - compare VAR_TEMP_8, LOCALID_MECHADOLL_2 - call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll2WalkLeft3 - compare VAR_TEMP_8, LOCALID_MECHADOLL_3 - call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll3WalkLeft3 - compare VAR_TEMP_8, LOCALID_MECHADOLL_4 - call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll4WalkLeft3 - compare VAR_TEMP_8, LOCALID_MECHADOLL_5 - call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll5WalkLeft3 + call_if_eq VAR_TEMP_8, LOCALID_MECHADOLL_1, Route110_TrickHousePuzzle5_EventScript_Mechadoll1WalkLeft3 + call_if_eq VAR_TEMP_8, LOCALID_MECHADOLL_2, Route110_TrickHousePuzzle5_EventScript_Mechadoll2WalkLeft3 + call_if_eq VAR_TEMP_8, LOCALID_MECHADOLL_3, Route110_TrickHousePuzzle5_EventScript_Mechadoll3WalkLeft3 + call_if_eq VAR_TEMP_8, LOCALID_MECHADOLL_4, Route110_TrickHousePuzzle5_EventScript_Mechadoll4WalkLeft3 + call_if_eq VAR_TEMP_8, LOCALID_MECHADOLL_5, Route110_TrickHousePuzzle5_EventScript_Mechadoll5WalkLeft3 return Route110_TrickHousePuzzle5_EventScript_MechadollWalkLeft4:: - compare VAR_TEMP_8, LOCALID_MECHADOLL_1 - call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll1WalkLeft4 - compare VAR_TEMP_8, LOCALID_MECHADOLL_2 - call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll2WalkLeft4 - compare VAR_TEMP_8, LOCALID_MECHADOLL_3 - call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll3WalkLeft4 - compare VAR_TEMP_8, LOCALID_MECHADOLL_4 - call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll4WalkLeft4 - compare VAR_TEMP_8, LOCALID_MECHADOLL_5 - call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll5WalkLeft4 + call_if_eq VAR_TEMP_8, LOCALID_MECHADOLL_1, Route110_TrickHousePuzzle5_EventScript_Mechadoll1WalkLeft4 + call_if_eq VAR_TEMP_8, LOCALID_MECHADOLL_2, Route110_TrickHousePuzzle5_EventScript_Mechadoll2WalkLeft4 + call_if_eq VAR_TEMP_8, LOCALID_MECHADOLL_3, Route110_TrickHousePuzzle5_EventScript_Mechadoll3WalkLeft4 + call_if_eq VAR_TEMP_8, LOCALID_MECHADOLL_4, Route110_TrickHousePuzzle5_EventScript_Mechadoll4WalkLeft4 + call_if_eq VAR_TEMP_8, LOCALID_MECHADOLL_5, Route110_TrickHousePuzzle5_EventScript_Mechadoll5WalkLeft4 return Route110_TrickHousePuzzle5_EventScript_MechadollWalkLeft5:: - compare VAR_TEMP_8, LOCALID_MECHADOLL_1 - call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll1WalkLeft5 - compare VAR_TEMP_8, LOCALID_MECHADOLL_2 - call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll2WalkLeft5 - compare VAR_TEMP_8, LOCALID_MECHADOLL_3 - call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll3WalkLeft5 - compare VAR_TEMP_8, LOCALID_MECHADOLL_4 - call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll4WalkLeft5 - compare VAR_TEMP_8, LOCALID_MECHADOLL_5 - call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll5WalkLeft5 + call_if_eq VAR_TEMP_8, LOCALID_MECHADOLL_1, Route110_TrickHousePuzzle5_EventScript_Mechadoll1WalkLeft5 + call_if_eq VAR_TEMP_8, LOCALID_MECHADOLL_2, Route110_TrickHousePuzzle5_EventScript_Mechadoll2WalkLeft5 + call_if_eq VAR_TEMP_8, LOCALID_MECHADOLL_3, Route110_TrickHousePuzzle5_EventScript_Mechadoll3WalkLeft5 + call_if_eq VAR_TEMP_8, LOCALID_MECHADOLL_4, Route110_TrickHousePuzzle5_EventScript_Mechadoll4WalkLeft5 + call_if_eq VAR_TEMP_8, LOCALID_MECHADOLL_5, Route110_TrickHousePuzzle5_EventScript_Mechadoll5WalkLeft5 return Route110_TrickHousePuzzle5_EventScript_MechadollWalkRight1:: - compare VAR_TEMP_8, LOCALID_MECHADOLL_1 - call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll1WalkRight1 - compare VAR_TEMP_8, LOCALID_MECHADOLL_2 - call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll2WalkRight1 - compare VAR_TEMP_8, LOCALID_MECHADOLL_3 - call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll3WalkRight1 - compare VAR_TEMP_8, LOCALID_MECHADOLL_4 - call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll4WalkRight1 - compare VAR_TEMP_8, LOCALID_MECHADOLL_5 - call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll5WalkRight1 + call_if_eq VAR_TEMP_8, LOCALID_MECHADOLL_1, Route110_TrickHousePuzzle5_EventScript_Mechadoll1WalkRight1 + call_if_eq VAR_TEMP_8, LOCALID_MECHADOLL_2, Route110_TrickHousePuzzle5_EventScript_Mechadoll2WalkRight1 + call_if_eq VAR_TEMP_8, LOCALID_MECHADOLL_3, Route110_TrickHousePuzzle5_EventScript_Mechadoll3WalkRight1 + call_if_eq VAR_TEMP_8, LOCALID_MECHADOLL_4, Route110_TrickHousePuzzle5_EventScript_Mechadoll4WalkRight1 + call_if_eq VAR_TEMP_8, LOCALID_MECHADOLL_5, Route110_TrickHousePuzzle5_EventScript_Mechadoll5WalkRight1 return Route110_TrickHousePuzzle5_EventScript_MechadollWalkRight2:: - compare VAR_TEMP_8, LOCALID_MECHADOLL_1 - call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll1WalkRight2 - compare VAR_TEMP_8, LOCALID_MECHADOLL_2 - call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll2WalkRight2 - compare VAR_TEMP_8, LOCALID_MECHADOLL_3 - call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll3WalkRight2 - compare VAR_TEMP_8, LOCALID_MECHADOLL_4 - call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll4WalkRight2 - compare VAR_TEMP_8, LOCALID_MECHADOLL_5 - call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll5WalkRight2 + call_if_eq VAR_TEMP_8, LOCALID_MECHADOLL_1, Route110_TrickHousePuzzle5_EventScript_Mechadoll1WalkRight2 + call_if_eq VAR_TEMP_8, LOCALID_MECHADOLL_2, Route110_TrickHousePuzzle5_EventScript_Mechadoll2WalkRight2 + call_if_eq VAR_TEMP_8, LOCALID_MECHADOLL_3, Route110_TrickHousePuzzle5_EventScript_Mechadoll3WalkRight2 + call_if_eq VAR_TEMP_8, LOCALID_MECHADOLL_4, Route110_TrickHousePuzzle5_EventScript_Mechadoll4WalkRight2 + call_if_eq VAR_TEMP_8, LOCALID_MECHADOLL_5, Route110_TrickHousePuzzle5_EventScript_Mechadoll5WalkRight2 return Route110_TrickHousePuzzle5_EventScript_MechadollWalkRight3:: - compare VAR_TEMP_8, LOCALID_MECHADOLL_1 - call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll1WalkRight3 - compare VAR_TEMP_8, LOCALID_MECHADOLL_2 - call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll2WalkRight3 - compare VAR_TEMP_8, LOCALID_MECHADOLL_3 - call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll3WalkRight3 - compare VAR_TEMP_8, LOCALID_MECHADOLL_4 - call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll4WalkRight3 - compare VAR_TEMP_8, LOCALID_MECHADOLL_5 - call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll5WalkRight3 + call_if_eq VAR_TEMP_8, LOCALID_MECHADOLL_1, Route110_TrickHousePuzzle5_EventScript_Mechadoll1WalkRight3 + call_if_eq VAR_TEMP_8, LOCALID_MECHADOLL_2, Route110_TrickHousePuzzle5_EventScript_Mechadoll2WalkRight3 + call_if_eq VAR_TEMP_8, LOCALID_MECHADOLL_3, Route110_TrickHousePuzzle5_EventScript_Mechadoll3WalkRight3 + call_if_eq VAR_TEMP_8, LOCALID_MECHADOLL_4, Route110_TrickHousePuzzle5_EventScript_Mechadoll4WalkRight3 + call_if_eq VAR_TEMP_8, LOCALID_MECHADOLL_5, Route110_TrickHousePuzzle5_EventScript_Mechadoll5WalkRight3 return Route110_TrickHousePuzzle5_EventScript_MechadollWalkRight4:: - compare VAR_TEMP_8, LOCALID_MECHADOLL_1 - call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll1WalkRight4 - compare VAR_TEMP_8, LOCALID_MECHADOLL_2 - call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll2WalkRight4 - compare VAR_TEMP_8, LOCALID_MECHADOLL_3 - call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll3WalkRight4 - compare VAR_TEMP_8, LOCALID_MECHADOLL_4 - call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll4WalkRight4 - compare VAR_TEMP_8, LOCALID_MECHADOLL_5 - call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll5WalkRight4 + call_if_eq VAR_TEMP_8, LOCALID_MECHADOLL_1, Route110_TrickHousePuzzle5_EventScript_Mechadoll1WalkRight4 + call_if_eq VAR_TEMP_8, LOCALID_MECHADOLL_2, Route110_TrickHousePuzzle5_EventScript_Mechadoll2WalkRight4 + call_if_eq VAR_TEMP_8, LOCALID_MECHADOLL_3, Route110_TrickHousePuzzle5_EventScript_Mechadoll3WalkRight4 + call_if_eq VAR_TEMP_8, LOCALID_MECHADOLL_4, Route110_TrickHousePuzzle5_EventScript_Mechadoll4WalkRight4 + call_if_eq VAR_TEMP_8, LOCALID_MECHADOLL_5, Route110_TrickHousePuzzle5_EventScript_Mechadoll5WalkRight4 return Route110_TrickHousePuzzle5_EventScript_MechadollWalkRight5:: - compare VAR_TEMP_8, LOCALID_MECHADOLL_1 - call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll1WalkRight5 - compare VAR_TEMP_8, LOCALID_MECHADOLL_2 - call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll2WalkRight5 - compare VAR_TEMP_8, LOCALID_MECHADOLL_3 - call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll3WalkRight5 - compare VAR_TEMP_8, LOCALID_MECHADOLL_4 - call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll4WalkRight5 - compare VAR_TEMP_8, LOCALID_MECHADOLL_5 - call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll5WalkRight5 + call_if_eq VAR_TEMP_8, LOCALID_MECHADOLL_1, Route110_TrickHousePuzzle5_EventScript_Mechadoll1WalkRight5 + call_if_eq VAR_TEMP_8, LOCALID_MECHADOLL_2, Route110_TrickHousePuzzle5_EventScript_Mechadoll2WalkRight5 + call_if_eq VAR_TEMP_8, LOCALID_MECHADOLL_3, Route110_TrickHousePuzzle5_EventScript_Mechadoll3WalkRight5 + call_if_eq VAR_TEMP_8, LOCALID_MECHADOLL_4, Route110_TrickHousePuzzle5_EventScript_Mechadoll4WalkRight5 + call_if_eq VAR_TEMP_8, LOCALID_MECHADOLL_5, Route110_TrickHousePuzzle5_EventScript_Mechadoll5WalkRight5 return Route110_TrickHousePuzzle5_EventScript_Mechadoll1WalkLeft1:: diff --git a/data/maps/Route110_TrickHousePuzzle6/scripts.inc b/data/maps/Route110_TrickHousePuzzle6/scripts.inc index 35d657acc379..e442d094d59f 100644 --- a/data/maps/Route110_TrickHousePuzzle6/scripts.inc +++ b/data/maps/Route110_TrickHousePuzzle6/scripts.inc @@ -17,8 +17,7 @@ Route110_TrickHousePuzzle6_EventScript_InitPuzzle:: Route110_TrickHousePuzzle6_EventScript_Scroll:: lockall - compare VAR_TRICK_HOUSE_PUZZLE_6_STATE, 0 - goto_if_eq Route110_TrickHousePuzzle6_EventScript_FoundScroll + goto_if_eq VAR_TRICK_HOUSE_PUZZLE_6_STATE, 0, Route110_TrickHousePuzzle6_EventScript_FoundScroll goto Route110_TrickHousePuzzle_EventScript_ReadScrollAgain end diff --git a/data/maps/Route110_TrickHousePuzzle7/scripts.inc b/data/maps/Route110_TrickHousePuzzle7/scripts.inc index b0f1cbea12d8..a47df82cac2f 100644 --- a/data/maps/Route110_TrickHousePuzzle7/scripts.inc +++ b/data/maps/Route110_TrickHousePuzzle7/scripts.inc @@ -22,58 +22,57 @@ Route110_TrickHousePuzzle7_EventScript_UpdateSwitchMetatiles:: @ Leftover from R/S, none of the below metatile scripts are ever called Route110_TrickHousePuzzle7_EventScript_SetSwitch1MetatilesOn:: - setmetatile 13, 17, METATILE_TrickHousePuzzle_Arrow_RedOnBlack_Up, 0 - setmetatile 12, 16, METATILE_TrickHousePuzzle_Lever_On, 1 + setmetatile 13, 17, METATILE_TrickHousePuzzle_Arrow_RedOnBlack_Up, FALSE + setmetatile 12, 16, METATILE_TrickHousePuzzle_Lever_On, TRUE return Route110_TrickHousePuzzle7_EventScript_SetSwitch2MetatilesOn:: - setmetatile 12, 13, METATILE_TrickHousePuzzle_Arrow_RedOnBlack_Up, 0 - setmetatile 12, 11, METATILE_TrickHousePuzzle_Lever_On, 1 + setmetatile 12, 13, METATILE_TrickHousePuzzle_Arrow_RedOnBlack_Up, FALSE + setmetatile 12, 11, METATILE_TrickHousePuzzle_Lever_On, TRUE return Route110_TrickHousePuzzle7_EventScript_SetSwitch3MetatilesOn:: - setmetatile 7, 12, METATILE_TrickHousePuzzle_Arrow_RedOnBlack_Up, 0 - setmetatile 5, 10, METATILE_TrickHousePuzzle_Lever_On, 1 + setmetatile 7, 12, METATILE_TrickHousePuzzle_Arrow_RedOnBlack_Up, FALSE + setmetatile 5, 10, METATILE_TrickHousePuzzle_Lever_On, TRUE return Route110_TrickHousePuzzle7_EventScript_SetSwitch4MetatilesOn:: - setmetatile 6, 6, METATILE_TrickHousePuzzle_Arrow_RedOnBlack_Right_Alt, 0 - setmetatile 4, 4, METATILE_TrickHousePuzzle_Lever_On, 1 + setmetatile 6, 6, METATILE_TrickHousePuzzle_Arrow_RedOnBlack_Right_Alt, FALSE + setmetatile 4, 4, METATILE_TrickHousePuzzle_Lever_On, TRUE return Route110_TrickHousePuzzle7_EventScript_SetSwitch5MetatilesOn:: - setmetatile 8, 4, METATILE_TrickHousePuzzle_Arrow_RedOnBlack_Left, 0 - setmetatile 7, 5, METATILE_TrickHousePuzzle_Lever_On, 1 + setmetatile 8, 4, METATILE_TrickHousePuzzle_Arrow_RedOnBlack_Left, FALSE + setmetatile 7, 5, METATILE_TrickHousePuzzle_Lever_On, TRUE return Route110_TrickHousePuzzle7_EventScript_SetSwitch1MetatilesOff:: - setmetatile 13, 17, METATILE_TrickHousePuzzle_Arrow_RedOnBlack_Down, 0 - setmetatile 12, 16, METATILE_TrickHousePuzzle_Lever_Off, 1 + setmetatile 13, 17, METATILE_TrickHousePuzzle_Arrow_RedOnBlack_Down, FALSE + setmetatile 12, 16, METATILE_TrickHousePuzzle_Lever_Off, TRUE return Route110_TrickHousePuzzle7_EventScript_SetSwitch2MetatilesOff:: - setmetatile 12, 13, METATILE_TrickHousePuzzle_Arrow_RedOnBlack_Left, 0 - setmetatile 12, 11, METATILE_TrickHousePuzzle_Lever_Off, 1 + setmetatile 12, 13, METATILE_TrickHousePuzzle_Arrow_RedOnBlack_Left, FALSE + setmetatile 12, 11, METATILE_TrickHousePuzzle_Lever_Off, TRUE return Route110_TrickHousePuzzle7_EventScript_SetSwitch3MetatilesOff:: - setmetatile 7, 12, METATILE_TrickHousePuzzle_Arrow_RedOnBlack_Down, 0 - setmetatile 5, 10, METATILE_TrickHousePuzzle_Lever_Off, 1 + setmetatile 7, 12, METATILE_TrickHousePuzzle_Arrow_RedOnBlack_Down, FALSE + setmetatile 5, 10, METATILE_TrickHousePuzzle_Lever_Off, TRUE return Route110_TrickHousePuzzle7_EventScript_SetSwitch4MetatilesOff:: - setmetatile 6, 6, METATILE_TrickHousePuzzle_Arrow_RedOnBlack_Left_Alt, 0 - setmetatile 4, 4, METATILE_TrickHousePuzzle_Lever_Off, 1 + setmetatile 6, 6, METATILE_TrickHousePuzzle_Arrow_RedOnBlack_Left_Alt, FALSE + setmetatile 4, 4, METATILE_TrickHousePuzzle_Lever_Off, TRUE return Route110_TrickHousePuzzle7_EventScript_SetSwitch5MetatilesOff:: - setmetatile 8, 4, METATILE_TrickHousePuzzle_Arrow_RedOnBlack_Right, 0 - setmetatile 7, 5, METATILE_TrickHousePuzzle_Lever_Off, 1 + setmetatile 8, 4, METATILE_TrickHousePuzzle_Arrow_RedOnBlack_Right, FALSE + setmetatile 7, 5, METATILE_TrickHousePuzzle_Lever_Off, TRUE return Route110_TrickHousePuzzle7_OnTransition: - compare VAR_TRICK_HOUSE_PUZZLE_7_STATE_2, 1 - goto_if_eq Route110_TrickHousePuzzle7_EventScript_TeleportedTransition + goto_if_eq VAR_TRICK_HOUSE_PUZZLE_7_STATE_2, 1, Route110_TrickHousePuzzle7_EventScript_TeleportedTransition clearflag FLAG_TRICK_HOUSE_PUZZLE_7_SWITCH_1 clearflag FLAG_TRICK_HOUSE_PUZZLE_7_SWITCH_2 clearflag FLAG_TRICK_HOUSE_PUZZLE_7_SWITCH_3 @@ -85,8 +84,7 @@ Route110_TrickHousePuzzle7_EventScript_TeleportedTransition:: end Route110_TrickHousePuzzle7_OnLoad: - compare VAR_TRICK_HOUSE_PUZZLE_7_STATE_2, 1 - call_if_eq Route110_TrickHousePuzzle7_EventScript_UpdateSwitchMetatiles + call_if_eq VAR_TRICK_HOUSE_PUZZLE_7_STATE_2, 1, Route110_TrickHousePuzzle7_EventScript_UpdateSwitchMetatiles end Route110_TrickHousePuzzle7_OnFrame: @@ -99,8 +97,7 @@ Route110_TrickHousePuzzle7_EventScript_ClearState2:: Route110_TrickHousePuzzle7_EventScript_Scroll:: lockall - compare VAR_TRICK_HOUSE_PUZZLE_7_STATE, 0 - goto_if_eq Route110_TrickHousePuzzle7_EventScript_FoundScroll + goto_if_eq VAR_TRICK_HOUSE_PUZZLE_7_STATE, 0, Route110_TrickHousePuzzle7_EventScript_FoundScroll goto Route110_TrickHousePuzzle_EventScript_ReadScrollAgain end @@ -113,7 +110,7 @@ Route110_TrickHousePuzzle7_EventScript_FoundScroll:: Route110_TrickHousePuzzle7_EventScript_TeleportPad:: lockall setvar VAR_TRICK_HOUSE_PUZZLE_7_STATE_2, 1 - warpteleport MAP_ROUTE110_TRICK_HOUSE_PUZZLE7, 255, 3, 19 + warpteleport MAP_ROUTE110_TRICK_HOUSE_PUZZLE7, 3, 19 waitstate releaseall end diff --git a/data/maps/Route110_TrickHousePuzzle8/scripts.inc b/data/maps/Route110_TrickHousePuzzle8/scripts.inc index 310751e5dfd2..371f610004ae 100644 --- a/data/maps/Route110_TrickHousePuzzle8/scripts.inc +++ b/data/maps/Route110_TrickHousePuzzle8/scripts.inc @@ -3,8 +3,7 @@ Route110_TrickHousePuzzle8_MapScripts:: Route110_TrickHousePuzzle8_EventScript_Scroll:: lockall - compare VAR_TRICK_HOUSE_PUZZLE_8_STATE, 0 - goto_if_eq Route110_TrickHousePuzzle8_EventScript_FoundScroll + goto_if_eq VAR_TRICK_HOUSE_PUZZLE_8_STATE, 0, Route110_TrickHousePuzzle8_EventScript_FoundScroll goto Route110_TrickHousePuzzle_EventScript_ReadScrollAgain end diff --git a/data/maps/Route111/scripts.inc b/data/maps/Route111/scripts.inc index 72e30958a5df..6cb83b452810 100644 --- a/data/maps/Route111/scripts.inc +++ b/data/maps/Route111/scripts.inc @@ -15,45 +15,42 @@ Route111_MapScripts:: Route111_OnLoad: call_if_unset FLAG_REGI_DOORS_OPENED, Route111_EventScript_CloseDesertRuins - compare VAR_MIRAGE_TOWER_STATE, 1 - call_if_eq Route111_EventScript_ShowTemporaryMirageTower + call_if_eq VAR_MIRAGE_TOWER_STATE, 1, Route111_EventScript_ShowTemporaryMirageTower end Route111_EventScript_CloseDesertRuins:: - setmetatile 29, 86, METATILE_General_RockWall_RockBase, 1 - setmetatile 29, 87, METATILE_General_RockWall_SandBase, 1 + setmetatile 29, 86, METATILE_General_RockWall_RockBase, TRUE + setmetatile 29, 87, METATILE_General_RockWall_SandBase, TRUE return @ Show Mirage Tower just prior to disintegration. Mirage Tower is otherwise handled by the map layout Route111_EventScript_ShowTemporaryMirageTower:: - setmetatile 18, 53, METATILE_Mauville_MirageTower_Tile0, 0 - setmetatile 19, 53, METATILE_Mauville_MirageTower_Tile1, 0 - setmetatile 20, 53, METATILE_Mauville_MirageTower_Tile2, 0 - setmetatile 18, 54, METATILE_Mauville_MirageTower_Tile3, 0 - setmetatile 19, 54, METATILE_Mauville_MirageTower_Tile4, 0 - setmetatile 20, 54, METATILE_Mauville_MirageTower_Tile5, 0 - setmetatile 18, 55, METATILE_Mauville_MirageTower_Tile6, 0 - setmetatile 19, 55, METATILE_Mauville_MirageTower_Tile7, 0 - setmetatile 20, 55, METATILE_Mauville_MirageTower_Tile8, 0 - setmetatile 18, 56, METATILE_Mauville_MirageTower_Tile9, 0 - setmetatile 19, 56, METATILE_Mauville_MirageTower_TileA, 0 - setmetatile 20, 56, METATILE_Mauville_MirageTower_TileB, 0 - setmetatile 18, 57, METATILE_Mauville_MirageTower_TileC, 0 - setmetatile 19, 57, METATILE_Mauville_MirageTower_TileD, 0 - setmetatile 20, 57, METATILE_Mauville_MirageTower_TileE, 0 - setmetatile 18, 58, METATILE_Mauville_MirageTower_TileF, 0 - setmetatile 19, 58, METATILE_Mauville_MirageTower_Tile10, 0 - setmetatile 20, 58, METATILE_Mauville_MirageTower_Tile11, 0 + setmetatile 18, 53, METATILE_Mauville_MirageTower_Tile0, FALSE + setmetatile 19, 53, METATILE_Mauville_MirageTower_Tile1, FALSE + setmetatile 20, 53, METATILE_Mauville_MirageTower_Tile2, FALSE + setmetatile 18, 54, METATILE_Mauville_MirageTower_Tile3, FALSE + setmetatile 19, 54, METATILE_Mauville_MirageTower_Tile4, FALSE + setmetatile 20, 54, METATILE_Mauville_MirageTower_Tile5, FALSE + setmetatile 18, 55, METATILE_Mauville_MirageTower_Tile6, FALSE + setmetatile 19, 55, METATILE_Mauville_MirageTower_Tile7, FALSE + setmetatile 20, 55, METATILE_Mauville_MirageTower_Tile8, FALSE + setmetatile 18, 56, METATILE_Mauville_MirageTower_Tile9, FALSE + setmetatile 19, 56, METATILE_Mauville_MirageTower_TileA, FALSE + setmetatile 20, 56, METATILE_Mauville_MirageTower_TileB, FALSE + setmetatile 18, 57, METATILE_Mauville_MirageTower_TileC, FALSE + setmetatile 19, 57, METATILE_Mauville_MirageTower_TileD, FALSE + setmetatile 20, 57, METATILE_Mauville_MirageTower_TileE, FALSE + setmetatile 18, 58, METATILE_Mauville_MirageTower_TileF, FALSE + setmetatile 19, 58, METATILE_Mauville_MirageTower_Tile10, FALSE + setmetatile 20, 58, METATILE_Mauville_MirageTower_Tile11, FALSE return Route111_OnTransition: setvar VAR_TRAINER_HILL_IS_ACTIVE, 0 special SetMirageTowerVisibility call_if_unset FLAG_MIRAGE_TOWER_VISIBLE, Route111_EventScript_SetLayoutNoMirageTower - compare VAR_MIRAGE_TOWER_STATE, 1 - call_if_eq Route111_EventScript_SetFallingPlayerGfx - compare VAR_MIRAGE_TOWER_STATE, 2 - call_if_eq Route111_EventScript_SetMirageTowerGone + call_if_eq VAR_MIRAGE_TOWER_STATE, 1, Route111_EventScript_SetFallingPlayerGfx + call_if_eq VAR_MIRAGE_TOWER_STATE, 2, Route111_EventScript_SetMirageTowerGone call Route111_EventScript_CheckSetSandstorm call GabbyAndTy_EventScript_UpdateLocation goto_if_not_defeated TRAINER_VICKY, Route111_EventScript_SetWinstratesNotDefeated @@ -61,10 +58,8 @@ Route111_OnTransition: Route111_EventScript_SetFallingPlayerGfx:: checkplayergender - compare VAR_RESULT, MALE - goto_if_eq Route111_EventScript_SetFallingPlayerGfxMale - compare VAR_RESULT, FEMALE - goto_if_eq Route111_EventScript_SetFallingPlayerGfxFemale + goto_if_eq VAR_RESULT, MALE, Route111_EventScript_SetFallingPlayerGfxMale + goto_if_eq VAR_RESULT, FEMALE, Route111_EventScript_SetFallingPlayerGfxFemale return Route111_EventScript_SetFallingPlayerGfxMale:: @@ -77,16 +72,11 @@ Route111_EventScript_SetFallingPlayerGfxFemale:: Route111_EventScript_CheckSetSandstorm:: getplayerxy VAR_TEMP_0, VAR_TEMP_1 - compare VAR_TEMP_1, 34 - goto_if_lt Route111_EventScript_EndCheckSetSandstorm - compare VAR_TEMP_1, 107 - goto_if_gt Route111_EventScript_EndCheckSetSandstorm - compare VAR_TEMP_1, 72 - goto_if_gt Route111_EventScript_SetSandstorm - compare VAR_TEMP_0, 2000 - goto_if_gt Route111_EventScript_EndCheckSetSandstorm - compare VAR_TEMP_0, 8 - goto_if_lt Route111_EventScript_EndCheckSetSandstorm + goto_if_lt VAR_TEMP_1, 34, Route111_EventScript_EndCheckSetSandstorm + goto_if_gt VAR_TEMP_1, 107, Route111_EventScript_EndCheckSetSandstorm + goto_if_gt VAR_TEMP_1, 72, Route111_EventScript_SetSandstorm + goto_if_gt VAR_TEMP_0, 2000, Route111_EventScript_EndCheckSetSandstorm + goto_if_lt VAR_TEMP_0, 8, Route111_EventScript_EndCheckSetSandstorm Route111_EventScript_SetSandstorm:: setweather WEATHER_SANDSTORM Route111_EventScript_EndCheckSetSandstorm:: @@ -170,8 +160,7 @@ Route111_EventScript_Girl:: goto_if_set FLAG_DAILY_ROUTE_111_RECEIVED_BERRY, Route111_EventScript_ReceivedBerry msgbox Route111_Text_WateredPlantsEveryDayTakeBerry, MSGBOX_DEFAULT giveitem ITEM_RAZZ_BERRY - compare VAR_RESULT, FALSE - goto_if_eq Common_EventScript_ShowBagIsFull + goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull setflag FLAG_DAILY_ROUTE_111_RECEIVED_BERRY special GetPlayerBigGuyGirlString msgbox Route111_Text_GoingToTryToMakeDifferentColorBerries, MSGBOX_DEFAULT @@ -210,9 +199,8 @@ Route111_EventScript_ViciousSandstormTriggerRight:: end Route111_EventScript_ViciousSandstormTrigger:: - checkitem ITEM_GO_GOGGLES, 1 - compare VAR_RESULT, FALSE - goto_if_eq Route111_EventScript_PreventRouteAccess + checkitem ITEM_GO_GOGGLES + goto_if_eq VAR_RESULT, FALSE, Route111_EventScript_PreventRouteAccess setvar VAR_TEMP_3, 1 releaseall end @@ -220,14 +208,10 @@ Route111_EventScript_ViciousSandstormTrigger:: Route111_EventScript_PreventRouteAccess:: msgbox gText_SandstormIsVicious, MSGBOX_DEFAULT closemessage - compare VAR_0x8004, 0 - call_if_eq Route111_EventScript_PushUpFromRoute - compare VAR_0x8004, 1 - call_if_eq Route111_EventScript_PushDownFromRoute - compare VAR_0x8004, 2 - call_if_eq Route111_EventScript_PushLeftFromRoute - compare VAR_0x8004, 3 - call_if_eq Route111_EventScript_PushRightFromRoute + call_if_eq VAR_0x8004, 0, Route111_EventScript_PushUpFromRoute + call_if_eq VAR_0x8004, 1, Route111_EventScript_PushDownFromRoute + call_if_eq VAR_0x8004, 2, Route111_EventScript_PushLeftFromRoute + call_if_eq VAR_0x8004, 3, Route111_EventScript_PushRightFromRoute releaseall end @@ -285,8 +269,7 @@ Route111_EventScript_Victor:: faceplayer setflag FLAG_LANDMARK_WINSTRATE_FAMILY msgbox Route111_Text_BattleOurFamily, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq Route111_EventScript_BattleWinstrates + goto_if_eq VAR_RESULT, YES, Route111_EventScript_BattleWinstrates msgbox Route111_Text_IsThatSo, MSGBOX_DEFAULT release end @@ -420,10 +403,8 @@ Route111_EventScript_Man2:: Route111_EventScript_Hiker:: lock faceplayer - compare VAR_MIRAGE_TOWER_STATE, 3 - goto_if_eq Route111_EventScript_HikerMirageTowerGone - compare VAR_MIRAGE_TOWER_STATE, 2 - goto_if_eq Route111_EventScript_HikerMirageTowerDisintegrated + goto_if_eq VAR_MIRAGE_TOWER_STATE, 3, Route111_EventScript_HikerMirageTowerGone + goto_if_eq VAR_MIRAGE_TOWER_STATE, 2, Route111_EventScript_HikerMirageTowerDisintegrated goto_if_set FLAG_MIRAGE_TOWER_VISIBLE, Route111_EventScript_HikerMirageTowerVisible msgbox Route111_Text_ShouldBeMirageTowerAroundHere, MSGBOX_DEFAULT release @@ -478,8 +459,7 @@ Route111_EventScript_Becky:: Route111_EventScript_Dusty:: trainerbattle_single TRAINER_DUSTY_1, Route111_Text_DustyIntro, Route111_Text_DustyDefeat, Route111_EventScript_RegisterDusty specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq Route111_EventScript_RematchDusty + goto_if_eq VAR_RESULT, TRUE, Route111_EventScript_RematchDusty msgbox Route111_Text_DustyPostBattle, MSGBOX_DEFAULT release end @@ -515,8 +495,7 @@ Route111_EventScript_Daisuke:: Route111_EventScript_Wilton:: trainerbattle_single TRAINER_WILTON_1, Route111_Text_WiltonIntro, Route111_Text_WiltonDefeat, Route111_EventScript_RegisterWilton specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq Route111_EventScript_RematchWilton + goto_if_eq VAR_RESULT, TRUE, Route111_EventScript_RematchWilton msgbox Route111_Text_WiltonPostBattle, MSGBOX_DEFAULT release end @@ -537,8 +516,7 @@ Route111_EventScript_RematchWilton:: Route111_EventScript_Brooke:: trainerbattle_single TRAINER_BROOKE_1, Route111_Text_BrookeIntro, Route111_Text_BrookeDefeat, Route111_EventScript_RegisterBrooke specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq Route111_EventScript_RematchBrooke + goto_if_eq VAR_RESULT, TRUE, Route111_EventScript_RematchBrooke msgbox Route111_Text_BrookePostBattle, MSGBOX_DEFAULT release end diff --git a/data/maps/Route111_OldLadysRestStop/scripts.inc b/data/maps/Route111_OldLadysRestStop/scripts.inc index 645ce4de4175..6b7b5a8abcca 100644 --- a/data/maps/Route111_OldLadysRestStop/scripts.inc +++ b/data/maps/Route111_OldLadysRestStop/scripts.inc @@ -10,10 +10,8 @@ Route111_OldLadysRestStop_EventScript_OldLady:: lock faceplayer msgbox Route111_OldLadysRestStop_Text_RestUpHere, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq Route111_OldLadysRestStop_EventScript_Rest - compare VAR_RESULT, NO - goto_if_eq Route111_OldLadysRestStop_EventScript_DeclineRest + goto_if_eq VAR_RESULT, YES, Route111_OldLadysRestStop_EventScript_Rest + goto_if_eq VAR_RESULT, NO, Route111_OldLadysRestStop_EventScript_DeclineRest end Route111_OldLadysRestStop_EventScript_Rest:: @@ -21,10 +19,8 @@ Route111_OldLadysRestStop_EventScript_Rest:: closemessage call Common_EventScript_OutOfCenterPartyHeal msgbox Route111_OldLadysRestStop_Text_StillTiredTakeAnotherRest, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq Route111_OldLadysRestStop_EventScript_Rest - compare VAR_RESULT, NO - goto_if_eq Route111_OldLadysRestStop_EventScript_DeclineRest + goto_if_eq VAR_RESULT, YES, Route111_OldLadysRestStop_EventScript_Rest + goto_if_eq VAR_RESULT, NO, Route111_OldLadysRestStop_EventScript_DeclineRest end Route111_OldLadysRestStop_EventScript_DeclineRest:: diff --git a/data/maps/Route111_WinstrateFamilysHouse/scripts.inc b/data/maps/Route111_WinstrateFamilysHouse/scripts.inc index eedd83f0689d..a163c7b4f2d7 100644 --- a/data/maps/Route111_WinstrateFamilysHouse/scripts.inc +++ b/data/maps/Route111_WinstrateFamilysHouse/scripts.inc @@ -21,8 +21,7 @@ Route111_WinstrateFamilysHouse_EventScript_Victoria:: goto_if_set FLAG_RECEIVED_MACHO_BRACE, Route111_WinstrateFamilysHouse_EventScript_ReceivedMachoBrace msgbox Route111_WinstrateFamilysHouse_Text_LikeYouToHaveMachoBrace, MSGBOX_DEFAULT giveitem ITEM_MACHO_BRACE - compare VAR_RESULT, FALSE - goto_if_eq Common_EventScript_ShowBagIsFull + goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull setflag FLAG_RECEIVED_MACHO_BRACE goto Route111_WinstrateFamilysHouse_EventScript_FaceOriginalDirection end diff --git a/data/maps/Route112/scripts.inc b/data/maps/Route112/scripts.inc index abea230be1ba..a6c248e1f6dd 100644 --- a/data/maps/Route112/scripts.inc +++ b/data/maps/Route112/scripts.inc @@ -71,8 +71,7 @@ Route112_EventScript_Brice:: Route112_EventScript_Trent:: trainerbattle_single TRAINER_TRENT_1, Route112_Text_TrentIntro, Route112_Text_TrentDefeat, Route112_EventScript_RegisterTrent specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq Route112_EventScript_RematchTrent + goto_if_eq VAR_RESULT, TRUE, Route112_EventScript_RematchTrent msgbox Route112_Text_TrentPostBattle, MSGBOX_DEFAULT release end diff --git a/data/maps/Route112_CableCarStation/scripts.inc b/data/maps/Route112_CableCarStation/scripts.inc index 86fe61a05b80..3ce4f62e2a4a 100644 --- a/data/maps/Route112_CableCarStation/scripts.inc +++ b/data/maps/Route112_CableCarStation/scripts.inc @@ -6,9 +6,8 @@ Route112_CableCarStation_MapScripts:: .byte 0 Route112_CableCarStation_OnTransition: - setescapewarp MAP_ROUTE112, 255, 28, 28 - compare VAR_CABLE_CAR_STATION_STATE, 2 - call_if_eq Route112_CableCarStation_EventScript_MoveAttendantAside + setescapewarp MAP_ROUTE112, 28, 28 + call_if_eq VAR_CABLE_CAR_STATION_STATE, 2, Route112_CableCarStation_EventScript_MoveAttendantAside end Route112_CableCarStation_EventScript_MoveAttendantAside:: @@ -35,10 +34,8 @@ Route112_CableCarStation_EventScript_Attendant:: lock faceplayer msgbox Route112_CableCarStation_Text_CableCarReadyGetOn, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq Route112_CableCarStation_EventScript_RideCableCar - compare VAR_RESULT, NO - goto_if_eq Route112_CableCarStation_EventScript_DeclineRide + goto_if_eq VAR_RESULT, YES, Route112_CableCarStation_EventScript_RideCableCar + goto_if_eq VAR_RESULT, NO, Route112_CableCarStation_EventScript_DeclineRide end Route112_CableCarStation_EventScript_RideCableCar:: diff --git a/data/maps/Route113/scripts.inc b/data/maps/Route113/scripts.inc index 0a8bb092c361..4f02e74b6452 100644 --- a/data/maps/Route113/scripts.inc +++ b/data/maps/Route113/scripts.inc @@ -14,10 +14,8 @@ Route113_OnTransition: Route113_EventScript_CheckSetAshWeather:: getplayerxy VAR_TEMP_0, VAR_TEMP_1 - compare VAR_TEMP_0, 19 - goto_if_lt Route113_EventScript_DontSetAshWeather - compare VAR_TEMP_0, 84 - goto_if_gt Route113_EventScript_DontSetAshWeather + goto_if_lt VAR_TEMP_0, 19, Route113_EventScript_DontSetAshWeather + goto_if_gt VAR_TEMP_0, 84, Route113_EventScript_DontSetAshWeather setweather WEATHER_VOLCANIC_ASH return @@ -61,8 +59,7 @@ Route113_EventScript_Dillon:: Route113_EventScript_Madeline:: trainerbattle_single TRAINER_MADELINE_1, Route113_Text_MadelineIntro, Route113_Text_MadelineDefeat, Route113_EventScript_RegisterMadeline specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq Route113_EventScript_RematchMadeline + goto_if_eq VAR_RESULT, TRUE, Route113_EventScript_RematchMadeline msgbox Route113_Text_MadelinePostBattle, MSGBOX_DEFAULT release end @@ -83,8 +80,7 @@ Route113_EventScript_RematchMadeline:: Route113_EventScript_Lao:: trainerbattle_single TRAINER_LAO_1, Route113_Text_LaoIntro, Route113_Text_LaoDefeat, Route113_EventScript_RegisterLao specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq Route113_EventScript_RematchLao + goto_if_eq VAR_RESULT, TRUE, Route113_EventScript_RematchLao msgbox Route113_Text_LaoPostBattle, MSGBOX_DEFAULT release end diff --git a/data/maps/Route113_GlassWorkshop/scripts.inc b/data/maps/Route113_GlassWorkshop/scripts.inc index bad739806f5c..41182b2ae558 100644 --- a/data/maps/Route113_GlassWorkshop/scripts.inc +++ b/data/maps/Route113_GlassWorkshop/scripts.inc @@ -13,8 +13,7 @@ Route113_GlassWorkshop_MapScripts:: Route113_GlassWorkshop_OnTransition: setflag FLAG_LANDMARK_GLASS_WORKSHOP - compare VAR_GLASS_WORKSHOP_STATE, 1 - call_if_eq Route113_GlassWorkshop_EventScript_ReenterWorkshopAfterSootSack + call_if_eq VAR_GLASS_WORKSHOP_STATE, 1, Route113_GlassWorkshop_EventScript_ReenterWorkshopAfterSootSack end Route113_GlassWorkshop_EventScript_ReenterWorkshopAfterSootSack:: @@ -24,12 +23,9 @@ Route113_GlassWorkshop_EventScript_ReenterWorkshopAfterSootSack:: Route113_GlassWorkshop_EventScript_GlassWorker:: lock faceplayer - compare VAR_GLASS_WORKSHOP_STATE, 10 - goto_if_ge Route113_GlassWorkshop_EventScript_GiveItemAfterNoRoom - compare VAR_GLASS_WORKSHOP_STATE, 2 - goto_if_eq Route113_GlassWorkshop_EventScript_CheckCollectedAsh - compare VAR_GLASS_WORKSHOP_STATE, 1 - goto_if_eq Route113_GlassWorkshop_EventScript_ExplainSootSack + goto_if_ge VAR_GLASS_WORKSHOP_STATE, 10, Route113_GlassWorkshop_EventScript_GiveItemAfterNoRoom + goto_if_eq VAR_GLASS_WORKSHOP_STATE, 2, Route113_GlassWorkshop_EventScript_CheckCollectedAsh + goto_if_eq VAR_GLASS_WORKSHOP_STATE, 1, Route113_GlassWorkshop_EventScript_ExplainSootSack msgbox Route113_GlassWorkshop_Text_GoCollectAshWithThis, MSGBOX_DEFAULT giveitem ITEM_SOOT_SACK setvar VAR_GLASS_WORKSHOP_STATE, 1 @@ -43,12 +39,10 @@ Route113_GlassWorkshop_EventScript_ExplainSootSack:: end Route113_GlassWorkshop_EventScript_CheckCollectedAsh:: - checkitem ITEM_SOOT_SACK, 1 - compare VAR_RESULT, FALSE - goto_if_eq Route113_GlassWorkshop_EventScript_SootSackNotInBag + checkitem ITEM_SOOT_SACK + goto_if_eq VAR_RESULT, FALSE, Route113_GlassWorkshop_EventScript_SootSackNotInBag msgbox Route113_GlassWorkshop_Text_LetsSeeCollectedAshes, MSGBOX_DEFAULT - compare VAR_ASH_GATHER_COUNT, LOWEST_ASH_PRICE - goto_if_lt Route113_GlassWorkshop_EventScript_NotEnoughAsh + goto_if_lt VAR_ASH_GATHER_COUNT, LOWEST_ASH_PRICE, Route113_GlassWorkshop_EventScript_NotEnoughAsh message Route113_GlassWorkshop_Text_WhichGlassItemWoudYouLike waitmessage goto Route113_GlassWorkshop_EventScript_ChooseGlassItem @@ -78,13 +72,11 @@ Route113_GlassWorkshop_EventScript_ChooseGlassItem:: Route113_GlassWorkshop_EventScript_BlueFlute:: setvar VAR_0x8008, ITEM_BLUE_FLUTE - bufferitemname 0, VAR_0x8008 + bufferitemname STR_VAR_1, VAR_0x8008 setvar VAR_0x800A, BLUE_FLUTE_PRICE - compare VAR_ASH_GATHER_COUNT, BLUE_FLUTE_PRICE - goto_if_lt Route113_GlassWorkshop_EventScript_NotEnoughAshForItem + goto_if_lt VAR_ASH_GATHER_COUNT, BLUE_FLUTE_PRICE, Route113_GlassWorkshop_EventScript_NotEnoughAshForItem msgbox Route113_GlassWorkshop_Text_IsThatTheItemForYou, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq Route113_GlassWorkshop_EventScript_ChooseDifferentItem + goto_if_eq VAR_RESULT, NO, Route113_GlassWorkshop_EventScript_ChooseDifferentItem setvar VAR_GLASS_WORKSHOP_STATE, 10 subvar VAR_ASH_GATHER_COUNT, BLUE_FLUTE_PRICE goto Route113_GlassWorkshop_EventScript_MakeGlassItem @@ -92,13 +84,11 @@ Route113_GlassWorkshop_EventScript_BlueFlute:: Route113_GlassWorkshop_EventScript_YellowFlute:: setvar VAR_0x8008, ITEM_YELLOW_FLUTE - bufferitemname 0, VAR_0x8008 + bufferitemname STR_VAR_1, VAR_0x8008 setvar VAR_0x800A, YELLOW_FLUTE_PRICE - compare VAR_ASH_GATHER_COUNT, YELLOW_FLUTE_PRICE - goto_if_lt Route113_GlassWorkshop_EventScript_NotEnoughAshForItem + goto_if_lt VAR_ASH_GATHER_COUNT, YELLOW_FLUTE_PRICE, Route113_GlassWorkshop_EventScript_NotEnoughAshForItem msgbox Route113_GlassWorkshop_Text_IsThatTheItemForYou, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq Route113_GlassWorkshop_EventScript_ChooseDifferentItem + goto_if_eq VAR_RESULT, NO, Route113_GlassWorkshop_EventScript_ChooseDifferentItem setvar VAR_GLASS_WORKSHOP_STATE, 11 subvar VAR_ASH_GATHER_COUNT, YELLOW_FLUTE_PRICE goto Route113_GlassWorkshop_EventScript_MakeGlassItem @@ -106,13 +96,11 @@ Route113_GlassWorkshop_EventScript_YellowFlute:: Route113_GlassWorkshop_EventScript_RedFlute:: setvar VAR_0x8008, ITEM_RED_FLUTE - bufferitemname 0, VAR_0x8008 + bufferitemname STR_VAR_1, VAR_0x8008 setvar VAR_0x800A, RED_FLUTE_PRICE - compare VAR_ASH_GATHER_COUNT, RED_FLUTE_PRICE - goto_if_lt Route113_GlassWorkshop_EventScript_NotEnoughAshForItem + goto_if_lt VAR_ASH_GATHER_COUNT, RED_FLUTE_PRICE, Route113_GlassWorkshop_EventScript_NotEnoughAshForItem msgbox Route113_GlassWorkshop_Text_IsThatTheItemForYou, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq Route113_GlassWorkshop_EventScript_ChooseDifferentItem + goto_if_eq VAR_RESULT, NO, Route113_GlassWorkshop_EventScript_ChooseDifferentItem setvar VAR_GLASS_WORKSHOP_STATE, 12 subvar VAR_ASH_GATHER_COUNT, RED_FLUTE_PRICE goto Route113_GlassWorkshop_EventScript_MakeGlassItem @@ -120,13 +108,11 @@ Route113_GlassWorkshop_EventScript_RedFlute:: Route113_GlassWorkshop_EventScript_WhiteFlute:: setvar VAR_0x8008, ITEM_WHITE_FLUTE - bufferitemname 0, VAR_0x8008 + bufferitemname STR_VAR_1, VAR_0x8008 setvar VAR_0x800A, WHITE_FLUTE_PRICE - compare VAR_ASH_GATHER_COUNT, WHITE_FLUTE_PRICE - goto_if_lt Route113_GlassWorkshop_EventScript_NotEnoughAshForItem + goto_if_lt VAR_ASH_GATHER_COUNT, WHITE_FLUTE_PRICE, Route113_GlassWorkshop_EventScript_NotEnoughAshForItem msgbox Route113_GlassWorkshop_Text_IsThatTheItemForYou, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq Route113_GlassWorkshop_EventScript_ChooseDifferentItem + goto_if_eq VAR_RESULT, NO, Route113_GlassWorkshop_EventScript_ChooseDifferentItem setvar VAR_GLASS_WORKSHOP_STATE, 13 subvar VAR_ASH_GATHER_COUNT, WHITE_FLUTE_PRICE goto Route113_GlassWorkshop_EventScript_MakeGlassItem @@ -134,13 +120,11 @@ Route113_GlassWorkshop_EventScript_WhiteFlute:: Route113_GlassWorkshop_EventScript_BlackFlute:: setvar VAR_0x8008, ITEM_BLACK_FLUTE - bufferitemname 0, VAR_0x8008 + bufferitemname STR_VAR_1, VAR_0x8008 setvar VAR_0x800A, BLACK_FLUTE_PRICE - compare VAR_ASH_GATHER_COUNT, BLACK_FLUTE_PRICE - goto_if_lt Route113_GlassWorkshop_EventScript_NotEnoughAshForItem + goto_if_lt VAR_ASH_GATHER_COUNT, BLACK_FLUTE_PRICE, Route113_GlassWorkshop_EventScript_NotEnoughAshForItem msgbox Route113_GlassWorkshop_Text_IsThatTheItemForYou, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq Route113_GlassWorkshop_EventScript_ChooseDifferentItem + goto_if_eq VAR_RESULT, NO, Route113_GlassWorkshop_EventScript_ChooseDifferentItem setvar VAR_GLASS_WORKSHOP_STATE, 14 subvar VAR_ASH_GATHER_COUNT, BLACK_FLUTE_PRICE goto Route113_GlassWorkshop_EventScript_MakeGlassItem @@ -149,13 +133,11 @@ Route113_GlassWorkshop_EventScript_BlackFlute:: Route113_GlassWorkshop_EventScript_PrettyChair:: setvar VAR_0x8009, 1 setvar VAR_0x8008, DECOR_PRETTY_CHAIR - bufferdecorationname 0, VAR_0x8008 + bufferdecorationname STR_VAR_1, VAR_0x8008 setvar VAR_0x800A, PRETTY_CHAIR_PRICE - compare VAR_ASH_GATHER_COUNT, PRETTY_CHAIR_PRICE - goto_if_lt Route113_GlassWorkshop_EventScript_NotEnoughAshForItem + goto_if_lt VAR_ASH_GATHER_COUNT, PRETTY_CHAIR_PRICE, Route113_GlassWorkshop_EventScript_NotEnoughAshForItem msgbox Route113_GlassWorkshop_Text_IsThatTheItemForYou, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq Route113_GlassWorkshop_EventScript_ChooseDifferentItem + goto_if_eq VAR_RESULT, NO, Route113_GlassWorkshop_EventScript_ChooseDifferentItem setvar VAR_GLASS_WORKSHOP_STATE, 15 subvar VAR_ASH_GATHER_COUNT, PRETTY_CHAIR_PRICE goto Route113_GlassWorkshop_EventScript_MakeGlassItem @@ -164,13 +146,11 @@ Route113_GlassWorkshop_EventScript_PrettyChair:: Route113_GlassWorkshop_EventScript_PrettyDesk:: setvar VAR_0x8009, 1 setvar VAR_0x8008, DECOR_PRETTY_DESK - bufferdecorationname 0, VAR_0x8008 + bufferdecorationname STR_VAR_1, VAR_0x8008 setvar VAR_0x800A, PRETTY_DESK_PRICE - compare VAR_ASH_GATHER_COUNT, PRETTY_DESK_PRICE - goto_if_lt Route113_GlassWorkshop_EventScript_NotEnoughAshForItem + goto_if_lt VAR_ASH_GATHER_COUNT, PRETTY_DESK_PRICE, Route113_GlassWorkshop_EventScript_NotEnoughAshForItem msgbox Route113_GlassWorkshop_Text_IsThatTheItemForYou, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq Route113_GlassWorkshop_EventScript_ChooseDifferentItem + goto_if_eq VAR_RESULT, NO, Route113_GlassWorkshop_EventScript_ChooseDifferentItem setvar VAR_GLASS_WORKSHOP_STATE, 16 subvar VAR_ASH_GATHER_COUNT, PRETTY_DESK_PRICE goto Route113_GlassWorkshop_EventScript_MakeGlassItem @@ -184,14 +164,14 @@ Route113_GlassWorkshop_EventScript_CancelGlassItemSelect:: Route113_GlassWorkshop_EventScript_NotEnoughAsh:: setvar VAR_0x800A, LOWEST_ASH_PRICE subvar VAR_0x800A, VAR_ASH_GATHER_COUNT - buffernumberstring 0, VAR_0x800A + buffernumberstring STR_VAR_1, VAR_0x800A msgbox Route113_GlassWorkshop_Text_NotEnoughAshNeedX, MSGBOX_DEFAULT release end Route113_GlassWorkshop_EventScript_NotEnoughAshForItem:: subvar VAR_0x800A, VAR_ASH_GATHER_COUNT - buffernumberstring 1, VAR_0x800A + buffernumberstring STR_VAR_2, VAR_0x800A message Route113_GlassWorkshop_Text_NotEnoughAshToMakeItem waitmessage goto Route113_GlassWorkshop_EventScript_ChooseGlassItem @@ -211,24 +191,20 @@ Route113_GlassWorkshop_EventScript_MakeGlassItem:: delay 30 fadescreen FADE_FROM_BLACK msgbox Route113_GlassWorkshop_Text_IveFinishedGlassItem, MSGBOX_DEFAULT - compare VAR_0x8009, 0 - call_if_eq Route113_GlassWorkshop_EventScript_GiveGlassFlute - compare VAR_0x8009, 1 - call_if_eq Route113_GlassWorkshop_EventScript_GiveGlassDecor + call_if_eq VAR_0x8009, 0, Route113_GlassWorkshop_EventScript_GiveGlassFlute + call_if_eq VAR_0x8009, 1, Route113_GlassWorkshop_EventScript_GiveGlassDecor setvar VAR_GLASS_WORKSHOP_STATE, 2 release end Route113_GlassWorkshop_EventScript_GiveGlassFlute:: giveitem VAR_0x8008 - compare VAR_RESULT, FALSE - goto_if_eq Route113_GlassWorkshop_EventScript_NoRoomForFlute + goto_if_eq VAR_RESULT, FALSE, Route113_GlassWorkshop_EventScript_NoRoomForFlute return Route113_GlassWorkshop_EventScript_GiveGlassDecor:: givedecoration VAR_0x8008 - compare VAR_RESULT, FALSE - goto_if_eq Route113_GlassWorkshop_EventScript_NoRoomForDecor + goto_if_eq VAR_RESULT, FALSE, Route113_GlassWorkshop_EventScript_NoRoomForDecor return Route113_GlassWorkshop_EventScript_NoRoomForFlute:: @@ -257,58 +233,56 @@ Route113_GlassWorkshop_EventScript_GiveItemAfterNoRoom:: Route113_GlassWorkshop_EventScript_GiveBlueFlute:: setvar VAR_0x8009, 0 setvar VAR_0x8008, ITEM_BLUE_FLUTE - bufferitemname 0, VAR_0x8008 + bufferitemname STR_VAR_1, VAR_0x8008 goto Route113_GlassWorkshop_EventScript_TryGiveItemAgain end Route113_GlassWorkshop_EventScript_GiveYellowFlute:: setvar VAR_0x8009, 0 setvar VAR_0x8008, ITEM_YELLOW_FLUTE - bufferitemname 0, VAR_0x8008 + bufferitemname STR_VAR_1, VAR_0x8008 goto Route113_GlassWorkshop_EventScript_TryGiveItemAgain end Route113_GlassWorkshop_EventScript_GiveRedFlute:: setvar VAR_0x8009, 0 setvar VAR_0x8008, ITEM_RED_FLUTE - bufferitemname 0, VAR_0x8008 + bufferitemname STR_VAR_1, VAR_0x8008 goto Route113_GlassWorkshop_EventScript_TryGiveItemAgain end Route113_GlassWorkshop_EventScript_GiveWhiteFlute:: setvar VAR_0x8009, 0 setvar VAR_0x8008, ITEM_WHITE_FLUTE - bufferitemname 0, VAR_0x8008 + bufferitemname STR_VAR_1, VAR_0x8008 goto Route113_GlassWorkshop_EventScript_TryGiveItemAgain end Route113_GlassWorkshop_EventScript_GiveBlackFlute:: setvar VAR_0x8009, 0 setvar VAR_0x8008, ITEM_BLACK_FLUTE - bufferitemname 0, VAR_0x8008 + bufferitemname STR_VAR_1, VAR_0x8008 goto Route113_GlassWorkshop_EventScript_TryGiveItemAgain end Route113_GlassWorkshop_EventScript_GivePrettyChair:: setvar VAR_0x8009, 1 setvar VAR_0x8008, DECOR_PRETTY_CHAIR - bufferdecorationname 0, DECOR_PRETTY_CHAIR + bufferdecorationname STR_VAR_1, DECOR_PRETTY_CHAIR goto Route113_GlassWorkshop_EventScript_TryGiveItemAgain end Route113_GlassWorkshop_EventScript_GivePrettyDesk:: setvar VAR_0x8009, 1 setvar VAR_0x8008, DECOR_PRETTY_DESK - bufferdecorationname 0, DECOR_PRETTY_DESK + bufferdecorationname STR_VAR_1, DECOR_PRETTY_DESK goto Route113_GlassWorkshop_EventScript_TryGiveItemAgain end Route113_GlassWorkshop_EventScript_TryGiveItemAgain:: msgbox Route113_GlassWorkshop_Text_IveFinishedGlassItem, MSGBOX_DEFAULT - compare VAR_0x8009, 0 - call_if_eq Route113_GlassWorkshop_EventScript_GiveGlassFlute - compare VAR_0x8009, 1 - call_if_eq Route113_GlassWorkshop_EventScript_GiveGlassDecor + call_if_eq VAR_0x8009, 0, Route113_GlassWorkshop_EventScript_GiveGlassFlute + call_if_eq VAR_0x8009, 1, Route113_GlassWorkshop_EventScript_GiveGlassDecor setvar VAR_GLASS_WORKSHOP_STATE, 2 release end diff --git a/data/maps/Route114/scripts.inc b/data/maps/Route114/scripts.inc index c0420fbf611d..abf70ea08163 100644 --- a/data/maps/Route114/scripts.inc +++ b/data/maps/Route114/scripts.inc @@ -5,19 +5,14 @@ Route114_MapScripts:: .byte 0 Route114_OnTransition: - compare VAR_SHOULD_END_ABNORMAL_WEATHER, 1 - call_if_eq AbnormalWeather_EventScript_HideMapNamePopup - compare VAR_ABNORMAL_WEATHER_LOCATION, ABNORMAL_WEATHER_ROUTE_114_NORTH - call_if_eq AbnormalWeather_StartGroudonWeather - compare VAR_ABNORMAL_WEATHER_LOCATION, ABNORMAL_WEATHER_ROUTE_114_SOUTH - call_if_eq AbnormalWeather_StartGroudonWeather + call_if_eq VAR_SHOULD_END_ABNORMAL_WEATHER, 1, AbnormalWeather_EventScript_HideMapNamePopup + call_if_eq VAR_ABNORMAL_WEATHER_LOCATION, ABNORMAL_WEATHER_ROUTE_114_NORTH, AbnormalWeather_StartGroudonWeather + call_if_eq VAR_ABNORMAL_WEATHER_LOCATION, ABNORMAL_WEATHER_ROUTE_114_SOUTH, AbnormalWeather_StartGroudonWeather end Route114_OnLoad: - compare VAR_ABNORMAL_WEATHER_LOCATION, ABNORMAL_WEATHER_ROUTE_114_NORTH - call_if_eq AbnormalWeather_EventScript_PlaceTilesRoute114North - compare VAR_ABNORMAL_WEATHER_LOCATION, ABNORMAL_WEATHER_ROUTE_114_SOUTH - call_if_eq AbnormalWeather_EventScript_PlaceTilesRoute114South + call_if_eq VAR_ABNORMAL_WEATHER_LOCATION, ABNORMAL_WEATHER_ROUTE_114_NORTH, AbnormalWeather_EventScript_PlaceTilesRoute114North + call_if_eq VAR_ABNORMAL_WEATHER_LOCATION, ABNORMAL_WEATHER_ROUTE_114_SOUTH, AbnormalWeather_EventScript_PlaceTilesRoute114South end Route114_OnFrame: @@ -34,8 +29,7 @@ Route114_EventScript_Man:: addvar VAR_RESULT, NUM_ROUTE_114_MAN_BERRIES_SKIPPED addvar VAR_RESULT, FIRST_BERRY_INDEX giveitem VAR_RESULT - compare VAR_RESULT, FALSE - goto_if_eq Common_EventScript_ShowBagIsFull + goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull setflag FLAG_DAILY_ROUTE_114_RECEIVED_BERRY msgbox Route114_Text_TryBerryCrushWithFriends, MSGBOX_DEFAULT release @@ -52,8 +46,7 @@ Route114_EventScript_RoarGentleman:: goto_if_set FLAG_RECEIVED_TM05, Route114_EventScript_ReceivedRoar msgbox Route114_Text_AllMyMonDoesIsRoarTakeThis, MSGBOX_DEFAULT giveitem ITEM_TM05 - compare VAR_RESULT, FALSE - goto_if_eq Common_EventScript_ShowBagIsFull + goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull setflag FLAG_RECEIVED_TM05 msgbox Route114_Text_ExplainRoar, MSGBOX_DEFAULT release @@ -109,8 +102,7 @@ Route114_EventScript_Nancy:: Route114_EventScript_Steve:: trainerbattle_single TRAINER_STEVE_1, Route114_Text_SteveIntro, Route114_Text_SteveDefeat, Route114_EventScript_RegisterSteve specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq Route114_EventScript_RematchSteve + goto_if_eq VAR_RESULT, TRUE, Route114_EventScript_RematchSteve msgbox Route114_Text_StevePostBattle, MSGBOX_DEFAULT release end @@ -131,8 +123,7 @@ Route114_EventScript_RematchSteve:: Route114_EventScript_Bernie:: trainerbattle_single TRAINER_BERNIE_1, Route114_Text_BernieIntro, Route114_Text_BernieDefeat, Route114_EventScript_RegisterBernie specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq Route114_EventScript_RematchBernie + goto_if_eq VAR_RESULT, TRUE, Route114_EventScript_RematchBernie msgbox Route114_Text_BerniePostBattle, MSGBOX_DEFAULT release end diff --git a/data/maps/Route114_FossilManiacsHouse/scripts.inc b/data/maps/Route114_FossilManiacsHouse/scripts.inc index f291cd5ee4ef..ba3c0c60e591 100644 --- a/data/maps/Route114_FossilManiacsHouse/scripts.inc +++ b/data/maps/Route114_FossilManiacsHouse/scripts.inc @@ -12,8 +12,7 @@ Route114_FossilManiacsHouse_EventScript_FossilManiacsBrother:: goto_if_set FLAG_RECEIVED_TM28, Route114_FossilManiacsHouse_EventScript_ReceivedDig msgbox Route114_FossilManiacsHouse_Text_HaveThisToDigLikeMyBrother, MSGBOX_DEFAULT giveitem ITEM_TM28 - compare VAR_RESULT, FALSE - goto_if_eq Common_EventScript_ShowBagIsFull + goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull setflag FLAG_RECEIVED_TM28 release end diff --git a/data/maps/Route114_FossilManiacsTunnel/scripts.inc b/data/maps/Route114_FossilManiacsTunnel/scripts.inc index 3a6dd785cc47..72138bbe4006 100644 --- a/data/maps/Route114_FossilManiacsTunnel/scripts.inc +++ b/data/maps/Route114_FossilManiacsTunnel/scripts.inc @@ -19,8 +19,8 @@ Route114_FossilManiacsTunnel_OnLoad: end Route114_FossilManiacsTunnel_EventScript_CloseDesertUnderpass:: - setmetatile 6, 1, METATILE_Fallarbor_RedRockWall, 1 - setmetatile 6, 2, METATILE_Fallarbor_RedRockWall, 1 + setmetatile 6, 1, METATILE_Fallarbor_RedRockWall, TRUE + setmetatile 6, 2, METATILE_Fallarbor_RedRockWall, TRUE return Route114_FossilManiacsTunnel_EventScript_ManiacMentionCaveIn:: @@ -37,12 +37,10 @@ Route114_FossilManiacsTunnel_EventScript_FossilManiac:: lock faceplayer goto_if_set FLAG_RECEIVED_REVIVED_FOSSIL_MON, Route114_FossilManiacsTunnel_EventScript_PlayerRevivedFossil - checkitem ITEM_ROOT_FOSSIL, 1 - compare VAR_RESULT, TRUE - goto_if_eq Route114_FossilManiacsTunnel_EventScript_PlayerHasFossil - checkitem ITEM_CLAW_FOSSIL, 1 - compare VAR_RESULT, TRUE - goto_if_eq Route114_FossilManiacsTunnel_EventScript_PlayerHasFossil + checkitem ITEM_ROOT_FOSSIL + goto_if_eq VAR_RESULT, TRUE, Route114_FossilManiacsTunnel_EventScript_PlayerHasFossil + checkitem ITEM_CLAW_FOSSIL + goto_if_eq VAR_RESULT, TRUE, Route114_FossilManiacsTunnel_EventScript_PlayerHasFossil msgbox Route114_FossilManiacsTunnel_Text_LookInDesertForFossils, MSGBOX_DEFAULT release end diff --git a/data/maps/Route114_LanettesHouse/scripts.inc b/data/maps/Route114_LanettesHouse/scripts.inc index 5a7ccb34158f..9143b279540c 100644 --- a/data/maps/Route114_LanettesHouse/scripts.inc +++ b/data/maps/Route114_LanettesHouse/scripts.inc @@ -13,8 +13,7 @@ Route114_LanettesHouse_EventScript_Lanette:: setflag FLAG_SYS_PC_LANETTE msgbox Route114_LanettesHouse_Text_EverythingClutteredKeepThis, MSGBOX_DEFAULT givedecoration DECOR_LOTAD_DOLL - compare VAR_RESULT, FALSE - goto_if_eq Common_EventScript_ShowNoRoomForDecor + goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowNoRoomForDecor setflag FLAG_RECEIVED_DOLL_LANETTE release end @@ -27,16 +26,14 @@ Route114_LanettesHouse_EventScript_OfferAdvice:: Route114_LanettesHouse_EventScript_Notebook:: lockall msgbox Route114_LanettesHouse_Text_ResearchNotesPage1, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq Route114_LanettesHouse_EventScript_NotebookPage2 + goto_if_eq VAR_RESULT, YES, Route114_LanettesHouse_EventScript_NotebookPage2 msgbox Route114_LanettesHouse_Text_ClosedTheNotebook, MSGBOX_DEFAULT releaseall end Route114_LanettesHouse_EventScript_NotebookPage2:: msgbox Route114_LanettesHouse_Text_ResearchNotesPage2, MSGBOX_YESNO - compare VAR_RESULT, YES - call_if_eq Route114_LanettesHouse_EventScript_NotebookPage3 + call_if_eq VAR_RESULT, YES, Route114_LanettesHouse_EventScript_NotebookPage3 releaseall end diff --git a/data/maps/Route115/scripts.inc b/data/maps/Route115/scripts.inc index 600e6751f2fa..e00fdb27dc91 100644 --- a/data/maps/Route115/scripts.inc +++ b/data/maps/Route115/scripts.inc @@ -5,19 +5,14 @@ Route115_MapScripts:: .byte 0 Route115_OnLoad: - compare VAR_ABNORMAL_WEATHER_LOCATION, ABNORMAL_WEATHER_ROUTE_115_WEST - call_if_eq AbnormalWeather_EventScript_PlaceTilesRoute115West - compare VAR_ABNORMAL_WEATHER_LOCATION, ABNORMAL_WEATHER_ROUTE_115_EAST - call_if_eq AbnormalWeather_EventScript_PlaceTilesRoute115East + call_if_eq VAR_ABNORMAL_WEATHER_LOCATION, ABNORMAL_WEATHER_ROUTE_115_WEST, AbnormalWeather_EventScript_PlaceTilesRoute115West + call_if_eq VAR_ABNORMAL_WEATHER_LOCATION, ABNORMAL_WEATHER_ROUTE_115_EAST, AbnormalWeather_EventScript_PlaceTilesRoute115East end Route115_OnTransition: - compare VAR_SHOULD_END_ABNORMAL_WEATHER, 1 - call_if_eq AbnormalWeather_EventScript_HideMapNamePopup - compare VAR_ABNORMAL_WEATHER_LOCATION, ABNORMAL_WEATHER_ROUTE_115_WEST - call_if_eq AbnormalWeather_StartGroudonWeather - compare VAR_ABNORMAL_WEATHER_LOCATION, ABNORMAL_WEATHER_ROUTE_115_EAST - call_if_eq AbnormalWeather_StartGroudonWeather + call_if_eq VAR_SHOULD_END_ABNORMAL_WEATHER, 1, AbnormalWeather_EventScript_HideMapNamePopup + call_if_eq VAR_ABNORMAL_WEATHER_LOCATION, ABNORMAL_WEATHER_ROUTE_115_WEST, AbnormalWeather_StartGroudonWeather + call_if_eq VAR_ABNORMAL_WEATHER_LOCATION, ABNORMAL_WEATHER_ROUTE_115_EAST, AbnormalWeather_StartGroudonWeather end Route115_OnFrame: @@ -39,8 +34,7 @@ Route115_EventScript_MeteorFallsSign:: Route115_EventScript_Timothy:: trainerbattle_single TRAINER_TIMOTHY_1, Route115_Text_TimothyIntro, Route115_Text_TimothyDefeat, Route115_EventScript_RegisterTimothy specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq Route115_EventScript_RematchTimothy + goto_if_eq VAR_RESULT, TRUE, Route115_EventScript_RematchTimothy msgbox Route115_Text_TimothyPostBattle, MSGBOX_DEFAULT release end @@ -66,8 +60,7 @@ Route115_EventScript_Koichi:: Route115_EventScript_Nob:: trainerbattle_single TRAINER_NOB_1, Route115_Text_NobIntro, Route115_Text_NobDefeat, Route115_EventScript_RegisterNob specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq Route115_EventScript_RematchNob + goto_if_eq VAR_RESULT, TRUE, Route115_EventScript_RematchNob msgbox Route115_Text_NobPostBattle, MSGBOX_DEFAULT release end @@ -88,8 +81,7 @@ Route115_EventScript_RematchNob:: Route115_EventScript_Cyndy:: trainerbattle_single TRAINER_CYNDY_1, Route115_Text_CyndyIntro, Route115_Text_CyndyDefeat, Route115_EventScript_RegisterCyndy specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq Route115_EventScript_RematchCyndy + goto_if_eq VAR_RESULT, TRUE, Route115_EventScript_RematchCyndy msgbox Route115_Text_CyndyPostBattle, MSGBOX_DEFAULT release end diff --git a/data/maps/Route116/scripts.inc b/data/maps/Route116/scripts.inc index 0ef6a05e1aa5..2a464d199655 100644 --- a/data/maps/Route116/scripts.inc +++ b/data/maps/Route116/scripts.inc @@ -9,12 +9,9 @@ Route116_MapScripts:: Route116_OnTransition: call_if_set FLAG_RECOVERED_DEVON_GOODS, Route116_EventScript_SetWandasBoyfriendPos - compare VAR_SHOULD_END_ABNORMAL_WEATHER, 1 - call_if_eq AbnormalWeather_EventScript_HideMapNamePopup - compare VAR_ABNORMAL_WEATHER_LOCATION, ABNORMAL_WEATHER_ROUTE_116_NORTH - call_if_eq AbnormalWeather_StartGroudonWeather - compare VAR_ABNORMAL_WEATHER_LOCATION, ABNORMAL_WEATHER_ROUTE_116_SOUTH - call_if_eq AbnormalWeather_StartGroudonWeather + call_if_eq VAR_SHOULD_END_ABNORMAL_WEATHER, 1, AbnormalWeather_EventScript_HideMapNamePopup + call_if_eq VAR_ABNORMAL_WEATHER_LOCATION, ABNORMAL_WEATHER_ROUTE_116_NORTH, AbnormalWeather_StartGroudonWeather + call_if_eq VAR_ABNORMAL_WEATHER_LOCATION, ABNORMAL_WEATHER_ROUTE_116_SOUTH, AbnormalWeather_StartGroudonWeather end Route116_EventScript_SetWandasBoyfriendPos:: @@ -22,10 +19,8 @@ Route116_EventScript_SetWandasBoyfriendPos:: return Route116_OnLoad: - compare VAR_ABNORMAL_WEATHER_LOCATION, ABNORMAL_WEATHER_ROUTE_116_NORTH - call_if_eq AbnormalWeather_EventScript_PlaceTilesRoute116North - compare VAR_ABNORMAL_WEATHER_LOCATION, ABNORMAL_WEATHER_ROUTE_116_SOUTH - call_if_eq AbnormalWeather_EventScript_PlaceTilesRoute116South + call_if_eq VAR_ABNORMAL_WEATHER_LOCATION, ABNORMAL_WEATHER_ROUTE_116_NORTH, AbnormalWeather_EventScript_PlaceTilesRoute116North + call_if_eq VAR_ABNORMAL_WEATHER_LOCATION, ABNORMAL_WEATHER_ROUTE_116_SOUTH, AbnormalWeather_EventScript_PlaceTilesRoute116South end Route116_OnFrame: @@ -62,18 +57,13 @@ Route116_EventScript_DevonEmployee:: Route116_EventScript_GiveRepeatBall:: setflag FLAG_MET_DEVON_EMPLOYEE giveitem ITEM_REPEAT_BALL - compare VAR_RESULT, FALSE - goto_if_eq Route116_EventScript_NoRoomForRepeatBall + goto_if_eq VAR_RESULT, FALSE, Route116_EventScript_NoRoomForRepeatBall msgbox Route116_Text_NewBallAvailableAtMart, MSGBOX_DEFAULT closemessage - compare VAR_FACING, DIR_NORTH - call_if_eq Route116_EventScript_DevonEmployeeExit - compare VAR_FACING, DIR_SOUTH - call_if_eq Route116_EventScript_DevonEmployeeExit - compare VAR_FACING, DIR_WEST - call_if_eq Route116_EventScript_DevonEmployeeExit - compare VAR_FACING, DIR_EAST - call_if_eq Route116_EventScript_DevonEmployeeExitEast + call_if_eq VAR_FACING, DIR_NORTH, Route116_EventScript_DevonEmployeeExit + call_if_eq VAR_FACING, DIR_SOUTH, Route116_EventScript_DevonEmployeeExit + call_if_eq VAR_FACING, DIR_WEST, Route116_EventScript_DevonEmployeeExit + call_if_eq VAR_FACING, DIR_EAST, Route116_EventScript_DevonEmployeeExitEast removeobject VAR_LAST_TALKED clearflag FLAG_HIDE_RUSTBORO_CITY_DEVON_CORP_3F_EMPLOYEE setflag FLAG_RECEIVED_REPEAT_BALL @@ -165,12 +155,10 @@ Route116_EventScript_BrineyTrigger:: Route116_EventScript_GlassesMan:: lock faceplayer - checkitem ITEM_BLACK_GLASSES, 1 - compare VAR_RESULT, TRUE - goto_if_eq Route116_EventScript_PlayerHasGlasses + checkitem ITEM_BLACK_GLASSES + goto_if_eq VAR_RESULT, TRUE, Route116_EventScript_PlayerHasGlasses specialvar VAR_RESULT, FoundBlackGlasses - compare VAR_RESULT, TRUE - goto_if_eq Route116_EventScript_FoundGlassesNotOnPlayer + goto_if_eq VAR_RESULT, TRUE, Route116_EventScript_FoundGlassesNotOnPlayer msgbox Route116_Text_CanYouHelpMeFindGlasses, MSGBOX_DEFAULT release end @@ -185,8 +173,7 @@ Route116_EventScript_PlayerHasGlasses:: msgbox Route116_Text_CanYouHelpMeFindGlasses, MSGBOX_DEFAULT msgbox Route116_Text_MayISeeThoseGlasses, MSGBOX_DEFAULT specialvar VAR_RESULT, FoundBlackGlasses - compare VAR_RESULT, TRUE - goto_if_eq Route116_EventScript_FoundGlassesOnPlayer + goto_if_eq VAR_RESULT, TRUE, Route116_EventScript_FoundGlassesOnPlayer msgbox Route116_Text_NotWhatImLookingFor, MSGBOX_DEFAULT release end @@ -199,14 +186,10 @@ Route116_EventScript_FoundGlassesOnPlayer:: Route116_EventScript_GlassesManExit:: delay 20 - compare VAR_FACING, DIR_NORTH - call_if_eq Route116_EventScript_GlassesManExitNormal - compare VAR_FACING, DIR_SOUTH - call_if_eq Route116_EventScript_GlassesManExitNormal - compare VAR_FACING, DIR_WEST - call_if_eq Route116_EventScript_GlassesManExitNormal - compare VAR_FACING, DIR_EAST - call_if_eq Route116_EventScript_GlassesManExitEast + call_if_eq VAR_FACING, DIR_NORTH, Route116_EventScript_GlassesManExitNormal + call_if_eq VAR_FACING, DIR_SOUTH, Route116_EventScript_GlassesManExitNormal + call_if_eq VAR_FACING, DIR_WEST, Route116_EventScript_GlassesManExitNormal + call_if_eq VAR_FACING, DIR_EAST, Route116_EventScript_GlassesManExitEast removeobject VAR_LAST_TALKED release end @@ -259,12 +242,10 @@ Route116_EventScript_Jose:: Route116_EventScript_Jerry:: trainerbattle_single TRAINER_JERRY_1, Route116_Text_JerryIntro, Route116_Text_JerryDefeat, Route116_EventScript_TryRegisterJerryAfterBattle specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq Route116_EventScript_RematchJerry + goto_if_eq VAR_RESULT, TRUE, Route116_EventScript_RematchJerry setvar VAR_0x8004, TRAINER_JERRY_1 specialvar VAR_RESULT, IsTrainerRegistered - compare VAR_RESULT, FALSE - goto_if_eq Route116_EventScript_TryRegisterJerry + goto_if_eq VAR_RESULT, FALSE, Route116_EventScript_TryRegisterJerry msgbox Route116_Text_JerryPostBattle, MSGBOX_DEFAULT release end @@ -312,12 +293,10 @@ Route116_EventScript_Janice:: Route116_EventScript_Karen:: trainerbattle_single TRAINER_KAREN_1, Route116_Text_KarenIntro, Route116_Text_KarenDefeat, Route116_EventScript_TryRegisterKarenAfterBattle specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq Route116_EventScript_RematchKaren + goto_if_eq VAR_RESULT, TRUE, Route116_EventScript_RematchKaren setvar VAR_0x8004, TRAINER_KAREN_1 specialvar VAR_RESULT, IsTrainerRegistered - compare VAR_RESULT, FALSE - goto_if_eq Route116_EventScript_TryRegisterKaren + goto_if_eq VAR_RESULT, FALSE, Route116_EventScript_TryRegisterKaren msgbox Route116_Text_KarenPostBattle, MSGBOX_DEFAULT release end diff --git a/data/maps/Route117/scripts.inc b/data/maps/Route117/scripts.inc index f6ab8859174f..37d589ce316c 100644 --- a/data/maps/Route117/scripts.inc +++ b/data/maps/Route117/scripts.inc @@ -41,8 +41,7 @@ Route117_EventScript_DayCareSign:: Route117_EventScript_Isaac:: trainerbattle_single TRAINER_ISAAC_1, Route117_Text_IsaacIntro, Route117_Text_IsaacDefeat, Route117_EventScript_RegisterIsaac specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq Route117_EventScript_RematchIsaac + goto_if_eq VAR_RESULT, TRUE, Route117_EventScript_RematchIsaac msgbox Route117_Text_IsaacPostBattle, MSGBOX_DEFAULT release end @@ -63,8 +62,7 @@ Route117_EventScript_RematchIsaac:: Route117_EventScript_Lydia:: trainerbattle_single TRAINER_LYDIA_1, Route117_Text_LydiaIntro, Route117_Text_LydiaDefeat, Route117_EventScript_RegisterLydia specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq Route117_EventScript_RematchLydia + goto_if_eq VAR_RESULT, TRUE, Route117_EventScript_RematchLydia msgbox Route117_Text_LydiaPostBattle, MSGBOX_DEFAULT release end @@ -85,8 +83,7 @@ Route117_EventScript_RematchLydia:: Route117_EventScript_Dylan:: trainerbattle_single TRAINER_DYLAN_1, Route117_Text_DylanIntro, Route117_Text_DylanDefeat, Route117_EventScript_RegisterDylan specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq Route117_EventScript_RematchDylan + goto_if_eq VAR_RESULT, TRUE, Route117_EventScript_RematchDylan msgbox Route117_Text_DylanPostBattle, MSGBOX_DEFAULT release end @@ -107,8 +104,7 @@ Route117_EventScript_RematchDylan:: Route117_EventScript_Maria:: trainerbattle_single TRAINER_MARIA_1, Route117_Text_MariaIntro, Route117_Text_MariaDefeat, Route117_EventScript_RegisterMaria specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq Route117_EventScript_RematchMaria + goto_if_eq VAR_RESULT, TRUE, Route117_EventScript_RematchMaria msgbox Route117_Text_MariaPostBattle, MSGBOX_DEFAULT release end @@ -134,8 +130,7 @@ Route117_EventScript_Derek:: Route117_EventScript_Anna:: trainerbattle_double TRAINER_ANNA_AND_MEG_1, Route117_Text_AnnaIntro, Route117_Text_AnnaDefeat, Route117_Text_AnnaNotEnoughMons, Route117_EventScript_RegisterAnna specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq Route117_EventScript_RematchAnna + goto_if_eq VAR_RESULT, TRUE, Route117_EventScript_RematchAnna msgbox Route117_Text_AnnaPostBattle, MSGBOX_DEFAULT release end @@ -154,8 +149,7 @@ Route117_EventScript_RematchAnna:: Route117_EventScript_Meg:: trainerbattle_double TRAINER_ANNA_AND_MEG_1, Route117_Text_MegIntro, Route117_Text_MegDefeat, Route117_Text_MegNotEnoughMons, Route117_EventScript_RegisterMeg specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq Route117_EventScript_RematchMeg + goto_if_eq VAR_RESULT, TRUE, Route117_EventScript_RematchMeg msgbox Route117_Text_MegPostBattle, MSGBOX_DEFAULT release end diff --git a/data/maps/Route118/scripts.inc b/data/maps/Route118/scripts.inc index 5b68804b5b2e..92dd8847d46a 100644 --- a/data/maps/Route118/scripts.inc +++ b/data/maps/Route118/scripts.inc @@ -8,19 +8,14 @@ Route118_MapScripts:: Route118_OnTransition: call GabbyAndTy_EventScript_UpdateLocation - compare VAR_SHOULD_END_ABNORMAL_WEATHER, 1 - call_if_eq AbnormalWeather_EventScript_HideMapNamePopup - compare VAR_ABNORMAL_WEATHER_LOCATION, ABNORMAL_WEATHER_ROUTE_118_EAST - call_if_eq AbnormalWeather_StartGroudonWeather - compare VAR_ABNORMAL_WEATHER_LOCATION, ABNORMAL_WEATHER_ROUTE_118_WEST - call_if_eq AbnormalWeather_StartGroudonWeather + call_if_eq VAR_SHOULD_END_ABNORMAL_WEATHER, 1, AbnormalWeather_EventScript_HideMapNamePopup + call_if_eq VAR_ABNORMAL_WEATHER_LOCATION, ABNORMAL_WEATHER_ROUTE_118_EAST, AbnormalWeather_StartGroudonWeather + call_if_eq VAR_ABNORMAL_WEATHER_LOCATION, ABNORMAL_WEATHER_ROUTE_118_WEST, AbnormalWeather_StartGroudonWeather end Route118_OnLoad: - compare VAR_ABNORMAL_WEATHER_LOCATION, ABNORMAL_WEATHER_ROUTE_118_EAST - call_if_eq AbnormalWeather_EventScript_PlaceTilesRoute118East - compare VAR_ABNORMAL_WEATHER_LOCATION, ABNORMAL_WEATHER_ROUTE_118_WEST - call_if_eq AbnormalWeather_EventScript_PlaceTilesRoute118West + call_if_eq VAR_ABNORMAL_WEATHER_LOCATION, ABNORMAL_WEATHER_ROUTE_118_EAST, AbnormalWeather_EventScript_PlaceTilesRoute118East + call_if_eq VAR_ABNORMAL_WEATHER_LOCATION, ABNORMAL_WEATHER_ROUTE_118_WEST, AbnormalWeather_EventScript_PlaceTilesRoute118West end Route118_OnFrame: @@ -32,10 +27,8 @@ Route118_EventScript_GoodRodFisherman:: faceplayer goto_if_set FLAG_RECEIVED_GOOD_ROD, Route118_EventScript_ReceivedGoodRod msgbox Route118_Text_YouAgreeGoodRodIsGood, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq Route118_EventScript_ReceiveGoodRod - compare VAR_RESULT, NO - goto_if_eq Route118_EventScript_DeclineGoodRod + goto_if_eq VAR_RESULT, YES, Route118_EventScript_ReceiveGoodRod + goto_if_eq VAR_RESULT, NO, Route118_EventScript_DeclineGoodRod end Route118_EventScript_ReceiveGoodRod:: @@ -103,12 +96,9 @@ Route118_EventScript_StevenTrigger:: delay 30 msgbox Route118_Text_StevenQuestions, MSGBOX_DEFAULT closemessage - compare VAR_0x8008, 0 - call_if_eq Route118_EventScript_StevenExit0 - compare VAR_0x8008, 1 - call_if_eq Route118_EventScript_StevenExit1 - compare VAR_0x8008, 2 - call_if_eq Route118_EventScript_StevenExit2 + call_if_eq VAR_0x8008, 0, Route118_EventScript_StevenExit0 + call_if_eq VAR_0x8008, 1, Route118_EventScript_StevenExit1 + call_if_eq VAR_0x8008, 2, Route118_EventScript_StevenExit2 setvar VAR_ROUTE118_STATE, 1 removeobject LOCALID_STEVEN releaseall @@ -190,8 +180,7 @@ Route118_Movement_StevenExit2: Route118_EventScript_Rose:: trainerbattle_single TRAINER_ROSE_1, Route118_Text_RoseIntro, Route118_Text_RoseDefeat, Route118_EventScript_RegisterRose specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq Route118_EventScript_RematchRose + goto_if_eq VAR_RESULT, TRUE, Route118_EventScript_RematchRose msgbox Route118_Text_RosePostBattle, MSGBOX_DEFAULT release end @@ -222,8 +211,7 @@ Route118_EventScript_Wade:: Route118_EventScript_Dalton:: trainerbattle_single TRAINER_DALTON_1, Route118_Text_DaltonIntro, Route118_Text_DaltonDefeat, Route118_EventScript_RegisterDalton specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq Route118_EventScript_RematchDalton + goto_if_eq VAR_RESULT, TRUE, Route118_EventScript_RematchDalton msgbox Route118_Text_DaltonPostBattle, MSGBOX_DEFAULT release end diff --git a/data/maps/Route119/scripts.inc b/data/maps/Route119/scripts.inc index 839f4101ba56..94094206c703 100644 --- a/data/maps/Route119/scripts.inc +++ b/data/maps/Route119/scripts.inc @@ -13,16 +13,14 @@ Route119_OnResume: Route119_EventScript_TryRemoveKecleon:: specialvar VAR_RESULT, GetBattleOutcome - compare VAR_RESULT, B_OUTCOME_CAUGHT - goto_if_ne Common_EventScript_NopReturn + goto_if_ne VAR_RESULT, B_OUTCOME_CAUGHT, Common_EventScript_NopReturn removeobject VAR_LAST_TALKED return Route119_OnTransition: call Common_EventScript_SetupRivalGfxId call Common_EventScript_SetupRivalOnBikeGfxId - compare VAR_WEATHER_INSTITUTE_STATE, 1 - call_if_eq Route119_EventScript_MoveInstituteWorkersDownstairs + call_if_eq VAR_WEATHER_INSTITUTE_STATE, 1, Route119_EventScript_MoveInstituteWorkersDownstairs special SetRoute119Weather end @@ -46,30 +44,22 @@ Route119_EventScript_RivalEncounter:: lockall addobject LOCALID_RIVAL_ON_BIKE checkplayergender - compare VAR_RESULT, MALE - call_if_eq Route119_EventScript_PlayMayMusic - compare VAR_RESULT, FEMALE - call_if_eq Route119_EventScript_PlayBrendanMusic + call_if_eq VAR_RESULT, MALE, Route119_EventScript_PlayMayMusic + call_if_eq VAR_RESULT, FEMALE, Route119_EventScript_PlayBrendanMusic delay 65 - compare VAR_TEMP_1, 1 - call_if_eq Route119_EventScript_RivalEnter1 - compare VAR_TEMP_1, 2 - call_if_eq Route119_EventScript_RivalEnter2 + call_if_eq VAR_TEMP_1, 1, Route119_EventScript_RivalEnter1 + call_if_eq VAR_TEMP_1, 2, Route119_EventScript_RivalEnter2 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFasterDown waitmovement 0 delay 30 - compare VAR_TEMP_1, 1 - call_if_eq Route119_EventScript_SetRivalPos1 - compare VAR_TEMP_1, 2 - call_if_eq Route119_EventScript_SetRivalPos2 + call_if_eq VAR_TEMP_1, 1, Route119_EventScript_SetRivalPos1 + call_if_eq VAR_TEMP_1, 2, Route119_EventScript_SetRivalPos2 removeobject LOCALID_RIVAL_ON_BIKE addobject LOCALID_RIVAL delay 30 checkplayergender - compare VAR_RESULT, MALE - goto_if_eq Route119_EventScript_BattleMay - compare VAR_RESULT, FEMALE - goto_if_eq Route119_EventScript_BattleBrendan + goto_if_eq VAR_RESULT, MALE, Route119_EventScript_BattleMay + goto_if_eq VAR_RESULT, FEMALE, Route119_EventScript_BattleBrendan releaseall end @@ -148,36 +138,28 @@ Route119_EventScript_GiveFlyHM:: Route119_EventScript_RivalExitScottArrive:: closemessage - compare VAR_TEMP_1, 1 - call_if_eq Route119_EventScript_SetRivalPos1 - compare VAR_TEMP_1, 2 - call_if_eq Route119_EventScript_SetRivalPos2 + call_if_eq VAR_TEMP_1, 1, Route119_EventScript_SetRivalPos1 + call_if_eq VAR_TEMP_1, 2, Route119_EventScript_SetRivalPos2 removeobject LOCALID_RIVAL addobject LOCALID_RIVAL_ON_BIKE delay 30 - compare VAR_TEMP_1, 1 - call_if_eq Route119_EventScript_RivalExit1 - compare VAR_TEMP_1, 2 - call_if_eq Route119_EventScript_RivalExit2 + call_if_eq VAR_TEMP_1, 1, Route119_EventScript_RivalExit1 + call_if_eq VAR_TEMP_1, 2, Route119_EventScript_RivalExit2 removeobject LOCALID_RIVAL_ON_BIKE setvar VAR_ROUTE119_STATE, 1 savebgm MUS_DUMMY fadedefaultbgm delay 60 - compare VAR_TEMP_1, 1 - call_if_eq Route119_EventScript_SetScottPos1 - compare VAR_TEMP_1, 2 - call_if_eq Route119_EventScript_SetScottPos2 + call_if_eq VAR_TEMP_1, 1, Route119_EventScript_SetScottPos1 + call_if_eq VAR_TEMP_1, 2, Route119_EventScript_SetScottPos2 addobject LOCALID_SCOTT applymovement LOCALID_SCOTT, Route119_Movement_ScottEnter waitmovement 0 addvar VAR_SCOTT_STATE, 1 msgbox Route119_Text_ScottWayToGoBeSeeingYou, MSGBOX_DEFAULT closemessage - compare VAR_TEMP_1, 1 - call_if_eq Route119_EventScript_ScottExit1 - compare VAR_TEMP_1, 2 - call_if_eq Route119_EventScript_ScottExit2 + call_if_eq VAR_TEMP_1, 1, Route119_EventScript_ScottExit1 + call_if_eq VAR_TEMP_1, 2, Route119_EventScript_ScottExit2 removeobject LOCALID_SCOTT releaseall end @@ -372,8 +354,7 @@ Route119_EventScript_Kent:: Route119_EventScript_Jackson:: trainerbattle_single TRAINER_JACKSON_1, Route119_Text_JacksonIntro, Route119_Text_JacksonDefeat, Route119_EventScript_RegisterJackson specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq Route119_EventScript_RematchJackson + goto_if_eq VAR_RESULT, TRUE, Route119_EventScript_RematchJackson msgbox Route119_Text_JacksonPostBattle, MSGBOX_DEFAULT release end @@ -394,8 +375,7 @@ Route119_EventScript_RematchJackson:: Route119_EventScript_Catherine:: trainerbattle_single TRAINER_CATHERINE_1, Route119_Text_CatherineIntro, Route119_Text_CatherineDefeat, Route119_EventScript_RegisterCatherine specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq Route119_EventScript_RematchCatherine + goto_if_eq VAR_RESULT, TRUE, Route119_EventScript_RematchCatherine msgbox Route119_Text_CatherinePostBattle, MSGBOX_DEFAULT release end diff --git a/data/maps/Route119_WeatherInstitute_1F/scripts.inc b/data/maps/Route119_WeatherInstitute_1F/scripts.inc index 33ba0b025dca..cce41bfb5ff3 100644 --- a/data/maps/Route119_WeatherInstitute_1F/scripts.inc +++ b/data/maps/Route119_WeatherInstitute_1F/scripts.inc @@ -5,8 +5,7 @@ Route119_WeatherInstitute_1F_MapScripts:: .byte 0 Route119_WeatherInstitute_1F_OnTransition: - compare VAR_WEATHER_INSTITUTE_STATE, 0 - call_if_eq Route119_WeatherInstitute_1F_EventScript_SetLittleBoyPos + call_if_eq VAR_WEATHER_INSTITUTE_STATE, 0, Route119_WeatherInstitute_1F_EventScript_SetLittleBoyPos end Route119_WeatherInstitute_1F_EventScript_SetLittleBoyPos:: @@ -18,8 +17,7 @@ Route119_WeatherInstitute_1F_EventScript_LittleBoy:: lock faceplayer special GetPlayerBigGuyGirlString - compare VAR_WEATHER_INSTITUTE_STATE, 0 - goto_if_eq Route119_WeatherInstitute_1F_EventScript_LittleBoyTeamAquaHere + goto_if_eq VAR_WEATHER_INSTITUTE_STATE, 0, Route119_WeatherInstitute_1F_EventScript_LittleBoyTeamAquaHere msgbox Route119_WeatherInstitute_1F_Text_WowYoureStrong, MSGBOX_DEFAULT release end @@ -36,8 +34,7 @@ Route119_WeatherInstitute_1F_EventScript_InstituteWorker1:: setvar VAR_0x8004, 0 call_if_set FLAG_DEFEATED_KYOGRE, Route119_WeatherInstitute_1F_EventScript_LegendaryDefeated call_if_set FLAG_DEFEATED_GROUDON, Route119_WeatherInstitute_1F_EventScript_LegendaryDefeated - compare VAR_0x8004, 2 @ Both defeated - goto_if_eq Route119_WeatherInstitute_1F_EventScript_StudyingRain + goto_if_eq VAR_0x8004, 2, Route119_WeatherInstitute_1F_EventScript_StudyingRain @ Both defeated msgbox Route119_WeatherInstitute_1F_Text_NoticingAbnormalWeather, MSGBOX_DEFAULT release end diff --git a/data/maps/Route119_WeatherInstitute_2F/scripts.inc b/data/maps/Route119_WeatherInstitute_2F/scripts.inc index 3b94d5cc140a..0b2227e8baf8 100644 --- a/data/maps/Route119_WeatherInstitute_2F/scripts.inc +++ b/data/maps/Route119_WeatherInstitute_2F/scripts.inc @@ -10,10 +10,8 @@ Route119_WeatherInstitute_2F_MapScripts:: .byte 0 Route119_WeatherInstitute_2F_OnTransition: - compare VAR_WEATHER_INSTITUTE_STATE, 0 - call_if_eq Route119_WeatherInstitute_2F_EventScript_SetScientistPosAquaHere - compare VAR_WEATHER_INSTITUTE_STATE, 1 - call_if_eq Route119_WeatherInstitute_2F_EventScript_SetScientistPosAquaGone + call_if_eq VAR_WEATHER_INSTITUTE_STATE, 0, Route119_WeatherInstitute_2F_EventScript_SetScientistPosAquaHere + call_if_eq VAR_WEATHER_INSTITUTE_STATE, 1, Route119_WeatherInstitute_2F_EventScript_SetScientistPosAquaGone call_if_set FLAG_SYS_GAME_CLEAR, Route119_WeatherInstitute_2F_EventScript_SetScientistPosGameClear end @@ -92,18 +90,15 @@ Route119_WeatherInstitute_2F_EventScript_ReceiveCastform:: msgbox Route119_WeatherInstitute_2F_Text_ThanksPleaseTakePokemon, MSGBOX_DEFAULT setvar VAR_TEMP_1, SPECIES_CASTFORM givemon SPECIES_CASTFORM, 25, ITEM_MYSTIC_WATER - compare VAR_RESULT, 0 - goto_if_eq Route119_WeatherInstitute_2F_EventScript_ReceiveCastformParty - compare VAR_RESULT, 1 - goto_if_eq Route119_WeatherInstitute_2F_EventScript_ReceiveCastformPC + goto_if_eq VAR_RESULT, 0, Route119_WeatherInstitute_2F_EventScript_ReceiveCastformParty + goto_if_eq VAR_RESULT, 1, Route119_WeatherInstitute_2F_EventScript_ReceiveCastformPC goto Common_EventScript_NoMoreRoomForPokemon end Route119_WeatherInstitute_2F_EventScript_ReceiveCastformParty:: call Route119_WeatherInstitute_2F_EventScript_ReceivedCastformFanfare msgbox gText_NicknameThisPokemon, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq Route119_WeatherInstitute_2F_EventScript_ExplainCastform + goto_if_eq VAR_RESULT, NO, Route119_WeatherInstitute_2F_EventScript_ExplainCastform call Common_EventScript_GetGiftMonPartySlot call Common_EventScript_NameReceivedPartyMon goto Route119_WeatherInstitute_2F_EventScript_ExplainCastform @@ -112,8 +107,7 @@ Route119_WeatherInstitute_2F_EventScript_ReceiveCastformParty:: Route119_WeatherInstitute_2F_EventScript_ReceiveCastformPC:: call Route119_WeatherInstitute_2F_EventScript_ReceivedCastformFanfare msgbox gText_NicknameThisPokemon, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq Route119_WeatherInstitute_2F_EventScript_SendCastformToPC + goto_if_eq VAR_RESULT, NO, Route119_WeatherInstitute_2F_EventScript_SendCastformToPC call Common_EventScript_NameReceivedBoxMon goto Route119_WeatherInstitute_2F_EventScript_SendCastformToPC end @@ -128,7 +122,7 @@ Route119_WeatherInstitute_2F_EventScript_ReceivedCastformFanfare:: message Route119_WeatherInstitute_2F_Text_PlayerReceivedCastform waitmessage waitfanfare - bufferspeciesname 0, SPECIES_CASTFORM + bufferspeciesname STR_VAR_1, SPECIES_CASTFORM return Route119_WeatherInstitute_2F_EventScript_ExplainCastform:: @@ -147,12 +141,10 @@ Route119_WeatherInstitute_2F_EventScript_TryStartAbnormalWeather:: setvar VAR_0x8004, 0 call_if_set FLAG_DEFEATED_KYOGRE, Route119_WeatherInstitute_2F_EventScript_LegendaryDefeated call_if_set FLAG_DEFEATED_GROUDON, Route119_WeatherInstitute_2F_EventScript_LegendaryDefeated - compare VAR_0x8004, 2 @ Both defeated - goto_if_eq Route119_WeatherInstitute_2F_EventScript_NoAbnormalWeather + goto_if_eq VAR_0x8004, 2, Route119_WeatherInstitute_2F_EventScript_NoAbnormalWeather @ Both defeated call_if_unset FLAG_TEMP_2, Route119_WeatherInstitute_2F_EventScript_CreateAbnormalWeather specialvar VAR_RESULT, GetAbnormalWeatherMapNameAndType - compare VAR_RESULT, 1 - goto_if_eq Route119_WeatherInstitute_2F_EventScript_KyogreWeather + goto_if_eq VAR_RESULT, 1, Route119_WeatherInstitute_2F_EventScript_KyogreWeather msgbox Route119_WeatherInstitute_2F_Text_GroudonWeather, MSGBOX_DEFAULT release end diff --git a/data/maps/Route120/scripts.inc b/data/maps/Route120/scripts.inc index 588fa17a0ab3..baf721a5ca56 100644 --- a/data/maps/Route120/scripts.inc +++ b/data/maps/Route120/scripts.inc @@ -13,32 +13,24 @@ Route120_OnResume: end Route120_EventScript_RemoveKecleonObject:: - compare VAR_0x8009, 0 - call_if_eq Route120_EventScript_RemoveBridgeKecleon - compare VAR_0x8009, 1 - call_if_eq Route120_EventScript_RemoveKecleon - compare VAR_0x8009, 2 - call_if_eq Route120_EventScript_RemoveKecleon - compare VAR_0x8009, 3 - call_if_eq Route120_EventScript_RemoveKecleon - compare VAR_0x8009, 4 - call_if_eq Route120_EventScript_RemoveKecleon - compare VAR_0x8009, 5 - call_if_eq Route120_EventScript_RemoveKecleon + call_if_eq VAR_0x8009, 0, Route120_EventScript_RemoveBridgeKecleon + call_if_eq VAR_0x8009, 1, Route120_EventScript_RemoveKecleon + call_if_eq VAR_0x8009, 2, Route120_EventScript_RemoveKecleon + call_if_eq VAR_0x8009, 3, Route120_EventScript_RemoveKecleon + call_if_eq VAR_0x8009, 4, Route120_EventScript_RemoveKecleon + call_if_eq VAR_0x8009, 5, Route120_EventScript_RemoveKecleon return Route120_EventScript_RemoveBridgeKecleon:: specialvar VAR_RESULT, GetBattleOutcome - compare VAR_RESULT, B_OUTCOME_CAUGHT - goto_if_ne Common_EventScript_NopReturn + goto_if_ne VAR_RESULT, B_OUTCOME_CAUGHT, Common_EventScript_NopReturn removeobject LOCALID_BRIDGE_KECLEON removeobject LOCALID_BRIDGE_KECLEON_SHADOW return Route120_EventScript_RemoveKecleon:: specialvar VAR_RESULT, GetBattleOutcome - compare VAR_RESULT, B_OUTCOME_CAUGHT - goto_if_ne Common_EventScript_NopReturn + goto_if_ne VAR_RESULT, B_OUTCOME_CAUGHT, Common_EventScript_NopReturn removeobject VAR_LAST_TALKED return @@ -49,15 +41,15 @@ Route120_OnLoad: end Route120_EventScript_CloseAncientTomb:: - setmetatile 7, 54, METATILE_General_RockWall_RockBase, 1 - setmetatile 7, 55, METATILE_General_RockWall_SandBase, 1 + setmetatile 7, 54, METATILE_General_RockWall_RockBase, TRUE + setmetatile 7, 55, METATILE_General_RockWall_SandBase, TRUE return Route120_EventScript_SetBridgeClearMetatiles:: - setmetatile 13, 15, METATILE_Fortree_WoodBridge1_Top, 0 - setmetatile 12, 16, METATILE_Fortree_WoodBridge1_Bottom, 0 - setmetatile 12, 17, METATILE_General_ReflectiveWater, 0 - setmetatile 13, 17, METATILE_General_ReflectiveWater, 0 + setmetatile 13, 15, METATILE_Fortree_WoodBridge1_Top, FALSE + setmetatile 12, 16, METATILE_Fortree_WoodBridge1_Bottom, FALSE + setmetatile 12, 17, METATILE_General_ReflectiveWater, FALSE + setmetatile 13, 17, METATILE_General_ReflectiveWater, FALSE return Route120_EventScript_SetBridgeKecleonMovement:: @@ -71,12 +63,9 @@ Route120_OnTransition: Route120_EventScript_SetWeather:: getplayerxy VAR_TEMP_0, VAR_TEMP_1 - compare VAR_TEMP_1, 14 - goto_if_le Route120_EventScript_SetSunnyWeather - compare VAR_TEMP_1, 60 - goto_if_le Route120_EventScript_TrySetRainyWeather - compare VAR_TEMP_1, 61 - goto_if_ge Route120_EventScript_SetCloudyWeather + goto_if_le VAR_TEMP_1, 14, Route120_EventScript_SetSunnyWeather + goto_if_le VAR_TEMP_1, 60, Route120_EventScript_TrySetRainyWeather + goto_if_ge VAR_TEMP_1, 61, Route120_EventScript_SetCloudyWeather return Route120_EventScript_SetCloudyWeather:: @@ -88,10 +77,8 @@ Route120_EventScript_SetSunnyWeather:: return Route120_EventScript_TrySetRainyWeather:: - compare VAR_TEMP_0, 7 - goto_if_le Route120_EventScript_SetRainyWeather - compare VAR_TEMP_0, 19 - goto_if_le Route120_EventScript_SetSunnyWeather + goto_if_le VAR_TEMP_0, 7, Route120_EventScript_SetRainyWeather + goto_if_le VAR_TEMP_0, 19, Route120_EventScript_SetSunnyWeather goto Route120_EventScript_SetRainyWeather end @@ -105,10 +92,8 @@ Route120_EventScript_BerryBeauty:: dotimebasedevents goto_if_set FLAG_DAILY_ROUTE_120_RECEIVED_BERRY, Route120_EventScript_ReceivedBerry msgbox Route120_Text_BerriesExpressionOfLoveIsntIt, MSGBOX_YESNO - compare VAR_RESULT, YES - call_if_eq Route120_EventScript_BerryLove - compare VAR_RESULT, NO - call_if_eq Route120_EventScript_BerryNotLove + call_if_eq VAR_RESULT, YES, Route120_EventScript_BerryLove + call_if_eq VAR_RESULT, NO, Route120_EventScript_BerryNotLove specialvar VAR_RESULT, GetPlayerTrainerIdOnesDigit switch VAR_RESULT case 0, Route120_EventScript_GiveFigyBerry @@ -150,8 +135,7 @@ Route120_EventScript_GiveIapapaBerry:: Route120_EventScript_GiveBerry:: giveitem VAR_0x8004 - compare VAR_RESULT, FALSE - goto_if_eq Common_EventScript_ShowBagIsFull + goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull setflag FLAG_DAILY_ROUTE_120_RECEIVED_BERRY msgbox Route120_Text_BerryIsRareRaiseItWithCare, MSGBOX_DEFAULT release @@ -175,8 +159,7 @@ Route120_EventScript_Steven:: faceplayer goto_if_set FLAG_NOT_READY_FOR_BATTLE_ROUTE_120, Route120_EventScript_StevenAskReadyForBattle msgbox Route120_Text_StevenGreeting, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq Route120_EventScript_StevenNotReady + goto_if_eq VAR_RESULT, NO, Route120_EventScript_StevenNotReady goto Route120_EventScript_StevenBattleKecleon end @@ -188,18 +171,15 @@ Route120_EventScript_StevenNotReady:: Route120_EventScript_StevenAskReadyForBattle:: msgbox Route120_Text_StevenReadyForBattle, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq Route120_EventScript_StevenNotReady + goto_if_eq VAR_RESULT, NO, Route120_EventScript_StevenNotReady goto Route120_EventScript_StevenBattleKecleon end Route120_EventScript_StevenBattleKecleon:: msgbox Route120_Text_StevenShowMeYourPower, MSGBOX_DEFAULT closemessage - compare VAR_FACING, DIR_NORTH - call_if_eq Route120_EventScript_PlayerApproachKecleonNorth - compare VAR_FACING, DIR_WEST - call_if_eq Route120_EventScript_PlayerApproachKecleonWest + call_if_eq VAR_FACING, DIR_NORTH, Route120_EventScript_PlayerApproachKecleonNorth + call_if_eq VAR_FACING, DIR_WEST, Route120_EventScript_PlayerApproachKecleonWest applymovement LOCALID_STEVEN, Common_Movement_WalkInPlaceFasterLeft waitmovement 0 delay 20 @@ -219,12 +199,9 @@ Route120_EventScript_StevenBattleKecleon:: dowildbattle clearflag FLAG_SYS_CTRL_OBJ_DELETE specialvar VAR_RESULT, GetBattleOutcome - compare VAR_RESULT, B_OUTCOME_WON - goto_if_eq Route120_EventScript_RemoveBridgeKecleonPostBattle - compare VAR_RESULT, B_OUTCOME_RAN - goto_if_eq Route120_EventScript_RemoveBridgeKecleonPostBattle - compare VAR_RESULT, B_OUTCOME_PLAYER_TELEPORTED - goto_if_eq Route120_EventScript_RemoveBridgeKecleonPostBattle + goto_if_eq VAR_RESULT, B_OUTCOME_WON, Route120_EventScript_RemoveBridgeKecleonPostBattle + goto_if_eq VAR_RESULT, B_OUTCOME_RAN, Route120_EventScript_RemoveBridgeKecleonPostBattle + goto_if_eq VAR_RESULT, B_OUTCOME_PLAYER_TELEPORTED, Route120_EventScript_RemoveBridgeKecleonPostBattle goto Route120_EventScript_StevenGiveDeconScope end @@ -253,10 +230,10 @@ Route120_EventScript_StevenGiveDeconScope:: delay 15 removeobject LOCALID_STEVEN waitfieldeffect FLDEFF_NPCFLY_OUT - setmetatile 13, 15, METATILE_Fortree_WoodBridge1_Top, 0 - setmetatile 12, 16, METATILE_Fortree_WoodBridge1_Bottom, 0 - setmetatile 12, 17, METATILE_General_ReflectiveWater, 0 - setmetatile 13, 17, METATILE_General_ReflectiveWater, 0 + setmetatile 13, 15, METATILE_Fortree_WoodBridge1_Top, FALSE + setmetatile 12, 16, METATILE_Fortree_WoodBridge1_Bottom, FALSE + setmetatile 12, 17, METATILE_General_ReflectiveWater, FALSE + setmetatile 13, 17, METATILE_General_ReflectiveWater, FALSE special DrawWholeMapView release end @@ -296,8 +273,7 @@ Route120_EventScript_Colin:: Route120_EventScript_Robert:: trainerbattle_single TRAINER_ROBERT_1, Route120_Text_RobertIntro, Route120_Text_RobertDefeat, Route120_EventScript_RegisterRobert specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq Route120_EventScript_RematchRobert + goto_if_eq VAR_RESULT, TRUE, Route120_EventScript_RematchRobert msgbox Route120_Text_RobertPostBattle, MSGBOX_DEFAULT release end @@ -328,8 +304,7 @@ Route120_EventScript_Jenna:: Route120_EventScript_Jeffrey:: trainerbattle_single TRAINER_JEFFREY_1, Route120_Text_JeffreyIntro, Route120_Text_JeffreyDefeat, Route120_EventScript_RegisterJeffrey specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq Route120_EventScript_RematchJeffrey + goto_if_eq VAR_RESULT, TRUE, Route120_EventScript_RematchJeffrey msgbox Route120_Text_JeffreyPostBattle, MSGBOX_DEFAULT release end diff --git a/data/maps/Route121/scripts.inc b/data/maps/Route121/scripts.inc index 3bd0a42ee148..317328825c2f 100644 --- a/data/maps/Route121/scripts.inc +++ b/data/maps/Route121/scripts.inc @@ -77,8 +77,7 @@ Route121_EventScript_Vanessa:: Route121_EventScript_Walter:: trainerbattle_single TRAINER_WALTER_1, Route121_Text_WalterIntro, Route121_Text_WalterDefeat, Route121_EventScript_RegisterWalter specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq Route121_EventScript_RematchWalter + goto_if_eq VAR_RESULT, TRUE, Route121_EventScript_RematchWalter msgbox Route121_Text_WalterPostBattle, MSGBOX_DEFAULT release end @@ -114,8 +113,7 @@ Route121_EventScript_Joy:: Route121_EventScript_Jessica:: trainerbattle_single TRAINER_JESSICA_1, Route121_Text_JessicaIntro, Route121_Text_JessicaDefeat, Route121_EventScript_RegisterJessica specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq Route121_EventScript_RematchJessica + goto_if_eq VAR_RESULT, TRUE, Route121_EventScript_RematchJessica msgbox Route121_Text_JessicaPostBattle, MSGBOX_DEFAULT release end @@ -156,8 +154,7 @@ Route121_EventScript_Marcel:: Route121_EventScript_Cristin:: trainerbattle_single TRAINER_CRISTIN_1, Route121_Text_CristinIntro, Route121_Text_CristinDefeat, Route121_EventScript_RegisterCristin specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq Route121_EventScript_RematchCristin + goto_if_eq VAR_RESULT, TRUE, Route121_EventScript_RematchCristin msgbox Route121_Text_CristinPostBattle, MSGBOX_DEFAULT release end diff --git a/data/maps/Route121_SafariZoneEntrance/scripts.inc b/data/maps/Route121_SafariZoneEntrance/scripts.inc index 8bd5dac04f4d..92fdc2d0bd70 100644 --- a/data/maps/Route121_SafariZoneEntrance/scripts.inc +++ b/data/maps/Route121_SafariZoneEntrance/scripts.inc @@ -33,8 +33,7 @@ Route121_SafariZoneEntrance_EventScript_InfoAttendant:: lock faceplayer msgbox Route121_SafariZoneEntrance_Text_WelcomeFirstTime, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq Route121_SafariZoneEntrance_EventScript_FirstTimeInfo + goto_if_eq VAR_RESULT, YES, Route121_SafariZoneEntrance_EventScript_FirstTimeInfo msgbox Route121_SafariZoneEntrance_Text_ComeInAndEnjoy, MSGBOX_DEFAULT release end @@ -48,26 +47,23 @@ Route121_SafariZoneEntrance_EventScript_EntranceCounterTrigger:: lockall applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFasterUp waitmovement 0 - showmoneybox 0, 0, 0 + showmoneybox 0, 0 msgbox Route121_SafariZoneEntrance_Text_WouldYouLikeToPlay, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq Route121_SafariZoneEntrance_EventScript_TryEnterSafariZone + goto_if_eq VAR_RESULT, YES, Route121_SafariZoneEntrance_EventScript_TryEnterSafariZone msgbox Route121_SafariZoneEntrance_Text_PlayAnotherTime, MSGBOX_DEFAULT goto Route121_SafariZoneEntrance_EventScript_MovePlayerBackFromCounter end Route121_SafariZoneEntrance_EventScript_TryEnterSafariZone:: - checkitem ITEM_POKEBLOCK_CASE, 1 - compare VAR_RESULT, 0 - goto_if_eq Route121_SafariZoneEntrance_EventScript_NoPokeblockCase + checkitem ITEM_POKEBLOCK_CASE + goto_if_eq VAR_RESULT, 0, Route121_SafariZoneEntrance_EventScript_NoPokeblockCase call Route121_SafariZoneEntrance_EventScript_CheckHasRoomForPokemon - checkmoney 500, 0 - compare VAR_RESULT, 0 - goto_if_eq Route121_SafariZoneEntrance_EventScript_NotEnoughMoney + checkmoney 500 + goto_if_eq VAR_RESULT, 0, Route121_SafariZoneEntrance_EventScript_NotEnoughMoney playse SE_SHOP msgbox Route121_SafariZoneEntrance_Text_ThatWillBe500Please, MSGBOX_DEFAULT - removemoney 500, 0 - updatemoneybox 0, 0 + removemoney 500 + updatemoneybox msgbox Route121_SafariZoneEntrance_Text_HereAreYourSafariBalls, MSGBOX_DEFAULT playfanfare MUS_OBTAIN_ITEM message Route121_SafariZoneEntrance_Text_Received30SafariBalls @@ -80,17 +76,15 @@ Route121_SafariZoneEntrance_EventScript_TryEnterSafariZone:: special EnterSafariMode setvar VAR_SAFARI_ZONE_STATE, 2 clearflag FLAG_GOOD_LUCK_SAFARI_ZONE - warp MAP_SAFARI_ZONE_SOUTH, 255, 32, 33 + warp MAP_SAFARI_ZONE_SOUTH, 32, 33 waitstate end Route121_SafariZoneEntrance_EventScript_CheckHasRoomForPokemon:: getpartysize - compare VAR_RESULT, PARTY_SIZE - goto_if_ne Route121_SafariZoneEntrance_EventScript_HasRoomForPokemon + goto_if_ne VAR_RESULT, PARTY_SIZE, Route121_SafariZoneEntrance_EventScript_HasRoomForPokemon specialvar VAR_RESULT, ScriptCheckFreePokemonStorageSpace - compare VAR_RESULT, 1 - goto_if_eq Route121_SafariZoneEntrance_EventScript_HasRoomForPokemon + goto_if_eq VAR_RESULT, 1, Route121_SafariZoneEntrance_EventScript_HasRoomForPokemon msgbox Route121_SafariZoneEntrance_Text_PCIsFull, MSGBOX_DEFAULT goto Route121_SafariZoneEntrance_EventScript_MovePlayerBackFromCounter end diff --git a/data/maps/Route123/scripts.inc b/data/maps/Route123/scripts.inc index 6ce0de6544a9..fe63661261b3 100644 --- a/data/maps/Route123/scripts.inc +++ b/data/maps/Route123/scripts.inc @@ -12,12 +12,10 @@ Route123_EventScript_GigaDrainGirl:: goto_if_set FLAG_RECEIVED_TM19, Route123_EventScript_ReceivedGigaDrain msgbox Route123_Text_LoveGrassMonsHaveAny, MSGBOX_DEFAULT special IsGrassTypeInParty - compare VAR_RESULT, FALSE - goto_if_eq Route123_EventScript_NoGrassMons + goto_if_eq VAR_RESULT, FALSE, Route123_EventScript_NoGrassMons msgbox Route123_Text_YouLikeGrassMonsTooHaveThis, MSGBOX_DEFAULT giveitem ITEM_TM19 - compare VAR_RESULT, FALSE - goto_if_eq Common_EventScript_ShowBagIsFull + goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull setflag FLAG_RECEIVED_TM19 msgbox Route123_Text_CheckTreesWithMyGrassMon, MSGBOX_DEFAULT release @@ -62,8 +60,7 @@ Route123_EventScript_Violet:: Route123_EventScript_Cameron:: trainerbattle_single TRAINER_CAMERON_1, Route123_Text_CameronIntro, Route123_Text_CameronDefeat, Route123_EventScript_RegisterCameron specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq Route123_EventScript_RematchCameron + goto_if_eq VAR_RESULT, TRUE, Route123_EventScript_RematchCameron msgbox Route123_Text_CameronPostBattle, MSGBOX_DEFAULT release end @@ -84,8 +81,7 @@ Route123_EventScript_RematchCameron:: Route123_EventScript_Jacki:: trainerbattle_single TRAINER_JACKI_1, Route123_Text_JackiIntro, Route123_Text_JackiDefeat, Route123_EventScript_RegisterJacki specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq Route123_EventScript_RematchJacki + goto_if_eq VAR_RESULT, TRUE, Route123_EventScript_RematchJacki msgbox Route123_Text_JackiPostBattle, MSGBOX_DEFAULT release end @@ -156,8 +152,7 @@ Route123_EventScript_Davis:: Route123_EventScript_Fernando:: trainerbattle_single TRAINER_FERNANDO_1, Route123_Text_FernandoIntro, Route123_Text_FernandoDefeat, Route123_EventScript_RegisterFernando specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq Route123_EventScript_RematchFernando + goto_if_eq VAR_RESULT, TRUE, Route123_EventScript_RematchFernando msgbox Route123_Text_FernandoPostBattle, MSGBOX_DEFAULT release end diff --git a/data/maps/Route123_BerryMastersHouse/scripts.inc b/data/maps/Route123_BerryMastersHouse/scripts.inc index a9fbfd9d0a27..bdc0b0456b61 100644 --- a/data/maps/Route123_BerryMastersHouse/scripts.inc +++ b/data/maps/Route123_BerryMastersHouse/scripts.inc @@ -16,16 +16,14 @@ Route123_BerryMastersHouse_EventScript_BerryMaster:: addvar VAR_RESULT, NUM_BERRY_MASTER_BERRIES_SKIPPED addvar VAR_RESULT, FIRST_BERRY_INDEX giveitem VAR_RESULT - compare VAR_RESULT, FALSE - goto_if_eq Common_EventScript_ShowBagIsFull + goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull setflag FLAG_DAILY_BERRY_MASTER_RECEIVED_BERRY msgbox Route123_BerryMastersHouse_Text_WhyBeStingyTakeAnother, MSGBOX_DEFAULT random NUM_BERRY_MASTER_BERRIES addvar VAR_RESULT, NUM_BERRY_MASTER_BERRIES_SKIPPED addvar VAR_RESULT, FIRST_BERRY_INDEX giveitem VAR_RESULT - compare VAR_RESULT, FALSE - goto_if_eq Common_EventScript_ShowBagIsFull + goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull msgbox Route123_BerryMastersHouse_Text_VisitPrettyPetalFlowerShop, MSGBOX_DEFAULT release end @@ -45,10 +43,8 @@ Route123_BerryMastersHouse_EventScript_BerryMastersWife:: call Common_ShowEasyChatScreen lock faceplayer - compare VAR_RESULT, TRUE - goto_if_eq Route123_BerryMastersHouse_EventScript_GavePhrase - compare VAR_RESULT, FALSE - goto_if_eq Route123_BerryMastersHouse_EventScript_CancelPhrase + goto_if_eq VAR_RESULT, TRUE, Route123_BerryMastersHouse_EventScript_GavePhrase + goto_if_eq VAR_RESULT, FALSE, Route123_BerryMastersHouse_EventScript_CancelPhrase end Route123_BerryMastersHouse_EventScript_CancelPhrase:: @@ -58,18 +54,12 @@ Route123_BerryMastersHouse_EventScript_CancelPhrase:: end Route123_BerryMastersHouse_EventScript_GavePhrase:: - compare VAR_0x8004, NOT_SPECIAL_PHRASE - goto_if_eq Route123_BerryMastersHouse_EventScript_GiveNormalBerry - compare VAR_0x8004, PHRASE_GREAT_BATTLE - goto_if_eq Route123_BerryMastersHouse_EventScript_GiveSpelonBerry - compare VAR_0x8004, PHRASE_CHALLENGE_CONTEST - goto_if_eq Route123_BerryMastersHouse_EventScript_GivePamtreBerry - compare VAR_0x8004, PHRASE_OVERWHELMING_LATIAS - goto_if_eq Route123_BerryMastersHouse_EventScript_GiveWatmelBerry - compare VAR_0x8004, PHRASE_COOL_LATIOS - goto_if_eq Route123_BerryMastersHouse_EventScript_GiveDurinBerry - compare VAR_0x8004, PHRASE_SUPER_HUSTLE - goto_if_eq Route123_BerryMastersHouse_EventScript_GiveBelueBerry + goto_if_eq VAR_0x8004, NOT_SPECIAL_PHRASE, Route123_BerryMastersHouse_EventScript_GiveNormalBerry + goto_if_eq VAR_0x8004, PHRASE_GREAT_BATTLE, Route123_BerryMastersHouse_EventScript_GiveSpelonBerry + goto_if_eq VAR_0x8004, PHRASE_CHALLENGE_CONTEST, Route123_BerryMastersHouse_EventScript_GivePamtreBerry + goto_if_eq VAR_0x8004, PHRASE_OVERWHELMING_LATIAS, Route123_BerryMastersHouse_EventScript_GiveWatmelBerry + goto_if_eq VAR_0x8004, PHRASE_COOL_LATIOS, Route123_BerryMastersHouse_EventScript_GiveDurinBerry + goto_if_eq VAR_0x8004, PHRASE_SUPER_HUSTLE, Route123_BerryMastersHouse_EventScript_GiveBelueBerry end Route123_BerryMastersHouse_EventScript_GiveNormalBerry:: @@ -77,8 +67,7 @@ Route123_BerryMastersHouse_EventScript_GiveNormalBerry:: random NUM_BERRY_MASTER_WIFE_BERRIES addvar VAR_RESULT, FIRST_BERRY_INDEX giveitem VAR_RESULT - compare VAR_RESULT, FALSE - goto_if_eq Common_EventScript_ShowBagIsFull + goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull goto Route123_BerryMastersHouse_EventScript_GaveBerry release end @@ -87,8 +76,7 @@ Route123_BerryMastersHouse_EventScript_GiveSpelonBerry:: goto_if_set FLAG_RECEIVED_SPELON_BERRY, Route123_BerryMastersHouse_EventScript_GiveNormalBerry msgbox Route123_BerryMastersHouse_Text_InspirationalTakeThis, MSGBOX_DEFAULT giveitem ITEM_SPELON_BERRY - compare VAR_RESULT, FALSE - goto_if_eq Common_EventScript_ShowBagIsFull + goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull setflag FLAG_RECEIVED_SPELON_BERRY goto Route123_BerryMastersHouse_EventScript_GaveBerry end @@ -97,8 +85,7 @@ Route123_BerryMastersHouse_EventScript_GivePamtreBerry:: goto_if_set FLAG_RECEIVED_PAMTRE_BERRY, Route123_BerryMastersHouse_EventScript_GiveNormalBerry msgbox Route123_BerryMastersHouse_Text_InspirationalTakeThis, MSGBOX_DEFAULT giveitem ITEM_PAMTRE_BERRY - compare VAR_RESULT, FALSE - goto_if_eq Common_EventScript_ShowBagIsFull + goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull setflag FLAG_RECEIVED_PAMTRE_BERRY goto Route123_BerryMastersHouse_EventScript_GaveBerry end @@ -107,8 +94,7 @@ Route123_BerryMastersHouse_EventScript_GiveWatmelBerry:: goto_if_set FLAG_RECEIVED_WATMEL_BERRY, Route123_BerryMastersHouse_EventScript_GiveNormalBerry msgbox Route123_BerryMastersHouse_Text_InspirationalTakeThis, MSGBOX_DEFAULT giveitem ITEM_WATMEL_BERRY - compare VAR_RESULT, FALSE - goto_if_eq Common_EventScript_ShowBagIsFull + goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull setflag FLAG_RECEIVED_WATMEL_BERRY goto Route123_BerryMastersHouse_EventScript_GaveBerry end @@ -117,8 +103,7 @@ Route123_BerryMastersHouse_EventScript_GiveDurinBerry:: goto_if_set FLAG_RECEIVED_DURIN_BERRY, Route123_BerryMastersHouse_EventScript_GiveNormalBerry msgbox Route123_BerryMastersHouse_Text_InspirationalTakeThis, MSGBOX_DEFAULT giveitem ITEM_DURIN_BERRY - compare VAR_RESULT, FALSE - goto_if_eq Common_EventScript_ShowBagIsFull + goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull setflag FLAG_RECEIVED_DURIN_BERRY goto Route123_BerryMastersHouse_EventScript_GaveBerry end @@ -127,8 +112,7 @@ Route123_BerryMastersHouse_EventScript_GiveBelueBerry:: goto_if_set FLAG_RECEIVED_BELUE_BERRY, Route123_BerryMastersHouse_EventScript_GiveNormalBerry msgbox Route123_BerryMastersHouse_Text_InspirationalTakeThis, MSGBOX_DEFAULT giveitem ITEM_BELUE_BERRY - compare VAR_RESULT, FALSE - goto_if_eq Common_EventScript_ShowBagIsFull + goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull setflag FLAG_RECEIVED_BELUE_BERRY goto Route123_BerryMastersHouse_EventScript_GaveBerry end diff --git a/data/maps/Route124/scripts.inc b/data/maps/Route124/scripts.inc index d1cd8ef8c269..108b915da22b 100644 --- a/data/maps/Route124/scripts.inc +++ b/data/maps/Route124/scripts.inc @@ -23,8 +23,7 @@ Route124_EventScript_Roland:: Route124_EventScript_Jenny:: trainerbattle_single TRAINER_JENNY_1, Route124_Text_JennyIntro, Route124_Text_JennyDefeat, Route124_EventScript_RegisterJenny specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq Route124_EventScript_RematchJenny + goto_if_eq VAR_RESULT, TRUE, Route124_EventScript_RematchJenny msgbox Route124_Text_JennyPostBattle, MSGBOX_DEFAULT release end @@ -55,8 +54,7 @@ Route124_EventScript_Chad:: Route124_EventScript_Lila:: trainerbattle_double TRAINER_LILA_AND_ROY_1, Route124_Text_LilaIntro, Route124_Text_LilaDefeat, Route124_Text_LilaNotEnoughMons, Route124_EventScript_RegisterLila specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq Route124_EventScript_RematchLila + goto_if_eq VAR_RESULT, TRUE, Route124_EventScript_RematchLila msgbox Route124_Text_LilaPostBattle, MSGBOX_DEFAULT release end @@ -75,8 +73,7 @@ Route124_EventScript_RematchLila:: Route124_EventScript_Roy:: trainerbattle_double TRAINER_LILA_AND_ROY_1, Route124_Text_RoyIntro, Route124_Text_RoyDefeat, Route124_Text_RoyNotEnoughMons, Route124_EventScript_RegisterRoy specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq Route124_EventScript_RematchRoy + goto_if_eq VAR_RESULT, TRUE, Route124_EventScript_RematchRoy msgbox Route124_Text_RoyPostBattle, MSGBOX_DEFAULT release end diff --git a/data/maps/Route124_DivingTreasureHuntersHouse/scripts.inc b/data/maps/Route124_DivingTreasureHuntersHouse/scripts.inc index 63bee6ed5b21..b100438f5555 100644 --- a/data/maps/Route124_DivingTreasureHuntersHouse/scripts.inc +++ b/data/maps/Route124_DivingTreasureHuntersHouse/scripts.inc @@ -22,25 +22,20 @@ Route124_DivingTreasureHuntersHouse_EventScript_SkipGreeting:: Route124_DivingTreasureHuntersHouse_EventScript_CheckPlayerHasShard:: call Route124_DivingTreasureHuntersHouse_EventScript_GetPlayersShards - compare VAR_TEMP_1, 0 - goto_if_eq Route124_DivingTreasureHuntersHouse_EventScript_NoShards + goto_if_eq VAR_TEMP_1, 0, Route124_DivingTreasureHuntersHouse_EventScript_NoShards goto Route124_DivingTreasureHuntersHouse_EventScript_HasShard end Route124_DivingTreasureHuntersHouse_EventScript_GetPlayersShards:: setvar VAR_TEMP_1, 0 - checkitem ITEM_RED_SHARD, 1 - compare VAR_RESULT, TRUE - call_if_eq Route124_DivingTreasureHuntersHouse_EventScript_HasRedShard - checkitem ITEM_YELLOW_SHARD, 1 - compare VAR_RESULT, TRUE - call_if_eq Route124_DivingTreasureHuntersHouse_EventScript_HasYellowShard - checkitem ITEM_BLUE_SHARD, 1 - compare VAR_RESULT, TRUE - call_if_eq Route124_DivingTreasureHuntersHouse_EventScript_HasBlueShard - checkitem ITEM_GREEN_SHARD, 1 - compare VAR_RESULT, TRUE - call_if_eq Route124_DivingTreasureHuntersHouse_EventScript_HasGreenShard + checkitem ITEM_RED_SHARD + call_if_eq VAR_RESULT, TRUE, Route124_DivingTreasureHuntersHouse_EventScript_HasRedShard + checkitem ITEM_YELLOW_SHARD + call_if_eq VAR_RESULT, TRUE, Route124_DivingTreasureHuntersHouse_EventScript_HasYellowShard + checkitem ITEM_BLUE_SHARD + call_if_eq VAR_RESULT, TRUE, Route124_DivingTreasureHuntersHouse_EventScript_HasBlueShard + checkitem ITEM_GREEN_SHARD + call_if_eq VAR_RESULT, TRUE, Route124_DivingTreasureHuntersHouse_EventScript_HasGreenShard return Route124_DivingTreasureHuntersHouse_EventScript_HasRedShard:: @@ -243,17 +238,14 @@ Route124_DivingTreasureHuntersHouse_EventScript_TradeGreenShard:: goto Route124_DivingTreasureHuntersHouse_EventScript_TryTradeShard Route124_DivingTreasureHuntersHouse_EventScript_TryTradeShard:: - bufferitemname 0, VAR_0x8008 - bufferitemname 1, VAR_0x8009 + bufferitemname STR_VAR_1, VAR_0x8008 + bufferitemname STR_VAR_2, VAR_0x8009 msgbox Route124_DivingTreasureHuntersHouse_Text_YoullTradeShardForStone, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq Route124_DivingTreasureHuntersHouse_EventScript_DeclineTrade - checkitemspace VAR_0x8009, 1 - compare VAR_RESULT, TRUE - goto_if_eq Route124_DivingTreasureHuntersHouse_EventScript_TradeShard + goto_if_eq VAR_RESULT, NO, Route124_DivingTreasureHuntersHouse_EventScript_DeclineTrade + checkitemspace VAR_0x8009 + goto_if_eq VAR_RESULT, TRUE, Route124_DivingTreasureHuntersHouse_EventScript_TradeShard checkitem VAR_0x8008, 2 - compare VAR_RESULT, FALSE - goto_if_eq Route124_DivingTreasureHuntersHouse_EventScript_TradeShard + goto_if_eq VAR_RESULT, FALSE, Route124_DivingTreasureHuntersHouse_EventScript_TradeShard goto Route124_DivingTreasureHuntersHouse_EventScript_BagFull end @@ -262,11 +254,9 @@ Route124_DivingTreasureHuntersHouse_EventScript_TradeShard:: giveitem VAR_0x8009 msgbox Route124_DivingTreasureHuntersHouse_Text_ItsADeal, MSGBOX_DEFAULT call Route124_DivingTreasureHuntersHouse_EventScript_GetPlayersShards - compare VAR_TEMP_1, 0 - goto_if_eq Route124_DivingTreasureHuntersHouse_EventScript_EndTrade + goto_if_eq VAR_TEMP_1, 0, Route124_DivingTreasureHuntersHouse_EventScript_EndTrade msgbox Route124_DivingTreasureHuntersHouse_Text_TradeSomethingElse, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq Route124_DivingTreasureHuntersHouse_EventScript_ShowTradeOptions + goto_if_eq VAR_RESULT, YES, Route124_DivingTreasureHuntersHouse_EventScript_ShowTradeOptions goto Route124_DivingTreasureHuntersHouse_EventScript_DeclineTrade end diff --git a/data/maps/Route125/scripts.inc b/data/maps/Route125/scripts.inc index 7a2d3f15fa93..cafdf8fbbf69 100644 --- a/data/maps/Route125/scripts.inc +++ b/data/maps/Route125/scripts.inc @@ -6,19 +6,14 @@ Route125_MapScripts:: Route125_OnTransition: call_if_set FLAG_SYS_WEATHER_CTRL, Common_EventScript_SetAbnormalWeather - compare VAR_SHOULD_END_ABNORMAL_WEATHER, 1 - call_if_eq AbnormalWeather_EventScript_HideMapNamePopup - compare VAR_ABNORMAL_WEATHER_LOCATION, ABNORMAL_WEATHER_ROUTE_125_WEST - call_if_eq AbnormalWeather_StartKyogreWeather - compare VAR_ABNORMAL_WEATHER_LOCATION, ABNORMAL_WEATHER_ROUTE_125_EAST - call_if_eq AbnormalWeather_StartKyogreWeather + call_if_eq VAR_SHOULD_END_ABNORMAL_WEATHER, 1, AbnormalWeather_EventScript_HideMapNamePopup + call_if_eq VAR_ABNORMAL_WEATHER_LOCATION, ABNORMAL_WEATHER_ROUTE_125_WEST, AbnormalWeather_StartKyogreWeather + call_if_eq VAR_ABNORMAL_WEATHER_LOCATION, ABNORMAL_WEATHER_ROUTE_125_EAST, AbnormalWeather_StartKyogreWeather end Route125_OnLoad: - compare VAR_ABNORMAL_WEATHER_LOCATION, ABNORMAL_WEATHER_ROUTE_125_WEST - call_if_eq AbnormalWeather_EventScript_PlaceTilesRoute125West - compare VAR_ABNORMAL_WEATHER_LOCATION, ABNORMAL_WEATHER_ROUTE_125_EAST - call_if_eq AbnormalWeather_EventScript_PlaceTilesRoute125East + call_if_eq VAR_ABNORMAL_WEATHER_LOCATION, ABNORMAL_WEATHER_ROUTE_125_WEST, AbnormalWeather_EventScript_PlaceTilesRoute125West + call_if_eq VAR_ABNORMAL_WEATHER_LOCATION, ABNORMAL_WEATHER_ROUTE_125_EAST, AbnormalWeather_EventScript_PlaceTilesRoute125East end Route125_OnFrame: @@ -48,8 +43,7 @@ Route125_EventScript_Sharon:: Route125_EventScript_Ernest:: trainerbattle_single TRAINER_ERNEST_1, Route125_Text_ErnestIntro, Route125_Text_ErnestDefeat, Route125_EventScript_RegisterErnest specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq Route125_EventScript_RematchErnest + goto_if_eq VAR_RESULT, TRUE, Route125_EventScript_RematchErnest msgbox Route125_Text_ErnestPostBattle, MSGBOX_DEFAULT release end diff --git a/data/maps/Route126/scripts.inc b/data/maps/Route126/scripts.inc index 79f5bb11be83..752cd2d4d537 100644 --- a/data/maps/Route126/scripts.inc +++ b/data/maps/Route126/scripts.inc @@ -44,8 +44,7 @@ Route126_EventScript_Sienna:: Route126_EventScript_Pablo:: trainerbattle_single TRAINER_PABLO_1, Route126_Text_PabloIntro, Route126_Text_PabloDefeat, Route126_EventScript_RegisterPablo specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq Route126_EventScript_RematchPablo + goto_if_eq VAR_RESULT, TRUE, Route126_EventScript_RematchPablo msgbox Route126_Text_PabloPostBattle, MSGBOX_DEFAULT release end diff --git a/data/maps/Route127/scripts.inc b/data/maps/Route127/scripts.inc index 426e814702b9..05bfb14ffe25 100644 --- a/data/maps/Route127/scripts.inc +++ b/data/maps/Route127/scripts.inc @@ -6,19 +6,14 @@ Route127_MapScripts:: Route127_OnTransition: call_if_set FLAG_SYS_WEATHER_CTRL, Common_EventScript_SetAbnormalWeather - compare VAR_SHOULD_END_ABNORMAL_WEATHER, 1 - call_if_eq AbnormalWeather_EventScript_HideMapNamePopup - compare VAR_ABNORMAL_WEATHER_LOCATION, ABNORMAL_WEATHER_ROUTE_127_NORTH - call_if_eq AbnormalWeather_StartKyogreWeather - compare VAR_ABNORMAL_WEATHER_LOCATION, ABNORMAL_WEATHER_ROUTE_127_SOUTH - call_if_eq AbnormalWeather_StartKyogreWeather + call_if_eq VAR_SHOULD_END_ABNORMAL_WEATHER, 1, AbnormalWeather_EventScript_HideMapNamePopup + call_if_eq VAR_ABNORMAL_WEATHER_LOCATION, ABNORMAL_WEATHER_ROUTE_127_NORTH, AbnormalWeather_StartKyogreWeather + call_if_eq VAR_ABNORMAL_WEATHER_LOCATION, ABNORMAL_WEATHER_ROUTE_127_SOUTH, AbnormalWeather_StartKyogreWeather end Route127_OnLoad: - compare VAR_ABNORMAL_WEATHER_LOCATION, ABNORMAL_WEATHER_ROUTE_127_NORTH - call_if_eq AbnormalWeather_EventScript_PlaceTilesRoute127North - compare VAR_ABNORMAL_WEATHER_LOCATION, ABNORMAL_WEATHER_ROUTE_127_SOUTH - call_if_eq AbnormalWeather_EventScript_PlaceTilesRoute127South + call_if_eq VAR_ABNORMAL_WEATHER_LOCATION, ABNORMAL_WEATHER_ROUTE_127_NORTH, AbnormalWeather_EventScript_PlaceTilesRoute127North + call_if_eq VAR_ABNORMAL_WEATHER_LOCATION, ABNORMAL_WEATHER_ROUTE_127_SOUTH, AbnormalWeather_EventScript_PlaceTilesRoute127South end Route127_OnFrame: @@ -63,8 +58,7 @@ Route127_EventScript_Athena:: Route127_EventScript_Koji:: trainerbattle_single TRAINER_KOJI_1, Route127_Text_KojiIntro, Route127_Text_KojiDefeat, Route127_EventScript_RegisterKoji specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq Route127_EventScript_RematchKoji + goto_if_eq VAR_RESULT, TRUE, Route127_EventScript_RematchKoji msgbox Route127_Text_KojiPostBattle, MSGBOX_DEFAULT release end diff --git a/data/maps/Route128/scripts.inc b/data/maps/Route128/scripts.inc index e550f2bd1257..d08605128a93 100644 --- a/data/maps/Route128/scripts.inc +++ b/data/maps/Route128/scripts.inc @@ -181,8 +181,7 @@ Route128_Movement_MaxieApproachPlayer: Route128_EventScript_Isaiah:: trainerbattle_single TRAINER_ISAIAH_1, Route128_Text_IsaiahIntro, Route128_Text_IsaiahDefeat, Route128_EventScript_RegisterIsaiah specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq Route128_EventScript_RematchIsaiah + goto_if_eq VAR_RESULT, TRUE, Route128_EventScript_RematchIsaiah msgbox Route128_Text_IsaiahPostBattle, MSGBOX_DEFAULT release end @@ -203,8 +202,7 @@ Route128_EventScript_RematchIsaiah:: Route128_EventScript_Katelyn:: trainerbattle_single TRAINER_KATELYN_1, Route128_Text_KatelynIntro, Route128_Text_KatelynDefeat, Route128_EventScript_RegisterKatelyn specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq Route128_EventScript_RematchKatelyn + goto_if_eq VAR_RESULT, TRUE, Route128_EventScript_RematchKatelyn msgbox Route128_Text_KatelynPostBattle, MSGBOX_DEFAULT release end diff --git a/data/maps/Route129/scripts.inc b/data/maps/Route129/scripts.inc index e996722cc9d8..7055675a0e41 100644 --- a/data/maps/Route129/scripts.inc +++ b/data/maps/Route129/scripts.inc @@ -5,21 +5,15 @@ Route129_MapScripts:: .byte 0 Route129_OnLoad: - compare VAR_ABNORMAL_WEATHER_LOCATION, ABNORMAL_WEATHER_ROUTE_129_WEST - call_if_eq AbnormalWeather_EventScript_PlaceTilesRoute129West - compare VAR_ABNORMAL_WEATHER_LOCATION, ABNORMAL_WEATHER_ROUTE_129_EAST - call_if_eq AbnormalWeather_EventScript_PlaceTilesRoute129East + call_if_eq VAR_ABNORMAL_WEATHER_LOCATION, ABNORMAL_WEATHER_ROUTE_129_WEST, AbnormalWeather_EventScript_PlaceTilesRoute129West + call_if_eq VAR_ABNORMAL_WEATHER_LOCATION, ABNORMAL_WEATHER_ROUTE_129_EAST, AbnormalWeather_EventScript_PlaceTilesRoute129East end Route129_OnTransition: - compare VAR_SHOULD_END_ABNORMAL_WEATHER, 1 - call_if_eq AbnormalWeather_EventScript_HideMapNamePopup - compare VAR_SOOTOPOLIS_CITY_STATE, 4 - call_if_ge Route129_EventScript_CheckSetAbnormalWeather - compare VAR_ABNORMAL_WEATHER_LOCATION, ABNORMAL_WEATHER_ROUTE_129_WEST - call_if_eq AbnormalWeather_StartKyogreWeather - compare VAR_ABNORMAL_WEATHER_LOCATION, ABNORMAL_WEATHER_ROUTE_129_EAST - call_if_eq AbnormalWeather_StartKyogreWeather + call_if_eq VAR_SHOULD_END_ABNORMAL_WEATHER, 1, AbnormalWeather_EventScript_HideMapNamePopup + call_if_ge VAR_SOOTOPOLIS_CITY_STATE, 4, Route129_EventScript_CheckSetAbnormalWeather + call_if_eq VAR_ABNORMAL_WEATHER_LOCATION, ABNORMAL_WEATHER_ROUTE_129_WEST, AbnormalWeather_StartKyogreWeather + call_if_eq VAR_ABNORMAL_WEATHER_LOCATION, ABNORMAL_WEATHER_ROUTE_129_EAST, AbnormalWeather_StartKyogreWeather end Route129_EventScript_CheckSetAbnormalWeather:: diff --git a/data/maps/Route130/scripts.inc b/data/maps/Route130/scripts.inc index fe360a36bb72..7e0ecc8bd15b 100644 --- a/data/maps/Route130/scripts.inc +++ b/data/maps/Route130/scripts.inc @@ -3,11 +3,9 @@ Route130_MapScripts:: .byte 0 Route130_OnTransition: - compare VAR_SOOTOPOLIS_CITY_STATE, 4 - call_if_ge Route130_EventScript_CheckSetAbnormalWeather + call_if_ge VAR_SOOTOPOLIS_CITY_STATE, 4, Route130_EventScript_CheckSetAbnormalWeather specialvar VAR_RESULT, IsMirageIslandPresent - compare VAR_RESULT, TRUE - goto_if_eq Route130_EventScript_SetMirageIslandLayout + goto_if_eq VAR_RESULT, TRUE, Route130_EventScript_SetMirageIslandLayout setflag FLAG_TEMP_11 setflag FLAG_TEMP_12 setflag FLAG_TEMP_13 diff --git a/data/maps/Route131/scripts.inc b/data/maps/Route131/scripts.inc index 846998bfe92a..17060c183b8f 100644 --- a/data/maps/Route131/scripts.inc +++ b/data/maps/Route131/scripts.inc @@ -3,8 +3,7 @@ Route131_MapScripts:: .byte 0 Route131_OnTransition: - compare VAR_SOOTOPOLIS_CITY_STATE, 4 - call_if_ge Route131_EventScript_CheckSetAbnormalWeather + call_if_ge VAR_SOOTOPOLIS_CITY_STATE, 4, Route131_EventScript_CheckSetAbnormalWeather call Route131_EventScript_SetLayout end diff --git a/data/maps/Route134/scripts.inc b/data/maps/Route134/scripts.inc index 043835373e6a..226135c1d5d4 100644 --- a/data/maps/Route134/scripts.inc +++ b/data/maps/Route134/scripts.inc @@ -3,7 +3,7 @@ Route134_MapScripts:: .byte 0 Route134_OnResume: - setdivewarp MAP_UNDERWATER_ROUTE134, 255, 8, 6 + setdivewarp MAP_UNDERWATER_ROUTE134, 8, 6 end Route134_EventScript_Jack:: diff --git a/data/maps/RustboroCity/scripts.inc b/data/maps/RustboroCity/scripts.inc index 8d286d5de2fd..28fd38921019 100644 --- a/data/maps/RustboroCity/scripts.inc +++ b/data/maps/RustboroCity/scripts.inc @@ -13,16 +13,13 @@ RustboroCity_MapScripts:: RustboroCity_OnTransition: setflag FLAG_VISITED_RUSTBORO_CITY call Common_EventScript_SetupRivalGfxId - compare VAR_RUSTBORO_CITY_STATE, 6 - call_if_eq RustboroCity_EventScript_HideMapNamePopup + call_if_eq VAR_RUSTBORO_CITY_STATE, 6, RustboroCity_EventScript_HideMapNamePopup getplayerxy VAR_TEMP_0, VAR_TEMP_1 - compare VAR_RUSTBORO_CITY_STATE, 6 - goto_if_eq RustboroCity_EventScript_PositionScientistForExit + goto_if_eq VAR_RUSTBORO_CITY_STATE, 6, RustboroCity_EventScript_PositionScientistForExit end RustboroCity_EventScript_PositionScientistForExit:: - compare VAR_TEMP_0, 11 - goto_if_eq RustboroCity_EventScript_PositionScientistLeftExit + goto_if_eq VAR_TEMP_0, 11, RustboroCity_EventScript_PositionScientistLeftExit setobjectxyperm LOCALID_SCIENTIST, 12, 15 end @@ -506,14 +503,10 @@ RustboroCity_EventScript_HelpGetGoodsTrigger3:: end RustboroCity_EventScript_EmployeeAskToGetGoods:: - compare VAR_TEMP_1, 0 - call_if_eq RustboroCity_EventScript_EmployeeFacePlayerUp1 - compare VAR_TEMP_1, 1 - call_if_eq RustboroCity_EventScript_EmployeeFacePlayerLeft1 - compare VAR_TEMP_1, 2 - call_if_eq RustboroCity_EventScript_EmployeeFacePlayerDown1 - compare VAR_TEMP_1, 3 - call_if_eq RustboroCity_EventScript_EmployeeApproachPlayerDown1 + call_if_eq VAR_TEMP_1, 0, RustboroCity_EventScript_EmployeeFacePlayerUp1 + call_if_eq VAR_TEMP_1, 1, RustboroCity_EventScript_EmployeeFacePlayerLeft1 + call_if_eq VAR_TEMP_1, 2, RustboroCity_EventScript_EmployeeFacePlayerDown1 + call_if_eq VAR_TEMP_1, 3, RustboroCity_EventScript_EmployeeApproachPlayerDown1 setflag FLAG_INTERACTED_WITH_DEVON_EMPLOYEE_GOODS_STOLEN setvar VAR_RUSTBORO_CITY_STATE, 3 copyobjectxytoperm LOCALID_DEVON_EMPLOYEE @@ -601,27 +594,21 @@ RustboroCity_EventScript_ReturnGoodsTrigger3:: end RustboroCity_EventScript_ReturnGoods:: - compare VAR_TEMP_1, 0 - call_if_eq RustboroCity_EventScript_EmployeeFacePlayerUp2 - compare VAR_TEMP_1, 1 - call_if_eq RustboroCity_EventScript_EmployeeFacePlayerLeft2 - compare VAR_TEMP_1, 2 - call_if_eq RustboroCity_EventScript_EmployeeFacePlayerDown2 - compare VAR_TEMP_1, 3 - call_if_eq RustboroCity_EventScript_EmployeeApproachPlayerDown2 - compare VAR_TEMP_1, 4 - call_if_eq RustboroCity_EventScript_EmployeeFacePlayerRight + call_if_eq VAR_TEMP_1, 0, RustboroCity_EventScript_EmployeeFacePlayerUp2 + call_if_eq VAR_TEMP_1, 1, RustboroCity_EventScript_EmployeeFacePlayerLeft2 + call_if_eq VAR_TEMP_1, 2, RustboroCity_EventScript_EmployeeFacePlayerDown2 + call_if_eq VAR_TEMP_1, 3, RustboroCity_EventScript_EmployeeApproachPlayerDown2 + call_if_eq VAR_TEMP_1, 4, RustboroCity_EventScript_EmployeeFacePlayerRight msgbox RustboroCity_Text_YouGotItThankYou, MSGBOX_DEFAULT giveitem ITEM_GREAT_BALL - compare VAR_RESULT, FALSE - call_if_eq RustboroCity_EventScript_BagFull + call_if_eq VAR_RESULT, FALSE, RustboroCity_EventScript_BagFull msgbox RustboroCity_Text_PleaseComeWithMe, MSGBOX_DEFAULT closemessage setflag FLAG_RETURNED_DEVON_GOODS setflag FLAG_HIDE_RUSTBORO_CITY_DEVON_EMPLOYEE_1 setvar VAR_RUSTBORO_CITY_STATE, 5 delay 30 - warp MAP_RUSTBORO_CITY_DEVON_CORP_3F, 255, 2, 2 + warp MAP_RUSTBORO_CITY_DEVON_CORP_3F, 2, 2 waitstate releaseall end @@ -699,10 +686,8 @@ RustboroCity_EventScript_Rival:: RustboroCity_EventScript_PlayRivalMusic:: checkplayergender - compare VAR_RESULT, MALE - goto_if_eq RustboroCity_EventScript_PlayMayMusic - compare VAR_RESULT, FEMALE - goto_if_eq RustboroCity_EventScript_PlayBrendanMusic + goto_if_eq VAR_RESULT, MALE, RustboroCity_EventScript_PlayMayMusic + goto_if_eq VAR_RESULT, FEMALE, RustboroCity_EventScript_PlayBrendanMusic return RustboroCity_EventScript_PlayMayMusic:: @@ -843,10 +828,8 @@ RustboroCity_EventScript_RivalTrigger7:: RustboroCity_EventScript_RivalEncounter:: checkplayergender - compare VAR_RESULT, MALE - goto_if_eq RustboroCity_EventScript_MayEncounter - compare VAR_RESULT, FEMALE - goto_if_eq RustboroCity_EventScript_BrendanEncounter + goto_if_eq VAR_RESULT, MALE, RustboroCity_EventScript_MayEncounter + goto_if_eq VAR_RESULT, FEMALE, RustboroCity_EventScript_BrendanEncounter end RustboroCity_EventScript_MayEncounter:: @@ -866,8 +849,7 @@ RustboroCity_EventScript_MayEncounter:: setvar VAR_ROUTE104_STATE, 2 setvar VAR_0x8008, 0 msgbox RustboroCity_Text_MayPassedBrineyWantToBattle, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq RustboroCity_EventScript_BattleMay + goto_if_eq VAR_RESULT, YES, RustboroCity_EventScript_BattleMay msgbox RustboroCity_Text_MayOhHaventRaisedPokemonEnough, MSGBOX_DEFAULT call RustboroCity_EventScript_RestoreBgm releaseall @@ -876,8 +858,7 @@ RustboroCity_EventScript_MayEncounter:: RustboroCity_EventScript_MayAskToBattle:: setvar VAR_0x8008, 1 msgbox RustboroCity_Text_MayWantToBattle, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq RustboroCity_EventScript_BattleMay + goto_if_eq VAR_RESULT, YES, RustboroCity_EventScript_BattleMay msgbox RustboroCity_Text_MayOhHaventRaisedPokemonEnough, MSGBOX_DEFAULT releaseall end @@ -892,8 +873,7 @@ RustboroCity_EventScript_BattleMay:: RustboroCity_EventScript_MayBrineyHint:: msgbox RustboroCity_Text_MayMrBrineyHint, MSGBOX_DEFAULT - compare VAR_0x8008, 0 - call_if_eq RustboroCity_EventScript_RestoreBgm + call_if_eq VAR_0x8008, 0, RustboroCity_EventScript_RestoreBgm releaseall end @@ -936,8 +916,7 @@ RustboroCity_EventScript_BrendanEncounter:: setvar VAR_RUSTBORO_CITY_STATE, 8 setvar VAR_ROUTE104_STATE, 2 msgbox RustboroCity_Text_BrendanPassedBrineyWantToBattle, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq RustboroCity_EventScript_BattleBrendan + goto_if_eq VAR_RESULT, YES, RustboroCity_EventScript_BattleBrendan msgbox RustboroCity_Text_BrendanNoConfidenceInPokemon, MSGBOX_DEFAULT call RustboroCity_EventScript_RestoreBgm releaseall @@ -945,8 +924,7 @@ RustboroCity_EventScript_BrendanEncounter:: RustboroCity_EventScript_BrendanAskToBattle:: msgbox RustboroCity_Text_BrendanWantToBattle, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq RustboroCity_EventScript_BattleBrendan + goto_if_eq VAR_RESULT, YES, RustboroCity_EventScript_BattleBrendan msgbox RustboroCity_Text_BrendanNoConfidenceInPokemon, MSGBOX_DEFAULT releaseall end @@ -961,8 +939,7 @@ RustboroCity_EventScript_BattleBrendan:: RustboroCity_EventScript_BrendanBrineyHint:: msgbox RustboroCity_Text_BrendanMrBrineyHint, MSGBOX_DEFAULT - compare VAR_0x8008, 0 - call_if_eq RustboroCity_EventScript_RestoreBgm + call_if_eq VAR_0x8008, 0, RustboroCity_EventScript_RestoreBgm releaseall end diff --git a/data/maps/RustboroCity_DevonCorp_2F/scripts.inc b/data/maps/RustboroCity_DevonCorp_2F/scripts.inc index 326cd946e692..987828a295da 100644 --- a/data/maps/RustboroCity_DevonCorp_2F/scripts.inc +++ b/data/maps/RustboroCity_DevonCorp_2F/scripts.inc @@ -5,8 +5,7 @@ RustboroCity_DevonCorp_2F_MapScripts:: .byte 0 RustboroCity_DevonCorp_2F_OnTransition: - compare VAR_FOSSIL_RESURRECTION_STATE, 1 - call_if_eq RustboroCity_DevonCorp_2F_EventScript_SetFossilReady + call_if_eq VAR_FOSSIL_RESURRECTION_STATE, 1, RustboroCity_DevonCorp_2F_EventScript_SetFossilReady end RustboroCity_DevonCorp_2F_EventScript_SetFossilReady:: @@ -16,8 +15,7 @@ RustboroCity_DevonCorp_2F_EventScript_SetFossilReady:: RustboroCity_DevonCorp_2F_EventScript_TalkToPokemonScientist:: lock faceplayer - compare VAR_FOSSIL_RESURRECTION_STATE, 1 - call_if_eq RustboroCity_DevonCorp_2F_EventScript_SetFossilReady + call_if_eq VAR_FOSSIL_RESURRECTION_STATE, 1, RustboroCity_DevonCorp_2F_EventScript_SetFossilReady msgbox RustboroCity_DevonCorp_2F_Text_DeviceForTalkingToPokemon, MSGBOX_DEFAULT release end @@ -25,8 +23,7 @@ RustboroCity_DevonCorp_2F_EventScript_TalkToPokemonScientist:: RustboroCity_DevonCorp_2F_EventScript_BallScientist:: lock faceplayer - compare VAR_FOSSIL_RESURRECTION_STATE, 1 - call_if_eq RustboroCity_DevonCorp_2F_EventScript_SetFossilReady + call_if_eq VAR_FOSSIL_RESURRECTION_STATE, 1, RustboroCity_DevonCorp_2F_EventScript_SetFossilReady goto_if_set FLAG_MET_DEVON_EMPLOYEE, RustboroCity_DevonCorp_2F_EventScript_DevelopedBalls msgbox RustboroCity_DevonCorp_2F_Text_DevelopingNewBalls, MSGBOX_DEFAULT release @@ -40,8 +37,7 @@ RustboroCity_DevonCorp_2F_EventScript_DevelopedBalls:: RustboroCity_DevonCorp_2F_EventScript_PokenavScientist:: lock faceplayer - compare VAR_FOSSIL_RESURRECTION_STATE, 1 - call_if_eq RustboroCity_DevonCorp_2F_EventScript_SetFossilReady + call_if_eq VAR_FOSSIL_RESURRECTION_STATE, 1, RustboroCity_DevonCorp_2F_EventScript_SetFossilReady goto_if_set FLAG_RECEIVED_POKENAV, RustboroCity_DevonCorp_2F_EventScript_HasPokenav msgbox RustboroCity_DevonCorp_2F_Text_IMadePokenav, MSGBOX_DEFAULT release @@ -55,8 +51,7 @@ RustboroCity_DevonCorp_2F_EventScript_HasPokenav:: RustboroCity_DevonCorp_2F_EventScript_PokemonDreamsScientist:: lock faceplayer - compare VAR_FOSSIL_RESURRECTION_STATE, 1 - call_if_eq RustboroCity_DevonCorp_2F_EventScript_SetFossilReady + call_if_eq VAR_FOSSIL_RESURRECTION_STATE, 1, RustboroCity_DevonCorp_2F_EventScript_SetFossilReady msgbox RustboroCity_DevonCorp_2F_Text_DeviceToVisualizePokemonDreams, MSGBOX_DEFAULT release end @@ -64,17 +59,13 @@ RustboroCity_DevonCorp_2F_EventScript_PokemonDreamsScientist:: RustboroCity_DevonCorp_2F_EventScript_FossilScientist:: lock faceplayer - compare VAR_FOSSIL_RESURRECTION_STATE, 2 - goto_if_eq RustboroCity_DevonCorp_2F_EventScript_FossilMonReady - compare VAR_FOSSIL_RESURRECTION_STATE, 1 - goto_if_eq RustboroCity_DevonCorp_2F_EventScript_StillRegenerating + goto_if_eq VAR_FOSSIL_RESURRECTION_STATE, 2, RustboroCity_DevonCorp_2F_EventScript_FossilMonReady + goto_if_eq VAR_FOSSIL_RESURRECTION_STATE, 1, RustboroCity_DevonCorp_2F_EventScript_StillRegenerating msgbox RustboroCity_DevonCorp_2F_Text_DevelopDeviceToResurrectFossils, MSGBOX_DEFAULT - checkitem ITEM_ROOT_FOSSIL, 1 - compare VAR_RESULT, TRUE - goto_if_eq RustboroCity_DevonCorp_2F_EventScript_NoticeRootFossil - checkitem ITEM_CLAW_FOSSIL, 1 - compare VAR_RESULT, TRUE - goto_if_eq RustboroCity_DevonCorp_2F_EventScript_NoticeClawFossil + checkitem ITEM_ROOT_FOSSIL + goto_if_eq VAR_RESULT, TRUE, RustboroCity_DevonCorp_2F_EventScript_NoticeRootFossil + checkitem ITEM_CLAW_FOSSIL + goto_if_eq VAR_RESULT, TRUE, RustboroCity_DevonCorp_2F_EventScript_NoticeClawFossil release end @@ -87,16 +78,14 @@ RustboroCity_DevonCorp_2F_EventScript_NoticeRootFossil:: applymovement LOCALID_FOSSIL_SCIENTIST, Common_Movement_Delay48 waitmovement 0 msgbox RustboroCity_DevonCorp_2F_Text_WantToBringFossilBackToLife, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq RustboroCity_DevonCorp_2F_EventScript_DeclineGiveFossil - checkitem ITEM_CLAW_FOSSIL, 1 - compare VAR_RESULT, TRUE - goto_if_eq RustboroCity_DevonCorp_2F_EventScript_ChooseFossil + goto_if_eq VAR_RESULT, NO, RustboroCity_DevonCorp_2F_EventScript_DeclineGiveFossil + checkitem ITEM_CLAW_FOSSIL + goto_if_eq VAR_RESULT, TRUE, RustboroCity_DevonCorp_2F_EventScript_ChooseFossil goto RustboroCity_DevonCorp_2F_EventScript_GiveRootFossil end RustboroCity_DevonCorp_2F_EventScript_GiveRootFossil:: - bufferitemname 0, ITEM_ROOT_FOSSIL + bufferitemname STR_VAR_1, ITEM_ROOT_FOSSIL msgbox RustboroCity_DevonCorp_2F_Text_HandedFossilToResearcher, MSGBOX_DEFAULT removeitem ITEM_ROOT_FOSSIL setvar VAR_FOSSIL_RESURRECTION_STATE, 1 @@ -112,16 +101,14 @@ RustboroCity_DevonCorp_2F_EventScript_NoticeClawFossil:: applymovement LOCALID_FOSSIL_SCIENTIST, Common_Movement_Delay48 waitmovement 0 msgbox RustboroCity_DevonCorp_2F_Text_WantToBringFossilBackToLife, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq RustboroCity_DevonCorp_2F_EventScript_DeclineGiveFossil - checkitem ITEM_ROOT_FOSSIL, 1 - compare VAR_RESULT, TRUE - goto_if_eq RustboroCity_DevonCorp_2F_EventScript_ChooseFossil + goto_if_eq VAR_RESULT, NO, RustboroCity_DevonCorp_2F_EventScript_DeclineGiveFossil + checkitem ITEM_ROOT_FOSSIL + goto_if_eq VAR_RESULT, TRUE, RustboroCity_DevonCorp_2F_EventScript_ChooseFossil goto RustboroCity_DevonCorp_2F_EventScript_GiveClawFossil end RustboroCity_DevonCorp_2F_EventScript_GiveClawFossil:: - bufferitemname 0, ITEM_CLAW_FOSSIL + bufferitemname STR_VAR_1, ITEM_CLAW_FOSSIL msgbox RustboroCity_DevonCorp_2F_Text_HandedFossilToResearcher, MSGBOX_DEFAULT removeitem ITEM_CLAW_FOSSIL setvar VAR_FOSSIL_RESURRECTION_STATE, 1 @@ -140,20 +127,18 @@ RustboroCity_DevonCorp_2F_EventScript_StillRegenerating:: end RustboroCity_DevonCorp_2F_EventScript_FossilMonReady:: - compare VAR_WHICH_FOSSIL_REVIVED, 1 - goto_if_eq RustboroCity_DevonCorp_2F_EventScript_LileepReady - compare VAR_WHICH_FOSSIL_REVIVED, 2 - goto_if_eq RustboroCity_DevonCorp_2F_EventScript_AnorithReady + goto_if_eq VAR_WHICH_FOSSIL_REVIVED, 1, RustboroCity_DevonCorp_2F_EventScript_LileepReady + goto_if_eq VAR_WHICH_FOSSIL_REVIVED, 2, RustboroCity_DevonCorp_2F_EventScript_AnorithReady end RustboroCity_DevonCorp_2F_EventScript_LileepReady:: - bufferspeciesname 1, SPECIES_LILEEP + bufferspeciesname STR_VAR_2, SPECIES_LILEEP msgbox RustboroCity_DevonCorp_2F_Text_FossilizedMonBroughtBackToLife, MSGBOX_DEFAULT goto RustboroCity_DevonCorp_2F_EventScript_ReceiveLileep end RustboroCity_DevonCorp_2F_EventScript_AnorithReady:: - bufferspeciesname 1, SPECIES_ANORITH + bufferspeciesname STR_VAR_2, SPECIES_ANORITH msgbox RustboroCity_DevonCorp_2F_Text_FossilizedMonBroughtBackToLife, MSGBOX_DEFAULT goto RustboroCity_DevonCorp_2F_EventScript_ReceiveAnorith end @@ -161,18 +146,15 @@ RustboroCity_DevonCorp_2F_EventScript_AnorithReady:: RustboroCity_DevonCorp_2F_EventScript_ReceiveLileep:: setvar VAR_TEMP_1, SPECIES_LILEEP givemon SPECIES_LILEEP, 20, ITEM_NONE - compare VAR_RESULT, 0 - goto_if_eq RustboroCity_DevonCorp_2F_EventScript_ReceiveLileepParty - compare VAR_RESULT, 1 - goto_if_eq RustboroCity_DevonCorp_2F_EventScript_ReceiveLileepPC + goto_if_eq VAR_RESULT, 0, RustboroCity_DevonCorp_2F_EventScript_ReceiveLileepParty + goto_if_eq VAR_RESULT, 1, RustboroCity_DevonCorp_2F_EventScript_ReceiveLileepPC goto Common_EventScript_NoMoreRoomForPokemon end RustboroCity_DevonCorp_2F_EventScript_ReceiveLileepParty:: call RustboroCity_DevonCorp_2F_EventScript_ReceivedLileepFanfare msgbox gText_NicknameThisPokemon, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq RustboroCity_DevonCorp_2F_EventScript_FinishReceivingLileep + goto_if_eq VAR_RESULT, NO, RustboroCity_DevonCorp_2F_EventScript_FinishReceivingLileep call Common_EventScript_GetGiftMonPartySlot call Common_EventScript_NameReceivedPartyMon goto RustboroCity_DevonCorp_2F_EventScript_FinishReceivingLileep @@ -181,8 +163,7 @@ RustboroCity_DevonCorp_2F_EventScript_ReceiveLileepParty:: RustboroCity_DevonCorp_2F_EventScript_ReceiveLileepPC:: call RustboroCity_DevonCorp_2F_EventScript_ReceivedLileepFanfare msgbox gText_NicknameThisPokemon, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq RustboroCity_DevonCorp_2F_EventScript_TransferLileepToPC + goto_if_eq VAR_RESULT, NO, RustboroCity_DevonCorp_2F_EventScript_TransferLileepToPC call Common_EventScript_NameReceivedBoxMon goto RustboroCity_DevonCorp_2F_EventScript_TransferLileepToPC end @@ -193,12 +174,12 @@ RustboroCity_DevonCorp_2F_EventScript_TransferLileepToPC:: end RustboroCity_DevonCorp_2F_EventScript_ReceivedLileepFanfare:: - bufferspeciesname 1, SPECIES_LILEEP + bufferspeciesname STR_VAR_2, SPECIES_LILEEP playfanfare MUS_OBTAIN_ITEM message RustboroCity_DevonCorp_2F_Text_ReceivedMonFromResearcher waitmessage waitfanfare - bufferspeciesname 0, SPECIES_LILEEP + bufferspeciesname STR_VAR_1, SPECIES_LILEEP return RustboroCity_DevonCorp_2F_EventScript_FinishReceivingLileep:: @@ -210,18 +191,15 @@ RustboroCity_DevonCorp_2F_EventScript_FinishReceivingLileep:: RustboroCity_DevonCorp_2F_EventScript_ReceiveAnorith:: setvar VAR_TEMP_1, SPECIES_ANORITH givemon SPECIES_ANORITH, 20, ITEM_NONE - compare VAR_RESULT, 0 - goto_if_eq RustboroCity_DevonCorp_2F_EventScript_ReceiveAnorithParty - compare VAR_RESULT, 1 - goto_if_eq RustboroCity_DevonCorp_2F_EventScript_ReceiveAnorithPC + goto_if_eq VAR_RESULT, 0, RustboroCity_DevonCorp_2F_EventScript_ReceiveAnorithParty + goto_if_eq VAR_RESULT, 1, RustboroCity_DevonCorp_2F_EventScript_ReceiveAnorithPC goto Common_EventScript_NoMoreRoomForPokemon end RustboroCity_DevonCorp_2F_EventScript_ReceiveAnorithParty:: call RustboroCity_DevonCorp_2F_EventScript_ReceivedAnorithFanfare msgbox gText_NicknameThisPokemon, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq RustboroCity_DevonCorp_2F_EventScript_FinishReceivingAnorith + goto_if_eq VAR_RESULT, NO, RustboroCity_DevonCorp_2F_EventScript_FinishReceivingAnorith call Common_EventScript_GetGiftMonPartySlot call Common_EventScript_NameReceivedPartyMon goto RustboroCity_DevonCorp_2F_EventScript_FinishReceivingAnorith @@ -230,8 +208,7 @@ RustboroCity_DevonCorp_2F_EventScript_ReceiveAnorithParty:: RustboroCity_DevonCorp_2F_EventScript_ReceiveAnorithPC:: call RustboroCity_DevonCorp_2F_EventScript_ReceivedAnorithFanfare msgbox gText_NicknameThisPokemon, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq RustboroCity_DevonCorp_2F_EventScript_TransferAnorithToPC + goto_if_eq VAR_RESULT, NO, RustboroCity_DevonCorp_2F_EventScript_TransferAnorithToPC call Common_EventScript_NameReceivedBoxMon goto RustboroCity_DevonCorp_2F_EventScript_TransferAnorithToPC end @@ -242,12 +219,12 @@ RustboroCity_DevonCorp_2F_EventScript_TransferAnorithToPC:: end RustboroCity_DevonCorp_2F_EventScript_ReceivedAnorithFanfare:: - bufferspeciesname 1, SPECIES_ANORITH + bufferspeciesname STR_VAR_2, SPECIES_ANORITH playfanfare MUS_OBTAIN_ITEM message RustboroCity_DevonCorp_2F_Text_ReceivedMonFromResearcher waitmessage waitfanfare - bufferspeciesname 0, SPECIES_ANORITH + bufferspeciesname STR_VAR_1, SPECIES_ANORITH return RustboroCity_DevonCorp_2F_EventScript_FinishReceivingAnorith:: @@ -282,10 +259,8 @@ RustboroCity_DevonCorp_2F_EventScript_CancelFossilSelect:: RustboroCity_DevonCorp_2F_EventScript_MatchCallScientist:: lock faceplayer - compare VAR_FOSSIL_RESURRECTION_STATE, 1 - call_if_eq RustboroCity_DevonCorp_2F_EventScript_SetFossilReady - compare VAR_RUSTBORO_CITY_STATE, 6 - goto_if_ge RustboroCity_DevonCorp_2F_EventScript_WorkOnNext + call_if_eq VAR_FOSSIL_RESURRECTION_STATE, 1, RustboroCity_DevonCorp_2F_EventScript_SetFossilReady + goto_if_ge VAR_RUSTBORO_CITY_STATE, 6, RustboroCity_DevonCorp_2F_EventScript_WorkOnNext msgbox RustboroCity_DevonCorp_2F_Text_DevelopNewPokenavFeature, MSGBOX_DEFAULT release end diff --git a/data/maps/RustboroCity_DevonCorp_3F/scripts.inc b/data/maps/RustboroCity_DevonCorp_3F/scripts.inc index d249cc51f648..ebf9044c54a1 100644 --- a/data/maps/RustboroCity_DevonCorp_3F/scripts.inc +++ b/data/maps/RustboroCity_DevonCorp_3F/scripts.inc @@ -7,8 +7,7 @@ RustboroCity_DevonCorp_3F_MapScripts:: .byte 0 RustboroCity_DevonCorp_3F_OnTransition: - compare VAR_DEVON_CORP_3F_STATE, 0 - call_if_eq RustboroCity_DevonCorp_3F_EventScript_SetEmployeePos + call_if_eq VAR_DEVON_CORP_3F_STATE, 0, RustboroCity_DevonCorp_3F_EventScript_SetEmployeePos end RustboroCity_DevonCorp_3F_EventScript_SetEmployeePos:: @@ -164,8 +163,7 @@ RustboroCity_DevonCorp_3F_EventScript_MrStone:: RustboroCity_DevonCorp_3F_EventScript_GiveExpShare:: msgbox RustboroCity_DevonCorp_3F_Text_ThankYouForDeliveringLetter, MSGBOX_DEFAULT giveitem ITEM_EXP_SHARE - compare VAR_RESULT, FALSE - goto_if_eq Common_EventScript_ShowBagIsFull + goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull setflag FLAG_RECEIVED_EXP_SHARE msgbox RustboroCity_DevonCorp_3F_Text_ExplainExpShare, MSGBOX_DEFAULT closemessage diff --git a/data/maps/RustboroCity_Flat1_2F/scripts.inc b/data/maps/RustboroCity_Flat1_2F/scripts.inc index a9d24092f8c2..8e972182c131 100644 --- a/data/maps/RustboroCity_Flat1_2F/scripts.inc +++ b/data/maps/RustboroCity_Flat1_2F/scripts.inc @@ -7,36 +7,28 @@ RustboroCity_Flat1_2F_EventScript_WaldasDad:: lock faceplayer specialvar VAR_RESULT, TryBufferWaldaPhrase - compare VAR_RESULT, FALSE - goto_if_eq RustboroCity_Flat1_2F_EventScript_WaldasDadFirstPhrase - compare VAR_RESULT, TRUE - goto_if_eq RustboroCity_Flat1_2F_EventScript_WaldasDadNewPhrase + goto_if_eq VAR_RESULT, FALSE, RustboroCity_Flat1_2F_EventScript_WaldasDadFirstPhrase + goto_if_eq VAR_RESULT, TRUE, RustboroCity_Flat1_2F_EventScript_WaldasDadNewPhrase RustboroCity_Flat1_2F_EventScript_GivePhrase:: special DoWaldaNamingScreen waitstate - compare VAR_0x8004, 1 - goto_if_eq RustboroCity_Flat1_2F_EventScript_CancelGivePhrase - compare VAR_0x8004, 2 - goto_if_eq RustboroCity_Flat1_2F_EventScript_CancelGiveFirstPhrase + goto_if_eq VAR_0x8004, 1, RustboroCity_Flat1_2F_EventScript_CancelGivePhrase + goto_if_eq VAR_0x8004, 2, RustboroCity_Flat1_2F_EventScript_CancelGiveFirstPhrase specialvar VAR_RESULT, TryGetWallpaperWithWaldaPhrase - compare VAR_RESULT, TRUE - goto_if_eq RustboroCity_Flat1_2F_EventScript_WaldaLikesPhrase - compare VAR_RESULT, FALSE - goto_if_eq RustboroCity_Flat1_2F_EventScript_WaldaDoesntLikePhrase + goto_if_eq VAR_RESULT, TRUE, RustboroCity_Flat1_2F_EventScript_WaldaLikesPhrase + goto_if_eq VAR_RESULT, FALSE, RustboroCity_Flat1_2F_EventScript_WaldaDoesntLikePhrase end RustboroCity_Flat1_2F_EventScript_WaldasDadFirstPhrase:: msgbox RustboroCity_Flat1_2F_Text_HelloDoYouKnowFunnyPhrase, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq RustboroCity_Flat1_2F_EventScript_DeclineGivePhrase + goto_if_eq VAR_RESULT, NO, RustboroCity_Flat1_2F_EventScript_DeclineGivePhrase msgbox RustboroCity_Flat1_2F_Text_WonderfulLetsHearSuggestion, MSGBOX_DEFAULT goto RustboroCity_Flat1_2F_EventScript_GivePhrase RustboroCity_Flat1_2F_EventScript_WaldasDadNewPhrase:: msgbox RustboroCity_Flat1_2F_Text_BeenSayingXDoYouKnowBetterPhrase, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq RustboroCity_Flat1_2F_EventScript_DeclineGivePhrase + goto_if_eq VAR_RESULT, NO, RustboroCity_Flat1_2F_EventScript_DeclineGivePhrase msgbox RustboroCity_Flat1_2F_Text_WonderfulLetsHearSuggestion, MSGBOX_DEFAULT goto RustboroCity_Flat1_2F_EventScript_GivePhrase diff --git a/data/maps/RustboroCity_Flat2_2F/scripts.inc b/data/maps/RustboroCity_Flat2_2F/scripts.inc index 29edb7b586ce..97145ce8f242 100644 --- a/data/maps/RustboroCity_Flat2_2F/scripts.inc +++ b/data/maps/RustboroCity_Flat2_2F/scripts.inc @@ -11,8 +11,7 @@ RustboroCity_Flat2_2F_EventScript_NinjaBoy:: goto_if_set FLAG_RECEIVED_PREMIER_BALL_RUSTBORO, RustboroCity_Flat2_2F_EventScript_GavePremierBall msgbox RustboroCity_Flat2_2F_Text_MyDaddyMadeThisYouCanHaveIt, MSGBOX_DEFAULT giveitem ITEM_PREMIER_BALL - compare VAR_RESULT, FALSE - goto_if_eq Common_EventScript_ShowBagIsFull + goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull setflag FLAG_RECEIVED_PREMIER_BALL_RUSTBORO release end diff --git a/data/maps/RustboroCity_Gym/scripts.inc b/data/maps/RustboroCity_Gym/scripts.inc index 11354fac0a0b..e1596a9730e7 100644 --- a/data/maps/RustboroCity_Gym/scripts.inc +++ b/data/maps/RustboroCity_Gym/scripts.inc @@ -4,8 +4,7 @@ RustboroCity_Gym_MapScripts:: RustboroCity_Gym_EventScript_Roxanne:: trainerbattle_single TRAINER_ROXANNE_1, RustboroCity_Gym_Text_RoxanneIntro, RustboroCity_Gym_Text_RoxanneDefeat, RustboroCity_Gym_EventScript_RoxanneDefeated, NO_MUSIC specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq RustboroCity_Gym_EventScript_RoxanneRematch + goto_if_eq VAR_RESULT, TRUE, RustboroCity_Gym_EventScript_RoxanneRematch goto_if_unset FLAG_RECEIVED_TM39, RustboroCity_Gym_EventScript_GiveRockTomb msgbox RustboroCity_Gym_Text_RoxannePostBattle, MSGBOX_DEFAULT release @@ -22,15 +21,13 @@ RustboroCity_Gym_EventScript_RoxanneDefeated:: addvar VAR_PETALBURG_GYM_STATE, 1 setvar VAR_0x8008, 1 call Common_EventScript_SetGymTrainers - compare VAR_PETALBURG_GYM_STATE, 6 - call_if_eq Common_EventScript_ReadyPetalburgGymForBattle + call_if_eq VAR_PETALBURG_GYM_STATE, 6, Common_EventScript_ReadyPetalburgGymForBattle goto RustboroCity_Gym_EventScript_GiveRockTomb end RustboroCity_Gym_EventScript_GiveRockTomb:: giveitem ITEM_TM39 - compare VAR_RESULT, FALSE - goto_if_eq Common_EventScript_ShowBagIsFull + goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull setflag FLAG_RECEIVED_TM39 msgbox RustboroCity_Gym_Text_ExplainRockTomb, MSGBOX_DEFAULT release diff --git a/data/maps/RustboroCity_House1/scripts.inc b/data/maps/RustboroCity_House1/scripts.inc index 0b7de48bc54b..88a33786c0a6 100644 --- a/data/maps/RustboroCity_House1/scripts.inc +++ b/data/maps/RustboroCity_House1/scripts.inc @@ -10,18 +10,15 @@ RustboroCity_House1_EventScript_Trader:: specialvar VAR_RESULT, GetInGameTradeSpeciesInfo copyvar VAR_0x8009, VAR_RESULT msgbox RustboroCity_House1_Text_IllTradeIfYouWant, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq RustboroCity_House1_EventScript_DeclineTrade + goto_if_eq VAR_RESULT, NO, RustboroCity_House1_EventScript_DeclineTrade special ChoosePartyMon waitstate copyvar VAR_0x800A, VAR_0x8004 - compare VAR_0x8004, 255 - goto_if_eq RustboroCity_House1_EventScript_DeclineTrade + goto_if_eq VAR_0x8004, PARTY_NOTHING_CHOSEN, RustboroCity_House1_EventScript_DeclineTrade copyvar VAR_0x8005, VAR_0x800A specialvar VAR_RESULT, GetTradeSpecies copyvar VAR_0x800B, VAR_RESULT - compare VAR_RESULT, VAR_0x8009 - goto_if_ne RustboroCity_House1_EventScript_NotRequestedMon + goto_if_ne VAR_RESULT, VAR_0x8009, RustboroCity_House1_EventScript_NotRequestedMon copyvar VAR_0x8004, VAR_0x8008 copyvar VAR_0x8005, VAR_0x800A special CreateInGameTradePokemon @@ -38,7 +35,7 @@ RustboroCity_House1_EventScript_DeclineTrade:: end RustboroCity_House1_EventScript_NotRequestedMon:: - bufferspeciesname 0, VAR_0x8009 + bufferspeciesname STR_VAR_1, VAR_0x8009 msgbox RustboroCity_House1_Text_DoesntLookLikeMonToMe, MSGBOX_DEFAULT release end diff --git a/data/maps/RustboroCity_PokemonSchool/scripts.inc b/data/maps/RustboroCity_PokemonSchool/scripts.inc index fcc374ddc79e..8a409d49b3fd 100644 --- a/data/maps/RustboroCity_PokemonSchool/scripts.inc +++ b/data/maps/RustboroCity_PokemonSchool/scripts.inc @@ -78,14 +78,11 @@ RustboroCity_PokemonSchool_EventScript_Teacher:: lock faceplayer goto_if_set FLAG_RECEIVED_QUICK_CLAW, RustboroCity_PokemonSchool_EventScript_GaveQuickClaw - compare VAR_FACING, DIR_EAST - call_if_eq RustboroCity_PokemonSchool_EventScript_TeacherCheckOnStudentsEast - compare VAR_FACING, DIR_WEST - call_if_eq RustboroCity_PokemonSchool_EventScript_TeacherCheckOnStudentsWest + call_if_eq VAR_FACING, DIR_EAST, RustboroCity_PokemonSchool_EventScript_TeacherCheckOnStudentsEast + call_if_eq VAR_FACING, DIR_WEST, RustboroCity_PokemonSchool_EventScript_TeacherCheckOnStudentsWest msgbox RustboroCity_PokemonSchool_Text_StudentsWhoDontStudyGetQuickClaw, MSGBOX_DEFAULT giveitem ITEM_QUICK_CLAW - compare VAR_RESULT, 0 - goto_if_eq Common_EventScript_ShowBagIsFull + goto_if_eq VAR_RESULT, 0, Common_EventScript_ShowBagIsFull closemessage applymovement VAR_LAST_TALKED, Common_Movement_WalkInPlaceFasterDown waitmovement 0 diff --git a/data/maps/RusturfTunnel/scripts.inc b/data/maps/RusturfTunnel/scripts.inc index 97a158f22d6c..e7eee5817ae8 100644 --- a/data/maps/RusturfTunnel/scripts.inc +++ b/data/maps/RusturfTunnel/scripts.inc @@ -15,8 +15,7 @@ RusturfTunnel_OnFrame: .2byte 0 RusturfTunnel_OnTransition: - compare VAR_RUSTURF_TUNNEL_STATE, 2 - call_if_eq RusturfTunnel_EventScript_SetAquaGruntAndPeekoPos + call_if_eq VAR_RUSTURF_TUNNEL_STATE, 2, RusturfTunnel_EventScript_SetAquaGruntAndPeekoPos end RusturfTunnel_EventScript_SetAquaGruntAndPeekoPos:: @@ -56,36 +55,25 @@ RusturfTunnel_EventScript_AlreadySpokenTo:: RusturfTunnel_EventScript_ClearTunnelScene:: lockall - compare VAR_TEMP_1, 1 - call_if_eq RusturfTunnel_EventScript_FaceWandasBoyfriend1 - compare VAR_TEMP_1, 2 - call_if_eq RusturfTunnel_EventScript_FaceWandasBoyfriend2 - compare VAR_TEMP_1, 3 - call_if_eq RusturfTunnel_EventScript_FaceWandasBoyfriend3 + call_if_eq VAR_TEMP_1, 1, RusturfTunnel_EventScript_FaceWandasBoyfriend1 + call_if_eq VAR_TEMP_1, 2, RusturfTunnel_EventScript_FaceWandasBoyfriend2 + call_if_eq VAR_TEMP_1, 3, RusturfTunnel_EventScript_FaceWandasBoyfriend3 call RusturfTunnel_EventScript_WandasBoyfriendNotice msgbox RusturfTunnel_Text_YouShatteredBoulderTakeHM, MSGBOX_DEFAULT - compare VAR_TEMP_1, 2 - call_if_eq RusturfTunnel_EventScript_WandasBoyfriendApproachPlayer - compare VAR_TEMP_1, 3 - call_if_eq RusturfTunnel_EventScript_WandasBoyfriendApproachPlayer + call_if_eq VAR_TEMP_1, 2, RusturfTunnel_EventScript_WandasBoyfriendApproachPlayer + call_if_eq VAR_TEMP_1, 3, RusturfTunnel_EventScript_WandasBoyfriendApproachPlayer giveitem ITEM_HM04 setflag FLAG_RECEIVED_HM04 msgbox RusturfTunnel_Text_ExplainStrength, MSGBOX_DEFAULT closemessage - compare VAR_TEMP_1, 1 - call_if_eq RusturfTunnel_EventScript_BoyfriendApproachWanda1 - compare VAR_TEMP_1, 2 - call_if_eq RusturfTunnel_EventScript_BoyfriendApproachWanda2 - compare VAR_TEMP_1, 3 - call_if_eq RusturfTunnel_EventScript_BoyfriendApproachWanda3 + call_if_eq VAR_TEMP_1, 1, RusturfTunnel_EventScript_BoyfriendApproachWanda1 + call_if_eq VAR_TEMP_1, 2, RusturfTunnel_EventScript_BoyfriendApproachWanda2 + call_if_eq VAR_TEMP_1, 3, RusturfTunnel_EventScript_BoyfriendApproachWanda3 msgbox RusturfTunnel_Text_WandaReunion, MSGBOX_DEFAULT closemessage - compare VAR_TEMP_1, 1 - call_if_eq RusturfTunnel_EventScript_WandaAndBoyfriendExit1 - compare VAR_TEMP_1, 2 - call_if_eq RusturfTunnel_EventScript_WandaAndBoyfriendExit - compare VAR_TEMP_1, 3 - call_if_eq RusturfTunnel_EventScript_WandaAndBoyfriendExit + call_if_eq VAR_TEMP_1, 1, RusturfTunnel_EventScript_WandaAndBoyfriendExit1 + call_if_eq VAR_TEMP_1, 2, RusturfTunnel_EventScript_WandaAndBoyfriendExit + call_if_eq VAR_TEMP_1, 3, RusturfTunnel_EventScript_WandaAndBoyfriendExit call RusturfTunnel_EventScript_SetRusturfTunnelOpen releaseall end diff --git a/data/maps/SSTidalCorridor/scripts.inc b/data/maps/SSTidalCorridor/scripts.inc index 4aa94de2373f..b39b9a433630 100644 --- a/data/maps/SSTidalCorridor/scripts.inc +++ b/data/maps/SSTidalCorridor/scripts.inc @@ -45,10 +45,8 @@ SSTidalRooms_EventScript_ArrivedInLilycove:: return SSTidalCorridor_EventScript_ReachedStepCount:: - compare VAR_SS_TIDAL_STATE, SS_TIDAL_DEPART_SLATEPORT - goto_if_eq SSTidalCorridor_EventScript_HalfwayToLilycove - compare VAR_SS_TIDAL_STATE, SS_TIDAL_HALFWAY_SLATEPORT - goto_if_eq SSTidalCorridor_EventScript_ArrivedInSlateport + goto_if_eq VAR_SS_TIDAL_STATE, SS_TIDAL_DEPART_SLATEPORT, SSTidalCorridor_EventScript_HalfwayToLilycove + goto_if_eq VAR_SS_TIDAL_STATE, SS_TIDAL_HALFWAY_SLATEPORT, SSTidalCorridor_EventScript_ArrivedInSlateport end SSTidalCorridor_EventScript_HalfwayToLilycove:: @@ -117,10 +115,8 @@ SSTidalCorridor_EventScript_Cabin4Sign:: SSTidalCorridor_EventScript_ExitSailor:: lock faceplayer - compare VAR_SS_TIDAL_STATE, SS_TIDAL_LAND_LILYCOVE - goto_if_eq SSTidalCorridor_EventScript_ExitLilycove - compare VAR_SS_TIDAL_STATE, SS_TIDAL_LAND_SLATEPORT - goto_if_eq SSTidalCorridor_EventScript_ExitSlateport + goto_if_eq VAR_SS_TIDAL_STATE, SS_TIDAL_LAND_LILYCOVE, SSTidalCorridor_EventScript_ExitLilycove + goto_if_eq VAR_SS_TIDAL_STATE, SS_TIDAL_LAND_SLATEPORT, SSTidalCorridor_EventScript_ExitSlateport msgbox SSTidalCorridor_Text_CanRestInCabin2, MSGBOX_DEFAULT release end @@ -129,7 +125,7 @@ SSTidalCorridor_EventScript_ExitLilycove:: setrespawn HEAL_LOCATION_LILYCOVE_CITY msgbox SSTidalCorridor_Text_WeveArrived, MSGBOX_DEFAULT call_if_set FLAG_RECEIVED_TM49, SSTidalCorridor_EventScript_HideSnatchGiver - warp MAP_LILYCOVE_CITY_HARBOR, 255, 8, 11 + warp MAP_LILYCOVE_CITY_HARBOR, 8, 11 waitstate release end @@ -138,7 +134,7 @@ SSTidalCorridor_EventScript_ExitSlateport:: setrespawn HEAL_LOCATION_SLATEPORT_CITY msgbox SSTidalCorridor_Text_WeveArrived, MSGBOX_DEFAULT call_if_set FLAG_RECEIVED_TM49, SSTidalCorridor_EventScript_HideSnatchGiver - warp MAP_SLATEPORT_CITY_HARBOR, 255, 8, 11 + warp MAP_SLATEPORT_CITY_HARBOR, 8, 11 waitstate release end @@ -149,10 +145,8 @@ SSTidalCorridor_EventScript_HideSnatchGiver:: SSTidalCorridor_EventScript_Porthole:: lockall - compare VAR_SS_TIDAL_STATE, SS_TIDAL_DEPART_SLATEPORT - goto_if_eq SSTidalCorridor_EventScript_LookThroughPorthole - compare VAR_SS_TIDAL_STATE, SS_TIDAL_HALFWAY_SLATEPORT - goto_if_eq SSTidalCorridor_EventScript_LookThroughPorthole + goto_if_eq VAR_SS_TIDAL_STATE, SS_TIDAL_DEPART_SLATEPORT, SSTidalCorridor_EventScript_LookThroughPorthole + goto_if_eq VAR_SS_TIDAL_STATE, SS_TIDAL_HALFWAY_SLATEPORT, SSTidalCorridor_EventScript_LookThroughPorthole msgbox SSTidalCorridor_Text_HorizonSpreadsBeyondPorthole, MSGBOX_DEFAULT releaseall end diff --git a/data/maps/SSTidalRooms/scripts.inc b/data/maps/SSTidalRooms/scripts.inc index c5cade489e2f..c3aa8ff8ab55 100644 --- a/data/maps/SSTidalRooms/scripts.inc +++ b/data/maps/SSTidalRooms/scripts.inc @@ -7,8 +7,7 @@ SSTidalRooms_EventScript_SnatchGiver:: goto_if_set FLAG_RECEIVED_TM49, SSTidalRooms_EventScript_ExplainSnatch msgbox SSTidalRooms_Text_NotSuspiciousTakeThis, MSGBOX_DEFAULT giveitem ITEM_TM49 - compare VAR_RESULT, FALSE - goto_if_eq Common_EventScript_ShowBagIsFull + goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull setflag FLAG_RECEIVED_TM49 msgbox SSTidalRooms_Text_ExplainSnatch, MSGBOX_DEFAULT release diff --git a/data/maps/SafariZone_South/scripts.inc b/data/maps/SafariZone_South/scripts.inc index 791572fe0c7e..6b4c774c2ba5 100644 --- a/data/maps/SafariZone_South/scripts.inc +++ b/data/maps/SafariZone_South/scripts.inc @@ -21,8 +21,7 @@ SafariZone_South_EventScript_EnterSafariZone:: end SafariZone_South_OnTransition: - compare VAR_SAFARI_ZONE_STATE, 2 - call_if_eq SafariZone_South_EventScript_SetExitAttendantAside + call_if_eq VAR_SAFARI_ZONE_STATE, 2, SafariZone_South_EventScript_SetExitAttendantAside end SafariZone_South_EventScript_SetExitAttendantAside:: @@ -55,8 +54,7 @@ SafariZone_South_EventScript_ExitAttendant:: faceplayer goto_if_unset FLAG_GOOD_LUCK_SAFARI_ZONE, SafariZone_South_EventScript_GoodLuck msgbox SafariZone_South_Text_StillHaveTimeExit, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq SafariZone_South_EventScript_ExitEarly + goto_if_eq VAR_RESULT, YES, SafariZone_South_EventScript_ExitEarly msgbox SafariZone_South_Text_EnjoyTheRestOfYourAdventure, MSGBOX_DEFAULT release end @@ -94,7 +92,7 @@ SafariZone_South_EventScript_ExitEarlyEast:: SafariZone_South_EventScript_Exit:: setvar VAR_SAFARI_ZONE_STATE, 1 special ExitSafariMode - warpdoor MAP_ROUTE121_SAFARI_ZONE_ENTRANCE, 255, 2, 5 + warpdoor MAP_ROUTE121_SAFARI_ZONE_ENTRANCE, 2, 5 waitstate end diff --git a/data/maps/SeafloorCavern_Entrance/scripts.inc b/data/maps/SeafloorCavern_Entrance/scripts.inc index a4c621e3e0e2..eec69e6f8011 100644 --- a/data/maps/SeafloorCavern_Entrance/scripts.inc +++ b/data/maps/SeafloorCavern_Entrance/scripts.inc @@ -5,14 +5,13 @@ SeafloorCavern_Entrance_MapScripts:: .byte 0 SeafloorCavern_Entrance_OnResume: - setdivewarp MAP_UNDERWATER_SEAFLOOR_CAVERN, 255, 6, 5 - setescapewarp MAP_UNDERWATER_SEAFLOOR_CAVERN, 255, 6, 5 + setdivewarp MAP_UNDERWATER_SEAFLOOR_CAVERN, 6, 5 + setescapewarp MAP_UNDERWATER_SEAFLOOR_CAVERN, 6, 5 end SeafloorCavern_Entrance_EventScript_Grunt:: lockall - compare VAR_HAS_TALKED_TO_SEAFLOOR_CAVERN_ENTRANCE_GRUNT, 1 - goto_if_eq SeafloorCavern_Entrance_EventScript_GruntSpeechShort + goto_if_eq VAR_HAS_TALKED_TO_SEAFLOOR_CAVERN_ENTRANCE_GRUNT, 1, SeafloorCavern_Entrance_EventScript_GruntSpeechShort waitse playse SE_PIN applymovement LOCALID_GRUNT, Common_Movement_ExclamationMark @@ -20,12 +19,9 @@ SeafloorCavern_Entrance_EventScript_Grunt:: applymovement LOCALID_GRUNT, Common_Movement_Delay48 waitmovement 0 delay 20 - compare VAR_FACING, DIR_WEST - call_if_eq SeafloorCavern_Entrance_EventScript_GruntFacePlayerWest - compare VAR_FACING, DIR_EAST - call_if_eq SeafloorCavern_Entrance_EventScript_GruntFacePlayerEast - compare VAR_FACING, DIR_NORTH - call_if_eq SeafloorCavern_Entrance_EventScript_GruntFacePlayerNorth + call_if_eq VAR_FACING, DIR_WEST, SeafloorCavern_Entrance_EventScript_GruntFacePlayerWest + call_if_eq VAR_FACING, DIR_EAST, SeafloorCavern_Entrance_EventScript_GruntFacePlayerEast + call_if_eq VAR_FACING, DIR_NORTH, SeafloorCavern_Entrance_EventScript_GruntFacePlayerNorth delay 30 setvar VAR_HAS_TALKED_TO_SEAFLOOR_CAVERN_ENTRANCE_GRUNT, 1 copyobjectxytoperm LOCALID_GRUNT @@ -37,12 +33,9 @@ SeafloorCavern_Entrance_EventScript_Grunt:: end SeafloorCavern_Entrance_EventScript_GruntSpeechShort:: - compare VAR_FACING, DIR_WEST - call_if_eq SeafloorCavern_Entrance_EventScript_GruntFacePlayerWest - compare VAR_FACING, DIR_EAST - call_if_eq SeafloorCavern_Entrance_EventScript_GruntFacePlayerEast - compare VAR_FACING, DIR_NORTH - call_if_eq SeafloorCavern_Entrance_EventScript_GruntFacePlayerNorth + call_if_eq VAR_FACING, DIR_WEST, SeafloorCavern_Entrance_EventScript_GruntFacePlayerWest + call_if_eq VAR_FACING, DIR_EAST, SeafloorCavern_Entrance_EventScript_GruntFacePlayerEast + call_if_eq VAR_FACING, DIR_NORTH, SeafloorCavern_Entrance_EventScript_GruntFacePlayerNorth msgbox SeafloorCavern_Entrance_Text_HearMagmaNearMossdeepShort, MSGBOX_DEFAULT closemessage applymovement LOCALID_GRUNT, Common_Movement_WalkInPlaceFasterUp diff --git a/data/maps/SeafloorCavern_Room9/scripts.inc b/data/maps/SeafloorCavern_Room9/scripts.inc index 3db2348a4a89..63e6baf3c77e 100644 --- a/data/maps/SeafloorCavern_Room9/scripts.inc +++ b/data/maps/SeafloorCavern_Room9/scripts.inc @@ -145,7 +145,7 @@ SeafloorCavern_Room9_EventScript_ArchieAwakenKyogre:: setflag FLAG_HIDE_SEAFLOOR_CAVERN_ROOM_9_KYOGRE setflag FLAG_HIDE_SEAFLOOR_CAVERN_AQUA_GRUNTS setflag FLAG_HIDE_MAP_NAME_POPUP - warp MAP_ROUTE128, 255, 38, 22 + warp MAP_ROUTE128, 38, 22 waitstate releaseall end diff --git a/data/maps/SealedChamber_InnerRoom/scripts.inc b/data/maps/SealedChamber_InnerRoom/scripts.inc index 7d240535ca24..036ab4fb8028 100644 --- a/data/maps/SealedChamber_InnerRoom/scripts.inc +++ b/data/maps/SealedChamber_InnerRoom/scripts.inc @@ -6,8 +6,7 @@ SealedChamber_InnerRoom_EventScript_BrailleBackWall:: braillemsgbox SealedChamber_InnerRoom_Braille_FirstWailordLastRelicanth goto_if_set FLAG_REGI_DOORS_OPENED, SealedChamber_InnerRoom_EventScript_NoEffect specialvar VAR_RESULT, CheckRelicanthWailord - compare VAR_RESULT, FALSE - goto_if_eq SealedChamber_InnerRoom_EventScript_NoEffect + goto_if_eq VAR_RESULT, FALSE, SealedChamber_InnerRoom_EventScript_NoEffect fadeoutbgm 0 playse SE_TRUCK_MOVE special DoSealedChamberShakingEffect_Long diff --git a/data/maps/SealedChamber_OuterRoom/scripts.inc b/data/maps/SealedChamber_OuterRoom/scripts.inc index 7d57ea544941..bf02c7fe3762 100644 --- a/data/maps/SealedChamber_OuterRoom/scripts.inc +++ b/data/maps/SealedChamber_OuterRoom/scripts.inc @@ -5,8 +5,8 @@ SealedChamber_OuterRoom_MapScripts:: .byte 0 SealedChamber_OuterRoom_OnResume: - setdivewarp MAP_UNDERWATER_SEALED_CHAMBER, 255, 12, 44 - setescapewarp MAP_UNDERWATER_SEALED_CHAMBER, 255, 12, 44 + setdivewarp MAP_UNDERWATER_SEALED_CHAMBER, 12, 44 + setescapewarp MAP_UNDERWATER_SEALED_CHAMBER, 12, 44 end SealedChamber_OuterRoom_OnTransition: @@ -18,12 +18,12 @@ SealedChamber_OuterRoom_OnLoad: end SealedChamber_OuterRoom_EventScript_CloseInnerRoomEntrance:: - setmetatile 9, 1, METATILE_Cave_EntranceCover, 1 - setmetatile 10, 1, METATILE_Cave_EntranceCover, 1 - setmetatile 11, 1, METATILE_Cave_EntranceCover, 1 - setmetatile 9, 2, METATILE_Cave_SealedChamberBraille_Mid, 1 - setmetatile 10, 2, METATILE_Cave_SealedChamberBraille_Mid, 1 - setmetatile 11, 2, METATILE_Cave_SealedChamberBraille_Mid, 1 + setmetatile 9, 1, METATILE_Cave_EntranceCover, TRUE + setmetatile 10, 1, METATILE_Cave_EntranceCover, TRUE + setmetatile 11, 1, METATILE_Cave_EntranceCover, TRUE + setmetatile 9, 2, METATILE_Cave_SealedChamberBraille_Mid, TRUE + setmetatile 10, 2, METATILE_Cave_SealedChamberBraille_Mid, TRUE + setmetatile 11, 2, METATILE_Cave_SealedChamberBraille_Mid, TRUE return SealedChamber_OuterRoom_EventScript_BrailleABC:: diff --git a/data/maps/ShoalCave_LowTideEntranceRoom/scripts.inc b/data/maps/ShoalCave_LowTideEntranceRoom/scripts.inc index a1206dfb47c2..905a9a77a797 100644 --- a/data/maps/ShoalCave_LowTideEntranceRoom/scripts.inc +++ b/data/maps/ShoalCave_LowTideEntranceRoom/scripts.inc @@ -21,25 +21,19 @@ ShoalCave_LowTideEntranceRoom_EventScript_ShellBellExpert:: dotimebasedevents call_if_set FLAG_SYS_SHOAL_ITEM, ShoalCave_LowTideEntranceRoom_EventScript_ResetShoalItems checkitem ITEM_SHOAL_SALT, 4 - compare VAR_RESULT, FALSE - goto_if_eq ShoalCave_LowTideEntranceRoom_EventScript_NotEnoughShoalSaltOrShells + goto_if_eq VAR_RESULT, FALSE, ShoalCave_LowTideEntranceRoom_EventScript_NotEnoughShoalSaltOrShells checkitem ITEM_SHOAL_SHELL, 4 - compare VAR_RESULT, FALSE - goto_if_eq ShoalCave_LowTideEntranceRoom_EventScript_NotEnoughShoalSaltOrShells + goto_if_eq VAR_RESULT, FALSE, ShoalCave_LowTideEntranceRoom_EventScript_NotEnoughShoalSaltOrShells msgbox ShoalCave_LowTideEntranceRoom_Text_WouldYouLikeShellBell, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq ShoalCave_LowTideEntranceRoom_EventScript_DeclineShellBell - checkitemspace ITEM_SHELL_BELL, 1 - compare VAR_RESULT, FALSE - call_if_eq ShoalCave_LowTideEntranceRoom_EventScript_CheckSpaceWillBeFreed - compare VAR_RESULT, 2 - goto_if_eq ShoalCave_LowTideEntranceRoom_EventScript_NoRoomForShellBell + goto_if_eq VAR_RESULT, NO, ShoalCave_LowTideEntranceRoom_EventScript_DeclineShellBell + checkitemspace ITEM_SHELL_BELL + call_if_eq VAR_RESULT, FALSE, ShoalCave_LowTideEntranceRoom_EventScript_CheckSpaceWillBeFreed + goto_if_eq VAR_RESULT, 2, ShoalCave_LowTideEntranceRoom_EventScript_NoRoomForShellBell msgbox ShoalCave_LowTideEntranceRoom_Text_MakeShellBellRightAway, MSGBOX_DEFAULT removeitem ITEM_SHOAL_SALT, 4 removeitem ITEM_SHOAL_SHELL, 4 giveitem ITEM_SHELL_BELL - compare VAR_RESULT, FALSE - goto_if_eq Common_EventScript_ShowBagIsFull + goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull msgbox ShoalCave_LowTideEntranceRoom_Text_ExplainShellBell, MSGBOX_DEFAULT setflag FLAG_TEMP_2 release @@ -48,14 +42,12 @@ ShoalCave_LowTideEntranceRoom_EventScript_ShellBellExpert:: @ If the bag is full, check if a slot will be freed when 4 Shoal Salt or Shells are given ShoalCave_LowTideEntranceRoom_EventScript_CheckSpaceWillBeFreed:: checkitem ITEM_SHOAL_SALT, 5 - compare VAR_RESULT, TRUE - goto_if_eq ShoalCave_LowTideEntranceRoom_EventScript_CheckSpaceWillBeFreedShells + goto_if_eq VAR_RESULT, TRUE, ShoalCave_LowTideEntranceRoom_EventScript_CheckSpaceWillBeFreedShells return ShoalCave_LowTideEntranceRoom_EventScript_CheckSpaceWillBeFreedShells:: checkitem ITEM_SHOAL_SHELL, 5 - compare VAR_RESULT, TRUE - goto_if_eq ShoalCave_LowTideEntranceRoom_EventScript_NoSpaceWillBeFreed + goto_if_eq VAR_RESULT, TRUE, ShoalCave_LowTideEntranceRoom_EventScript_NoSpaceWillBeFreed return ShoalCave_LowTideEntranceRoom_EventScript_NoSpaceWillBeFreed:: @@ -68,12 +60,10 @@ ShoalCave_LowTideEntranceRoom_EventScript_NoRoomForShellBell:: end ShoalCave_LowTideEntranceRoom_EventScript_NotEnoughShoalSaltOrShells:: - checkitem ITEM_SHOAL_SALT, 1 - compare VAR_RESULT, TRUE - goto_if_eq ShoalCave_LowTideEntranceRoom_EventScript_HasSomeShoalSaltOrShell - checkitem ITEM_SHOAL_SHELL, 1 - compare VAR_RESULT, TRUE - goto_if_eq ShoalCave_LowTideEntranceRoom_EventScript_HasSomeShoalSaltOrShell + checkitem ITEM_SHOAL_SALT + goto_if_eq VAR_RESULT, TRUE, ShoalCave_LowTideEntranceRoom_EventScript_HasSomeShoalSaltOrShell + checkitem ITEM_SHOAL_SHELL + goto_if_eq VAR_RESULT, TRUE, ShoalCave_LowTideEntranceRoom_EventScript_HasSomeShoalSaltOrShell msgbox ShoalCave_LowTideEntranceRoom_Text_AreYouPlanningOnGoingInThere, MSGBOX_DEFAULT release end diff --git a/data/maps/ShoalCave_LowTideInnerRoom/scripts.inc b/data/maps/ShoalCave_LowTideInnerRoom/scripts.inc index 9692d2f6944f..17f6a7ca6ba6 100644 --- a/data/maps/ShoalCave_LowTideInnerRoom/scripts.inc +++ b/data/maps/ShoalCave_LowTideInnerRoom/scripts.inc @@ -22,38 +22,38 @@ ShoalCave_LowTideInnerRoom_OnLoad: ShoalCave_LowTideInnerRoom_EventScript_SetShoalItemMetatiles:: goto_if_set FLAG_RECEIVED_SHOAL_SALT_1, ShoalCave_LowTideInnerRoom_EventScript_SetShoalItemMetatiles2 goto_if_set FLAG_SYS_SHOAL_TIDE, ShoalCave_LowTideInnerRoom_EventScript_SetShoalItemMetatiles2 - setmetatile 31, 8, METATILE_Cave_ShoalCave_DirtPile_Large, 1 + setmetatile 31, 8, METATILE_Cave_ShoalCave_DirtPile_Large, TRUE goto ShoalCave_LowTideInnerRoom_EventScript_SetShoalItemMetatiles2 end ShoalCave_LowTideInnerRoom_EventScript_SetShoalItemMetatiles2:: goto_if_set FLAG_RECEIVED_SHOAL_SALT_2, ShoalCave_LowTideInnerRoom_EventScript_SetShoalItemMetatiles3 goto_if_set FLAG_SYS_SHOAL_TIDE, ShoalCave_LowTideInnerRoom_EventScript_SetShoalItemMetatiles3 - setmetatile 14, 26, METATILE_Cave_ShoalCave_DirtPile_Large, 1 + setmetatile 14, 26, METATILE_Cave_ShoalCave_DirtPile_Large, TRUE goto ShoalCave_LowTideInnerRoom_EventScript_SetShoalItemMetatiles3 end ShoalCave_LowTideInnerRoom_EventScript_SetShoalItemMetatiles3:: goto_if_set FLAG_RECEIVED_SHOAL_SHELL_1, ShoalCave_LowTideInnerRoom_EventScript_SetShoalItemMetatiles4 - setmetatile 41, 20, METATILE_Cave_ShoalCave_BlueStone_Large, 1 + setmetatile 41, 20, METATILE_Cave_ShoalCave_BlueStone_Large, TRUE goto ShoalCave_LowTideInnerRoom_EventScript_SetShoalItemMetatiles4 end ShoalCave_LowTideInnerRoom_EventScript_SetShoalItemMetatiles4:: goto_if_set FLAG_RECEIVED_SHOAL_SHELL_2, ShoalCave_LowTideInnerRoom_EventScript_SetShoalItemMetatiles5 - setmetatile 41, 10, METATILE_Cave_ShoalCave_BlueStone_Large, 1 + setmetatile 41, 10, METATILE_Cave_ShoalCave_BlueStone_Large, TRUE goto ShoalCave_LowTideInnerRoom_EventScript_SetShoalItemMetatiles5 end ShoalCave_LowTideInnerRoom_EventScript_SetShoalItemMetatiles5:: goto_if_set FLAG_RECEIVED_SHOAL_SHELL_3, ShoalCave_LowTideInnerRoom_EventScript_SetShoalItemMetatiles6 - setmetatile 6, 9, METATILE_Cave_ShoalCave_BlueStone_Large, 1 + setmetatile 6, 9, METATILE_Cave_ShoalCave_BlueStone_Large, TRUE goto ShoalCave_LowTideInnerRoom_EventScript_SetShoalItemMetatiles6 end ShoalCave_LowTideInnerRoom_EventScript_SetShoalItemMetatiles6:: goto_if_set FLAG_RECEIVED_SHOAL_SHELL_4, ShoalCave_LowTideInnerRoom_EventScript_SetShoalItemMetatilesEnd - setmetatile 16, 13, METATILE_Cave_ShoalCave_BlueStone_Large, 1 + setmetatile 16, 13, METATILE_Cave_ShoalCave_BlueStone_Large, TRUE return ShoalCave_LowTideInnerRoom_EventScript_SetShoalItemMetatilesEnd:: @@ -63,9 +63,8 @@ ShoalCave_LowTideInnerRoom_EventScript_ShoalShell1:: lockall goto_if_set FLAG_RECEIVED_SHOAL_SHELL_1, ShoalCave_LowTideInnerRoom_EventScript_ReceivedShoalShell giveitem ITEM_SHOAL_SHELL - compare VAR_RESULT, FALSE - goto_if_eq Common_EventScript_ShowBagIsFull - setmetatile 41, 20, METATILE_Cave_ShoalCave_BlueStone_Small, 0 + goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull + setmetatile 41, 20, METATILE_Cave_ShoalCave_BlueStone_Small, FALSE special DrawWholeMapView setflag FLAG_RECEIVED_SHOAL_SHELL_1 releaseall @@ -80,9 +79,8 @@ ShoalCave_LowTideInnerRoom_EventScript_ShoalShell2:: lockall goto_if_set FLAG_RECEIVED_SHOAL_SHELL_2, ShoalCave_LowTideInnerRoom_EventScript_ReceivedShoalShell giveitem ITEM_SHOAL_SHELL - compare VAR_RESULT, FALSE - goto_if_eq Common_EventScript_ShowBagIsFull - setmetatile 41, 10, METATILE_Cave_ShoalCave_BlueStone_Small, 0 + goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull + setmetatile 41, 10, METATILE_Cave_ShoalCave_BlueStone_Small, FALSE special DrawWholeMapView setflag FLAG_RECEIVED_SHOAL_SHELL_2 releaseall @@ -92,9 +90,8 @@ ShoalCave_LowTideInnerRoom_EventScript_ShoalShell3:: lockall goto_if_set FLAG_RECEIVED_SHOAL_SHELL_3, ShoalCave_LowTideInnerRoom_EventScript_ReceivedShoalShell giveitem ITEM_SHOAL_SHELL - compare VAR_RESULT, FALSE - goto_if_eq Common_EventScript_ShowBagIsFull - setmetatile 6, 9, METATILE_Cave_ShoalCave_BlueStone_Small, 0 + goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull + setmetatile 6, 9, METATILE_Cave_ShoalCave_BlueStone_Small, FALSE special DrawWholeMapView setflag FLAG_RECEIVED_SHOAL_SHELL_3 releaseall @@ -104,9 +101,8 @@ ShoalCave_LowTideInnerRoom_EventScript_ShoalShell4:: lockall goto_if_set FLAG_RECEIVED_SHOAL_SHELL_4, ShoalCave_LowTideInnerRoom_EventScript_ReceivedShoalShell giveitem ITEM_SHOAL_SHELL - compare VAR_RESULT, FALSE - goto_if_eq Common_EventScript_ShowBagIsFull - setmetatile 16, 13, METATILE_Cave_ShoalCave_BlueStone_Small, 0 + goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull + setmetatile 16, 13, METATILE_Cave_ShoalCave_BlueStone_Small, FALSE special DrawWholeMapView setflag FLAG_RECEIVED_SHOAL_SHELL_4 releaseall @@ -116,9 +112,8 @@ ShoalCave_LowTideInnerRoom_EventScript_ShoalSalt1:: lockall goto_if_set FLAG_RECEIVED_SHOAL_SALT_1, ShoalCave_LowTideInnerRoom_EventScript_ReceivedShoalSalt giveitem ITEM_SHOAL_SALT - compare VAR_RESULT, FALSE - goto_if_eq Common_EventScript_ShowBagIsFull - setmetatile 31, 8, METATILE_Cave_ShoalCave_DirtPile_Small, 0 + goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull + setmetatile 31, 8, METATILE_Cave_ShoalCave_DirtPile_Small, FALSE special DrawWholeMapView setflag FLAG_RECEIVED_SHOAL_SALT_1 releaseall @@ -133,9 +128,8 @@ ShoalCave_LowTideInnerRoom_EventScript_ShoalSalt2:: lockall goto_if_set FLAG_RECEIVED_SHOAL_SALT_2, ShoalCave_LowTideInnerRoom_EventScript_ReceivedShoalSalt giveitem ITEM_SHOAL_SALT - compare VAR_RESULT, FALSE - goto_if_eq Common_EventScript_ShowBagIsFull - setmetatile 14, 26, METATILE_Cave_ShoalCave_DirtPile_Small, 0 + goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull + setmetatile 14, 26, METATILE_Cave_ShoalCave_DirtPile_Small, FALSE special DrawWholeMapView setflag FLAG_RECEIVED_SHOAL_SALT_2 releaseall diff --git a/data/maps/ShoalCave_LowTideLowerRoom/scripts.inc b/data/maps/ShoalCave_LowTideLowerRoom/scripts.inc index d7937998ee74..a06d46cc2aa2 100644 --- a/data/maps/ShoalCave_LowTideLowerRoom/scripts.inc +++ b/data/maps/ShoalCave_LowTideLowerRoom/scripts.inc @@ -8,7 +8,7 @@ ShoalCave_LowTideLowerRoom_OnLoad: ShoalCave_LowTideLowerRoom_EventScript_SetShoalItemMetatiles:: goto_if_set FLAG_RECEIVED_SHOAL_SALT_4, ShoalCave_LowTideLowerRoom_EventScript_SetShoalItemMetatilesEnd - setmetatile 18, 2, METATILE_Cave_ShoalCave_DirtPile_Large, 1 + setmetatile 18, 2, METATILE_Cave_ShoalCave_DirtPile_Large, TRUE return ShoalCave_LowTideLowerRoom_EventScript_SetShoalItemMetatilesEnd:: @@ -18,9 +18,8 @@ ShoalCave_LowTideLowerRoom_EventScript_ShoalSalt4:: lockall goto_if_set FLAG_RECEIVED_SHOAL_SALT_4, ShoalCave_LowTideLowerRoom_EventScript_ReceivedShoalSalt giveitem ITEM_SHOAL_SALT - compare VAR_RESULT, FALSE - goto_if_eq Common_EventScript_ShowBagIsFull - setmetatile 18, 2, METATILE_Cave_ShoalCave_DirtPile_Small, 0 + goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull + setmetatile 18, 2, METATILE_Cave_ShoalCave_DirtPile_Small, FALSE special DrawWholeMapView setflag FLAG_RECEIVED_SHOAL_SALT_4 releaseall @@ -37,8 +36,7 @@ ShoalCave_LowTideLowerRoom_EventScript_BlackBelt:: goto_if_set FLAG_RECEIVED_FOCUS_BAND, ShoalCave_LowTideLowerRoom_EventScript_ReceivedFocusBand msgbox ShoalCave_LowTideLowerRoom_Text_CanOvercomeColdWithFocus, MSGBOX_DEFAULT giveitem ITEM_FOCUS_BAND - compare VAR_RESULT, FALSE - goto_if_eq Common_EventScript_ShowBagIsFull + goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull setflag FLAG_RECEIVED_FOCUS_BAND release end diff --git a/data/maps/ShoalCave_LowTideStairsRoom/scripts.inc b/data/maps/ShoalCave_LowTideStairsRoom/scripts.inc index a778a18e11b6..655711e9c67f 100644 --- a/data/maps/ShoalCave_LowTideStairsRoom/scripts.inc +++ b/data/maps/ShoalCave_LowTideStairsRoom/scripts.inc @@ -8,7 +8,7 @@ ShoalCave_LowTideStairsRoom_OnLoad: ShoalCave_LowTideStairsRoom_EventScript_SetShoalItemMetatiles:: goto_if_set FLAG_RECEIVED_SHOAL_SALT_3, ShoalCave_LowTideStairsRoom_EventScript_SetShoalItemMetatilesEnd - setmetatile 11, 11, METATILE_Cave_ShoalCave_DirtPile_Large, 1 + setmetatile 11, 11, METATILE_Cave_ShoalCave_DirtPile_Large, TRUE return ShoalCave_LowTideStairsRoom_EventScript_SetShoalItemMetatilesEnd:: @@ -18,9 +18,8 @@ ShoalCave_LowTideStairsRoom_EventScript_ShoalSalt3:: lockall goto_if_set FLAG_RECEIVED_SHOAL_SALT_3, ShoalCave_LowTideStairsRoom_EventScript_ReceivedShoalSalt giveitem ITEM_SHOAL_SALT - compare VAR_RESULT, FALSE - goto_if_eq Common_EventScript_ShowBagIsFull - setmetatile 11, 11, METATILE_Cave_ShoalCave_DirtPile_Small, 0 + goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull + setmetatile 11, 11, METATILE_Cave_ShoalCave_DirtPile_Small, FALSE special DrawWholeMapView setflag FLAG_RECEIVED_SHOAL_SALT_3 releaseall diff --git a/data/maps/SkyPillar_1F/scripts.inc b/data/maps/SkyPillar_1F/scripts.inc index 3ef94b261c2b..b521b541c19f 100644 --- a/data/maps/SkyPillar_1F/scripts.inc +++ b/data/maps/SkyPillar_1F/scripts.inc @@ -3,8 +3,7 @@ SkyPillar_1F_MapScripts:: .byte 0 SkyPillar_1F_OnTransition: - compare VAR_SKY_PILLAR_STATE, 2 - call_if_lt SkyPillar_1F_EventScript_CleanFloor + call_if_lt VAR_SKY_PILLAR_STATE, 2, SkyPillar_1F_EventScript_CleanFloor end SkyPillar_1F_EventScript_CleanFloor:: diff --git a/data/maps/SkyPillar_2F/scripts.inc b/data/maps/SkyPillar_2F/scripts.inc index 9990ebba9668..bad2488f0b49 100644 --- a/data/maps/SkyPillar_2F/scripts.inc +++ b/data/maps/SkyPillar_2F/scripts.inc @@ -5,8 +5,7 @@ SkyPillar_2F_MapScripts:: .byte 0 SkyPillar_2F_OnTransition: - compare VAR_SKY_PILLAR_STATE, 2 - call_if_lt SkyPillar_2F_EventScript_CleanFloor + call_if_lt VAR_SKY_PILLAR_STATE, 2, SkyPillar_2F_EventScript_CleanFloor copyvar VAR_ICE_STEP_COUNT, 1 end @@ -16,6 +15,6 @@ SkyPillar_2F_EventScript_CleanFloor:: SkyPillar_2F_SetHoleWarp: setstepcallback STEP_CB_CRACKED_FLOOR - setholewarp MAP_SKY_PILLAR_1F, 255, 0, 0 + setholewarp MAP_SKY_PILLAR_1F end diff --git a/data/maps/SkyPillar_3F/scripts.inc b/data/maps/SkyPillar_3F/scripts.inc index 681137df0823..07ef3bb44900 100644 --- a/data/maps/SkyPillar_3F/scripts.inc +++ b/data/maps/SkyPillar_3F/scripts.inc @@ -3,8 +3,7 @@ SkyPillar_3F_MapScripts:: .byte 0 SkyPillar_3F_OnTransition: - compare VAR_SKY_PILLAR_STATE, 2 - call_if_lt SkyPillar_3F_EventScript_CleanFloor + call_if_lt VAR_SKY_PILLAR_STATE, 2, SkyPillar_3F_EventScript_CleanFloor end SkyPillar_3F_EventScript_CleanFloor:: diff --git a/data/maps/SkyPillar_4F/scripts.inc b/data/maps/SkyPillar_4F/scripts.inc index bed91a1751f8..9e8f1e80ea49 100644 --- a/data/maps/SkyPillar_4F/scripts.inc +++ b/data/maps/SkyPillar_4F/scripts.inc @@ -5,8 +5,7 @@ SkyPillar_4F_MapScripts:: .byte 0 SkyPillar_4F_OnTransition: - compare VAR_SKY_PILLAR_STATE, 2 - call_if_lt SkyPillar_4F_EventScript_CleanFloor + call_if_lt VAR_SKY_PILLAR_STATE, 2, SkyPillar_4F_EventScript_CleanFloor copyvar VAR_ICE_STEP_COUNT, 1 end @@ -16,6 +15,6 @@ SkyPillar_4F_EventScript_CleanFloor:: SkyPillar_4F_SetHoleWarp: setstepcallback STEP_CB_CRACKED_FLOOR - setholewarp MAP_SKY_PILLAR_3F, 255, 0, 0 + setholewarp MAP_SKY_PILLAR_3F end diff --git a/data/maps/SkyPillar_5F/scripts.inc b/data/maps/SkyPillar_5F/scripts.inc index 12fc72f4936a..47d02fb61b08 100644 --- a/data/maps/SkyPillar_5F/scripts.inc +++ b/data/maps/SkyPillar_5F/scripts.inc @@ -3,8 +3,7 @@ SkyPillar_5F_MapScripts:: .byte 0 SkyPillar_5F_OnTransition: - compare VAR_SKY_PILLAR_STATE, 2 - call_if_lt SkyPillar_5F_EventScript_CleanFloor + call_if_lt VAR_SKY_PILLAR_STATE, 2, SkyPillar_5F_EventScript_CleanFloor return SkyPillar_5F_EventScript_CleanFloor:: diff --git a/data/maps/SkyPillar_Outside/scripts.inc b/data/maps/SkyPillar_Outside/scripts.inc index 9ffcd2de73b7..f25c82df65fc 100644 --- a/data/maps/SkyPillar_Outside/scripts.inc +++ b/data/maps/SkyPillar_Outside/scripts.inc @@ -7,10 +7,8 @@ SkyPillar_Outside_MapScripts:: .byte 0 SkyPillar_Outside_OnTransition: - compare VAR_SOOTOPOLIS_CITY_STATE, 3 - call_if_eq SkyPillar_Outside_EventScript_HideMapNamePopup - compare VAR_SOOTOPOLIS_CITY_STATE, 4 - call_if_ge SkyPillar_Outside_EventScript_CheckSetAbnormalWeather + call_if_eq VAR_SOOTOPOLIS_CITY_STATE, 3, SkyPillar_Outside_EventScript_HideMapNamePopup + call_if_ge VAR_SOOTOPOLIS_CITY_STATE, 4, SkyPillar_Outside_EventScript_CheckSetAbnormalWeather end SkyPillar_Outside_EventScript_HideMapNamePopup:: @@ -26,8 +24,8 @@ SkyPillar_Outside_OnLoad: end SkyPillar_Outside_EventScript_OpenDoor:: - setmetatile 14, 4, METATILE_Pacifidlog_SkyPillar_DoorOpen_Top, 0 - setmetatile 14, 5, METATILE_Pacifidlog_SkyPillar_DoorOpen_Bottom, 0 + setmetatile 14, 4, METATILE_Pacifidlog_SkyPillar_DoorOpen_Top, FALSE + setmetatile 14, 5, METATILE_Pacifidlog_SkyPillar_DoorOpen_Bottom, FALSE return SkyPillar_Outside_OnFrame: diff --git a/data/maps/SkyPillar_Top/scripts.inc b/data/maps/SkyPillar_Top/scripts.inc index 2b3c0212002b..5c71bbe4bfe0 100644 --- a/data/maps/SkyPillar_Top/scripts.inc +++ b/data/maps/SkyPillar_Top/scripts.inc @@ -12,16 +12,13 @@ SkyPillar_Top_OnResume: SkyPillar_Top_EventScript_TryRemoveRayquaza:: specialvar VAR_RESULT, GetBattleOutcome - compare VAR_RESULT, B_OUTCOME_CAUGHT - goto_if_ne Common_EventScript_NopReturn + goto_if_ne VAR_RESULT, B_OUTCOME_CAUGHT, Common_EventScript_NopReturn removeobject VAR_LAST_TALKED return SkyPillar_Top_OnTransition: - compare VAR_SKY_PILLAR_STATE, 2 - call_if_lt SkyPillar_Top_EventScript_SetCleanLayout - compare VAR_SKY_PILLAR_STATE, 2 - call_if_ge SkyPillar_Top_EventScript_TryShowRayquaza + call_if_lt VAR_SKY_PILLAR_STATE, 2, SkyPillar_Top_EventScript_SetCleanLayout + call_if_ge VAR_SKY_PILLAR_STATE, 2, SkyPillar_Top_EventScript_TryShowRayquaza end SkyPillar_Top_EventScript_SetCleanLayout:: @@ -57,12 +54,9 @@ SkyPillar_Top_EventScript_Rayquaza:: waitstate clearflag FLAG_SYS_CTRL_OBJ_DELETE specialvar VAR_RESULT, GetBattleOutcome - compare VAR_RESULT, B_OUTCOME_WON - goto_if_eq SkyPillar_Top_EventScript_DefeatedRayquaza - compare VAR_RESULT, B_OUTCOME_RAN - goto_if_eq SkyPillar_Top_EventScript_RanFromRayquaza - compare VAR_RESULT, B_OUTCOME_PLAYER_TELEPORTED - goto_if_eq SkyPillar_Top_EventScript_RanFromRayquaza + goto_if_eq VAR_RESULT, B_OUTCOME_WON, SkyPillar_Top_EventScript_DefeatedRayquaza + goto_if_eq VAR_RESULT, B_OUTCOME_RAN, SkyPillar_Top_EventScript_RanFromRayquaza + goto_if_eq VAR_RESULT, B_OUTCOME_PLAYER_TELEPORTED, SkyPillar_Top_EventScript_RanFromRayquaza setflag FLAG_DEFEATED_RAYQUAZA releaseall end @@ -88,7 +82,7 @@ SkyPillar_Top_EventScript_RanFromRayquaza2:: fadescreenswapbuffers FADE_TO_BLACK removeobject VAR_LAST_TALKED fadescreenswapbuffers FADE_FROM_BLACK - bufferspeciesname 0, VAR_0x8004 + bufferspeciesname STR_VAR_1, VAR_0x8004 msgbox gText_LegendaryFlewAway, MSGBOX_DEFAULT releaseall end diff --git a/data/maps/SlateportCity/scripts.inc b/data/maps/SlateportCity/scripts.inc index 3e8648531f7b..653f405c4512 100644 --- a/data/maps/SlateportCity/scripts.inc +++ b/data/maps/SlateportCity/scripts.inc @@ -19,6 +19,8 @@ .set LOCALID_GRUNT_11, 33 .set LOCALID_SCOTT, 35 +@ Note: LOCALID_SLATEPORT_ENERGY_GURU is a local id for this map used elsewhere. It's defined in event_objects.h + SlateportCity_MapScripts:: map_script MAP_SCRIPT_ON_TRANSITION, SlateportCity_OnTransition map_script MAP_SCRIPT_ON_FRAME_TABLE, SlateportCity_OnFrame @@ -27,10 +29,8 @@ SlateportCity_MapScripts:: SlateportCity_OnTransition: setvar VAR_SLATEPORT_MUSEUM_1F_STATE, 0 call SlateportCity_EventScript_EnterSlateport - compare VAR_SLATEPORT_CITY_STATE, 1 - call_if_eq SlateportCity_EventScript_MovePeopleForSternInterview - compare VAR_SLATEPORT_OUTSIDE_MUSEUM_STATE, 1 - call_if_eq SlateportCity_EventScript_SetReadyForScottScene + call_if_eq VAR_SLATEPORT_CITY_STATE, 1, SlateportCity_EventScript_MovePeopleForSternInterview + call_if_eq VAR_SLATEPORT_OUTSIDE_MUSEUM_STATE, 1, SlateportCity_EventScript_SetReadyForScottScene end SlateportCity_EventScript_EnterSlateport:: @@ -59,8 +59,7 @@ SlateportCity_EventScript_MovePeopleForSternInterview:: SlateportCity_EventScript_SetReadyForScottScene:: setflag FLAG_HIDE_MAP_NAME_POPUP getplayerxy VAR_0x8004, VAR_0x8005 - compare VAR_0x8004, 30 - goto_if_eq SlateportCity_EventScript_MoveScottLeft + goto_if_eq VAR_0x8004, 30, SlateportCity_EventScript_MoveScottLeft setobjectxyperm LOCALID_SCOTT, 23, 27 setobjectmovementtype LOCALID_SCOTT, MOVEMENT_TYPE_FACE_RIGHT return @@ -162,14 +161,12 @@ SlateportCity_Pokemart_EnergyGuru: SlateportCity_EventScript_EffortRibbonWoman:: lock faceplayer - bufferleadmonspeciesname 0 + bufferleadmonspeciesname STR_VAR_1 msgbox SlateportCity_Text_OhYourPokemon, MSGBOX_DEFAULT specialvar VAR_RESULT, LeadMonHasEffortRibbon - compare VAR_RESULT, TRUE - call_if_eq SlateportCity_EventScript_MonHasEffortRibbon + call_if_eq VAR_RESULT, TRUE, SlateportCity_EventScript_MonHasEffortRibbon specialvar VAR_RESULT, Special_AreLeadMonEVsMaxedOut - compare VAR_RESULT, FALSE - call_if_eq SlateportCity_EventScript_MonEVsNotMaxed + call_if_eq VAR_RESULT, FALSE, SlateportCity_EventScript_MonEVsNotMaxed msgbox SlateportCity_Text_PleaseGiveItThisEffortRibbon, MSGBOX_DEFAULT playfanfare MUS_OBTAIN_ITEM message SlateportCity_Text_ReceivedEffortRibbon @@ -192,8 +189,7 @@ SlateportCity_EventScript_MonHasEffortRibbon:: SlateportCity_EventScript_Cook:: lock faceplayer - compare VAR_SLATEPORT_CITY_STATE, 1 - call_if_eq SlateportCity_EventScript_CookSternInterview + call_if_eq VAR_SLATEPORT_CITY_STATE, 1, SlateportCity_EventScript_CookSternInterview msgbox SlateportCity_Text_SeaweedFullOfLife, MSGBOX_DEFAULT release end @@ -206,8 +202,7 @@ SlateportCity_EventScript_CookSternInterview:: SlateportCity_EventScript_OldWoman:: lock faceplayer - compare VAR_SLATEPORT_CITY_STATE, 1 - call_if_eq SlateportCity_EventScript_OldWomanSternInterview + call_if_eq VAR_SLATEPORT_CITY_STATE, 1, SlateportCity_EventScript_OldWomanSternInterview msgbox SlateportCity_Text_HowTownIsBornAndGrows, MSGBOX_DEFAULT release end @@ -220,8 +215,7 @@ SlateportCity_EventScript_OldWomanSternInterview:: SlateportCity_EventScript_Girl:: lock faceplayer - compare VAR_SLATEPORT_CITY_STATE, 1 - call_if_eq SlateportCity_EventScript_GirlSternInterview + call_if_eq VAR_SLATEPORT_CITY_STATE, 1, SlateportCity_EventScript_GirlSternInterview goto_if_set FLAG_RECEIVED_SECRET_POWER, SlateportCity_EventScript_GirlSecretBase msgbox SlateportCity_Text_SlateportWonderfulPlace, MSGBOX_DEFAULT release @@ -240,8 +234,7 @@ SlateportCity_EventScript_GirlSecretBase:: SlateportCity_EventScript_RichBoy:: lock faceplayer - compare VAR_SLATEPORT_CITY_STATE, 1 - call_if_eq SlateportCity_EventScript_RichBoySternInterview + call_if_eq VAR_SLATEPORT_CITY_STATE, 1, SlateportCity_EventScript_RichBoySternInterview msgbox SlateportCity_Text_GoingToCompeteInBattleTent, MSGBOX_DEFAULT release end @@ -252,8 +245,7 @@ SlateportCity_EventScript_RichBoySternInterview:: end SlateportCity_EventScript_FatMan:: - compare VAR_SLATEPORT_CITY_STATE, 1 - goto_if_eq SlateportCity_EventScript_FatManSternInterview + goto_if_eq VAR_SLATEPORT_CITY_STATE, 1, SlateportCity_EventScript_FatManSternInterview msgbox SlateportCity_Text_BushedHikingFromMauville, MSGBOX_NPC end @@ -264,8 +256,7 @@ SlateportCity_EventScript_FatManSternInterview:: SlateportCity_EventScript_Man1:: lock faceplayer - compare VAR_SLATEPORT_CITY_STATE, 1 - call_if_eq SlateportCity_EventScript_Man1SternInterview + call_if_eq VAR_SLATEPORT_CITY_STATE, 1, SlateportCity_EventScript_Man1SternInterview msgbox SlateportCity_Text_EveryoneCallsHimCaptStern, MSGBOX_DEFAULT release end @@ -345,8 +336,7 @@ SlateportCity_EventScript_NameRatersHouseSign:: SlateportCity_EventScript_Maniac:: lock faceplayer - compare VAR_SLATEPORT_CITY_STATE, 1 - call_if_eq SlateportCity_EventScript_ManiacSternInterview + call_if_eq VAR_SLATEPORT_CITY_STATE, 1, SlateportCity_EventScript_ManiacSternInterview msgbox SlateportCity_Text_GetNameRaterToHelpYou, MSGBOX_DEFAULT release end @@ -635,7 +625,7 @@ SlateportCity_EventScript_CaptStern:: clearflag FLAG_HIDE_SLATEPORT_CITY_HARBOR_AQUA_GRUNT clearflag FLAG_HIDE_SLATEPORT_CITY_HARBOR_ARCHIE setvar VAR_SLATEPORT_CITY_STATE, 2 - warp MAP_SLATEPORT_CITY_HARBOR, 255, 11, 14 + warp MAP_SLATEPORT_CITY_HARBOR, 11, 14 waitstate releaseall end @@ -758,8 +748,7 @@ SlateportCity_EventScript_BerryPowderClerk:: SlateportCity_EventScript_ReceivedPowderJar:: setvar VAR_0x8004, 1 specialvar VAR_RESULT, HasEnoughBerryPowder - compare VAR_RESULT, FALSE - goto_if_eq SlateportCity_EventScript_ExplainBerryPowder + goto_if_eq VAR_RESULT, FALSE, SlateportCity_EventScript_ExplainBerryPowder msgbox SlateportCity_Text_BroughtMeSomeBerryPowder, MSGBOX_DEFAULT special DisplayBerryPowderVendorMenu goto SlateportCity_EventScript_ChooseBerryPowderItem @@ -793,77 +782,77 @@ SlateportCity_EventScript_ChooseBerryPowderItem:: end SlateportCity_EventScript_EnergyPowder:: - bufferitemname 0, ITEM_ENERGY_POWDER + bufferitemname STR_VAR_1, ITEM_ENERGY_POWDER setvar VAR_0x8008, ITEM_ENERGY_POWDER setvar VAR_0x8009, 50 goto SlateportCity_EventScript_TryBuyBerryPowderItem end SlateportCity_EventScript_EnergyRoot:: - bufferitemname 0, ITEM_ENERGY_ROOT + bufferitemname STR_VAR_1, ITEM_ENERGY_ROOT setvar VAR_0x8008, ITEM_ENERGY_ROOT setvar VAR_0x8009, 80 goto SlateportCity_EventScript_TryBuyBerryPowderItem end SlateportCity_EventScript_HealPowder:: - bufferitemname 0, ITEM_HEAL_POWDER + bufferitemname STR_VAR_1, ITEM_HEAL_POWDER setvar VAR_0x8008, ITEM_HEAL_POWDER setvar VAR_0x8009, 50 goto SlateportCity_EventScript_TryBuyBerryPowderItem end SlateportCity_EventScript_RevivalHerb:: - bufferitemname 0, ITEM_REVIVAL_HERB + bufferitemname STR_VAR_1, ITEM_REVIVAL_HERB setvar VAR_0x8008, ITEM_REVIVAL_HERB setvar VAR_0x8009, 300 goto SlateportCity_EventScript_TryBuyBerryPowderItem end SlateportCity_EventScript_Protein:: - bufferitemname 0, ITEM_PROTEIN + bufferitemname STR_VAR_1, ITEM_PROTEIN setvar VAR_0x8008, ITEM_PROTEIN setvar VAR_0x8009, 1000 goto SlateportCity_EventScript_TryBuyBerryPowderItem end SlateportCity_EventScript_Iron:: - bufferitemname 0, ITEM_IRON + bufferitemname STR_VAR_1, ITEM_IRON setvar VAR_0x8008, ITEM_IRON setvar VAR_0x8009, 1000 goto SlateportCity_EventScript_TryBuyBerryPowderItem end SlateportCity_EventScript_Carbos:: - bufferitemname 0, ITEM_CARBOS + bufferitemname STR_VAR_1, ITEM_CARBOS setvar VAR_0x8008, ITEM_CARBOS setvar VAR_0x8009, 1000 goto SlateportCity_EventScript_TryBuyBerryPowderItem end SlateportCity_EventScript_Calcium:: - bufferitemname 0, ITEM_CALCIUM + bufferitemname STR_VAR_1, ITEM_CALCIUM setvar VAR_0x8008, ITEM_CALCIUM setvar VAR_0x8009, 1000 goto SlateportCity_EventScript_TryBuyBerryPowderItem end SlateportCity_EventScript_Zinc:: - bufferitemname 0, ITEM_ZINC + bufferitemname STR_VAR_1, ITEM_ZINC setvar VAR_0x8008, ITEM_ZINC setvar VAR_0x8009, 1000 goto SlateportCity_EventScript_TryBuyBerryPowderItem end SlateportCity_EventScript_HPUp:: - bufferitemname 0, ITEM_HP_UP + bufferitemname STR_VAR_1, ITEM_HP_UP setvar VAR_0x8008, ITEM_HP_UP setvar VAR_0x8009, 1000 goto SlateportCity_EventScript_TryBuyBerryPowderItem end SlateportCity_EventScript_PPUp:: - bufferitemname 0, ITEM_PP_UP + bufferitemname STR_VAR_1, ITEM_PP_UP setvar VAR_0x8008, ITEM_PP_UP setvar VAR_0x8009, 3000 goto SlateportCity_EventScript_TryBuyBerryPowderItem @@ -877,21 +866,17 @@ SlateportCity_EventScript_CancelPowderItemSelect:: SlateportCity_EventScript_TryBuyBerryPowderItem:: msgbox SlateportCity_Text_ExchangeBerryPowderForItem, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq SlateportCity_EventScript_ChooseBerryPowderItem + goto_if_eq VAR_RESULT, NO, SlateportCity_EventScript_ChooseBerryPowderItem copyvar VAR_0x8004, VAR_0x8009 specialvar VAR_RESULT, HasEnoughBerryPowder - compare VAR_RESULT, FALSE - goto_if_eq SlateportCity_EventScript_NotEnoughBerryPowder + goto_if_eq VAR_RESULT, FALSE, SlateportCity_EventScript_NotEnoughBerryPowder giveitem VAR_0x8008 - compare VAR_RESULT, FALSE - goto_if_eq SlateportCity_EventScript_NoRoomForBerryPowderItem + goto_if_eq VAR_RESULT, FALSE, SlateportCity_EventScript_NoRoomForBerryPowderItem copyvar VAR_0x8004, VAR_0x8009 special TakeBerryPowder special PrintPlayerBerryPowderAmount msgbox SlateportCity_Text_FineBerryPowderTradeSomethingElse, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq SlateportCity_EventScript_ChooseBerryPowderItem + goto_if_eq VAR_RESULT, YES, SlateportCity_EventScript_ChooseBerryPowderItem msgbox SlateportCity_Text_WhenYouGetMoreBringItToMe, MSGBOX_DEFAULT special RemoveBerryPowderVendorMenu release diff --git a/data/maps/SlateportCity_BattleTentBattleRoom/scripts.inc b/data/maps/SlateportCity_BattleTentBattleRoom/scripts.inc index 06052e145141..53514bb5e95d 100644 --- a/data/maps/SlateportCity_BattleTentBattleRoom/scripts.inc +++ b/data/maps/SlateportCity_BattleTentBattleRoom/scripts.inc @@ -16,10 +16,8 @@ SlateportCity_BattleTentBattleRoom_OnTransition: SlateportCity_BattleTentBattleRoom_EventScript_SetPlayerGfx:: checkplayergender - compare VAR_RESULT, MALE - goto_if_eq SlateportCity_BattleTentBattleRoom_EventScript_SetPlayerGfxMale - compare VAR_RESULT, FEMALE - goto_if_eq SlateportCity_BattleTentBattleRoom_EventScript_SetPlayerGfxFemale + goto_if_eq VAR_RESULT, MALE, SlateportCity_BattleTentBattleRoom_EventScript_SetPlayerGfxMale + goto_if_eq VAR_RESULT, FEMALE, SlateportCity_BattleTentBattleRoom_EventScript_SetPlayerGfxFemale return SlateportCity_BattleTentBattleRoom_EventScript_SetPlayerGfxMale:: @@ -68,7 +66,7 @@ SlateportCity_BattleTentBattleRoom_EventScript_EnterRoom:: SlateportCity_BattleTent_EventScript_WarpToLobbyLost:: frontier_set FRONTIER_DATA_CHALLENGE_STATUS, CHALLENGE_STATUS_LOST special LoadPlayerParty - warp MAP_SLATEPORT_CITY_BATTLE_TENT_LOBBY, 255, 6, 6 + warp MAP_SLATEPORT_CITY_BATTLE_TENT_LOBBY, 6, 6 waitstate @ forced stop @@ -79,14 +77,14 @@ SlateportCity_BattleTentBattleRoom_EventScript_DefeatedOpponent:: switch VAR_RESULT case 3, SlateportCity_BattleTentBattleRoom_EventScript_WarpToLobbyWon setvar VAR_0x8006, 1 - warp MAP_SLATEPORT_CITY_BATTLE_TENT_CORRIDOR, 255, 2, 3 + warp MAP_SLATEPORT_CITY_BATTLE_TENT_CORRIDOR, 2, 3 waitstate @ forced stop SlateportCity_BattleTentBattleRoom_EventScript_WarpToLobbyWon:: frontier_set FRONTIER_DATA_CHALLENGE_STATUS, CHALLENGE_STATUS_WON special LoadPlayerParty - warp MAP_SLATEPORT_CITY_BATTLE_TENT_LOBBY, 255, 6, 6 + warp MAP_SLATEPORT_CITY_BATTLE_TENT_LOBBY, 6, 6 waitstate @ forced stop diff --git a/data/maps/SlateportCity_BattleTentCorridor/scripts.inc b/data/maps/SlateportCity_BattleTentCorridor/scripts.inc index 37b0f6fc88f8..75156f68f041 100644 --- a/data/maps/SlateportCity_BattleTentCorridor/scripts.inc +++ b/data/maps/SlateportCity_BattleTentCorridor/scripts.inc @@ -13,8 +13,7 @@ SlateportCity_BattleTentCorridor_OnWarp: SlateportCity_BattleTentCorridor_EventScript_SetUpObjects:: setvar VAR_TEMP_1, 1 - compare VAR_0x8006, 1 - goto_if_ne SlateportCity_BattleTentCorridor_EventScript_TurnPlayerNorth + goto_if_ne VAR_0x8006, 1, SlateportCity_BattleTentCorridor_EventScript_TurnPlayerNorth setobjectxy LOCALID_ATTENDANT, 2, 2 turnobject LOCALID_ATTENDANT, DIR_SOUTH SlateportCity_BattleTentCorridor_EventScript_TurnPlayerNorth:: @@ -26,14 +25,12 @@ SlateportCity_BattleTentCorridor_OnFrame: .2byte 0 SlateportCity_BattleTentCorridor_EventScript_EnterCorridor:: - compare VAR_0x8006, 1 - goto_if_eq SlateportCity_BattleTentCorridor_EventScript_ReturnToRoomFromBattle + goto_if_eq VAR_0x8006, 1, SlateportCity_BattleTentCorridor_EventScript_ReturnToRoomFromBattle setvar VAR_TEMP_0, 1 applymovement LOCALID_ATTENDANT, SlateportCity_BattleTentCorridor_Movement_AttendantEnter applymovement OBJ_EVENT_ID_PLAYER, SlateportCity_BattleTentCorridor_Movement_PlayerEnter waitmovement 0 - compare VAR_0x8006, 2 - goto_if_eq SlateportCity_BattleTentCorridor_EventScript_ResumeChallenge + goto_if_eq VAR_0x8006, 2, SlateportCity_BattleTentCorridor_EventScript_ResumeChallenge slateporttent_generaterentalmons slateporttent_generateopponentmons msgbox BattleFrontier_BattleFactoryPreBattleRoom_Text_HoldMonsChooseFromSelection, MSGBOX_DEFAULT @@ -52,7 +49,7 @@ SlateportCity_BattleTentCorridor_EventScript_EnterBattleRoom:: waitmovement 0 closedoor 2, 1 waitdooranim - warp MAP_SLATEPORT_CITY_BATTLE_TENT_BATTLE_ROOM, 255, 4, 4 + warp MAP_SLATEPORT_CITY_BATTLE_TENT_BATTLE_ROOM, 4, 4 waitstate end @@ -65,10 +62,8 @@ SlateportCity_BattleTentCorridor_EventScript_ReturnToRoomFromBattle:: special HealPlayerParty SlateportCity_BattleTentCorridor_EventScript_AskReadyForOpponent:: frontier_get FRONTIER_DATA_BATTLE_NUM - compare VAR_RESULT, 1 - call_if_eq SlateportCity_BattleTentCorridor_EventScript_ReadyFor2ndOpponent - compare VAR_RESULT, 2 - call_if_eq SlateportCity_BattleTentCorridor_EventScript_ReadyFor3rdOpponent + call_if_eq VAR_RESULT, 1, SlateportCity_BattleTentCorridor_EventScript_ReadyFor2ndOpponent + call_if_eq VAR_RESULT, 2, SlateportCity_BattleTentCorridor_EventScript_ReadyFor3rdOpponent multichoice 20, 6, MULTI_GO_ON_REST_RETIRE, TRUE switch VAR_RESULT case 0, SlateportCity_BattleTentCorridor_EventScript_AskSwapMon @@ -103,8 +98,7 @@ SlateportCity_BattleTentCorridor_EventScript_SwapMons:: fadescreen FADE_TO_BLACK slateporttent_swapmons waitstate - compare VAR_RESULT, 1 - goto_if_eq SlateportCity_BattleTentCorridor_EventScript_EnterBattleRoom + goto_if_eq VAR_RESULT, 1, SlateportCity_BattleTentCorridor_EventScript_EnterBattleRoom msgbox BattleFrontier_BattleFactoryPreBattleRoom_Text_YourSwapIsComplete, MSGBOX_DEFAULT goto SlateportCity_BattleTentCorridor_EventScript_EnterBattleRoom diff --git a/data/maps/SlateportCity_BattleTentLobby/scripts.inc b/data/maps/SlateportCity_BattleTentLobby/scripts.inc index 8361cdfcc37b..0d3fae875f68 100644 --- a/data/maps/SlateportCity_BattleTentLobby/scripts.inc +++ b/data/maps/SlateportCity_BattleTentLobby/scripts.inc @@ -93,8 +93,7 @@ SlateportCity_BattleTentLobby_EventScript_Attendant:: lock faceplayer slateporttent_getprize - compare VAR_RESULT, ITEM_NONE - goto_if_ne SlateportCity_BattleTentLobby_EventScript_GivePrize + goto_if_ne VAR_RESULT, ITEM_NONE, SlateportCity_BattleTentLobby_EventScript_GivePrize special SavePlayerParty msgbox SlateportCity_BattleTentLobby_Text_WelcomeToBattleTent, MSGBOX_DEFAULT SlateportCity_BattleTentLobby_EventScript_AskEnterChallenge:: @@ -127,14 +126,13 @@ SlateportCity_BattleTentLobby_EventScript_SaveBeforeChallenge:: delay 2 call Common_EventScript_SaveGame setvar VAR_TEMP_0, 255 - compare VAR_RESULT, 0 - goto_if_eq SlateportCity_BattleTentLobby_EventScript_CancelChallengeSaveFailed + goto_if_eq VAR_RESULT, 0, SlateportCity_BattleTentLobby_EventScript_CancelChallengeSaveFailed setvar VAR_0x8006, 0 SlateportCity_BattleTentLobby_EventScript_EnterChallenge:: msgbox SlateportCity_BattleTentLobby_Text_StepThisWay, MSGBOX_DEFAULT closemessage call SlateportCity_BattleTentLobby_EventScript_WalkToDoor - warp MAP_SLATEPORT_CITY_BATTLE_TENT_CORRIDOR, 255, 2, 7 + warp MAP_SLATEPORT_CITY_BATTLE_TENT_CORRIDOR, 2, 7 setvar VAR_TEMP_0, 0 waitstate end @@ -204,8 +202,7 @@ SlateportCity_BattleTentLobby_EventScript_TormentGiver:: goto_if_set FLAG_RECEIVED_TM41, SlateportCity_BattleTentLobby_EventScript_ReceivedTorment msgbox SlateportCity_BattleTentLobby_Text_CouldntFindMonForMe, MSGBOX_DEFAULT giveitem ITEM_TM41 - compare VAR_RESULT, FALSE - goto_if_eq Common_EventScript_ShowBagIsFull + goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull setflag FLAG_RECEIVED_TM41 msgbox SlateportCity_BattleTentLobby_Text_ExplainTorment, MSGBOX_DEFAULT release diff --git a/data/maps/SlateportCity_Harbor/scripts.inc b/data/maps/SlateportCity_Harbor/scripts.inc index 58e5978cf0cb..b2a71f2b7c3c 100644 --- a/data/maps/SlateportCity_Harbor/scripts.inc +++ b/data/maps/SlateportCity_Harbor/scripts.inc @@ -9,10 +9,9 @@ SlateportCity_Harbor_MapScripts:: .byte 0 SlateportCity_Harbor_OnTransition: - setescapewarp MAP_SLATEPORT_CITY, 255, 28, 13 + setescapewarp MAP_SLATEPORT_CITY, 28, 13 setvar VAR_TEMP_1, 0 - compare VAR_SLATEPORT_HARBOR_STATE, 1 - call_if_eq SlateportCity_Harbor_EventScript_ReadyAquaEscapeScene + call_if_eq VAR_SLATEPORT_HARBOR_STATE, 1, SlateportCity_Harbor_EventScript_ReadyAquaEscapeScene call_if_set FLAG_SYS_GAME_CLEAR, SlateportCity_Harbor_EventScript_ShowSSTidal end @@ -71,14 +70,10 @@ SlateportCity_Harbor_EventScript_AquaEscapeScene:: setvar VAR_SLATEPORT_HARBOR_STATE, 2 setflag FLAG_MET_TEAM_AQUA_HARBOR setflag FLAG_HIDE_LILYCOVE_MOTEL_SCOTT - compare VAR_0x8008, 0 - call_if_eq SlateportCity_Harbor_EventScript_SternApproachPlayer0 - compare VAR_0x8008, 1 - call_if_eq SlateportCity_Harbor_EventScript_SternApproachPlayer1 - compare VAR_0x8008, 2 - call_if_eq SlateportCity_Harbor_EventScript_SternApproachPlayer - compare VAR_0x8008, 3 - call_if_eq SlateportCity_Harbor_EventScript_SternApproachPlayer + call_if_eq VAR_0x8008, 0, SlateportCity_Harbor_EventScript_SternApproachPlayer0 + call_if_eq VAR_0x8008, 1, SlateportCity_Harbor_EventScript_SternApproachPlayer1 + call_if_eq VAR_0x8008, 2, SlateportCity_Harbor_EventScript_SternApproachPlayer + call_if_eq VAR_0x8008, 3, SlateportCity_Harbor_EventScript_SternApproachPlayer msgbox SlateportCity_Harbor_Text_CaptSternWhyStealMySubmarine, MSGBOX_DEFAULT closemessage setflag FLAG_HIDE_AQUA_HIDEOUT_1F_GRUNT_1_BLOCKING_ENTRANCE @@ -206,21 +201,19 @@ SlateportCity_Harbor_EventScript_NoTicket:: SlateportCity_Harbor_EventScript_Lilycove:: msgbox SlateportCity_Harbor_Text_LilycoveItIs, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq SlateportCity_Harbor_EventScript_ChooseNewDestination + goto_if_eq VAR_RESULT, NO, SlateportCity_Harbor_EventScript_ChooseNewDestination setvar VAR_SS_TIDAL_STATE, SS_TIDAL_BOARD_SLATEPORT call SlateportCity_Harbor_EventScript_BoardFerry - warp MAP_SS_TIDAL_CORRIDOR, 255, 1, 10 + warp MAP_SS_TIDAL_CORRIDOR, 1, 10 waitstate release end SlateportCity_Harbor_EventScript_BattleFrontier:: msgbox SlateportCity_Harbor_Text_BattleFrontierItIs, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq SlateportCity_Harbor_EventScript_ChooseNewDestination + goto_if_eq VAR_RESULT, NO, SlateportCity_Harbor_EventScript_ChooseNewDestination call SlateportCity_Harbor_EventScript_BoardFerry - warp MAP_BATTLE_FRONTIER_OUTSIDE_WEST, 255, 19, 67 + warp MAP_BATTLE_FRONTIER_OUTSIDE_WEST, 19, 67 waitstate release end @@ -238,10 +231,8 @@ SlateportCity_Harbor_EventScript_BoardFerry:: waitmovement 0 delay 30 hideobjectat VAR_LAST_TALKED, MAP_SLATEPORT_CITY_HARBOR - compare VAR_FACING, DIR_NORTH - call_if_eq SlateportCity_Harbor_EventScript_BoardFerryNorth - compare VAR_FACING, DIR_EAST - call_if_eq SlateportCity_Harbor_EventScript_BoardFerryEast + call_if_eq VAR_FACING, DIR_NORTH, SlateportCity_Harbor_EventScript_BoardFerryNorth + call_if_eq VAR_FACING, DIR_EAST, SlateportCity_Harbor_EventScript_BoardFerryEast delay 30 hideobjectat OBJ_EVENT_ID_PLAYER, 0 setvar VAR_0x8004, LOCALID_SS_TIDAL @@ -279,8 +270,7 @@ SlateportCity_Harbor_EventScript_Sailor:: setvar VAR_0x8004, 0 call_if_set FLAG_DEFEATED_KYOGRE, SlateportCity_Harbor_EventScript_CountDefeatedLegendary call_if_set FLAG_DEFEATED_GROUDON, SlateportCity_Harbor_EventScript_CountDefeatedLegendary - compare VAR_0x8004, 2 @ Defeated both - goto_if_eq SlateportCity_Harbor_EventScript_SailorNoAbnormalWeather + goto_if_eq VAR_0x8004, 2, SlateportCity_Harbor_EventScript_SailorNoAbnormalWeather @ Defeated both msgbox SlateportCity_Harbor_Text_AbnormalWeather, MSGBOX_DEFAULT release end @@ -304,8 +294,7 @@ SlateportCity_Harbor_EventScript_CaptStern:: goto_if_set FLAG_BADGE07_GET, SlateportCity_Harbor_EventScript_CaptSternFerryOrScannerComment goto_if_set FLAG_EVIL_TEAM_ESCAPED_STERN_SPOKE, SlateportCity_Harbor_EventScript_NeedDive goto_if_set FLAG_TEAM_AQUA_ESCAPED_IN_SUBMARINE, SlateportCity_Harbor_EventScript_TeamAquaLeftNeedDive - compare VAR_SLATEPORT_HARBOR_STATE, 2 - goto_if_eq SlateportCity_Harbor_EventScript_WhyStealSubmarine + goto_if_eq VAR_SLATEPORT_HARBOR_STATE, 2, SlateportCity_Harbor_EventScript_WhyStealSubmarine msgbox SlateportCity_Harbor_Text_SameThugsTriedToRobAtMuseum, MSGBOX_DEFAULT closemessage applymovement VAR_LAST_TALKED, Common_Movement_FaceOriginalDirection @@ -330,11 +319,9 @@ SlateportCity_Harbor_EventScript_NeedDive:: end SlateportCity_Harbor_EventScript_CaptSternFerryOrScannerComment:: - compare VAR_TEMP_1, 1 - goto_if_eq SlateportCity_Harbor_EventScript_TradedScanner - checkitem ITEM_SCANNER, 1 - compare VAR_RESULT, TRUE - goto_if_eq SlateportCity_Harbor_EventScript_AskToTradeScanner + goto_if_eq VAR_TEMP_1, 1, SlateportCity_Harbor_EventScript_TradedScanner + checkitem ITEM_SCANNER + goto_if_eq VAR_RESULT, TRUE, SlateportCity_Harbor_EventScript_AskToTradeScanner goto_if_set FLAG_SYS_GAME_CLEAR, SlateportCity_Harbor_EventScript_FerryFinished msgbox SlateportCity_Harbor_Text_WontBeLongBeforeWeFinishFerry, MSGBOX_DEFAULT release @@ -362,11 +349,9 @@ SlateportCity_Harbor_EventScript_ChooseScannerTrade:: SlateportCity_Harbor_EventScript_DeepSeaTooth:: msgbox SlateportCity_Harbor_Text_TradeForDeepSeaTooth, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq SlateportCity_Harbor_EventScript_ChooseDifferentTrade + goto_if_eq VAR_RESULT, NO, SlateportCity_Harbor_EventScript_ChooseDifferentTrade giveitem ITEM_DEEP_SEA_TOOTH - compare VAR_RESULT, FALSE - goto_if_eq Common_EventScript_ShowBagIsFull + goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull removeitem ITEM_SCANNER msgbox SlateportCity_Harbor_Text_HandedScannerToStern, MSGBOX_DEFAULT setflag FLAG_EXCHANGED_SCANNER @@ -375,11 +360,9 @@ SlateportCity_Harbor_EventScript_DeepSeaTooth:: SlateportCity_Harbor_EventScript_DeepSeaScale:: msgbox SlateportCity_Harbor_Text_TradeForDeepSeaScale, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq SlateportCity_Harbor_EventScript_ChooseDifferentTrade + goto_if_eq VAR_RESULT, NO, SlateportCity_Harbor_EventScript_ChooseDifferentTrade giveitem ITEM_DEEP_SEA_SCALE - compare VAR_RESULT, FALSE - goto_if_eq Common_EventScript_ShowBagIsFull + goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull removeitem ITEM_SCANNER msgbox SlateportCity_Harbor_Text_HandedScannerToStern, MSGBOX_DEFAULT setflag FLAG_EXCHANGED_SCANNER diff --git a/data/maps/SlateportCity_NameRatersHouse/scripts.inc b/data/maps/SlateportCity_NameRatersHouse/scripts.inc index 87ed2d07f868..34d788a6aac2 100644 --- a/data/maps/SlateportCity_NameRatersHouse/scripts.inc +++ b/data/maps/SlateportCity_NameRatersHouse/scripts.inc @@ -5,20 +5,16 @@ SlateportCity_NameRatersHouse_EventScript_NameRater:: lock faceplayer msgbox SlateportCity_NameRatersHouse_Text_PleasedToRateMonNickname, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq SlateportCity_NameRatersHouse_EventScript_ChooseMonToRate - compare VAR_RESULT, NO - goto_if_eq SlateportCity_NameRatersHouse_EventScript_DeclineNameRate + goto_if_eq VAR_RESULT, YES, SlateportCity_NameRatersHouse_EventScript_ChooseMonToRate + goto_if_eq VAR_RESULT, NO, SlateportCity_NameRatersHouse_EventScript_DeclineNameRate end SlateportCity_NameRatersHouse_EventScript_ChooseMonToRate:: msgbox SlateportCity_NameRatersHouse_Text_CritiqueWhichMonNickname, MSGBOX_DEFAULT special ChoosePartyMon waitstate - compare VAR_0x8004, 255 - goto_if_ne SlateportCity_NameRatersHouse_EventScript_RateMonNickname - compare VAR_0x8004, 255 - goto_if_eq SlateportCity_NameRatersHouse_EventScript_DeclineNameRate + goto_if_ne VAR_0x8004, PARTY_NOTHING_CHOSEN, SlateportCity_NameRatersHouse_EventScript_RateMonNickname + goto_if_eq VAR_0x8004, PARTY_NOTHING_CHOSEN, SlateportCity_NameRatersHouse_EventScript_DeclineNameRate end SlateportCity_NameRatersHouse_EventScript_DeclineNameRate:: @@ -28,21 +24,16 @@ SlateportCity_NameRatersHouse_EventScript_DeclineNameRate:: SlateportCity_NameRatersHouse_EventScript_RateMonNickname:: specialvar VAR_RESULT, ScriptGetPartyMonSpecies - compare VAR_RESULT, SPECIES_EGG - goto_if_eq SlateportCity_NameRatersHouse_EventScript_CantRateEgg + goto_if_eq VAR_RESULT, SPECIES_EGG, SlateportCity_NameRatersHouse_EventScript_CantRateEgg special BufferMonNickname special IsMonOTIDNotPlayers - compare VAR_RESULT, TRUE - goto_if_eq SlateportCity_NameRatersHouse_EventScript_PlayerNotMonsOT + goto_if_eq VAR_RESULT, TRUE, SlateportCity_NameRatersHouse_EventScript_PlayerNotMonsOT specialvar VAR_RESULT, MonOTNameNotPlayer special BufferMonNickname - compare VAR_RESULT, TRUE - goto_if_eq SlateportCity_NameRatersHouse_EventScript_PlayerNotMonsOT + goto_if_eq VAR_RESULT, TRUE, SlateportCity_NameRatersHouse_EventScript_PlayerNotMonsOT msgbox SlateportCity_NameRatersHouse_Text_FineNameSuggestBetterOne, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq SlateportCity_NameRatersHouse_EventScript_ChangeNickname - compare VAR_RESULT, NO - goto_if_eq SlateportCity_NameRatersHouse_EventScript_DeclineNameRate + goto_if_eq VAR_RESULT, YES, SlateportCity_NameRatersHouse_EventScript_ChangeNickname + goto_if_eq VAR_RESULT, NO, SlateportCity_NameRatersHouse_EventScript_DeclineNameRate end SlateportCity_NameRatersHouse_EventScript_CantRateEgg:: @@ -60,8 +51,7 @@ SlateportCity_NameRatersHouse_EventScript_ChangeNickname:: call Common_EventScript_NameReceivedPartyMon specialvar VAR_RESULT, TryPutNameRaterShowOnTheAir special BufferMonNickname - compare VAR_RESULT, TRUE - goto_if_eq SlateportCity_NameRatersHouse_EventScript_NewNameDifferent + goto_if_eq VAR_RESULT, TRUE, SlateportCity_NameRatersHouse_EventScript_NewNameDifferent msgbox SlateportCity_NameRatersHouse_Text_NameNoDifferentYetSuperior, MSGBOX_DEFAULT release end diff --git a/data/maps/SlateportCity_OceanicMuseum_1F/scripts.inc b/data/maps/SlateportCity_OceanicMuseum_1F/scripts.inc index cfe547de56d9..96892f948d99 100644 --- a/data/maps/SlateportCity_OceanicMuseum_1F/scripts.inc +++ b/data/maps/SlateportCity_OceanicMuseum_1F/scripts.inc @@ -22,10 +22,9 @@ SlateportCity_OceanicMuseum_1F_EventScript_PayEntranceFeeRight:: end SlateportCity_OceanicMuseum_1F_EventScript_PayEntranceFee:: - showmoneybox 0, 0, 0 + showmoneybox 0, 0 msgbox SlateportCity_OceanicMuseum_1F_Text_WouldYouLikeToEnter, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq SlateportCity_OceanicMuseum_1F_EventScript_CheckMoneyForFee + goto_if_eq VAR_RESULT, YES, SlateportCity_OceanicMuseum_1F_EventScript_CheckMoneyForFee closemessage hidemoneybox applymovement OBJ_EVENT_ID_PLAYER, SlateportCity_OceanicMuseum_1F_Movement_PushPlayerBackFromCounter @@ -34,12 +33,11 @@ SlateportCity_OceanicMuseum_1F_EventScript_PayEntranceFee:: end SlateportCity_OceanicMuseum_1F_EventScript_CheckMoneyForFee:: - checkmoney 50, 0 - compare VAR_RESULT, FALSE - goto_if_eq SlateportCity_OceanicMuseum_1F_EventScript_NotEnoughMoney + checkmoney 50 + goto_if_eq VAR_RESULT, FALSE, SlateportCity_OceanicMuseum_1F_EventScript_NotEnoughMoney playse SE_SHOP - removemoney 50, 0 - updatemoneybox 0, 0 + removemoney 50 + updatemoneybox msgbox SlateportCity_OceanicMuseum_1F_Text_PleaseEnjoyYourself, MSGBOX_DEFAULT setvar VAR_SLATEPORT_MUSEUM_1F_STATE, 1 hidemoneybox @@ -154,19 +152,14 @@ SlateportCity_OceanicMuseum_1F_EventScript_FamiliarGrunt:: waitmovement 0 msgbox SlateportCity_OceanicMuseum_1F_Text_RememberMeTakeThis, MSGBOX_DEFAULT giveitem ITEM_TM46 - compare VAR_RESULT, 0 - goto_if_eq SlateportCity_OceanicMuseum_1F_EventScript_NoRoomForThief + goto_if_eq VAR_RESULT, 0, SlateportCity_OceanicMuseum_1F_EventScript_NoRoomForThief setflag FLAG_RECEIVED_TM46 msgbox SlateportCity_OceanicMuseum_1F_Text_HopeINeverSeeYouAgain, MSGBOX_DEFAULT closemessage - compare VAR_FACING, DIR_NORTH - goto_if_eq SlateportCity_OceanicMuseum_1F_EventScript_FamiliarGruntExitNorth - compare VAR_FACING, DIR_SOUTH - goto_if_eq SlateportCity_OceanicMuseum_1F_EventScript_FamiliarGruntExitSouth - compare VAR_FACING, DIR_WEST - goto_if_eq SlateportCity_OceanicMuseum_1F_EventScript_FamiliarGruntExitWestEast - compare VAR_FACING, DIR_EAST - goto_if_eq SlateportCity_OceanicMuseum_1F_EventScript_FamiliarGruntExitWestEast + goto_if_eq VAR_FACING, DIR_NORTH, SlateportCity_OceanicMuseum_1F_EventScript_FamiliarGruntExitNorth + goto_if_eq VAR_FACING, DIR_SOUTH, SlateportCity_OceanicMuseum_1F_EventScript_FamiliarGruntExitSouth + goto_if_eq VAR_FACING, DIR_WEST, SlateportCity_OceanicMuseum_1F_EventScript_FamiliarGruntExitWestEast + goto_if_eq VAR_FACING, DIR_EAST, SlateportCity_OceanicMuseum_1F_EventScript_FamiliarGruntExitWestEast end SlateportCity_OceanicMuseum_1F_EventScript_FamiliarGruntExitNorth:: diff --git a/data/maps/SlateportCity_OceanicMuseum_2F/scripts.inc b/data/maps/SlateportCity_OceanicMuseum_2F/scripts.inc index b993c9fab1fa..59131fd7ee2a 100644 --- a/data/maps/SlateportCity_OceanicMuseum_2F/scripts.inc +++ b/data/maps/SlateportCity_OceanicMuseum_2F/scripts.inc @@ -21,22 +21,17 @@ SlateportCity_OceanicMuseum_2F_EventScript_CaptStern:: applymovement LOCALID_GRUNT_1, SlateportCity_OceanicMuseum_2F_Movement_FirstGruntApproach applymovement LOCALID_GRUNT_2, SlateportCity_OceanicMuseum_2F_Movement_SecondGruntApproach waitmovement 0 - compare VAR_FACING, DIR_SOUTH - call_if_eq SlateportCity_OceanicMuseum_2F_EventScript_PlayerFaceGrunts - compare VAR_FACING, DIR_EAST - call_if_eq SlateportCity_OceanicMuseum_2F_EventScript_PlayerFaceGrunts + call_if_eq VAR_FACING, DIR_SOUTH, SlateportCity_OceanicMuseum_2F_EventScript_PlayerFaceGrunts + call_if_eq VAR_FACING, DIR_EAST, SlateportCity_OceanicMuseum_2F_EventScript_PlayerFaceGrunts msgbox SlateportCity_OceanicMuseum_2F_Text_WellTakeThoseParts, MSGBOX_DEFAULT - compare VAR_FACING, DIR_EAST - call_if_ne SlateportCity_OceanicMuseum_2F_EventScript_SternFaceGrunts + call_if_ne VAR_FACING, DIR_EAST, SlateportCity_OceanicMuseum_2F_EventScript_SternFaceGrunts msgbox SlateportCity_OceanicMuseum_2F_Text_SternWhoAreYou, MSGBOX_DEFAULT msgbox SlateportCity_OceanicMuseum_2F_Text_WereTeamAqua, MSGBOX_DEFAULT closemessage applymovement LOCALID_GRUNT_2, SlateportCity_OceanicMuseum_2F_Movement_GruntApproachToBattle waitmovement 0 - compare VAR_FACING, DIR_SOUTH - call_if_eq SlateportCity_OceanicMuseum_2F_EventScript_PlayerApproachGruntSouth - compare VAR_FACING, DIR_WEST - call_if_eq SlateportCity_OceanicMuseum_2F_EventScript_PlayerApproachGruntWest + call_if_eq VAR_FACING, DIR_SOUTH, SlateportCity_OceanicMuseum_2F_EventScript_PlayerApproachGruntSouth + call_if_eq VAR_FACING, DIR_WEST, SlateportCity_OceanicMuseum_2F_EventScript_PlayerApproachGruntWest trainerbattle_no_intro TRAINER_GRUNT_MUSEUM_1, SlateportCity_OceanicMuseum_2F_Text_Grunt1Defeat msgbox SlateportCity_OceanicMuseum_2F_Text_BossGoingToBeFurious, MSGBOX_DEFAULT closemessage @@ -86,8 +81,7 @@ SlateportCity_OceanicMuseum_2F_EventScript_CaptStern:: special HealPlayerParty removeobject LOCALID_CAPT_STERN setflag FLAG_HIDE_ROUTE_110_TEAM_AQUA - compare VAR_REGISTER_BIRCH_STATE, 0 - call_if_eq SlateportCity_OceanicMuseum_2F_EventScript_ReadyRegisterBirch + call_if_eq VAR_REGISTER_BIRCH_STATE, 0, SlateportCity_OceanicMuseum_2F_EventScript_ReadyRegisterBirch setflag FLAG_DELIVERED_DEVON_GOODS clearflag FLAG_HIDE_ROUTE_116_DEVON_EMPLOYEE setflag FLAG_HIDE_RUSTBORO_CITY_DEVON_CORP_3F_EMPLOYEE diff --git a/data/maps/SlateportCity_PokemonFanClub/scripts.inc b/data/maps/SlateportCity_PokemonFanClub/scripts.inc index 96e1a7633dec..b97e29a02865 100644 --- a/data/maps/SlateportCity_PokemonFanClub/scripts.inc +++ b/data/maps/SlateportCity_PokemonFanClub/scripts.inc @@ -26,10 +26,8 @@ SlateportCity_PokemonFanClub_EventScript_ChairmanTryAssessPokemon:: call_if_set FLAG_RECEIVED_PINK_SCARF, SlateportCity_PokemonFanClub_EventScript_CountReceivedScarf call_if_set FLAG_RECEIVED_BLUE_SCARF, SlateportCity_PokemonFanClub_EventScript_CountReceivedScarf call_if_set FLAG_RECEIVED_RED_SCARF, SlateportCity_PokemonFanClub_EventScript_CountReceivedScarf - compare VAR_TEMP_2, CONTEST_CATEGORIES_COUNT - call_if_eq SlateportCity_PokemonFanClub_EventScript_ReceivedAllScarves - compare VAR_SLATEPORT_FAN_CLUB_STATE, 2 - goto_if_eq SlateportCity_PokemonFanClub_EventScript_NoMoreScarves + call_if_eq VAR_TEMP_2, CONTEST_CATEGORIES_COUNT, SlateportCity_PokemonFanClub_EventScript_ReceivedAllScarves + goto_if_eq VAR_SLATEPORT_FAN_CLUB_STATE, 2, SlateportCity_PokemonFanClub_EventScript_NoMoreScarves msgbox SlateportCity_PokemonFanClub_Text_HowIsYourPokemonGrowing, MSGBOX_DEFAULT goto SlateportCity_PokemonFanClub_EventScript_ChairmanAssessLeadMon end @@ -47,7 +45,7 @@ SlateportCity_PokemonFanClub_EventScript_ChairmanAssessLeadMon:: call_if_unset FLAG_RECEIVED_PINK_SCARF, SlateportCity_PokemonFanClub_EventScript_CheckMonCute call_if_unset FLAG_RECEIVED_BLUE_SCARF, SlateportCity_PokemonFanClub_EventScript_CheckMonBeauty call_if_unset FLAG_RECEIVED_RED_SCARF, SlateportCity_PokemonFanClub_EventScript_CheckMonCool - bufferleadmonspeciesname 0 + bufferleadmonspeciesname STR_VAR_1 switch VAR_TEMP_1 case 0, SlateportCity_PokemonFanClub_EventScript_NoHighConditions case 1, SlateportCity_PokemonFanClub_EventScript_GiveRedScarf @@ -72,9 +70,8 @@ SlateportCity_PokemonFanClub_EventScript_NoHighConditions:: end SlateportCity_PokemonFanClub_EventScript_GiveRedScarf:: - checkitemspace ITEM_RED_SCARF, 1 - compare VAR_RESULT, FALSE - goto_if_eq SlateportCity_PokemonFanClub_EventScript_NoRoomForScarf + checkitemspace ITEM_RED_SCARF + goto_if_eq VAR_RESULT, FALSE, SlateportCity_PokemonFanClub_EventScript_NoRoomForScarf msgbox SlateportCity_PokemonFanClub_Text_MonMostImpressiveGiveItThis, MSGBOX_DEFAULT setflag FLAG_RECEIVED_RED_SCARF giveitem ITEM_RED_SCARF @@ -83,9 +80,8 @@ SlateportCity_PokemonFanClub_EventScript_GiveRedScarf:: end SlateportCity_PokemonFanClub_EventScript_GiveBlueScarf:: - checkitemspace ITEM_BLUE_SCARF, 1 - compare VAR_RESULT, FALSE - goto_if_eq SlateportCity_PokemonFanClub_EventScript_NoRoomForScarf + checkitemspace ITEM_BLUE_SCARF + goto_if_eq VAR_RESULT, FALSE, SlateportCity_PokemonFanClub_EventScript_NoRoomForScarf msgbox SlateportCity_PokemonFanClub_Text_MonMostImpressiveGiveItThis, MSGBOX_DEFAULT setflag FLAG_RECEIVED_BLUE_SCARF giveitem ITEM_BLUE_SCARF @@ -94,9 +90,8 @@ SlateportCity_PokemonFanClub_EventScript_GiveBlueScarf:: end SlateportCity_PokemonFanClub_EventScript_GivePinkScarf:: - checkitemspace ITEM_PINK_SCARF, 1 - compare VAR_RESULT, FALSE - goto_if_eq SlateportCity_PokemonFanClub_EventScript_NoRoomForScarf + checkitemspace ITEM_PINK_SCARF + goto_if_eq VAR_RESULT, FALSE, SlateportCity_PokemonFanClub_EventScript_NoRoomForScarf msgbox SlateportCity_PokemonFanClub_Text_MonMostImpressiveGiveItThis, MSGBOX_DEFAULT setflag FLAG_RECEIVED_PINK_SCARF giveitem ITEM_PINK_SCARF @@ -105,9 +100,8 @@ SlateportCity_PokemonFanClub_EventScript_GivePinkScarf:: end SlateportCity_PokemonFanClub_EventScript_GiveGreenScarf:: - checkitemspace ITEM_GREEN_SCARF, 1 - compare VAR_RESULT, FALSE - goto_if_eq SlateportCity_PokemonFanClub_EventScript_NoRoomForScarf + checkitemspace ITEM_GREEN_SCARF + goto_if_eq VAR_RESULT, FALSE, SlateportCity_PokemonFanClub_EventScript_NoRoomForScarf msgbox SlateportCity_PokemonFanClub_Text_MonMostImpressiveGiveItThis, MSGBOX_DEFAULT setflag FLAG_RECEIVED_GREEN_SCARF giveitem ITEM_GREEN_SCARF @@ -116,9 +110,8 @@ SlateportCity_PokemonFanClub_EventScript_GiveGreenScarf:: end SlateportCity_PokemonFanClub_EventScript_GiveYellowScarf:: - checkitemspace ITEM_YELLOW_SCARF, 1 - compare VAR_RESULT, FALSE - goto_if_eq SlateportCity_PokemonFanClub_EventScript_NoRoomForScarf + checkitemspace ITEM_YELLOW_SCARF + goto_if_eq VAR_RESULT, FALSE, SlateportCity_PokemonFanClub_EventScript_NoRoomForScarf msgbox SlateportCity_PokemonFanClub_Text_MonMostImpressiveGiveItThis, MSGBOX_DEFAULT setflag FLAG_RECEIVED_YELLOW_SCARF giveitem ITEM_YELLOW_SCARF @@ -133,8 +126,7 @@ SlateportCity_PokemonFanClub_EventScript_NoRoomForScarf:: SlateportCity_PokemonFanClub_EventScript_CheckMonCool:: specialvar VAR_RESULT, CheckLeadMonCool - compare VAR_RESULT, TRUE - call_if_eq SlateportCity_PokemonFanClub_EventScript_SetMonCool + call_if_eq VAR_RESULT, TRUE, SlateportCity_PokemonFanClub_EventScript_SetMonCool return SlateportCity_PokemonFanClub_EventScript_SetMonCool:: @@ -143,8 +135,7 @@ SlateportCity_PokemonFanClub_EventScript_SetMonCool:: SlateportCity_PokemonFanClub_EventScript_CheckMonBeauty:: specialvar VAR_RESULT, CheckLeadMonBeauty - compare VAR_RESULT, TRUE - call_if_eq SlateportCity_PokemonFanClub_EventScript_SetMonBeauty + call_if_eq VAR_RESULT, TRUE, SlateportCity_PokemonFanClub_EventScript_SetMonBeauty return SlateportCity_PokemonFanClub_EventScript_SetMonBeauty:: @@ -153,8 +144,7 @@ SlateportCity_PokemonFanClub_EventScript_SetMonBeauty:: SlateportCity_PokemonFanClub_EventScript_CheckMonCute:: specialvar VAR_RESULT, CheckLeadMonCute - compare VAR_RESULT, TRUE - call_if_eq SlateportCity_PokemonFanClub_EventScript_SetMonCute + call_if_eq VAR_RESULT, TRUE, SlateportCity_PokemonFanClub_EventScript_SetMonCute return SlateportCity_PokemonFanClub_EventScript_SetMonCute:: @@ -163,8 +153,7 @@ SlateportCity_PokemonFanClub_EventScript_SetMonCute:: SlateportCity_PokemonFanClub_EventScript_CheckMonSmart:: specialvar VAR_RESULT, CheckLeadMonSmart - compare VAR_RESULT, TRUE - call_if_eq SlateportCity_PokemonFanClub_EventScript_SetMonSmart + call_if_eq VAR_RESULT, TRUE, SlateportCity_PokemonFanClub_EventScript_SetMonSmart return SlateportCity_PokemonFanClub_EventScript_SetMonSmart:: @@ -173,8 +162,7 @@ SlateportCity_PokemonFanClub_EventScript_SetMonSmart:: SlateportCity_PokemonFanClub_EventScript_CheckMonTough:: specialvar VAR_RESULT, CheckLeadMonTough - compare VAR_RESULT, TRUE - call_if_eq SlateportCity_PokemonFanClub_EventScript_SetMonTough + call_if_eq VAR_RESULT, TRUE, SlateportCity_PokemonFanClub_EventScript_SetMonTough return SlateportCity_PokemonFanClub_EventScript_SetMonTough:: @@ -204,8 +192,7 @@ SlateportCity_PokemonFanClub_EventScript_SootheBellWoman:: goto_if_set FLAG_RECEIVED_SOOTHE_BELL, SlateportCity_PokemonFanClub_EventScript_ReceivedSootheBell msgbox SlateportCity_PokemonFanClub_Text_ShowMePokemonThatLoveYou, MSGBOX_DEFAULT specialvar VAR_RESULT, GetLeadMonFriendshipScore - compare VAR_RESULT, 4 - goto_if_ge SlateportCity_PokemonFanClub_EventScript_GiveSootheBell + goto_if_ge VAR_RESULT, 4, SlateportCity_PokemonFanClub_EventScript_GiveSootheBell release end @@ -217,8 +204,7 @@ SlateportCity_PokemonFanClub_EventScript_GiveSootheBell:: waitmovement 0 msgbox SlateportCity_PokemonFanClub_Text_PokemonAdoresYou, MSGBOX_DEFAULT giveitem ITEM_SOOTHE_BELL - compare VAR_RESULT, FALSE - goto_if_eq Common_EventScript_ShowBagIsFull + goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull setflag FLAG_RECEIVED_SOOTHE_BELL release end diff --git a/data/maps/SootopolisCity/scripts.inc b/data/maps/SootopolisCity/scripts.inc index f3f8ea024a85..69f74880ecaa 100644 --- a/data/maps/SootopolisCity/scripts.inc +++ b/data/maps/SootopolisCity/scripts.inc @@ -34,49 +34,37 @@ SootopolisCity_EventScript_LegendariesNotArrived:: end SootopolisCity_EventScript_LockHouseDoors:: - setmetatile 9, 6, METATILE_Sootopolis_Door_Closed, 1 - setmetatile 9, 17, METATILE_Sootopolis_Door_Closed, 1 - setmetatile 9, 26, METATILE_Sootopolis_Door_Closed, 1 - setmetatile 44, 17, METATILE_Sootopolis_Door_Closed, 1 - setmetatile 8, 35, METATILE_Sootopolis_Door_Closed, 1 - setmetatile 53, 28, METATILE_Sootopolis_Door_Closed, 1 - setmetatile 45, 6, METATILE_Sootopolis_Door_Closed, 1 - setmetatile 48, 25, METATILE_Sootopolis_Door_Closed, 1 - setmetatile 51, 36, METATILE_Sootopolis_Door_Closed, 1 + setmetatile 9, 6, METATILE_Sootopolis_Door_Closed, TRUE + setmetatile 9, 17, METATILE_Sootopolis_Door_Closed, TRUE + setmetatile 9, 26, METATILE_Sootopolis_Door_Closed, TRUE + setmetatile 44, 17, METATILE_Sootopolis_Door_Closed, TRUE + setmetatile 8, 35, METATILE_Sootopolis_Door_Closed, TRUE + setmetatile 53, 28, METATILE_Sootopolis_Door_Closed, TRUE + setmetatile 45, 6, METATILE_Sootopolis_Door_Closed, TRUE + setmetatile 48, 25, METATILE_Sootopolis_Door_Closed, TRUE + setmetatile 51, 36, METATILE_Sootopolis_Door_Closed, TRUE return SootopolisCity_EventScript_LockGymDoor:: - setmetatile 31, 32, METATILE_Sootopolis_GymDoor_Closed, 1 + setmetatile 31, 32, METATILE_Sootopolis_GymDoor_Closed, TRUE return SootopolisCity_OnTransition: setflag FLAG_VISITED_SOOTOPOLIS_CITY - compare VAR_SOOTOPOLIS_CITY_STATE, 1 - call_if_eq SootopolisCity_EventScript_HideMapNamePopup - compare VAR_SKY_PILLAR_STATE, 1 - call_if_eq SootopolisCity_EventScript_HideMapNamePopup + call_if_eq VAR_SOOTOPOLIS_CITY_STATE, 1, SootopolisCity_EventScript_HideMapNamePopup + call_if_eq VAR_SKY_PILLAR_STATE, 1, SootopolisCity_EventScript_HideMapNamePopup call SootopolisCity_EventScript_SetWeather call SootopolisCity_EventScript_SetLayout - compare VAR_SOOTOPOLIS_CITY_STATE, 1 - call_if_eq SootopolisCity_EventScript_SetBattleSpectators - compare VAR_SOOTOPOLIS_CITY_STATE, 2 - call_if_eq SootopolisCity_EventScript_SetBattleSpectators - compare VAR_SOOTOPOLIS_CITY_STATE, 3 - call_if_eq SootopolisCity_EventScript_SetBattleSpectators - compare VAR_SOOTOPOLIS_CITY_STATE, 4 - call_if_eq SootopolisCity_EventScript_SetBattleSpectators - compare VAR_SOOTOPOLIS_CITY_STATE, 5 - call_if_eq SootopolisCity_EventScript_SetBattleSpectators - compare VAR_SOOTOPOLIS_CITY_STATE, 2 - call_if_eq SootopolisCity_EventScript_CheckSetEnterCaveOfOriginObjPos - compare VAR_SOOTOPOLIS_CITY_STATE, 3 - call_if_eq SootopolisCity_EventScript_CheckSetEnterCaveOfOriginObjPos - compare VAR_SOOTOPOLIS_CITY_STATE, 4 - call_if_eq SootopolisCity_EventScript_SetExitCaveOfOriginObjPos - compare VAR_SOOTOPOLIS_CITY_STATE, 5 - call_if_eq SootopolisCity_EventScript_SetOutsideGymObjPos - compare VAR_SOOTOPOLIS_CITY_STATE, 6 - call_if_eq SootopolisCity_EventScript_SetExpertBlockCaveEntrance + call_if_eq VAR_SOOTOPOLIS_CITY_STATE, 1, SootopolisCity_EventScript_SetBattleSpectators + call_if_eq VAR_SOOTOPOLIS_CITY_STATE, 2, SootopolisCity_EventScript_SetBattleSpectators + call_if_eq VAR_SOOTOPOLIS_CITY_STATE, 3, SootopolisCity_EventScript_SetBattleSpectators + call_if_eq VAR_SOOTOPOLIS_CITY_STATE, 4, SootopolisCity_EventScript_SetBattleSpectators + call_if_eq VAR_SOOTOPOLIS_CITY_STATE, 5, SootopolisCity_EventScript_SetBattleSpectators + call_if_eq VAR_SOOTOPOLIS_CITY_STATE, 2, SootopolisCity_EventScript_CheckSetEnterCaveOfOriginObjPos + call_if_eq VAR_SOOTOPOLIS_CITY_STATE, 3, SootopolisCity_EventScript_CheckSetEnterCaveOfOriginObjPos + call_if_eq VAR_SOOTOPOLIS_CITY_STATE, 4, SootopolisCity_EventScript_SetExitCaveOfOriginObjPos + call_if_eq VAR_SOOTOPOLIS_CITY_STATE, 5, SootopolisCity_EventScript_SetOutsideGymObjPos + call_if_eq VAR_SOOTOPOLIS_CITY_STATE, 6, SootopolisCity_EventScript_SetExpertBlockCaveEntrance end SootopolisCity_EventScript_HideMapNamePopup:: @@ -95,20 +83,13 @@ SootopolisCity_EventScript_SetBattleSpectators:: return SootopolisCity_EventScript_SetLayout:: - compare VAR_SOOTOPOLIS_CITY_STATE, 0 - goto_if_eq SootopolisCity_EventScript_SetNormalLayout - compare VAR_SOOTOPOLIS_CITY_STATE, 6 - goto_if_ge SootopolisCity_EventScript_SetNormalLayout - compare VAR_SOOTOPOLIS_CITY_STATE, 1 - goto_if_eq SootopolisCity_EventScript_SetLegendariesLayout - compare VAR_SOOTOPOLIS_CITY_STATE, 2 - goto_if_eq SootopolisCity_EventScript_SetLegendariesLayout - compare VAR_SOOTOPOLIS_CITY_STATE, 3 - goto_if_eq SootopolisCity_EventScript_SetLegendariesLayout - compare VAR_SOOTOPOLIS_CITY_STATE, 4 - goto_if_eq SootopolisCity_EventScript_SetLegendariesLayout - compare VAR_SKY_PILLAR_STATE, 1 - goto_if_le SootopolisCity_EventScript_SetLegendariesLayout + goto_if_eq VAR_SOOTOPOLIS_CITY_STATE, 0, SootopolisCity_EventScript_SetNormalLayout + goto_if_ge VAR_SOOTOPOLIS_CITY_STATE, 6, SootopolisCity_EventScript_SetNormalLayout + goto_if_eq VAR_SOOTOPOLIS_CITY_STATE, 1, SootopolisCity_EventScript_SetLegendariesLayout + goto_if_eq VAR_SOOTOPOLIS_CITY_STATE, 2, SootopolisCity_EventScript_SetLegendariesLayout + goto_if_eq VAR_SOOTOPOLIS_CITY_STATE, 3, SootopolisCity_EventScript_SetLegendariesLayout + goto_if_eq VAR_SOOTOPOLIS_CITY_STATE, 4, SootopolisCity_EventScript_SetLegendariesLayout + goto_if_le VAR_SKY_PILLAR_STATE, 1, SootopolisCity_EventScript_SetLegendariesLayout return SootopolisCity_EventScript_SetNormalLayout:: @@ -119,16 +100,11 @@ SootopolisCity_EventScript_SetLegendariesLayout:: return SootopolisCity_EventScript_SetWeather:: - compare VAR_SOOTOPOLIS_CITY_STATE, 0 - goto_if_eq SootopolisCity_EventScript_SetNormalWeather - compare VAR_SOOTOPOLIS_CITY_STATE, 6 - goto_if_ge SootopolisCity_EventScript_SetNormalWeather - compare VAR_SOOTOPOLIS_CITY_STATE, 1 - goto_if_eq SootopolisCity_EventScript_SetDownpour - compare VAR_SKY_PILLAR_STATE, 1 - goto_if_eq SootopolisCity_EventScript_SetDownpour - compare VAR_SKY_PILLAR_STATE, 1 - goto_if_le Common_EventScript_SetAbnormalWeather + goto_if_eq VAR_SOOTOPOLIS_CITY_STATE, 0, SootopolisCity_EventScript_SetNormalWeather + goto_if_ge VAR_SOOTOPOLIS_CITY_STATE, 6, SootopolisCity_EventScript_SetNormalWeather + goto_if_eq VAR_SOOTOPOLIS_CITY_STATE, 1, SootopolisCity_EventScript_SetDownpour + goto_if_eq VAR_SKY_PILLAR_STATE, 1, SootopolisCity_EventScript_SetDownpour + goto_if_le VAR_SKY_PILLAR_STATE, 1, Common_EventScript_SetAbnormalWeather return SootopolisCity_EventScript_SetNormalWeather:: @@ -158,12 +134,9 @@ SootopolisCity_EventScript_SetOutsideGymObjPos:: setobjectxyperm LOCALID_STEVEN, 29, 33 setobjectxyperm LOCALID_MAXIE, 33, 35 setobjectxyperm LOCALID_ARCHIE, 34, 35 - compare VAR_SOOTOPOLIS_WALLACE_STATE, 0 - call_if_eq SootopolisCity_EventScript_SetWallaceMiddle - compare VAR_SOOTOPOLIS_WALLACE_STATE, 1 - call_if_eq SootopolisCity_EventScript_SetWallaceRight - compare VAR_SOOTOPOLIS_WALLACE_STATE, 2 - call_if_eq SootopolisCity_EventScript_SetWallaceLeft + call_if_eq VAR_SOOTOPOLIS_WALLACE_STATE, 0, SootopolisCity_EventScript_SetWallaceMiddle + call_if_eq VAR_SOOTOPOLIS_WALLACE_STATE, 1, SootopolisCity_EventScript_SetWallaceRight + call_if_eq VAR_SOOTOPOLIS_WALLACE_STATE, 2, SootopolisCity_EventScript_SetWallaceLeft return SootopolisCity_EventScript_SetWallaceMiddle:: @@ -190,10 +163,8 @@ SootopolisCity_OnWarp: .2byte 0 SootopolisCity_EventScript_PlayerFaceLegendaries:: - compare VAR_SKY_PILLAR_STATE, 1 - call_if_eq SootopolisCity_EventScript_PlayerFaceLegendaries1 - compare VAR_SKY_PILLAR_STATE, 2 - call_if_eq SootopolisCity_EventScript_PlayerFaceLegendaries2 + call_if_eq VAR_SKY_PILLAR_STATE, 1, SootopolisCity_EventScript_PlayerFaceLegendaries1 + call_if_eq VAR_SKY_PILLAR_STATE, 2, SootopolisCity_EventScript_PlayerFaceLegendaries2 end SootopolisCity_EventScript_PlayerFaceLegendaries1:: @@ -206,7 +177,7 @@ SootopolisCity_EventScript_PlayerFaceLegendaries2:: return SootopolisCity_OnResume: - setdivewarp MAP_UNDERWATER_SOOTOPOLIS_CITY, 255, 9, 6 + setdivewarp MAP_UNDERWATER_SOOTOPOLIS_CITY, 9, 6 end SootopolisCity_OnFrame: @@ -218,10 +189,8 @@ SootopolisCity_OnFrame: SootopolisCity_EventScript_StartLegendariesScene:: lockall special StorePlayerCoordsInVars - compare VAR_0x8004, 43 - goto_if_ne SootopolisCity_EventScript_LegendariesSceneFromDive - compare VAR_0x8005, 32 - goto_if_ne SootopolisCity_EventScript_LegendariesSceneFromDive + goto_if_ne VAR_0x8004, 43, SootopolisCity_EventScript_LegendariesSceneFromDive + goto_if_ne VAR_0x8005, 32, SootopolisCity_EventScript_LegendariesSceneFromDive goto SootopolisCity_EventScript_LegendariesSceneFromPokeCenter end @@ -509,10 +478,8 @@ SootopolisCity_Movement_GroudonIdle: SootopolisCity_EventScript_StartRayquazaScene:: lockall special StorePlayerCoordsInVars - compare VAR_0x8004, 43 - goto_if_ne SootopolisCity_EventScript_RayquazaSceneFromDive - compare VAR_0x8005, 32 - goto_if_ne SootopolisCity_EventScript_RayquazaSceneFromDive + goto_if_ne VAR_0x8004, 43, SootopolisCity_EventScript_RayquazaSceneFromDive + goto_if_ne VAR_0x8005, 32, SootopolisCity_EventScript_RayquazaSceneFromDive goto SootopolisCity_EventScript_RayquazaSceneFromPokeCenter end @@ -565,7 +532,7 @@ SootopolisCity_EventScript_RayquazaSceneFromPokeCenter:: fadenewbgm MUS_SOOTOPOLIS delay 120 clearflag FLAG_HIDE_MAP_NAME_POPUP - warpsootopolislegend MAP_SOOTOPOLIS_CITY, 255, 43, 32 + warpwhitefade MAP_SOOTOPOLIS_CITY, 43, 32 waitstate end @@ -618,35 +585,35 @@ SootopolisCity_EventScript_RayquazaSceneFromDive:: fadenewbgm MUS_SURF delay 120 clearflag FLAG_HIDE_MAP_NAME_POPUP - warpsootopolislegend MAP_SOOTOPOLIS_CITY, 255, 29, 53 + warpwhitefade MAP_SOOTOPOLIS_CITY, 29, 53 waitstate end SootopolisCity_EventScript_SetRoughWater:: - setmetatile 27, 43, METATILE_Sootopolis_RoughWater, 0 - setmetatile 28, 43, METATILE_Sootopolis_RoughWater, 0 - setmetatile 29, 43, METATILE_Sootopolis_RoughWater, 0 - setmetatile 30, 43, METATILE_Sootopolis_RoughWater, 0 - setmetatile 27, 44, METATILE_Sootopolis_RoughWater, 0 - setmetatile 28, 44, METATILE_Sootopolis_RoughWater, 0 - setmetatile 29, 44, METATILE_Sootopolis_RoughWater, 0 - setmetatile 30, 44, METATILE_Sootopolis_RoughWater, 0 - setmetatile 27, 45, METATILE_Sootopolis_RoughWater, 0 - setmetatile 28, 45, METATILE_Sootopolis_RoughWater, 0 - setmetatile 29, 45, METATILE_Sootopolis_RoughWater, 0 - setmetatile 30, 45, METATILE_Sootopolis_RoughWater, 0 - setmetatile 32, 43, METATILE_Sootopolis_RoughWater, 0 - setmetatile 33, 43, METATILE_Sootopolis_RoughWater, 0 - setmetatile 34, 43, METATILE_Sootopolis_RoughWater, 0 - setmetatile 35, 43, METATILE_Sootopolis_RoughWater, 0 - setmetatile 32, 44, METATILE_Sootopolis_RoughWater, 0 - setmetatile 33, 44, METATILE_Sootopolis_RoughWater, 0 - setmetatile 34, 44, METATILE_Sootopolis_RoughWater, 0 - setmetatile 35, 44, METATILE_Sootopolis_RoughWater, 0 - setmetatile 32, 45, METATILE_Sootopolis_RoughWater, 0 - setmetatile 33, 45, METATILE_Sootopolis_RoughWater, 0 - setmetatile 34, 45, METATILE_Sootopolis_RoughWater, 0 - setmetatile 35, 45, METATILE_Sootopolis_RoughWater, 0 + setmetatile 27, 43, METATILE_Sootopolis_RoughWater, FALSE + setmetatile 28, 43, METATILE_Sootopolis_RoughWater, FALSE + setmetatile 29, 43, METATILE_Sootopolis_RoughWater, FALSE + setmetatile 30, 43, METATILE_Sootopolis_RoughWater, FALSE + setmetatile 27, 44, METATILE_Sootopolis_RoughWater, FALSE + setmetatile 28, 44, METATILE_Sootopolis_RoughWater, FALSE + setmetatile 29, 44, METATILE_Sootopolis_RoughWater, FALSE + setmetatile 30, 44, METATILE_Sootopolis_RoughWater, FALSE + setmetatile 27, 45, METATILE_Sootopolis_RoughWater, FALSE + setmetatile 28, 45, METATILE_Sootopolis_RoughWater, FALSE + setmetatile 29, 45, METATILE_Sootopolis_RoughWater, FALSE + setmetatile 30, 45, METATILE_Sootopolis_RoughWater, FALSE + setmetatile 32, 43, METATILE_Sootopolis_RoughWater, FALSE + setmetatile 33, 43, METATILE_Sootopolis_RoughWater, FALSE + setmetatile 34, 43, METATILE_Sootopolis_RoughWater, FALSE + setmetatile 35, 43, METATILE_Sootopolis_RoughWater, FALSE + setmetatile 32, 44, METATILE_Sootopolis_RoughWater, FALSE + setmetatile 33, 44, METATILE_Sootopolis_RoughWater, FALSE + setmetatile 34, 44, METATILE_Sootopolis_RoughWater, FALSE + setmetatile 35, 44, METATILE_Sootopolis_RoughWater, FALSE + setmetatile 32, 45, METATILE_Sootopolis_RoughWater, FALSE + setmetatile 33, 45, METATILE_Sootopolis_RoughWater, FALSE + setmetatile 34, 45, METATILE_Sootopolis_RoughWater, FALSE + setmetatile 35, 45, METATILE_Sootopolis_RoughWater, FALSE return SootopolisCity_Movement_RayquazaFlyOff: @@ -717,12 +684,9 @@ SootopolisCity_Movement_UnusedPanBack: SootopolisCity_EventScript_CaveOfOriginExpert:: lock faceplayer - compare VAR_SOOTOPOLIS_CITY_STATE, 6 - goto_if_ge SootopolisCity_EventScript_ExpertPostLegendaries - compare VAR_SOOTOPOLIS_CITY_STATE, 5 - goto_if_eq SootopolisCity_EventScript_ExpertLegendaries - compare VAR_SOOTOPOLIS_CITY_STATE, 2 - goto_if_ge SootopolisCity_EventScript_ExpertLeadToCave + goto_if_ge VAR_SOOTOPOLIS_CITY_STATE, 6, SootopolisCity_EventScript_ExpertPostLegendaries + goto_if_eq VAR_SOOTOPOLIS_CITY_STATE, 5, SootopolisCity_EventScript_ExpertLegendaries + goto_if_ge VAR_SOOTOPOLIS_CITY_STATE, 2, SootopolisCity_EventScript_ExpertLeadToCave msgbox SootopolisCity_Text_CaveOfOriginPleaseLeave, MSGBOX_DEFAULT release end @@ -745,12 +709,9 @@ SootopolisCity_EventScript_ExpertLegendaries:: SootopolisCity_EventScript_Kiri:: lock faceplayer - compare VAR_SOOTOPOLIS_CITY_STATE, 1 - goto_if_le SootopolisCity_EventScript_KiriGiveBerry - compare VAR_SOOTOPOLIS_CITY_STATE, 6 - goto_if_ge SootopolisCity_EventScript_KiriGiveBerry - compare VAR_SOOTOPOLIS_CITY_STATE, 5 - goto_if_eq SootopolisCity_EventScript_KiriRayquaza + goto_if_le VAR_SOOTOPOLIS_CITY_STATE, 1, SootopolisCity_EventScript_KiriGiveBerry + goto_if_ge VAR_SOOTOPOLIS_CITY_STATE, 6, SootopolisCity_EventScript_KiriGiveBerry + goto_if_eq VAR_SOOTOPOLIS_CITY_STATE, 5, SootopolisCity_EventScript_KiriRayquaza msgbox SootopolisCity_Text_BigPokemonFighting, MSGBOX_DEFAULT closemessage applymovement LOCALID_KIRI, Common_Movement_FaceOriginalDirection @@ -774,37 +735,31 @@ SootopolisCity_EventScript_KiriGiveBerry:: addvar VAR_RESULT, NUM_KIRI_BERRIES_SKIPPED addvar VAR_RESULT, FIRST_BERRY_INDEX giveitem VAR_RESULT - compare VAR_RESULT, FALSE - goto_if_eq Common_EventScript_ShowBagIsFull + goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull setflag FLAG_DAILY_SOOTOPOLIS_RECEIVED_BERRY msgbox SootopolisCity_Text_GiveYouThisBerryToo, MSGBOX_DEFAULT random 2 - compare VAR_RESULT, 0 - goto_if_eq SootopolisCity_EventScript_GiveFigyBerry - compare VAR_RESULT, 1 - goto_if_eq SootopolisCity_EventScript_GiveIapapaBerry + goto_if_eq VAR_RESULT, 0, SootopolisCity_EventScript_GiveFigyBerry + goto_if_eq VAR_RESULT, 1, SootopolisCity_EventScript_GiveIapapaBerry end SootopolisCity_EventScript_GiveFigyBerry:: giveitem ITEM_FIGY_BERRY - compare VAR_RESULT, FALSE - goto_if_eq Common_EventScript_ShowBagIsFull + goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull msgbox SootopolisCity_Text_WhatKindOfWishInYourName, MSGBOX_DEFAULT release end SootopolisCity_EventScript_GiveIapapaBerry:: giveitem ITEM_IAPAPA_BERRY - compare VAR_RESULT, FALSE - goto_if_eq Common_EventScript_ShowBagIsFull + goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull msgbox SootopolisCity_Text_WhatKindOfWishInYourName, MSGBOX_DEFAULT release end SootopolisCity_EventScript_KiriReceivedBerry:: msgbox SootopolisCity_Text_LikeSeasonBornIn, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq SootopolisCity_EventScript_KiriLikeSeasonBornIn + goto_if_eq VAR_RESULT, YES, SootopolisCity_EventScript_KiriLikeSeasonBornIn msgbox SootopolisCity_Text_OhDoesntMatter, MSGBOX_DEFAULT release end @@ -818,8 +773,7 @@ SootopolisCity_EventScript_Woman2:: lockall applymovement LOCALID_WOMAN_2, Common_Movement_FacePlayer waitmovement 0 - compare VAR_SOOTOPOLIS_CITY_STATE, 5 - goto_if_eq SootopolisCity_EventScript_Woman2Rayquaza + goto_if_eq VAR_SOOTOPOLIS_CITY_STATE, 5, SootopolisCity_EventScript_Woman2Rayquaza msgbox SootopolisCity_Text_WeatherWentWild, MSGBOX_DEFAULT closemessage applymovement LOCALID_WOMAN_2, Common_Movement_FaceOriginalDirection @@ -835,8 +789,7 @@ SootopolisCity_EventScript_Woman2Rayquaza:: SootopolisCity_EventScript_Man:: lock faceplayer - compare VAR_SOOTOPOLIS_CITY_STATE, 6 - goto_if_ge SootopolisCity_EventScript_ManPostLegendaries + goto_if_ge VAR_SOOTOPOLIS_CITY_STATE, 6, SootopolisCity_EventScript_ManPostLegendaries msgbox SootopolisCity_Text_NoOrdinaryTourist, MSGBOX_DEFAULT release end @@ -849,12 +802,9 @@ SootopolisCity_EventScript_ManPostLegendaries:: SootopolisCity_EventScript_Woman1:: lock faceplayer - compare VAR_SOOTOPOLIS_CITY_STATE, 6 - goto_if_ge SootopolisCity_EventScript_Woman1PostLegendaries - compare VAR_SOOTOPOLIS_CITY_STATE, 5 - goto_if_eq SootopolisCity_EventScript_Woman1Rayquaza - compare VAR_SOOTOPOLIS_CITY_STATE, 2 - goto_if_ge SootopolisCity_EventScript_Woman1Legendaries + goto_if_ge VAR_SOOTOPOLIS_CITY_STATE, 6, SootopolisCity_EventScript_Woman1PostLegendaries + goto_if_eq VAR_SOOTOPOLIS_CITY_STATE, 5, SootopolisCity_EventScript_Woman1Rayquaza + goto_if_ge VAR_SOOTOPOLIS_CITY_STATE, 2, SootopolisCity_EventScript_Woman1Legendaries msgbox SootopolisCity_Text_SootopolisSkyBeautiful, MSGBOX_DEFAULT release end @@ -881,12 +831,9 @@ SootopolisCity_EventScript_NinjaBoy:: lockall applymovement LOCALID_NINJA_BOY, Common_Movement_FacePlayer waitmovement 0 - compare VAR_SOOTOPOLIS_CITY_STATE, 5 - goto_if_eq SootopolisCity_EventScript_NinjaBoyRayquaza - compare VAR_SOOTOPOLIS_CITY_STATE, 6 - goto_if_ge SootopolisCity_EventScript_NinjaBoyNormal - compare VAR_SOOTOPOLIS_CITY_STATE, 1 - goto_if_le SootopolisCity_EventScript_NinjaBoyNormal + goto_if_eq VAR_SOOTOPOLIS_CITY_STATE, 5, SootopolisCity_EventScript_NinjaBoyRayquaza + goto_if_ge VAR_SOOTOPOLIS_CITY_STATE, 6, SootopolisCity_EventScript_NinjaBoyNormal + goto_if_le VAR_SOOTOPOLIS_CITY_STATE, 1, SootopolisCity_EventScript_NinjaBoyNormal msgbox SootopolisCity_Text_ThisIsWicked, MSGBOX_DEFAULT closemessage applymovement LOCALID_NINJA_BOY, Common_Movement_FaceOriginalDirection @@ -908,13 +855,10 @@ SootopolisCity_EventScript_Boy1:: lockall applymovement LOCALID_BOY_1, Common_Movement_FacePlayer waitmovement 0 - compare VAR_SOOTOPOLIS_CITY_STATE, 5 - goto_if_eq SootopolisCity_EventScript_Boy1Rayquaza + goto_if_eq VAR_SOOTOPOLIS_CITY_STATE, 5, SootopolisCity_EventScript_Boy1Rayquaza goto_if_set FLAG_SYS_GAME_CLEAR, SootopolisCity_EventScript_Boy1GameClear - compare VAR_SOOTOPOLIS_CITY_STATE, 6 - goto_if_ge SootopolisCity_EventScript_Boy1Normal - compare VAR_SOOTOPOLIS_CITY_STATE, 1 - goto_if_le SootopolisCity_EventScript_Boy1Normal + goto_if_ge VAR_SOOTOPOLIS_CITY_STATE, 6, SootopolisCity_EventScript_Boy1Normal + goto_if_le VAR_SOOTOPOLIS_CITY_STATE, 1, SootopolisCity_EventScript_Boy1Normal msgbox SootopolisCity_Text_GiantPokemonSuddenlyAppeared, MSGBOX_DEFAULT closemessage applymovement LOCALID_BOY_1, Common_Movement_FaceOriginalDirection @@ -954,12 +898,9 @@ SootopolisCity_EventScript_Steven:: applymovement LOCALID_STEVEN, Common_Movement_FacePlayer waitmovement 0 call_if_unset FLAG_STEVEN_GUIDES_TO_CAVE_OF_ORIGIN, SootopolisCity_EventScript_StevenLeadPlayerCaveOfOrigin - compare VAR_SOOTOPOLIS_CITY_STATE, 2 - goto_if_eq SootopolisCity_EventScript_StevenHelpWallace - compare VAR_SOOTOPOLIS_CITY_STATE, 3 - goto_if_eq SootopolisCity_EventScript_StevenHelpedWallace - compare VAR_SOOTOPOLIS_CITY_STATE, 4 - goto_if_eq SootopolisCity_EventScript_StevenHelpedWallace + goto_if_eq VAR_SOOTOPOLIS_CITY_STATE, 2, SootopolisCity_EventScript_StevenHelpWallace + goto_if_eq VAR_SOOTOPOLIS_CITY_STATE, 3, SootopolisCity_EventScript_StevenHelpedWallace + goto_if_eq VAR_SOOTOPOLIS_CITY_STATE, 4, SootopolisCity_EventScript_StevenHelpedWallace goto_if_set FLAG_SOOTOPOLIS_ARCHIE_MAXIE_LEAVE, SootopolisCity_EventScript_StevenMaxieArchieLeft msgbox SootopolisCity_Text_SoThatsRayquaza, MSGBOX_DEFAULT releaseall @@ -983,10 +924,8 @@ SootopolisCity_EventScript_StevenHelpedWallace:: SootopolisCity_EventScript_StevenLeadPlayerCaveOfOrigin:: msgbox SootopolisCity_Text_InvolvedWithCrisisComeWithMe, MSGBOX_DEFAULT closemessage - compare VAR_FACING, DIR_WEST - call_if_eq SootopolisCity_EventScript_StartWalkToCaveOfOriginWest - compare VAR_FACING, DIR_NORTH - call_if_eq SootopolisCity_EventScript_StartWalkToCaveOfOriginNorth + call_if_eq VAR_FACING, DIR_WEST, SootopolisCity_EventScript_StartWalkToCaveOfOriginWest + call_if_eq VAR_FACING, DIR_NORTH, SootopolisCity_EventScript_StartWalkToCaveOfOriginNorth msgbox SootopolisCity_Text_DoesThisMakeYourFearPokemon, MSGBOX_DEFAULT closemessage applymovement LOCALID_STEVEN, SootopolisCity_Movement_StevenWalkToCaveOfOrigin @@ -1003,7 +942,7 @@ SootopolisCity_EventScript_StevenLeadPlayerCaveOfOrigin:: setflag FLAG_STEVEN_GUIDES_TO_CAVE_OF_ORIGIN applymovement OBJ_EVENT_ID_PLAYER, SootopolisCity_Movement_PlayerEnterCaveOfOrigin waitmovement 0 - warp MAP_CAVE_OF_ORIGIN_ENTRANCE, 255, 9, 20 + warp MAP_CAVE_OF_ORIGIN_ENTRANCE, 9, 20 waitstate end @@ -1287,8 +1226,7 @@ SootopolisCity_EventScript_Boy2:: lockall applymovement LOCALID_BOY_2, Common_Movement_FacePlayer waitmovement 0 - compare VAR_SOOTOPOLIS_CITY_STATE, 5 - goto_if_eq SootopolisCity_EventScript_Boy2Rayquaza + goto_if_eq VAR_SOOTOPOLIS_CITY_STATE, 5, SootopolisCity_EventScript_Boy2Rayquaza msgbox SootopolisCity_Text_TwoPokemonArentAngry, MSGBOX_DEFAULT closemessage applymovement LOCALID_BOY_2, Common_Movement_FaceOriginalDirection @@ -1304,8 +1242,7 @@ SootopolisCity_EventScript_Boy2Rayquaza:: SootopolisCity_EventScript_BlackBelt:: lockall - compare VAR_SOOTOPOLIS_CITY_STATE, 5 - goto_if_eq SootopolisCity_EventScript_BlackBeltRayquaza + goto_if_eq VAR_SOOTOPOLIS_CITY_STATE, 5, SootopolisCity_EventScript_BlackBeltRayquaza msgbox SootopolisCity_Text_GoRedAndBlueMon, MSGBOX_DEFAULT closemessage applymovement LOCALID_BLACK_BELT, Common_Movement_FacePlayer @@ -1328,8 +1265,7 @@ SootopolisCity_EventScript_Girl:: lockall applymovement LOCALID_GIRL, Common_Movement_FacePlayer waitmovement 0 - compare VAR_SOOTOPOLIS_CITY_STATE, 5 - goto_if_eq SootopolisCity_EventScript_GirlRayquaza + goto_if_eq VAR_SOOTOPOLIS_CITY_STATE, 5, SootopolisCity_EventScript_GirlRayquaza msgbox SootopolisCity_Text_SootopolisWillBeWrecked, MSGBOX_DEFAULT closemessage applymovement LOCALID_GIRL, Common_Movement_FaceOriginalDirection @@ -1347,8 +1283,7 @@ SootopolisCity_EventScript_Maniac:: lockall applymovement LOCALID_MANIAC, Common_Movement_FacePlayer waitmovement 0 - compare VAR_SOOTOPOLIS_CITY_STATE, 5 - goto_if_eq SootopolisCity_EventScript_ManiacRayquaza + goto_if_eq VAR_SOOTOPOLIS_CITY_STATE, 5, SootopolisCity_EventScript_ManiacRayquaza msgbox SootopolisCity_Text_SeeingLegendWithOwnEyes, MSGBOX_DEFAULT closemessage applymovement LOCALID_MANIAC, Common_Movement_FaceOriginalDirection @@ -1364,8 +1299,7 @@ SootopolisCity_EventScript_ManiacRayquaza:: SootopolisCity_EventScript_Wallace:: lock faceplayer - compare VAR_SOOTOPOLIS_CITY_STATE, 4 - goto_if_eq SootopolisCity_EventScript_GoToSkyPillar + goto_if_eq VAR_SOOTOPOLIS_CITY_STATE, 4, SootopolisCity_EventScript_GoToSkyPillar goto_if_set FLAG_RECEIVED_HM07, SootopolisCity_EventScript_GoToGym goto_if_set FLAG_SOOTOPOLIS_ARCHIE_MAXIE_LEAVE, SootopolisCity_EventScript_GiveWaterfall msgbox SootopolisCity_Text_AquaMagmaDidntMeanHarm, MSGBOX_DEFAULT @@ -1378,12 +1312,9 @@ SootopolisCity_EventScript_GiveWaterfall:: setflag FLAG_RECEIVED_HM07 msgbox SootopolisCity_Text_ExplainWaterfallGoToGym, MSGBOX_DEFAULT closemessage - compare VAR_FACING, DIR_NORTH - call_if_eq SootopolisCity_EventScript_WallaceMoveFromGym - compare VAR_FACING, DIR_EAST - call_if_eq SootopolisCity_EventScript_WallaceMoveFromGym - compare VAR_FACING, DIR_WEST - call_if_eq SootopolisCity_EventScript_WallaceMoveFromGymWest + call_if_eq VAR_FACING, DIR_NORTH, SootopolisCity_EventScript_WallaceMoveFromGym + call_if_eq VAR_FACING, DIR_EAST, SootopolisCity_EventScript_WallaceMoveFromGym + call_if_eq VAR_FACING, DIR_WEST, SootopolisCity_EventScript_WallaceMoveFromGymWest release end @@ -1423,8 +1354,7 @@ SootopolisCity_Movement_WallaceMoveFromGymWest: SootopolisCity_EventScript_Maxie:: lockall - compare VAR_SOOTOPOLIS_CITY_STATE, 5 - goto_if_eq SootopolisCity_EventScript_MaxieRayquaza + goto_if_eq VAR_SOOTOPOLIS_CITY_STATE, 5, SootopolisCity_EventScript_MaxieRayquaza msgbox SootopolisCity_Text_GroudonPleaseStop, MSGBOX_DEFAULT closemessage releaseall @@ -1439,8 +1369,7 @@ SootopolisCity_EventScript_MaxieRayquaza:: SootopolisCity_EventScript_Archie:: lockall - compare VAR_SOOTOPOLIS_CITY_STATE, 5 - goto_if_eq SootopolisCity_EventScript_ArchieRayquaza + goto_if_eq VAR_SOOTOPOLIS_CITY_STATE, 5, SootopolisCity_EventScript_ArchieRayquaza msgbox SootopolisCity_Text_KyogreCalmDown, MSGBOX_DEFAULT closemessage releaseall @@ -1460,7 +1389,7 @@ SootopolisCity_EventScript_MaxieArchieLeave:: clearflag FLAG_HIDE_MT_PYRE_SUMMIT_MAXIE clearflag FLAG_HIDE_MT_PYRE_SUMMIT_ARCHIE setvar VAR_MT_PYRE_STATE, 2 - warpsilent MAP_SOOTOPOLIS_CITY, 255, 31, 34 + warpsilent MAP_SOOTOPOLIS_CITY, 31, 34 waitstate releaseall end diff --git a/data/maps/SootopolisCity_Gym_1F/scripts.inc b/data/maps/SootopolisCity_Gym_1F/scripts.inc index b20cf788872f..7f739935b133 100644 --- a/data/maps/SootopolisCity_Gym_1F/scripts.inc +++ b/data/maps/SootopolisCity_Gym_1F/scripts.inc @@ -19,20 +19,17 @@ SootopolisCity_Gym_1F_OnLoad: end SootopolisCity_Gym_1F_EventScript_CheckSetStairMetatiles:: - compare VAR_ICE_STEP_COUNT, 8 - goto_if_lt SootopolisCity_Gym_1F_EventScript_StopCheckingStairs @ All stairs ice - compare VAR_ICE_STEP_COUNT, 28 - goto_if_lt SootopolisCity_Gym_1F_EventScript_OpenFirstStairs - compare VAR_ICE_STEP_COUNT, 67 - goto_if_lt SootopolisCity_Gym_1F_EventScript_OpenFirstAndSecondStairs - setmetatile 8, 4, METATILE_SootopolisGym_Stairs, 0 - setmetatile 8, 5, METATILE_SootopolisGym_Stairs, 0 + goto_if_lt VAR_ICE_STEP_COUNT, 8, SootopolisCity_Gym_1F_EventScript_StopCheckingStairs @ All stairs ice + goto_if_lt VAR_ICE_STEP_COUNT, 28, SootopolisCity_Gym_1F_EventScript_OpenFirstStairs + goto_if_lt VAR_ICE_STEP_COUNT, 67, SootopolisCity_Gym_1F_EventScript_OpenFirstAndSecondStairs + setmetatile 8, 4, METATILE_SootopolisGym_Stairs, FALSE + setmetatile 8, 5, METATILE_SootopolisGym_Stairs, FALSE SootopolisCity_Gym_1F_EventScript_OpenFirstAndSecondStairs:: - setmetatile 8, 10, METATILE_SootopolisGym_Stairs, 0 - setmetatile 8, 11, METATILE_SootopolisGym_Stairs, 0 + setmetatile 8, 10, METATILE_SootopolisGym_Stairs, FALSE + setmetatile 8, 11, METATILE_SootopolisGym_Stairs, FALSE SootopolisCity_Gym_1F_EventScript_OpenFirstStairs:: - setmetatile 8, 15, METATILE_SootopolisGym_Stairs, 0 - setmetatile 8, 16, METATILE_SootopolisGym_Stairs, 0 + setmetatile 8, 15, METATILE_SootopolisGym_Stairs, FALSE + setmetatile 8, 16, METATILE_SootopolisGym_Stairs, FALSE SootopolisCity_Gym_1F_EventScript_StopCheckingStairs:: return @@ -85,8 +82,7 @@ SootopolisCity_Gym_1F_Movement_FallThroughIce: SootopolisCity_Gym_1F_EventScript_Juan:: trainerbattle_single TRAINER_JUAN_1, SootopolisCity_Gym_1F_Text_JuanIntro, SootopolisCity_Gym_1F_Text_JuanDefeat, SootopolisCity_Gym_1F_EventScript_JuanDefeated, NO_MUSIC specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq SootopolisCity_Gym_1F_EventScript_JuanRematch + goto_if_eq VAR_RESULT, TRUE, SootopolisCity_Gym_1F_EventScript_JuanRematch goto_if_unset FLAG_RECEIVED_TM03, SootopolisCity_Gym_1F_EventScript_GiveWaterPulse2 goto_if_unset FLAG_BADGE06_GET, SootopolisCity_Gym_1F_EventScript_GoGetFortreeBadge msgbox SootopolisCity_Gym_1F_Text_JuanPostBattle, MSGBOX_DEFAULT @@ -121,16 +117,14 @@ SootopolisCity_Gym_1F_EventScript_JuanDefeated:: SootopolisCity_Gym_1F_EventScript_GiveWaterPulse:: giveitem ITEM_TM03 - compare VAR_RESULT, FALSE - goto_if_eq Common_EventScript_BagIsFull + goto_if_eq VAR_RESULT, FALSE, Common_EventScript_BagIsFull msgbox SootopolisCity_Gym_1F_Text_ExplainWaterPulse, MSGBOX_DEFAULT setflag FLAG_RECEIVED_TM03 return SootopolisCity_Gym_1F_EventScript_GiveWaterPulse2:: giveitem ITEM_TM03 - compare VAR_RESULT, FALSE - goto_if_eq Common_EventScript_ShowBagIsFull + goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull msgbox SootopolisCity_Gym_1F_Text_ExplainWaterPulse, MSGBOX_DEFAULT setflag FLAG_RECEIVED_TM03 release diff --git a/data/maps/SootopolisCity_House1/scripts.inc b/data/maps/SootopolisCity_House1/scripts.inc index 65df8587f380..40f22a9c1f3f 100644 --- a/data/maps/SootopolisCity_House1/scripts.inc +++ b/data/maps/SootopolisCity_House1/scripts.inc @@ -7,8 +7,7 @@ SootopolisCity_House1_EventScript_BrickBreakBlackBelt:: goto_if_set FLAG_RECEIVED_TM31, SootopolisCity_House1_EventScript_ReceivedBrickBreak msgbox SootopolisCity_House1_Text_DevelopedThisTM, MSGBOX_DEFAULT giveitem ITEM_TM31 - compare VAR_RESULT, FALSE - goto_if_eq Common_EventScript_ShowBagIsFull + goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull setflag FLAG_RECEIVED_TM31 msgbox SootopolisCity_House1_Text_ExplainBrickBreak, MSGBOX_DEFAULT release diff --git a/data/maps/SootopolisCity_House2/scripts.inc b/data/maps/SootopolisCity_House2/scripts.inc index a9c2ed255db4..68cf96a9064f 100644 --- a/data/maps/SootopolisCity_House2/scripts.inc +++ b/data/maps/SootopolisCity_House2/scripts.inc @@ -5,10 +5,8 @@ SootopolisCity_House2_EventScript_ExpertF:: lock faceplayer msgbox SootopolisCity_House2_Text_DidYouKnowAboutMtPyreOrbs, MSGBOX_YESNO - compare VAR_RESULT, YES - call_if_eq SootopolisCity_House2_EventScript_KnowAboutOrbs - compare VAR_RESULT, NO - call_if_eq SootopolisCity_House2_EventScript_DontKnowAboutOrbs + call_if_eq VAR_RESULT, YES, SootopolisCity_House2_EventScript_KnowAboutOrbs + call_if_eq VAR_RESULT, NO, SootopolisCity_House2_EventScript_DontKnowAboutOrbs release end diff --git a/data/maps/SootopolisCity_House3/scripts.inc b/data/maps/SootopolisCity_House3/scripts.inc index 02546968b556..621738c4f103 100644 --- a/data/maps/SootopolisCity_House3/scripts.inc +++ b/data/maps/SootopolisCity_House3/scripts.inc @@ -5,8 +5,7 @@ SootopolisCity_House3_EventScript_Woman:: lock faceplayer msgbox SootopolisCity_House3_Text_JuanHasManyFansDoYou, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq SootopolisCity_House3_EventScript_HaveFans + goto_if_eq VAR_RESULT, YES, SootopolisCity_House3_EventScript_HaveFans msgbox SootopolisCity_House3_Text_LonesomeTryWorkingHarder, MSGBOX_DEFAULT release end diff --git a/data/maps/SootopolisCity_House6/scripts.inc b/data/maps/SootopolisCity_House6/scripts.inc index be2dad11f26e..35f7acc7b50e 100644 --- a/data/maps/SootopolisCity_House6/scripts.inc +++ b/data/maps/SootopolisCity_House6/scripts.inc @@ -6,12 +6,10 @@ SootopolisCity_House6_EventScript_Woman:: faceplayer goto_if_set FLAG_RECEIVED_WAILMER_DOLL, SootopolisCity_House6_EventScript_ReceivedWailmerDoll msgbox SootopolisCity_House6_Text_FirstGuestInWhileTakeDoll, MSGBOX_YESNO - compare VAR_RESULT, NO - call_if_eq SootopolisCity_House6_EventScript_DeclineWailmerDoll + call_if_eq VAR_RESULT, NO, SootopolisCity_House6_EventScript_DeclineWailmerDoll msgbox SootopolisCity_House6_Text_TakeGoodCareOfIt, MSGBOX_DEFAULT givedecoration DECOR_WAILMER_DOLL - compare VAR_RESULT, FALSE - goto_if_eq SootopolisCity_House6_EventScript_NoRoomForWailmerDoll + goto_if_eq VAR_RESULT, FALSE, SootopolisCity_House6_EventScript_NoRoomForWailmerDoll setflag FLAG_RECEIVED_WAILMER_DOLL release end @@ -27,7 +25,7 @@ SootopolisCity_House6_EventScript_ReceivedWailmerDoll:: end SootopolisCity_House6_EventScript_NoRoomForWailmerDoll:: - bufferdecorationname 1, DECOR_WAILMER_DOLL + bufferdecorationname STR_VAR_2, DECOR_WAILMER_DOLL msgbox gText_NoRoomLeftForAnother, MSGBOX_DEFAULT msgbox SootopolisCity_House6_Text_IllHoldItForYou, MSGBOX_DEFAULT release diff --git a/data/maps/SootopolisCity_LotadAndSeedotHouse/scripts.inc b/data/maps/SootopolisCity_LotadAndSeedotHouse/scripts.inc index ab087696e8cb..52bdf3aceeeb 100644 --- a/data/maps/SootopolisCity_LotadAndSeedotHouse/scripts.inc +++ b/data/maps/SootopolisCity_LotadAndSeedotHouse/scripts.inc @@ -9,15 +9,11 @@ SootopolisCity_LotadAndSeedotHouse_EventScript_SeedotBrother:: special ChoosePartyMon waitstate copyvar VAR_RESULT, VAR_0x8004 - compare VAR_RESULT, 255 - goto_if_eq SootopolisCity_LotadAndSeedotHouse_EventScript_CancelShowSeedot + goto_if_eq VAR_RESULT, PARTY_NOTHING_CHOSEN, SootopolisCity_LotadAndSeedotHouse_EventScript_CancelShowSeedot special CompareSeedotSize - compare VAR_RESULT, 1 - goto_if_eq SootopolisCity_LotadAndSeedotHouse_EventScript_NotSeedot - compare VAR_RESULT, 2 - goto_if_eq SootopolisCity_LotadAndSeedotHouse_EventScript_SmallSeedot - compare VAR_RESULT, 3 - goto_if_eq SootopolisCity_LotadAndSeedotHouse_EventScript_BigSeedot + goto_if_eq VAR_RESULT, 1, SootopolisCity_LotadAndSeedotHouse_EventScript_NotSeedot + goto_if_eq VAR_RESULT, 2, SootopolisCity_LotadAndSeedotHouse_EventScript_SmallSeedot + goto_if_eq VAR_RESULT, 3, SootopolisCity_LotadAndSeedotHouse_EventScript_BigSeedot release end @@ -39,8 +35,7 @@ SootopolisCity_LotadAndSeedotHouse_EventScript_SmallSeedot:: SootopolisCity_LotadAndSeedotHouse_EventScript_BigSeedot:: msgbox SootopolisCity_LotadAndSeedotHouse_Text_GoshMightBeBiggerThanLotad, MSGBOX_DEFAULT giveitem ITEM_ELIXIR - compare VAR_RESULT, FALSE - goto_if_eq SootopolisCity_LotadAndSeedotHouse_EventScript_NoRoomForElixir1 + goto_if_eq VAR_RESULT, FALSE, SootopolisCity_LotadAndSeedotHouse_EventScript_NoRoomForElixir1 closemessage release end @@ -58,15 +53,11 @@ SootopolisCity_LotadAndSeedotHouse_EventScript_LotadBrother:: special ChoosePartyMon waitstate copyvar VAR_RESULT, VAR_0x8004 - compare VAR_RESULT, 255 - goto_if_eq SootopolisCity_LotadAndSeedotHouse_EventScript_CancelShowLotad + goto_if_eq VAR_RESULT, PARTY_NOTHING_CHOSEN, SootopolisCity_LotadAndSeedotHouse_EventScript_CancelShowLotad special CompareLotadSize - compare VAR_RESULT, 1 - goto_if_eq SootopolisCity_LotadAndSeedotHouse_EventScript_NotLotad - compare VAR_RESULT, 2 - goto_if_eq SootopolisCity_LotadAndSeedotHouse_EventScript_SmallLotad - compare VAR_RESULT, 3 - goto_if_eq SootopolisCity_LotadAndSeedotHouse_EventScript_BigLotad + goto_if_eq VAR_RESULT, 1, SootopolisCity_LotadAndSeedotHouse_EventScript_NotLotad + goto_if_eq VAR_RESULT, 2, SootopolisCity_LotadAndSeedotHouse_EventScript_SmallLotad + goto_if_eq VAR_RESULT, 3, SootopolisCity_LotadAndSeedotHouse_EventScript_BigLotad release end @@ -88,8 +79,7 @@ SootopolisCity_LotadAndSeedotHouse_EventScript_SmallLotad:: SootopolisCity_LotadAndSeedotHouse_EventScript_BigLotad:: msgbox SootopolisCity_LotadAndSeedotHouse_Text_WowMightBeBiggerThanSeedot, MSGBOX_DEFAULT giveitem ITEM_ELIXIR - compare VAR_RESULT, FALSE - goto_if_eq SootopolisCity_LotadAndSeedotHouse_EventScript_NoRoomForElixir2 + goto_if_eq VAR_RESULT, FALSE, SootopolisCity_LotadAndSeedotHouse_EventScript_NoRoomForElixir2 closemessage release end diff --git a/data/maps/SootopolisCity_Mart/scripts.inc b/data/maps/SootopolisCity_Mart/scripts.inc index 0975abd2b032..3cade5fbc428 100644 --- a/data/maps/SootopolisCity_Mart/scripts.inc +++ b/data/maps/SootopolisCity_Mart/scripts.inc @@ -29,8 +29,7 @@ SootopolisCity_Mart_Pokemart: SootopolisCity_Mart_EventScript_FatMan:: lock faceplayer - compare VAR_SKY_PILLAR_STATE, 2 - goto_if_ge SootopolisCity_Mart_EventScript_FatManNoLegendaries + goto_if_ge VAR_SKY_PILLAR_STATE, 2, SootopolisCity_Mart_EventScript_FatManNoLegendaries goto_if_unset FLAG_KYOGRE_ESCAPED_SEAFLOOR_CAVERN, SootopolisCity_Mart_EventScript_FatManNoLegendaries msgbox SootopolisCity_Mart_Text_TooScaryOutside, MSGBOX_DEFAULT release @@ -44,8 +43,7 @@ SootopolisCity_Mart_EventScript_FatManNoLegendaries:: SootopolisCity_Mart_EventScript_Gentleman:: lock faceplayer - compare VAR_SKY_PILLAR_STATE, 2 - goto_if_ge SootopolisCity_Mart_EventScript_GentlemanNoLegendaries + goto_if_ge VAR_SKY_PILLAR_STATE, 2, SootopolisCity_Mart_EventScript_GentlemanNoLegendaries goto_if_unset FLAG_KYOGRE_ESCAPED_SEAFLOOR_CAVERN, SootopolisCity_Mart_EventScript_GentlemanNoLegendaries msgbox SootopolisCity_Mart_Text_DidSomethingAwaken, MSGBOX_DEFAULT release diff --git a/data/maps/SootopolisCity_MysteryEventsHouse_1F/scripts.inc b/data/maps/SootopolisCity_MysteryEventsHouse_1F/scripts.inc index 1fb8a8f723f2..374adbfc66ad 100644 --- a/data/maps/SootopolisCity_MysteryEventsHouse_1F/scripts.inc +++ b/data/maps/SootopolisCity_MysteryEventsHouse_1F/scripts.inc @@ -7,10 +7,8 @@ SootopolisCity_MysteryEventsHouse_1F_MapScripts:: SootopolisCity_MysteryEventsHouse_1F_OnTransition: frontier_checkvisittrainer - compare VAR_RESULT, 0 - call_if_eq SootopolisCity_MysteryEventsHouse_1F_EventScript_SetTrainerVisitingLayout - compare VAR_SOOTOPOLIS_MYSTERY_EVENTS_STATE, 0 - call_if_ne SootopolisCity_MysteryEventsHouse_1F_EventScript_MoveOldManToDoor + call_if_eq VAR_RESULT, 0, SootopolisCity_MysteryEventsHouse_1F_EventScript_SetTrainerVisitingLayout + call_if_ne VAR_SOOTOPOLIS_MYSTERY_EVENTS_STATE, 0, SootopolisCity_MysteryEventsHouse_1F_EventScript_MoveOldManToDoor end SootopolisCity_MysteryEventsHouse_1F_EventScript_SetTrainerVisitingLayout:: @@ -40,12 +38,9 @@ SootopolisCity_MysteryEventsHouse_1F_EventScript_OldManCommentOnBattle:: copyobjectxytoperm LOCALID_OLD_MAN applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFasterUp waitmovement 0 - compare VAR_SOOTOPOLIS_MYSTERY_EVENTS_STATE, 1 - call_if_eq SootopolisCity_MysteryEventsHouse_1F_EventScript_BattleWonComment - compare VAR_SOOTOPOLIS_MYSTERY_EVENTS_STATE, 2 - call_if_eq SootopolisCity_MysteryEventsHouse_1F_EventScript_BattleLostComment - compare VAR_SOOTOPOLIS_MYSTERY_EVENTS_STATE, 3 - call_if_eq SootopolisCity_MysteryEventsHouse_1F_EventScript_BattleTiedComment + call_if_eq VAR_SOOTOPOLIS_MYSTERY_EVENTS_STATE, 1, SootopolisCity_MysteryEventsHouse_1F_EventScript_BattleWonComment + call_if_eq VAR_SOOTOPOLIS_MYSTERY_EVENTS_STATE, 2, SootopolisCity_MysteryEventsHouse_1F_EventScript_BattleLostComment + call_if_eq VAR_SOOTOPOLIS_MYSTERY_EVENTS_STATE, 3, SootopolisCity_MysteryEventsHouse_1F_EventScript_BattleTiedComment special LoadPlayerParty setvar VAR_SOOTOPOLIS_MYSTERY_EVENTS_STATE, 0 releaseall @@ -76,10 +71,8 @@ SootopolisCity_MysteryEventsHouse_1F_EventScript_OldMan:: lock faceplayer frontier_checkvisittrainer - compare VAR_RESULT, 1 - goto_if_eq SootopolisCity_MysteryEventsHouse_1F_EventScript_InvalidVisitingTrainer - compare VAR_TEMP_1, 1 - goto_if_eq SootopolisCity_MysteryEventsHouse_1F_EventScript_TrainerVisiting + goto_if_eq VAR_RESULT, 1, SootopolisCity_MysteryEventsHouse_1F_EventScript_InvalidVisitingTrainer + goto_if_eq VAR_TEMP_1, 1, SootopolisCity_MysteryEventsHouse_1F_EventScript_TrainerVisiting msgbox SootopolisCity_MysteryEventsHouse_1F_Text_OnlyAmusementWatchingBattles, MSGBOX_DEFAULT release end @@ -93,29 +86,22 @@ SootopolisCity_MysteryEventsHouse_1F_EventScript_TrainerVisiting:: special SavePlayerParty special BufferEReaderTrainerName msgbox SootopolisCity_MysteryEventsHouse_1F_Text_ChallengeVisitingTrainer, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq SootopolisCity_MysteryEventsHouse_1F_EventScript_DeclineBattle + goto_if_eq VAR_RESULT, NO, SootopolisCity_MysteryEventsHouse_1F_EventScript_DeclineBattle call SootopolisCity_MysteryEventsHouse_1F_EventScript_ChooseParty - compare VAR_RESULT, 0 - goto_if_eq SootopolisCity_MysteryEventsHouse_1F_EventScript_DeclineBattle + goto_if_eq VAR_RESULT, 0, SootopolisCity_MysteryEventsHouse_1F_EventScript_DeclineBattle msgbox SootopolisCity_MysteryEventsHouse_1F_Text_SaveProgressBeforeBattle, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq SootopolisCity_MysteryEventsHouse_1F_EventScript_DeclineBattle + goto_if_eq VAR_RESULT, NO, SootopolisCity_MysteryEventsHouse_1F_EventScript_DeclineBattle special LoadPlayerParty call Common_EventScript_SaveGame - compare VAR_RESULT, FALSE - goto_if_eq SootopolisCity_MysteryEventsHouse_1F_EventScript_DeclineBattle + goto_if_eq VAR_RESULT, FALSE, SootopolisCity_MysteryEventsHouse_1F_EventScript_DeclineBattle special SavePlayerParty special ReducePlayerPartyToSelectedMons msgbox SootopolisCity_MysteryEventsHouse_1F_Text_HopeToSeeGoodMatch, MSGBOX_DEFAULT closemessage - compare VAR_FACING, DIR_NORTH - call_if_eq SootopolisCity_MysteryEventsHouse_1F_EventScript_EnterBasementNorth - compare VAR_FACING, DIR_EAST - call_if_eq SootopolisCity_MysteryEventsHouse_1F_EventScript_EnterBasementEast - compare VAR_FACING, DIR_WEST - call_if_eq SootopolisCity_MysteryEventsHouse_1F_EventScript_EnterBasementWest - warp MAP_SOOTOPOLIS_CITY_MYSTERY_EVENTS_HOUSE_B1F, 255, 3, 1 + call_if_eq VAR_FACING, DIR_NORTH, SootopolisCity_MysteryEventsHouse_1F_EventScript_EnterBasementNorth + call_if_eq VAR_FACING, DIR_EAST, SootopolisCity_MysteryEventsHouse_1F_EventScript_EnterBasementEast + call_if_eq VAR_FACING, DIR_WEST, SootopolisCity_MysteryEventsHouse_1F_EventScript_EnterBasementWest + warp MAP_SOOTOPOLIS_CITY_MYSTERY_EVENTS_HOUSE_B1F, 3, 1 waitstate release end diff --git a/data/maps/SootopolisCity_MysteryEventsHouse_B1F/scripts.inc b/data/maps/SootopolisCity_MysteryEventsHouse_B1F/scripts.inc index f0ebbf516fcc..533eb7cfa51a 100644 --- a/data/maps/SootopolisCity_MysteryEventsHouse_B1F/scripts.inc +++ b/data/maps/SootopolisCity_MysteryEventsHouse_B1F/scripts.inc @@ -22,19 +22,16 @@ SootopolisCity_MysteryEventsHouse_B1F_EventScript_BattleVisitingTrainer:: setvar VAR_0x8005, 0 special DoSpecialTrainerBattle waitstate - compare VAR_RESULT, B_OUTCOME_DREW - call_if_eq SootopolisCity_MysteryEventsHouse_B1F_EventScript_BattleTie - compare VAR_RESULT, B_OUTCOME_WON - call_if_eq SootopolisCity_MysteryEventsHouse_B1F_EventScript_BattleWon - compare VAR_RESULT, B_OUTCOME_LOST - call_if_eq SootopolisCity_MysteryEventsHouse_B1F_EventScript_BattleLost + call_if_eq VAR_RESULT, B_OUTCOME_DREW, SootopolisCity_MysteryEventsHouse_B1F_EventScript_BattleTie + call_if_eq VAR_RESULT, B_OUTCOME_WON, SootopolisCity_MysteryEventsHouse_B1F_EventScript_BattleWon + call_if_eq VAR_RESULT, B_OUTCOME_LOST, SootopolisCity_MysteryEventsHouse_B1F_EventScript_BattleLost closemessage special HealPlayerParty applymovement OBJ_EVENT_ID_PLAYER, SootopolisCity_MysteryEventsHouse_B1F_Movement_PlayerExitBasement waitmovement 0 special LoadPlayerParty setvar VAR_TEMP_1, 1 - warp MAP_SOOTOPOLIS_CITY_MYSTERY_EVENTS_HOUSE_1F, 255, 3, 1 + warp MAP_SOOTOPOLIS_CITY_MYSTERY_EVENTS_HOUSE_1F, 3, 1 waitstate releaseall end diff --git a/data/maps/SootopolisCity_PokemonCenter_1F/scripts.inc b/data/maps/SootopolisCity_PokemonCenter_1F/scripts.inc index 9e017861b75d..e1e13b35c830 100644 --- a/data/maps/SootopolisCity_PokemonCenter_1F/scripts.inc +++ b/data/maps/SootopolisCity_PokemonCenter_1F/scripts.inc @@ -20,8 +20,7 @@ SootopolisCity_PokemonCenter_1F_EventScript_Nurse:: SootopolisCity_PokemonCenter_1F_EventScript_Gentleman:: lock faceplayer - compare VAR_SKY_PILLAR_STATE, 2 - goto_if_ge SootopolisCity_PokemonCenter_1F_EventScript_GentlemanNoLegendaries + goto_if_ge VAR_SKY_PILLAR_STATE, 2, SootopolisCity_PokemonCenter_1F_EventScript_GentlemanNoLegendaries goto_if_unset FLAG_KYOGRE_ESCAPED_SEAFLOOR_CAVERN, SootopolisCity_PokemonCenter_1F_EventScript_GentlemanNoLegendaries msgbox SootopolisCity_PokemonCenter_1F_Text_EveryoneTakenRefuge, MSGBOX_DEFAULT release @@ -35,8 +34,7 @@ SootopolisCity_PokemonCenter_1F_EventScript_GentlemanNoLegendaries:: SootopolisCity_PokemonCenter_1F_EventScript_Woman:: lock faceplayer - compare VAR_SKY_PILLAR_STATE, 2 - goto_if_ge SootopolisCity_PokemonCenter_1F_EventScript_WomanNoLegendaries + goto_if_ge VAR_SKY_PILLAR_STATE, 2, SootopolisCity_PokemonCenter_1F_EventScript_WomanNoLegendaries goto_if_unset FLAG_KYOGRE_ESCAPED_SEAFLOOR_CAVERN, SootopolisCity_PokemonCenter_1F_EventScript_WomanNoLegendaries msgbox SootopolisCity_PokemonCenter_1F_Text_ArentPokemonOurFriends, MSGBOX_DEFAULT release diff --git a/data/maps/SouthernIsland_Exterior/scripts.inc b/data/maps/SouthernIsland_Exterior/scripts.inc index b491c2f6c51e..b393413fe33f 100644 --- a/data/maps/SouthernIsland_Exterior/scripts.inc +++ b/data/maps/SouthernIsland_Exterior/scripts.inc @@ -13,8 +13,7 @@ SouthernIsland_Exterior_EventScript_Sailor:: lock faceplayer msgbox EventTicket_Text_SouthernIslandSailBack, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq SouthernIsland_Exterior_EventScript_AsYouLike + goto_if_eq VAR_RESULT, NO, SouthernIsland_Exterior_EventScript_AsYouLike msgbox EventTicket_Text_SailHome, MSGBOX_DEFAULT closemessage applymovement VAR_LAST_TALKED, Common_Movement_WalkInPlaceFasterDown @@ -23,7 +22,7 @@ SouthernIsland_Exterior_EventScript_Sailor:: hideobjectat LOCALID_SAILOR, MAP_SOUTHERN_ISLAND_EXTERIOR setvar VAR_0x8004, LOCALID_SS_TIDAL call Common_EventScript_FerryDepartIsland - warp MAP_LILYCOVE_CITY_HARBOR, 255, 8, 11 + warp MAP_LILYCOVE_CITY_HARBOR, 8, 11 waitstate release end diff --git a/data/maps/SouthernIsland_Interior/scripts.inc b/data/maps/SouthernIsland_Interior/scripts.inc index 4ce90e249fbb..c46cefefc641 100644 --- a/data/maps/SouthernIsland_Interior/scripts.inc +++ b/data/maps/SouthernIsland_Interior/scripts.inc @@ -11,16 +11,13 @@ SouthernIsland_Interior_OnResume: SouthernIsland_Interior_EventScript_TryRemoveLati:: specialvar VAR_RESULT, GetBattleOutcome - compare VAR_RESULT, B_OUTCOME_CAUGHT - goto_if_ne Common_EventScript_NopReturn + goto_if_ne VAR_RESULT, B_OUTCOME_CAUGHT, Common_EventScript_NopReturn removeobject LOCALID_LATI return SouthernIsland_Interior_OnTransition: - compare VAR_ROAMER_POKEMON, 0 - call_if_eq SouthernIsland_Interior_EventScript_SetUpLatios - compare VAR_ROAMER_POKEMON, 0 - call_if_ne SouthernIsland_Interior_EventScript_SetUpLatias + call_if_eq VAR_ROAMER_POKEMON, 0, SouthernIsland_Interior_EventScript_SetUpLatios + call_if_ne VAR_ROAMER_POKEMON, 0, SouthernIsland_Interior_EventScript_SetUpLatias call SouthernIsland_Interior_EventScript_SetUpPlayerGfx end @@ -36,10 +33,8 @@ SouthernIsland_Interior_EventScript_SetUpLatias:: SouthernIsland_Interior_EventScript_SetUpPlayerGfx:: checkplayergender - compare VAR_RESULT, MALE - goto_if_eq SouthernIsland_Interior_EventScript_SetBrendanGfx - compare VAR_RESULT, FEMALE - goto_if_eq SouthernIsland_Interior_EventScript_SetMayGfx + goto_if_eq VAR_RESULT, MALE, SouthernIsland_Interior_EventScript_SetBrendanGfx + goto_if_eq VAR_RESULT, FEMALE, SouthernIsland_Interior_EventScript_SetMayGfx end SouthernIsland_Interior_EventScript_SetBrendanGfx:: @@ -79,21 +74,16 @@ SouthernIsland_Interior_EventScript_Lati:: delay 50 special RemoveCameraObject setvar VAR_LAST_TALKED, LOCALID_LATI - compare VAR_ROAMER_POKEMON, 0 - call_if_eq SouthernIsland_Interior_EventScript_SetLatiosBattleVars - compare VAR_ROAMER_POKEMON, 0 - call_if_ne SouthernIsland_Interior_EventScript_SetLatiasBattleVars + call_if_eq VAR_ROAMER_POKEMON, 0, SouthernIsland_Interior_EventScript_SetLatiosBattleVars + call_if_ne VAR_ROAMER_POKEMON, 0, SouthernIsland_Interior_EventScript_SetLatiasBattleVars setflag FLAG_SYS_CTRL_OBJ_DELETE special BattleSetup_StartLatiBattle waitstate clearflag FLAG_SYS_CTRL_OBJ_DELETE specialvar VAR_RESULT, GetBattleOutcome - compare VAR_RESULT, B_OUTCOME_WON - goto_if_eq SouthernIsland_Interior_EventScript_LatiDefeated - compare VAR_RESULT, B_OUTCOME_RAN - goto_if_eq SouthernIsland_Interior_EventScript_RanFromLati - compare VAR_RESULT, B_OUTCOME_PLAYER_TELEPORTED - goto_if_eq SouthernIsland_Interior_EventScript_RanFromLati + goto_if_eq VAR_RESULT, B_OUTCOME_WON, SouthernIsland_Interior_EventScript_LatiDefeated + goto_if_eq VAR_RESULT, B_OUTCOME_RAN, SouthernIsland_Interior_EventScript_RanFromLati + goto_if_eq VAR_RESULT, B_OUTCOME_PLAYER_TELEPORTED, SouthernIsland_Interior_EventScript_RanFromLati setflag FLAG_CAUGHT_LATIAS_OR_LATIOS releaseall end diff --git a/data/maps/TerraCave_End/scripts.inc b/data/maps/TerraCave_End/scripts.inc index 0036f33b5ad5..5f0051becf6d 100644 --- a/data/maps/TerraCave_End/scripts.inc +++ b/data/maps/TerraCave_End/scripts.inc @@ -11,8 +11,7 @@ TerraCave_End_OnResume: TerraCave_End_EventScript_TryRemoveGroudon:: specialvar VAR_RESULT, GetBattleOutcome - compare VAR_RESULT, B_OUTCOME_CAUGHT - goto_if_ne Common_EventScript_NopReturn + goto_if_ne VAR_RESULT, B_OUTCOME_CAUGHT, Common_EventScript_NopReturn removeobject LOCALID_GROUDON return @@ -43,12 +42,9 @@ TerraCave_End_EventScript_Groudon:: clearflag FLAG_SYS_CTRL_OBJ_DELETE setvar VAR_TEMP_1, 0 specialvar VAR_RESULT, GetBattleOutcome - compare VAR_RESULT, B_OUTCOME_WON - goto_if_eq TerraCave_End_EventScript_DefeatedGroudon - compare VAR_RESULT, B_OUTCOME_RAN - goto_if_eq TerraCave_End_EventScript_RanFromGroudon - compare VAR_RESULT, B_OUTCOME_PLAYER_TELEPORTED - goto_if_eq TerraCave_End_EventScript_RanFromGroudon + goto_if_eq VAR_RESULT, B_OUTCOME_WON, TerraCave_End_EventScript_DefeatedGroudon + goto_if_eq VAR_RESULT, B_OUTCOME_RAN, TerraCave_End_EventScript_RanFromGroudon + goto_if_eq VAR_RESULT, B_OUTCOME_PLAYER_TELEPORTED, TerraCave_End_EventScript_RanFromGroudon setvar VAR_SHOULD_END_ABNORMAL_WEATHER, 1 setflag FLAG_DEFEATED_GROUDON releaseall diff --git a/data/maps/TrainerHill_Elevator/scripts.inc b/data/maps/TrainerHill_Elevator/scripts.inc index f4ebc7ea918c..bec1ffbff1c9 100644 --- a/data/maps/TrainerHill_Elevator/scripts.inc +++ b/data/maps/TrainerHill_Elevator/scripts.inc @@ -15,7 +15,7 @@ TrainerHill_Elevator_EventScript_ExitToRoof:: applymovement OBJ_EVENT_ID_PLAYER, TrainerHill_Elevator_Movement_PlayerExitElevatorToRoof waitmovement 0 releaseall - warp MAP_TRAINER_HILL_ROOF, 255, 15, 5 + warp MAP_TRAINER_HILL_ROOF, 15, 5 waitstate end @@ -26,8 +26,7 @@ TrainerHill_Elevator_EventScript_EnterElevator:: waitmovement 0 lockall msgbox TrainerHill_Elevator_Text_ReturnToReception, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq TrainerHill_Elevator_EventScript_ExitToRoof + goto_if_eq VAR_RESULT, NO, TrainerHill_Elevator_EventScript_ExitToRoof releaseall applymovement LOCALID_ATTENDANT, TrainerHill_Elevator_Movement_AttendantFaceDown waitmovement 0 @@ -37,7 +36,7 @@ TrainerHill_Elevator_EventScript_EnterElevator:: delay 25 applymovement OBJ_EVENT_ID_PLAYER, TrainerHill_Elevator_Movement_PlayerExitElevator waitmovement 0 - warp MAP_TRAINER_HILL_ENTRANCE, 255, 17, 8 + warp MAP_TRAINER_HILL_ENTRANCE, 17, 8 waitstate end diff --git a/data/maps/TrainerHill_Entrance/scripts.inc b/data/maps/TrainerHill_Entrance/scripts.inc index af4a4c12352e..8989883e47fa 100644 --- a/data/maps/TrainerHill_Entrance/scripts.inc +++ b/data/maps/TrainerHill_Entrance/scripts.inc @@ -24,16 +24,14 @@ TrainerHill_Entrance_OnResume: trainerhill_resumetimer setvar VAR_TEMP_0, 0 trainerhill_getusingereader - compare VAR_RESULT, FALSE @ VAR_RESULT always FALSE here - goto_if_eq TrainerHill_Entrance_EventScript_TryFaceAttendant + goto_if_eq VAR_RESULT, FALSE, TrainerHill_Entrance_EventScript_TryFaceAttendant @ VAR_RESULT always FALSE here setobjectxy OBJ_EVENT_ID_PLAYER, 9, 6 applymovement OBJ_EVENT_ID_PLAYER, TrainerHill_Entrance_Movement_PlayerFaceAttendant end TrainerHill_Entrance_EventScript_TryFaceAttendant:: trainerhill_getwon - compare VAR_RESULT, TRUE - goto_if_eq TrainerHill_Entrance_EventScript_PlayerDontFaceAttendant + goto_if_eq VAR_RESULT, TRUE, TrainerHill_Entrance_EventScript_PlayerDontFaceAttendant applymovement OBJ_EVENT_ID_PLAYER, TrainerHill_Entrance_Movement_PlayerFaceAttendant end @@ -48,12 +46,11 @@ TrainerHill_Entrance_OnReturn: end TrainerHill_Entrance_OnLoad: - compare VAR_TEMP_D, 17 - call_if_eq TrainerHill_Entrance_EventScript_OpenCounterDoor + call_if_eq VAR_TEMP_D, 17, TrainerHill_Entrance_EventScript_OpenCounterDoor end TrainerHill_Entrance_EventScript_OpenCounterDoor:: - setmetatile 17, 10, METATILE_TrainerHill_GreenFloorTile, 0 + setmetatile 17, 10, METATILE_TrainerHill_GreenFloorTile, FALSE return TrainerHill_Entrance_OnFrame: @@ -67,7 +64,7 @@ TrainerHill_Entrance_EventScript_ExitElevator:: lockall applymovement OBJ_EVENT_ID_PLAYER, TrainerHill_Entrance_Movement_PlayerExitElevator waitmovement 0 - setmetatile 17, 10, METATILE_TrainerHill_CounterDoor, 1 + setmetatile 17, 10, METATILE_TrainerHill_CounterDoor, TRUE special DrawWholeMapView playse SE_CLICK waitse @@ -115,8 +112,7 @@ TrainerHill_Entrance_EventScript_Attendant:: lock faceplayer trainerhill_inchallenge - compare VAR_RESULT, FALSE - goto_if_eq TrainerHill_Entrance_EventScript_ThanksForPlaying + goto_if_eq VAR_RESULT, FALSE, TrainerHill_Entrance_EventScript_ThanksForPlaying msgbox TrainerHill_Entrance_Text_HopeYouGiveItYourBest, MSGBOX_DEFAULT goto TrainerHill_Entrance_EventScript_AttendantEnd @@ -132,11 +128,9 @@ TrainerHill_Entrance_EventScript_EntryTrigger:: goto_if_unset FLAG_SYS_GAME_CLEAR, TrainerHill_Entrance_EventScript_Closed msgbox TrainerHill_Entrance_Text_WelcomeToTrainerHill, MSGBOX_DEFAULT trainerhill_getsaved - compare VAR_RESULT, FALSE - call_if_eq TrainerHill_Entrance_EventScript_SaveGame + call_if_eq VAR_RESULT, FALSE, TrainerHill_Entrance_EventScript_SaveGame trainerhill_allfloorsused - compare VAR_RESULT, TRUE - goto_if_eq TrainerHill_Entrance_EventScript_AllFloorsUsed + goto_if_eq VAR_RESULT, TRUE, TrainerHill_Entrance_EventScript_AllFloorsUsed msgbox TrainerHill_Entrance_Text_TrainersUpToFloorX, MSGBOX_DEFAULT goto TrainerHill_Entrance_EventScript_AskChallengeTrainers @@ -186,8 +180,7 @@ TrainerHill_Entrance_EventScript_SaveGame:: trainerhill_setsaved setvar VAR_TEMP_5, 1 call Common_EventScript_SaveGame - compare VAR_RESULT, FALSE - goto_if_eq TrainerHill_Entrance_EventScript_SaveFailed + goto_if_eq VAR_RESULT, FALSE, TrainerHill_Entrance_EventScript_SaveFailed trainerhill_setsaved return diff --git a/data/maps/Underwater_MarineCave/scripts.inc b/data/maps/Underwater_MarineCave/scripts.inc index cbd158e27316..6c876283516a 100644 --- a/data/maps/Underwater_MarineCave/scripts.inc +++ b/data/maps/Underwater_MarineCave/scripts.inc @@ -8,6 +8,6 @@ Underwater_MarineCave_OnTransition: end Underwater_MarineCave_OnResume: - setdivewarp MAP_MARINE_CAVE_ENTRANCE, 255, 10, 17 + setdivewarp MAP_MARINE_CAVE_ENTRANCE, 10, 17 end diff --git a/data/maps/Underwater_Route134/scripts.inc b/data/maps/Underwater_Route134/scripts.inc index 909b2f8b10d0..b5ab48e26ac3 100644 --- a/data/maps/Underwater_Route134/scripts.inc +++ b/data/maps/Underwater_Route134/scripts.inc @@ -3,6 +3,6 @@ Underwater_Route134_MapScripts:: .byte 0 Underwater_Route134_OnResume: - setdivewarp MAP_ROUTE134, 255, 60, 31 + setdivewarp MAP_ROUTE134, 60, 31 end diff --git a/data/maps/Underwater_SeafloorCavern/scripts.inc b/data/maps/Underwater_SeafloorCavern/scripts.inc index 2e0613c04cbd..7f1231feffe9 100644 --- a/data/maps/Underwater_SeafloorCavern/scripts.inc +++ b/data/maps/Underwater_SeafloorCavern/scripts.inc @@ -18,22 +18,22 @@ Underwater_SeafloorCavern_OnLoad: end Underwater_SeafloorCavern_EventScript_SetSubmarineGoneMetatiles:: - setmetatile 5, 3, METATILE_Underwater_RockWall, 1 - setmetatile 6, 3, METATILE_Underwater_RockWall, 1 - setmetatile 7, 3, METATILE_Underwater_RockWall, 1 - setmetatile 8, 3, METATILE_Underwater_RockWall, 1 - setmetatile 5, 4, METATILE_Underwater_FloorShadow, 0 - setmetatile 6, 4, METATILE_Underwater_FloorShadow, 0 - setmetatile 7, 4, METATILE_Underwater_FloorShadow, 0 - setmetatile 8, 4, METATILE_Underwater_FloorShadow, 0 - setmetatile 5, 5, METATILE_Underwater_FloorShadow, 0 - setmetatile 6, 5, METATILE_Underwater_FloorShadow, 0 - setmetatile 7, 5, METATILE_Underwater_FloorShadow, 0 - setmetatile 8, 5, METATILE_Underwater_FloorShadow, 0 + setmetatile 5, 3, METATILE_Underwater_RockWall, TRUE + setmetatile 6, 3, METATILE_Underwater_RockWall, TRUE + setmetatile 7, 3, METATILE_Underwater_RockWall, TRUE + setmetatile 8, 3, METATILE_Underwater_RockWall, TRUE + setmetatile 5, 4, METATILE_Underwater_FloorShadow, FALSE + setmetatile 6, 4, METATILE_Underwater_FloorShadow, FALSE + setmetatile 7, 4, METATILE_Underwater_FloorShadow, FALSE + setmetatile 8, 4, METATILE_Underwater_FloorShadow, FALSE + setmetatile 5, 5, METATILE_Underwater_FloorShadow, FALSE + setmetatile 6, 5, METATILE_Underwater_FloorShadow, FALSE + setmetatile 7, 5, METATILE_Underwater_FloorShadow, FALSE + setmetatile 8, 5, METATILE_Underwater_FloorShadow, FALSE return Underwater_SeafloorCavern_OnResume: - setdivewarp MAP_SEAFLOOR_CAVERN_ENTRANCE, 255, 10, 17 + setdivewarp MAP_SEAFLOOR_CAVERN_ENTRANCE, 10, 17 end Underwater_SeafloorCavern_EventScript_CheckStolenSub:: diff --git a/data/maps/Underwater_SealedChamber/scripts.inc b/data/maps/Underwater_SealedChamber/scripts.inc index 2b3fe5e0de24..f4f8d8ccb767 100644 --- a/data/maps/Underwater_SealedChamber/scripts.inc +++ b/data/maps/Underwater_SealedChamber/scripts.inc @@ -4,18 +4,16 @@ Underwater_SealedChamber_MapScripts:: Underwater_SealedChamber_OnDive: getplayerxy VAR_0x8004, VAR_0x8005 - compare VAR_0x8004, 12 - goto_if_ne Underwater_SealedChamber_EventScript_SurfaceRoute134 - compare VAR_0x8005, 44 - goto_if_ne Underwater_SealedChamber_EventScript_SurfaceRoute134 + goto_if_ne VAR_0x8004, 12, Underwater_SealedChamber_EventScript_SurfaceRoute134 + goto_if_ne VAR_0x8005, 44, Underwater_SealedChamber_EventScript_SurfaceRoute134 goto Underwater_SealedChamber_EventScript_SurfaceSealedChamber Underwater_SealedChamber_EventScript_SurfaceRoute134:: - setdivewarp MAP_ROUTE134, 255, 60, 31 + setdivewarp MAP_ROUTE134, 60, 31 end Underwater_SealedChamber_EventScript_SurfaceSealedChamber:: - setdivewarp MAP_SEALED_CHAMBER_OUTER_ROOM, 255, 10, 19 + setdivewarp MAP_SEALED_CHAMBER_OUTER_ROOM, 10, 19 end Underwater_SealedChamber_EventScript_Braille:: diff --git a/data/maps/Underwater_SootopolisCity/scripts.inc b/data/maps/Underwater_SootopolisCity/scripts.inc index 4346c284fac9..8bf30560ca29 100644 --- a/data/maps/Underwater_SootopolisCity/scripts.inc +++ b/data/maps/Underwater_SootopolisCity/scripts.inc @@ -3,6 +3,6 @@ Underwater_SootopolisCity_MapScripts:: .byte 0 Underwater_SootopolisCity_OnResume: - setdivewarp MAP_SOOTOPOLIS_CITY, 255, 29, 53 + setdivewarp MAP_SOOTOPOLIS_CITY, 29, 53 end diff --git a/data/maps/VerdanturfTown_BattleTentBattleRoom/scripts.inc b/data/maps/VerdanturfTown_BattleTentBattleRoom/scripts.inc index b349a395cf09..29008b7c0f4a 100644 --- a/data/maps/VerdanturfTown_BattleTentBattleRoom/scripts.inc +++ b/data/maps/VerdanturfTown_BattleTentBattleRoom/scripts.inc @@ -18,10 +18,8 @@ VerdanturfTown_BattleTentBattleRoom_OnTransition: VerdanturfTown_BattleTentBattleRoom_EventScript_SetPlayerGfx:: checkplayergender - compare VAR_RESULT, MALE - goto_if_eq VerdanturfTown_BattleTentBattleRoom_EventScript_SetPlayerGfxMale - compare VAR_RESULT, FEMALE - goto_if_eq VerdanturfTown_BattleTentBattleRoom_EventScript_SetPlayerGfxFemale + goto_if_eq VAR_RESULT, MALE, VerdanturfTown_BattleTentBattleRoom_EventScript_SetPlayerGfxMale + goto_if_eq VAR_RESULT, FEMALE, VerdanturfTown_BattleTentBattleRoom_EventScript_SetPlayerGfxFemale return VerdanturfTown_BattleTentBattleRoom_EventScript_SetPlayerGfxMale:: @@ -43,8 +41,7 @@ VerdanturfTown_BattleTentBattleRoom_EventScript_EnterRoom:: applymovement LOCALID_PLAYER, VerdanturfTown_BattleTentBattleRoom_Movement_PlayerEnter waitmovement 0 frontier_get FRONTIER_DATA_BATTLE_NUM - compare VAR_RESULT, 0 - goto_if_ne VerdanturfTown_BattleTentBattleRoom_EventScript_AskContinueChallenge + goto_if_ne VAR_RESULT, 0, VerdanturfTown_BattleTentBattleRoom_EventScript_AskContinueChallenge VerdanturfTown_BattleTentBattleRoom_EventScript_NextOpponentEnter:: tower_setopponent addobject LOCALID_OPPONENT @@ -59,7 +56,7 @@ VerdanturfTown_BattleTentBattleRoom_EventScript_NextOpponentEnter:: VerdanturfTown_BattleTentBattleRoom_EventScript_WarpToLobbyLost:: frontier_set FRONTIER_DATA_CHALLENGE_STATUS, CHALLENGE_STATUS_LOST special LoadPlayerParty - warp MAP_VERDANTURF_TOWN_BATTLE_TENT_LOBBY, 255, 6, 6 + warp MAP_VERDANTURF_TOWN_BATTLE_TENT_LOBBY, 6, 6 waitstate VerdanturfTown_BattleTentBattleRoom_EventScript_DefeatedOpponent:: @@ -84,10 +81,8 @@ VerdanturfTown_BattleTentBattleRoom_EventScript_DefeatedOpponent:: VerdanturfTown_BattleTentBattleRoom_EventScript_AskContinueChallenge:: frontier_get FRONTIER_DATA_BATTLE_NUM - compare VAR_RESULT, 1 - call_if_eq VerdanturfTown_BattleTentBattleRoom_EventScript_ReadyFor2ndOpponent - compare VAR_RESULT, 2 - call_if_eq VerdanturfTown_BattleTentBattleRoom_EventScript_ReadyFor3rdOpponent + call_if_eq VAR_RESULT, 1, VerdanturfTown_BattleTentBattleRoom_EventScript_ReadyFor2ndOpponent + call_if_eq VAR_RESULT, 2, VerdanturfTown_BattleTentBattleRoom_EventScript_ReadyFor3rdOpponent multichoice 20, 6, MULTI_GO_ON_REST_RETIRE, TRUE switch VAR_RESULT case 0, VerdanturfTown_BattleTentBattleRoom_EventScript_ContinueChallenge @@ -120,7 +115,7 @@ VerdanturfTown_BattleTentBattleRoom_EventScript_ContinueChallenge:: VerdanturfTown_BattleTentBattleRoom_EventScript_WarpToLobbyWon:: frontier_set FRONTIER_DATA_CHALLENGE_STATUS, CHALLENGE_STATUS_WON special LoadPlayerParty - warp MAP_VERDANTURF_TOWN_BATTLE_TENT_LOBBY, 255, 6, 6 + warp MAP_VERDANTURF_TOWN_BATTLE_TENT_LOBBY, 6, 6 waitstate VerdanturfTown_BattleTentBattleRoom_EventScript_PauseChallenge:: diff --git a/data/maps/VerdanturfTown_BattleTentCorridor/scripts.inc b/data/maps/VerdanturfTown_BattleTentCorridor/scripts.inc index c2e9dbd6a724..debf1b177f37 100644 --- a/data/maps/VerdanturfTown_BattleTentCorridor/scripts.inc +++ b/data/maps/VerdanturfTown_BattleTentCorridor/scripts.inc @@ -22,7 +22,7 @@ VerdanturfTown_BattleTentCorridor_EventScript_EnterCorridor:: closedoor 2, 1 waitdooranim setvar VAR_0x8006, 0 - warp MAP_VERDANTURF_TOWN_BATTLE_TENT_BATTLE_ROOM, 255, 6, 5 + warp MAP_VERDANTURF_TOWN_BATTLE_TENT_BATTLE_ROOM, 6, 5 waitstate releaseall end diff --git a/data/maps/VerdanturfTown_BattleTentLobby/scripts.inc b/data/maps/VerdanturfTown_BattleTentLobby/scripts.inc index dd8f0eaa4524..a78a6a78edc2 100644 --- a/data/maps/VerdanturfTown_BattleTentLobby/scripts.inc +++ b/data/maps/VerdanturfTown_BattleTentLobby/scripts.inc @@ -107,8 +107,7 @@ VerdanturfTown_BattleTentLobby_EventScript_Attendant:: lock faceplayer verdanturftent_getprize - compare VAR_RESULT, ITEM_NONE - goto_if_ne VerdanturfTown_BattleTentLobby_EventScript_PrizeWaiting + goto_if_ne VAR_RESULT, ITEM_NONE, VerdanturfTown_BattleTentLobby_EventScript_PrizeWaiting special SavePlayerParty msgbox VerdanturfTown_BattleTentLobby_Text_WelcomeToBattleTent, MSGBOX_DEFAULT VerdanturfTown_BattleTentLobby_EventScript_AskEnterChallenge:: @@ -126,8 +125,7 @@ VerdanturfTown_BattleTentLobby_EventScript_TryEnterChallenge:: setvar VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_SINGLES setvar VAR_RESULT, 2 frontier_checkineligible - compare VAR_0x8004, TRUE - goto_if_eq VerdanturfTown_BattleTentLobby_EventScript_NotEnoughValidMons + goto_if_eq VAR_0x8004, TRUE, VerdanturfTown_BattleTentLobby_EventScript_NotEnoughValidMons frontier_set FRONTIER_DATA_LVL_MODE, FRONTIER_LVL_TENT msgbox VerdanturfTown_BattleTentLobby_Text_SelectThreeMons, MSGBOX_DEFAULT fadescreen FADE_TO_BLACK @@ -135,8 +133,7 @@ VerdanturfTown_BattleTentLobby_EventScript_TryEnterChallenge:: setvar VAR_0x8005, FRONTIER_PARTY_SIZE special ChoosePartyForBattleFrontier waitstate - compare VAR_RESULT, 0 - goto_if_eq VerdanturfTown_BattleTentLobby_EventScript_LoadPartyCancelChallenge + goto_if_eq VAR_RESULT, 0, VerdanturfTown_BattleTentLobby_EventScript_LoadPartyCancelChallenge msgbox VerdanturfTown_BattleTentLobby_Text_SaveBeforeChallenge, MSGBOX_YESNO switch VAR_RESULT case NO, VerdanturfTown_BattleTentLobby_EventScript_LoadPartyCancelChallenge @@ -154,15 +151,14 @@ VerdanturfTown_BattleTentLobby_EventScript_SaveBeforeChallenge:: delay 2 call Common_EventScript_SaveGame setvar VAR_TEMP_0, 255 - compare VAR_RESULT, 0 - goto_if_eq VerdanturfTown_BattleTentLobby_EventScript_CancelChallengeSaveFailed + goto_if_eq VAR_RESULT, 0, VerdanturfTown_BattleTentLobby_EventScript_CancelChallengeSaveFailed VerdanturfTown_BattleTentLobby_EventScript_EnterChallenge:: special SavePlayerParty frontier_setpartyorder FRONTIER_PARTY_SIZE msgbox VerdanturfTown_BattleTentLobby_Text_NowFollowMe, MSGBOX_DEFAULT closemessage call VerdanturfTown_BattleTentLobby_EventScript_WalkToDoor - warp MAP_VERDANTURF_TOWN_BATTLE_TENT_CORRIDOR, 255, 2, 7 + warp MAP_VERDANTURF_TOWN_BATTLE_TENT_CORRIDOR, 2, 7 setvar VAR_TEMP_0, 0 waitstate end @@ -232,8 +228,7 @@ VerdanturfTown_BattleTentLobby_EventScript_AttractGiver:: goto_if_set FLAG_RECEIVED_TM45, VerdanturfTown_BattleTentLobby_EventScript_ReceivedAttract msgbox VerdanturfTown_BattleTentLobby_Text_AttractionRunsDeep, MSGBOX_DEFAULT giveitem ITEM_TM45 - compare VAR_RESULT, 0 - goto_if_eq Common_EventScript_ShowBagIsFull + goto_if_eq VAR_RESULT, 0, Common_EventScript_ShowBagIsFull setflag FLAG_RECEIVED_TM45 msgbox VerdanturfTown_BattleTentLobby_Text_AttractionMutual, MSGBOX_DEFAULT release diff --git a/data/maps/VictoryRoad_1F/scripts.inc b/data/maps/VictoryRoad_1F/scripts.inc index e07da7e60dad..4bce6b4c1dce 100644 --- a/data/maps/VictoryRoad_1F/scripts.inc +++ b/data/maps/VictoryRoad_1F/scripts.inc @@ -5,10 +5,8 @@ VictoryRoad_1F_MapScripts:: .byte 0 VictoryRoad_1F_OnTransition: - compare VAR_VICTORY_ROAD_1F_STATE, 1 - call_if_eq VictoryRoad_1F_EventScript_SetEntranceWallyPos1 - compare VAR_VICTORY_ROAD_1F_STATE, 2 - call_if_eq VictoryRoad_1F_EventScript_SetEntranceWallyPos2 + call_if_eq VAR_VICTORY_ROAD_1F_STATE, 1, VictoryRoad_1F_EventScript_SetEntranceWallyPos1 + call_if_eq VAR_VICTORY_ROAD_1F_STATE, 2, VictoryRoad_1F_EventScript_SetEntranceWallyPos2 end VictoryRoad_1F_EventScript_SetEntranceWallyPos1:: @@ -88,8 +86,7 @@ VictoryRoad_1F_EventScript_EntranceWally:: VictoryRoad_1F_EventScript_ExitWally:: trainerbattle_single TRAINER_WALLY_VR_2, VictoryRoad_1F_Text_WallyIntro, VictoryRoad_1F_Text_WallyDefeat specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, TRUE - goto_if_eq VictoryRoad_1F_EventScript_RematchWally + goto_if_eq VAR_RESULT, TRUE, VictoryRoad_1F_EventScript_RematchWally msgbox VictoryRoad_1F_Text_WallyPostBattle, MSGBOX_AUTOCLOSE end diff --git a/data/script_cmd_table.inc b/data/script_cmd_table.inc index dcc0da9f7f6a..48ec7918a434 100644 --- a/data/script_cmd_table.inc +++ b/data/script_cmd_table.inc @@ -13,12 +13,12 @@ gScriptCmdTable:: .4byte ScrCmd_gotostd_if @ 0x0a .4byte ScrCmd_callstd_if @ 0x0b .4byte ScrCmd_returnram @ 0x0c - .4byte ScrCmd_killscript @ 0x0d + .4byte ScrCmd_endram @ 0x0d .4byte ScrCmd_setmysteryeventstatus @ 0x0e .4byte ScrCmd_loadword @ 0x0f .4byte ScrCmd_loadbyte @ 0x10 - .4byte ScrCmd_writebytetoaddr @ 0x11 - .4byte ScrCmd_loadbytefromaddr @ 0x12 + .4byte ScrCmd_setptr @ 0x11 + .4byte ScrCmd_loadbytefromptr @ 0x12 .4byte ScrCmd_setptrbyte @ 0x13 .4byte ScrCmd_copylocal @ 0x14 .4byte ScrCmd_copybyte @ 0x15 @@ -29,10 +29,10 @@ gScriptCmdTable:: .4byte ScrCmd_setorcopyvar @ 0x1a .4byte ScrCmd_compare_local_to_local @ 0x1b .4byte ScrCmd_compare_local_to_value @ 0x1c - .4byte ScrCmd_compare_local_to_addr @ 0x1d - .4byte ScrCmd_compare_addr_to_local @ 0x1e - .4byte ScrCmd_compare_addr_to_value @ 0x1f - .4byte ScrCmd_compare_addr_to_addr @ 0x20 + .4byte ScrCmd_compare_local_to_ptr @ 0x1d + .4byte ScrCmd_compare_ptr_to_local @ 0x1e + .4byte ScrCmd_compare_ptr_to_value @ 0x1f + .4byte ScrCmd_compare_ptr_to_ptr @ 0x20 .4byte ScrCmd_compare_var_to_value @ 0x21 .4byte ScrCmd_compare_var_to_var @ 0x22 .4byte ScrCmd_callnative @ 0x23 @@ -150,14 +150,14 @@ gScriptCmdTable:: .4byte ScrCmd_showmoneybox @ 0x93 .4byte ScrCmd_hidemoneybox @ 0x94 .4byte ScrCmd_updatemoneybox @ 0x95 - .4byte ScrCmd_getpricereduction @ 0x96 + .4byte ScrCmd_getpokenewsactive @ 0x96 .4byte ScrCmd_fadescreen @ 0x97 .4byte ScrCmd_fadescreenspeed @ 0x98 - .4byte ScrCmd_setflashradius @ 0x99 + .4byte ScrCmd_setflashlevel @ 0x99 .4byte ScrCmd_animateflash @ 0x9a .4byte ScrCmd_messageautoscroll @ 0x9b .4byte ScrCmd_dofieldeffect @ 0x9c - .4byte ScrCmd_setfieldeffectarg @ 0x9d + .4byte ScrCmd_setfieldeffectargument @ 0x9d .4byte ScrCmd_waitfieldeffect @ 0x9e .4byte ScrCmd_setrespawn @ 0x9f .4byte ScrCmd_checkplayergender @ 0xa0 @@ -168,8 +168,8 @@ gScriptCmdTable:: .4byte ScrCmd_doweather @ 0xa5 .4byte ScrCmd_setstepcallback @ 0xa6 .4byte ScrCmd_setmaplayoutindex @ 0xa7 - .4byte ScrCmd_setobjectpriority @ 0xa8 - .4byte ScrCmd_resetobjectpriority @ 0xa9 + .4byte ScrCmd_setobjectsubpriority @ 0xa8 + .4byte ScrCmd_resetobjectsubpriority @ 0xa9 .4byte ScrCmd_createvobject @ 0xaa .4byte ScrCmd_turnvobject @ 0xab .4byte ScrCmd_opendoor @ 0xac @@ -190,7 +190,7 @@ gScriptCmdTable:: .4byte ScrCmd_vgoto_if @ 0xbb .4byte ScrCmd_vcall_if @ 0xbc .4byte ScrCmd_vmessage @ 0xbd - .4byte ScrCmd_vloadword @ 0xbe + .4byte ScrCmd_vbuffermessage @ 0xbe .4byte ScrCmd_vbufferstring @ 0xbf .4byte ScrCmd_showcoinsbox @ 0xc0 .4byte ScrCmd_hidecoinsbox @ 0xc1 @@ -207,7 +207,7 @@ gScriptCmdTable:: .4byte ScrCmd_nop1 @ 0xcc .4byte ScrCmd_setmoneventlegal @ 0xcd .4byte ScrCmd_checkmoneventlegal @ 0xce - .4byte ScrCmd_gotoram @ 0xcf + .4byte ScrCmd_trywondercardscript @ 0xcf .4byte ScrCmd_nop1 @ 0xd0 .4byte ScrCmd_warpspinenter @ 0xd1 .4byte ScrCmd_setmonmetlocation @ 0xd2 @@ -224,8 +224,8 @@ gScriptCmdTable:: .4byte ScrCmd_buffertrainerclassname @ 0xdd .4byte ScrCmd_buffertrainername @ 0xde .4byte ScrCmd_pokenavcall @ 0xdf - .4byte ScrCmd_warpsootopolislegend @ 0xe0 - .4byte ScrCmd_buffercontesttype @ 0xe1 + .4byte ScrCmd_warpwhitefade @ 0xe0 + .4byte ScrCmd_buffercontestname @ 0xe1 .4byte ScrCmd_bufferitemnameplural @ 0xe2 gScriptCmdTableEnd:: diff --git a/data/scripts/abnormal_weather.inc b/data/scripts/abnormal_weather.inc index 9af24c45d52f..c5b03a9704cf 100644 --- a/data/scripts/abnormal_weather.inc +++ b/data/scripts/abnormal_weather.inc @@ -1,161 +1,161 @@ AbnormalWeather_EventScript_PlaceTilesRoute114North:: - setmetatile 7, 3, METATILE_Fallarbor_RedCaveEntrance_Top, 1 - setmetatile 7, 4, METATILE_Fallarbor_RedCaveEntrance_Bottom, 0 + setmetatile 7, 3, METATILE_Fallarbor_RedCaveEntrance_Top, TRUE + setmetatile 7, 4, METATILE_Fallarbor_RedCaveEntrance_Bottom, FALSE return AbnormalWeather_EventScript_PlaceTilesRoute114South:: - setmetatile 6, 45, METATILE_Fallarbor_BrownCaveEntrance_Top, 1 - setmetatile 6, 46, METATILE_Fallarbor_BrownCaveEntrance_Bottom, 0 + setmetatile 6, 45, METATILE_Fallarbor_BrownCaveEntrance_Top, TRUE + setmetatile 6, 46, METATILE_Fallarbor_BrownCaveEntrance_Bottom, FALSE return AbnormalWeather_EventScript_PlaceTilesRoute115West:: - setmetatile 21, 5, METATILE_Fallarbor_BrownCaveEntrance_Top, 1 - setmetatile 21, 6, METATILE_Fallarbor_BrownCaveEntrance_Bottom, 0 + setmetatile 21, 5, METATILE_Fallarbor_BrownCaveEntrance_Top, TRUE + setmetatile 21, 6, METATILE_Fallarbor_BrownCaveEntrance_Bottom, FALSE return AbnormalWeather_EventScript_PlaceTilesRoute115East:: - setmetatile 36, 9, METATILE_Fallarbor_BrownCaveEntrance_Top, 1 - setmetatile 36, 10, METATILE_Fallarbor_BrownCaveEntrance_Bottom, 0 + setmetatile 36, 9, METATILE_Fallarbor_BrownCaveEntrance_Top, TRUE + setmetatile 36, 10, METATILE_Fallarbor_BrownCaveEntrance_Bottom, FALSE return AbnormalWeather_EventScript_PlaceTilesRoute116North:: - setmetatile 59, 12, METATILE_General_CaveEntrance_Top, 1 - setmetatile 59, 13, METATILE_General_CaveEntrance_Bottom, 0 + setmetatile 59, 12, METATILE_General_CaveEntrance_Top, TRUE + setmetatile 59, 13, METATILE_General_CaveEntrance_Bottom, FALSE return AbnormalWeather_EventScript_PlaceTilesRoute116South:: - setmetatile 79, 5, METATILE_General_CaveEntrance_Top, 1 - setmetatile 79, 6, METATILE_General_CaveEntrance_Bottom, 0 + setmetatile 79, 5, METATILE_General_CaveEntrance_Top, TRUE + setmetatile 79, 6, METATILE_General_CaveEntrance_Bottom, FALSE return AbnormalWeather_EventScript_PlaceTilesRoute118East:: - setmetatile 42, 5, METATILE_General_CaveEntrance_Top, 1 - setmetatile 42, 6, METATILE_General_CaveEntrance_Bottom, 0 + setmetatile 42, 5, METATILE_General_CaveEntrance_Top, TRUE + setmetatile 42, 6, METATILE_General_CaveEntrance_Bottom, FALSE return AbnormalWeather_EventScript_PlaceTilesRoute118West:: - setmetatile 9, 5, METATILE_General_CaveEntrance_Top, 1 - setmetatile 9, 6, METATILE_General_CaveEntrance_Bottom, 0 + setmetatile 9, 5, METATILE_General_CaveEntrance_Top, TRUE + setmetatile 9, 6, METATILE_General_CaveEntrance_Bottom, FALSE return AbnormalWeather_EventScript_PlaceTilesRoute105North:: - setmetatile 10, 28, METATILE_General_RoughWater, 0 - setmetatile 11, 28, METATILE_General_RoughWater, 0 - setmetatile 9, 29, METATILE_General_RoughWater, 0 - setmetatile 10, 29, METATILE_General_RoughDeepWater, 0 - setmetatile 11, 29, METATILE_General_RoughDeepWater, 0 - setmetatile 12, 29, METATILE_General_RoughWater, 0 - setmetatile 9, 30, METATILE_General_RoughWater, 0 - setmetatile 10, 30, METATILE_General_RoughDeepWater, 0 - setmetatile 11, 30, METATILE_General_RoughDeepWater, 0 - setmetatile 12, 30, METATILE_General_RoughWater, 0 - setmetatile 10, 31, METATILE_General_RoughWater, 0 - setmetatile 11, 31, METATILE_General_RoughWater, 0 + setmetatile 10, 28, METATILE_General_RoughWater, FALSE + setmetatile 11, 28, METATILE_General_RoughWater, FALSE + setmetatile 9, 29, METATILE_General_RoughWater, FALSE + setmetatile 10, 29, METATILE_General_RoughDeepWater, FALSE + setmetatile 11, 29, METATILE_General_RoughDeepWater, FALSE + setmetatile 12, 29, METATILE_General_RoughWater, FALSE + setmetatile 9, 30, METATILE_General_RoughWater, FALSE + setmetatile 10, 30, METATILE_General_RoughDeepWater, FALSE + setmetatile 11, 30, METATILE_General_RoughDeepWater, FALSE + setmetatile 12, 30, METATILE_General_RoughWater, FALSE + setmetatile 10, 31, METATILE_General_RoughWater, FALSE + setmetatile 11, 31, METATILE_General_RoughWater, FALSE return AbnormalWeather_EventScript_PlaceTilesRoute105South:: - setmetatile 20, 53, METATILE_General_RoughWater, 0 - setmetatile 21, 53, METATILE_General_RoughWater, 0 - setmetatile 19, 54, METATILE_General_RoughWater, 0 - setmetatile 20, 54, METATILE_General_RoughDeepWater, 0 - setmetatile 21, 54, METATILE_General_RoughDeepWater, 0 - setmetatile 22, 54, METATILE_General_RoughWater, 0 - setmetatile 19, 55, METATILE_General_RoughWater, 0 - setmetatile 20, 55, METATILE_General_RoughDeepWater, 0 - setmetatile 21, 55, METATILE_General_RoughDeepWater, 0 - setmetatile 22, 55, METATILE_General_RoughWater, 0 - setmetatile 20, 56, METATILE_General_RoughWater, 0 - setmetatile 21, 56, METATILE_General_RoughWater, 0 + setmetatile 20, 53, METATILE_General_RoughWater, FALSE + setmetatile 21, 53, METATILE_General_RoughWater, FALSE + setmetatile 19, 54, METATILE_General_RoughWater, FALSE + setmetatile 20, 54, METATILE_General_RoughDeepWater, FALSE + setmetatile 21, 54, METATILE_General_RoughDeepWater, FALSE + setmetatile 22, 54, METATILE_General_RoughWater, FALSE + setmetatile 19, 55, METATILE_General_RoughWater, FALSE + setmetatile 20, 55, METATILE_General_RoughDeepWater, FALSE + setmetatile 21, 55, METATILE_General_RoughDeepWater, FALSE + setmetatile 22, 55, METATILE_General_RoughWater, FALSE + setmetatile 20, 56, METATILE_General_RoughWater, FALSE + setmetatile 21, 56, METATILE_General_RoughWater, FALSE return AbnormalWeather_EventScript_PlaceTilesRoute125West:: - setmetatile 8, 16, METATILE_General_RoughWater, 0 - setmetatile 9, 16, METATILE_General_RoughWater, 0 - setmetatile 7, 17, METATILE_General_RoughWater, 0 - setmetatile 8, 17, METATILE_General_RoughDeepWater, 0 - setmetatile 9, 17, METATILE_General_RoughDeepWater, 0 - setmetatile 10, 17, METATILE_General_RoughWater, 0 - setmetatile 7, 18, METATILE_General_RoughWater, 0 - setmetatile 8, 18, METATILE_General_RoughDeepWater, 0 - setmetatile 9, 18, METATILE_General_RoughDeepWater, 0 - setmetatile 10, 18, METATILE_General_RoughWater, 0 - setmetatile 8, 19, METATILE_General_RoughWater, 0 - setmetatile 9, 19, METATILE_General_RoughWater, 0 + setmetatile 8, 16, METATILE_General_RoughWater, FALSE + setmetatile 9, 16, METATILE_General_RoughWater, FALSE + setmetatile 7, 17, METATILE_General_RoughWater, FALSE + setmetatile 8, 17, METATILE_General_RoughDeepWater, FALSE + setmetatile 9, 17, METATILE_General_RoughDeepWater, FALSE + setmetatile 10, 17, METATILE_General_RoughWater, FALSE + setmetatile 7, 18, METATILE_General_RoughWater, FALSE + setmetatile 8, 18, METATILE_General_RoughDeepWater, FALSE + setmetatile 9, 18, METATILE_General_RoughDeepWater, FALSE + setmetatile 10, 18, METATILE_General_RoughWater, FALSE + setmetatile 8, 19, METATILE_General_RoughWater, FALSE + setmetatile 9, 19, METATILE_General_RoughWater, FALSE return AbnormalWeather_EventScript_PlaceTilesRoute125East:: - setmetatile 53, 18, METATILE_General_RoughWater, 0 - setmetatile 54, 18, METATILE_General_RoughWater, 0 - setmetatile 52, 19, METATILE_General_RoughWater, 0 - setmetatile 53, 19, METATILE_General_RoughDeepWater, 0 - setmetatile 54, 19, METATILE_General_RoughDeepWater, 0 - setmetatile 55, 19, METATILE_General_RoughWater, 0 - setmetatile 52, 20, METATILE_General_RoughWater, 0 - setmetatile 53, 20, METATILE_General_RoughDeepWater, 0 - setmetatile 54, 20, METATILE_General_RoughDeepWater, 0 - setmetatile 55, 20, METATILE_General_RoughWater, 0 - setmetatile 53, 21, METATILE_General_RoughWater, 0 - setmetatile 54, 21, METATILE_General_RoughWater, 0 + setmetatile 53, 18, METATILE_General_RoughWater, FALSE + setmetatile 54, 18, METATILE_General_RoughWater, FALSE + setmetatile 52, 19, METATILE_General_RoughWater, FALSE + setmetatile 53, 19, METATILE_General_RoughDeepWater, FALSE + setmetatile 54, 19, METATILE_General_RoughDeepWater, FALSE + setmetatile 55, 19, METATILE_General_RoughWater, FALSE + setmetatile 52, 20, METATILE_General_RoughWater, FALSE + setmetatile 53, 20, METATILE_General_RoughDeepWater, FALSE + setmetatile 54, 20, METATILE_General_RoughDeepWater, FALSE + setmetatile 55, 20, METATILE_General_RoughWater, FALSE + setmetatile 53, 21, METATILE_General_RoughWater, FALSE + setmetatile 54, 21, METATILE_General_RoughWater, FALSE return AbnormalWeather_EventScript_PlaceTilesRoute127North:: - setmetatile 57, 9, METATILE_General_RoughWater, 0 - setmetatile 58, 9, METATILE_General_RoughWater, 0 - setmetatile 56, 10, METATILE_General_RoughWater, 0 - setmetatile 57, 10, METATILE_General_RoughDeepWater, 0 - setmetatile 58, 10, METATILE_General_RoughDeepWater, 0 - setmetatile 59, 10, METATILE_General_RoughWater, 0 - setmetatile 56, 11, METATILE_General_RoughWater, 0 - setmetatile 57, 11, METATILE_General_RoughDeepWater, 0 - setmetatile 58, 11, METATILE_General_RoughDeepWater, 0 - setmetatile 59, 11, METATILE_General_RoughWater, 0 - setmetatile 57, 12, METATILE_General_RoughWater, 0 - setmetatile 58, 12, METATILE_General_RoughWater, 0 + setmetatile 57, 9, METATILE_General_RoughWater, FALSE + setmetatile 58, 9, METATILE_General_RoughWater, FALSE + setmetatile 56, 10, METATILE_General_RoughWater, FALSE + setmetatile 57, 10, METATILE_General_RoughDeepWater, FALSE + setmetatile 58, 10, METATILE_General_RoughDeepWater, FALSE + setmetatile 59, 10, METATILE_General_RoughWater, FALSE + setmetatile 56, 11, METATILE_General_RoughWater, FALSE + setmetatile 57, 11, METATILE_General_RoughDeepWater, FALSE + setmetatile 58, 11, METATILE_General_RoughDeepWater, FALSE + setmetatile 59, 11, METATILE_General_RoughWater, FALSE + setmetatile 57, 12, METATILE_General_RoughWater, FALSE + setmetatile 58, 12, METATILE_General_RoughWater, FALSE return AbnormalWeather_EventScript_PlaceTilesRoute127South:: - setmetatile 61, 30, METATILE_General_RoughWater, 0 - setmetatile 62, 30, METATILE_General_RoughWater, 0 - setmetatile 60, 31, METATILE_General_RoughWater, 0 - setmetatile 61, 31, METATILE_General_RoughDeepWater, 0 - setmetatile 62, 31, METATILE_General_RoughDeepWater, 0 - setmetatile 63, 31, METATILE_General_RoughWater, 0 - setmetatile 60, 32, METATILE_General_RoughWater, 0 - setmetatile 61, 32, METATILE_General_RoughDeepWater, 0 - setmetatile 62, 32, METATILE_General_RoughDeepWater, 0 - setmetatile 63, 32, METATILE_General_RoughWater, 0 - setmetatile 61, 33, METATILE_General_RoughWater, 0 - setmetatile 62, 33, METATILE_General_RoughWater, 0 + setmetatile 61, 30, METATILE_General_RoughWater, FALSE + setmetatile 62, 30, METATILE_General_RoughWater, FALSE + setmetatile 60, 31, METATILE_General_RoughWater, FALSE + setmetatile 61, 31, METATILE_General_RoughDeepWater, FALSE + setmetatile 62, 31, METATILE_General_RoughDeepWater, FALSE + setmetatile 63, 31, METATILE_General_RoughWater, FALSE + setmetatile 60, 32, METATILE_General_RoughWater, FALSE + setmetatile 61, 32, METATILE_General_RoughDeepWater, FALSE + setmetatile 62, 32, METATILE_General_RoughDeepWater, FALSE + setmetatile 63, 32, METATILE_General_RoughWater, FALSE + setmetatile 61, 33, METATILE_General_RoughWater, FALSE + setmetatile 62, 33, METATILE_General_RoughWater, FALSE return AbnormalWeather_EventScript_PlaceTilesRoute129West:: - setmetatile 16, 14, METATILE_General_RoughWater, 0 - setmetatile 17, 14, METATILE_General_RoughWater, 0 - setmetatile 15, 15, METATILE_General_RoughWater, 0 - setmetatile 16, 15, METATILE_General_RoughDeepWater, 0 - setmetatile 17, 15, METATILE_General_RoughDeepWater, 0 - setmetatile 18, 15, METATILE_General_RoughWater, 0 - setmetatile 15, 16, METATILE_General_RoughWater, 0 - setmetatile 16, 16, METATILE_General_RoughDeepWater, 0 - setmetatile 17, 16, METATILE_General_RoughDeepWater, 0 - setmetatile 18, 16, METATILE_General_RoughWater, 0 - setmetatile 16, 17, METATILE_General_RoughWater, 0 - setmetatile 17, 17, METATILE_General_RoughWater, 0 + setmetatile 16, 14, METATILE_General_RoughWater, FALSE + setmetatile 17, 14, METATILE_General_RoughWater, FALSE + setmetatile 15, 15, METATILE_General_RoughWater, FALSE + setmetatile 16, 15, METATILE_General_RoughDeepWater, FALSE + setmetatile 17, 15, METATILE_General_RoughDeepWater, FALSE + setmetatile 18, 15, METATILE_General_RoughWater, FALSE + setmetatile 15, 16, METATILE_General_RoughWater, FALSE + setmetatile 16, 16, METATILE_General_RoughDeepWater, FALSE + setmetatile 17, 16, METATILE_General_RoughDeepWater, FALSE + setmetatile 18, 16, METATILE_General_RoughWater, FALSE + setmetatile 16, 17, METATILE_General_RoughWater, FALSE + setmetatile 17, 17, METATILE_General_RoughWater, FALSE return AbnormalWeather_EventScript_PlaceTilesRoute129East:: - setmetatile 42, 19, METATILE_General_RoughWater, 0 - setmetatile 43, 19, METATILE_General_RoughWater, 0 - setmetatile 41, 20, METATILE_General_RoughWater, 0 - setmetatile 42, 20, METATILE_General_RoughDeepWater, 0 - setmetatile 43, 20, METATILE_General_RoughDeepWater, 0 - setmetatile 44, 20, METATILE_General_RoughWater, 0 - setmetatile 41, 21, METATILE_General_RoughWater, 0 - setmetatile 42, 21, METATILE_General_RoughDeepWater, 0 - setmetatile 43, 21, METATILE_General_RoughDeepWater, 0 - setmetatile 44, 21, METATILE_General_RoughWater, 0 - setmetatile 42, 22, METATILE_General_RoughWater, 0 - setmetatile 43, 22, METATILE_General_RoughWater, 0 + setmetatile 42, 19, METATILE_General_RoughWater, FALSE + setmetatile 43, 19, METATILE_General_RoughWater, FALSE + setmetatile 41, 20, METATILE_General_RoughWater, FALSE + setmetatile 42, 20, METATILE_General_RoughDeepWater, FALSE + setmetatile 43, 20, METATILE_General_RoughDeepWater, FALSE + setmetatile 44, 20, METATILE_General_RoughWater, FALSE + setmetatile 41, 21, METATILE_General_RoughWater, FALSE + setmetatile 42, 21, METATILE_General_RoughDeepWater, FALSE + setmetatile 43, 21, METATILE_General_RoughDeepWater, FALSE + setmetatile 44, 21, METATILE_General_RoughWater, FALSE + setmetatile 42, 22, METATILE_General_RoughWater, FALSE + setmetatile 43, 22, METATILE_General_RoughWater, FALSE return AbnormalWeather_EventScript_HideMapNamePopup:: @@ -172,8 +172,7 @@ AbnormalWeather_StartGroudonWeather:: AbnormalWeather_EventScript_EndEventAndCleanup_1:: lockall - compare VAR_ABNORMAL_WEATHER_LOCATION, MARINE_CAVE_LOCATIONS_START - goto_if_ge AbnormalWeather_EventScript_ShowRainEndedMessage + goto_if_ge VAR_ABNORMAL_WEATHER_LOCATION, MARINE_CAVE_LOCATIONS_START, AbnormalWeather_EventScript_ShowRainEndedMessage goto AbnormalWeather_EventScript_ShowSunEndedMessage end @@ -222,163 +221,163 @@ AbnormalWeather_EventScript_CleanupMapTiles:: return AbnormalWeather_EventScript_CleanupRoute114North:: - setmetatile 7, 3, METATILE_Fallarbor_RedRockWall, 1 - setmetatile 7, 4, METATILE_Fallarbor_RedRockWall, 1 + setmetatile 7, 3, METATILE_Fallarbor_RedRockWall, TRUE + setmetatile 7, 4, METATILE_Fallarbor_RedRockWall, TRUE return AbnormalWeather_EventScript_CleanupRoute114South:: - setmetatile 6, 45, METATILE_Fallarbor_BrownRockWall, 1 - setmetatile 6, 46, METATILE_Fallarbor_BrownRockWall, 1 + setmetatile 6, 45, METATILE_Fallarbor_BrownRockWall, TRUE + setmetatile 6, 46, METATILE_Fallarbor_BrownRockWall, TRUE return AbnormalWeather_EventScript_CleanupRoute115West:: - setmetatile 21, 5, METATILE_Fallarbor_BrownRockWall, 1 - setmetatile 21, 6, METATILE_Fallarbor_BrownRockWall, 1 + setmetatile 21, 5, METATILE_Fallarbor_BrownRockWall, TRUE + setmetatile 21, 6, METATILE_Fallarbor_BrownRockWall, TRUE return AbnormalWeather_EventScript_CleanupRoute115East:: - setmetatile 36, 9, METATILE_Fallarbor_BrownRockWall, 1 - setmetatile 36, 10, METATILE_Fallarbor_BrownRockWall, 1 + setmetatile 36, 9, METATILE_Fallarbor_BrownRockWall, TRUE + setmetatile 36, 10, METATILE_Fallarbor_BrownRockWall, TRUE return AbnormalWeather_EventScript_CleanupRoute116North:: - setmetatile 59, 12, METATILE_General_RockWall_RockBase, 1 - setmetatile 59, 13, METATILE_General_RockWall_RockBase, 1 + setmetatile 59, 12, METATILE_General_RockWall_RockBase, TRUE + setmetatile 59, 13, METATILE_General_RockWall_RockBase, TRUE return AbnormalWeather_EventScript_CleanupRoute116South:: - setmetatile 79, 5, METATILE_General_RockWall_RockBase, 1 - setmetatile 79, 6, METATILE_General_RockWall_RockBase, 1 + setmetatile 79, 5, METATILE_General_RockWall_RockBase, TRUE + setmetatile 79, 6, METATILE_General_RockWall_RockBase, TRUE return AbnormalWeather_EventScript_CleanupRoute118East:: - setmetatile 42, 5, METATILE_General_RockWall_RockBase, 1 - setmetatile 42, 6, METATILE_General_RockWall_GrassBase, 1 + setmetatile 42, 5, METATILE_General_RockWall_RockBase, TRUE + setmetatile 42, 6, METATILE_General_RockWall_GrassBase, TRUE return AbnormalWeather_EventScript_CleanupRoute118West:: - setmetatile 9, 5, METATILE_General_RockWall_RockBase, 1 - setmetatile 9, 6, METATILE_General_RockWall_GrassBase, 1 + setmetatile 9, 5, METATILE_General_RockWall_RockBase, TRUE + setmetatile 9, 6, METATILE_General_RockWall_GrassBase, TRUE return AbnormalWeather_EventScript_CleanupRoute105North:: - setmetatile 10, 28, METATILE_General_CalmWater, 0 - setmetatile 11, 28, METATILE_General_CalmWater, 0 - setmetatile 9, 29, METATILE_General_CalmWater, 0 - setmetatile 10, 29, METATILE_General_CalmWater, 0 - setmetatile 11, 29, METATILE_General_CalmWater, 0 - setmetatile 12, 29, METATILE_General_CalmWater, 0 - setmetatile 9, 30, METATILE_General_CalmWater, 0 - setmetatile 10, 30, METATILE_General_CalmWater, 0 - setmetatile 11, 30, METATILE_General_CalmWater, 0 - setmetatile 12, 30, METATILE_General_CalmWater, 0 - setmetatile 10, 31, METATILE_General_CalmWater, 0 - setmetatile 11, 31, METATILE_General_CalmWater, 0 + setmetatile 10, 28, METATILE_General_CalmWater, FALSE + setmetatile 11, 28, METATILE_General_CalmWater, FALSE + setmetatile 9, 29, METATILE_General_CalmWater, FALSE + setmetatile 10, 29, METATILE_General_CalmWater, FALSE + setmetatile 11, 29, METATILE_General_CalmWater, FALSE + setmetatile 12, 29, METATILE_General_CalmWater, FALSE + setmetatile 9, 30, METATILE_General_CalmWater, FALSE + setmetatile 10, 30, METATILE_General_CalmWater, FALSE + setmetatile 11, 30, METATILE_General_CalmWater, FALSE + setmetatile 12, 30, METATILE_General_CalmWater, FALSE + setmetatile 10, 31, METATILE_General_CalmWater, FALSE + setmetatile 11, 31, METATILE_General_CalmWater, FALSE return AbnormalWeather_EventScript_CleanupRoute105South:: - setmetatile 20, 53, METATILE_General_CalmWater, 0 - setmetatile 21, 53, METATILE_General_CalmWater, 0 - setmetatile 19, 54, METATILE_General_CalmWater, 0 - setmetatile 20, 54, METATILE_General_CalmWater, 0 - setmetatile 21, 54, METATILE_General_CalmWater, 0 - setmetatile 22, 54, METATILE_General_CalmWater, 0 - setmetatile 19, 55, METATILE_General_CalmWater, 0 - setmetatile 20, 55, METATILE_General_CalmWater, 0 - setmetatile 21, 55, METATILE_General_CalmWater, 0 - setmetatile 22, 55, METATILE_General_CalmWater, 0 - setmetatile 20, 56, METATILE_General_CalmWater, 0 - setmetatile 21, 56, METATILE_General_CalmWater, 0 + setmetatile 20, 53, METATILE_General_CalmWater, FALSE + setmetatile 21, 53, METATILE_General_CalmWater, FALSE + setmetatile 19, 54, METATILE_General_CalmWater, FALSE + setmetatile 20, 54, METATILE_General_CalmWater, FALSE + setmetatile 21, 54, METATILE_General_CalmWater, FALSE + setmetatile 22, 54, METATILE_General_CalmWater, FALSE + setmetatile 19, 55, METATILE_General_CalmWater, FALSE + setmetatile 20, 55, METATILE_General_CalmWater, FALSE + setmetatile 21, 55, METATILE_General_CalmWater, FALSE + setmetatile 22, 55, METATILE_General_CalmWater, FALSE + setmetatile 20, 56, METATILE_General_CalmWater, FALSE + setmetatile 21, 56, METATILE_General_CalmWater, FALSE return AbnormalWeather_EventScript_CleanupRoute125West:: - setmetatile 8, 16, METATILE_General_CalmWater, 0 - setmetatile 9, 16, METATILE_General_CalmWater, 0 - setmetatile 7, 17, METATILE_General_CalmWater, 0 - setmetatile 8, 17, METATILE_General_CalmWater, 0 - setmetatile 9, 17, METATILE_General_CalmWater, 0 - setmetatile 10, 17, METATILE_General_CalmWater, 0 - setmetatile 7, 18, METATILE_General_CalmWater, 0 - setmetatile 8, 18, METATILE_General_CalmWater, 0 - setmetatile 9, 18, METATILE_General_CalmWater, 0 - setmetatile 10, 18, METATILE_General_CalmWater, 0 - setmetatile 8, 19, METATILE_General_CalmWater, 0 - setmetatile 9, 19, METATILE_General_CalmWater, 0 + setmetatile 8, 16, METATILE_General_CalmWater, FALSE + setmetatile 9, 16, METATILE_General_CalmWater, FALSE + setmetatile 7, 17, METATILE_General_CalmWater, FALSE + setmetatile 8, 17, METATILE_General_CalmWater, FALSE + setmetatile 9, 17, METATILE_General_CalmWater, FALSE + setmetatile 10, 17, METATILE_General_CalmWater, FALSE + setmetatile 7, 18, METATILE_General_CalmWater, FALSE + setmetatile 8, 18, METATILE_General_CalmWater, FALSE + setmetatile 9, 18, METATILE_General_CalmWater, FALSE + setmetatile 10, 18, METATILE_General_CalmWater, FALSE + setmetatile 8, 19, METATILE_General_CalmWater, FALSE + setmetatile 9, 19, METATILE_General_CalmWater, FALSE return AbnormalWeather_EventScript_CleanupRoute125East:: - setmetatile 53, 18, METATILE_General_CalmWater, 0 - setmetatile 54, 18, METATILE_General_CalmWater, 0 - setmetatile 52, 19, METATILE_General_CalmWater, 0 - setmetatile 53, 19, METATILE_General_CalmWater, 0 - setmetatile 54, 19, METATILE_General_CalmWater, 0 - setmetatile 55, 19, METATILE_General_CalmWater, 0 - setmetatile 52, 20, METATILE_General_CalmWater, 0 - setmetatile 53, 20, METATILE_General_CalmWater, 0 - setmetatile 54, 20, METATILE_General_CalmWater, 0 - setmetatile 55, 20, METATILE_General_CalmWater, 0 - setmetatile 53, 21, METATILE_General_CalmWater, 0 - setmetatile 54, 21, METATILE_General_CalmWater, 0 + setmetatile 53, 18, METATILE_General_CalmWater, FALSE + setmetatile 54, 18, METATILE_General_CalmWater, FALSE + setmetatile 52, 19, METATILE_General_CalmWater, FALSE + setmetatile 53, 19, METATILE_General_CalmWater, FALSE + setmetatile 54, 19, METATILE_General_CalmWater, FALSE + setmetatile 55, 19, METATILE_General_CalmWater, FALSE + setmetatile 52, 20, METATILE_General_CalmWater, FALSE + setmetatile 53, 20, METATILE_General_CalmWater, FALSE + setmetatile 54, 20, METATILE_General_CalmWater, FALSE + setmetatile 55, 20, METATILE_General_CalmWater, FALSE + setmetatile 53, 21, METATILE_General_CalmWater, FALSE + setmetatile 54, 21, METATILE_General_CalmWater, FALSE return AbnormalWeather_EventScript_CleanupRoute127North:: - setmetatile 57, 9, METATILE_General_CalmWater, 0 - setmetatile 58, 9, METATILE_General_CalmWater, 0 - setmetatile 56, 10, METATILE_General_CalmWater, 0 - setmetatile 57, 10, METATILE_General_CalmWater, 0 - setmetatile 58, 10, METATILE_General_CalmWater, 0 - setmetatile 59, 10, METATILE_General_CalmWater, 0 - setmetatile 56, 11, METATILE_General_CalmWater, 0 - setmetatile 57, 11, METATILE_General_CalmWater, 0 - setmetatile 58, 11, METATILE_General_CalmWater, 0 - setmetatile 59, 11, METATILE_General_CalmWater, 0 - setmetatile 57, 12, METATILE_General_CalmWater, 0 - setmetatile 58, 12, METATILE_General_CalmWater, 0 + setmetatile 57, 9, METATILE_General_CalmWater, FALSE + setmetatile 58, 9, METATILE_General_CalmWater, FALSE + setmetatile 56, 10, METATILE_General_CalmWater, FALSE + setmetatile 57, 10, METATILE_General_CalmWater, FALSE + setmetatile 58, 10, METATILE_General_CalmWater, FALSE + setmetatile 59, 10, METATILE_General_CalmWater, FALSE + setmetatile 56, 11, METATILE_General_CalmWater, FALSE + setmetatile 57, 11, METATILE_General_CalmWater, FALSE + setmetatile 58, 11, METATILE_General_CalmWater, FALSE + setmetatile 59, 11, METATILE_General_CalmWater, FALSE + setmetatile 57, 12, METATILE_General_CalmWater, FALSE + setmetatile 58, 12, METATILE_General_CalmWater, FALSE return AbnormalWeather_EventScript_CleanupRoute127South:: - setmetatile 61, 30, METATILE_General_CalmWater, 0 - setmetatile 62, 30, METATILE_General_CalmWater, 0 - setmetatile 60, 31, METATILE_General_CalmWater, 0 - setmetatile 61, 31, METATILE_General_CalmWater, 0 - setmetatile 62, 31, METATILE_General_CalmWater, 0 - setmetatile 63, 31, METATILE_General_CalmWater, 0 - setmetatile 60, 32, METATILE_General_CalmWater, 0 - setmetatile 61, 32, METATILE_General_CalmWater, 0 - setmetatile 62, 32, METATILE_General_CalmWater, 0 - setmetatile 63, 32, METATILE_General_CalmWater, 0 - setmetatile 61, 33, METATILE_General_CalmWater, 0 - setmetatile 62, 33, METATILE_General_CalmWater, 0 + setmetatile 61, 30, METATILE_General_CalmWater, FALSE + setmetatile 62, 30, METATILE_General_CalmWater, FALSE + setmetatile 60, 31, METATILE_General_CalmWater, FALSE + setmetatile 61, 31, METATILE_General_CalmWater, FALSE + setmetatile 62, 31, METATILE_General_CalmWater, FALSE + setmetatile 63, 31, METATILE_General_CalmWater, FALSE + setmetatile 60, 32, METATILE_General_CalmWater, FALSE + setmetatile 61, 32, METATILE_General_CalmWater, FALSE + setmetatile 62, 32, METATILE_General_CalmWater, FALSE + setmetatile 63, 32, METATILE_General_CalmWater, FALSE + setmetatile 61, 33, METATILE_General_CalmWater, FALSE + setmetatile 62, 33, METATILE_General_CalmWater, FALSE return AbnormalWeather_EventScript_CleanupRoute129West:: - setmetatile 16, 14, METATILE_General_CalmWater, 0 - setmetatile 17, 14, METATILE_General_CalmWater, 0 - setmetatile 15, 15, METATILE_General_CalmWater, 0 - setmetatile 16, 15, METATILE_General_CalmWater, 0 - setmetatile 17, 15, METATILE_General_CalmWater, 0 - setmetatile 18, 15, METATILE_General_CalmWater, 0 - setmetatile 15, 16, METATILE_General_CalmWater, 0 - setmetatile 16, 16, METATILE_General_CalmWater, 0 - setmetatile 17, 16, METATILE_General_CalmWater, 0 - setmetatile 18, 16, METATILE_General_CalmWater, 0 - setmetatile 16, 17, METATILE_General_CalmWater, 0 - setmetatile 17, 17, METATILE_General_CalmWater, 0 + setmetatile 16, 14, METATILE_General_CalmWater, FALSE + setmetatile 17, 14, METATILE_General_CalmWater, FALSE + setmetatile 15, 15, METATILE_General_CalmWater, FALSE + setmetatile 16, 15, METATILE_General_CalmWater, FALSE + setmetatile 17, 15, METATILE_General_CalmWater, FALSE + setmetatile 18, 15, METATILE_General_CalmWater, FALSE + setmetatile 15, 16, METATILE_General_CalmWater, FALSE + setmetatile 16, 16, METATILE_General_CalmWater, FALSE + setmetatile 17, 16, METATILE_General_CalmWater, FALSE + setmetatile 18, 16, METATILE_General_CalmWater, FALSE + setmetatile 16, 17, METATILE_General_CalmWater, FALSE + setmetatile 17, 17, METATILE_General_CalmWater, FALSE return AbnormalWeather_EventScript_CleanupRoute129East:: - setmetatile 42, 19, METATILE_General_CalmWater, 0 - setmetatile 43, 19, METATILE_General_CalmWater, 0 - setmetatile 41, 20, METATILE_General_CalmWater, 0 - setmetatile 42, 20, METATILE_General_CalmWater, 0 - setmetatile 43, 20, METATILE_General_CalmWater, 0 - setmetatile 44, 20, METATILE_General_CalmWater, 0 - setmetatile 41, 21, METATILE_General_CalmWater, 0 - setmetatile 42, 21, METATILE_General_CalmWater, 0 - setmetatile 43, 21, METATILE_General_CalmWater, 0 - setmetatile 44, 21, METATILE_General_CalmWater, 0 - setmetatile 42, 22, METATILE_General_CalmWater, 0 - setmetatile 43, 22, METATILE_General_CalmWater, 0 + setmetatile 42, 19, METATILE_General_CalmWater, FALSE + setmetatile 43, 19, METATILE_General_CalmWater, FALSE + setmetatile 41, 20, METATILE_General_CalmWater, FALSE + setmetatile 42, 20, METATILE_General_CalmWater, FALSE + setmetatile 43, 20, METATILE_General_CalmWater, FALSE + setmetatile 44, 20, METATILE_General_CalmWater, FALSE + setmetatile 41, 21, METATILE_General_CalmWater, FALSE + setmetatile 42, 21, METATILE_General_CalmWater, FALSE + setmetatile 43, 21, METATILE_General_CalmWater, FALSE + setmetatile 44, 21, METATILE_General_CalmWater, FALSE + setmetatile 42, 22, METATILE_General_CalmWater, FALSE + setmetatile 43, 22, METATILE_General_CalmWater, FALSE return AbnormalWeather_Underwater_SetupEscapeWarp:: @@ -394,33 +393,33 @@ AbnormalWeather_Underwater_SetupEscapeWarp:: return AbnormalWeather_Underwater_SetupEscapeWarpRoute105North:: - setescapewarp MAP_ROUTE105, 255, 11, 29 + setescapewarp MAP_ROUTE105, 11, 29 return AbnormalWeather_Underwater_SetupEscapeWarpRoute105South:: - setescapewarp MAP_ROUTE105, 255, 21, 54 + setescapewarp MAP_ROUTE105, 21, 54 return AbnormalWeather_Underwater_SetupEscapeWarpRoute125West:: - setescapewarp MAP_ROUTE125, 255, 9, 17 + setescapewarp MAP_ROUTE125, 9, 17 return AbnormalWeather_Underwater_SetupEscapeWarpRoute125East:: - setescapewarp MAP_ROUTE125, 255, 54, 19 + setescapewarp MAP_ROUTE125, 54, 19 return AbnormalWeather_Underwater_SetupEscapeWarpRoute127North:: - setescapewarp MAP_ROUTE127, 255, 58, 10 + setescapewarp MAP_ROUTE127, 58, 10 return AbnormalWeather_Underwater_SetupEscapeWarpRoute127South:: - setescapewarp MAP_ROUTE127, 255, 62, 31 + setescapewarp MAP_ROUTE127, 62, 31 return AbnormalWeather_Underwater_SetupEscapeWarpRoute129West:: - setescapewarp MAP_ROUTE129, 255, 17, 15 + setescapewarp MAP_ROUTE129, 17, 15 return AbnormalWeather_Underwater_SetupEscapeWarpRoute129East:: - setescapewarp MAP_ROUTE129, 255, 43, 20 + setescapewarp MAP_ROUTE129, 43, 20 return diff --git a/data/scripts/apprentice.inc b/data/scripts/apprentice.inc index 2a6772a5dc2a..6b3a99e728c8 100644 --- a/data/scripts/apprentice.inc +++ b/data/scripts/apprentice.inc @@ -4,40 +4,32 @@ BattleFrontier_BattleTowerLobby_EventScript_Apprentice:: lock faceplayer apprentice_gavelvlmode - compare VAR_RESULT, FALSE - goto_if_eq Apprentice_EventScript_FirstMeeting + goto_if_eq VAR_RESULT, FALSE, Apprentice_EventScript_FirstMeeting apprentice_shouldcheckgone - compare VAR_0x8004, FALSE @ Always TRUE here - goto_if_eq Apprentice_EventScript_AskQuestion + goto_if_eq VAR_0x8004, FALSE, Apprentice_EventScript_AskQuestion @ VAR_0x8004 always TRUE here goto_if_set FLAG_DAILY_APPRENTICE_LEAVES, Apprentice_EventScript_Gone Apprentice_EventScript_AskQuestion: apprentice_getquestion - compare VAR_RESULT, APPRENTICE_QUESTION_WHICH_MON - goto_if_eq Apprentice_EventScript_UseWhichMon - compare VAR_RESULT, APPRENTICE_QUESTION_WHAT_ITEM - goto_if_eq Apprentice_EventScript_UseWhatHeldItem - compare VAR_RESULT, APPRENTICE_QUESTION_WHICH_MOVE - goto_if_eq Apprentice_EventScript_UseWhichMove - compare VAR_RESULT, APPRENTICE_QUESTION_WHICH_FIRST - goto_if_eq Apprentice_EventScript_PutWhichMonFirst - compare VAR_RESULT, APPRENTICE_QUESTION_WIN_SPEECH - goto_if_eq Apprentice_EventScript_PickWinSpeech + goto_if_eq VAR_RESULT, APPRENTICE_QUESTION_WHICH_MON, Apprentice_EventScript_UseWhichMon + goto_if_eq VAR_RESULT, APPRENTICE_QUESTION_WHAT_ITEM, Apprentice_EventScript_UseWhatHeldItem + goto_if_eq VAR_RESULT, APPRENTICE_QUESTION_WHICH_MOVE, Apprentice_EventScript_UseWhichMove + goto_if_eq VAR_RESULT, APPRENTICE_QUESTION_WHICH_FIRST, Apprentice_EventScript_PutWhichMonFirst + goto_if_eq VAR_RESULT, APPRENTICE_QUESTION_WIN_SPEECH, Apprentice_EventScript_PickWinSpeech release releaseall end Apprentice_EventScript_FirstMeeting: - apprentice_buff 0, APPRENTICE_BUFF_NAME + apprentice_buff STR_VAR_1, APPRENTICE_BUFF_NAME apprentice_msg FALSE, APPRENTICE_MSG_PLEASE_TEACH Apprentice_EventScript_WhichLvlMode: apprentice_menu APPRENTICE_ASK_YES_NO - compare VAR_RESULT, 1 - goto_if_eq Apprentice_EventScript_RejectTeach + goto_if_eq VAR_RESULT, 1, Apprentice_EventScript_RejectTeach apprentice_msg FALSE, APPRENTICE_MSG_WHICH_LVL_MODE apprentice_menu APPRENTICE_ASK_WHICH_LEVEL apprentice_setlvlmode VAR_RESULT apprentice_shufflespecies - apprentice_buff 0, APPRENTICE_BUFF_LEVEL + apprentice_buff STR_VAR_1, APPRENTICE_BUFF_LEVEL apprentice_msg TRUE, APPRENTICE_MSG_THANKS_LVL_MODE call Apprentice_EventScript_SetHideFlags release @@ -54,22 +46,19 @@ Apprentice_EventScript_RejectTeach: Apprentice_EventScript_UseWhichMon: apprentice_initquestion APPRENTICE_QUESTION_WHICH_MON - apprentice_buff 0, APPRENTICE_BUFF_SPECIES1 - apprentice_buff 1, APPRENTICE_BUFF_SPECIES2 + apprentice_buff STR_VAR_1, APPRENTICE_BUFF_SPECIES1 + apprentice_buff STR_VAR_2, APPRENTICE_BUFF_SPECIES2 apprentice_msg FALSE, APPRENTICE_MSG_WHICH_MON apprentice_menu APPRENTICE_ASK_2SPECIES copyvar VAR_0x8005, VAR_RESULT - compare VAR_0x8005, 0 - call_if_eq Apprentice_EventScript_ChoseFirstMon - compare VAR_0x8005, 1 - call_if_eq Apprentice_EventScript_ChoseSecondMon + call_if_eq VAR_0x8005, 0, Apprentice_EventScript_ChoseFirstMon + call_if_eq VAR_0x8005, 1, Apprentice_EventScript_ChoseSecondMon apprentice_getnumpartymons apprentice_setpartymon VAR_RESULT apprentice_answeredquestion apprentice_getnumpartymons - compare VAR_RESULT, MULTI_PARTY_SIZE - call_if_eq Apprentice_EventScript_LastMonSelected - apprentice_buff 0, VAR_0x8007 + call_if_eq VAR_RESULT, MULTI_PARTY_SIZE, Apprentice_EventScript_LastMonSelected + apprentice_buff STR_VAR_1, VAR_0x8007 apprentice_freequestion apprentice_msg TRUE, APPRENTICE_MSG_THANKS_MON call Apprentice_EventScript_SetHideFlags @@ -94,19 +83,17 @@ Apprentice_EventScript_LastMonSelected: Apprentice_EventScript_UseWhatHeldItem: apprentice_initquestion APPRENTICE_QUESTION_WHAT_ITEM - apprentice_buff 0, APPRENTICE_BUFF_SPECIES3 + apprentice_buff STR_VAR_1, APPRENTICE_BUFF_SPECIES3 apprentice_msg TRUE, APPRENTICE_MSG_WHAT_HELD_ITEM apprentice_freequestion Apprentice_EventScript_ChooseHoldItem: fadescreen FADE_TO_BLACK setvar VAR_RESULT, 0 apprentice_openbag - compare VAR_RESULT, FALSE - goto_if_eq Apprentice_EventScript_ConfirmHoldNothing + goto_if_eq VAR_RESULT, FALSE, Apprentice_EventScript_ConfirmHoldNothing apprentice_trysetitem - compare VAR_RESULT, FALSE - goto_if_eq Apprentice_EventScript_AlreadySuggestedItem - apprentice_buff 0, APPRENTICE_BUFF_ITEM + goto_if_eq VAR_RESULT, FALSE, Apprentice_EventScript_AlreadySuggestedItem + apprentice_buff STR_VAR_1, APPRENTICE_BUFF_ITEM apprentice_msg TRUE, APPRENTICE_MSG_THANKS_HELD_ITEM apprentice_answeredquestion call Apprentice_EventScript_SetHideFlags @@ -119,12 +106,11 @@ Apprentice_EventScript_ChooseHoldItem: Apprentice_EventScript_ConfirmHoldNothing: apprentice_initquestion APPRENTICE_QUESTION_WHAT_ITEM - apprentice_buff 0, APPRENTICE_BUFF_SPECIES3 + apprentice_buff STR_VAR_1, APPRENTICE_BUFF_SPECIES3 apprentice_msg FALSE, APPRENTICE_MSG_HOLD_NOTHING apprentice_menu APPRENTICE_ASK_GIVE apprentice_freequestion - compare VAR_RESULT, 0 - goto_if_eq Apprentice_EventScript_ChooseHoldItem + goto_if_eq VAR_RESULT, 0, Apprentice_EventScript_ChooseHoldItem Apprentice_EventScript_HoldNothing: apprentice_msg TRUE, APPRENTICE_MSG_THANKS_NO_HELD_ITEM apprentice_answeredquestion @@ -140,31 +126,28 @@ Apprentice_EventScript_HoldNothing: @ different item if theyve already told the Apprentice to use it for another mon Apprentice_EventScript_AlreadySuggestedItem: apprentice_initquestion APPRENTICE_QUESTION_WHAT_ITEM - apprentice_buff 0, APPRENTICE_BUFF_ITEM - apprentice_buff 1, APPRENTICE_BUFF_SPECIES3 + apprentice_buff STR_VAR_1, APPRENTICE_BUFF_ITEM + apprentice_buff STR_VAR_2, APPRENTICE_BUFF_SPECIES3 apprentice_msg FALSE, APPRENTICE_MSG_ITEM_ALREADY_SUGGESTED apprentice_menu APPRENTICE_ASK_GIVE apprentice_freequestion - compare VAR_RESULT, 0 - goto_if_eq Apprentice_EventScript_ChooseHoldItem + goto_if_eq VAR_RESULT, 0, Apprentice_EventScript_ChooseHoldItem goto Apprentice_EventScript_HoldNothing end Apprentice_EventScript_UseWhichMove: apprentice_initquestion APPRENTICE_QUESTION_WHICH_MOVE - apprentice_buff 0, APPRENTICE_BUFF_SPECIES3 - apprentice_buff 1, APPRENTICE_BUFF_MOVE1 - apprentice_buff 2, APPRENTICE_BUFF_MOVE2 + apprentice_buff STR_VAR_1, APPRENTICE_BUFF_SPECIES3 + apprentice_buff STR_VAR_2, APPRENTICE_BUFF_MOVE1 + apprentice_buff STR_VAR_3, APPRENTICE_BUFF_MOVE2 apprentice_msg FALSE, APPRENTICE_MSG_WHICH_MOVE apprentice_menu APPRENTICE_ASK_MOVES copyvar VAR_0x8005, VAR_RESULT - compare VAR_0x8005, 0 - call_if_eq Apprentice_EventScript_ChoseMove1 - compare VAR_0x8005, 1 - call_if_eq Apprentice_EventScript_ChoseMove2 + call_if_eq VAR_0x8005, 0, Apprentice_EventScript_ChoseMove1 + call_if_eq VAR_0x8005, 1, Apprentice_EventScript_ChoseMove2 apprentice_setmove apprentice_answeredquestion - apprentice_buff 0, VAR_0x8007 + apprentice_buff STR_VAR_1, VAR_0x8007 apprentice_freequestion apprentice_msg TRUE, APPRENTICE_MSG_THANKS_MOVE call Apprentice_EventScript_SetHideFlags @@ -188,7 +171,7 @@ Apprentice_EventScript_PutWhichMonFirst: apprentice_menu APPRENTICE_ASK_3SPECIES apprentice_setleadmon VAR_RESULT apprentice_answeredquestion - apprentice_buff 0, APPRENTICE_BUFF_LEAD_MON_SPECIES + apprentice_buff STR_VAR_1, APPRENTICE_BUFF_LEAD_MON_SPECIES apprentice_msg TRUE, APPRENTICE_MSG_THANKS_MON_FIRST call Apprentice_EventScript_SetHideFlags release @@ -207,7 +190,7 @@ Apprentice_EventScript_PickWinSpeech: lock faceplayer apprentice_save - apprentice_buff 0, APPRENTICE_BUFF_WIN_SPEECH + apprentice_buff STR_VAR_1, APPRENTICE_BUFF_WIN_SPEECH apprentice_msg TRUE, APPRENTICE_MSG_THANKS_WIN_SPEECH apprentice_reset call Apprentice_EventScript_SetHideFlags @@ -225,16 +208,14 @@ Apprentice_EventScript_SetHideFlags: Apprentice_EventScript_LeaveNorth: apprentice_shouldleave - compare VAR_0x8004, FALSE @ Always TRUE here - goto_if_eq Apprentice_EventScript_DontMove + goto_if_eq VAR_0x8004, FALSE, Apprentice_EventScript_DontMove @ VAR_0x8004 always TRUE here applymovement LOCALID_APPRENTICE, Apprentice_Movement_LeaveNorth waitmovement 0 end Apprentice_EventScript_Leave: apprentice_shouldleave - compare VAR_0x8004, FALSE @ Always TRUE here - goto_if_eq Apprentice_EventScript_DontMove + goto_if_eq VAR_0x8004, FALSE, Apprentice_EventScript_DontMove @ VAR_0x8004 always TRUE here applymovement LOCALID_APPRENTICE, Apprentice_Movement_Leave waitmovement 0 end diff --git a/data/scripts/battle_pike.inc b/data/scripts/battle_pike.inc index 3260bcfd829f..8ca7f5b1af9d 100644 --- a/data/scripts/battle_pike.inc +++ b/data/scripts/battle_pike.inc @@ -50,14 +50,10 @@ BattleFrontier_BattlePikeRoomNormal_EventScript_InitRoomObjects:: setvar VAR_OBJ_GFX_ID_1, OBJ_EVENT_GFX_LINK_RECEPTIONIST setvar VAR_OBJ_GFX_ID_0, OBJ_EVENT_GFX_LINK_RECEPTIONIST pike_getroomtype - compare VAR_RESULT, PIKE_ROOM_STATUS - goto_if_eq BattleFrontier_BattlePikeRoomNormal_EventScript_InitTwoObjectRoom - compare VAR_RESULT, PIKE_ROOM_HARD_BATTLE - goto_if_eq BattleFrontier_BattlePikeRoomNormal_EventScript_InitTwoObjectRoom - compare VAR_RESULT, PIKE_ROOM_DOUBLE_BATTLE - goto_if_eq BattleFrontier_BattlePikeRoomNormal_EventScript_InitTwoObjectRoom - compare VAR_RESULT, PIKE_ROOM_BRAIN - goto_if_eq BattleFrontier_BattlePikeRoomNormal_EventScript_InitBrainRoomObjects + goto_if_eq VAR_RESULT, PIKE_ROOM_STATUS, BattleFrontier_BattlePikeRoomNormal_EventScript_InitTwoObjectRoom + goto_if_eq VAR_RESULT, PIKE_ROOM_HARD_BATTLE, BattleFrontier_BattlePikeRoomNormal_EventScript_InitTwoObjectRoom + goto_if_eq VAR_RESULT, PIKE_ROOM_DOUBLE_BATTLE, BattleFrontier_BattlePikeRoomNormal_EventScript_InitTwoObjectRoom + goto_if_eq VAR_RESULT, PIKE_ROOM_BRAIN, BattleFrontier_BattlePikeRoomNormal_EventScript_InitBrainRoomObjects hideobjectat LOCALID_OBJ_1, MAP_BATTLE_FRONTIER_BATTLE_PIKE_ROOM_NORMAL setvar VAR_TEMP_4, 1 turnobject OBJ_EVENT_ID_PLAYER, DIR_NORTH @@ -114,7 +110,7 @@ BattleFrontier_BattlePikeThreePathRoom_EventScript_WarpNPCRoom:: applymovement OBJ_EVENT_ID_PLAYER, BattleFrontier_BattlePikeRoom_Movement_HidePlayer waitmovement 0 call BattleFrontier_BattlePike_EventScript_CloseCurtain - warpsilent MAP_BATTLE_FRONTIER_BATTLE_PIKE_ROOM_NORMAL, 255, 4, 7 + warpsilent MAP_BATTLE_FRONTIER_BATTLE_PIKE_ROOM_NORMAL, 4, 7 waitstate end @@ -122,7 +118,7 @@ BattleFrontier_BattlePikeThreePathRoom_EventScript_WarpWildMonRoom:: applymovement OBJ_EVENT_ID_PLAYER, BattleFrontier_BattlePikeRoom_Movement_HidePlayer waitmovement 0 call BattleFrontier_BattlePike_EventScript_CloseCurtain - warpsilent MAP_BATTLE_FRONTIER_BATTLE_PIKE_ROOM_WILD_MONS, 255, 4, 19 + warpsilent MAP_BATTLE_FRONTIER_BATTLE_PIKE_ROOM_WILD_MONS, 4, 19 waitstate end @@ -154,10 +150,8 @@ BattleFrontier_BattlePikeRoomNormal_EventScript_NoTurningBack:: BattleFrontier_BattlePikeRoomNormal_EventScript_Exit:: pike_ispartyfullhealth - compare VAR_RESULT, TRUE - call_if_eq BattleFrontier_BattlePikeRoom_EventScript_DisableHealing - compare VAR_RESULT, TRUE - call_if_ne BattleFrontier_BattlePikeRoom_EventScript_EnableHealing + call_if_eq VAR_RESULT, TRUE, BattleFrontier_BattlePikeRoom_EventScript_DisableHealing + call_if_ne VAR_RESULT, TRUE, BattleFrontier_BattlePikeRoom_EventScript_EnableHealing pike_get PIKE_DATA_WIN_STREAK addvar VAR_RESULT, 1 pike_set PIKE_DATA_WIN_STREAK, VAR_RESULT @@ -165,10 +159,8 @@ BattleFrontier_BattlePikeRoomNormal_EventScript_Exit:: addvar VAR_RESULT, 1 frontier_set FRONTIER_DATA_BATTLE_NUM, VAR_RESULT pike_isfinalroom - compare VAR_RESULT, TRUE - call_if_eq BattleFrontier_BattlePikeRoom_EventScript_WarpToFinalRoom - compare VAR_RESULT, FALSE - call_if_eq BattleFrontier_BattlePikeRoom_EventScript_WarpToThreePathRoom + call_if_eq VAR_RESULT, TRUE, BattleFrontier_BattlePikeRoom_EventScript_WarpToFinalRoom + call_if_eq VAR_RESULT, FALSE, BattleFrontier_BattlePikeRoom_EventScript_WarpToThreePathRoom waitstate end @@ -184,23 +176,21 @@ BattleFrontier_BattlePikeRoom_EventScript_WarpToFinalRoom:: applymovement OBJ_EVENT_ID_PLAYER, BattleFrontier_BattlePikeRoom_Movement_HidePlayer waitmovement 0 call BattleFrontier_BattlePike_EventScript_CloseCurtain - warpsilent MAP_BATTLE_FRONTIER_BATTLE_PIKE_ROOM_FINAL, 255, 2, 7 + warpsilent MAP_BATTLE_FRONTIER_BATTLE_PIKE_ROOM_FINAL, 2, 7 return BattleFrontier_BattlePikeRoom_EventScript_WarpToThreePathRoom:: applymovement OBJ_EVENT_ID_PLAYER, BattleFrontier_BattlePikeRoom_Movement_HidePlayer waitmovement 0 call BattleFrontier_BattlePike_EventScript_CloseCurtain - warpsilent MAP_BATTLE_FRONTIER_BATTLE_PIKE_THREE_PATH_ROOM, 255, 6, 10 + warpsilent MAP_BATTLE_FRONTIER_BATTLE_PIKE_THREE_PATH_ROOM, 6, 10 return BattleFrontier_BattlePikeRoomWildMons_EventScript_Exit:: pike_exitwildmonroom pike_ispartyfullhealth - compare VAR_RESULT, TRUE - call_if_eq BattleFrontier_BattlePikeRoom_EventScript_DisableHealing - compare VAR_RESULT, TRUE - call_if_ne BattleFrontier_BattlePikeRoom_EventScript_EnableHealing + call_if_eq VAR_RESULT, TRUE, BattleFrontier_BattlePikeRoom_EventScript_DisableHealing + call_if_ne VAR_RESULT, TRUE, BattleFrontier_BattlePikeRoom_EventScript_EnableHealing pike_get PIKE_DATA_WIN_STREAK addvar VAR_RESULT, 1 pike_set PIKE_DATA_WIN_STREAK, VAR_RESULT @@ -208,10 +198,8 @@ BattleFrontier_BattlePikeRoomWildMons_EventScript_Exit:: addvar VAR_RESULT, 1 frontier_set FRONTIER_DATA_BATTLE_NUM, VAR_RESULT pike_isfinalroom - compare VAR_RESULT, TRUE - call_if_eq BattleFrontier_BattlePikeRoom_EventScript_WarpToFinalRoom - compare VAR_RESULT, FALSE - call_if_eq BattleFrontier_BattlePikeRoom_EventScript_WarpToThreePathRoom + call_if_eq VAR_RESULT, TRUE, BattleFrontier_BattlePikeRoom_EventScript_WarpToFinalRoom + call_if_eq VAR_RESULT, FALSE, BattleFrontier_BattlePikeRoom_EventScript_WarpToThreePathRoom waitstate end @@ -230,17 +218,15 @@ BattleFrontier_BattlePikeRoomWildMons_EventScript_NoTurningBack:: BattleFrontier_BattlePike_EventScript_Retire:: frontier_set FRONTIER_DATA_CHALLENGE_STATUS CHALLENGE_STATUS_LOST - warp MAP_BATTLE_FRONTIER_BATTLE_PIKE_LOBBY, 255, 5, 6 + warp MAP_BATTLE_FRONTIER_BATTLE_PIKE_LOBBY, 5, 6 waitstate end BattleFrontier_BattlePikeRoom_OnResume: setorcopyvar VAR_0x8006, VAR_RESULT @ Save VAR_RESULT from being overwritten frontier_get FRONTIER_DATA_CHALLENGE_STATUS - compare VAR_RESULT, CHALLENGE_STATUS_PAUSED - goto_if_eq BattleFrontier_BattlePikeThreePathRoom_EventScript_EndOnResume - compare VAR_RESULT, CHALLENGE_STATUS_SAVING - goto_if_eq BattleFrontier_BattlePikeThreePathRoom_EventScript_EndOnResume + goto_if_eq VAR_RESULT, CHALLENGE_STATUS_PAUSED, BattleFrontier_BattlePikeThreePathRoom_EventScript_EndOnResume + goto_if_eq VAR_RESULT, CHALLENGE_STATUS_SAVING, BattleFrontier_BattlePikeThreePathRoom_EventScript_EndOnResume call BattleFrontier_BattlePikeRoom_EventScript_ResetSketchedMoves BattleFrontier_BattlePikeThreePathRoom_EventScript_EndOnResume:: setorcopyvar VAR_RESULT, VAR_0x8006 diff --git a/data/scripts/berry_blender.inc b/data/scripts/berry_blender.inc index 1d833f470c71..f860ef066c01 100644 --- a/data/scripts/berry_blender.inc +++ b/data/scripts/berry_blender.inc @@ -249,8 +249,7 @@ BerryBlender_EventScript_BerryBlender1:: applymovement LOCALID_EXPERT_M, BerryBlender_Movement_BlendLeaderWalkInPlace waitmovement 0 msgbox BerryBlender_Text_WantToMakePokeblocks, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq BerryBlender_EventScript_TryUseBerryBlender1 + goto_if_eq VAR_RESULT, YES, BerryBlender_EventScript_TryUseBerryBlender1 goto BerryBlender_EventScript_DeclineBlender1 end @@ -280,8 +279,7 @@ BerryBlender_EventScript_Blender1GiveSpareBerry: BerryBlender_EventScript_UseBerryBlender1: msgbox BerryBlender_Text_KnowHowToMakePokeblocks, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq BerryBlender_EventScript_StartBlender1 + goto_if_eq VAR_RESULT, YES, BerryBlender_EventScript_StartBlender1 goto BerryBlender_EventScript_ExplainBlending1 end @@ -296,15 +294,12 @@ BerryBlender_EventScript_ExplainBlending1: end BerryBlender_EventScript_TryUseBerryBlender1: - checkitem ITEM_POKEBLOCK_CASE, 1 - compare VAR_RESULT, FALSE - goto_if_eq BerryBlender_EventScript_Blender1NoCase + checkitem ITEM_POKEBLOCK_CASE + goto_if_eq VAR_RESULT, FALSE, BerryBlender_EventScript_Blender1NoCase specialvar VAR_RESULT, GetFirstFreePokeblockSlot - compare VAR_RESULT, 65535 - goto_if_eq BerryBlender_EventScript_Blender1CaseFull + goto_if_eq VAR_RESULT, 65535, BerryBlender_EventScript_Blender1CaseFull specialvar VAR_RESULT, PlayerHasBerries - compare VAR_RESULT, FALSE - goto_if_eq BerryBlender_EventScript_Blender1NoBerries + goto_if_eq VAR_RESULT, FALSE, BerryBlender_EventScript_Blender1NoBerries msgbox BerryBlender_Text_Excellent, MSGBOX_DEFAULT goto BerryBlender_EventScript_UseBerryBlender1 end @@ -334,8 +329,7 @@ BerryBlender_EventScript_BerryBlender2:: applymovement LOCALID_MAN, BerryBlender_Movement_BlendLeaderWalkInPlace waitmovement 0 msgbox BerryBlender_Text_WantToBlendPokeblocksWithUs, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq BerryBlender_EventScript_TryUseBerryBlender2 + goto_if_eq VAR_RESULT, YES, BerryBlender_EventScript_TryUseBerryBlender2 goto BerryBlender_EventScript_DeclineBlender2 end @@ -351,8 +345,7 @@ BerryBlender_EventScript_Blender2NoBerries: BerryBlender_EventScript_UseBerryBlender2: msgbox BerryBlender_Text_KnowHowToMakePokeblocks2, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq BerryBlender_EventScript_StartBlender2 + goto_if_eq VAR_RESULT, YES, BerryBlender_EventScript_StartBlender2 goto BerryBlender_EventScript_ExplainBlending2 end @@ -368,17 +361,13 @@ BerryBlender_EventScript_ExplainBlending2: BerryBlender_EventScript_TryUseBerryBlender2: specialvar VAR_RESULT, PlayerHasBerries - compare VAR_RESULT, FALSE - goto_if_eq BerryBlender_EventScript_Blender2NoBerries - checkitem ITEM_POKEBLOCK_CASE, 1 - compare VAR_RESULT, FALSE - goto_if_eq BerryBlender_EventScript_Blender2NoCase + goto_if_eq VAR_RESULT, FALSE, BerryBlender_EventScript_Blender2NoBerries + checkitem ITEM_POKEBLOCK_CASE + goto_if_eq VAR_RESULT, FALSE, BerryBlender_EventScript_Blender2NoCase msgbox BerryBlender_Text_Okay, MSGBOX_DEFAULT specialvar VAR_RESULT, GetFirstFreePokeblockSlot - compare VAR_RESULT, 65535 - goto_if_ne BerryBlender_EventScript_UseBerryBlender2 - compare VAR_RESULT, 65535 - goto_if_eq BerryBlender_EventScript_Blender2CaseFull + goto_if_ne VAR_RESULT, 65535, BerryBlender_EventScript_UseBerryBlender2 + goto_if_eq VAR_RESULT, 65535, BerryBlender_EventScript_Blender2CaseFull end BerryBlender_EventScript_Blender2CaseFull: @@ -400,8 +389,7 @@ BerryBlender_EventScript_BerryBlender3:: applymovement VAR_0x8008, BerryBlender_Movement_BlendLeaderWalkInPlace waitmovement 0 msgbox BerryBlender_Text_LookGoodAtBlendingJoinUs, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq BerryBlender_EventScript_TryUseBlender3 + goto_if_eq VAR_RESULT, YES, BerryBlender_EventScript_TryUseBlender3 goto BerryBlender_EventScript_DeclineBlender3 end @@ -417,8 +405,7 @@ BerryBlender_EventScript_Blender3NoBerries: BerryBlender_EventScript_UseBerryBlender3: msgbox BerryBlender_Text_KnowHowToMakePokeblocks3, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq BerryBlender_EventScript_StartBlender3 + goto_if_eq VAR_RESULT, YES, BerryBlender_EventScript_StartBlender3 goto BerryBlender_EventScript_ExplainBlending3 end @@ -434,17 +421,13 @@ BerryBlender_EventScript_ExplainBlending3: BerryBlender_EventScript_TryUseBlender3: specialvar VAR_RESULT, PlayerHasBerries - compare VAR_RESULT, FALSE - goto_if_eq BerryBlender_EventScript_Blender3NoBerries - checkitem ITEM_POKEBLOCK_CASE, 1 - compare VAR_RESULT, FALSE - goto_if_eq BerryBlender_EventScript_Blender3NoCase + goto_if_eq VAR_RESULT, FALSE, BerryBlender_EventScript_Blender3NoBerries + checkitem ITEM_POKEBLOCK_CASE + goto_if_eq VAR_RESULT, FALSE, BerryBlender_EventScript_Blender3NoCase msgbox BerryBlender_Text_OhDear, MSGBOX_DEFAULT specialvar VAR_RESULT, GetFirstFreePokeblockSlot - compare VAR_RESULT, 65535 - goto_if_ne BerryBlender_EventScript_UseBerryBlender3 - compare VAR_RESULT, 65535 - goto_if_eq BerryBlender_EventScript_Blender3CaseFull + goto_if_ne VAR_RESULT, 65535, BerryBlender_EventScript_UseBerryBlender3 + goto_if_eq VAR_RESULT, 65535, BerryBlender_EventScript_Blender3CaseFull end BerryBlender_EventScript_Blender3CaseFull: @@ -461,8 +444,7 @@ BerryBlender_EventScript_BlendMasterPresent: lockall setvar NUM_OPPONENTS, 1 msgbox BerryBlender_Text_SeeMyMasteryInAction, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq BerryBlender_EventScript_TryBlendWithBlendMaster + goto_if_eq VAR_RESULT, YES, BerryBlender_EventScript_TryBlendWithBlendMaster msgbox BerryBlender_Text_TooBusyNowIsee, MSGBOX_DEFAULT releaseall end @@ -473,23 +455,18 @@ BerryBlender_EventScript_BlendMasterNoBerries: end BerryBlender_EventScript_TryBlendWithBlendMaster: - checkitem ITEM_POKEBLOCK_CASE, 1 - compare VAR_RESULT, FALSE - goto_if_eq BerryBlender_EventScript_BlendMasterNoCase + checkitem ITEM_POKEBLOCK_CASE + goto_if_eq VAR_RESULT, FALSE, BerryBlender_EventScript_BlendMasterNoCase specialvar VAR_RESULT, PlayerHasBerries - compare VAR_RESULT, FALSE - goto_if_eq BerryBlender_EventScript_BlendMasterNoBerries + goto_if_eq VAR_RESULT, FALSE, BerryBlender_EventScript_BlendMasterNoBerries specialvar VAR_RESULT, GetFirstFreePokeblockSlot - compare VAR_RESULT, 65535 - goto_if_ne BerryBlender_EventScript_BlendWithBlendMaster - compare VAR_RESULT, 65535 - goto_if_eq BerryBlender_EventScript_BlendMasterCaseFull + goto_if_ne VAR_RESULT, 65535, BerryBlender_EventScript_BlendWithBlendMaster + goto_if_eq VAR_RESULT, 65535, BerryBlender_EventScript_BlendMasterCaseFull end BerryBlender_EventScript_BlendWithBlendMaster: msgbox BerryBlender_Text_BlendMasterKnowHowToMakePokeblocks, MSGBOX_YESNO - compare VAR_RESULT, NO - call_if_eq BerryBlender_EventScript_BlendMasterExplainBlending + call_if_eq VAR_RESULT, NO, BerryBlender_EventScript_BlendMasterExplainBlending msgbox BerryBlender_Text_BlendMasterLetsBerryBlender, MSGBOX_DEFAULT goto BerryBlender_EventScript_DoBerryBlending end @@ -530,10 +507,8 @@ BerryBlender_EventScript_ExpertMCheckGiveBerry: faceplayer msgbox BerryBlender_Text_LoveMakingPokeblocks, MSGBOX_DEFAULT specialvar VAR_RESULT, PlayerHasBerries - compare VAR_RESULT, TRUE - goto_if_eq BerryBlender_EventScript_ExpertMPlayerHasBerries - compare VAR_RESULT, FALSE - goto_if_eq BerryBlender_EventScript_ExpertMNoBerries + goto_if_eq VAR_RESULT, TRUE, BerryBlender_EventScript_ExpertMPlayerHasBerries + goto_if_eq VAR_RESULT, FALSE, BerryBlender_EventScript_ExpertMNoBerries end BerryBlender_EventScript_ExpertMPlayerHasBerries: @@ -542,12 +517,10 @@ BerryBlender_EventScript_ExpertMPlayerHasBerries: end BerryBlender_EventScript_ExpertMNoBerries: - checkitem ITEM_POKEBLOCK_CASE, 1 - compare VAR_RESULT, FALSE - goto_if_eq BerryBlender_EventScript_ExpertMNoSpareBerries + checkitem ITEM_POKEBLOCK_CASE + goto_if_eq VAR_RESULT, FALSE, BerryBlender_EventScript_ExpertMNoSpareBerries specialvar VAR_RESULT, GetFirstFreePokeblockSlot - compare VAR_RESULT, 65535 - goto_if_eq BerryBlender_EventScript_ExpertMNoSpareBerries + goto_if_eq VAR_RESULT, 65535, BerryBlender_EventScript_ExpertMNoSpareBerries dotimebasedevents goto_if_set FLAG_DAILY_CONTEST_LOBBY_RECEIVED_BERRY, BerryBlender_EventScript_ExpertMNoSpareBerries goto BerryBlender_EventScript_ExpertMGiveBerry @@ -573,24 +546,18 @@ BerryBlender_Movement_BlendLeaderWalkInPlace: BerryBlender_EventScript_BerryBlenderLink:: lockall specialvar VAR_RESULT, PlayerHasBerries - compare VAR_RESULT, FALSE - goto_if_eq BerryBlender_EventScript_LinkBlenderNoBerries - checkitem ITEM_POKEBLOCK_CASE, 1 - compare VAR_RESULT, FALSE - goto_if_eq BerryBlender_EventScript_LinkBlenderNoCase + goto_if_eq VAR_RESULT, FALSE, BerryBlender_EventScript_LinkBlenderNoBerries + checkitem ITEM_POKEBLOCK_CASE + goto_if_eq VAR_RESULT, FALSE, BerryBlender_EventScript_LinkBlenderNoCase specialvar VAR_RESULT, GetFirstFreePokeblockSlot - compare VAR_RESULT, 65535 - goto_if_ne BerryBlender_EventScript_LinkBlenderSaveGame - compare VAR_RESULT, 65535 - goto_if_eq BerryBlender_EventScript_LinkBlenderCaseFull + goto_if_ne VAR_RESULT, 65535, BerryBlender_EventScript_LinkBlenderSaveGame + goto_if_eq VAR_RESULT, 65535, BerryBlender_EventScript_LinkBlenderCaseFull end BerryBlender_EventScript_LinkBlenderSaveGame: msgbox BerryBlender_Text_SaveGameBeforeBerryBlenderLink, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq BerryBlender_EventScript_TryDoLinkBlender - compare VAR_RESULT, NO - goto_if_eq BerryBlender_EventScript_CancelLinkBlender + goto_if_eq VAR_RESULT, YES, BerryBlender_EventScript_TryDoLinkBlender + goto_if_eq VAR_RESULT, NO, BerryBlender_EventScript_CancelLinkBlender end BerryBlender_EventScript_LinkBlenderNoBerries: @@ -600,25 +567,18 @@ BerryBlender_EventScript_LinkBlenderNoBerries: BerryBlender_EventScript_TryDoLinkBlender: call Common_EventScript_SaveGame - compare VAR_RESULT, FALSE - goto_if_eq BerryBlender_EventScript_CancelLinkBlender + goto_if_eq VAR_RESULT, FALSE, BerryBlender_EventScript_CancelLinkBlender specialvar VAR_RESULT, IsWirelessAdapterConnected - compare VAR_RESULT, TRUE - goto_if_eq BerryBlender_EventScript_StartDecideLinkLeader + goto_if_eq VAR_RESULT, TRUE, BerryBlender_EventScript_StartDecideLinkLeader message BerryBlender_Text_SearchingForFriends waitmessage special TryBerryBlenderLinkup waitstate - compare VAR_RESULT, LINKUP_SUCCESS - goto_if_eq BerryBlender_EventScript_SpawnLinkPartners - compare VAR_RESULT, LINKUP_SOMEONE_NOT_READY - goto_if_eq BerryBlender_EventScript_CloseLinkNotReady - compare VAR_RESULT, LINKUP_DIFF_SELECTIONS - goto_if_eq BerryBlender_EventScript_CloseLinkDifferentSelections - compare VAR_RESULT, LINKUP_FAILED - goto_if_eq BerryBlender_EventScript_CloseLink - compare VAR_RESULT, LINKUP_CONNECTION_ERROR - goto_if_eq BerryBlender_EventScript_LinkError + goto_if_eq VAR_RESULT, LINKUP_SUCCESS, BerryBlender_EventScript_SpawnLinkPartners + goto_if_eq VAR_RESULT, LINKUP_SOMEONE_NOT_READY, BerryBlender_EventScript_CloseLinkNotReady + goto_if_eq VAR_RESULT, LINKUP_DIFF_SELECTIONS, BerryBlender_EventScript_CloseLinkDifferentSelections + goto_if_eq VAR_RESULT, LINKUP_FAILED, BerryBlender_EventScript_CloseLink + goto_if_eq VAR_RESULT, LINKUP_CONNECTION_ERROR, BerryBlender_EventScript_LinkError end BerryBlender_EventScript_TwoPlayerLink: @@ -721,23 +681,17 @@ BerryBlender_EventScript_DecideLinkLeader: BerryBlender_EventScript_TryLeadGroup: call BerryBlender_EventScript_TryBecomeLinkLeader - compare VAR_RESULT, LINKUP_SUCCESS - goto_if_eq BerryBlender_EventScript_LinkLeaderDecided - compare VAR_RESULT, LINKUP_FAILED - goto_if_eq BerryBlender_EventScript_DecideLinkLeader - compare VAR_RESULT, LINKUP_RETRY_ROLE_ASSIGN - goto_if_eq BerryBlender_EventScript_TryLeadGroup + goto_if_eq VAR_RESULT, LINKUP_SUCCESS, BerryBlender_EventScript_LinkLeaderDecided + goto_if_eq VAR_RESULT, LINKUP_FAILED, BerryBlender_EventScript_DecideLinkLeader + goto_if_eq VAR_RESULT, LINKUP_RETRY_ROLE_ASSIGN, BerryBlender_EventScript_TryLeadGroup release end BerryBlender_EventScript_TryJoinGroup: call BerryBlender_EventScript_TryJoinLinkGroup - compare VAR_RESULT, LINKUP_SUCCESS - goto_if_eq BerryBlender_EventScript_LinkLeaderDecided - compare VAR_RESULT, LINKUP_FAILED - goto_if_eq BerryBlender_EventScript_DecideLinkLeader - compare VAR_RESULT, LINKUP_RETRY_ROLE_ASSIGN - goto_if_eq BerryBlender_EventScript_TryJoinGroup + goto_if_eq VAR_RESULT, LINKUP_SUCCESS, BerryBlender_EventScript_LinkLeaderDecided + goto_if_eq VAR_RESULT, LINKUP_FAILED, BerryBlender_EventScript_DecideLinkLeader + goto_if_eq VAR_RESULT, LINKUP_RETRY_ROLE_ASSIGN, BerryBlender_EventScript_TryJoinGroup release end diff --git a/data/scripts/berry_tree.inc b/data/scripts/berry_tree.inc index e415d0c657da..8ad300df525b 100644 --- a/data/scripts/berry_tree.inc +++ b/data/scripts/berry_tree.inc @@ -22,8 +22,7 @@ BerryTree_EventScript_CheckSoil:: lock faceplayer specialvar VAR_RESULT, PlayerHasBerries - compare VAR_RESULT, TRUE - goto_if_eq BerryTree_EventScript_WantToPlant + goto_if_eq VAR_RESULT, TRUE, BerryTree_EventScript_WantToPlant message BerryTree_Text_ItsSoftLoamySoil waitmessage waitbuttonpress @@ -32,10 +31,8 @@ BerryTree_EventScript_CheckSoil:: BerryTree_EventScript_WantToPlant:: msgbox BerryTree_Text_WantToPlant, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq BerryTree_EventScript_ChooseBerryToPlant - compare VAR_RESULT, NO - goto_if_eq BerryTree_EventScript_CancelPlanting + goto_if_eq VAR_RESULT, YES, BerryTree_EventScript_ChooseBerryToPlant + goto_if_eq VAR_RESULT, NO, BerryTree_EventScript_CancelPlanting end BerryTree_EventScript_ChooseBerryToPlant:: @@ -43,8 +40,7 @@ BerryTree_EventScript_ChooseBerryToPlant:: closemessage special Bag_ChooseBerry waitstate - compare VAR_ITEM_ID, 0 - goto_if_eq BerryTree_EventScript_CancelPlanting + goto_if_eq VAR_ITEM_ID, 0, BerryTree_EventScript_CancelPlanting removeitem VAR_ITEM_ID call BerryTree_EventScript_PlantBerry @@ -88,37 +84,32 @@ BerryTree_EventScript_CheckBerryStage4:: @ VAR_0x8005 here is the number of times watered @ Buffered by ObjectEventInteractionGetBerryTreeData BerryTree_EventScript_GetCareAdverb:: - compare VAR_0x8005, 0 - goto_if_eq BerryTree_EventScript_SetAdverbPoor - compare VAR_0x8005, 4 - goto_if_eq BerryTree_EventScript_SetAdverbGreat - bufferstring 1, BerryTree_Text_CareAdverbGood + goto_if_eq VAR_0x8005, 0, BerryTree_EventScript_SetAdverbPoor + goto_if_eq VAR_0x8005, 4, BerryTree_EventScript_SetAdverbGreat + bufferstring STR_VAR_2, BerryTree_Text_CareAdverbGood return BerryTree_EventScript_SetAdverbGreat:: - bufferstring 1, BerryTree_Text_CareAdverbGreat + bufferstring STR_VAR_2, BerryTree_Text_CareAdverbGreat return BerryTree_EventScript_SetAdverbPoor:: - bufferstring 1, BerryTree_Text_CareAdverbPoor + bufferstring STR_VAR_2, BerryTree_Text_CareAdverbPoor return @ VAR_0x8006 here is the number of berries BerryTree_EventScript_CheckBerryFullyGrown:: - buffernumberstring 1, VAR_0x8006 + buffernumberstring STR_VAR_2, VAR_0x8006 lock faceplayer special ObjectEventInteractionGetBerryCountString msgbox BerryTree_Text_WantToPick, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq BerryTree_EventScript_PickBerry - compare VAR_RESULT, NO - goto_if_eq BerryTree_EventScript_CancelPickingBerry + goto_if_eq VAR_RESULT, YES, BerryTree_EventScript_PickBerry + goto_if_eq VAR_RESULT, NO, BerryTree_EventScript_CancelPickingBerry BerryTree_EventScript_PickBerry:: special ObjectEventInteractionPickBerryTree - compare VAR_0x8004, 0 - goto_if_eq BerryTree_EventScript_BerryPocketFull + goto_if_eq VAR_0x8004, 0, BerryTree_EventScript_BerryPocketFull special IncrementDailyPickedBerries special ObjectEventInteractionRemoveBerryTree message BerryTree_Text_PickedTheBerry @@ -154,15 +145,12 @@ BerryTree_EventScript_ItemUsePlantBerry:: end BerryTree_EventScript_WantToWater:: - checkitem ITEM_WAILMER_PAIL, 1 - compare VAR_RESULT, 0 - goto_if_eq BerryTree_EventScript_DontWater + checkitem ITEM_WAILMER_PAIL + goto_if_eq VAR_RESULT, FALSE, BerryTree_EventScript_DontWater special ObjectEventInteractionGetBerryName msgbox BerryTree_Text_WantToWater, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq BerryTree_EventScript_WaterBerry - compare VAR_RESULT, NO - goto_if_eq BerryTree_EventScript_DontWater + goto_if_eq VAR_RESULT, YES, BerryTree_EventScript_WaterBerry + goto_if_eq VAR_RESULT, NO, BerryTree_EventScript_DontWater BerryTree_EventScript_DontWater:: releaseall diff --git a/data/scripts/cable_club.inc b/data/scripts/cable_club.inc index d6ea1a707e76..0ab93c40376f 100644 --- a/data/scripts/cable_club.inc +++ b/data/scripts/cable_club.inc @@ -4,11 +4,9 @@ CableClub_OnTransition: CableClub_EventScript_HideOrShowMysteryGiftMan:: specialvar VAR_RESULT, ShouldDistributeEonTicket - compare VAR_RESULT, TRUE - goto_if_eq CableClub_EventScript_ShowMysteryGiftMan + goto_if_eq VAR_RESULT, TRUE, CableClub_EventScript_ShowMysteryGiftMan specialvar VAR_RESULT, ValidateSavedWonderCard - compare VAR_RESULT, FALSE - goto_if_eq CableClub_EventScript_HideMysteryGiftMan + goto_if_eq VAR_RESULT, FALSE, CableClub_EventScript_HideMysteryGiftMan goto CableClub_EventScript_ShowMysteryGiftMan end @@ -22,24 +20,20 @@ CableClub_EventScript_HideMysteryGiftMan:: CableClub_EventScript_MysteryGiftMan:: specialvar VAR_RESULT, ShouldDistributeEonTicket - compare VAR_RESULT, TRUE - goto_if_eq CableClub_EventScript_DistributeEonTicket - goto CableClub_EventScript_AlreadyGotEonTicket + goto_if_eq VAR_RESULT, TRUE, CableClub_EventScript_DistributeEonTicket + goto CableClub_EventScript_TryWonderCardScript end -CableClub_EventScript_AlreadyGotEonTicket:: - gotoram - -@ Unused? +CableClub_EventScript_TryWonderCardScript:: + trywondercardscript CableClub_EventScript_MysteryGiftThankYou:: msgbox gText_ThankYouForAccessingMysteryGift, MSGBOX_NPC end CableClub_EventScript_DistributeEonTicket:: - checkitem ITEM_EON_TICKET, 1 - compare VAR_RESULT, TRUE - goto_if_eq CableClub_EventScript_AlreadyGotEonTicket - goto_if_set FLAG_ENABLE_SHIP_SOUTHERN_ISLAND, CableClub_EventScript_AlreadyGotEonTicket + checkitem ITEM_EON_TICKET + goto_if_eq VAR_RESULT, TRUE, CableClub_EventScript_TryWonderCardScript + goto_if_set FLAG_ENABLE_SHIP_SOUTHERN_ISLAND, CableClub_EventScript_TryWonderCardScript msgbox MysteryGift_Text_TheresATicketForYou, MSGBOX_DEFAULT giveitem ITEM_EON_TICKET setflag FLAG_ENABLE_SHIP_SOUTHERN_ISLAND @@ -66,29 +60,20 @@ CableClub_OnWarp: .2byte 0 CableClub_EventScript_CheckTurnAttendant:: - compare VAR_0x8007, 0 - goto_if_eq CableClub_EventScript_DontTurnAttendant + goto_if_eq VAR_0x8007, 0, CableClub_EventScript_DontTurnAttendant turnobject VAR_0x8007, DIR_WEST CableClub_EventScript_DontTurnAttendant:: end CableClub_OnLoad: - compare VAR_CABLE_CLUB_STATE, USING_SINGLE_BATTLE - goto_if_eq CableClub_EventScript_OnLoadFromColosseum - compare VAR_CABLE_CLUB_STATE, USING_DOUBLE_BATTLE - goto_if_eq CableClub_EventScript_OnLoadFromColosseum - compare VAR_CABLE_CLUB_STATE, USING_MULTI_BATTLE - goto_if_eq CableClub_EventScript_OnLoadFromColosseum - compare VAR_CABLE_CLUB_STATE, USING_TRADE_CENTER - goto_if_eq CableClub_EventScript_OnLoadFromTradeCenter - compare VAR_CABLE_CLUB_STATE, USING_RECORD_CORNER - goto_if_eq CableClub_EventScript_OnLoadFromRecordCorner - compare VAR_CABLE_CLUB_STATE, USING_UNION_ROOM - goto_if_eq CableClub_EventScript_OnLoadFromUnionRoom - compare VAR_CABLE_CLUB_STATE, USING_BERRY_CRUSH - goto_if_eq CableClub_EventScript_OnLoadFromBerryCrush - compare VAR_CABLE_CLUB_STATE, USING_MINIGAME - goto_if_eq CableClub_EventScript_OnLoadFromGameCorner + goto_if_eq VAR_CABLE_CLUB_STATE, USING_SINGLE_BATTLE, CableClub_EventScript_OnLoadFromColosseum + goto_if_eq VAR_CABLE_CLUB_STATE, USING_DOUBLE_BATTLE, CableClub_EventScript_OnLoadFromColosseum + goto_if_eq VAR_CABLE_CLUB_STATE, USING_MULTI_BATTLE, CableClub_EventScript_OnLoadFromColosseum + goto_if_eq VAR_CABLE_CLUB_STATE, USING_TRADE_CENTER, CableClub_EventScript_OnLoadFromTradeCenter + goto_if_eq VAR_CABLE_CLUB_STATE, USING_RECORD_CORNER, CableClub_EventScript_OnLoadFromRecordCorner + goto_if_eq VAR_CABLE_CLUB_STATE, USING_UNION_ROOM, CableClub_EventScript_OnLoadFromUnionRoom + goto_if_eq VAR_CABLE_CLUB_STATE, USING_BERRY_CRUSH, CableClub_EventScript_OnLoadFromBerryCrush + goto_if_eq VAR_CABLE_CLUB_STATE, USING_MINIGAME, CableClub_EventScript_OnLoadFromGameCorner end CableClub_EventScript_OnLoadFromColosseum:: @@ -150,8 +135,7 @@ CableClub_EventScript_ExitMinigameRoom:: CableClub_EventScript_CloseLinkAndExitLinkRoom:: special CloseLink setvar VAR_CABLE_CLUB_STATE, 0 - compare VAR_0x8007, 0 - goto_if_eq CableClub_EventScript_PlayerExitLinkRoom + goto_if_eq VAR_0x8007, 0, CableClub_EventScript_PlayerExitLinkRoom applymovement VAR_0x8007, Movement_AttendantFaceLeft waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, Movement_PlayerExitLinkRoom @@ -173,8 +157,7 @@ CableClub_EventScript_ExitTradeCenter:: CableClub_EventScript_PlayerExitTradeCenter:: special CloseLink setvar VAR_CABLE_CLUB_STATE, 0 - compare VAR_0x8007, 0 - goto_if_eq CableClub_EventScript_PlayerExitLinkRoom + goto_if_eq VAR_0x8007, 0, CableClub_EventScript_PlayerExitLinkRoom applymovement OBJ_EVENT_ID_PLAYER, Movement_PlayerFaceAttendantRight waitmovement 0 applymovement VAR_0x8007, Movement_AttendantFaceLeft @@ -197,8 +180,7 @@ CableClub_EventScript_PlayerExitRecordCorner:: setvar VAR_CABLE_CLUB_STATE, 0 applymovement OBJ_EVENT_ID_PLAYER, Movement_PlayerExitLinkRoom waitmovement 0 - compare VAR_0x8007, 0 - goto_if_eq CableClub_EventScript_ExitRecordCornerRet + goto_if_eq VAR_0x8007, 0, CableClub_EventScript_ExitRecordCornerRet applymovement VAR_0x8007, Movement_AttendantFaceDown waitmovement 0 CableClub_EventScript_ExitRecordCornerRet:: @@ -216,8 +198,7 @@ CableClub_EventScript_ExitUnionRoom:: CableClub_EventScript_PlayerExitUnionRoom:: setvar VAR_CABLE_CLUB_STATE, 0 - compare VAR_0x8007, 0 - goto_if_eq CableClub_EventScript_PlayerExitLinkRoom + goto_if_eq VAR_0x8007, 0, CableClub_EventScript_PlayerExitLinkRoom applymovement OBJ_EVENT_ID_PLAYER, Movement_PlayerFaceAttendantRight waitmovement 0 applymovement VAR_0x8007, Movement_AttendantFaceLeft @@ -325,8 +306,7 @@ CableClub_EventScript_SingleBattleMode:: CableClub_EventScript_DoubleBattleMode:: special HasEnoughMonsForDoubleBattle - compare VAR_RESULT, PLAYER_HAS_TWO_USABLE_MONS - goto_if_ne CableClub_EventScript_NeedTwoMonsForDoubleBattle + goto_if_ne VAR_RESULT, PLAYER_HAS_TWO_USABLE_MONS, CableClub_EventScript_NeedTwoMonsForDoubleBattle setvar VAR_0x8004, USING_DOUBLE_BATTLE goto CableClub_EventScript_TryEnterColosseum end @@ -343,24 +323,17 @@ CableClub_EventScript_MultiBattleMode:: CableClub_EventScript_TryEnterColosseum:: call Common_EventScript_SaveGame - compare VAR_RESULT, 0 - goto_if_eq CableClub_EventScript_AbortLink + goto_if_eq VAR_RESULT, 0, CableClub_EventScript_AbortLink message gText_PleaseWaitForLink waitmessage special TryBattleLinkup waitstate - compare VAR_RESULT, LINKUP_SUCCESS - goto_if_eq CableClub_EventScript_EnterColosseum - compare VAR_RESULT, LINKUP_SOMEONE_NOT_READY - goto_if_eq CableClub_EventScript_AbortLinkSomeoneNotReady - compare VAR_RESULT, LINKUP_DIFF_SELECTIONS - goto_if_eq CableClub_EventScript_AbortLinkDifferentSelections - compare VAR_RESULT, LINKUP_WRONG_NUM_PLAYERS - goto_if_eq CableClub_EventScript_AbortLinkIncorrectNumberOfBattlers - compare VAR_RESULT, LINKUP_FAILED - goto_if_eq CableClub_EventScript_AbortLink - compare VAR_RESULT, LINKUP_CONNECTION_ERROR - goto_if_eq CableClub_EventScript_AbortLinkConnectionError + goto_if_eq VAR_RESULT, LINKUP_SUCCESS, CableClub_EventScript_EnterColosseum + goto_if_eq VAR_RESULT, LINKUP_SOMEONE_NOT_READY, CableClub_EventScript_AbortLinkSomeoneNotReady + goto_if_eq VAR_RESULT, LINKUP_DIFF_SELECTIONS, CableClub_EventScript_AbortLinkDifferentSelections + goto_if_eq VAR_RESULT, LINKUP_WRONG_NUM_PLAYERS, CableClub_EventScript_AbortLinkIncorrectNumberOfBattlers + goto_if_eq VAR_RESULT, LINKUP_FAILED, CableClub_EventScript_AbortLink + goto_if_eq VAR_RESULT, LINKUP_CONNECTION_ERROR, CableClub_EventScript_AbortLinkConnectionError end CableClub_EventScript_EnterColosseum:: @@ -387,10 +360,9 @@ CableClub_EventScript_EnterColosseum:: closedoor 9, 1 waitdooranim release - compare VAR_0x8004, USING_MULTI_BATTLE - goto_if_eq CableClub_EventScript_WarpTo4PColosseum + goto_if_eq VAR_0x8004, USING_MULTI_BATTLE, CableClub_EventScript_WarpTo4PColosseum special SetCableClubWarp - warp MAP_BATTLE_COLOSSEUM_2P, 255, 6, 8 + warp MAP_BATTLE_COLOSSEUM_2P, 6, 8 special DoCableClubWarp waitstate end @@ -403,7 +375,7 @@ CableClub_EventScript_PlayerApproachLinkRoomRight:: CableClub_EventScript_WarpTo4PColosseum:: special SetCableClubWarp - warp MAP_BATTLE_COLOSSEUM_4P, 255, 5, 8 + warp MAP_BATTLE_COLOSSEUM_4P, 5, 8 special DoCableClubWarp waitstate end @@ -443,31 +415,21 @@ CableClub_EventScript_ConfirmNumberAndRestart:: CableClub_EventScript_TradeCenter:: copyvar VAR_0x8007, VAR_LAST_TALKED call CableClub_EventScript_CheckPartyTradeRequirements - compare VAR_RESULT, 0 - goto_if_eq CableClub_EventScript_AbortLink + goto_if_eq VAR_RESULT, 0, CableClub_EventScript_AbortLink call Common_EventScript_SaveGame - compare VAR_RESULT, 0 - goto_if_eq CableClub_EventScript_AbortLink + goto_if_eq VAR_RESULT, 0, CableClub_EventScript_AbortLink message gText_PleaseWaitForLink waitmessage special TryTradeLinkup waitstate - compare VAR_RESULT, LINKUP_SUCCESS - goto_if_eq CableClub_EventScript_EnterTradeCenter - compare VAR_RESULT, LINKUP_SOMEONE_NOT_READY - goto_if_eq CableClub_EventScript_AbortLinkSomeoneNotReady - compare VAR_RESULT, LINKUP_DIFF_SELECTIONS - goto_if_eq CableClub_EventScript_AbortLinkDifferentSelections - compare VAR_RESULT, LINKUP_WRONG_NUM_PLAYERS - goto_if_eq CableClub_EventScript_AbortLinkIncorrectNumberOfParticipants - compare VAR_RESULT, LINKUP_FAILED - goto_if_eq CableClub_EventScript_AbortLink - compare VAR_RESULT, LINKUP_CONNECTION_ERROR - goto_if_eq CableClub_EventScript_AbortLinkConnectionError - compare VAR_RESULT, LINKUP_PLAYER_NOT_READY - goto_if_eq CableClub_EventScript_AbortLinkPlayerNotReady - compare VAR_RESULT, LINKUP_PARTNER_NOT_READY - goto_if_eq CableClub_EventScript_AbortLinkOtherTrainerNotReady + goto_if_eq VAR_RESULT, LINKUP_SUCCESS, CableClub_EventScript_EnterTradeCenter + goto_if_eq VAR_RESULT, LINKUP_SOMEONE_NOT_READY, CableClub_EventScript_AbortLinkSomeoneNotReady + goto_if_eq VAR_RESULT, LINKUP_DIFF_SELECTIONS, CableClub_EventScript_AbortLinkDifferentSelections + goto_if_eq VAR_RESULT, LINKUP_WRONG_NUM_PLAYERS, CableClub_EventScript_AbortLinkIncorrectNumberOfParticipants + goto_if_eq VAR_RESULT, LINKUP_FAILED, CableClub_EventScript_AbortLink + goto_if_eq VAR_RESULT, LINKUP_CONNECTION_ERROR, CableClub_EventScript_AbortLinkConnectionError + goto_if_eq VAR_RESULT, LINKUP_PLAYER_NOT_READY, CableClub_EventScript_AbortLinkPlayerNotReady + goto_if_eq VAR_RESULT, LINKUP_PARTNER_NOT_READY, CableClub_EventScript_AbortLinkOtherTrainerNotReady end CableClub_EventScript_EnterTradeCenter:: @@ -493,18 +455,16 @@ CableClub_EventScript_EnterTradeCenter:: waitdooranim release special SetCableClubWarp - setwarp MAP_TRADE_CENTER, 255, 5, 8 + setwarp MAP_TRADE_CENTER, 5, 8 special DoCableClubWarp waitstate end CableClub_EventScript_CheckPartyTradeRequirements:: specialvar VAR_RESULT, CalculatePlayerPartyCount - compare VAR_RESULT, 2 - goto_if_lt CableClub_EventScript_NeedTwoMonsToTrade + goto_if_lt VAR_RESULT, 2, CableClub_EventScript_NeedTwoMonsToTrade specialvar VAR_RESULT, DoesPartyHaveEnigmaBerry - compare VAR_RESULT, TRUE - goto_if_eq CableClub_EventScript_CantTradeEnigmaBerry + goto_if_eq VAR_RESULT, TRUE, CableClub_EventScript_CantTradeEnigmaBerry setvar VAR_RESULT, 1 return @@ -521,28 +481,20 @@ CableClub_EventScript_CantTradeEnigmaBerry:: CableClub_EventScript_RecordCorner:: copyvar VAR_0x8007, VAR_LAST_TALKED call Common_EventScript_SaveGame - compare VAR_RESULT, 0 - goto_if_eq CableClub_EventScript_AbortLink + goto_if_eq VAR_RESULT, 0, CableClub_EventScript_AbortLink message gText_PleaseWaitForLink waitmessage special TryRecordMixLinkup waitstate special ValidateMixingGameLanguage waitstate - compare VAR_RESULT, LINKUP_FOREIGN_GAME - goto_if_eq CableClub_EventScript_AbortLinkForeignGame - compare VAR_RESULT, LINKUP_SUCCESS - goto_if_eq CableClub_EventScript_EnterRecordCorner - compare VAR_RESULT, LINKUP_SOMEONE_NOT_READY - goto_if_eq CableClub_EventScript_AbortLinkSomeoneNotReady - compare VAR_RESULT, LINKUP_DIFF_SELECTIONS - goto_if_eq CableClub_EventScript_AbortLinkDifferentSelections - compare VAR_RESULT, LINKUP_WRONG_NUM_PLAYERS - goto_if_eq CableClub_EventScript_AbortLinkIncorrectNumberOfParticipants - compare VAR_RESULT, LINKUP_FAILED - goto_if_eq CableClub_EventScript_AbortLink - compare VAR_RESULT, LINKUP_CONNECTION_ERROR - goto_if_eq CableClub_EventScript_AbortLinkConnectionError + goto_if_eq VAR_RESULT, LINKUP_FOREIGN_GAME, CableClub_EventScript_AbortLinkForeignGame + goto_if_eq VAR_RESULT, LINKUP_SUCCESS, CableClub_EventScript_EnterRecordCorner + goto_if_eq VAR_RESULT, LINKUP_SOMEONE_NOT_READY, CableClub_EventScript_AbortLinkSomeoneNotReady + goto_if_eq VAR_RESULT, LINKUP_DIFF_SELECTIONS, CableClub_EventScript_AbortLinkDifferentSelections + goto_if_eq VAR_RESULT, LINKUP_WRONG_NUM_PLAYERS, CableClub_EventScript_AbortLinkIncorrectNumberOfParticipants + goto_if_eq VAR_RESULT, LINKUP_FAILED, CableClub_EventScript_AbortLink + goto_if_eq VAR_RESULT, LINKUP_CONNECTION_ERROR, CableClub_EventScript_AbortLinkConnectionError end CableClub_EventScript_EnterRecordCorner:: @@ -568,7 +520,7 @@ CableClub_EventScript_EnterRecordCorner:: waitdooranim release special SetCableClubWarp - setwarp MAP_RECORD_CORNER, 255, 8, 9 + setwarp MAP_RECORD_CORNER, 8, 9 special DoCableClubWarp waitstate end @@ -726,8 +678,7 @@ EventScript_BattleColosseum_4P_PlayerSpot0:: fadescreen FADE_TO_BLACK special ChooseHalfPartyForBattle waitstate - compare VAR_RESULT, 0 - goto_if_eq EventScript_BattleColosseum_4P_CancelSpotTrigger + goto_if_eq VAR_RESULT, 0, EventScript_BattleColosseum_4P_CancelSpotTrigger setvar VAR_0x8005, 0 special ColosseumPlayerSpotTriggered waitstate @@ -737,8 +688,7 @@ EventScript_BattleColosseum_4P_PlayerSpot1:: fadescreen FADE_TO_BLACK special ChooseHalfPartyForBattle waitstate - compare VAR_RESULT, 0 - goto_if_eq EventScript_BattleColosseum_4P_CancelSpotTrigger + goto_if_eq VAR_RESULT, 0, EventScript_BattleColosseum_4P_CancelSpotTrigger setvar VAR_0x8005, 1 special ColosseumPlayerSpotTriggered waitstate @@ -748,8 +698,7 @@ EventScript_BattleColosseum_4P_PlayerSpot2:: fadescreen FADE_TO_BLACK special ChooseHalfPartyForBattle waitstate - compare VAR_RESULT, 0 - goto_if_eq EventScript_BattleColosseum_4P_CancelSpotTrigger + goto_if_eq VAR_RESULT, 0, EventScript_BattleColosseum_4P_CancelSpotTrigger setvar VAR_0x8005, 2 special ColosseumPlayerSpotTriggered waitstate @@ -759,8 +708,7 @@ EventScript_BattleColosseum_4P_PlayerSpot3:: fadescreen FADE_TO_BLACK special ChooseHalfPartyForBattle waitstate - compare VAR_RESULT, 0 - goto_if_eq EventScript_BattleColosseum_4P_CancelSpotTrigger + goto_if_eq VAR_RESULT, 0, EventScript_BattleColosseum_4P_CancelSpotTrigger setvar VAR_0x8005, 3 special ColosseumPlayerSpotTriggered waitstate @@ -800,36 +748,32 @@ EventScript_RecordCenter_Spot0:: setvar VAR_0x8005, 0 special RecordMixingPlayerSpotTriggered waitstate - compare VAR_TEMP_1, ITEM_NONE - goto_if_ne RecordCorner_EventScript_ReceivedGiftItem + goto_if_ne VAR_TEMP_1, ITEM_NONE, RecordCorner_EventScript_ReceivedGiftItem end EventScript_RecordCenter_Spot1:: setvar VAR_0x8005, 1 special RecordMixingPlayerSpotTriggered waitstate - compare VAR_TEMP_1, ITEM_NONE - goto_if_ne RecordCorner_EventScript_ReceivedGiftItem + goto_if_ne VAR_TEMP_1, ITEM_NONE, RecordCorner_EventScript_ReceivedGiftItem end EventScript_RecordCenter_Spot2:: setvar VAR_0x8005, 2 special RecordMixingPlayerSpotTriggered waitstate - compare VAR_TEMP_1, ITEM_NONE - goto_if_ne RecordCorner_EventScript_ReceivedGiftItem + goto_if_ne VAR_TEMP_1, ITEM_NONE, RecordCorner_EventScript_ReceivedGiftItem end EventScript_RecordCenter_Spot3:: setvar VAR_0x8005, 3 special RecordMixingPlayerSpotTriggered waitstate - compare VAR_TEMP_1, ITEM_NONE - goto_if_ne RecordCorner_EventScript_ReceivedGiftItem + goto_if_ne VAR_TEMP_1, ITEM_NONE, RecordCorner_EventScript_ReceivedGiftItem end RecordCorner_EventScript_ReceivedGiftItem:: - bufferitemname 1, VAR_TEMP_1 + bufferitemname STR_VAR_2, VAR_TEMP_1 message RecordCorner_Text_PlayerSentOverOneX waitmessage waitbuttonpress @@ -870,8 +814,7 @@ TradeCenter_EventScript_Attendant:: end RecordCorner_EventScript_Attendant:: - compare VAR_TEMP_0, 0 - goto_if_ne RecordCorner_EventScript_AlreadyMixed + goto_if_ne VAR_TEMP_0, 0, RecordCorner_EventScript_AlreadyMixed special Script_FacePlayer message RecordCorner_Text_TakeSeatAndWait waitmessage @@ -891,8 +834,7 @@ RecordCorner_EventScript_AlreadyMixed:: EventScript_ConfirmLeaveCableClubRoom:: msgbox Text_TerminateLinkConfirmation, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq EventScript_TerminateLink + goto_if_eq VAR_RESULT, YES, EventScript_TerminateLink erasebox 0, 0, 29, 19 releaseall end @@ -915,12 +857,10 @@ CableClub_EventScript_UnionRoomAttendant:: setvar VAR_FRONTIER_FACILITY, FACILITY_UNION_ROOM goto_if_unset FLAG_SYS_POKEDEX_GET, CableClub_EventScript_WirelessClubAdjustements specialvar VAR_RESULT, IsBadEggInParty - compare VAR_RESULT, TRUE - goto_if_eq CableClub_EventScript_AbortLinkPlayerHasBadEgg + goto_if_eq VAR_RESULT, TRUE, CableClub_EventScript_AbortLinkPlayerHasBadEgg copyvar VAR_0x8007, VAR_LAST_TALKED specialvar VAR_RESULT, IsWirelessAdapterConnected - compare VAR_RESULT, FALSE - goto_if_eq CableClub_EventScript_UnionRoomAdapterNotConnected + goto_if_eq VAR_RESULT, FALSE, CableClub_EventScript_UnionRoomAdapterNotConnected message CableClub_Text_WelcomeUnionRoomEnter waitmessage goto CableClub_EventScript_UnionRoomSelect @@ -943,11 +883,9 @@ CableClub_EventScript_UnionRoomInfo:: CableClub_EventScript_EnterUnionRoom:: call CableClub_EventScript_CheckPartyUnionRoomRequirements - compare VAR_RESULT, 0 - goto_if_eq CableClub_EventScript_AbortLink + goto_if_eq VAR_RESULT, 0, CableClub_EventScript_AbortLink call Common_EventScript_SaveGame - compare VAR_RESULT, 0 - goto_if_eq CableClub_EventScript_AbortLink + goto_if_eq VAR_RESULT, 0, CableClub_EventScript_AbortLink msgbox CableClub_Text_EnjoyUnionRoom, MSGBOX_DEFAULT closemessage special HealPlayerParty @@ -970,7 +908,7 @@ CableClub_EventScript_EnterUnionRoom:: waitdooranim special Script_ResetUnionRoomTrade special SetCableClubWarp - warpteleport2 MAP_UNION_ROOM, 255, 7, 11 + warpspinenter MAP_UNION_ROOM, 7, 11 waitstate special RunUnionRoom waitstate @@ -978,11 +916,9 @@ CableClub_EventScript_EnterUnionRoom:: CableClub_EventScript_CheckPartyUnionRoomRequirements:: specialvar VAR_RESULT, CountPartyNonEggMons - compare VAR_RESULT, 2 - goto_if_lt CableClub_EventScript_NeedTwoMonsForUnionRoom + goto_if_lt VAR_RESULT, 2, CableClub_EventScript_NeedTwoMonsForUnionRoom specialvar VAR_RESULT, DoesPartyHaveEnigmaBerry - compare VAR_RESULT, TRUE - goto_if_eq CableClub_EventScript_NoEnigmaBerryInUnionRoom + goto_if_eq VAR_RESULT, TRUE, CableClub_EventScript_NoEnigmaBerryInUnionRoom setvar VAR_RESULT, 1 return @@ -1006,8 +942,7 @@ CableClub_EventScript_WirelessClubAttendant:: faceplayer goto_if_unset FLAG_SYS_POKEDEX_GET, CableClub_EventScript_WirelessClubAdjustements msgbox CableClub_Text_AskAboutLinking, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq CableClub_EventScript_DontAskAboutLinking + goto_if_eq VAR_RESULT, NO, CableClub_EventScript_DontAskAboutLinking msgbox CableClub_Text_ExplainWirelessClub, MSGBOX_DEFAULT release return @@ -1023,11 +958,9 @@ CableClub_EventScript_DirectCornerAttendant:: setvar VAR_FRONTIER_FACILITY, FACILITY_MULTI_OR_EREADER @ Set preemptively for multi battles, ignored otherwise goto_if_unset FLAG_SYS_POKEDEX_GET, CableClub_EventScript_WirelessClubAdjustements specialvar VAR_RESULT, IsBadEggInParty - compare VAR_RESULT, TRUE - goto_if_eq CableClub_EventScript_AbortLinkPlayerHasBadEgg + goto_if_eq VAR_RESULT, TRUE, CableClub_EventScript_AbortLinkPlayerHasBadEgg specialvar VAR_RESULT, IsWirelessAdapterConnected - compare VAR_RESULT, FALSE - goto_if_eq CableClub_EventScript_WelcomeToCableClub + goto_if_eq VAR_RESULT, FALSE, CableClub_EventScript_WelcomeToCableClub message CableClub_Text_WelcomeWhichDirectCornerRoom waitmessage delay 28 @@ -1035,9 +968,8 @@ CableClub_EventScript_DirectCornerAttendant:: end CableClub_EventScript_DirectCornerSelectService:: - checkitem ITEM_POWDER_JAR, 1 - compare VAR_RESULT, FALSE - goto_if_eq CableClub_EventScript_DirectCornerNoBerry + checkitem ITEM_POWDER_JAR + goto_if_eq VAR_RESULT, FALSE, CableClub_EventScript_DirectCornerNoBerry goto_if_set FLAG_VISITED_MAUVILLE_CITY, CableClub_EventScript_DirectCornerSelectAllServices multichoice 0, 0, MULTI_WIRELESS_NO_RECORD, FALSE switch VAR_RESULT @@ -1081,11 +1013,9 @@ CableClub_EventScript_DirectCornerHasRecordMix:: CableClub_EventScript_WirelessTrade:: msgbox CableClub_Text_TradePokemon, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq CableClub_EventScript_AbortLink + goto_if_eq VAR_RESULT, NO, CableClub_EventScript_AbortLink call CableClub_EventScript_CheckPartyTradeRequirements - compare VAR_RESULT, 0 - goto_if_eq CableClub_EventScript_AbortLink + goto_if_eq VAR_RESULT, 0, CableClub_EventScript_AbortLink setvar VAR_0x8004, LINK_GROUP_TRADE goto CableClub_EventScript_SaveAndChooseLinkLeader end @@ -1110,8 +1040,7 @@ CableClub_EventScript_WirelessSingleBattle:: CableClub_EventScript_WirelessDoubleBattle:: special HasEnoughMonsForDoubleBattle - compare VAR_RESULT, PLAYER_HAS_TWO_USABLE_MONS - goto_if_ne CableClub_EventScript_TwoMonsNeededForWirelessDoubleBattle + goto_if_ne VAR_RESULT, PLAYER_HAS_TWO_USABLE_MONS, CableClub_EventScript_TwoMonsNeededForWirelessDoubleBattle setvar VAR_0x8004, LINK_GROUP_DOUBLE_BATTLE goto CableClub_EventScript_SaveAndChooseLinkLeader end @@ -1133,19 +1062,16 @@ CableClub_EventScript_WirelessBattleInfo:: CableClub_EventScript_WirelessRecordMix:: msgbox CableClub_Text_AccessRecordCorner, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq CableClub_EventScript_AbortLink + goto_if_eq VAR_RESULT, NO, CableClub_EventScript_AbortLink setvar VAR_0x8004, LINK_GROUP_RECORD_CORNER goto CableClub_EventScript_SaveAndChooseLinkLeader end CableClub_EventScript_WirelessBerryCrush:: msgbox CableClub_Text_UseBerryCrush, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq CableClub_EventScript_AbortLink + goto_if_eq VAR_RESULT, NO, CableClub_EventScript_AbortLink special HasAtLeastOneBerry - compare VAR_RESULT, FALSE - goto_if_eq CableClub_EventScript_NeedBerryForBerryCrush + goto_if_eq VAR_RESULT, FALSE, CableClub_EventScript_NeedBerryForBerryCrush setvar VAR_0x8004, LINK_GROUP_BERRY_CRUSH goto CableClub_EventScript_SaveAndChooseLinkLeader end @@ -1157,8 +1083,7 @@ CableClub_EventScript_NeedBerryForBerryCrush:: CableClub_EventScript_SaveAndChooseLinkLeader:: call Common_EventScript_SaveGame - compare VAR_RESULT, 0 - goto_if_eq CableClub_EventScript_AbortLink + goto_if_eq VAR_RESULT, 0, CableClub_EventScript_AbortLink switch VAR_0x8004 case LINK_GROUP_TRADE, CableClub_EventScript_ChooseLinkLeaderFrom2 case LINK_GROUP_SINGLE_BATTLE, CableClub_EventScript_ChooseLinkLeaderFrom2 @@ -1181,23 +1106,17 @@ CableClub_EventScript_ChooseLinkLeaderFrom2:: CableClub_EventScript_TryLeadGroup2Players:: call CableClub_EventScript_TryBecomeLinkLeader - compare VAR_RESULT, LINKUP_SUCCESS - goto_if_eq CableClub_EventScript_EnterWirelessLinkRoom - compare VAR_RESULT, LINKUP_FAILED - goto_if_eq CableClub_EventScript_ChooseLinkLeaderFrom2 - compare VAR_RESULT, LINKUP_RETRY_ROLE_ASSIGN - goto_if_eq CableClub_EventScript_TryLeadGroup2Players + goto_if_eq VAR_RESULT, LINKUP_SUCCESS, CableClub_EventScript_EnterWirelessLinkRoom + goto_if_eq VAR_RESULT, LINKUP_FAILED, CableClub_EventScript_ChooseLinkLeaderFrom2 + goto_if_eq VAR_RESULT, LINKUP_RETRY_ROLE_ASSIGN, CableClub_EventScript_TryLeadGroup2Players release return CableClub_EventScript_TryJoinGroup2Players:: call CableClub_EventScript_TryJoinLinkGroup - compare VAR_RESULT, LINKUP_SUCCESS - goto_if_eq CableClub_EventScript_EnterWirelessLinkRoom - compare VAR_RESULT, LINKUP_FAILED - goto_if_eq CableClub_EventScript_ChooseLinkLeaderFrom2 - compare VAR_RESULT, LINKUP_RETRY_ROLE_ASSIGN - goto_if_eq CableClub_EventScript_TryJoinGroup2Players + goto_if_eq VAR_RESULT, LINKUP_SUCCESS, CableClub_EventScript_EnterWirelessLinkRoom + goto_if_eq VAR_RESULT, LINKUP_FAILED, CableClub_EventScript_ChooseLinkLeaderFrom2 + goto_if_eq VAR_RESULT, LINKUP_RETRY_ROLE_ASSIGN, CableClub_EventScript_TryJoinGroup2Players release return @@ -1214,23 +1133,17 @@ CableClub_EventScript_ChooseLinkLeaderFrom4:: CableClub_EventScript_TryLeadGroup4Players:: call CableClub_EventScript_TryBecomeLinkLeader - compare VAR_RESULT, LINKUP_SUCCESS - goto_if_eq CableClub_EventScript_EnterWirelessLinkRoom - compare VAR_RESULT, LINKUP_FAILED - goto_if_eq CableClub_EventScript_ChooseLinkLeaderFrom4 - compare VAR_RESULT, LINKUP_RETRY_ROLE_ASSIGN - goto_if_eq CableClub_EventScript_TryLeadGroup4Players + goto_if_eq VAR_RESULT, LINKUP_SUCCESS, CableClub_EventScript_EnterWirelessLinkRoom + goto_if_eq VAR_RESULT, LINKUP_FAILED, CableClub_EventScript_ChooseLinkLeaderFrom4 + goto_if_eq VAR_RESULT, LINKUP_RETRY_ROLE_ASSIGN, CableClub_EventScript_TryLeadGroup4Players release return CableClub_EventScript_TryJoinGroup4Players:: call CableClub_EventScript_TryJoinLinkGroup - compare VAR_RESULT, LINKUP_SUCCESS - goto_if_eq CableClub_EventScript_EnterWirelessLinkRoom - compare VAR_RESULT, LINKUP_FAILED - goto_if_eq CableClub_EventScript_ChooseLinkLeaderFrom4 - compare VAR_RESULT, LINKUP_RETRY_ROLE_ASSIGN - goto_if_eq CableClub_EventScript_TryJoinGroup4Players + goto_if_eq VAR_RESULT, LINKUP_SUCCESS, CableClub_EventScript_EnterWirelessLinkRoom + goto_if_eq VAR_RESULT, LINKUP_FAILED, CableClub_EventScript_ChooseLinkLeaderFrom4 + goto_if_eq VAR_RESULT, LINKUP_RETRY_ROLE_ASSIGN, CableClub_EventScript_TryJoinGroup4Players release return @@ -1247,23 +1160,17 @@ CableClub_EventScript_ChooseLinkLeader:: CableClub_EventScript_TryLeadGroupXPlayers:: call CableClub_EventScript_TryBecomeLinkLeader - compare VAR_RESULT, LINKUP_SUCCESS - goto_if_eq CableClub_EventScript_EnterWirelessLinkRoom - compare VAR_RESULT, LINKUP_FAILED - goto_if_eq CableClub_EventScript_ChooseLinkLeader - compare VAR_RESULT, LINKUP_RETRY_ROLE_ASSIGN - goto_if_eq CableClub_EventScript_TryLeadGroupXPlayers + goto_if_eq VAR_RESULT, LINKUP_SUCCESS, CableClub_EventScript_EnterWirelessLinkRoom + goto_if_eq VAR_RESULT, LINKUP_FAILED, CableClub_EventScript_ChooseLinkLeader + goto_if_eq VAR_RESULT, LINKUP_RETRY_ROLE_ASSIGN, CableClub_EventScript_TryLeadGroupXPlayers release return CableClub_EventScript_TryJoinGroupXPlayers:: call CableClub_EventScript_TryJoinLinkGroup - compare VAR_RESULT, LINKUP_SUCCESS - goto_if_eq CableClub_EventScript_EnterWirelessLinkRoom - compare VAR_RESULT, LINKUP_FAILED - goto_if_eq CableClub_EventScript_ChooseLinkLeader - compare VAR_RESULT, LINKUP_RETRY_ROLE_ASSIGN - goto_if_eq CableClub_EventScript_TryJoinGroupXPlayers + goto_if_eq VAR_RESULT, LINKUP_SUCCESS, CableClub_EventScript_EnterWirelessLinkRoom + goto_if_eq VAR_RESULT, LINKUP_FAILED, CableClub_EventScript_ChooseLinkLeader + goto_if_eq VAR_RESULT, LINKUP_RETRY_ROLE_ASSIGN, CableClub_EventScript_TryJoinGroupXPlayers release return @@ -1307,8 +1214,7 @@ EventScript_WirelessBoxResults:: lockall goto_if_unset FLAG_SYS_POKEDEX_GET, CableClub_EventScript_NotReadyYet specialvar VAR_RESULT, IsWirelessAdapterConnected - compare VAR_RESULT, FALSE - goto_if_eq CableClub_EventScript_AdapterNotConnected + goto_if_eq VAR_RESULT, FALSE, CableClub_EventScript_AdapterNotConnected fadescreen FADE_TO_BLACK special ShowWirelessCommunicationScreen waitstate @@ -1322,33 +1228,33 @@ CableClub_EventScript_AdapterNotConnected:: end CableClub_EventScript_OpenUnionRoomBarrier:: - setmetatile 5, 2, METATILE_PokemonCenter_Floor_ShadowTop_Alt, 0 - setmetatile 5, 3, METATILE_PokemonCenter_Floor_Plain_Alt, 0 + setmetatile 5, 2, METATILE_PokemonCenter_Floor_ShadowTop_Alt, FALSE + setmetatile 5, 3, METATILE_PokemonCenter_Floor_Plain_Alt, FALSE return CableClub_EventScript_CloseUnionRoomBarrier:: - setmetatile 5, 2, METATILE_PokemonCenter_Floor_ShadowTop, 1 - setmetatile 5, 3, METATILE_PokemonCenter_CounterBarrier, 1 + setmetatile 5, 2, METATILE_PokemonCenter_Floor_ShadowTop, TRUE + setmetatile 5, 3, METATILE_PokemonCenter_CounterBarrier, TRUE return CableClub_EventScript_OpenDirectCornerBarrier:: - setmetatile 9, 2, METATILE_PokemonCenter_Floor_ShadowTop_Alt, 0 - setmetatile 9, 3, METATILE_PokemonCenter_Floor_Plain_Alt, 0 + setmetatile 9, 2, METATILE_PokemonCenter_Floor_ShadowTop_Alt, FALSE + setmetatile 9, 3, METATILE_PokemonCenter_Floor_Plain_Alt, FALSE return CableClub_EventScript_CloseDirectCornerBarrier:: - setmetatile 9, 2, METATILE_PokemonCenter_Floor_ShadowTop, 1 - setmetatile 9, 3, METATILE_PokemonCenter_CounterBarrier, 1 + setmetatile 9, 2, METATILE_PokemonCenter_Floor_ShadowTop, TRUE + setmetatile 9, 3, METATILE_PokemonCenter_CounterBarrier, TRUE return EventScript_OpenMossdeepGameCornerBarrier:: - setmetatile 5, 2, METATILE_MossdeepGameCorner_CounterOpen_Top, 0 - setmetatile 5, 3, METATILE_MossdeepGameCorner_CounterOpen_Bottom, 0 + setmetatile 5, 2, METATILE_MossdeepGameCorner_CounterOpen_Top, FALSE + setmetatile 5, 3, METATILE_MossdeepGameCorner_CounterOpen_Bottom, FALSE return EventScript_CloseMossdeepGameCornerBarrier:: - setmetatile 5, 2, METATILE_MossdeepGameCorner_CounterClosed_Top, 1 - setmetatile 5, 3, METATILE_MossdeepGameCorner_CounterClosed_Bottom, 1 + setmetatile 5, 2, METATILE_MossdeepGameCorner_CounterClosed_Top, TRUE + setmetatile 5, 3, METATILE_MossdeepGameCorner_CounterClosed_Bottom, TRUE return CableClub_OnResume: @@ -1389,8 +1295,7 @@ MossdeepCity_GameCorner_1F_EventScript_OldMan2:: message MossdeepCity_GameCorner_1F_Text_WelcomeCanYouWait waitmessage specialvar VAR_RESULT, IsWirelessAdapterConnected - compare VAR_RESULT, FALSE - goto_if_eq MossdeepCity_GameCorner_1F_EventScript_AdapterNotConnected + goto_if_eq VAR_RESULT, FALSE, MossdeepCity_GameCorner_1F_EventScript_AdapterNotConnected delay 60 message MossdeepCity_GameCorner_1F_Text_PlayWhichGame waitmessage @@ -1405,18 +1310,15 @@ MossdeepCity_GameCorner_1F_EventScript_OldMan2:: MossdeepCity_GameCorner_1F_EventScript_PlayPokemonJump:: setvar VAR_0x8005, 0 special IsPokemonJumpSpeciesInParty - compare VAR_RESULT, FALSE - goto_if_eq MossdeepCity_GameCorner_1F_EventScript_DontHaveRequiredMon + goto_if_eq VAR_RESULT, FALSE, MossdeepCity_GameCorner_1F_EventScript_DontHaveRequiredMon msgbox MossdeepCity_GameCorner_1F_Text_EnterWhichPokemon, MSGBOX_DEFAULT fadescreen FADE_TO_BLACK setvar VAR_0x8005, 0 special ChooseMonForWirelessMinigame waitstate - compare VAR_0x8004, PARTY_SIZE - goto_if_ge MossdeepCity_GameCorner_1F_EventScript_AbortMinigame + goto_if_ge VAR_0x8004, PARTY_SIZE, MossdeepCity_GameCorner_1F_EventScript_AbortMinigame call Common_EventScript_SaveGame - compare VAR_RESULT, 0 - goto_if_eq MossdeepCity_GameCorner_1F_EventScript_AbortMinigame + goto_if_eq VAR_RESULT, 0, MossdeepCity_GameCorner_1F_EventScript_AbortMinigame setvar VAR_0x8004, LINK_GROUP_POKEMON_JUMP goto MossdeepCity_GameCorner_1F_EventScript_ChooseLinkLeader end @@ -1424,18 +1326,15 @@ MossdeepCity_GameCorner_1F_EventScript_PlayPokemonJump:: MossdeepCity_GameCorner_1F_EventScript_PlayDodrioBerryPicking:: setvar VAR_0x8005, 1 special IsDodrioInParty - compare VAR_RESULT, FALSE - goto_if_eq MossdeepCity_GameCorner_1F_EventScript_DontHaveRequiredMon + goto_if_eq VAR_RESULT, FALSE, MossdeepCity_GameCorner_1F_EventScript_DontHaveRequiredMon msgbox MossdeepCity_GameCorner_1F_Text_EnterWhichPokemon, MSGBOX_DEFAULT fadescreen FADE_TO_BLACK setvar VAR_0x8005, 1 special ChooseMonForWirelessMinigame waitstate - compare VAR_0x8004, PARTY_SIZE - goto_if_ge MossdeepCity_GameCorner_1F_EventScript_AbortMinigame + goto_if_ge VAR_0x8004, PARTY_SIZE, MossdeepCity_GameCorner_1F_EventScript_AbortMinigame call Common_EventScript_SaveGame - compare VAR_RESULT, 0 - goto_if_eq MossdeepCity_GameCorner_1F_EventScript_AbortMinigame + goto_if_eq VAR_RESULT, 0, MossdeepCity_GameCorner_1F_EventScript_AbortMinigame setvar VAR_0x8004, LINK_GROUP_BERRY_PICKING goto MossdeepCity_GameCorner_1F_EventScript_ChooseLinkLeader end @@ -1453,23 +1352,17 @@ MossdeepCity_GameCorner_1F_EventScript_ChooseLinkLeader:: MossdeepCity_GameCorner_1F_EventScript_TryBecomeLinkLeader:: call CableClub_EventScript_TryBecomeLinkLeader - compare VAR_RESULT, LINKUP_SUCCESS - goto_if_eq MossdeepCity_GameCorner_1F_EventScript_EnterMinigameRoom - compare VAR_RESULT, LINKUP_FAILED - goto_if_eq MossdeepCity_GameCorner_1F_EventScript_ChooseLinkLeader - compare VAR_RESULT, LINKUP_RETRY_ROLE_ASSIGN - goto_if_eq MossdeepCity_GameCorner_1F_EventScript_TryBecomeLinkLeader + goto_if_eq VAR_RESULT, LINKUP_SUCCESS, MossdeepCity_GameCorner_1F_EventScript_EnterMinigameRoom + goto_if_eq VAR_RESULT, LINKUP_FAILED, MossdeepCity_GameCorner_1F_EventScript_ChooseLinkLeader + goto_if_eq VAR_RESULT, LINKUP_RETRY_ROLE_ASSIGN, MossdeepCity_GameCorner_1F_EventScript_TryBecomeLinkLeader release return MossdeepCity_GameCorner_1F_EventScript_TryJoinLinkGroup:: call CableClub_EventScript_TryJoinLinkGroup - compare VAR_RESULT, LINKUP_SUCCESS - goto_if_eq MossdeepCity_GameCorner_1F_EventScript_EnterMinigameRoom - compare VAR_RESULT, LINKUP_FAILED - goto_if_eq MossdeepCity_GameCorner_1F_EventScript_ChooseLinkLeader - compare VAR_RESULT, LINKUP_RETRY_ROLE_ASSIGN - goto_if_eq MossdeepCity_GameCorner_1F_EventScript_TryJoinLinkGroup + goto_if_eq VAR_RESULT, LINKUP_SUCCESS, MossdeepCity_GameCorner_1F_EventScript_EnterMinigameRoom + goto_if_eq VAR_RESULT, LINKUP_FAILED, MossdeepCity_GameCorner_1F_EventScript_ChooseLinkLeader + goto_if_eq VAR_RESULT, LINKUP_RETRY_ROLE_ASSIGN, MossdeepCity_GameCorner_1F_EventScript_TryJoinLinkGroup release return @@ -1501,12 +1394,9 @@ MossdeepCity_GameCorner_1F_EventScript_AdapterNotConnected:: MossdeepCity_GameCorner_1F_EventScript_DontHaveRequiredMon:: msgbox MossdeepCity_GameCorner_1F_Text_ExplainRequiredMon, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq MossdeepCity_GameCorner_1F_EventScript_AbortMinigame - compare VAR_0x8005, 0 - call_if_eq MossdeepCity_GameCorner_1F_EventScript_ExplainPokemonJumpRequirements - compare VAR_0x8005, 1 - call_if_eq MossdeepCity_GameCorner_1F_EventScript_ExplainDodrioBerryPickingRequirements + goto_if_eq VAR_RESULT, NO, MossdeepCity_GameCorner_1F_EventScript_AbortMinigame + call_if_eq VAR_0x8005, 0, MossdeepCity_GameCorner_1F_EventScript_ExplainPokemonJumpRequirements + call_if_eq VAR_0x8005, 1, MossdeepCity_GameCorner_1F_EventScript_ExplainDodrioBerryPickingRequirements goto MossdeepCity_GameCorner_1F_EventScript_AbortMinigame end diff --git a/data/scripts/contest_hall.inc b/data/scripts/contest_hall.inc index 17364559bb26..04c62a6de317 100644 --- a/data/scripts/contest_hall.inc +++ b/data/scripts/contest_hall.inc @@ -18,8 +18,7 @@ LilycoveCity_ContestLobby_EventScript_SpeakToContestReceptionist:: lock faceplayer - compare VAR_CONTEST_PRIZE_PICKUP, 0 - goto_if_ne LilycoveCity_ContestLobby_EventScript_PickUpPrize + goto_if_ne VAR_CONTEST_PRIZE_PICKUP, 0, LilycoveCity_ContestLobby_EventScript_PickUpPrize call_if_set FLAG_RECEIVED_POKEBLOCK_CASE, LilycoveCity_ContestLobby_EventScript_ReceptionWelcome call_if_unset FLAG_RECEIVED_POKEBLOCK_CASE, LilycoveCity_ContestLobby_EventScript_GivePokeblockCase goto LilycoveCity_ContestLobby_EventScript_AskEnterContest @@ -44,8 +43,7 @@ LilycoveCity_ContestLobby_EventScript_PickUpPrize:: LilycoveCity_ContestLobby_EventScript_GiveLuxuryBallAtCounter:: giveitem ITEM_LUXURY_BALL - compare VAR_RESULT, FALSE - goto_if_eq LilycoveCity_ContestLobby_EventScript_NoRoomForLuxuryBallAtCounter + goto_if_eq VAR_RESULT, FALSE, LilycoveCity_ContestLobby_EventScript_NoRoomForLuxuryBallAtCounter setvar VAR_CONTEST_PRIZE_PICKUP, 0 closemessage release @@ -103,19 +101,13 @@ LilycoveCity_ContestLobby_EventScript_CancelEnterContest:: LilycoveCity_ContestLobby_EventScript_ChooseContestMon:: msgbox LilycoveCity_ContestLobby_Text_EnterWhichPokemon1, MSGBOX_DEFAULT choosecontestmon - compare VAR_0x8004, 255 - goto_if_eq LilycoveCity_ContestLobby_EventScript_CancelEnterContest + goto_if_eq VAR_0x8004, PARTY_NOTHING_CHOSEN, LilycoveCity_ContestLobby_EventScript_CancelEnterContest special TryEnterContestMon - compare VAR_RESULT, CANT_ENTER_CONTEST - goto_if_eq LilycoveCity_ContestLobby_EventScript_CantEnterLowRank - compare VAR_RESULT, CAN_ENTER_CONTEST_EQUAL_RANK - goto_if_eq LilycoveCity_ContestLobby_EventScript_EnterMon - compare VAR_RESULT, CAN_ENTER_CONTEST_HIGH_RANK - goto_if_eq LilycoveCity_ContestLobby_EventScript_ConfirmEntryAlreadyWon - compare VAR_RESULT, CANT_ENTER_CONTEST_EGG - goto_if_eq LilycoveCity_ContestLobby_EventScript_CantEnterEgg - compare VAR_RESULT, CANT_ENTER_CONTEST_FAINTED - goto_if_eq LilycoveCity_ContestLobby_EventScript_CantEnterFainted + goto_if_eq VAR_RESULT, CANT_ENTER_CONTEST, LilycoveCity_ContestLobby_EventScript_CantEnterLowRank + goto_if_eq VAR_RESULT, CAN_ENTER_CONTEST_EQUAL_RANK, LilycoveCity_ContestLobby_EventScript_EnterMon + goto_if_eq VAR_RESULT, CAN_ENTER_CONTEST_HIGH_RANK, LilycoveCity_ContestLobby_EventScript_ConfirmEntryAlreadyWon + goto_if_eq VAR_RESULT, CANT_ENTER_CONTEST_EGG, LilycoveCity_ContestLobby_EventScript_CantEnterEgg + goto_if_eq VAR_RESULT, CANT_ENTER_CONTEST_FAINTED, LilycoveCity_ContestLobby_EventScript_CantEnterFainted end LilycoveCity_ContestLobby_EventScript_ChooseContestRank:: @@ -283,8 +275,8 @@ ContestHall_EventScript_GetCategoryTough:: return ContestHall_EventScript_ContestGettingStarted:: - buffercontesttypestring 1, VAR_0x8008 - bufferstdstring 2, VAR_0x8009 + buffercontestname STR_VAR_2, VAR_0x8008 + bufferstdstring STR_VAR_3, VAR_0x8009 call ContestHall_EventScript_GettingStarted lockall applymovement LOCALID_MC, ContestHall_Movement_MCBackUp @@ -293,8 +285,7 @@ ContestHall_EventScript_ContestGettingStarted:: return ContestHall_EventScript_GettingStarted:: - compare VAR_CONTEST_TYPE, CONTEST_TYPE_LINK - goto_if_eq ContestHall_EventScript_GettingStartedLink + goto_if_eq VAR_CONTEST_TYPE, CONTEST_TYPE_LINK, ContestHall_EventScript_GettingStartedLink lockall msgbox ContestHall_Text_GettingStartedParticipantsAsFollows, MSGBOX_DEFAULT releaseall @@ -302,8 +293,7 @@ ContestHall_EventScript_GettingStarted:: ContestHall_EventScript_GettingStartedLink:: specialvar VAR_RESULT, IsWirelessContest - compare VAR_RESULT, TRUE - goto_if_eq ContestHall_EventScript_GettingStartedWireless + goto_if_eq VAR_RESULT, TRUE, ContestHall_EventScript_GettingStartedWireless messageautoscroll ContestHall_Text_GettingStartedParticipantsAsFollowsLink waitmessage return @@ -326,16 +316,14 @@ ContestHall_EventScript_ShowContestMons:: call ContestHall_EventScript_TryWaitForLink call ContestHall_EventScript_TryWaitForLink addvar VAR_0x8006, 1 - compare VAR_0x8006, CONTESTANT_COUNT - goto_if_ne ContestHall_EventScript_ShowContestMons + goto_if_ne VAR_0x8006, CONTESTANT_COUNT, ContestHall_EventScript_ShowContestMons call ContestHall_EventScript_AudienceVote setvar VAR_TEMP_1, 6 return ContestHall_EventScript_TryWaitForLink:: specialvar VAR_RESULT, IsWirelessContest - compare VAR_RESULT, TRUE - goto_if_eq ContestHall_EventScript_WaitForLink + goto_if_eq VAR_RESULT, TRUE, ContestHall_EventScript_WaitForLink return ContestHall_EventScript_WaitForLink:: @@ -344,14 +332,10 @@ ContestHall_EventScript_WaitForLink:: return ContestHall_EventScript_ContestantWalkToCenter:: - compare VAR_0x8006, 0 - goto_if_eq ContestHall_EventScript_Player1WalkToCenter - compare VAR_0x8006, 1 - goto_if_eq ContestHall_EventScript_Player2WalkToCenter - compare VAR_0x8006, 2 - goto_if_eq ContestHall_EventScript_Player3WalkToCenter - compare VAR_0x8006, 3 - goto_if_eq ContestHall_EventScript_Player4WalkToCenter + goto_if_eq VAR_0x8006, 0, ContestHall_EventScript_Player1WalkToCenter + goto_if_eq VAR_0x8006, 1, ContestHall_EventScript_Player2WalkToCenter + goto_if_eq VAR_0x8006, 2, ContestHall_EventScript_Player3WalkToCenter + goto_if_eq VAR_0x8006, 3, ContestHall_EventScript_Player4WalkToCenter return ContestHall_EventScript_Player1WalkToCenter:: @@ -393,7 +377,7 @@ ContestHall_EventScript_Player4WalkToCenter:: ContestHall_EventScript_ShowContestMonPic:: special BufferContestTrainerAndMonNames addvar VAR_0x8006, 1 - buffernumberstring 1, VAR_0x8006 + buffernumberstring STR_VAR_2, VAR_0x8006 lockall applymovement VAR_0x800B, ContestHall_Movement_ContestantDelay32 waitmovement 0 @@ -413,8 +397,7 @@ ContestHall_EventScript_ShowContestMonPic:: return ContestHall_EventScript_EntryXTrainersMon:: - compare VAR_CONTEST_TYPE, CONTEST_TYPE_LINK - goto_if_eq ContestHall_EventScript_EntryXTrainersMonLink + goto_if_eq VAR_CONTEST_TYPE, CONTEST_TYPE_LINK, ContestHall_EventScript_EntryXTrainersMonLink message ContestHall_Text_EntryXTrainersMon waitmessage return @@ -441,15 +424,13 @@ ContestHall_EventScript_AudienceVote:: return ContestHall_EventScript_AudienceWillVote:: - compare VAR_CONTEST_TYPE, CONTEST_TYPE_LINK - goto_if_eq ContestHall_EventScript_AudienceWillVoteLink + goto_if_eq VAR_CONTEST_TYPE, CONTEST_TYPE_LINK, ContestHall_EventScript_AudienceWillVoteLink msgbox ContestHall_Text_SeenContestantsAudienceWillVote, MSGBOX_DEFAULT return ContestHall_EventScript_AudienceWillVoteLink:: specialvar VAR_RESULT, IsWirelessContest - compare VAR_RESULT, TRUE - goto_if_eq ContestHall_EventScript_AudienceWillVoteWireless + goto_if_eq VAR_RESULT, TRUE, ContestHall_EventScript_AudienceWillVoteWireless messageautoscroll ContestHall_Text_SeenContestantsAudienceWillVote waitmessage return @@ -467,8 +448,7 @@ ContestHall_EventScript_AudienceWillVoteWireless:: return ContestHall_EventScript_VotingUnderWay:: - compare VAR_CONTEST_TYPE, CONTEST_TYPE_LINK - goto_if_eq ContestHall_EventScript_VotingUnderWayLink + goto_if_eq VAR_CONTEST_TYPE, CONTEST_TYPE_LINK, ContestHall_EventScript_VotingUnderWayLink message ContestHall_Text_VotingUnderWay return @@ -510,16 +490,11 @@ ContestHall_EventScript_AudienceReactToContestant:: @ and are set to 9 if they havent displayed a heart yet, and 1 if they have ContestHall_EventScript_AudienceHeartEmotes:: special GetContestMonCondition - compare VAR_CONTEST_TYPE, CONTEST_TYPE_NPC_NORMAL - call_if_eq ContestHall_EventScript_GetNumberOfHeartsNormal - compare VAR_CONTEST_TYPE, CONTEST_TYPE_NPC_SUPER - call_if_eq ContestHall_EventScript_GetNumberOfHeartsSuper - compare VAR_CONTEST_TYPE, CONTEST_TYPE_NPC_HYPER - call_if_eq ContestHall_EventScript_GetNumberOfHeartsHyper - compare VAR_CONTEST_TYPE, CONTEST_TYPE_NPC_MASTER - call_if_eq ContestHall_EventScript_GetNumberOfHeartsMaster - compare VAR_CONTEST_TYPE, CONTEST_TYPE_LINK - call_if_eq ContestHall_EventScript_GetNumberOfHeartsLink + call_if_eq VAR_CONTEST_TYPE, CONTEST_TYPE_NPC_NORMAL, ContestHall_EventScript_GetNumberOfHeartsNormal + call_if_eq VAR_CONTEST_TYPE, CONTEST_TYPE_NPC_SUPER, ContestHall_EventScript_GetNumberOfHeartsSuper + call_if_eq VAR_CONTEST_TYPE, CONTEST_TYPE_NPC_HYPER, ContestHall_EventScript_GetNumberOfHeartsHyper + call_if_eq VAR_CONTEST_TYPE, CONTEST_TYPE_NPC_MASTER, ContestHall_EventScript_GetNumberOfHeartsMaster + call_if_eq VAR_CONTEST_TYPE, CONTEST_TYPE_LINK, ContestHall_EventScript_GetNumberOfHeartsLink setvar VAR_TEMP_1, 9 setvar VAR_TEMP_2, 9 setvar VAR_TEMP_3, 9 @@ -528,8 +503,7 @@ ContestHall_EventScript_AudienceHeartEmotes:: setvar VAR_TEMP_6, 9 setvar VAR_TEMP_7, 9 setvar VAR_TEMP_8, 9 - compare VAR_TEMP_0, 0 - call_if_gt ContestHall_EventScript_DisplayHearts + call_if_gt VAR_TEMP_0, 0, ContestHall_EventScript_DisplayHearts setvar VAR_TEMP_1, 0 setvar VAR_TEMP_2, 0 setvar VAR_TEMP_3, 0 @@ -543,124 +517,75 @@ ContestHall_EventScript_AudienceHeartEmotes:: ContestHall_EventScript_DisplayHearts:: setvar VAR_RESULT, 8 special GenerateContestRand - compare VAR_RESULT, 0 - call_if_eq ContestHall_EventScript_TryDisplayHeartAudienceMember1 - compare VAR_RESULT, 1 - call_if_eq ContestHall_EventScript_TryDisplayHeartAudienceMember2 - compare VAR_RESULT, 2 - call_if_eq ContestHall_EventScript_TryDisplayHeartAudienceMember3 - compare VAR_RESULT, 3 - call_if_eq ContestHall_EventScript_TryDisplayHeartAudienceMember4 - compare VAR_RESULT, 4 - call_if_eq ContestHall_EventScript_TryDisplayHeartAudienceMember5 - compare VAR_RESULT, 5 - call_if_eq ContestHall_EventScript_TryDisplayHeartAudienceMember6 - compare VAR_RESULT, 6 - call_if_eq ContestHall_EventScript_TryDisplayHeartAudienceMember7 - compare VAR_RESULT, 7 - call_if_eq ContestHall_EventScript_TryDisplayHeartAudienceMember8 - compare VAR_TEMP_0, 0 @ Still more hearts to display - goto_if_gt ContestHall_EventScript_DisplayHearts + call_if_eq VAR_RESULT, 0, ContestHall_EventScript_TryDisplayHeartAudienceMember1 + call_if_eq VAR_RESULT, 1, ContestHall_EventScript_TryDisplayHeartAudienceMember2 + call_if_eq VAR_RESULT, 2, ContestHall_EventScript_TryDisplayHeartAudienceMember3 + call_if_eq VAR_RESULT, 3, ContestHall_EventScript_TryDisplayHeartAudienceMember4 + call_if_eq VAR_RESULT, 4, ContestHall_EventScript_TryDisplayHeartAudienceMember5 + call_if_eq VAR_RESULT, 5, ContestHall_EventScript_TryDisplayHeartAudienceMember6 + call_if_eq VAR_RESULT, 6, ContestHall_EventScript_TryDisplayHeartAudienceMember7 + call_if_eq VAR_RESULT, 7, ContestHall_EventScript_TryDisplayHeartAudienceMember8 + goto_if_gt VAR_TEMP_0, 0, ContestHall_EventScript_DisplayHearts @ Still more hearts to display waitmovement 0 return ContestHall_EventScript_GetNumberOfHeartsNormal:: - compare VAR_0x8004, 80 - goto_if_gt ContestHall_EventScript_Set8Hearts - compare VAR_0x8004, 70 - goto_if_gt ContestHall_EventScript_Set7Hearts - compare VAR_0x8004, 60 - goto_if_gt ContestHall_EventScript_Set6Hearts - compare VAR_0x8004, 50 - goto_if_gt ContestHall_EventScript_Set5Hearts - compare VAR_0x8004, 40 - goto_if_gt ContestHall_EventScript_Set4Hearts - compare VAR_0x8004, 30 - goto_if_gt ContestHall_EventScript_Set3Hearts - compare VAR_0x8004, 20 - goto_if_gt ContestHall_EventScript_Set2Hearts - compare VAR_0x8004, 10 - goto_if_gt ContestHall_EventScript_Set1Heart + goto_if_gt VAR_0x8004, 80, ContestHall_EventScript_Set8Hearts + goto_if_gt VAR_0x8004, 70, ContestHall_EventScript_Set7Hearts + goto_if_gt VAR_0x8004, 60, ContestHall_EventScript_Set6Hearts + goto_if_gt VAR_0x8004, 50, ContestHall_EventScript_Set5Hearts + goto_if_gt VAR_0x8004, 40, ContestHall_EventScript_Set4Hearts + goto_if_gt VAR_0x8004, 30, ContestHall_EventScript_Set3Hearts + goto_if_gt VAR_0x8004, 20, ContestHall_EventScript_Set2Hearts + goto_if_gt VAR_0x8004, 10, ContestHall_EventScript_Set1Heart setvar VAR_TEMP_0, 0 return ContestHall_EventScript_GetNumberOfHeartsSuper:: - compare VAR_0x8004, 230 - goto_if_gt ContestHall_EventScript_Set8Hearts - compare VAR_0x8004, 210 - goto_if_gt ContestHall_EventScript_Set7Hearts - compare VAR_0x8004, 190 - goto_if_gt ContestHall_EventScript_Set6Hearts - compare VAR_0x8004, 170 - goto_if_gt ContestHall_EventScript_Set5Hearts - compare VAR_0x8004, 150 - goto_if_gt ContestHall_EventScript_Set4Hearts - compare VAR_0x8004, 130 - goto_if_gt ContestHall_EventScript_Set3Hearts - compare VAR_0x8004, 110 - goto_if_gt ContestHall_EventScript_Set2Hearts - compare VAR_0x8004, 90 - goto_if_gt ContestHall_EventScript_Set1Heart + goto_if_gt VAR_0x8004, 230, ContestHall_EventScript_Set8Hearts + goto_if_gt VAR_0x8004, 210, ContestHall_EventScript_Set7Hearts + goto_if_gt VAR_0x8004, 190, ContestHall_EventScript_Set6Hearts + goto_if_gt VAR_0x8004, 170, ContestHall_EventScript_Set5Hearts + goto_if_gt VAR_0x8004, 150, ContestHall_EventScript_Set4Hearts + goto_if_gt VAR_0x8004, 130, ContestHall_EventScript_Set3Hearts + goto_if_gt VAR_0x8004, 110, ContestHall_EventScript_Set2Hearts + goto_if_gt VAR_0x8004, 90, ContestHall_EventScript_Set1Heart setvar VAR_TEMP_0, 0 return ContestHall_EventScript_GetNumberOfHeartsHyper:: - compare VAR_0x8004, 380 - goto_if_gt ContestHall_EventScript_Set8Hearts - compare VAR_0x8004, 350 - goto_if_gt ContestHall_EventScript_Set7Hearts - compare VAR_0x8004, 320 - goto_if_gt ContestHall_EventScript_Set6Hearts - compare VAR_0x8004, 290 - goto_if_gt ContestHall_EventScript_Set5Hearts - compare VAR_0x8004, 260 - goto_if_gt ContestHall_EventScript_Set4Hearts - compare VAR_0x8004, 230 - goto_if_gt ContestHall_EventScript_Set3Hearts - compare VAR_0x8004, 200 - goto_if_gt ContestHall_EventScript_Set2Hearts - compare VAR_0x8004, 170 - goto_if_gt ContestHall_EventScript_Set1Heart + goto_if_gt VAR_0x8004, 380, ContestHall_EventScript_Set8Hearts + goto_if_gt VAR_0x8004, 350, ContestHall_EventScript_Set7Hearts + goto_if_gt VAR_0x8004, 320, ContestHall_EventScript_Set6Hearts + goto_if_gt VAR_0x8004, 290, ContestHall_EventScript_Set5Hearts + goto_if_gt VAR_0x8004, 260, ContestHall_EventScript_Set4Hearts + goto_if_gt VAR_0x8004, 230, ContestHall_EventScript_Set3Hearts + goto_if_gt VAR_0x8004, 200, ContestHall_EventScript_Set2Hearts + goto_if_gt VAR_0x8004, 170, ContestHall_EventScript_Set1Heart setvar VAR_TEMP_0, 0 return ContestHall_EventScript_GetNumberOfHeartsMaster:: - compare VAR_0x8004, 600 - goto_if_gt ContestHall_EventScript_Set8Hearts - compare VAR_0x8004, 560 - goto_if_gt ContestHall_EventScript_Set7Hearts - compare VAR_0x8004, 520 - goto_if_gt ContestHall_EventScript_Set6Hearts - compare VAR_0x8004, 480 - goto_if_gt ContestHall_EventScript_Set5Hearts - compare VAR_0x8004, 440 - goto_if_gt ContestHall_EventScript_Set4Hearts - compare VAR_0x8004, 400 - goto_if_gt ContestHall_EventScript_Set3Hearts - compare VAR_0x8004, 360 - goto_if_gt ContestHall_EventScript_Set2Hearts - compare VAR_0x8004, 320 - goto_if_gt ContestHall_EventScript_Set1Heart + goto_if_gt VAR_0x8004, 600, ContestHall_EventScript_Set8Hearts + goto_if_gt VAR_0x8004, 560, ContestHall_EventScript_Set7Hearts + goto_if_gt VAR_0x8004, 520, ContestHall_EventScript_Set6Hearts + goto_if_gt VAR_0x8004, 480, ContestHall_EventScript_Set5Hearts + goto_if_gt VAR_0x8004, 440, ContestHall_EventScript_Set4Hearts + goto_if_gt VAR_0x8004, 400, ContestHall_EventScript_Set3Hearts + goto_if_gt VAR_0x8004, 360, ContestHall_EventScript_Set2Hearts + goto_if_gt VAR_0x8004, 320, ContestHall_EventScript_Set1Heart setvar VAR_TEMP_0, 0 return ContestHall_EventScript_GetNumberOfHeartsLink:: - compare VAR_0x8004, 600 - goto_if_gt ContestHall_EventScript_Set8Hearts - compare VAR_0x8004, 550 - goto_if_gt ContestHall_EventScript_Set7Hearts - compare VAR_0x8004, 500 - goto_if_gt ContestHall_EventScript_Set6Hearts - compare VAR_0x8004, 450 - goto_if_gt ContestHall_EventScript_Set5Hearts - compare VAR_0x8004, 400 - goto_if_gt ContestHall_EventScript_Set4Hearts - compare VAR_0x8004, 300 - goto_if_gt ContestHall_EventScript_Set3Hearts - compare VAR_0x8004, 200 - goto_if_gt ContestHall_EventScript_Set2Hearts - compare VAR_0x8004, 100 - goto_if_gt ContestHall_EventScript_Set1Heart + goto_if_gt VAR_0x8004, 600, ContestHall_EventScript_Set8Hearts + goto_if_gt VAR_0x8004, 550, ContestHall_EventScript_Set7Hearts + goto_if_gt VAR_0x8004, 500, ContestHall_EventScript_Set6Hearts + goto_if_gt VAR_0x8004, 450, ContestHall_EventScript_Set5Hearts + goto_if_gt VAR_0x8004, 400, ContestHall_EventScript_Set4Hearts + goto_if_gt VAR_0x8004, 300, ContestHall_EventScript_Set3Hearts + goto_if_gt VAR_0x8004, 200, ContestHall_EventScript_Set2Hearts + goto_if_gt VAR_0x8004, 100, ContestHall_EventScript_Set1Heart setvar VAR_TEMP_0, 0 return @@ -697,8 +622,7 @@ ContestHall_EventScript_Set8Hearts:: return ContestHall_EventScript_TryDisplayHeartAudienceMember1:: - compare VAR_TEMP_1, 1 - goto_if_eq ContestHall_EventScript_AudienceMember1AlreadyEmoted + goto_if_eq VAR_TEMP_1, 1, ContestHall_EventScript_AudienceMember1AlreadyEmoted applymovement LOCALID_AUDIENCE_1, ContestHall_Movement_Heart playse SE_PIN delay 14 @@ -710,8 +634,7 @@ ContestHall_EventScript_AudienceMember1AlreadyEmoted:: return ContestHall_EventScript_TryDisplayHeartAudienceMember2:: - compare VAR_TEMP_2, 1 - goto_if_eq ContestHall_EventScript_AudienceMember2AlreadyEmoted + goto_if_eq VAR_TEMP_2, 1, ContestHall_EventScript_AudienceMember2AlreadyEmoted applymovement LOCALID_AUDIENCE_2, ContestHall_Movement_Heart playse SE_PIN delay 14 @@ -723,8 +646,7 @@ ContestHall_EventScript_AudienceMember2AlreadyEmoted:: return ContestHall_EventScript_TryDisplayHeartAudienceMember3:: - compare VAR_TEMP_3, 1 - goto_if_eq ContestHall_EventScript_AudienceMember3AlreadyEmoted + goto_if_eq VAR_TEMP_3, 1, ContestHall_EventScript_AudienceMember3AlreadyEmoted applymovement LOCALID_AUDIENCE_3, ContestHall_Movement_Heart playse SE_PIN delay 14 @@ -736,8 +658,7 @@ ContestHall_EventScript_AudienceMember3AlreadyEmoted:: return ContestHall_EventScript_TryDisplayHeartAudienceMember4:: - compare VAR_TEMP_4, 1 - goto_if_eq ContestHall_EventScript_Audience4MemberAlreadyEmoted + goto_if_eq VAR_TEMP_4, 1, ContestHall_EventScript_Audience4MemberAlreadyEmoted applymovement LOCALID_AUDIENCE_4, ContestHall_Movement_Heart playse SE_PIN delay 14 @@ -749,8 +670,7 @@ ContestHall_EventScript_Audience4MemberAlreadyEmoted:: return ContestHall_EventScript_TryDisplayHeartAudienceMember5:: - compare VAR_TEMP_5, 1 - goto_if_eq ContestHall_EventScript_AudienceMember5AlreadyEmoted + goto_if_eq VAR_TEMP_5, 1, ContestHall_EventScript_AudienceMember5AlreadyEmoted applymovement LOCALID_AUDIENCE_5, ContestHall_Movement_Heart playse SE_PIN delay 14 @@ -762,8 +682,7 @@ ContestHall_EventScript_AudienceMember5AlreadyEmoted:: return ContestHall_EventScript_TryDisplayHeartAudienceMember6:: - compare VAR_TEMP_6, 1 - goto_if_eq ContestHall_EventScript_AudienceMember6AlreadyEmoted + goto_if_eq VAR_TEMP_6, 1, ContestHall_EventScript_AudienceMember6AlreadyEmoted applymovement LOCALID_AUDIENCE_6, ContestHall_Movement_Heart playse SE_PIN delay 14 @@ -775,8 +694,7 @@ ContestHall_EventScript_AudienceMember6AlreadyEmoted:: return ContestHall_EventScript_TryDisplayHeartAudienceMember7:: - compare VAR_TEMP_7, 1 - goto_if_eq ContestHall_EventScript_AudienceMember7AlreadyEmoted + goto_if_eq VAR_TEMP_7, 1, ContestHall_EventScript_AudienceMember7AlreadyEmoted applymovement LOCALID_AUDIENCE_7, ContestHall_Movement_Heart playse SE_PIN delay 14 @@ -788,8 +706,7 @@ ContestHall_EventScript_AudienceMember7AlreadyEmoted:: return ContestHall_EventScript_TryDisplayHeartAudienceMember8:: - compare VAR_TEMP_8, 1 - goto_if_eq ContestHall_EventScript_AudienceMember8AlreadyEmoted + goto_if_eq VAR_TEMP_8, 1, ContestHall_EventScript_AudienceMember8AlreadyEmoted applymovement LOCALID_ARTIST, ContestHall_Movement_Heart playse SE_PIN delay 14 @@ -870,15 +787,13 @@ ContestHall_EventScript_DoContestAppeals:: return ContestHall_EventScript_LetsAppeal:: - compare VAR_CONTEST_TYPE, CONTEST_TYPE_LINK - goto_if_eq ContestHall_EventScript_LetsAppealLink + goto_if_eq VAR_CONTEST_TYPE, CONTEST_TYPE_LINK, ContestHall_EventScript_LetsAppealLink msgbox ContestHall_Text_VotingCompleteLetsAppeal, MSGBOX_DEFAULT return ContestHall_EventScript_LetsAppealLink:: specialvar VAR_RESULT, IsWirelessContest - compare VAR_RESULT, TRUE - goto_if_eq ContestHall_EventScript_LetsAppealWireless + goto_if_eq VAR_RESULT, TRUE, ContestHall_EventScript_LetsAppealWireless messageautoscroll ContestHall_Text_VotingCompleteLetsAppeal waitmessage return @@ -920,8 +835,7 @@ ContestHall_EventScript_ContestResults:: return ContestHall_EventScript_ThatsItForJudging:: - compare VAR_CONTEST_TYPE, CONTEST_TYPE_LINK - goto_if_eq ContestHall_EventScript_ThatsItForJudgingLink + goto_if_eq VAR_CONTEST_TYPE, CONTEST_TYPE_LINK, ContestHall_EventScript_ThatsItForJudgingLink msgbox ContestHall_Text_ThatsItForJudging, MSGBOX_DEFAULT return @@ -933,8 +847,7 @@ ContestHall_EventScript_ThatsItForJudgingLink:: return ContestHall_EventScript_ThankYouForAppeals:: - compare VAR_CONTEST_TYPE, CONTEST_TYPE_LINK - goto_if_eq ContestHall_EventScript_ThankYouForAppealsLink + goto_if_eq VAR_CONTEST_TYPE, CONTEST_TYPE_LINK, ContestHall_EventScript_ThankYouForAppealsLink msgbox ContestHall_Text_ThankYouForAppeals, MSGBOX_DEFAULT return @@ -946,8 +859,7 @@ ContestHall_EventScript_ThankYouForAppealsLink:: return ContestHall_EventScript_JudgeLooksReady:: - compare VAR_CONTEST_TYPE, CONTEST_TYPE_LINK - goto_if_eq ContestHall_EventScript_JudgeLooksReadyLink + goto_if_eq VAR_CONTEST_TYPE, CONTEST_TYPE_LINK, ContestHall_EventScript_JudgeLooksReadyLink msgbox ContestHall_Text_JudgeLooksReady, MSGBOX_DEFAULT return @@ -959,8 +871,7 @@ ContestHall_EventScript_JudgeLooksReadyLink:: return ContestHall_EventScript_WeWillDeclareWinner:: - compare VAR_CONTEST_TYPE, CONTEST_TYPE_LINK - goto_if_eq ContestHall_EventScript_WeWillDeclareWinnerLink + goto_if_eq VAR_CONTEST_TYPE, CONTEST_TYPE_LINK, ContestHall_EventScript_WeWillDeclareWinnerLink msgbox ContestHall_Text_WeWillNowDeclareWinner, MSGBOX_DEFAULT return @@ -1000,7 +911,7 @@ ContestHall_EventScript_CongratulateWinner:: special BufferContestWinnerTrainerName special BufferContestWinnerMonName addvar VAR_0x8005, 1 - buffernumberstring 1, VAR_0x8005 + buffernumberstring STR_VAR_2, VAR_0x8005 addvar VAR_0x8005, -1 call ContestHall_EventScript_CongratsWinner applymovement VAR_TEMP_3, ContestHall_Movement_WinningPlayerWalkUp @@ -1010,8 +921,7 @@ ContestHall_EventScript_CongratulateWinner:: return ContestHall_EventScript_CongratsWinner:: - compare VAR_CONTEST_TYPE, CONTEST_TYPE_LINK - goto_if_eq ContestHall_EventScript_CongratsWinnerLink + goto_if_eq VAR_CONTEST_TYPE, CONTEST_TYPE_LINK, ContestHall_EventScript_CongratsWinnerLink msgbox ContestHall_Text_CongratsTrainerXandMon, MSGBOX_DEFAULT return @@ -1023,8 +933,7 @@ ContestHall_EventScript_CongratsWinnerLink:: ContestHall_EventScript_AudienceLookAround:: addvar VAR_TEMP_1, 1 lockall - compare VAR_CONTEST_TYPE, CONTEST_TYPE_NPC_NORMAL - call_if_gt ContestHall_EventScript_VObjectAudienceLookAround + call_if_gt VAR_CONTEST_TYPE, CONTEST_TYPE_NPC_NORMAL, ContestHall_EventScript_VObjectAudienceLookAround applymovement LOCALID_AUDIENCE_5, ContestHall_Movement_AudienceMemberLookRight applymovement LOCALID_AUDIENCE_2, ContestHall_Movement_AudienceMemberLookDown applymovement LOCALID_AUDIENCE_3, ContestHall_Movement_AudienceMemberLookRight @@ -1033,8 +942,7 @@ ContestHall_EventScript_AudienceLookAround:: applymovement LOCALID_AUDIENCE_7, ContestHall_Movement_AudienceMemberLookDown applymovement LOCALID_AUDIENCE_1, ContestHall_Movement_AudienceMemberLookUp applymovement LOCALID_AUDIENCE_4, ContestHall_Movement_AudienceMemberLookLeft - compare VAR_TEMP_1, 4 - goto_if_ne ContestHall_EventScript_AudienceLookAround + goto_if_ne VAR_TEMP_1, 4, ContestHall_EventScript_AudienceLookAround delay 30 return @@ -1108,8 +1016,7 @@ ContestHall_EventScript_VObjectAudienceLookAround:: return ContestHall_EventScript_GiveWinnerPrize:: - compare VAR_CONTEST_TYPE, CONTEST_TYPE_LINK - goto_if_eq ContestHall_EventScript_EndLinkContest + goto_if_eq VAR_CONTEST_TYPE, CONTEST_TYPE_LINK, ContestHall_EventScript_EndLinkContest call ContestHall_EventScript_CheckShouldSkipPrize goto_if_set FLAG_TEMP_2, ContestHall_EventScript_SkipPrize lockall @@ -1122,8 +1029,7 @@ ContestHall_EventScript_GiveWinnerPrize:: call ContestHall_EventScript_AudienceLookAround delay 30 special ShouldReadyContestArtist - compare VAR_0x8004, TRUE - goto_if_eq ContestHall_EventScript_SetReadyForContestArtist + goto_if_eq VAR_0x8004, TRUE, ContestHall_EventScript_SetReadyForContestArtist return ContestHall_EventScript_SkipPrize:: @@ -1132,25 +1038,21 @@ ContestHall_EventScript_SkipPrize:: releaseall delay 90 special ShouldReadyContestArtist - compare VAR_0x8004, TRUE - goto_if_eq ContestHall_EventScript_SetReadyForContestArtist + goto_if_eq VAR_0x8004, TRUE, ContestHall_EventScript_SetReadyForContestArtist return ContestHall_EventScript_CheckShouldSkipPrize:: specialvar VAR_RESULT, HasMonWonThisContestBefore - compare VAR_RESULT, TRUE - goto_if_eq ContestHall_EventScript_CheckPlayerWon + goto_if_eq VAR_RESULT, TRUE, ContestHall_EventScript_CheckPlayerWon return ContestHall_EventScript_CheckPlayerWon:: special GetContestWinnerId - compare VAR_0x8005, 3 - goto_if_eq ContestHall_EventScript_CheckRankIsMaster + goto_if_eq VAR_0x8005, 3, ContestHall_EventScript_CheckRankIsMaster return ContestHall_EventScript_CheckRankIsMaster:: - compare VAR_CONTEST_RANK, CONTEST_RANK_MASTER - goto_if_eq ContestHall_EventScript_DontSkipPrize + goto_if_eq VAR_CONTEST_RANK, CONTEST_RANK_MASTER, ContestHall_EventScript_DontSkipPrize setflag FLAG_TEMP_2 return @@ -1171,8 +1073,7 @@ ContestHall_EventScript_EndLinkContest:: special GetContestPlayerId special GetContestWinnerId special ShouldReadyContestArtist - compare VAR_0x8004, TRUE - goto_if_eq ContestHall_EventScript_SetReadyForLinkContestArtist + goto_if_eq VAR_0x8004, TRUE, ContestHall_EventScript_SetReadyForLinkContestArtist closemessage return @@ -1223,21 +1124,17 @@ ContestHall_EventScript_Player4ApproachForPrize:: @ In NPC Contests, the player is always entry 4 (id number 3) ContestHall_EventScript_GivePrizeIfWinner:: special GetContestWinnerId - compare VAR_0x8005, 3 - goto_if_eq ContestHall_EventScript_GiveContestPrizes + goto_if_eq VAR_0x8005, 3, ContestHall_EventScript_GiveContestPrizes lockall msgbox ContestHall_Text_CongratsPleaseCompeteAgain, MSGBOX_DEFAULT releaseall return ContestHall_EventScript_GiveContestPrizes:: - compare VAR_CONTEST_TYPE, CONTEST_TYPE_NPC_SUPER - call_if_eq ContestHall_EventScript_SetSketchFlag + call_if_eq VAR_CONTEST_TYPE, CONTEST_TYPE_NPC_SUPER, ContestHall_EventScript_SetSketchFlag specialvar VAR_RESULT, HasMonWonThisContestBefore - compare VAR_RESULT, FALSE - goto_if_eq ContestHall_EventScript_ReceiveContestRibbon - compare VAR_CONTEST_RANK, CONTEST_RANK_MASTER - goto_if_eq ContestHall_EventScript_GiveLuxuryBall + goto_if_eq VAR_RESULT, FALSE, ContestHall_EventScript_ReceiveContestRibbon + goto_if_eq VAR_CONTEST_RANK, CONTEST_RANK_MASTER, ContestHall_EventScript_GiveLuxuryBall lockall msgbox ContestHall_Text_CongratsPleaseCompeteAgain, MSGBOX_DEFAULT releaseall @@ -1253,8 +1150,7 @@ ContestHall_EventScript_NoRoomForLuxuryBall:: ContestHall_EventScript_GiveLuxuryBall:: giveitem ITEM_LUXURY_BALL - compare VAR_RESULT, FALSE - goto_if_eq ContestHall_EventScript_NoRoomForLuxuryBall + goto_if_eq VAR_RESULT, FALSE, ContestHall_EventScript_NoRoomForLuxuryBall lockall msgbox ContestHall_Text_CongratsPleaseCompeteAgain, MSGBOX_DEFAULT releaseall @@ -1460,8 +1356,7 @@ ContestHall_Movement_Player2ApproachForPrize: @ IsContestWithRSPlayer has no side effect, so this is nop ContestHall_EventScript_CheckIfContestWithRSPlayer:: specialvar VAR_RESULT, IsContestWithRSPlayer - compare VAR_RESULT, TRUE - goto_if_eq ContestHall_EventScript_RetRSPlayer + goto_if_eq VAR_RESULT, TRUE, ContestHall_EventScript_RetRSPlayer return ContestHall_EventScript_RetRSPlayer:: @@ -1469,8 +1364,7 @@ ContestHall_EventScript_RetRSPlayer:: LilycoveCity_ContestLobby_EventScript_DelayIfContestWithRSPlayer:: specialvar VAR_RESULT, IsContestWithRSPlayer - compare VAR_RESULT, TRUE - goto_if_eq LilycoveCity_ContestLobby_EventScript_DelayForRSPlayer + goto_if_eq VAR_RESULT, TRUE, LilycoveCity_ContestLobby_EventScript_DelayForRSPlayer return LilycoveCity_ContestLobby_EventScript_DelayForRSPlayer:: diff --git a/data/scripts/day_care.inc b/data/scripts/day_care.inc index 8d529d5e105f..cb053f2c401d 100644 --- a/data/scripts/day_care.inc +++ b/data/scripts/day_care.inc @@ -5,23 +5,18 @@ Route117_EventScript_DaycareMan:: faceplayer special GetDaycareMonNicknames specialvar VAR_RESULT, GetDaycareState - compare VAR_RESULT, DAYCARE_EGG_WAITING - goto_if_eq Route117_EventScript_DaycareEggWaiting - compare VAR_RESULT, DAYCARE_ONE_MON - goto_if_eq Route117_EventScript_CheckOnOneMon - compare VAR_RESULT, DAYCARE_TWO_MONS - goto_if_eq Route117_EventScript_CheckOnTwoMons + goto_if_eq VAR_RESULT, DAYCARE_EGG_WAITING, Route117_EventScript_DaycareEggWaiting + goto_if_eq VAR_RESULT, DAYCARE_ONE_MON, Route117_EventScript_CheckOnOneMon + goto_if_eq VAR_RESULT, DAYCARE_TWO_MONS, Route117_EventScript_CheckOnTwoMons msgbox Route117_Text_SeeWifeIfYoudLikeMeToRaiseMon, MSGBOX_DEFAULT release end Route117_EventScript_DaycareEggWaiting:: msgbox Route117_Text_DoYouWantEgg, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq Route117_EventScript_DaycareAcceptEgg + goto_if_eq VAR_RESULT, YES, Route117_EventScript_DaycareAcceptEgg msgbox Route117_Text_IWillKeepDoYouWantIt, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq Route117_EventScript_DaycareAcceptEgg + goto_if_eq VAR_RESULT, YES, Route117_EventScript_DaycareAcceptEgg msgbox Route117_Text_IllKeepIt, MSGBOX_DEFAULT clearflag FLAG_PENDING_DAYCARE_EGG special RejectEggFromDayCare @@ -30,8 +25,7 @@ Route117_EventScript_DaycareEggWaiting:: Route117_EventScript_DaycareAcceptEgg:: specialvar VAR_RESULT, CalculatePlayerPartyCount - compare VAR_RESULT, PARTY_SIZE - goto_if_ne Route117_EventScript_DaycareReceiveEgg + goto_if_ne VAR_RESULT, PARTY_SIZE, Route117_EventScript_DaycareReceiveEgg msgbox Route117_Text_YouHaveNoRoomForIt, MSGBOX_DEFAULT release end @@ -49,8 +43,7 @@ Route117_EventScript_DaycareReceiveEgg:: Route117_EventScript_CheckMonReceivedMail:: specialvar VAR_RESULT, CheckDaycareMonReceivedMail - compare VAR_RESULT, 1 - call_if_eq Route117_EventScript_MonReceivedMail + call_if_eq VAR_RESULT, 1, Route117_EventScript_MonReceivedMail return Route117_EventScript_MonReceivedMail:: @@ -83,35 +76,27 @@ Route117_PokemonDayCare_EventScript_DaycareWoman:: lock faceplayer specialvar VAR_RESULT, GetDaycareState - compare VAR_RESULT, DAYCARE_EGG_WAITING - goto_if_eq Route117_PokemonDayCare_EventScript_EggWaiting - compare VAR_RESULT, DAYCARE_ONE_MON - goto_if_eq Route117_PokemonDayCare_EventScript_OneMonInDaycare - compare VAR_RESULT, DAYCARE_TWO_MONS - goto_if_eq Route117_PokemonDayCare_EventScript_TwoMonsInDaycare + goto_if_eq VAR_RESULT, DAYCARE_EGG_WAITING, Route117_PokemonDayCare_EventScript_EggWaiting + goto_if_eq VAR_RESULT, DAYCARE_ONE_MON, Route117_PokemonDayCare_EventScript_OneMonInDaycare + goto_if_eq VAR_RESULT, DAYCARE_TWO_MONS, Route117_PokemonDayCare_EventScript_TwoMonsInDaycare msgbox Route117_PokemonDayCare_Text_WouldYouLikeUsToRaiseAMon, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq Route117_PokemonDayCare_EventScript_GiveMonToRaise + goto_if_eq VAR_RESULT, YES, Route117_PokemonDayCare_EventScript_GiveMonToRaise msgbox Route117_PokemonDayCare_Text_FineThenComeAgain, MSGBOX_DEFAULT release end Route117_PokemonDayCare_EventScript_GiveMonToRaise:: specialvar VAR_RESULT, CountPartyNonEggMons - compare VAR_RESULT, 1 - goto_if_eq Route117_PokemonDayCare_EventScript_OnlyOneMon + goto_if_eq VAR_RESULT, 1, Route117_PokemonDayCare_EventScript_OnlyOneMon specialvar VAR_RESULT, CountPartyAliveNonEggMons - compare VAR_RESULT, 2 - goto_if_eq Route117_PokemonDayCare_EventScript_OnlyTwoAliveMons + goto_if_eq VAR_RESULT, 2, Route117_PokemonDayCare_EventScript_OnlyTwoAliveMons msgbox Route117_PokemonDayCare_Text_WhichMonShouldWeRaise, MSGBOX_DEFAULT fadescreen FADE_TO_BLACK special ChooseSendDaycareMon waitstate - compare VAR_0x8004, 255 - goto_if_eq Route117_PokemonDayCare_EventScript_ComeAgain + goto_if_eq VAR_0x8004, PARTY_NOTHING_CHOSEN, Route117_PokemonDayCare_EventScript_ComeAgain specialvar VAR_RESULT, CountPartyAliveNonEggMons_IgnoreVar0x8004Slot - compare VAR_RESULT, 0 - goto_if_eq Route117_PokemonDayCare_EventScript_OnlyOneAliveMon + goto_if_eq VAR_RESULT, 0, Route117_PokemonDayCare_EventScript_OnlyOneAliveMon specialvar VAR_0x8005, GetSelectedMonNicknameAndSpecies waitse playmoncry VAR_0x8005, CRY_MODE_NORMAL @@ -120,8 +105,7 @@ Route117_PokemonDayCare_EventScript_GiveMonToRaise:: special StoreSelectedPokemonInDaycare incrementgamestat GAME_STAT_USED_DAYCARE specialvar VAR_RESULT, GetDaycareState - compare VAR_RESULT, DAYCARE_ONE_MON - goto_if_eq Route117_PokemonDayCare_EventScript_CanRaiseOneMore + goto_if_eq VAR_RESULT, DAYCARE_ONE_MON, Route117_PokemonDayCare_EventScript_CanRaiseOneMore release end @@ -132,8 +116,7 @@ Route117_PokemonDayCare_EventScript_ComeAgain:: Route117_PokemonDayCare_EventScript_CanRaiseOneMore:: msgbox Route117_PokemonDayCare_Text_WeCanRaiseOneMore, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq Route117_PokemonDayCare_EventScript_GiveMonToRaise + goto_if_eq VAR_RESULT, YES, Route117_PokemonDayCare_EventScript_GiveMonToRaise goto Route117_PokemonDayCare_EventScript_ComeAgain end @@ -163,8 +146,7 @@ Route117_PokemonDayCare_EventScript_YourMonHasGrownXLevels:: Route117_PokemonDayCare_EventScript_DisplayLevelsGained:: specialvar VAR_RESULT, GetNumLevelsGainedFromDaycare - compare VAR_RESULT, 0 - call_if_ne Route117_PokemonDayCare_EventScript_YourMonHasGrownXLevels + call_if_ne VAR_RESULT, 0, Route117_PokemonDayCare_EventScript_YourMonHasGrownXLevels return Route117_PokemonDayCare_EventScript_OneMonInDaycare:: @@ -172,42 +154,35 @@ Route117_PokemonDayCare_EventScript_OneMonInDaycare:: setvar VAR_0x8004, 0 call Route117_PokemonDayCare_EventScript_DisplayLevelsGained msgbox Route117_PokemonDayCare_Text_WeCanRaiseOneMore, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq Route117_PokemonDayCare_EventScript_GiveMonToRaise + goto_if_eq VAR_RESULT, YES, Route117_PokemonDayCare_EventScript_GiveMonToRaise msgbox Route117_PokemonDayCare_Text_TakeYourMonBack, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq Route117_PokemonDayCare_EventScript_TryRetrieveMon + goto_if_eq VAR_RESULT, YES, Route117_PokemonDayCare_EventScript_TryRetrieveMon goto Route117_PokemonDayCare_EventScript_ComeAgain end Route117_PokemonDayCare_EventScript_TryRetrieveMon:: specialvar VAR_RESULT, CalculatePlayerPartyCount - compare VAR_RESULT, PARTY_SIZE - goto_if_eq Route117_PokemonDayCare_EventScript_NoRoom + goto_if_eq VAR_RESULT, PARTY_SIZE, Route117_PokemonDayCare_EventScript_NoRoom specialvar VAR_RESULT, GetDaycareState setvar VAR_0x8004, 0 - compare VAR_RESULT, DAYCARE_ONE_MON - goto_if_eq Route117_PokemonDayCare_EventScript_CostPrompt + goto_if_eq VAR_RESULT, DAYCARE_ONE_MON, Route117_PokemonDayCare_EventScript_CostPrompt special ShowDaycareLevelMenu waitstate copyvar VAR_0x8004, VAR_RESULT - compare VAR_RESULT, DAYCARE_EXITED_LEVEL_MENU - goto_if_eq Route117_PokemonDayCare_EventScript_ComeAgain + goto_if_eq VAR_RESULT, DAYCARE_EXITED_LEVEL_MENU, Route117_PokemonDayCare_EventScript_ComeAgain goto Route117_PokemonDayCare_EventScript_CostPrompt end Route117_PokemonDayCare_EventScript_CostPrompt:: special GetDaycareCost msgbox Route117_PokemonDayCare_Text_ItWillCostX, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq Route117_PokemonDayCare_EventScript_CheckEnoughMoney + goto_if_eq VAR_RESULT, YES, Route117_PokemonDayCare_EventScript_CheckEnoughMoney goto Route117_PokemonDayCare_EventScript_ComeAgain end Route117_PokemonDayCare_EventScript_CheckEnoughMoney:: specialvar VAR_RESULT, IsEnoughForCostInVar0x8005 - compare VAR_RESULT, 1 - goto_if_eq Route117_PokemonDayCare_EventScript_RetrieveMon + goto_if_eq VAR_RESULT, 1, Route117_PokemonDayCare_EventScript_RetrieveMon msgbox Route117_PokemonDayCare_Text_NotEnoughMoney, MSGBOX_DEFAULT release end @@ -224,15 +199,13 @@ Route117_PokemonDayCare_EventScript_RetrieveMon:: msgbox Route117_PokemonDayCare_Text_TookBackMon, MSGBOX_DEFAULT waitmoncry specialvar VAR_RESULT, GetDaycareState - compare VAR_RESULT, DAYCARE_ONE_MON - goto_if_eq Route117_PokemonDayCare_EventScript_AskRetrieveOtherMon + goto_if_eq VAR_RESULT, DAYCARE_ONE_MON, Route117_PokemonDayCare_EventScript_AskRetrieveOtherMon goto Route117_PokemonDayCare_EventScript_ComeAgain end Route117_PokemonDayCare_EventScript_AskRetrieveOtherMon:: msgbox Route117_PokemonDayCare_Text_TakeOtherOneBackToo, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq Route117_PokemonDayCare_EventScript_TryRetrieveMon + goto_if_eq VAR_RESULT, YES, Route117_PokemonDayCare_EventScript_TryRetrieveMon goto Route117_PokemonDayCare_EventScript_ComeAgain end @@ -274,8 +247,7 @@ Route117_PokemonDayCare_EventScript_TwoMonsInDaycare:: setvar VAR_0x8004, 1 call Route117_PokemonDayCare_EventScript_DisplayLevelsGained msgbox Route117_PokemonDayCare_Text_TakeYourMonBack, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq Route117_PokemonDayCare_EventScript_TryRetrieveMon + goto_if_eq VAR_RESULT, YES, Route117_PokemonDayCare_EventScript_TryRetrieveMon msgbox Route117_PokemonDayCare_Text_ComeAgain, MSGBOX_DEFAULT release end @@ -284,8 +256,7 @@ Route117_PokemonDayCare_EventScript_TwoMonsInDaycare:: Route117_PokemonDayCare_EventScript_UnusedRetrieveMon:: special ShowDaycareLevelMenu waitstate - compare VAR_RESULT, 2 - goto_if_eq Route117_PokemonDayCare_EventScript_ComeAgain + goto_if_eq VAR_RESULT, 2, Route117_PokemonDayCare_EventScript_ComeAgain copyvar VAR_0x8004, VAR_RESULT specialvar VAR_RESULT, TakePokemonFromDaycare msgbox Route117_PokemonDayCare_Text_HeresYourMon, MSGBOX_DEFAULT diff --git a/data/scripts/elite_four.inc b/data/scripts/elite_four.inc index 0ae319061ab9..97d7f413149f 100644 --- a/data/scripts/elite_four.inc +++ b/data/scripts/elite_four.inc @@ -2,18 +2,18 @@ PokemonLeague_EliteFour_SetAdvanceToNextRoomMetatiles:: applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_Delay32 waitmovement 0 playse SE_DOOR - setmetatile 6, 1, METATILE_EliteFour_OpenDoor_Frame, 0 - setmetatile 6, 2, METATILE_EliteFour_OpenDoor_Opening, 0 - setmetatile 0, 2, METATILE_EliteFour_RightSpotlightOff, 1 - setmetatile 1, 2, METATILE_EliteFour_LeftSpotlightOff, 1 - setmetatile 2, 2, METATILE_EliteFour_RightSpotlightOff, 1 - setmetatile 3, 2, METATILE_EliteFour_LeftSpotlightOff, 1 - setmetatile 4, 2, METATILE_EliteFour_RightSpotlightOff, 1 - setmetatile 8, 2, METATILE_EliteFour_LeftSpotlightOff, 1 - setmetatile 9, 2, METATILE_EliteFour_RightSpotlightOff, 1 - setmetatile 10, 2, METATILE_EliteFour_LeftSpotlightOff, 1 - setmetatile 11, 2, METATILE_EliteFour_RightSpotlightOff, 1 - setmetatile 12, 2, METATILE_EliteFour_LeftSpotlightOff, 1 + setmetatile 6, 1, METATILE_EliteFour_OpenDoor_Frame, FALSE + setmetatile 6, 2, METATILE_EliteFour_OpenDoor_Opening, FALSE + setmetatile 0, 2, METATILE_EliteFour_RightSpotlightOff, TRUE + setmetatile 1, 2, METATILE_EliteFour_LeftSpotlightOff, TRUE + setmetatile 2, 2, METATILE_EliteFour_RightSpotlightOff, TRUE + setmetatile 3, 2, METATILE_EliteFour_LeftSpotlightOff, TRUE + setmetatile 4, 2, METATILE_EliteFour_RightSpotlightOff, TRUE + setmetatile 8, 2, METATILE_EliteFour_LeftSpotlightOff, TRUE + setmetatile 9, 2, METATILE_EliteFour_RightSpotlightOff, TRUE + setmetatile 10, 2, METATILE_EliteFour_LeftSpotlightOff, TRUE + setmetatile 11, 2, METATILE_EliteFour_RightSpotlightOff, TRUE + setmetatile 12, 2, METATILE_EliteFour_LeftSpotlightOff, TRUE special DrawWholeMapView return @@ -21,42 +21,42 @@ PokemonLeague_EliteFour_EventScript_WalkInCloseDoor:: applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkUp6 waitmovement 0 playse SE_TRUCK_DOOR - setmetatile 5, 12, METATILE_EliteFour_EntryDoor_ClosedTop, 1 - setmetatile 6, 12, METATILE_EliteFour_EntryDoor_ClosedTop, 1 - setmetatile 7, 12, METATILE_EliteFour_EntryDoor_ClosedTop, 1 - setmetatile 5, 13, METATILE_EliteFour_EntryDoor_ClosedBottom, 1 - setmetatile 6, 13, METATILE_EliteFour_EntryDoor_ClosedBottom, 1 - setmetatile 7, 13, METATILE_EliteFour_EntryDoor_ClosedBottom, 1 + setmetatile 5, 12, METATILE_EliteFour_EntryDoor_ClosedTop, TRUE + setmetatile 6, 12, METATILE_EliteFour_EntryDoor_ClosedTop, TRUE + setmetatile 7, 12, METATILE_EliteFour_EntryDoor_ClosedTop, TRUE + setmetatile 5, 13, METATILE_EliteFour_EntryDoor_ClosedBottom, TRUE + setmetatile 6, 13, METATILE_EliteFour_EntryDoor_ClosedBottom, TRUE + setmetatile 7, 13, METATILE_EliteFour_EntryDoor_ClosedBottom, TRUE special DrawWholeMapView return @ Essentially unused, only necessary when re-entering an Elite Four room after defeating the member, which isnt normally possible PokemonLeague_EliteFour_EventScript_ResetAdvanceToNextRoom:: - setmetatile 6, 1, METATILE_EliteFour_OpenDoor_Frame, 0 - setmetatile 6, 2, METATILE_EliteFour_OpenDoor_Opening, 0 - setmetatile 5, 12, METATILE_EliteFour_EntryDoor_ClosedTop, 1 - setmetatile 6, 12, METATILE_EliteFour_EntryDoor_ClosedTop, 1 - setmetatile 7, 12, METATILE_EliteFour_EntryDoor_ClosedTop, 1 - setmetatile 5, 13, METATILE_EliteFour_EntryDoor_ClosedBottom, 1 - setmetatile 6, 13, METATILE_EliteFour_EntryDoor_ClosedBottom, 1 - setmetatile 7, 13, METATILE_EliteFour_EntryDoor_ClosedBottom, 1 - setmetatile 0, 2, METATILE_EliteFour_RightSpotlightOff, 1 - setmetatile 1, 2, METATILE_EliteFour_LeftSpotlightOff, 1 - setmetatile 2, 2, METATILE_EliteFour_RightSpotlightOff, 1 - setmetatile 3, 2, METATILE_EliteFour_LeftSpotlightOff, 1 - setmetatile 4, 2, METATILE_EliteFour_RightSpotlightOff, 1 - setmetatile 8, 2, METATILE_EliteFour_LeftSpotlightOff, 1 - setmetatile 9, 2, METATILE_EliteFour_RightSpotlightOff, 1 - setmetatile 10, 2, METATILE_EliteFour_LeftSpotlightOff, 1 - setmetatile 11, 2, METATILE_EliteFour_RightSpotlightOff, 1 - setmetatile 12, 2, METATILE_EliteFour_LeftSpotlightOff, 1 + setmetatile 6, 1, METATILE_EliteFour_OpenDoor_Frame, FALSE + setmetatile 6, 2, METATILE_EliteFour_OpenDoor_Opening, FALSE + setmetatile 5, 12, METATILE_EliteFour_EntryDoor_ClosedTop, TRUE + setmetatile 6, 12, METATILE_EliteFour_EntryDoor_ClosedTop, TRUE + setmetatile 7, 12, METATILE_EliteFour_EntryDoor_ClosedTop, TRUE + setmetatile 5, 13, METATILE_EliteFour_EntryDoor_ClosedBottom, TRUE + setmetatile 6, 13, METATILE_EliteFour_EntryDoor_ClosedBottom, TRUE + setmetatile 7, 13, METATILE_EliteFour_EntryDoor_ClosedBottom, TRUE + setmetatile 0, 2, METATILE_EliteFour_RightSpotlightOff, TRUE + setmetatile 1, 2, METATILE_EliteFour_LeftSpotlightOff, TRUE + setmetatile 2, 2, METATILE_EliteFour_RightSpotlightOff, TRUE + setmetatile 3, 2, METATILE_EliteFour_LeftSpotlightOff, TRUE + setmetatile 4, 2, METATILE_EliteFour_RightSpotlightOff, TRUE + setmetatile 8, 2, METATILE_EliteFour_LeftSpotlightOff, TRUE + setmetatile 9, 2, METATILE_EliteFour_RightSpotlightOff, TRUE + setmetatile 10, 2, METATILE_EliteFour_LeftSpotlightOff, TRUE + setmetatile 11, 2, METATILE_EliteFour_RightSpotlightOff, TRUE + setmetatile 12, 2, METATILE_EliteFour_LeftSpotlightOff, TRUE return PokemonLeague_EliteFour_EventScript_CloseDoor:: - setmetatile 5, 12, METATILE_EliteFour_EntryDoor_ClosedTop, 1 - setmetatile 6, 12, METATILE_EliteFour_EntryDoor_ClosedTop, 1 - setmetatile 7, 12, METATILE_EliteFour_EntryDoor_ClosedTop, 1 - setmetatile 5, 13, METATILE_EliteFour_EntryDoor_ClosedBottom, 1 - setmetatile 6, 13, METATILE_EliteFour_EntryDoor_ClosedBottom, 1 - setmetatile 7, 13, METATILE_EliteFour_EntryDoor_ClosedBottom, 1 + setmetatile 5, 12, METATILE_EliteFour_EntryDoor_ClosedTop, TRUE + setmetatile 6, 12, METATILE_EliteFour_EntryDoor_ClosedTop, TRUE + setmetatile 7, 12, METATILE_EliteFour_EntryDoor_ClosedTop, TRUE + setmetatile 5, 13, METATILE_EliteFour_EntryDoor_ClosedBottom, TRUE + setmetatile 6, 13, METATILE_EliteFour_EntryDoor_ClosedBottom, TRUE + setmetatile 7, 13, METATILE_EliteFour_EntryDoor_ClosedBottom, TRUE return diff --git a/data/scripts/field_move_scripts.inc b/data/scripts/field_move_scripts.inc index b81ca21dd1ce..3e99fc08e2d4 100644 --- a/data/scripts/field_move_scripts.inc +++ b/data/scripts/field_move_scripts.inc @@ -3,14 +3,12 @@ EventScript_CutTree:: lockall goto_if_unset FLAG_BADGE01_GET, EventScript_CheckTreeCantCut checkpartymove MOVE_CUT - compare VAR_RESULT, PARTY_SIZE - goto_if_eq EventScript_CheckTreeCantCut + goto_if_eq VAR_RESULT, PARTY_SIZE, EventScript_CheckTreeCantCut setfieldeffectargument 0, VAR_RESULT - bufferpartymonnick 0, VAR_RESULT - buffermovename 1, MOVE_CUT + bufferpartymonnick STR_VAR_1, VAR_RESULT + buffermovename STR_VAR_2, MOVE_CUT msgbox Text_WantToCut, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq EventScript_CancelCut + goto_if_eq VAR_RESULT, NO, EventScript_CancelCut msgbox Text_MonUsedFieldMove, MSGBOX_DEFAULT closemessage dofieldeffect FLDEFF_USE_CUT_ON_TREE @@ -64,14 +62,12 @@ EventScript_RockSmash:: lockall goto_if_unset FLAG_BADGE03_GET, EventScript_CantSmashRock checkpartymove MOVE_ROCK_SMASH - compare VAR_RESULT, PARTY_SIZE - goto_if_eq EventScript_CantSmashRock + goto_if_eq VAR_RESULT, PARTY_SIZE, EventScript_CantSmashRock setfieldeffectargument 0, VAR_RESULT - bufferpartymonnick 0, VAR_RESULT - buffermovename 1, MOVE_ROCK_SMASH + bufferpartymonnick STR_VAR_1, VAR_RESULT + buffermovename STR_VAR_2, MOVE_ROCK_SMASH msgbox Text_WantToSmash, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq EventScript_CancelSmash + goto_if_eq VAR_RESULT, NO, EventScript_CancelSmash msgbox Text_MonUsedFieldMove, MSGBOX_DEFAULT closemessage dofieldeffect FLDEFF_USE_ROCK_SMASH @@ -92,11 +88,9 @@ EventScript_SmashRock:: waitmovement 0 removeobject VAR_LAST_TALKED specialvar VAR_RESULT, TryUpdateRusturfTunnelState - compare VAR_RESULT, TRUE - goto_if_eq EventScript_EndSmash + goto_if_eq VAR_RESULT, TRUE, EventScript_EndSmash special RockSmashWildEncounter - compare VAR_RESULT, FALSE - goto_if_eq EventScript_EndSmash + goto_if_eq VAR_RESULT, FALSE, EventScript_EndSmash waitstate releaseall end @@ -132,12 +126,10 @@ EventScript_StrengthBoulder:: goto_if_unset FLAG_BADGE04_GET, EventScript_CantStrength goto_if_set FLAG_SYS_USE_STRENGTH, EventScript_CheckActivatedBoulder checkpartymove MOVE_STRENGTH - compare VAR_RESULT, PARTY_SIZE - goto_if_eq EventScript_CantStrength + goto_if_eq VAR_RESULT, PARTY_SIZE, EventScript_CantStrength setfieldeffectargument 0, VAR_RESULT msgbox Text_WantToStrength, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq EventScript_CancelStrength + goto_if_eq VAR_RESULT, NO, EventScript_CancelStrength closemessage dofieldeffect FLDEFF_USE_STRENGTH waitstate @@ -193,13 +185,11 @@ Text_StrengthActivated: EventScript_UseWaterfall:: lockall checkpartymove MOVE_WATERFALL - compare VAR_RESULT, PARTY_SIZE - goto_if_eq EventScript_CantWaterfall - bufferpartymonnick 0, VAR_RESULT + goto_if_eq VAR_RESULT, PARTY_SIZE, EventScript_CantWaterfall + bufferpartymonnick STR_VAR_1, VAR_RESULT setfieldeffectargument 0, VAR_RESULT msgbox Text_WantToWaterfall, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq EventScript_EndWaterfall + goto_if_eq VAR_RESULT, NO, EventScript_EndWaterfall msgbox Text_MonUsedWaterfall, MSGBOX_DEFAULT dofieldeffect FLDEFF_USE_WATERFALL goto EventScript_EndWaterfall @@ -228,14 +218,12 @@ Text_MonUsedWaterfall: EventScript_UseDive:: lockall checkpartymove MOVE_DIVE - compare VAR_RESULT, PARTY_SIZE - goto_if_eq EventScript_CantDive - bufferpartymonnick 0, VAR_RESULT + goto_if_eq VAR_RESULT, PARTY_SIZE, EventScript_CantDive + bufferpartymonnick STR_VAR_1, VAR_RESULT setfieldeffectargument 0, VAR_RESULT setfieldeffectargument 1, 1 msgbox Text_WantToDive, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq EventScript_EndDive + goto_if_eq VAR_RESULT, NO, EventScript_EndDive msgbox Text_MonUsedDive, MSGBOX_DEFAULT dofieldeffect FLDEFF_USE_DIVE goto EventScript_EndDive @@ -253,14 +241,12 @@ EventScript_EndDive:: EventScript_UseDiveUnderwater:: lockall checkpartymove MOVE_DIVE - compare VAR_RESULT, PARTY_SIZE - goto_if_eq EventScript_CantSurface - bufferpartymonnick 0, VAR_RESULT + goto_if_eq VAR_RESULT, PARTY_SIZE, EventScript_CantSurface + bufferpartymonnick STR_VAR_1, VAR_RESULT setfieldeffectargument 0, VAR_RESULT setfieldeffectargument 1, 1 msgbox Text_WantToSurface, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq EventScript_EndSurface + goto_if_eq VAR_RESULT, NO, EventScript_EndSurface msgbox Text_MonUsedDive, MSGBOX_DEFAULT dofieldeffect FLDEFF_USE_DIVE goto EventScript_EndSurface diff --git a/data/scripts/field_poison.inc b/data/scripts/field_poison.inc index a4f9b90b6b46..ddda34ebaae6 100644 --- a/data/scripts/field_poison.inc +++ b/data/scripts/field_poison.inc @@ -2,10 +2,8 @@ EventScript_FieldPoison:: lockall special TryFieldPoisonWhiteOut waitstate - compare VAR_RESULT, FLDPSN_WHITEOUT - goto_if_eq EventScript_FieldWhiteOut - compare VAR_RESULT, FLDPSN_FRONTIER_WHITEOUT - goto_if_eq EventScript_FrontierFieldWhiteOut + goto_if_eq VAR_RESULT, FLDPSN_WHITEOUT, EventScript_FieldWhiteOut + goto_if_eq VAR_RESULT, FLDPSN_FRONTIER_WHITEOUT, EventScript_FrontierFieldWhiteOut releaseall end @@ -30,16 +28,12 @@ EventScript_FrontierFieldWhiteOut:: waitmessage waitbuttonpress pike_inchallenge - compare VAR_RESULT, TRUE - goto_if_eq BattleFrontier_BattlePike_EventScript_Retire + goto_if_eq VAR_RESULT, TRUE, BattleFrontier_BattlePike_EventScript_Retire pyramid_inchallenge - compare VAR_RESULT, 1 @ On Pyramid floor - goto_if_eq BattleFrontier_BattlePyramid_EventScript_WarpToLobbyLost - compare VAR_RESULT, 2 @ On Pyramid peak - goto_if_eq BattleFrontier_BattlePyramid_EventScript_WarpToLobbyLost + goto_if_eq VAR_RESULT, 1, BattleFrontier_BattlePyramid_EventScript_WarpToLobbyLost @ On Pyramid floor + goto_if_eq VAR_RESULT, 2, BattleFrontier_BattlePyramid_EventScript_WarpToLobbyLost @ On Pyramid peak trainerhill_inchallenge - compare VAR_RESULT, TRUE - goto_if_eq TrainerHill_1F_EventScript_Lost + goto_if_eq VAR_RESULT, TRUE, TrainerHill_1F_EventScript_Lost special Script_FadeOutMapMusic waitstate fadescreen FADE_TO_BLACK diff --git a/data/scripts/flash.inc b/data/scripts/flash.inc index a69975a16514..dbfec2314dc2 100644 --- a/data/scripts/flash.inc +++ b/data/scripts/flash.inc @@ -1,4 +1,4 @@ EventScript_UseFlash:: animateflash 1 - setflashradius 1 + setflashlevel 1 end diff --git a/data/scripts/gabby_and_ty.inc b/data/scripts/gabby_and_ty.inc index 68be27a0287a..e3dbdfd665b1 100644 --- a/data/scripts/gabby_and_ty.inc +++ b/data/scripts/gabby_and_ty.inc @@ -199,12 +199,9 @@ GabbyAndTy_EventScript_TyBattle6:: GabbyAndTy_EventScript_FirstInterview:: special GabbyAndTyBeforeInterview special GetGabbyAndTyLocalIds - compare VAR_FACING, DIR_NORTH - call_if_eq GabbyAndTy_EventScript_FacePlayerNorth - compare VAR_FACING, DIR_SOUTH - call_if_eq GabbyAndTy_EventScript_FacePlayerSouth - compare VAR_FACING, DIR_EAST - call_if_eq GabbyAndTy_EventScript_FacePlayerEast + call_if_eq VAR_FACING, DIR_NORTH, GabbyAndTy_EventScript_FacePlayerNorth + call_if_eq VAR_FACING, DIR_SOUTH, GabbyAndTy_EventScript_FacePlayerSouth + call_if_eq VAR_FACING, DIR_EAST, GabbyAndTy_EventScript_FacePlayerEast goto_if_set FLAG_TEMP_1, GabbyAndTy_EventScript_KeepingAnEyeOutForYou msgbox GabbyAndTy_Text_WhoAreYouInterview, MSGBOX_YESNO goto GabbyAndTy_EventScript_Interview @@ -230,16 +227,12 @@ GabbyAndTy_EventScript_FacePlayerEast:: GabbyAndTy_EventScript_RequestInterview:: special GabbyAndTyBeforeInterview special GetGabbyAndTyLocalIds - compare VAR_FACING, DIR_NORTH - call_if_eq GabbyAndTy_EventScript_FacePlayerNorth - compare VAR_FACING, DIR_SOUTH - call_if_eq GabbyAndTy_EventScript_FacePlayerSouth - compare VAR_FACING, DIR_EAST - call_if_eq GabbyAndTy_EventScript_FacePlayerEast + call_if_eq VAR_FACING, DIR_NORTH, GabbyAndTy_EventScript_FacePlayerNorth + call_if_eq VAR_FACING, DIR_SOUTH, GabbyAndTy_EventScript_FacePlayerSouth + call_if_eq VAR_FACING, DIR_EAST, GabbyAndTy_EventScript_FacePlayerEast goto_if_set FLAG_TEMP_1, GabbyAndTy_EventScript_KeepingAnEyeOutForYou specialvar VAR_RESULT, GabbyAndTyGetLastQuote - compare VAR_RESULT, 0 - goto_if_eq GabbyAndTy_EventScript_DidntInterviewLastTime + goto_if_eq VAR_RESULT, 0, GabbyAndTy_EventScript_DidntInterviewLastTime msgbox GabbyAndTy_Text_QuoteFromLastInterview, MSGBOX_DEFAULT specialvar VAR_RESULT, GabbyAndTyGetLastBattleTrivia switch VAR_RESULT @@ -293,15 +286,13 @@ GabbyAndTy_EventScript_RequestInterviewLostAMon:: end GabbyAndTy_EventScript_Interview:: - compare VAR_RESULT, NO - goto_if_eq GabbyAndTy_EventScript_DontGiveUpKeepingEyeOut + goto_if_eq VAR_RESULT, NO, GabbyAndTy_EventScript_DontGiveUpKeepingEyeOut msgbox GabbyAndTy_Text_DescribeYourFeelings, MSGBOX_DEFAULT setvar VAR_0x8004, EASY_CHAT_TYPE_GABBY_AND_TY call Common_ShowEasyChatScreen lock faceplayer - compare VAR_RESULT, 0 - goto_if_eq GabbyAndTy_EventScript_DontGiveUpKeepingEyeOut + goto_if_eq VAR_RESULT, 0, GabbyAndTy_EventScript_DontGiveUpKeepingEyeOut msgbox GabbyAndTy_Text_PerfectWellBeSeeingYou, MSGBOX_DEFAULT special GabbyAndTyAfterInterview setflag FLAG_TEMP_1 diff --git a/data/scripts/gift_altering_cave.inc b/data/scripts/gift_altering_cave.inc index 8761b5fa409e..f86432ce284c 100644 --- a/data/scripts/gift_altering_cave.inc +++ b/data/scripts/gift_altering_cave.inc @@ -1,8 +1,7 @@ MysteryGiftScript_AlteringCave:: setvaddress MysteryGiftScript_AlteringCave addvar VAR_ALTERING_CAVE_WILD_SET, 1 - compare VAR_ALTERING_CAVE_WILD_SET, 10 - vgoto_if_ne MysteryGiftScript_AlteringCave_ + vgoto_if_ne VAR_ALTERING_CAVE_WILD_SET, 10, MysteryGiftScript_AlteringCave_ setvar VAR_ALTERING_CAVE_WILD_SET, 0 MysteryGiftScript_AlteringCave_: lock diff --git a/data/scripts/gift_aurora_ticket.inc b/data/scripts/gift_aurora_ticket.inc index c9250b9f93eb..0cadf804a7be 100644 --- a/data/scripts/gift_aurora_ticket.inc +++ b/data/scripts/gift_aurora_ticket.inc @@ -4,15 +4,13 @@ MysteryGiftScript_AuroraTicket:: faceplayer vgoto_if_set FLAG_RECEIVED_AURORA_TICKET, AuroraTicket_Obtained vgoto_if_set FLAG_BATTLED_DEOXYS, AuroraTicket_Obtained - checkitem ITEM_AURORA_TICKET, 1 - compare VAR_RESULT, TRUE - vgoto_if_eq AuroraTicket_Obtained + checkitem ITEM_AURORA_TICKET + vgoto_if_eq VAR_RESULT, TRUE, AuroraTicket_Obtained vmessage sText_AuroraTicketForYou waitmessage waitbuttonpress - checkitemspace ITEM_AURORA_TICKET, 1 - compare VAR_RESULT, FALSE - vgoto_if_eq AuroraTicket_NoBagSpace + checkitemspace ITEM_AURORA_TICKET + vgoto_if_eq VAR_RESULT, FALSE, AuroraTicket_NoBagSpace giveitem ITEM_AURORA_TICKET setflag FLAG_ENABLE_SHIP_BIRTH_ISLAND setflag FLAG_RECEIVED_AURORA_TICKET diff --git a/data/scripts/gift_battle_card.inc b/data/scripts/gift_battle_card.inc index 80b4ba26ebbb..95e55e1b95c7 100644 --- a/data/scripts/gift_battle_card.inc +++ b/data/scripts/gift_battle_card.inc @@ -3,8 +3,7 @@ MysteryGiftScript_BattleCard:: vgoto_if_set FLAG_MYSTERY_GIFT_DONE, MysteryGiftScript_BattleCardInfo setorcopyvar VAR_RESULT, GET_CARD_BATTLES_WON specialvar VAR_0x8008, GetMysteryGiftCardStat - compare VAR_0x8008, REQUIRED_CARD_BATTLES - vgoto_if_ne MysteryGiftScript_BattleCardInfo + vgoto_if_ne VAR_0x8008, REQUIRED_CARD_BATTLES, MysteryGiftScript_BattleCardInfo lock faceplayer vmessage sText_MysteryGiftBattleCountCard_WonPrize diff --git a/data/scripts/gift_mystic_ticket.inc b/data/scripts/gift_mystic_ticket.inc index 29c325f72d41..3ed8aa6bcfac 100644 --- a/data/scripts/gift_mystic_ticket.inc +++ b/data/scripts/gift_mystic_ticket.inc @@ -5,15 +5,13 @@ MysteryGiftScript_MysticTicket:: vgoto_if_set FLAG_RECEIVED_MYSTIC_TICKET, MysticTicket_Obtained vgoto_if_set FLAG_CAUGHT_LUGIA, MysticTicket_Obtained vgoto_if_set FLAG_CAUGHT_HO_OH, MysticTicket_Obtained - checkitem ITEM_MYSTIC_TICKET, 1 - compare VAR_RESULT, TRUE - vgoto_if_eq MysticTicket_Obtained + checkitem ITEM_MYSTIC_TICKET + vgoto_if_eq VAR_RESULT, TRUE, MysticTicket_Obtained vmessage sText_MysticTicketForYou waitmessage waitbuttonpress - checkitemspace ITEM_MYSTIC_TICKET, 1 - compare VAR_RESULT, FALSE - vgoto_if_eq MysticTicket_NoBagSpace + checkitemspace ITEM_MYSTIC_TICKET + vgoto_if_eq VAR_RESULT, FALSE, MysticTicket_NoBagSpace giveitem ITEM_MYSTIC_TICKET setflag FLAG_ENABLE_SHIP_NAVEL_ROCK setflag FLAG_RECEIVED_MYSTIC_TICKET diff --git a/data/scripts/gift_old_sea_map.inc b/data/scripts/gift_old_sea_map.inc index 5e47a10df14c..06435492e4cc 100644 --- a/data/scripts/gift_old_sea_map.inc +++ b/data/scripts/gift_old_sea_map.inc @@ -4,15 +4,13 @@ MysteryGiftScript_OldSeaMap:: faceplayer vgoto_if_set FLAG_RECEIVED_OLD_SEA_MAP, OldSeaMap_Obtained vgoto_if_set FLAG_CAUGHT_MEW, OldSeaMap_Obtained - checkitem ITEM_OLD_SEA_MAP, 1 - compare VAR_RESULT, TRUE - vgoto_if_eq OldSeaMap_Obtained + checkitem ITEM_OLD_SEA_MAP + vgoto_if_eq VAR_RESULT, TRUE, OldSeaMap_Obtained vmessage sText_MysteryGiftOldSeaMapForYou waitmessage waitbuttonpress - checkitemspace ITEM_OLD_SEA_MAP, 1 - compare VAR_RESULT, FALSE - vgoto_if_eq OldSeaMap_NoBagSpace + checkitemspace ITEM_OLD_SEA_MAP + vgoto_if_eq VAR_RESULT, FALSE, OldSeaMap_NoBagSpace giveitem ITEM_OLD_SEA_MAP setflag FLAG_ENABLE_SHIP_FARAWAY_ISLAND setflag FLAG_RECEIVED_OLD_SEA_MAP diff --git a/data/scripts/gift_pichu.inc b/data/scripts/gift_pichu.inc index e62fc4536ed7..d2cd381b5391 100644 --- a/data/scripts/gift_pichu.inc +++ b/data/scripts/gift_pichu.inc @@ -5,8 +5,7 @@ MysteryGiftScript_SurfPichu:: SurfPichu_GiveIfPossible: specialvar VAR_GIFT_PICHU_SLOT, CalculatePlayerPartyCount - compare VAR_GIFT_PICHU_SLOT, PARTY_SIZE - vgoto_if_eq SurfPichu_FullParty + vgoto_if_eq VAR_GIFT_PICHU_SLOT, PARTY_SIZE, SurfPichu_FullParty setflag FLAG_MYSTERY_GIFT_DONE vcall SurfPichu_GiveEgg lock @@ -32,16 +31,11 @@ SurfPichu_GiveEgg: giveegg SPECIES_PICHU setmoneventlegal VAR_GIFT_PICHU_SLOT setmonmetlocation VAR_GIFT_PICHU_SLOT, METLOC_FATEFUL_ENCOUNTER - compare VAR_GIFT_PICHU_SLOT, 1 - vgoto_if_eq SurfPichu_Slot1 - compare VAR_GIFT_PICHU_SLOT, 2 - vgoto_if_eq SurfPichu_Slot2 - compare VAR_GIFT_PICHU_SLOT, 3 - vgoto_if_eq SurfPichu_Slot3 - compare VAR_GIFT_PICHU_SLOT, 4 - vgoto_if_eq SurfPichu_Slot4 - compare VAR_GIFT_PICHU_SLOT, 5 - vgoto_if_eq SurfPichu_Slot5 + vgoto_if_eq VAR_GIFT_PICHU_SLOT, 1, SurfPichu_Slot1 + vgoto_if_eq VAR_GIFT_PICHU_SLOT, 2, SurfPichu_Slot2 + vgoto_if_eq VAR_GIFT_PICHU_SLOT, 3, SurfPichu_Slot3 + vgoto_if_eq VAR_GIFT_PICHU_SLOT, 4, SurfPichu_Slot4 + vgoto_if_eq VAR_GIFT_PICHU_SLOT, 5, SurfPichu_Slot5 return SurfPichu_Slot1: diff --git a/data/scripts/gift_stamp_card.inc b/data/scripts/gift_stamp_card.inc index f6e1eb7c7c4d..4ac399bec54c 100644 --- a/data/scripts/gift_stamp_card.inc +++ b/data/scripts/gift_stamp_card.inc @@ -5,7 +5,7 @@ MysteryGiftScript_StampCard:: setorcopyvar VAR_RESULT, GET_NUM_STAMPS specialvar VAR_0x8009, GetMysteryGiftCardStat subvar VAR_0x8008, VAR_0x8009 - buffernumberstring 0, VAR_0x8008 + buffernumberstring STR_VAR_1, VAR_0x8008 lock faceplayer vmessage sText_MysteryGiftStampCard diff --git a/data/scripts/gift_trainer.inc b/data/scripts/gift_trainer.inc index 2dbc86d53eba..b927809058cd 100644 --- a/data/scripts/gift_trainer.inc +++ b/data/scripts/gift_trainer.inc @@ -1,8 +1,7 @@ MysteryGiftScript_VisitingTrainer:: setvaddress MysteryGiftScript_VisitingTrainer special ValidateEReaderTrainer - compare VAR_RESULT, 0 - vgoto_if_eq MysteryGiftScript_VisitingTrainerArrived + vgoto_if_eq VAR_RESULT, 0, MysteryGiftScript_VisitingTrainerArrived lock faceplayer vmessage sText_MysteryGiftVisitingTrainerInstructions diff --git a/data/scripts/hall_of_fame.inc b/data/scripts/hall_of_fame.inc index 9b730de317fd..fc082870f729 100644 --- a/data/scripts/hall_of_fame.inc +++ b/data/scripts/hall_of_fame.inc @@ -2,8 +2,7 @@ EverGrandeCity_HallOfFame_EventScript_SetGameClearFlags:: special SetChampionSaveWarp setflag FLAG_IS_CHAMPION call EverGrandeCity_HallOfFame_EventScript_ResetDefeatedEventLegendaries - compare VAR_FOSSIL_MANIAC_STATE, 0 - call_if_eq EverGrandeCity_HallOfFame_EventScript_SetDesertUnderpassCommentReady + call_if_eq VAR_FOSSIL_MANIAC_STATE, 0, EverGrandeCity_HallOfFame_EventScript_SetDesertUnderpassCommentReady clearflag FLAG_HIDE_LILYCOVE_MOTEL_GAME_DESIGNERS call EverGrandeCity_HallOfFame_EventScript_ResetEliteFour setflag FLAG_HIDE_SLATEPORT_CITY_STERNS_SHIPYARD_MR_BRINEY @@ -22,8 +21,7 @@ EverGrandeCity_HallOfFame_EventScript_SetGameClearFlags:: call_if_unset FLAG_RECEIVED_BELDUM, EverGrandeCity_HallOfFame_EventScript_ShowStevensHouseBeldum setflag FLAG_HIDE_LITTLEROOT_TOWN_BRENDANS_HOUSE_RIVAL_BEDROOM setflag FLAG_HIDE_LITTLEROOT_TOWN_MAYS_HOUSE_RIVAL_BEDROOM - compare VAR_DEX_UPGRADE_JOHTO_STARTER_STATE, 0 - call_if_eq EverGrandeCity_HallOfFame_EventScript_ReadyDexUpgradeEvent + call_if_eq VAR_DEX_UPGRADE_JOHTO_STARTER_STATE, 0, EverGrandeCity_HallOfFame_EventScript_ReadyDexUpgradeEvent return EverGrandeCity_HallOfFame_EventScript_ResetDefeatedEventLegendaries:: diff --git a/data/scripts/interview.inc b/data/scripts/interview.inc index 90fceb9d187d..e102bf889c84 100644 --- a/data/scripts/interview.inc +++ b/data/scripts/interview.inc @@ -8,14 +8,11 @@ Interview_EventScript_EndInterview:: SlateportCity_PokemonFanClub_EventScript_ReporterNoNickname:: setvar VAR_0x8005, TVSHOW_FAN_CLUB_LETTER special InterviewBefore - compare VAR_RESULT, TRUE - goto_if_eq SlateportCity_PokemonFanClub_EventScript_AlreadyInterviewed2 + goto_if_eq VAR_RESULT, TRUE, SlateportCity_PokemonFanClub_EventScript_AlreadyInterviewed2 copyvar VAR_0x8009, VAR_0x8006 msgbox SlateportCity_PokemonFanClub_Text_InterviewRequest, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq SlateportCity_PokemonFanClub_EventScript_AcceptInterview2 - compare VAR_RESULT, NO - goto_if_eq SlateportCity_PokemonFanClub_EventScript_DeclineInterview2 + goto_if_eq VAR_RESULT, YES, SlateportCity_PokemonFanClub_EventScript_AcceptInterview2 + goto_if_eq VAR_RESULT, NO, SlateportCity_PokemonFanClub_EventScript_DeclineInterview2 end SlateportCity_PokemonFanClub_EventScript_AcceptInterview2:: @@ -26,10 +23,8 @@ SlateportCity_PokemonFanClub_EventScript_AcceptInterview2:: call Common_ShowEasyChatScreen lock faceplayer - compare VAR_RESULT, 1 - goto_if_eq SlateportCity_PokemonFanClub_EventScript_SubmitResponse2 - compare VAR_RESULT, 0 - goto_if_eq SlateportCity_PokemonFanClub_EventScript_DeclineInterview2 + goto_if_eq VAR_RESULT, 1, SlateportCity_PokemonFanClub_EventScript_SubmitResponse2 + goto_if_eq VAR_RESULT, 0, SlateportCity_PokemonFanClub_EventScript_DeclineInterview2 end SlateportCity_PokemonFanClub_EventScript_DeclineInterview2:: @@ -53,24 +48,19 @@ SlateportCity_OceanicMuseum_1F_EventScript_Reporter:: faceplayer setvar VAR_0x8005, TVSHOW_RECENT_HAPPENINGS special InterviewBefore - compare VAR_RESULT, TRUE - goto_if_eq SlateportCity_OceanicMuseum_1F_EventScript_AlreadyInterviewed + goto_if_eq VAR_RESULT, TRUE, SlateportCity_OceanicMuseum_1F_EventScript_AlreadyInterviewed copyvar VAR_0x8009, VAR_0x8006 goto_if_set FLAG_OCEANIC_MUSEUM_MET_REPORTER, SlateportCity_OceanicMuseum_1F_EventScript_RequestInterviewShort setflag FLAG_OCEANIC_MUSEUM_MET_REPORTER msgbox SlateportCity_OceanicMuseum_1F_Text_InterviewRequest, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq SlateportCity_OceanicMuseum_1F_EventScript_AcceptInterview - compare VAR_RESULT, NO - goto_if_eq SlateportCity_OceanicMuseum_1F_EventScript_DeclineInterview + goto_if_eq VAR_RESULT, YES, SlateportCity_OceanicMuseum_1F_EventScript_AcceptInterview + goto_if_eq VAR_RESULT, NO, SlateportCity_OceanicMuseum_1F_EventScript_DeclineInterview end SlateportCity_OceanicMuseum_1F_EventScript_RequestInterviewShort:: msgbox SlateportCity_OceanicMuseum_1F_Text_InterviewRequestShort, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq SlateportCity_OceanicMuseum_1F_EventScript_AcceptInterview - compare VAR_RESULT, NO - goto_if_eq SlateportCity_OceanicMuseum_1F_EventScript_DeclineInterview + goto_if_eq VAR_RESULT, YES, SlateportCity_OceanicMuseum_1F_EventScript_AcceptInterview + goto_if_eq VAR_RESULT, NO, SlateportCity_OceanicMuseum_1F_EventScript_DeclineInterview end SlateportCity_OceanicMuseum_1F_EventScript_AcceptInterview:: @@ -81,10 +71,8 @@ SlateportCity_OceanicMuseum_1F_EventScript_AcceptInterview:: call Common_ShowEasyChatScreen lock faceplayer - compare VAR_RESULT, 1 - goto_if_eq SlateportCity_OceanicMuseum_1F_EventScript_SubmitResponse - compare VAR_RESULT, 0 - goto_if_eq SlateportCity_OceanicMuseum_1F_EventScript_DeclineInterview + goto_if_eq VAR_RESULT, 1, SlateportCity_OceanicMuseum_1F_EventScript_SubmitResponse + goto_if_eq VAR_RESULT, 0, SlateportCity_OceanicMuseum_1F_EventScript_DeclineInterview end SlateportCity_OceanicMuseum_1F_EventScript_DeclineInterview:: @@ -107,18 +95,14 @@ SlateportCity_PokemonFanClub_EventScript_Reporter:: lock faceplayer specialvar VAR_RESULT, IsLeadMonNicknamedOrNotEnglish - compare VAR_RESULT, FALSE - goto_if_eq SlateportCity_PokemonFanClub_EventScript_ReporterNoNickname + goto_if_eq VAR_RESULT, FALSE, SlateportCity_PokemonFanClub_EventScript_ReporterNoNickname setvar VAR_0x8005, TVSHOW_PKMN_FAN_CLUB_OPINIONS special InterviewBefore - compare VAR_RESULT, TRUE - goto_if_eq SlateportCity_PokemonFanClub_EventScript_AlreadyInterviewed + goto_if_eq VAR_RESULT, TRUE, SlateportCity_PokemonFanClub_EventScript_AlreadyInterviewed copyvar VAR_0x8009, VAR_0x8006 msgbox SlateportCity_PokemonFanClub_Text_InterviewRequestHasName, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq SlateportCity_PokemonFanClub_EventScript_AcceptInterview - compare VAR_RESULT, NO - goto_if_eq SlateportCity_PokemonFanClub_EventScript_DeclineInterview + goto_if_eq VAR_RESULT, YES, SlateportCity_PokemonFanClub_EventScript_AcceptInterview + goto_if_eq VAR_RESULT, NO, SlateportCity_PokemonFanClub_EventScript_DeclineInterview end SlateportCity_PokemonFanClub_EventScript_AcceptInterview:: @@ -153,15 +137,13 @@ SlateportCity_PokemonFanClub_EventScript_ContinueInterview:: call Common_ShowEasyChatScreen lock faceplayer - compare VAR_RESULT, 0 - goto_if_eq SlateportCity_PokemonFanClub_EventScript_DeclineInterview + goto_if_eq VAR_RESULT, 0, SlateportCity_PokemonFanClub_EventScript_DeclineInterview msgbox SlateportCity_PokemonFanClub_Text_WhatDoPokemonMeanToYou, MSGBOX_DEFAULT setvar VAR_0x8006, 1 call Common_ShowEasyChatScreen lock faceplayer - compare VAR_RESULT, 0 - goto_if_eq SlateportCity_PokemonFanClub_EventScript_DeclineInterview + goto_if_eq VAR_RESULT, 0, SlateportCity_PokemonFanClub_EventScript_DeclineInterview msgbox SlateportCity_PokemonFanClub_Text_ThatsAllForInterview, MSGBOX_DEFAULT copyvar VAR_0x8007, VAR_0x800A setvar VAR_0x8005, TVSHOW_PKMN_FAN_CLUB_OPINIONS @@ -184,14 +166,11 @@ LilycoveCity_ContestLobby_EventScript_Reporter:: goto_if_set FLAG_TEMP_2, LilycoveCity_ContestLobby_EventScript_AlreadyInterviewed setvar VAR_0x8005, TVSHOW_BRAVO_TRAINER_POKEMON_PROFILE special InterviewBefore - compare VAR_RESULT, TRUE - goto_if_eq LilycoveCity_ContestLobby_EventScript_AlreadyInterviewed + goto_if_eq VAR_RESULT, TRUE, LilycoveCity_ContestLobby_EventScript_AlreadyInterviewed copyvar VAR_0x8009, VAR_0x8006 msgbox LilycoveCity_ContestLobby_Text_InterviewRequest, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq LilycoveCity_ContestLobby_EventScript_AcceptInterview - compare VAR_RESULT, NO - goto_if_eq LilycoveCity_ContestLobby_EventScript_DeclineInterview + goto_if_eq VAR_RESULT, YES, LilycoveCity_ContestLobby_EventScript_AcceptInterview + goto_if_eq VAR_RESULT, NO, LilycoveCity_ContestLobby_EventScript_DeclineInterview end LilycoveCity_ContestLobby_EventScript_AcceptInterview:: @@ -202,10 +181,8 @@ LilycoveCity_ContestLobby_EventScript_AcceptInterview:: call Common_ShowEasyChatScreen lock faceplayer - compare VAR_RESULT, 1 - goto_if_eq LilycoveCity_ContestLobby_EventScript_SubmitResponse - compare VAR_RESULT, 0 - goto_if_eq LilycoveCity_ContestLobby_EventScript_DeclineInterview + goto_if_eq VAR_RESULT, 1, LilycoveCity_ContestLobby_EventScript_SubmitResponse + goto_if_eq VAR_RESULT, 0, LilycoveCity_ContestLobby_EventScript_DeclineInterview end LilycoveCity_ContestLobby_EventScript_DeclineInterview:: @@ -223,8 +200,7 @@ LilycoveCity_ContestLobby_EventScript_SubmitResponse:: call Common_ShowEasyChatScreen lock faceplayer - compare VAR_RESULT, 0 - goto_if_eq LilycoveCity_ContestLobby_EventScript_DeclineInterview + goto_if_eq VAR_RESULT, 0, LilycoveCity_ContestLobby_EventScript_DeclineInterview msgbox LilycoveCity_ContestLobby_Text_ThatsAllForInterview, MSGBOX_DEFAULT setflag FLAG_TEMP_2 setvar VAR_0x8005, TVSHOW_BRAVO_TRAINER_POKEMON_PROFILE @@ -237,12 +213,10 @@ LilycoveCity_ContestLobby_EventScript_AlreadyInterviewed:: end LilycoveCity_ContestLobby_EventScript_TryShowContestReporter:: - compare VAR_CONTEST_HALL_STATE, 2 - goto_if_ne LilycoveCity_ContestLobby_EventScript_DontShowContestReporter + goto_if_ne VAR_CONTEST_HALL_STATE, 2, LilycoveCity_ContestLobby_EventScript_DontShowContestReporter setvar VAR_0x8005, TVSHOW_BRAVO_TRAINER_POKEMON_PROFILE special InterviewBefore - compare VAR_RESULT, TRUE - goto_if_eq LilycoveCity_ContestLobby_EventScript_DontShowContestReporter + goto_if_eq VAR_RESULT, TRUE, LilycoveCity_ContestLobby_EventScript_DontShowContestReporter switch VAR_CONTEST_TYPE case 0, LilycoveCity_ContestLobby_EventScript_DontShowContestReporter case 2, LilycoveCity_ContestLobby_EventScript_ShowContestReporter @@ -265,14 +239,11 @@ BattleFrontier_BattleTowerLobby_EventScript_Reporter:: goto_if_set FLAG_TEMP_2, BattleFrontier_BattleTowerLobby_EventScript_AlreadyInterviewed setvar VAR_0x8005, TVSHOW_BRAVO_TRAINER_BATTLE_TOWER_PROFILE special InterviewBefore - compare VAR_RESULT, TRUE - goto_if_eq BattleFrontier_BattleTowerLobby_EventScript_AlreadyInterviewed + goto_if_eq VAR_RESULT, TRUE, BattleFrontier_BattleTowerLobby_EventScript_AlreadyInterviewed copyvar VAR_0x8009, VAR_0x8006 msgbox BattleFrontier_BattleTowerLobby_Text_InterviewRequest, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq BattleFrontier_BattleTowerLobby_EventScript_AcceptInterview - compare VAR_RESULT, NO - goto_if_eq BattleFrontier_BattleTowerLobby_EventScript_DeclineInterview + goto_if_eq VAR_RESULT, YES, BattleFrontier_BattleTowerLobby_EventScript_AcceptInterview + goto_if_eq VAR_RESULT, NO, BattleFrontier_BattleTowerLobby_EventScript_DeclineInterview end BattleFrontier_BattleTowerLobby_EventScript_AcceptInterview:: @@ -280,20 +251,16 @@ BattleFrontier_BattleTowerLobby_EventScript_AcceptInterview:: waitmessage multichoice 20, 8, MULTI_SATISFACTION, TRUE copyvar VAR_0x8008, VAR_RESULT - compare VAR_RESULT, 0 - call_if_eq BattleFrontier_BattleTowerLobby_EventScript_Satisfied - compare VAR_RESULT, 1 - call_if_eq BattleFrontier_BattleTowerLobby_EventScript_Dissatisfied + call_if_eq VAR_RESULT, 0, BattleFrontier_BattleTowerLobby_EventScript_Satisfied + call_if_eq VAR_RESULT, 1, BattleFrontier_BattleTowerLobby_EventScript_Dissatisfied msgbox BattleFrontier_BattleTowerLobby_Text_DescribeYourBattle, MSGBOX_DEFAULT setvar VAR_0x8004, EASY_CHAT_TYPE_BATTLE_TOWER_INTERVIEW copyvar VAR_0x8005, VAR_0x8009 call Common_ShowEasyChatScreen lock faceplayer - compare VAR_RESULT, 1 - goto_if_eq BattleFrontier_BattleTowerLobby_EventScript_SubmitResponse - compare VAR_RESULT, 0 - goto_if_eq BattleFrontier_BattleTowerLobby_EventScript_CancelInterview + goto_if_eq VAR_RESULT, 1, BattleFrontier_BattleTowerLobby_EventScript_SubmitResponse + goto_if_eq VAR_RESULT, 0, BattleFrontier_BattleTowerLobby_EventScript_CancelInterview end BattleFrontier_BattleTowerLobby_EventScript_DeclineInterview:: @@ -310,8 +277,7 @@ BattleFrontier_BattleTowerLobby_EventScript_Dissatisfied:: return BattleFrontier_BattleTowerLobby_EventScript_SubmitResponse:: - compare VAR_RESULT, 0 - goto_if_eq BattleFrontier_BattleTowerLobby_EventScript_CancelInterview + goto_if_eq VAR_RESULT, 0, BattleFrontier_BattleTowerLobby_EventScript_CancelInterview msgbox BattleFrontier_BattleTowerLobby_Text_ThatsGreatLine, MSGBOX_DEFAULT setflag FLAG_TEMP_2 copyvar VAR_0x8004, VAR_0x8008 @@ -330,12 +296,10 @@ BattleFrontier_BattleTowerLobby_EventScript_AlreadyInterviewed:: end BattleFrontier_BattleTowerLobby_EventScript_ShowOrHideReporter:: - compare VAR_BRAVO_TRAINER_BATTLE_TOWER_ON, 0 - goto_if_eq BattleFrontier_BattleTowerLobby_EventScript_HideReporter + goto_if_eq VAR_BRAVO_TRAINER_BATTLE_TOWER_ON, 0, BattleFrontier_BattleTowerLobby_EventScript_HideReporter setvar VAR_0x8005, TVSHOW_BRAVO_TRAINER_BATTLE_TOWER_PROFILE special InterviewBefore - compare VAR_RESULT, TRUE - goto_if_eq BattleFrontier_BattleTowerLobby_EventScript_HideReporter + goto_if_eq VAR_RESULT, TRUE, BattleFrontier_BattleTowerLobby_EventScript_HideReporter clearflag FLAG_HIDE_BATTLE_TOWER_REPORTER return @@ -347,8 +311,7 @@ BattleFrontier_BattleTowerLobby_EventScript_HideReporter:: EventScript_ContestLiveInterview:: setvar VAR_0x8005, TVSHOW_CONTEST_LIVE_UPDATES special InterviewBefore - compare VAR_RESULT, TRUE - goto_if_eq EventScript_ContestLiveInterviewEnd + goto_if_eq VAR_RESULT, TRUE, EventScript_ContestLiveInterviewEnd setvar VAR_0x8005, TVSHOW_CONTEST_LIVE_UPDATES special InterviewAfter return diff --git a/data/scripts/kecleon.inc b/data/scripts/kecleon.inc index 82eca777d5e3..f51dc2fbd2bd 100644 --- a/data/scripts/kecleon.inc +++ b/data/scripts/kecleon.inc @@ -48,17 +48,15 @@ Route119_EventScript_Kecleon2:: end EventScript_Kecleon:: - checkitem ITEM_DEVON_SCOPE, 1 - compare VAR_RESULT, 1 - goto_if_eq EventScript_AskUseDevonScope + checkitem ITEM_DEVON_SCOPE + goto_if_eq VAR_RESULT, TRUE, EventScript_AskUseDevonScope msgbox Kecleon_Text_SomethingUnseeable, MSGBOX_DEFAULT release end EventScript_AskUseDevonScope:: msgbox Kecleon_Text_WantToUseDevonScope, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq EventScript_BattleKecleon + goto_if_eq VAR_RESULT, YES, EventScript_BattleKecleon release end @@ -78,12 +76,9 @@ EventScript_BattleKecleon:: dowildbattle clearflag FLAG_SYS_CTRL_OBJ_DELETE specialvar VAR_RESULT, GetBattleOutcome - compare VAR_RESULT, B_OUTCOME_WON - goto_if_eq EventScript_RemoveKecleon - compare VAR_RESULT, B_OUTCOME_RAN - goto_if_eq EventScript_RemoveKecleon - compare VAR_RESULT, B_OUTCOME_PLAYER_TELEPORTED - goto_if_eq EventScript_RemoveKecleon + goto_if_eq VAR_RESULT, B_OUTCOME_WON, EventScript_RemoveKecleon + goto_if_eq VAR_RESULT, B_OUTCOME_RAN, EventScript_RemoveKecleon + goto_if_eq VAR_RESULT, B_OUTCOME_PLAYER_TELEPORTED, EventScript_RemoveKecleon release end diff --git a/data/scripts/lilycove_lady.inc b/data/scripts/lilycove_lady.inc index 576fa28adeb0..5519de9791aa 100644 --- a/data/scripts/lilycove_lady.inc +++ b/data/scripts/lilycove_lady.inc @@ -2,858 +2,789 @@ .set LOCALID_LADYS_MON, 5 LilycoveCity_PokemonCenter_1F_EventScript_LilycoveLady:: - special Script_GetLilycoveLadyId - switch VAR_RESULT - case LILYCOVE_LADY_QUIZ, LilycoveCity_PokemonCenter_1F_EventScript_QuizLady - case LILYCOVE_LADY_FAVOR, LilycoveCity_PokemonCenter_1F_EventScript_FavorLady - case LILYCOVE_LADY_CONTEST, LilycoveCity_PokemonCenter_1F_EventScript_ContestLady - end + special Script_GetLilycoveLadyId + switch VAR_RESULT + case LILYCOVE_LADY_QUIZ, LilycoveCity_PokemonCenter_1F_EventScript_QuizLady + case LILYCOVE_LADY_FAVOR, LilycoveCity_PokemonCenter_1F_EventScript_FavorLady + case LILYCOVE_LADY_CONTEST, LilycoveCity_PokemonCenter_1F_EventScript_ContestLady + end LilycoveCity_PokemonCenter_1F_EventScript_FavorLady:: - lock - faceplayer - msgbox LilycoveCity_PokemonCenter_1F_Text_ImTheFavorLady, MSGBOX_DEFAULT - specialvar VAR_RESULT, GetFavorLadyState - compare VAR_RESULT, LILYCOVE_LADY_STATE_READY - goto_if_eq LilycoveCity_PokemonCenter_1F_EventScript_FavorLadyReady - compare VAR_RESULT, LILYCOVE_LADY_STATE_COMPLETED - goto_if_eq LilycoveCity_PokemonCenter_1F_EventScript_FavorLadyCompleted - compare VAR_RESULT, LILYCOVE_LADY_STATE_PRIZE - goto_if_eq LilycoveCity_PokemonCenter_1F_EventScript_FavorLadyPrize - end + lock + faceplayer + msgbox LilycoveCity_PokemonCenter_1F_Text_ImTheFavorLady, MSGBOX_DEFAULT + specialvar VAR_RESULT, GetFavorLadyState + goto_if_eq VAR_RESULT, LILYCOVE_LADY_STATE_READY, LilycoveCity_PokemonCenter_1F_EventScript_FavorLadyReady + goto_if_eq VAR_RESULT, LILYCOVE_LADY_STATE_COMPLETED, LilycoveCity_PokemonCenter_1F_EventScript_FavorLadyCompleted + goto_if_eq VAR_RESULT, LILYCOVE_LADY_STATE_PRIZE, LilycoveCity_PokemonCenter_1F_EventScript_FavorLadyPrize + end LilycoveCity_PokemonCenter_1F_EventScript_FavorLadyCompleted:: - msgbox LilycoveCity_PokemonCenter_1F_Text_ThankYouForLastTime, MSGBOX_DEFAULT - release - end + msgbox LilycoveCity_PokemonCenter_1F_Text_ThankYouForLastTime, MSGBOX_DEFAULT + release + end LilycoveCity_PokemonCenter_1F_EventScript_FavorLadyReady:: - special BufferFavorLadyRequest - msgbox LilycoveCity_PokemonCenter_1F_Text_ObsessedWithThing, MSGBOX_DEFAULT - specialvar VAR_RESULT, HasAnotherPlayerGivenFavorLadyItem - compare VAR_RESULT, FALSE - goto_if_eq LilycoveCity_PokemonCenter_1F_EventScript_RequestItem - compare VAR_RESULT, TRUE - goto_if_eq LilycoveCity_PokemonCenter_1F_EventScript_TellAboutPlayersItem - end + special BufferFavorLadyRequest + msgbox LilycoveCity_PokemonCenter_1F_Text_ObsessedWithThing, MSGBOX_DEFAULT + specialvar VAR_RESULT, HasAnotherPlayerGivenFavorLadyItem + goto_if_eq VAR_RESULT, FALSE, LilycoveCity_PokemonCenter_1F_EventScript_RequestItem + goto_if_eq VAR_RESULT, TRUE, LilycoveCity_PokemonCenter_1F_EventScript_TellAboutPlayersItem + end LilycoveCity_PokemonCenter_1F_EventScript_TellAboutPlayersItem:: - special BufferFavorLadyItemName - special BufferFavorLadyPlayerName - specialvar VAR_RESULT, DidFavorLadyLikeItem - compare VAR_RESULT, FALSE - goto_if_eq LilycoveCity_PokemonCenter_1F_EventScript_PlayerGaveBadThing - compare VAR_RESULT, TRUE - goto_if_eq LilycoveCity_PokemonCenter_1F_EventScript_PlayerGaveGreatThing - end + special BufferFavorLadyItemName + special BufferFavorLadyPlayerName + specialvar VAR_RESULT, DidFavorLadyLikeItem + goto_if_eq VAR_RESULT, FALSE, LilycoveCity_PokemonCenter_1F_EventScript_PlayerGaveBadThing + goto_if_eq VAR_RESULT, TRUE, LilycoveCity_PokemonCenter_1F_EventScript_PlayerGaveGreatThing + end LilycoveCity_PokemonCenter_1F_EventScript_PlayerGaveBadThing:: - msgbox LilycoveCity_PokemonCenter_1F_Text_PlayerGaveMeBadThing, MSGBOX_DEFAULT - goto LilycoveCity_PokemonCenter_1F_EventScript_RequestItem - end + msgbox LilycoveCity_PokemonCenter_1F_Text_PlayerGaveMeBadThing, MSGBOX_DEFAULT + goto LilycoveCity_PokemonCenter_1F_EventScript_RequestItem + end LilycoveCity_PokemonCenter_1F_EventScript_PlayerGaveGreatThing:: - msgbox LilycoveCity_PokemonCenter_1F_Text_PlayerGaveMeGreatThing, MSGBOX_DEFAULT - goto LilycoveCity_PokemonCenter_1F_EventScript_RequestItem - end + msgbox LilycoveCity_PokemonCenter_1F_Text_PlayerGaveMeGreatThing, MSGBOX_DEFAULT + goto LilycoveCity_PokemonCenter_1F_EventScript_RequestItem + end LilycoveCity_PokemonCenter_1F_EventScript_RequestItem:: - msgbox LilycoveCity_PokemonCenter_1F_Text_WillYouShareThing, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq LilycoveCity_PokemonCenter_1F_EventScript_DeclineFavor - compare VAR_RESULT, YES - goto_if_eq LilycoveCity_PokemonCenter_1F_EventScript_AcceptFavor - end + msgbox LilycoveCity_PokemonCenter_1F_Text_WillYouShareThing, MSGBOX_YESNO + goto_if_eq VAR_RESULT, NO, LilycoveCity_PokemonCenter_1F_EventScript_DeclineFavor + goto_if_eq VAR_RESULT, YES, LilycoveCity_PokemonCenter_1F_EventScript_AcceptFavor + end LilycoveCity_PokemonCenter_1F_EventScript_DeclineFavor:: - msgbox LilycoveCity_PokemonCenter_1F_Text_IsThatSoGoodbye, MSGBOX_DEFAULT - release - end + msgbox LilycoveCity_PokemonCenter_1F_Text_IsThatSoGoodbye, MSGBOX_DEFAULT + release + end LilycoveCity_PokemonCenter_1F_EventScript_AcceptFavor:: - msgbox LilycoveCity_PokemonCenter_1F_Text_WhatWillYouGiveMe, MSGBOX_DEFAULT - goto LilycoveCity_PokemonCenter_1F_EventScript_ChooseFavorItem - end + msgbox LilycoveCity_PokemonCenter_1F_Text_WhatWillYouGiveMe, MSGBOX_DEFAULT + goto LilycoveCity_PokemonCenter_1F_EventScript_ChooseFavorItem + end LilycoveCity_PokemonCenter_1F_EventScript_ChooseFavorItem:: - fadescreen FADE_TO_BLACK - setvar VAR_RESULT, 0 - special Script_FavorLadyOpenBagMenu - waitstate - compare VAR_RESULT, 0 - goto_if_eq LilycoveCity_PokemonCenter_1F_EventScript_AskQuitChooseFavorItem - compare VAR_RESULT, 1 - goto_if_eq LilycoveCity_PokemonCenter_1F_EventScript_GiveFavorItem - end + fadescreen FADE_TO_BLACK + setvar VAR_RESULT, 0 + special Script_FavorLadyOpenBagMenu + waitstate + goto_if_eq VAR_RESULT, 0, LilycoveCity_PokemonCenter_1F_EventScript_AskQuitChooseFavorItem + goto_if_eq VAR_RESULT, 1, LilycoveCity_PokemonCenter_1F_EventScript_GiveFavorItem + end LilycoveCity_PokemonCenter_1F_EventScript_AskQuitChooseFavorItem:: - msgbox LilycoveCity_PokemonCenter_1F_Text_NotWillingToShare, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq LilycoveCity_PokemonCenter_1F_EventScript_DeclineFavor - compare VAR_RESULT, NO - goto_if_eq LilycoveCity_PokemonCenter_1F_EventScript_ChooseFavorItem - end + msgbox LilycoveCity_PokemonCenter_1F_Text_NotWillingToShare, MSGBOX_YESNO + goto_if_eq VAR_RESULT, YES, LilycoveCity_PokemonCenter_1F_EventScript_DeclineFavor + goto_if_eq VAR_RESULT, NO, LilycoveCity_PokemonCenter_1F_EventScript_ChooseFavorItem + end LilycoveCity_PokemonCenter_1F_EventScript_GiveFavorItem:: - specialvar VAR_RESULT, Script_DoesFavorLadyLikeItem - compare VAR_RESULT, FALSE - goto_if_eq LilycoveCity_PokemonCenter_1F_EventScript_DidntLikeFavorItem - compare VAR_RESULT, TRUE - goto_if_eq LilycoveCity_PokemonCenter_1F_EventScript_CheckLovedItem - end + specialvar VAR_RESULT, Script_DoesFavorLadyLikeItem + goto_if_eq VAR_RESULT, FALSE, LilycoveCity_PokemonCenter_1F_EventScript_DidntLikeFavorItem + goto_if_eq VAR_RESULT, TRUE, LilycoveCity_PokemonCenter_1F_EventScript_CheckLovedItem + end LilycoveCity_PokemonCenter_1F_EventScript_DidntLikeFavorItem:: - special BufferFavorLadyRequest - msgbox LilycoveCity_PokemonCenter_1F_Text_IllTryToCherishIt, MSGBOX_DEFAULT - release - end + special BufferFavorLadyRequest + msgbox LilycoveCity_PokemonCenter_1F_Text_IllTryToCherishIt, MSGBOX_DEFAULT + release + end LilycoveCity_PokemonCenter_1F_EventScript_CheckLovedItem:: - specialvar VAR_RESULT, IsFavorLadyThresholdMet - compare VAR_RESULT, FALSE - goto_if_eq LilycoveCity_PokemonCenter_1F_EventScript_LikedFavorItem - compare VAR_RESULT, TRUE - goto_if_eq LilycoveCity_PokemonCenter_1F_EventScript_LovedFavorItem - end + specialvar VAR_RESULT, IsFavorLadyThresholdMet + goto_if_eq VAR_RESULT, FALSE, LilycoveCity_PokemonCenter_1F_EventScript_LikedFavorItem + goto_if_eq VAR_RESULT, TRUE, LilycoveCity_PokemonCenter_1F_EventScript_LovedFavorItem + end LilycoveCity_PokemonCenter_1F_EventScript_LikedFavorItem:: - special BufferFavorLadyRequest - msgbox LilycoveCity_PokemonCenter_1F_Text_IWillCherishThis, MSGBOX_DEFAULT - release - end + special BufferFavorLadyRequest + msgbox LilycoveCity_PokemonCenter_1F_Text_IWillCherishThis, MSGBOX_DEFAULT + release + end LilycoveCity_PokemonCenter_1F_EventScript_LovedFavorItem:: - special BufferFavorLadyRequest - msgbox LilycoveCity_PokemonCenter_1F_Text_IWillTreasureThis, MSGBOX_DEFAULT - goto LilycoveCity_PokemonCenter_1F_EventScript_FavorLadyPrize - end + special BufferFavorLadyRequest + msgbox LilycoveCity_PokemonCenter_1F_Text_IWillTreasureThis, MSGBOX_DEFAULT + goto LilycoveCity_PokemonCenter_1F_EventScript_FavorLadyPrize + end LilycoveCity_PokemonCenter_1F_EventScript_FavorLadyPrize:: - setvar VAR_0x8004, 0 - specialvar VAR_0x8004, FavorLadyGetPrize - msgbox LilycoveCity_PokemonCenter_1F_Text_IllGiveYouThisInReturn, MSGBOX_DEFAULT - giveitem VAR_0x8004 - compare VAR_RESULT, 0 - goto_if_eq LilycoveCity_PokemonCenter_1F_EventScript_NoRoomForFavorPrize - compare VAR_RESULT, 1 - goto_if_eq LilycoveCity_PokemonCenter_1F_EventScript_ReceivedFavorPrize - end + setvar VAR_0x8004, 0 + specialvar VAR_0x8004, FavorLadyGetPrize + msgbox LilycoveCity_PokemonCenter_1F_Text_IllGiveYouThisInReturn, MSGBOX_DEFAULT + giveitem VAR_0x8004 + goto_if_eq VAR_RESULT, 0, LilycoveCity_PokemonCenter_1F_EventScript_NoRoomForFavorPrize + goto_if_eq VAR_RESULT, 1, LilycoveCity_PokemonCenter_1F_EventScript_ReceivedFavorPrize + end LilycoveCity_PokemonCenter_1F_EventScript_NoRoomForFavorPrize:: - msgbox LilycoveCity_PokemonCenter_1F_Text_YouDontHaveSpaceForIt, MSGBOX_DEFAULT - release - end + msgbox LilycoveCity_PokemonCenter_1F_Text_YouDontHaveSpaceForIt, MSGBOX_DEFAULT + release + end LilycoveCity_PokemonCenter_1F_EventScript_ReceivedFavorPrize:: - special SetFavorLadyState_Complete - release - end + special SetFavorLadyState_Complete + release + end LilycoveCity_PokemonCenter_1F_EventScript_QuizLady:: - lock - faceplayer - msgbox LilycoveCity_PokemonCenter_1F_Text_ImTheQuizLady, MSGBOX_DEFAULT - specialvar VAR_RESULT, GetQuizLadyState - compare VAR_RESULT, LILYCOVE_LADY_STATE_READY - goto_if_eq LilycoveCity_PokemonCenter_1F_EventScript_HasQuiz - compare VAR_RESULT, LILYCOVE_LADY_STATE_COMPLETED - goto_if_eq LilycoveCity_PokemonCenter_1F_EventScript_CheckMadeQuiz - compare VAR_RESULT, LILYCOVE_LADY_STATE_PRIZE - goto_if_eq LilycoveCity_PokemonCenter_1F_EventScript_ReadyGivePrize - end + lock + faceplayer + msgbox LilycoveCity_PokemonCenter_1F_Text_ImTheQuizLady, MSGBOX_DEFAULT + specialvar VAR_RESULT, GetQuizLadyState + goto_if_eq VAR_RESULT, LILYCOVE_LADY_STATE_READY, LilycoveCity_PokemonCenter_1F_EventScript_HasQuiz + goto_if_eq VAR_RESULT, LILYCOVE_LADY_STATE_COMPLETED, LilycoveCity_PokemonCenter_1F_EventScript_CheckMadeQuiz + goto_if_eq VAR_RESULT, LILYCOVE_LADY_STATE_PRIZE, LilycoveCity_PokemonCenter_1F_EventScript_ReadyGivePrize + end LilycoveCity_PokemonCenter_1F_EventScript_HasQuiz:: - specialvar VAR_RESULT, GetQuizAuthor - compare VAR_RESULT, QUIZ_AUTHOR_PLAYER - goto_if_eq LilycoveCity_PokemonCenter_1F_EventScript_WaitingToTakeYourQuiz - compare VAR_RESULT, QUIZ_AUTHOR_OTHER_PLAYER - goto_if_eq LilycoveCity_PokemonCenter_1F_EventScript_PlayerQuizReady - compare VAR_RESULT, QUIZ_AUTHOR_LADY - goto_if_eq LilycoveCity_PokemonCenter_1F_EventScript_LadyQuizReady - end + specialvar VAR_RESULT, GetQuizAuthor + goto_if_eq VAR_RESULT, QUIZ_AUTHOR_PLAYER, LilycoveCity_PokemonCenter_1F_EventScript_WaitingToTakeYourQuiz + goto_if_eq VAR_RESULT, QUIZ_AUTHOR_OTHER_PLAYER, LilycoveCity_PokemonCenter_1F_EventScript_PlayerQuizReady + goto_if_eq VAR_RESULT, QUIZ_AUTHOR_LADY, LilycoveCity_PokemonCenter_1F_EventScript_LadyQuizReady + end LilycoveCity_PokemonCenter_1F_EventScript_CheckMadeQuiz:: - specialvar VAR_RESULT, IsQuizLadyWaitingForChallenger - compare VAR_RESULT, FALSE - goto_if_eq LilycoveCity_PokemonCenter_1F_EventScript_AskMakeQuiz - compare VAR_RESULT, TRUE - goto_if_eq LilycoveCity_PokemonCenter_1F_EventScript_WaitingToTakeYourQuiz - end + specialvar VAR_RESULT, IsQuizLadyWaitingForChallenger + goto_if_eq VAR_RESULT, FALSE, LilycoveCity_PokemonCenter_1F_EventScript_AskMakeQuiz + goto_if_eq VAR_RESULT, TRUE, LilycoveCity_PokemonCenter_1F_EventScript_WaitingToTakeYourQuiz + end LilycoveCity_PokemonCenter_1F_EventScript_WaitingToTakeYourQuiz:: - msgbox LilycoveCity_PokemonCenter_1F_Text_WaitingToTakeYourQuiz, MSGBOX_DEFAULT - release - end + msgbox LilycoveCity_PokemonCenter_1F_Text_WaitingToTakeYourQuiz, MSGBOX_DEFAULT + release + end LilycoveCity_PokemonCenter_1F_EventScript_PlayerQuizReady:: - msgbox LilycoveCity_PokemonCenter_1F_Text_WaitingForChallenger, MSGBOX_DEFAULT - goto LilycoveCity_PokemonCenter_1F_EventScript_AskTakeQuiz - end + msgbox LilycoveCity_PokemonCenter_1F_Text_WaitingForChallenger, MSGBOX_DEFAULT + goto LilycoveCity_PokemonCenter_1F_EventScript_AskTakeQuiz + end LilycoveCity_PokemonCenter_1F_EventScript_LadyQuizReady:: - msgbox LilycoveCity_PokemonCenter_1F_Text_WaitingForChallenger, MSGBOX_DEFAULT - goto LilycoveCity_PokemonCenter_1F_EventScript_AskTakeQuiz - end + msgbox LilycoveCity_PokemonCenter_1F_Text_WaitingForChallenger, MSGBOX_DEFAULT + goto LilycoveCity_PokemonCenter_1F_EventScript_AskTakeQuiz + end LilycoveCity_PokemonCenter_1F_EventScript_AskTakeQuiz:: - setvar VAR_0x8004, 0 - msgbox LilycoveCity_PokemonCenter_1F_Text_TakeQuizChallenge, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq LilycoveCity_PokemonCenter_1F_EventScript_TakeQuiz - compare VAR_RESULT, NO - goto_if_eq LilycoveCity_PokemonCenter_1F_EventScript_DeclineQuiz - end + setvar VAR_0x8004, 0 + msgbox LilycoveCity_PokemonCenter_1F_Text_TakeQuizChallenge, MSGBOX_YESNO + goto_if_eq VAR_RESULT, YES, LilycoveCity_PokemonCenter_1F_EventScript_TakeQuiz + goto_if_eq VAR_RESULT, NO, LilycoveCity_PokemonCenter_1F_EventScript_DeclineQuiz + end LilycoveCity_PokemonCenter_1F_EventScript_DeclineQuiz:: - msgbox LilycoveCity_PokemonCenter_1F_Text_HowBoringBye, MSGBOX_DEFAULT - release - end + msgbox LilycoveCity_PokemonCenter_1F_Text_HowBoringBye, MSGBOX_DEFAULT + release + end LilycoveCity_PokemonCenter_1F_EventScript_TakeQuiz:: - special ClearQuizLadyPlayerAnswer - compare VAR_0x8004, 0 - goto_if_eq LilycoveCity_PokemonCenter_1F_EventScript_ShowQuestion - compare VAR_0x8004, EASY_CHAT_TYPE_QUIZ_ANSWER - goto_if_eq LilycoveCity_PokemonCenter_1F_EventScript_GetAnswer + special ClearQuizLadyPlayerAnswer + goto_if_eq VAR_0x8004, 0, LilycoveCity_PokemonCenter_1F_EventScript_ShowQuestion + goto_if_eq VAR_0x8004, EASY_CHAT_TYPE_QUIZ_ANSWER, LilycoveCity_PokemonCenter_1F_EventScript_GetAnswer LilycoveCity_PokemonCenter_1F_EventScript_CheckQuizTakingState:: - compare VAR_RESULT, 0 - goto_if_eq LilycoveCity_PokemonCenter_1F_EventScript_AskQuitQuiz - compare VAR_RESULT, 1 - goto_if_eq LilycoveCity_PokemonCenter_1F_EventScript_SubmitQuizResponse - end + goto_if_eq VAR_RESULT, 0, LilycoveCity_PokemonCenter_1F_EventScript_AskQuitQuiz + goto_if_eq VAR_RESULT, 1, LilycoveCity_PokemonCenter_1F_EventScript_SubmitQuizResponse + end LilycoveCity_PokemonCenter_1F_EventScript_ShowQuestion:: - special QuizLadyShowQuizQuestion - waitstate - goto LilycoveCity_PokemonCenter_1F_EventScript_CheckQuizTakingState - end + special QuizLadyShowQuizQuestion + waitstate + goto LilycoveCity_PokemonCenter_1F_EventScript_CheckQuizTakingState + end LilycoveCity_PokemonCenter_1F_EventScript_GetAnswer:: - special QuizLadyGetPlayerAnswer - waitstate - goto LilycoveCity_PokemonCenter_1F_EventScript_CheckQuizTakingState - end + special QuizLadyGetPlayerAnswer + waitstate + goto LilycoveCity_PokemonCenter_1F_EventScript_CheckQuizTakingState + end LilycoveCity_PokemonCenter_1F_EventScript_AskQuitQuiz:: - msgbox LilycoveCity_PokemonCenter_1F_Text_YoureGoingToQuit, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq LilycoveCity_PokemonCenter_1F_EventScript_QuitTakingQuiz - compare VAR_RESULT, NO - goto_if_eq LilycoveCity_PokemonCenter_1F_EventScript_TakeQuiz - end + msgbox LilycoveCity_PokemonCenter_1F_Text_YoureGoingToQuit, MSGBOX_YESNO + goto_if_eq VAR_RESULT, YES, LilycoveCity_PokemonCenter_1F_EventScript_QuitTakingQuiz + goto_if_eq VAR_RESULT, NO, LilycoveCity_PokemonCenter_1F_EventScript_TakeQuiz + end LilycoveCity_PokemonCenter_1F_EventScript_QuitTakingQuiz:: - msgbox LilycoveCity_PokemonCenter_1F_Text_TakeTheQuizAnotherTime, MSGBOX_DEFAULT - release - end + msgbox LilycoveCity_PokemonCenter_1F_Text_TakeTheQuizAnotherTime, MSGBOX_DEFAULT + release + end LilycoveCity_PokemonCenter_1F_EventScript_SubmitQuizResponse:: - special SetQuizLadyState_Complete - msgbox LilycoveCity_PokemonCenter_1F_Text_WaitForAnswer, MSGBOX_DEFAULT - specialvar VAR_RESULT, IsQuizAnswerCorrect - compare VAR_RESULT, FALSE - goto_if_eq LilycoveCity_PokemonCenter_1F_EventScript_IncorrectResponse - compare VAR_RESULT, TRUE - goto_if_eq LilycoveCity_PokemonCenter_1F_EventScript_CorrectResponse - end + special SetQuizLadyState_Complete + msgbox LilycoveCity_PokemonCenter_1F_Text_WaitForAnswer, MSGBOX_DEFAULT + specialvar VAR_RESULT, IsQuizAnswerCorrect + goto_if_eq VAR_RESULT, FALSE, LilycoveCity_PokemonCenter_1F_EventScript_IncorrectResponse + goto_if_eq VAR_RESULT, TRUE, LilycoveCity_PokemonCenter_1F_EventScript_CorrectResponse + end LilycoveCity_PokemonCenter_1F_EventScript_CorrectResponse:: - playse SE_SUCCESS - delay 10 - playse SE_SUCCESS - msgbox LilycoveCity_PokemonCenter_1F_Text_YouGotItRight, MSGBOX_DEFAULT - goto LilycoveCity_PokemonCenter_1F_EventScript_ReadyGivePrize - end + playse SE_SUCCESS + delay 10 + playse SE_SUCCESS + msgbox LilycoveCity_PokemonCenter_1F_Text_YouGotItRight, MSGBOX_DEFAULT + goto LilycoveCity_PokemonCenter_1F_EventScript_ReadyGivePrize + end LilycoveCity_PokemonCenter_1F_EventScript_IncorrectResponse:: - special BufferQuizCorrectAnswer - special BufferQuizPrizeName - playse SE_FAILURE - delay 10 - playse SE_FAILURE - msgbox LilycoveCity_PokemonCenter_1F_Text_WrongTheCorrectAnswerIs, MSGBOX_DEFAULT - msgbox LilycoveCity_PokemonCenter_1F_Text_IGetToKeepPrize, MSGBOX_DEFAULT - goto LilycoveCity_PokemonCenter_1F_EventScript_AskMakeQuiz - end + special BufferQuizCorrectAnswer + special BufferQuizPrizeName + playse SE_FAILURE + delay 10 + playse SE_FAILURE + msgbox LilycoveCity_PokemonCenter_1F_Text_WrongTheCorrectAnswerIs, MSGBOX_DEFAULT + msgbox LilycoveCity_PokemonCenter_1F_Text_IGetToKeepPrize, MSGBOX_DEFAULT + goto LilycoveCity_PokemonCenter_1F_EventScript_AskMakeQuiz + end @ VAR_RESULT is essentially ignored, both jumps are identical LilycoveCity_PokemonCenter_1F_EventScript_ReadyGivePrize:: - specialvar VAR_RESULT, BufferQuizAuthorNameAndCheckIfLady - compare VAR_RESULT, 1 - goto_if_eq LilycoveCity_PokemonCenter_1F_EventScript_GivePrize1 - compare VAR_RESULT, 0 - goto_if_eq LilycoveCity_PokemonCenter_1F_EventScript_GivePrize0 - end + specialvar VAR_RESULT, BufferQuizAuthorNameAndCheckIfLady + goto_if_eq VAR_RESULT, 1, LilycoveCity_PokemonCenter_1F_EventScript_GivePrize1 + goto_if_eq VAR_RESULT, 0, LilycoveCity_PokemonCenter_1F_EventScript_GivePrize0 + end LilycoveCity_PokemonCenter_1F_EventScript_GivePrize1:: - msgbox LilycoveCity_PokemonCenter_1F_Text_YouGotItRightYouveWonPersonsPrize, MSGBOX_DEFAULT - goto LilycoveCity_PokemonCenter_1F_EventScript_GivePrize - end + msgbox LilycoveCity_PokemonCenter_1F_Text_YouGotItRightYouveWonPersonsPrize, MSGBOX_DEFAULT + goto LilycoveCity_PokemonCenter_1F_EventScript_GivePrize + end LilycoveCity_PokemonCenter_1F_EventScript_GivePrize0:: - msgbox LilycoveCity_PokemonCenter_1F_Text_YouGotItRightYouveWonPersonsPrize, MSGBOX_DEFAULT - goto LilycoveCity_PokemonCenter_1F_EventScript_GivePrize - end + msgbox LilycoveCity_PokemonCenter_1F_Text_YouGotItRightYouveWonPersonsPrize, MSGBOX_DEFAULT + goto LilycoveCity_PokemonCenter_1F_EventScript_GivePrize + end LilycoveCity_PokemonCenter_1F_EventScript_GivePrize:: - setvar VAR_0x8005, 0 - special BufferQuizPrizeItem - special SetQuizLadyState_Complete - giveitem VAR_0x8005 - compare VAR_RESULT, FALSE - goto_if_eq LilycoveCity_PokemonCenter_1F_EventScript_NoSpaceForQuizPrize - goto LilycoveCity_PokemonCenter_1F_EventScript_AskMakeQuiz - end + setvar VAR_0x8005, 0 + special BufferQuizPrizeItem + special SetQuizLadyState_Complete + giveitem VAR_0x8005 + goto_if_eq VAR_RESULT, FALSE, LilycoveCity_PokemonCenter_1F_EventScript_NoSpaceForQuizPrize + goto LilycoveCity_PokemonCenter_1F_EventScript_AskMakeQuiz + end LilycoveCity_PokemonCenter_1F_EventScript_NoSpaceForQuizPrize:: - msgbox LilycoveCity_PokemonCenter_1F_Text_YourBagIsFilledUp, MSGBOX_DEFAULT - special SetQuizLadyState_GivePrize - release - end + msgbox LilycoveCity_PokemonCenter_1F_Text_YourBagIsFilledUp, MSGBOX_DEFAULT + special SetQuizLadyState_GivePrize + release + end LilycoveCity_PokemonCenter_1F_EventScript_AskMakeQuiz:: - msgbox LilycoveCity_PokemonCenter_1F_Text_MakeYourOwnQuiz, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq LilycoveCity_PokemonCenter_1F_EventScript_MakeQuiz - compare VAR_RESULT, NO - goto_if_eq LilycoveCity_PokemonCenter_1F_EventScript_DeclineMakeQuiz - end + msgbox LilycoveCity_PokemonCenter_1F_Text_MakeYourOwnQuiz, MSGBOX_YESNO + goto_if_eq VAR_RESULT, YES, LilycoveCity_PokemonCenter_1F_EventScript_MakeQuiz + goto_if_eq VAR_RESULT, NO, LilycoveCity_PokemonCenter_1F_EventScript_DeclineMakeQuiz + end LilycoveCity_PokemonCenter_1F_EventScript_DeclineMakeQuiz:: - special QuizLadyPickNewQuestion - msgbox LilycoveCity_PokemonCenter_1F_Text_MaybeNextTime, MSGBOX_DEFAULT - release - end + special QuizLadyPickNewQuestion + msgbox LilycoveCity_PokemonCenter_1F_Text_MaybeNextTime, MSGBOX_DEFAULT + release + end LilycoveCity_PokemonCenter_1F_EventScript_MakeQuiz:: - msgbox LilycoveCity_PokemonCenter_1F_Text_PickYourPrize, MSGBOX_DEFAULT + msgbox LilycoveCity_PokemonCenter_1F_Text_PickYourPrize, MSGBOX_DEFAULT LilycoveCity_PokemonCenter_1F_EventScript_PickPrize:: - fadescreen FADE_TO_BLACK - setvar VAR_RESULT, 0 - special Script_QuizLadyOpenBagMenu - waitstate - compare VAR_RESULT, 0 - goto_if_eq LilycoveCity_PokemonCenter_1F_EventScript_AskQuitChoosingPrize - compare VAR_RESULT, 1 - goto_if_eq LilycoveCity_PokemonCenter_1F_EventScript_WriteQuiz - end + fadescreen FADE_TO_BLACK + setvar VAR_RESULT, 0 + special Script_QuizLadyOpenBagMenu + waitstate + goto_if_eq VAR_RESULT, 0, LilycoveCity_PokemonCenter_1F_EventScript_AskQuitChoosingPrize + goto_if_eq VAR_RESULT, 1, LilycoveCity_PokemonCenter_1F_EventScript_WriteQuiz + end LilycoveCity_PokemonCenter_1F_EventScript_AskQuitChoosingPrize:: - msgbox LilycoveCity_PokemonCenter_1F_Text_QuitChoosingPrize, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq LilycoveCity_PokemonCenter_1F_EventScript_DeclineMakeQuiz - compare VAR_RESULT, NO - goto_if_eq LilycoveCity_PokemonCenter_1F_EventScript_PickPrize - end + msgbox LilycoveCity_PokemonCenter_1F_Text_QuitChoosingPrize, MSGBOX_YESNO + goto_if_eq VAR_RESULT, YES, LilycoveCity_PokemonCenter_1F_EventScript_DeclineMakeQuiz + goto_if_eq VAR_RESULT, NO, LilycoveCity_PokemonCenter_1F_EventScript_PickPrize + end LilycoveCity_PokemonCenter_1F_EventScript_WriteQuiz:: - msgbox LilycoveCity_PokemonCenter_1F_Text_WriteYourQuiz, MSGBOX_DEFAULT - special ClearQuizLadyQuestionAndAnswer - special ClearQuizLadyPlayerAnswer - setvar VAR_0x8004, EASY_CHAT_TYPE_QUIZ_QUESTION + msgbox LilycoveCity_PokemonCenter_1F_Text_WriteYourQuiz, MSGBOX_DEFAULT + special ClearQuizLadyQuestionAndAnswer + special ClearQuizLadyPlayerAnswer + setvar VAR_0x8004, EASY_CHAT_TYPE_QUIZ_QUESTION LilycoveCity_PokemonCenter_1F_EventScript_WriteQuizQuestion:: - fadescreen FADE_TO_BLACK - special QuizLadySetCustomQuestion - waitstate - compare VAR_RESULT, 0 - goto_if_eq LilycoveCity_PokemonCenter_1F_EventScript_AskQuitWritingQuizQuestion - goto LilycoveCity_PokemonCenter_1F_EventScript_FinishMakingQuiz - end + fadescreen FADE_TO_BLACK + special QuizLadySetCustomQuestion + waitstate + goto_if_eq VAR_RESULT, 0, LilycoveCity_PokemonCenter_1F_EventScript_AskQuitWritingQuizQuestion + goto LilycoveCity_PokemonCenter_1F_EventScript_FinishMakingQuiz + end LilycoveCity_PokemonCenter_1F_EventScript_AskQuitWritingQuizQuestion:: - msgbox LilycoveCity_PokemonCenter_1F_Text_QuitWritingQuizQuestion, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq LilycoveCity_PokemonCenter_1F_EventScript_DeclineMakeQuiz - compare VAR_RESULT, NO - goto_if_eq LilycoveCity_PokemonCenter_1F_EventScript_WriteQuizQuestion - end + msgbox LilycoveCity_PokemonCenter_1F_Text_QuitWritingQuizQuestion, MSGBOX_YESNO + goto_if_eq VAR_RESULT, YES, LilycoveCity_PokemonCenter_1F_EventScript_DeclineMakeQuiz + goto_if_eq VAR_RESULT, NO, LilycoveCity_PokemonCenter_1F_EventScript_WriteQuizQuestion + end LilycoveCity_PokemonCenter_1F_EventScript_FinishMakingQuiz:: - special QuizLadyTakePrizeForCustomQuiz - special QuizLadyRecordCustomQuizData - special QuizLadySetWaitingForChallenger - msgbox LilycoveCity_PokemonCenter_1F_Text_IllLookForAChallenger, MSGBOX_DEFAULT - release - end + special QuizLadyTakePrizeForCustomQuiz + special QuizLadyRecordCustomQuizData + special QuizLadySetWaitingForChallenger + msgbox LilycoveCity_PokemonCenter_1F_Text_IllLookForAChallenger, MSGBOX_DEFAULT + release + end LilycoveCity_PokemonCenter_1F_EventScript_ContestLady:: - lock - faceplayer - msgbox LilycoveCity_PokemonCenter_1F_Text_ImTheContestLady, MSGBOX_DEFAULT - specialvar VAR_RESULT, HasPlayerGivenContestLadyPokeblock - compare VAR_RESULT, FALSE - goto_if_eq LilycoveCity_PokemonCenter_1F_EventScript_NotGivenPokeblock - compare VAR_RESULT, TRUE - goto_if_eq LilycoveCity_PokemonCenter_1F_EventScript_GivenPokeblock - end + lock + faceplayer + msgbox LilycoveCity_PokemonCenter_1F_Text_ImTheContestLady, MSGBOX_DEFAULT + specialvar VAR_RESULT, HasPlayerGivenContestLadyPokeblock + goto_if_eq VAR_RESULT, FALSE, LilycoveCity_PokemonCenter_1F_EventScript_NotGivenPokeblock + goto_if_eq VAR_RESULT, TRUE, LilycoveCity_PokemonCenter_1F_EventScript_GivenPokeblock + end @ Redundant with above script, VAR_RESULT will always be FALSE here LilycoveCity_PokemonCenter_1F_EventScript_NotGivenPokeblock:: - specialvar VAR_RESULT, ShouldContestLadyShowGoOnAir - compare VAR_RESULT, FALSE - goto_if_eq LilycoveCity_PokemonCenter_1F_EventScript_AskForPokeblock - compare VAR_RESULT, TRUE - goto_if_eq LilycoveCity_PokemonCenter_1F_EventScript_GivenPokeblock - end + specialvar VAR_RESULT, ShouldContestLadyShowGoOnAir + goto_if_eq VAR_RESULT, FALSE, LilycoveCity_PokemonCenter_1F_EventScript_AskForPokeblock + goto_if_eq VAR_RESULT, TRUE, LilycoveCity_PokemonCenter_1F_EventScript_GivenPokeblock + end LilycoveCity_PokemonCenter_1F_EventScript_GivenPokeblock:: - msgbox LilycoveCity_PokemonCenter_1F_Text_ThankForPokeblock, MSGBOX_DEFAULT - release - end + msgbox LilycoveCity_PokemonCenter_1F_Text_ThankForPokeblock, MSGBOX_DEFAULT + release + end LilycoveCity_PokemonCenter_1F_EventScript_AskForPokeblock:: - special Script_BufferContestLadyCategoryAndMonName - msgbox LilycoveCity_PokemonCenter_1F_Text_MyFriendDisplaysQuality, MSGBOX_DEFAULT - checkitem ITEM_POKEBLOCK_CASE, 1 - compare VAR_RESULT, FALSE - goto_if_eq LilycoveCity_PokemonCenter_1F_EventScript_NoPokeblockCase - msgbox LilycoveCity_PokemonCenter_1F_Text_AskingForOnePokeblock, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq LilycoveCity_PokemonCenter_1F_EventScript_DeclineGivePokeblock - compare VAR_RESULT, YES - goto_if_eq LilycoveCity_PokemonCenter_1F_EventScript_ChoosePokeblock - end + special Script_BufferContestLadyCategoryAndMonName + msgbox LilycoveCity_PokemonCenter_1F_Text_MyFriendDisplaysQuality, MSGBOX_DEFAULT + checkitem ITEM_POKEBLOCK_CASE + goto_if_eq VAR_RESULT, FALSE, LilycoveCity_PokemonCenter_1F_EventScript_NoPokeblockCase + msgbox LilycoveCity_PokemonCenter_1F_Text_AskingForOnePokeblock, MSGBOX_YESNO + goto_if_eq VAR_RESULT, NO, LilycoveCity_PokemonCenter_1F_EventScript_DeclineGivePokeblock + goto_if_eq VAR_RESULT, YES, LilycoveCity_PokemonCenter_1F_EventScript_ChoosePokeblock + end LilycoveCity_PokemonCenter_1F_EventScript_DeclineGivePokeblock:: - msgbox LilycoveCity_PokemonCenter_1F_Text_WhatACheapskate, MSGBOX_DEFAULT - release - end + msgbox LilycoveCity_PokemonCenter_1F_Text_WhatACheapskate, MSGBOX_DEFAULT + release + end LilycoveCity_PokemonCenter_1F_EventScript_ChoosePokeblock:: - fadescreen FADE_TO_BLACK - special OpenPokeblockCaseForContestLady - waitstate - compare VAR_RESULT, 0xFFFF - goto_if_eq LilycoveCity_PokemonCenter_1F_EventScript_AskQuitGivingPokeblock - compare VAR_RESULT, 0xFFFF - goto_if_ne LilycoveCity_PokemonCenter_1F_EventScript_GivePokeblock - end + fadescreen FADE_TO_BLACK + special OpenPokeblockCaseForContestLady + waitstate + goto_if_eq VAR_RESULT, 0xFFFF, LilycoveCity_PokemonCenter_1F_EventScript_AskQuitGivingPokeblock + goto_if_ne VAR_RESULT, 0xFFFF, LilycoveCity_PokemonCenter_1F_EventScript_GivePokeblock + end LilycoveCity_PokemonCenter_1F_EventScript_AskQuitGivingPokeblock:: - msgbox LilycoveCity_PokemonCenter_1F_Text_ICantHaveOnePokeblock, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq LilycoveCity_PokemonCenter_1F_EventScript_DeclineGivePokeblock - compare VAR_RESULT, NO - goto_if_eq LilycoveCity_PokemonCenter_1F_EventScript_ChoosePokeblock - end + msgbox LilycoveCity_PokemonCenter_1F_Text_ICantHaveOnePokeblock, MSGBOX_YESNO + goto_if_eq VAR_RESULT, YES, LilycoveCity_PokemonCenter_1F_EventScript_DeclineGivePokeblock + goto_if_eq VAR_RESULT, NO, LilycoveCity_PokemonCenter_1F_EventScript_ChoosePokeblock + end LilycoveCity_PokemonCenter_1F_EventScript_GivePokeblock:: - msgbox LilycoveCity_PokemonCenter_1F_Text_IllUseYourPokeblock, MSGBOX_DEFAULT - special SetContestLadyGivenPokeblock - special GetContestLadyMonSpecies - goto LilycoveCity_PokemonCenter_1F_EventScript_FeedPokeblock - end + msgbox LilycoveCity_PokemonCenter_1F_Text_IllUseYourPokeblock, MSGBOX_DEFAULT + special SetContestLadyGivenPokeblock + special GetContestLadyMonSpecies + goto LilycoveCity_PokemonCenter_1F_EventScript_FeedPokeblock + end @ VAR_0x8004 here is the return value from GivePokeblockToContestLady LilycoveCity_PokemonCenter_1F_EventScript_FeedPokeblock:: - applymovement LOCALID_LILYCOVE_LADY, LilycoveCity_PokemonCenter_1F_Movement_LadyFaceMon - waitmovement 0 - delay 60 - applymovement LOCALID_LADYS_MON, LilycoveCity_PokemonCenter_1F_Movement_MonFaceLady - waitmovement 0 - delay 60 - waitse - playmoncry VAR_0x8005, CRY_MODE_NORMAL - delay 120 - waitmoncry - compare VAR_0x8004, 1 - goto_if_eq LilycoveCity_PokemonCenter_1F_EventScript_MonEnjoyPokeblock - goto LilycoveCity_PokemonCenter_1F_EventScript_FinishFeedPokeblock - end + applymovement LOCALID_LILYCOVE_LADY, LilycoveCity_PokemonCenter_1F_Movement_LadyFaceMon + waitmovement 0 + delay 60 + applymovement LOCALID_LADYS_MON, LilycoveCity_PokemonCenter_1F_Movement_MonFaceLady + waitmovement 0 + delay 60 + waitse + playmoncry VAR_0x8005, CRY_MODE_NORMAL + delay 120 + waitmoncry + goto_if_eq VAR_0x8004, 1, LilycoveCity_PokemonCenter_1F_EventScript_MonEnjoyPokeblock + goto LilycoveCity_PokemonCenter_1F_EventScript_FinishFeedPokeblock + end @ VAR_0x8004 here is the return value from GivePokeblockToContestLady LilycoveCity_PokemonCenter_1F_EventScript_MonEnjoyPokeblock:: - applymovement LOCALID_LADYS_MON, LilycoveCity_PokemonCenter_1F_Movement_MonJump - waitmovement 0 - delay 60 + applymovement LOCALID_LADYS_MON, LilycoveCity_PokemonCenter_1F_Movement_MonJump + waitmovement 0 + delay 60 LilycoveCity_PokemonCenter_1F_EventScript_FinishFeedPokeblock:: - applymovement LOCALID_LILYCOVE_LADY, LilycoveCity_PokemonCenter_1F_Movement_LadyFacePlayer - waitmovement 0 - delay 60 - compare VAR_0x8004, 0 - goto_if_eq LilycoveCity_PokemonCenter_1F_EventScript_MonDislikedPokeblock - compare VAR_0x8004, 1 - goto_if_eq LilycoveCity_PokemonCenter_1F_EventScript_MonLikedPokeblock - end + applymovement LOCALID_LILYCOVE_LADY, LilycoveCity_PokemonCenter_1F_Movement_LadyFacePlayer + waitmovement 0 + delay 60 + goto_if_eq VAR_0x8004, 0, LilycoveCity_PokemonCenter_1F_EventScript_MonDislikedPokeblock + goto_if_eq VAR_0x8004, 1, LilycoveCity_PokemonCenter_1F_EventScript_MonLikedPokeblock + end LilycoveCity_PokemonCenter_1F_EventScript_MonDislikedPokeblock:: - msgbox LilycoveCity_PokemonCenter_1F_Text_NoChangeThanks, MSGBOX_DEFAULT - goto LilycoveCity_PokemonCenter_1F_EventScript_CheckAirContestLadyShow - end + msgbox LilycoveCity_PokemonCenter_1F_Text_NoChangeThanks, MSGBOX_DEFAULT + goto LilycoveCity_PokemonCenter_1F_EventScript_CheckAirContestLadyShow + end LilycoveCity_PokemonCenter_1F_EventScript_MonLikedPokeblock:: - special Script_BufferContestLadyCategoryAndMonName - msgbox LilycoveCity_PokemonCenter_1F_Text_ReallyImprovedThanks, MSGBOX_DEFAULT - goto LilycoveCity_PokemonCenter_1F_EventScript_CheckAirContestLadyShow - end + special Script_BufferContestLadyCategoryAndMonName + msgbox LilycoveCity_PokemonCenter_1F_Text_ReallyImprovedThanks, MSGBOX_DEFAULT + goto LilycoveCity_PokemonCenter_1F_EventScript_CheckAirContestLadyShow + end LilycoveCity_PokemonCenter_1F_EventScript_CheckAirContestLadyShow:: - specialvar VAR_RESULT, ShouldContestLadyShowGoOnAir - compare VAR_RESULT, 1 - goto_if_eq LilycoveCity_PokemonCenter_1F_EventScript_AirContestLadyShow - release - end + specialvar VAR_RESULT, ShouldContestLadyShowGoOnAir + goto_if_eq VAR_RESULT, 1, LilycoveCity_PokemonCenter_1F_EventScript_AirContestLadyShow + release + end LilycoveCity_PokemonCenter_1F_EventScript_AirContestLadyShow:: - msgbox LilycoveCity_PokemonCenter_1F_Text_ReadyToEnterContests, MSGBOX_DEFAULT - special PutLilycoveContestLadyShowOnTheAir - release - end + msgbox LilycoveCity_PokemonCenter_1F_Text_ReadyToEnterContests, MSGBOX_DEFAULT + special PutLilycoveContestLadyShowOnTheAir + release + end LilycoveCity_PokemonCenter_1F_EventScript_NoPokeblockCase:: - msgbox LilycoveCity_PokemonCenter_1F_Text_DontHaveAPokeblockCase, MSGBOX_DEFAULT - release - end + msgbox LilycoveCity_PokemonCenter_1F_Text_DontHaveAPokeblockCase, MSGBOX_DEFAULT + release + end LilycoveCity_PokemonCenter_1F_Movement_LadyFaceMon: - face_right - delay_8 - step_end + face_right + delay_8 + step_end LilycoveCity_PokemonCenter_1F_Movement_MonFaceLady: - face_left - delay_8 - step_end + face_left + delay_8 + step_end @ Unused LilycoveCity_PokemonCenter_1F_Movement_MonFaceDown: - face_down - step_end + face_down + step_end LilycoveCity_PokemonCenter_1F_Movement_LadyFacePlayer: - face_player - step_end + face_player + step_end LilycoveCity_PokemonCenter_1F_Movement_MonJump: - disable_jump_landing_ground_effect - jump_in_place_left - disable_jump_landing_ground_effect - jump_in_place_left - step_end + disable_jump_landing_ground_effect + jump_in_place_left + disable_jump_landing_ground_effect + jump_in_place_left + step_end LilycoveCity_PokemonCenter_1F_EventScript_ContestLadyMon:: - specialvar VAR_RESULT, GetContestLadyCategory - special Script_BufferContestLadyCategoryAndMonName - special GetContestLadyMonSpecies - compare VAR_RESULT, CONTEST_CATEGORY_COOL - goto_if_eq LilycoveCity_PokemonCenter_1F_EventScript_Zigzagoon - compare VAR_RESULT, CONTEST_CATEGORY_BEAUTY - goto_if_eq LilycoveCity_PokemonCenter_1F_EventScript_Skitty - compare VAR_RESULT, CONTEST_CATEGORY_CUTE - goto_if_eq LilycoveCity_PokemonCenter_1F_EventScript_Poochyena - compare VAR_RESULT, CONTEST_CATEGORY_SMART - goto_if_eq LilycoveCity_PokemonCenter_1F_EventScript_Kecleon - compare VAR_RESULT, CONTEST_CATEGORY_TOUGH - goto_if_eq LilycoveCity_PokemonCenter_1F_EventScript_Pikachu - end + specialvar VAR_RESULT, GetContestLadyCategory + special Script_BufferContestLadyCategoryAndMonName + special GetContestLadyMonSpecies + goto_if_eq VAR_RESULT, CONTEST_CATEGORY_COOL, LilycoveCity_PokemonCenter_1F_EventScript_Zigzagoon + goto_if_eq VAR_RESULT, CONTEST_CATEGORY_BEAUTY, LilycoveCity_PokemonCenter_1F_EventScript_Skitty + goto_if_eq VAR_RESULT, CONTEST_CATEGORY_CUTE, LilycoveCity_PokemonCenter_1F_EventScript_Poochyena + goto_if_eq VAR_RESULT, CONTEST_CATEGORY_SMART, LilycoveCity_PokemonCenter_1F_EventScript_Kecleon + goto_if_eq VAR_RESULT, CONTEST_CATEGORY_TOUGH, LilycoveCity_PokemonCenter_1F_EventScript_Pikachu + end LilycoveCity_PokemonCenter_1F_EventScript_Zigzagoon:: - lock - faceplayer - waitse - playmoncry VAR_0x8005, CRY_MODE_NORMAL - msgbox LilycoveCity_PokemonCenter_1F_Text_Zigzagoon, MSGBOX_DEFAULT - waitmoncry - release - end + lock + faceplayer + waitse + playmoncry VAR_0x8005, CRY_MODE_NORMAL + msgbox LilycoveCity_PokemonCenter_1F_Text_Zigzagoon, MSGBOX_DEFAULT + waitmoncry + release + end LilycoveCity_PokemonCenter_1F_EventScript_Skitty:: - lock - faceplayer - waitse - playmoncry VAR_0x8005, CRY_MODE_NORMAL - msgbox LilycoveCity_PokemonCenter_1F_Text_Skitty, MSGBOX_DEFAULT - waitmoncry - release - end + lock + faceplayer + waitse + playmoncry VAR_0x8005, CRY_MODE_NORMAL + msgbox LilycoveCity_PokemonCenter_1F_Text_Skitty, MSGBOX_DEFAULT + waitmoncry + release + end LilycoveCity_PokemonCenter_1F_EventScript_Poochyena:: - lock - faceplayer - waitse - playmoncry VAR_0x8005, CRY_MODE_NORMAL - msgbox LilycoveCity_PokemonCenter_1F_Text_Poochyena, MSGBOX_DEFAULT - waitmoncry - release - end + lock + faceplayer + waitse + playmoncry VAR_0x8005, CRY_MODE_NORMAL + msgbox LilycoveCity_PokemonCenter_1F_Text_Poochyena, MSGBOX_DEFAULT + waitmoncry + release + end LilycoveCity_PokemonCenter_1F_EventScript_Kecleon:: - lock - faceplayer - waitse - playmoncry VAR_0x8005, CRY_MODE_NORMAL - msgbox LilycoveCity_PokemonCenter_1F_Text_Kecleon, MSGBOX_DEFAULT - waitmoncry - release - end + lock + faceplayer + waitse + playmoncry VAR_0x8005, CRY_MODE_NORMAL + msgbox LilycoveCity_PokemonCenter_1F_Text_Kecleon, MSGBOX_DEFAULT + waitmoncry + release + end LilycoveCity_PokemonCenter_1F_EventScript_Pikachu:: - lock - faceplayer - waitse - playmoncry VAR_0x8005, CRY_MODE_NORMAL - msgbox LilycoveCity_PokemonCenter_1F_Text_Pikachu, MSGBOX_DEFAULT - waitmoncry - release - end + lock + faceplayer + waitse + playmoncry VAR_0x8005, CRY_MODE_NORMAL + msgbox LilycoveCity_PokemonCenter_1F_Text_Pikachu, MSGBOX_DEFAULT + waitmoncry + release + end LilycoveCity_PokemonCenter_1F_Text_ImTheFavorLady: - .string "I'm the FAVOR LADY…$" + .string "I'm the FAVOR LADY…$" LilycoveCity_PokemonCenter_1F_Text_ObsessedWithThing: - .string "I've recently developed an obsession\n" - .string "for {STR_VAR_1} things…$" + .string "I've recently developed an obsession\n" + .string "for {STR_VAR_1} things…$" LilycoveCity_PokemonCenter_1F_Text_ThankYouForLastTime: - .string "Oh…\n" - .string "Thank you for last time…$" + .string "Oh…\n" + .string "Thank you for last time…$" LilycoveCity_PokemonCenter_1F_Text_PlayerGaveMeBadThing: - .string "Before, I think it was {STR_VAR_3}…\p" - .string "{STR_VAR_3} gave me one {STR_VAR_2},\n" - .string "saying it was {STR_VAR_1}.\p" - .string "But it wasn't {STR_VAR_1}.\n" - .string "Not in the least bit.$" + .string "Before, I think it was {STR_VAR_3}…\p" + .string "{STR_VAR_3} gave me one {STR_VAR_2},\n" + .string "saying it was {STR_VAR_1}.\p" + .string "But it wasn't {STR_VAR_1}.\n" + .string "Not in the least bit.$" LilycoveCity_PokemonCenter_1F_Text_PlayerGaveMeGreatThing: - .string "Before, {STR_VAR_3} gave me a very\n" - .string "{STR_VAR_1} {STR_VAR_2}.\p" - .string "I cherish it now.$" + .string "Before, {STR_VAR_3} gave me a very\n" + .string "{STR_VAR_1} {STR_VAR_2}.\p" + .string "I cherish it now.$" LilycoveCity_PokemonCenter_1F_Text_WillYouShareThing: - .string "Listen, if you have anything that\n" - .string "is {STR_VAR_1}, will you share it\l" - .string "with me?$" + .string "Listen, if you have anything that\n" + .string "is {STR_VAR_1}, will you share it\l" + .string "with me?$" LilycoveCity_PokemonCenter_1F_Text_WhatWillYouGiveMe: - .string "…Really?\n" - .string "What will you give me?$" + .string "…Really?\n" + .string "What will you give me?$" LilycoveCity_PokemonCenter_1F_Text_IsThatSoGoodbye: - .string "Is that so?\n" - .string "Then, it's good-bye…$" + .string "Is that so?\n" + .string "Then, it's good-bye…$" LilycoveCity_PokemonCenter_1F_Text_NotWillingToShare: - .string "Oh…\n" - .string "You're not willing to share?$" + .string "Oh…\n" + .string "You're not willing to share?$" LilycoveCity_PokemonCenter_1F_Text_IllTryToCherishIt: - .string "Oh?\n" - .string "That {STR_VAR_2} is {STR_VAR_1}?\p" - .string "…Oh, is that right?\p" - .string "Well, I owe you a thanks anyway.\n" - .string "I'll try to cherish it…$" + .string "Oh?\n" + .string "That {STR_VAR_2} is {STR_VAR_1}?\p" + .string "…Oh, is that right?\p" + .string "Well, I owe you a thanks anyway.\n" + .string "I'll try to cherish it…$" LilycoveCity_PokemonCenter_1F_Text_IWillCherishThis: - .string "Oh…\p" - .string "That's a quite {STR_VAR_1}\n" - .string "{STR_VAR_2}…\p" - .string "Isn't it nice?\n" - .string "It's so dreamy…\p" - .string "Thank you…\n" - .string "I will cherish this…$" + .string "Oh…\p" + .string "That's a quite {STR_VAR_1}\n" + .string "{STR_VAR_2}…\p" + .string "Isn't it nice?\n" + .string "It's so dreamy…\p" + .string "Thank you…\n" + .string "I will cherish this…$" LilycoveCity_PokemonCenter_1F_Text_IWillTreasureThis: - .string "…Oh, oh, oh…\p" - .string "This is amazing!\n" - .string "This really is {STR_VAR_1}!\p" - .string "I never knew that one {STR_VAR_2}\n" - .string "could be this {STR_VAR_1}!\p" - .string "Thank you!\p" - .string "I will treasure this for the rest\n" - .string "of my life!$" + .string "…Oh, oh, oh…\p" + .string "This is amazing!\n" + .string "This really is {STR_VAR_1}!\p" + .string "I never knew that one {STR_VAR_2}\n" + .string "could be this {STR_VAR_1}!\p" + .string "Thank you!\p" + .string "I will treasure this for the rest\n" + .string "of my life!$" LilycoveCity_PokemonCenter_1F_Text_IllGiveYouThisInReturn: - .string "I'll give you this wonderful item in\n" - .string "return for your fabulous gift.\p" - .string "I hope you will cherish it…$" + .string "I'll give you this wonderful item in\n" + .string "return for your fabulous gift.\p" + .string "I hope you will cherish it…$" LilycoveCity_PokemonCenter_1F_Text_YouDontHaveSpaceForIt: - .string "Oh, you can't have it if you don't have\n" - .string "the space for it.\p" - .string "Please come see me when you get\n" - .string "your BAG organized…$" + .string "Oh, you can't have it if you don't have\n" + .string "the space for it.\p" + .string "Please come see me when you get\n" + .string "your BAG organized…$" LilycoveCity_PokemonCenter_1F_Text_ImTheQuizLady: - .string "I'm the QUIZ LADY!\n" - .string "I love quizzes!$" + .string "I'm the QUIZ LADY!\n" + .string "I love quizzes!$" LilycoveCity_PokemonCenter_1F_Text_WaitingToTakeYourQuiz: - .string "Oh?\p" - .string "I'm waiting for a challenger to answer\n" - .string "the quiz you made.\p" - .string "We can chat another time, okay?$" + .string "Oh?\p" + .string "I'm waiting for a challenger to answer\n" + .string "the quiz you made.\p" + .string "We can chat another time, okay?$" LilycoveCity_PokemonCenter_1F_Text_WaitingForChallenger: - .string "I'm waiting for someone to challenge\n" - .string "a quiz this {STR_VAR_1} thought up!$" + .string "I'm waiting for someone to challenge\n" + .string "a quiz this {STR_VAR_1} thought up!$" LilycoveCity_PokemonCenter_1F_Text_TakeQuizChallenge: - .string "If you answer correctly, you can win\n" - .string "fabulous prizes!\p" - .string "Would you like to take the quiz\n" - .string "challenge?$" + .string "If you answer correctly, you can win\n" + .string "fabulous prizes!\p" + .string "Would you like to take the quiz\n" + .string "challenge?$" LilycoveCity_PokemonCenter_1F_Text_WaitForAnswer: - .string "… … … … … …\n" - .string "… … … … … …$" + .string "… … … … … …\n" + .string "… … … … … …$" LilycoveCity_PokemonCenter_1F_Text_HowBoringBye: - .string "Oh, how boring!\n" - .string "Bye-bye!$" + .string "Oh, how boring!\n" + .string "Bye-bye!$" LilycoveCity_PokemonCenter_1F_Text_YoureGoingToQuit: - .string "Awww!\n" - .string "You're going to quit?$" + .string "Awww!\n" + .string "You're going to quit?$" LilycoveCity_PokemonCenter_1F_Text_TakeTheQuizAnotherTime: - .string "Please take the quiz challenge\n" - .string "another time!$" + .string "Please take the quiz challenge\n" + .string "another time!$" LilycoveCity_PokemonCenter_1F_Text_YouGotItRight: - .string "You're amazing! You've got it right!\n" - .string "You're one sharp customer!$" + .string "You're amazing! You've got it right!\n" + .string "You're one sharp customer!$" LilycoveCity_PokemonCenter_1F_Text_YouGotItRightYouveWonPersonsPrize: - .string "Congratulations!\n" - .string "You've got the quiz right!\p" - .string "You've won a prize provided by\n" - .string "{STR_VAR_1}!$" + .string "Congratulations!\n" + .string "You've got the quiz right!\p" + .string "You've won a prize provided by\n" + .string "{STR_VAR_1}!$" @ Unused LilycoveCity_PokemonCenter_1F_Text_XReceivedOneY: - .string "{STR_VAR_1} received\n" - .string "one {STR_VAR_2}!$" + .string "{STR_VAR_1} received\n" + .string "one {STR_VAR_2}!$" LilycoveCity_PokemonCenter_1F_Text_YourBagIsFilledUp: - .string "Oh? Your BAG is filled up!\n" - .string "Come see me when you have room.$" + .string "Oh? Your BAG is filled up!\n" + .string "Come see me when you have room.$" LilycoveCity_PokemonCenter_1F_Text_WrongTheCorrectAnswerIs: - .string "Hmm… Wrong!\n" - .string "The correct answer is “{STR_VAR_3}”!$" + .string "Hmm… Wrong!\n" + .string "The correct answer is “{STR_VAR_3}”!$" LilycoveCity_PokemonCenter_1F_Text_IGetToKeepPrize: - .string "Too bad!\p" - .string "I get to keep the quiz prize\n" - .string "{STR_VAR_1} now!$" + .string "Too bad!\p" + .string "I get to keep the quiz prize\n" + .string "{STR_VAR_1} now!$" LilycoveCity_PokemonCenter_1F_Text_MakeYourOwnQuiz: - .string "Listen, listen!\n" - .string "Would you like to make your own quiz?$" + .string "Listen, listen!\n" + .string "Would you like to make your own quiz?$" LilycoveCity_PokemonCenter_1F_Text_MaybeNextTime: - .string "Oh, I see…\n" - .string "Well, maybe next time!$" + .string "Oh, I see…\n" + .string "Well, maybe next time!$" LilycoveCity_PokemonCenter_1F_Text_PickYourPrize: - .string "Okay, the first thing you have to do\n" - .string "is pick the prize for the person that\l" - .string "answers your quiz correctly.\p" - .string "But beware, if the person taking\n" - .string "the quiz can't get it right, I get to\l" - .string "keep the prize!$" + .string "Okay, the first thing you have to do\n" + .string "is pick the prize for the person that\l" + .string "answers your quiz correctly.\p" + .string "But beware, if the person taking\n" + .string "the quiz can't get it right, I get to\l" + .string "keep the prize!$" LilycoveCity_PokemonCenter_1F_Text_QuitChoosingPrize: - .string "If you don't choose a prize,\n" - .string "your quiz can't be made.\p" - .string "Are you going to quit making\n" - .string "your quiz?$" + .string "If you don't choose a prize,\n" + .string "your quiz can't be made.\p" + .string "Are you going to quit making\n" + .string "your quiz?$" LilycoveCity_PokemonCenter_1F_Text_WriteYourQuiz: - .string "Oh, how nice!\n" - .string "That's a wonderful prize!\p" - .string "Next, you need to write your quiz\n" - .string "question and its answer.$" + .string "Oh, how nice!\n" + .string "That's a wonderful prize!\p" + .string "Next, you need to write your quiz\n" + .string "question and its answer.$" LilycoveCity_PokemonCenter_1F_Text_QuitWritingQuizQuestion: - .string "Are you going to quit writing\n" - .string "your quiz question?$" + .string "Are you going to quit writing\n" + .string "your quiz question?$" @ Unused LilycoveCity_PokemonCenter_1F_Text_QuitWritingQuizAnswer: - .string "Are you going to quit choosing\n" - .string "your quiz answer?$" + .string "Are you going to quit choosing\n" + .string "your quiz answer?$" LilycoveCity_PokemonCenter_1F_Text_IllLookForAChallenger: - .string "Thank you!\n" - .string "You've put together a nice quiz.\p" - .string "I'll go look for someone who'll take\n" - .string "your quiz challenge right away.$" + .string "Thank you!\n" + .string "You've put together a nice quiz.\p" + .string "I'll go look for someone who'll take\n" + .string "your quiz challenge right away.$" LilycoveCity_PokemonCenter_1F_Text_ImTheContestLady: - .string "I'm the CONTEST LADY!\n" - .string "I sure do love CONTESTS!$" + .string "I'm the CONTEST LADY!\n" + .string "I sure do love CONTESTS!$" LilycoveCity_PokemonCenter_1F_Text_ThankForPokeblock: - .string "Thanks for your {POKEBLOCK} before!$" + .string "Thanks for your {POKEBLOCK} before!$" LilycoveCity_PokemonCenter_1F_Text_MyFriendDisplaysQuality: - .string "This is my friend {STR_VAR_1}!\n" - .string "It's the epitome of {STR_VAR_2}!\p" - .string "But I think that it will display\n" - .string "even more {STR_VAR_2}!$" + .string "This is my friend {STR_VAR_1}!\n" + .string "It's the epitome of {STR_VAR_2}!\p" + .string "But I think that it will display\n" + .string "even more {STR_VAR_2}!$" LilycoveCity_PokemonCenter_1F_Text_DontHaveAPokeblockCase: - .string "So, I need your help!\p" - .string "Please, may I have one {POKEBLOCK}?\n" - .string "All I'm asking for is one!\p" - .string "…Oh, but…\n" - .string "Don't you have a {POKEBLOCK} CASE?\l" - .string "That's no good. Next time, then!$" + .string "So, I need your help!\p" + .string "Please, may I have one {POKEBLOCK}?\n" + .string "All I'm asking for is one!\p" + .string "…Oh, but…\n" + .string "Don't you have a {POKEBLOCK} CASE?\l" + .string "That's no good. Next time, then!$" LilycoveCity_PokemonCenter_1F_Text_AskingForOnePokeblock: - .string "So, I need your help!\p" - .string "Please, may I have one {POKEBLOCK}?\n" - .string "All I'm asking for is one!$" + .string "So, I need your help!\p" + .string "Please, may I have one {POKEBLOCK}?\n" + .string "All I'm asking for is one!$" LilycoveCity_PokemonCenter_1F_Text_ICantHaveOnePokeblock: - .string "Awww!\n" - .string "I can't have one {POKEBLOCK}?!$" + .string "Awww!\n" + .string "I can't have one {POKEBLOCK}?!$" LilycoveCity_PokemonCenter_1F_Text_WhatACheapskate: - .string "Sheesh!\n" - .string "What a cheapskate!$" + .string "Sheesh!\n" + .string "What a cheapskate!$" LilycoveCity_PokemonCenter_1F_Text_IllUseYourPokeblock: - .string "Yay!\n" - .string "Thank you!\p" - .string "I'll feed my POKéMON your {POKEBLOCK}\n" - .string "right away.$" + .string "Yay!\n" + .string "Thank you!\p" + .string "I'll feed my POKéMON your {POKEBLOCK}\n" + .string "right away.$" LilycoveCity_PokemonCenter_1F_Text_NoChangeThanks: - .string "…It doesn't seem to have changed\n" - .string "in any way at all…\p" - .string "Hmm…\p" - .string "Oh, well!\n" - .string "Thank you very much!$" + .string "…It doesn't seem to have changed\n" + .string "in any way at all…\p" + .string "Hmm…\p" + .string "Oh, well!\n" + .string "Thank you very much!$" LilycoveCity_PokemonCenter_1F_Text_ReallyImprovedThanks: - .string "Oh, yay!\n" - .string "It's really delighted!\p" - .string "I think it really improved {STR_VAR_1}'s\n" - .string "{STR_VAR_2} quality, too.\p" - .string "Thank you so much!$" + .string "Oh, yay!\n" + .string "It's really delighted!\p" + .string "I think it really improved {STR_VAR_1}'s\n" + .string "{STR_VAR_2} quality, too.\p" + .string "Thank you so much!$" LilycoveCity_PokemonCenter_1F_Text_ReadyToEnterContests: - .string "Hmm…\p" - .string "I think we may be ready to enter\n" - .string "some CONTESTS.\p" - .string "If you see us in one somewhere,\n" - .string "I hope you'll cheer for us.$" + .string "Hmm…\p" + .string "I think we may be ready to enter\n" + .string "some CONTESTS.\p" + .string "If you see us in one somewhere,\n" + .string "I hope you'll cheer for us.$" LilycoveCity_PokemonCenter_1F_Text_Zigzagoon: - .string "{STR_VAR_1}: Guguuh!$" + .string "{STR_VAR_1}: Guguuh!$" LilycoveCity_PokemonCenter_1F_Text_Kecleon: - .string "{STR_VAR_1}: Igigigiiih!$" + .string "{STR_VAR_1}: Igigigiiih!$" LilycoveCity_PokemonCenter_1F_Text_Poochyena: - .string "{STR_VAR_1}: Baaarun…$" + .string "{STR_VAR_1}: Baaarun…$" LilycoveCity_PokemonCenter_1F_Text_Pikachu: - .string "{STR_VAR_1}: Pikka!$" + .string "{STR_VAR_1}: Pikka!$" LilycoveCity_PokemonCenter_1F_Text_Skitty: - .string "{STR_VAR_1}: Umyaaaan!$" + .string "{STR_VAR_1}: Umyaaaan!$" diff --git a/data/scripts/mauville_man.inc b/data/scripts/mauville_man.inc index b34f84e8e258..e1fa3d1799fb 100644 --- a/data/scripts/mauville_man.inc +++ b/data/scripts/mauville_man.inc @@ -13,10 +13,8 @@ MauvilleCity_PokemonCenter_1F_EventScript_Bard:: lock faceplayer msgbox MauvilleCity_PokemonCenter_1F_Text_WouldYouLikeToHearMySong, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_PlaySong - compare VAR_RESULT, NO - goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_DeclineSong + goto_if_eq VAR_RESULT, YES, MauvilleCity_PokemonCenter_1F_EventScript_PlaySong + goto_if_eq VAR_RESULT, NO, MauvilleCity_PokemonCenter_1F_EventScript_DeclineSong end MauvilleCity_PokemonCenter_1F_EventScript_PlaySong:: @@ -24,8 +22,7 @@ MauvilleCity_PokemonCenter_1F_EventScript_PlaySong:: special PlayBardSong delay 60 special HasBardSongBeenChanged - compare VAR_RESULT, FALSE - goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_AskToWriteLyrics + goto_if_eq VAR_RESULT, FALSE, MauvilleCity_PokemonCenter_1F_EventScript_AskToWriteLyrics msgbox MauvilleCity_PokemonCenter_1F_Text_WishICouldPlaySongForOthers, MSGBOX_DEFAULT release end @@ -37,10 +34,8 @@ MauvilleCity_PokemonCenter_1F_EventScript_DeclineSong:: MauvilleCity_PokemonCenter_1F_EventScript_AskToWriteLyrics:: msgbox MauvilleCity_PokemonCenter_1F_Text_WouldYouLikeToWriteSomeLyrics, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_WriteLyrics - compare VAR_RESULT, NO - goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_DeclineWritingLyrics + goto_if_eq VAR_RESULT, YES, MauvilleCity_PokemonCenter_1F_EventScript_WriteLyrics + goto_if_eq VAR_RESULT, NO, MauvilleCity_PokemonCenter_1F_EventScript_DeclineWritingLyrics end MauvilleCity_PokemonCenter_1F_EventScript_WriteLyrics:: @@ -48,15 +43,13 @@ MauvilleCity_PokemonCenter_1F_EventScript_WriteLyrics:: call Common_ShowEasyChatScreen lock faceplayer - compare VAR_RESULT, 0 - goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_DeclineWritingLyrics + goto_if_eq VAR_RESULT, 0, MauvilleCity_PokemonCenter_1F_EventScript_DeclineWritingLyrics msgbox MauvilleCity_PokemonCenter_1F_Text_LetMeSingItForYou, MSGBOX_DEFAULT setvar VAR_0x8004, 1 special PlayBardSong delay 60 msgbox MauvilleCity_PokemonCenter_1F_Text_ThatHowYouWantedSongToGo, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_WriteLyrics + goto_if_eq VAR_RESULT, NO, MauvilleCity_PokemonCenter_1F_EventScript_WriteLyrics special SaveBardSongLyrics msgbox MauvilleCity_PokemonCenter_1F_Text_IllSingThisSongForAWhile, MSGBOX_DEFAULT release @@ -74,16 +67,14 @@ MauvilleCity_PokemonCenter_1F_EventScript_Hipster:: setflag FLAG_SYS_HIPSTER_MEET msgbox MauvilleCity_PokemonCenter_1F_Text_TeachWhatsHipAndHappening, MSGBOX_DEFAULT special GetHipsterSpokenFlag - compare VAR_RESULT, FALSE - goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_TryTeachWord + goto_if_eq VAR_RESULT, FALSE, MauvilleCity_PokemonCenter_1F_EventScript_TryTeachWord msgbox MauvilleCity_PokemonCenter_1F_Text_IAlreadyTaughtYou, MSGBOX_DEFAULT release end MauvilleCity_PokemonCenter_1F_EventScript_TryTeachWord:: special HipsterTryTeachWord - compare VAR_RESULT, TRUE - goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_TeachWord + goto_if_eq VAR_RESULT, TRUE, MauvilleCity_PokemonCenter_1F_EventScript_TeachWord msgbox MauvilleCity_PokemonCenter_1F_Text_IveGotNothingNewToTeach, MSGBOX_DEFAULT release end @@ -158,11 +149,9 @@ MauvilleCity_PokemonCenter_1F_EventScript_Trader:: lock faceplayer msgbox MauvilleCity_PokemonCenter_1F_Text_WantToTradeDecor, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_DeclineTrade + goto_if_eq VAR_RESULT, NO, MauvilleCity_PokemonCenter_1F_EventScript_DeclineTrade special GetTraderTradedFlag - compare VAR_RESULT, TRUE - goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_AlreadyTraded + goto_if_eq VAR_RESULT, TRUE, MauvilleCity_PokemonCenter_1F_EventScript_AlreadyTraded message MauvilleCity_PokemonCenter_1F_Text_PickADecorItem waitmessage goto MauvilleCity_PokemonCenter_1F_EventScript_PickDecorToReceive @@ -181,16 +170,12 @@ MauvilleCity_PokemonCenter_1F_EventScript_AlreadyTraded:: MauvilleCity_PokemonCenter_1F_EventScript_PickDecorToReceive:: special TraderMenuGetDecoration waitstate - compare VAR_0x8004, 0 - goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_CancelPickDecor - compare VAR_0x8004, 0xFFFF - goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_InvalidDecor + goto_if_eq VAR_0x8004, 0, MauvilleCity_PokemonCenter_1F_EventScript_CancelPickDecor + goto_if_eq VAR_0x8004, 0xFFFF, MauvilleCity_PokemonCenter_1F_EventScript_InvalidDecor msgbox MauvilleCity_PokemonCenter_1F_Text_OnceBelongedToPlayerDoYouWantIt, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_PickDifferentDecor + goto_if_eq VAR_RESULT, NO, MauvilleCity_PokemonCenter_1F_EventScript_PickDifferentDecor special DoesPlayerHaveNoDecorations - compare VAR_RESULT, TRUE - goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_DontHaveAnyDecor + goto_if_eq VAR_RESULT, TRUE, MauvilleCity_PokemonCenter_1F_EventScript_DontHaveAnyDecor goto MauvilleCity_PokemonCenter_1F_EventScript_PickDecorToGive end @@ -220,16 +205,12 @@ MauvilleCity_PokemonCenter_1F_EventScript_PickDecorToGive:: msgbox MauvilleCity_PokemonCenter_1F_Text_PickTheDecorToTrade, MSGBOX_DEFAULT special TraderShowDecorationMenu waitstate - compare VAR_0x8006, 0 - goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_CancelGiveDecor - compare VAR_0x8006, 0xFFFF - goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_DecorInUse + goto_if_eq VAR_0x8006, 0, MauvilleCity_PokemonCenter_1F_EventScript_CancelGiveDecor + goto_if_eq VAR_0x8006, 0xFFFF, MauvilleCity_PokemonCenter_1F_EventScript_DecorInUse special IsDecorationCategoryFull - compare VAR_RESULT, TRUE - goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_NoRoomForDecor + goto_if_eq VAR_RESULT, TRUE, MauvilleCity_PokemonCenter_1F_EventScript_NoRoomForDecor msgbox MauvilleCity_PokemonCenter_1F_Text_SoWellTradeTheseDecor, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_PickDecorToGive + goto_if_eq VAR_RESULT, NO, MauvilleCity_PokemonCenter_1F_EventScript_PickDecorToGive special TraderDoDecorationTrade msgbox MauvilleCity_PokemonCenter_1F_Text_SendDecorToYourPC, MSGBOX_DEFAULT release @@ -816,24 +797,20 @@ MauvilleCity_PokemonCenter_1F_EventScript_Storyteller:: setvar VAR_0x800A, 0 setvar VAR_0x800B, 0 msgbox MauvilleCity_PokemonCenter_1F_Text_WillYouHearMyTale, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_DeclineStoryteller + goto_if_eq VAR_RESULT, NO, MauvilleCity_PokemonCenter_1F_EventScript_DeclineStoryteller specialvar VAR_RESULT, StorytellerGetFreeStorySlot - compare VAR_RESULT, 0 - goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_KnowNoTales + goto_if_eq VAR_RESULT, 0, MauvilleCity_PokemonCenter_1F_EventScript_KnowNoTales message MauvilleCity_PokemonCenter_1F_Text_WhichTaleToTell waitmessage special StorytellerStoryListMenu waitstate - compare VAR_RESULT, 0 - goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_CancelStorySelection + goto_if_eq VAR_RESULT, 0, MauvilleCity_PokemonCenter_1F_EventScript_CancelStorySelection setvar VAR_0x8008, 1 special Script_StorytellerDisplayStory waitmessage waitbuttonpress specialvar VAR_RESULT, StorytellerUpdateStat - compare VAR_RESULT, 0 - goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_AreThereOtherTales + goto_if_eq VAR_RESULT, 0, MauvilleCity_PokemonCenter_1F_EventScript_AreThereOtherTales goto MauvilleCity_PokemonCenter_1F_EventScript_TellPlayersTale MauvilleCity_PokemonCenter_1F_EventScript_CancelStorySelection:: @@ -843,19 +820,16 @@ MauvilleCity_PokemonCenter_1F_EventScript_CancelStorySelection:: MauvilleCity_PokemonCenter_1F_EventScript_AreThereOtherTales:: msgbox MauvilleCity_PokemonCenter_1F_Text_CouldThereBeOtherLegends, MSGBOX_DEFAULT specialvar VAR_RESULT, HasStorytellerAlreadyRecorded - compare VAR_RESULT, TRUE - goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_StorytellerEnd + goto_if_eq VAR_RESULT, TRUE, MauvilleCity_PokemonCenter_1F_EventScript_StorytellerEnd goto MauvilleCity_PokemonCenter_1F_EventScript_DoYouHaveAnyTales MauvilleCity_PokemonCenter_1F_EventScript_KnowNoTales:: msgbox MauvilleCity_PokemonCenter_1F_Text_IKnowNoTales, MSGBOX_DEFAULT MauvilleCity_PokemonCenter_1F_EventScript_DoYouHaveAnyTales:: msgbox MauvilleCity_PokemonCenter_1F_Text_HaveYouAnyLegendaryTales, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_DeclineStoryteller + goto_if_eq VAR_RESULT, NO, MauvilleCity_PokemonCenter_1F_EventScript_DeclineStoryteller specialvar VAR_RESULT, Script_StorytellerInitializeRandomStat - compare VAR_RESULT, 1 - goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_TellPlayersTale + goto_if_eq VAR_RESULT, 1, MauvilleCity_PokemonCenter_1F_EventScript_TellPlayersTale msgbox MauvilleCity_PokemonCenter_1F_Text_NotWorthyOfLegend, MSGBOX_DEFAULT release end @@ -902,26 +876,20 @@ MauvilleCity_PokemonCenter_1F_EventScript_Giddy:: lock faceplayer msgbox MauvilleCity_PokemonCenter_1F_Text_HearMyStory, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_TryTellTale - compare VAR_RESULT, NO - goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_DeclineGiddy + goto_if_eq VAR_RESULT, YES, MauvilleCity_PokemonCenter_1F_EventScript_TryTellTale + goto_if_eq VAR_RESULT, NO, MauvilleCity_PokemonCenter_1F_EventScript_DeclineGiddy end MauvilleCity_PokemonCenter_1F_EventScript_TryTellTale:: special GiddyShouldTellAnotherTale - compare VAR_RESULT, TRUE - goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_GiddyTellTale - compare VAR_RESULT, FALSE - goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_ToldEnoughTales + goto_if_eq VAR_RESULT, TRUE, MauvilleCity_PokemonCenter_1F_EventScript_GiddyTellTale + goto_if_eq VAR_RESULT, FALSE, MauvilleCity_PokemonCenter_1F_EventScript_ToldEnoughTales end MauvilleCity_PokemonCenter_1F_EventScript_TryTellNewTale:: special GiddyShouldTellAnotherTale - compare VAR_RESULT, TRUE - goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_GiddyStartNewTale - compare VAR_RESULT, FALSE - goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_ToldEnoughTales + goto_if_eq VAR_RESULT, TRUE, MauvilleCity_PokemonCenter_1F_EventScript_GiddyStartNewTale + goto_if_eq VAR_RESULT, FALSE, MauvilleCity_PokemonCenter_1F_EventScript_ToldEnoughTales end MauvilleCity_PokemonCenter_1F_EventScript_GiddyStartNewTale:: @@ -936,10 +904,8 @@ MauvilleCity_PokemonCenter_1F_EventScript_GiddyTellTale:: special ShowFieldMessageStringVar4 waitmessage yesnobox 20, 8 - compare VAR_RESULT, YES - goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_TryTellNewTale - compare VAR_RESULT, NO - goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_TryTellNewTale + goto_if_eq VAR_RESULT, YES, MauvilleCity_PokemonCenter_1F_EventScript_TryTellNewTale + goto_if_eq VAR_RESULT, NO, MauvilleCity_PokemonCenter_1F_EventScript_TryTellNewTale end MauvilleCity_PokemonCenter_1F_EventScript_DeclineGiddy:: diff --git a/data/scripts/move_tutors.inc b/data/scripts/move_tutors.inc index cc952749d421..4155969a026f 100644 --- a/data/scripts/move_tutors.inc +++ b/data/scripts/move_tutors.inc @@ -3,16 +3,13 @@ SlateportCity_PokemonFanClub_EventScript_SwaggerTutor:: faceplayer goto_if_set FLAG_MOVE_TUTOR_TAUGHT_SWAGGER, MoveTutor_EventScript_SwaggerTaught msgbox MoveTutor_Text_SwaggerTeach, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq MoveTutor_EventScript_SwaggerDeclined + goto_if_eq VAR_RESULT, NO, MoveTutor_EventScript_SwaggerDeclined call MoveTutor_EventScript_CanOnlyBeLearnedOnce - compare VAR_RESULT, NO - goto_if_eq MoveTutor_EventScript_SwaggerDeclined + goto_if_eq VAR_RESULT, NO, MoveTutor_EventScript_SwaggerDeclined msgbox MoveTutor_Text_SwaggerWhichMon, MSGBOX_DEFAULT setvar VAR_0x8005, TUTOR_MOVE_SWAGGER call MoveTutor_EventScript_OpenPartyMenu - compare VAR_RESULT, 0 - goto_if_eq MoveTutor_EventScript_SwaggerDeclined + goto_if_eq VAR_RESULT, 0, MoveTutor_EventScript_SwaggerDeclined setflag FLAG_MOVE_TUTOR_TAUGHT_SWAGGER goto MoveTutor_EventScript_SwaggerTaught end @@ -32,16 +29,13 @@ MauvilleCity_EventScript_RolloutTutor:: faceplayer goto_if_set FLAG_MOVE_TUTOR_TAUGHT_ROLLOUT, MoveTutor_EventScript_RolloutTaught msgbox MoveTutor_Text_RolloutTeach, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq MoveTutor_EventScript_RolloutDeclined + goto_if_eq VAR_RESULT, NO, MoveTutor_EventScript_RolloutDeclined call MoveTutor_EventScript_CanOnlyBeLearnedOnce - compare VAR_RESULT, NO - goto_if_eq MoveTutor_EventScript_RolloutDeclined + goto_if_eq VAR_RESULT, NO, MoveTutor_EventScript_RolloutDeclined msgbox MoveTutor_Text_RolloutWhichMon, MSGBOX_DEFAULT setvar VAR_0x8005, TUTOR_MOVE_ROLLOUT call MoveTutor_EventScript_OpenPartyMenu - compare VAR_RESULT, 0 - goto_if_eq MoveTutor_EventScript_RolloutDeclined + goto_if_eq VAR_RESULT, 0, MoveTutor_EventScript_RolloutDeclined setflag FLAG_MOVE_TUTOR_TAUGHT_ROLLOUT goto MoveTutor_EventScript_RolloutTaught end @@ -61,16 +55,13 @@ VerdanturfTown_PokemonCenter_1F_EventScript_FuryCutterTutor:: faceplayer goto_if_set FLAG_MOVE_TUTOR_TAUGHT_FURY_CUTTER, MoveTutor_EventScript_FuryCutterTaught msgbox MoveTutor_Text_FuryCutterTeach, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq MoveTutor_EventScript_FuryCutterDeclined + goto_if_eq VAR_RESULT, NO, MoveTutor_EventScript_FuryCutterDeclined call MoveTutor_EventScript_CanOnlyBeLearnedOnce - compare VAR_RESULT, NO - goto_if_eq MoveTutor_EventScript_FuryCutterDeclined + goto_if_eq VAR_RESULT, NO, MoveTutor_EventScript_FuryCutterDeclined msgbox MoveTutor_Text_FuryCutterWhichMon, MSGBOX_DEFAULT setvar VAR_0x8005, TUTOR_MOVE_FURY_CUTTER call MoveTutor_EventScript_OpenPartyMenu - compare VAR_RESULT, 0 - goto_if_eq MoveTutor_EventScript_FuryCutterDeclined + goto_if_eq VAR_RESULT, 0, MoveTutor_EventScript_FuryCutterDeclined setflag FLAG_MOVE_TUTOR_TAUGHT_FURY_CUTTER goto MoveTutor_EventScript_FuryCutterTaught end @@ -90,16 +81,13 @@ LavaridgeTown_House_EventScript_MimicTutor:: faceplayer goto_if_set FLAG_MOVE_TUTOR_TAUGHT_MIMIC, MoveTutor_EventScript_MimicTaught msgbox MoveTutor_MimicTeach, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq MoveTutor_EventScript_MimicDeclined + goto_if_eq VAR_RESULT, NO, MoveTutor_EventScript_MimicDeclined call MoveTutor_EventScript_CanOnlyBeLearnedOnce - compare VAR_RESULT, NO - goto_if_eq MoveTutor_EventScript_MimicDeclined + goto_if_eq VAR_RESULT, NO, MoveTutor_EventScript_MimicDeclined msgbox MoveTutor_Text_MimicWhichMon, MSGBOX_DEFAULT setvar VAR_0x8005, TUTOR_MOVE_MIMIC call MoveTutor_EventScript_OpenPartyMenu - compare VAR_RESULT, 0 - goto_if_eq MoveTutor_EventScript_MimicDeclined + goto_if_eq VAR_RESULT, 0, MoveTutor_EventScript_MimicDeclined setflag FLAG_MOVE_TUTOR_TAUGHT_MIMIC goto MoveTutor_EventScript_MimicTaught end @@ -119,16 +107,13 @@ FallarborTown_Mart_EventScript_MetronomeTutor:: faceplayer goto_if_set FLAG_MOVE_TUTOR_TAUGHT_METRONOME, MoveTutor_EventScript_MetronomeTaught msgbox MoveTutor_Text_MetronomeTeach, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq MoveTutor_EventScript_MetronomeDeclined + goto_if_eq VAR_RESULT, NO, MoveTutor_EventScript_MetronomeDeclined call MoveTutor_EventScript_CanOnlyBeLearnedOnce - compare VAR_RESULT, NO - goto_if_eq MoveTutor_EventScript_MetronomeDeclined + goto_if_eq VAR_RESULT, NO, MoveTutor_EventScript_MetronomeDeclined msgbox MoveTutor_Text_MetronomeWhichMon, MSGBOX_DEFAULT setvar VAR_0x8005, TUTOR_MOVE_METRONOME call MoveTutor_EventScript_OpenPartyMenu - compare VAR_RESULT, 0 - goto_if_eq MoveTutor_EventScript_MetronomeDeclined + goto_if_eq VAR_RESULT, 0, MoveTutor_EventScript_MetronomeDeclined setflag FLAG_MOVE_TUTOR_TAUGHT_METRONOME goto MoveTutor_EventScript_MetronomeTaught end @@ -148,16 +133,13 @@ FortreeCity_House2_EventScript_SleepTalkTutor:: faceplayer goto_if_set FLAG_MOVE_TUTOR_TAUGHT_SLEEP_TALK, MoveTutor_EventScript_SleepTalkTaught msgbox MoveTutor_Text_SleepTalkTeach, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq MoveTutor_EventScript_SleepTalkDeclined + goto_if_eq VAR_RESULT, NO, MoveTutor_EventScript_SleepTalkDeclined call MoveTutor_EventScript_CanOnlyBeLearnedOnce - compare VAR_RESULT, NO - goto_if_eq MoveTutor_EventScript_SleepTalkDeclined + goto_if_eq VAR_RESULT, NO, MoveTutor_EventScript_SleepTalkDeclined msgbox MoveTutor_Text_SleepTalkWhichMon, MSGBOX_DEFAULT setvar VAR_0x8005, TUTOR_MOVE_SLEEP_TALK call MoveTutor_EventScript_OpenPartyMenu - compare VAR_RESULT, 0 - goto_if_eq MoveTutor_EventScript_SleepTalkDeclined + goto_if_eq VAR_RESULT, 0, MoveTutor_EventScript_SleepTalkDeclined setflag FLAG_MOVE_TUTOR_TAUGHT_SLEEP_TALK goto MoveTutor_EventScript_SleepTalkTaught end @@ -177,16 +159,13 @@ LilycoveCity_DepartmentStoreRooftop_EventScript_SubstituteTutor:: faceplayer goto_if_set FLAG_MOVE_TUTOR_TAUGHT_SUBSTITUTE, MoveTutor_EventScript_SubstituteTaught msgbox MoveTutor_Text_SubstituteTeach, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq MoveTutor_EventScript_SubstituteDeclined + goto_if_eq VAR_RESULT, NO, MoveTutor_EventScript_SubstituteDeclined call MoveTutor_EventScript_CanOnlyBeLearnedOnce - compare VAR_RESULT, NO - goto_if_eq MoveTutor_EventScript_SubstituteDeclined + goto_if_eq VAR_RESULT, NO, MoveTutor_EventScript_SubstituteDeclined msgbox MoveTutor_Text_SubstituteWhichMon, MSGBOX_DEFAULT setvar VAR_0x8005, TUTOR_MOVE_SUBSTITUTE call MoveTutor_EventScript_OpenPartyMenu - compare VAR_RESULT, 0 - goto_if_eq MoveTutor_EventScript_SubstituteDeclined + goto_if_eq VAR_RESULT, 0, MoveTutor_EventScript_SubstituteDeclined setflag FLAG_MOVE_TUTOR_TAUGHT_SUBSTITUTE goto MoveTutor_EventScript_SubstituteTaught end @@ -206,16 +185,13 @@ MossdeepCity_EventScript_DynamicPunchTutor:: faceplayer goto_if_set FLAG_MOVE_TUTOR_TAUGHT_DYNAMICPUNCH, MoveTutor_EventScript_DynamicPunchTaught msgbox MoveTutor_Text_DynamicPunchTeach, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq MoveTutor_EventScript_DynamicPunchDeclined + goto_if_eq VAR_RESULT, NO, MoveTutor_EventScript_DynamicPunchDeclined call MoveTutor_EventScript_CanOnlyBeLearnedOnce - compare VAR_RESULT, NO - goto_if_eq MoveTutor_EventScript_DynamicPunchDeclined + goto_if_eq VAR_RESULT, NO, MoveTutor_EventScript_DynamicPunchDeclined msgbox MoveTutor_Text_DynamicPunchWhichMon, MSGBOX_DEFAULT setvar VAR_0x8005, TUTOR_MOVE_DYNAMIC_PUNCH call MoveTutor_EventScript_OpenPartyMenu - compare VAR_RESULT, 0 - goto_if_eq MoveTutor_EventScript_DynamicPunchDeclined + goto_if_eq VAR_RESULT, 0, MoveTutor_EventScript_DynamicPunchDeclined setflag FLAG_MOVE_TUTOR_TAUGHT_DYNAMICPUNCH goto MoveTutor_EventScript_DynamicPunchTaught end @@ -235,16 +211,13 @@ SootopolisCity_PokemonCenter_1F_EventScript_DoubleEdgeTutor:: faceplayer goto_if_set FLAG_MOVE_TUTOR_TAUGHT_DOUBLE_EDGE, MoveTutor_EventScript_DoubleEdgeTaught msgbox MoveTutor_Text_DoubleEdgeTeach, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq MoveTutor_EventScript_DoubleEdgeDeclined + goto_if_eq VAR_RESULT, NO, MoveTutor_EventScript_DoubleEdgeDeclined call MoveTutor_EventScript_CanOnlyBeLearnedOnce - compare VAR_RESULT, NO - goto_if_eq MoveTutor_EventScript_DoubleEdgeDeclined + goto_if_eq VAR_RESULT, NO, MoveTutor_EventScript_DoubleEdgeDeclined msgbox MoveTutor_Text_DoubleEdgeWhichMon, MSGBOX_DEFAULT setvar VAR_0x8005, TUTOR_MOVE_DOUBLE_EDGE call MoveTutor_EventScript_OpenPartyMenu - compare VAR_RESULT, 0 - goto_if_eq MoveTutor_EventScript_DoubleEdgeDeclined + goto_if_eq VAR_RESULT, 0, MoveTutor_EventScript_DoubleEdgeDeclined setflag FLAG_MOVE_TUTOR_TAUGHT_DOUBLE_EDGE goto MoveTutor_EventScript_DoubleEdgeTaught end @@ -264,16 +237,13 @@ PacifidlogTown_PokemonCenter_1F_EventScript_ExplosionTutor:: faceplayer goto_if_set FLAG_MOVE_TUTOR_TAUGHT_EXPLOSION, MoveTutor_EventScript_ExplosionTaught msgbox MoveTutor_Text_ExplosionTeach, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq MoveTutor_EventScript_ExplosionDeclined + goto_if_eq VAR_RESULT, NO, MoveTutor_EventScript_ExplosionDeclined call MoveTutor_EventScript_CanOnlyBeLearnedOnce - compare VAR_RESULT, NO - goto_if_eq MoveTutor_EventScript_ExplosionDeclined + goto_if_eq VAR_RESULT, NO, MoveTutor_EventScript_ExplosionDeclined msgbox MoveTutor_Text_ExplosionWhichMon, MSGBOX_DEFAULT setvar VAR_0x8005, TUTOR_MOVE_EXPLOSION call MoveTutor_EventScript_OpenPartyMenu - compare VAR_RESULT, 0 - goto_if_eq MoveTutor_EventScript_ExplosionDeclined + goto_if_eq VAR_RESULT, 0, MoveTutor_EventScript_ExplosionDeclined setflag FLAG_MOVE_TUTOR_TAUGHT_EXPLOSION goto MoveTutor_EventScript_ExplosionTaught end diff --git a/data/scripts/obtain_item.inc b/data/scripts/obtain_item.inc index 382f5ce3206d..e982858e7bd0 100644 --- a/data/scripts/obtain_item.inc +++ b/data/scripts/obtain_item.inc @@ -1,67 +1,63 @@ +.set ITEMID, VAR_0x8000 +.set AMOUNT, VAR_0x8001 + Std_ObtainItem:: - additem VAR_0x8000, VAR_0x8001 + additem ITEMID, AMOUNT copyvar VAR_0x8007, VAR_RESULT call EventScript_ObtainItemMessage return EventScript_ObtainItemMessage:: - bufferitemnameplural 1, VAR_0x8000, VAR_0x8001 - checkitemtype VAR_0x8000 + bufferitemnameplural STR_VAR_2, ITEMID, AMOUNT + checkitemtype ITEMID call EventScript_BufferPocketNameAndTryFanfare - compare VAR_0x8007, 1 - call_if_eq EventScript_ObtainedItem - compare VAR_0x8007, 0 - call_if_eq EventScript_NoRoomForItem + call_if_eq VAR_0x8007, TRUE, EventScript_ObtainedItem + call_if_eq VAR_0x8007, FALSE, EventScript_NoRoomForItem return EventScript_BufferPocketNameAndTryFanfare:: switch VAR_RESULT - case POCKET_ITEMS, EventScript_BufferItemsPocket - case POCKET_KEY_ITEMS, EventScript_BufferKeyItemsPocket + case POCKET_ITEMS, EventScript_BufferItemsPocket + case POCKET_KEY_ITEMS, EventScript_BufferKeyItemsPocket case POCKET_POKE_BALLS, EventScript_BufferPokeballsPocket - case POCKET_TM_HM, EventScript_BufferTMHMsPocket - case POCKET_BERRIES, EventScript_BufferBerriesPocket + case POCKET_TM_HM, EventScript_BufferTMHMsPocket + case POCKET_BERRIES, EventScript_BufferBerriesPocket end EventScript_BufferItemsPocket:: - bufferstdstring 2, STDSTRING_ITEMS - compare VAR_0x8007, 1 - call_if_eq EventScript_PlayFanfareObtainedItem + bufferstdstring STR_VAR_3, STDSTRING_ITEMS + call_if_eq VAR_0x8007, TRUE, EventScript_PlayFanfareObtainedItem return EventScript_BufferKeyItemsPocket:: - bufferstdstring 2, STDSTRING_KEYITEMS - compare VAR_0x8007, 1 - call_if_eq EventScript_PlayFanfareObtainedItem + bufferstdstring STR_VAR_3, STDSTRING_KEYITEMS + call_if_eq VAR_0x8007, TRUE, EventScript_PlayFanfareObtainedItem return EventScript_BufferPokeballsPocket:: - bufferstdstring 2, STDSTRING_POKEBALLS - compare VAR_0x8007, 1 - call_if_eq EventScript_PlayFanfareObtainedItem + bufferstdstring STR_VAR_3, STDSTRING_POKEBALLS + call_if_eq VAR_0x8007, TRUE, EventScript_PlayFanfareObtainedItem return EventScript_BufferTMHMsPocket:: - bufferstdstring 2, STDSTRING_TMHMS - compare VAR_0x8007, 1 - call_if_eq EventScript_PlayFanfareObtainedTMHM + bufferstdstring STR_VAR_3, STDSTRING_TMHMS + call_if_eq VAR_0x8007, TRUE, EventScript_PlayFanfareObtainedTMHM return EventScript_BufferBerriesPocket:: - bufferstdstring 2, STDSTRING_BERRIES - compare VAR_0x8007, 1 - call_if_eq EventScript_PlayFanfareObtainedItem + bufferstdstring STR_VAR_3, STDSTRING_BERRIES + call_if_eq VAR_0x8007, TRUE, EventScript_PlayFanfareObtainedItem return EventScript_ObtainedItem:: message gText_ObtainedTheItem waitfanfare msgbox gText_PutItemInPocket, MSGBOX_DEFAULT - setvar VAR_RESULT, 1 + setvar VAR_RESULT, TRUE return EventScript_NoRoomForItem:: - setvar VAR_RESULT, 0 + setvar VAR_RESULT, FALSE return EventScript_PlayFanfareObtainedItem:: @@ -73,17 +69,15 @@ EventScript_PlayFanfareObtainedTMHM:: return Std_ObtainDecoration:: - adddecoration VAR_0x8000 + adddecoration ITEMID copyvar VAR_0x8007, VAR_RESULT call EventScript_ObtainDecorationMessage return EventScript_ObtainDecorationMessage:: - bufferdecorationname 1, VAR_0x8000 - compare VAR_0x8007, 1 - call_if_eq EventScript_ObtainedDecor - compare VAR_0x8007, 0 - call_if_eq EventScript_NoRoomForDecor + bufferdecorationname STR_VAR_2, ITEMID + call_if_eq VAR_0x8007, TRUE, EventScript_ObtainedDecor + call_if_eq VAR_0x8007, FALSE, EventScript_NoRoomForDecor return EventScript_ObtainedDecor:: @@ -91,28 +85,26 @@ EventScript_ObtainedDecor:: message gText_ObtainedTheDecor waitfanfare msgbox gText_TheDecorWasTransferredToThePC, MSGBOX_DEFAULT - setvar VAR_RESULT, 1 + setvar VAR_RESULT, TRUE return EventScript_NoRoomForDecor:: - setvar VAR_RESULT, 0 + setvar VAR_RESULT, FALSE return Std_FindItem:: lock faceplayer waitse - copyvar VAR_0x8004, VAR_0x8000 - copyvar VAR_0x8005, VAR_0x8001 - checkitemspace VAR_0x8000, VAR_0x8001 + copyvar VAR_0x8004, ITEMID + copyvar VAR_0x8005, AMOUNT + checkitemspace ITEMID, AMOUNT copyvar VAR_0x8007, VAR_RESULT - bufferitemnameplural 1, VAR_0x8000, VAR_0x8001 - checkitemtype VAR_0x8000 + bufferitemnameplural STR_VAR_2, ITEMID, AMOUNT + checkitemtype ITEMID call EventScript_BufferPocketNameAndTryFanfare - compare VAR_0x8007, 1 - call_if_eq EventScript_PickUpItem - compare VAR_0x8007, 0 - call_if_eq EventScript_NoRoomToPickUpItem + call_if_eq VAR_0x8007, TRUE, EventScript_PickUpItem + call_if_eq VAR_0x8007, FALSE, EventScript_NoRoomToPickUpItem release return @@ -121,16 +113,13 @@ EventScript_PickUpItem:: additem VAR_0x8004, VAR_0x8005 specialvar VAR_RESULT, BufferTMHMMoveName copyvar VAR_0x8008, VAR_RESULT - compare VAR_0x8008, 1 - call_if_eq EventScript_FoundTMHM - compare VAR_0x8008, 0 - call_if_eq EventScript_FoundItem + call_if_eq VAR_0x8008, TRUE, EventScript_FoundTMHM + call_if_eq VAR_0x8008, FALSE, EventScript_FoundItem waitfanfare waitmessage - bufferitemnameplural 1, VAR_0x8004, VAR_0x8005 + bufferitemnameplural STR_VAR_2, VAR_0x8004, VAR_0x8005 pyramid_inchallenge - compare VAR_RESULT, 1 - goto_if_eq EventScript_PutBattlePyramidItemInBag + goto_if_eq VAR_RESULT, TRUE, EventScript_PutBattlePyramidItemInBag msgbox gText_PutItemInPocket, MSGBOX_DEFAULT return @@ -139,7 +128,7 @@ EventScript_PutBattlePyramidItemInBag:: return EventScript_FoundTMHM:: - bufferitemnameplural 0, VAR_0x8004, VAR_0x8005 + bufferitemnameplural STR_VAR_1, VAR_0x8004, VAR_0x8005 message gText_PlayerFoundOneTMHM return @@ -150,7 +139,7 @@ EventScript_FoundItem:: EventScript_NoRoomToPickUpItem:: msgbox gText_ObtainedTheItem, MSGBOX_DEFAULT msgbox gText_TooBadBagIsFull, MSGBOX_DEFAULT - setvar VAR_RESULT, 0 + setvar VAR_RESULT, FALSE return EventScript_HiddenItemScript:: @@ -158,27 +147,23 @@ EventScript_HiddenItemScript:: waitse additem VAR_0x8005 copyvar VAR_0x8007, VAR_RESULT - bufferitemnameplural 1, VAR_0x8005, 1 + bufferitemnameplural STR_VAR_2, VAR_0x8005, 1 checkitemtype VAR_0x8005 call EventScript_BufferPocketNameAndTryFanfare - compare VAR_0x8007, 1 - goto_if_eq EventScript_PickUpHiddenItem - compare VAR_0x8007, 0 - goto_if_eq EventScript_NoRoomForHiddenItem + goto_if_eq VAR_0x8007, TRUE, EventScript_PickUpHiddenItem + goto_if_eq VAR_0x8007, FALSE, EventScript_NoRoomForHiddenItem end EventScript_PickUpHiddenItem:: copyvar VAR_0x8008, VAR_0x8004 copyvar VAR_0x8004, VAR_0x8005 specialvar VAR_RESULT, BufferTMHMMoveName - compare VAR_RESULT, 1 - goto_if_eq EventScript_FoundHiddenTMHM - compare VAR_RESULT, 0 - goto_if_eq EventScript_FoundHiddenItem + goto_if_eq VAR_RESULT, TRUE, EventScript_FoundHiddenTMHM + goto_if_eq VAR_RESULT, FALSE, EventScript_FoundHiddenItem end EventScript_FoundHiddenTMHM:: - bufferitemnameplural 0, VAR_0x8004, 1 + bufferitemnameplural STR_VAR_1, VAR_0x8004, 1 message gText_PlayerFoundOneTMHM goto EventScript_PutHiddenItemInPocket end @@ -191,7 +176,7 @@ EventScript_FoundHiddenItem:: EventScript_PutHiddenItemInPocket:: waitmessage waitfanfare - bufferitemnameplural 1, VAR_0x8004, 1 + bufferitemnameplural STR_VAR_2, VAR_0x8004, 1 copyvar VAR_0x8004, VAR_0x8008 msgbox gText_PutItemInPocket, MSGBOX_DEFAULT special TryPutTreasureInvestigatorsOnAir diff --git a/data/scripts/pc_transfer.inc b/data/scripts/pc_transfer.inc index 1fe575d55115..1204bece3606 100644 --- a/data/scripts/pc_transfer.inc +++ b/data/scripts/pc_transfer.inc @@ -14,35 +14,33 @@ Common_EventScript_NameReceivedBoxMon:: return Common_EventScript_TransferredToPC:: - bufferboxname 0, VAR_PC_BOX_TO_SEND_MON - bufferspeciesname 1, VAR_TEMP_1 + bufferboxname STR_VAR_1, VAR_PC_BOX_TO_SEND_MON + bufferspeciesname STR_VAR_2, VAR_TEMP_1 call_if_unset FLAG_SYS_PC_LANETTE, EventScript_TransferredSomeonesPC call_if_set FLAG_SYS_PC_LANETTE, EventScript_TransferredLanettesPC return EventScript_TransferredSomeonesPC:: specialvar VAR_RESULT, ShouldShowBoxWasFullMessage - compare VAR_RESULT, 1 - goto_if_eq EventScript_SomeonesPCBoxFull + goto_if_eq VAR_RESULT, TRUE, EventScript_SomeonesPCBoxFull msgbox gText_PkmnTransferredSomeonesPC, MSGBOX_DEFAULT return EventScript_SomeonesPCBoxFull:: specialvar VAR_RESULT, GetPCBoxToSendMon - bufferboxname 2, VAR_RESULT + bufferboxname STR_VAR_3, VAR_RESULT msgbox gText_PkmnTransferredSomeonesPCBoxFull, MSGBOX_DEFAULT return EventScript_TransferredLanettesPC:: specialvar VAR_RESULT, ShouldShowBoxWasFullMessage - compare VAR_RESULT, TRUE - goto_if_eq EventScript_LanettesPCBoxFull + goto_if_eq VAR_RESULT, TRUE, EventScript_LanettesPCBoxFull msgbox gText_PkmnTransferredLanettesPC, MSGBOX_DEFAULT return EventScript_LanettesPCBoxFull:: specialvar VAR_RESULT, GetPCBoxToSendMon - bufferboxname 2, VAR_RESULT + bufferboxname STR_VAR_3, VAR_RESULT msgbox gText_PkmnTransferredLanettesPCBoxFull, MSGBOX_DEFAULT return diff --git a/data/scripts/pkmn_center_nurse.inc b/data/scripts/pkmn_center_nurse.inc index 21f2abe0a20a..64ccdfa77e55 100644 --- a/data/scripts/pkmn_center_nurse.inc +++ b/data/scripts/pkmn_center_nurse.inc @@ -1,135 +1,122 @@ Common_EventScript_PkmnCenterNurse:: - lock - faceplayer - setvar VAR_0x8004, 0 - specialvar VAR_RESULT, CountPlayerTrainerStars - compare VAR_RESULT, 4 - goto_if_eq EventScript_PkmnCenterNurse_GoldCard - msgbox gText_WouldYouLikeToRestYourPkmn, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq EventScript_PkmnCenterNurse_HealPkmn - compare VAR_RESULT, NO - goto_if_eq EventScript_PkmnCenterNurse_Goodbye - end + lock + faceplayer + setvar VAR_0x8004, 0 + specialvar VAR_RESULT, CountPlayerTrainerStars + goto_if_eq VAR_RESULT, 4, EventScript_PkmnCenterNurse_GoldCard + msgbox gText_WouldYouLikeToRestYourPkmn, MSGBOX_YESNO + goto_if_eq VAR_RESULT, YES, EventScript_PkmnCenterNurse_HealPkmn + goto_if_eq VAR_RESULT, NO, EventScript_PkmnCenterNurse_Goodbye + end EventScript_PkmnCenterNurse_Goodbye:: - message gText_WeHopeToSeeYouAgain - return + message gText_WeHopeToSeeYouAgain + return @ VAR_0x8004 is 1 when player has Gold Card; jumps are identical EventScript_PkmnCenterNurse_HealPkmn:: - incrementgamestat GAME_STAT_USED_POKECENTER - compare VAR_0x8004, 0 - call_if_eq EventScript_PkmnCenterNurse_IllTakeYourPkmn - compare VAR_0x8004, 1 - call_if_eq EventScript_PkmnCenterNurse_IllTakeYourPkmn2 - waitmessage - call EventScript_PkmnCenterNurse_TakeAndHealPkmn - goto_if_unset FLAG_POKERUS_EXPLAINED, EventScript_PkmnCenterNurse_CheckPokerus - goto EventScript_PkmnCenterNurse_CheckTrainerHillAndUnionRoom - end + incrementgamestat GAME_STAT_USED_POKECENTER + call_if_eq VAR_0x8004, 0, EventScript_PkmnCenterNurse_IllTakeYourPkmn + call_if_eq VAR_0x8004, 1, EventScript_PkmnCenterNurse_IllTakeYourPkmn2 + waitmessage + call EventScript_PkmnCenterNurse_TakeAndHealPkmn + goto_if_unset FLAG_POKERUS_EXPLAINED, EventScript_PkmnCenterNurse_CheckPokerus + goto EventScript_PkmnCenterNurse_CheckTrainerHillAndUnionRoom + end EventScript_PkmnCenterNurse_IllTakeYourPkmn:: - message gText_IllTakeYourPkmn - return + message gText_IllTakeYourPkmn + return EventScript_PkmnCenterNurse_IllTakeYourPkmn2:: - message gText_IllTakeYourPkmn2 - return + message gText_IllTakeYourPkmn2 + return EventScript_PkmnCenterNurse_TakeAndHealPkmn:: - applymovement VAR_0x800B, Common_Movement_WalkInPlaceFasterLeft - waitmovement 0 - dofieldeffect FLDEFF_POKECENTER_HEAL - waitfieldeffect FLDEFF_POKECENTER_HEAL - applymovement VAR_0x800B, Common_Movement_WalkInPlaceFasterDown - waitmovement 0 - special HealPlayerParty - return + applymovement VAR_0x800B, Common_Movement_WalkInPlaceFasterLeft + waitmovement 0 + dofieldeffect FLDEFF_POKECENTER_HEAL + waitfieldeffect FLDEFF_POKECENTER_HEAL + applymovement VAR_0x800B, Common_Movement_WalkInPlaceFasterDown + waitmovement 0 + special HealPlayerParty + return EventScript_PkmnCenterNurse_CheckTrainerHillAndUnionRoom:: - specialvar VAR_RESULT, PlayerNotAtTrainerHillEntrance - compare VAR_RESULT, 0 - goto_if_eq EventScript_PkmnCenterNurse_ReturnPkmn - specialvar VAR_RESULT, BufferUnionRoomPlayerName - copyvar VAR_0x8008, VAR_RESULT - compare VAR_0x8008, 0 - goto_if_eq EventScript_PkmnCenterNurse_ReturnPkmn - compare VAR_0x8008, 1 - goto_if_eq EventScript_PkmnCenterNurse_PlayerWaitingInUnionRoom - end + specialvar VAR_RESULT, PlayerNotAtTrainerHillEntrance + goto_if_eq VAR_RESULT, 0, EventScript_PkmnCenterNurse_ReturnPkmn + specialvar VAR_RESULT, BufferUnionRoomPlayerName + copyvar VAR_0x8008, VAR_RESULT + goto_if_eq VAR_0x8008, 0, EventScript_PkmnCenterNurse_ReturnPkmn + goto_if_eq VAR_0x8008, 1, EventScript_PkmnCenterNurse_PlayerWaitingInUnionRoom + end @ VAR_0x8004 is 1 when player has Gold Card EventScript_PkmnCenterNurse_ReturnPkmn:: - compare VAR_0x8004, 1 - goto_if_eq EventScript_PkmnCenterNurse_ReturnPkmn2 - message gText_RestoredPkmnToFullHealth - waitmessage - applymovement VAR_0x800B, Movement_PkmnCenterNurse_Bow - waitmovement 0 - message gText_WeHopeToSeeYouAgain - return + goto_if_eq VAR_0x8004, 1, EventScript_PkmnCenterNurse_ReturnPkmn2 + message gText_RestoredPkmnToFullHealth + waitmessage + applymovement VAR_0x800B, Movement_PkmnCenterNurse_Bow + waitmovement 0 + message gText_WeHopeToSeeYouAgain + return EventScript_PkmnCenterNurse_ReturnPkmn2:: - message gText_ThankYouForWaiting - waitmessage - applymovement VAR_0x800B, Movement_PkmnCenterNurse_Bow - waitmovement 0 - message gText_WeHopeToSeeYouAgain2 - return + message gText_ThankYouForWaiting + waitmessage + applymovement VAR_0x800B, Movement_PkmnCenterNurse_Bow + waitmovement 0 + message gText_WeHopeToSeeYouAgain2 + return EventScript_PkmnCenterNurse_PlayerWaitingInUnionRoom:: - goto_if_set FLAG_NURSE_UNION_ROOM_REMINDER, EventScript_PkmnCenterNurse_ReturnPkmn - msgbox gText_RestoredPkmnToFullHealth, MSGBOX_DEFAULT - setflag FLAG_NURSE_UNION_ROOM_REMINDER - message CableClub_Text_PlayerIsWaiting - waitmessage - applymovement VAR_0x800B, Movement_PkmnCenterNurse_Bow - waitmovement 0 - message gText_WeHopeToSeeYouAgain - return + goto_if_set FLAG_NURSE_UNION_ROOM_REMINDER, EventScript_PkmnCenterNurse_ReturnPkmn + msgbox gText_RestoredPkmnToFullHealth, MSGBOX_DEFAULT + setflag FLAG_NURSE_UNION_ROOM_REMINDER + message CableClub_Text_PlayerIsWaiting + waitmessage + applymovement VAR_0x800B, Movement_PkmnCenterNurse_Bow + waitmovement 0 + message gText_WeHopeToSeeYouAgain + return EventScript_PkmnCenterNurse_CheckPokerus:: - specialvar VAR_RESULT, IsPokerusInParty - compare VAR_RESULT, TRUE - goto_if_eq EventScript_PkmnCenterNurse_ExplainPokerus - compare VAR_RESULT, FALSE - goto_if_eq EventScript_PkmnCenterNurse_CheckTrainerHillAndUnionRoom - end + specialvar VAR_RESULT, IsPokerusInParty + goto_if_eq VAR_RESULT, TRUE, EventScript_PkmnCenterNurse_ExplainPokerus + goto_if_eq VAR_RESULT, FALSE, EventScript_PkmnCenterNurse_CheckTrainerHillAndUnionRoom + end EventScript_PkmnCenterNurse_ExplainPokerus:: - message gText_PokerusExplanation - setflag FLAG_POKERUS_EXPLAINED - return + message gText_PokerusExplanation + setflag FLAG_POKERUS_EXPLAINED + return EventScript_PkmnCenterNurse_GoldCard:: - goto_if_set FLAG_NURSE_MENTIONS_GOLD_CARD, EventScript_PkmnCenterNurse_AskForUsual - setflag FLAG_NURSE_MENTIONS_GOLD_CARD - msgbox gText_WelcomeCutShort, MSGBOX_DEFAULT - playse SE_PIN - applymovement VAR_0x800B, Common_Movement_ExclamationMark - waitmovement 0 - applymovement VAR_0x800B, Common_Movement_Delay48 - waitmovement 0 - msgbox gText_NoticesGoldCard, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq EventScript_PkmnCenterNurse_GoldCardHealPkmn - message gText_WeHopeToSeeYouAgain2 - return + goto_if_set FLAG_NURSE_MENTIONS_GOLD_CARD, EventScript_PkmnCenterNurse_AskForUsual + setflag FLAG_NURSE_MENTIONS_GOLD_CARD + msgbox gText_WelcomeCutShort, MSGBOX_DEFAULT + playse SE_PIN + applymovement VAR_0x800B, Common_Movement_ExclamationMark + waitmovement 0 + applymovement VAR_0x800B, Common_Movement_Delay48 + waitmovement 0 + msgbox gText_NoticesGoldCard, MSGBOX_YESNO + goto_if_eq VAR_RESULT, YES, EventScript_PkmnCenterNurse_GoldCardHealPkmn + message gText_WeHopeToSeeYouAgain2 + return EventScript_PkmnCenterNurse_AskForUsual:: - msgbox gText_YouWantTheUsual, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq EventScript_PkmnCenterNurse_GoldCardHealPkmn - message gText_WeHopeToSeeYouAgain2 - return + msgbox gText_YouWantTheUsual, MSGBOX_YESNO + goto_if_eq VAR_RESULT, YES, EventScript_PkmnCenterNurse_GoldCardHealPkmn + message gText_WeHopeToSeeYouAgain2 + return EventScript_PkmnCenterNurse_GoldCardHealPkmn:: - setvar VAR_0x8004, 1 - goto EventScript_PkmnCenterNurse_HealPkmn - end + setvar VAR_0x8004, 1 + goto EventScript_PkmnCenterNurse_HealPkmn + end Movement_PkmnCenterNurse_Bow: - nurse_joy_bow - delay_4 - step_end + nurse_joy_bow + delay_4 + step_end diff --git a/data/scripts/players_house.inc b/data/scripts/players_house.inc index e2e985a7a1fe..caa4e69551ec 100644 --- a/data/scripts/players_house.inc +++ b/data/scripts/players_house.inc @@ -11,10 +11,8 @@ PlayersHouse_1F_EventScript_EnterHouseMovingIn:: msgbox PlayersHouse_1F_Text_IsntItNiceInHere, MSGBOX_DEFAULT applymovement VAR_0x8004, Common_Movement_FacePlayer waitmovement 0 - compare VAR_0x8005, MALE - call_if_eq PlayersHouse_1F_EventScript_MomFacePlayerMovingInMale - compare VAR_0x8005, FEMALE - call_if_eq PlayersHouse_1F_EventScript_MomFacePlayerMovingInFemale + call_if_eq VAR_0x8005, MALE, PlayersHouse_1F_EventScript_MomFacePlayerMovingInMale + call_if_eq VAR_0x8005, FEMALE, PlayersHouse_1F_EventScript_MomFacePlayerMovingInFemale msgbox PlayersHouse_1F_Text_MoversPokemonGoSetClock, MSGBOX_DEFAULT closemessage setvar VAR_LITTLEROOT_INTRO_STATE, 4 @@ -69,10 +67,8 @@ PlayersHouse_2F_EventScript_WallClock:: setflag FLAG_HIDE_LITTLEROOT_TOWN_PLAYERS_HOUSE_VIGOROTH_1 setflag FLAG_HIDE_LITTLEROOT_TOWN_PLAYERS_HOUSE_VIGOROTH_2 checkplayergender - compare VAR_RESULT, MALE - call_if_eq PlayersHouse_2F_EventScript_MomComesUpstairsMale - compare VAR_RESULT, FEMALE - call_if_eq PlayersHouse_2F_EventScript_MomComesUpstairsFemale + call_if_eq VAR_RESULT, MALE, PlayersHouse_2F_EventScript_MomComesUpstairsMale + call_if_eq VAR_RESULT, FEMALE, PlayersHouse_2F_EventScript_MomComesUpstairsFemale playse SE_EXIT removeobject VAR_0x8008 releaseall @@ -310,16 +306,12 @@ PlayersHouse_1F_Movement_MomReturnToSeatFemale: PlayersHouse_1F_EventScript_Mom:: lock faceplayer - compare VAR_LITTLEROOT_HOUSES_STATE_MAY, 4 - goto_if_eq PlayersHouse_1F_EventScript_DontPushYourselfTooHard - compare VAR_LITTLEROOT_HOUSES_STATE_BRENDAN, 4 - goto_if_eq PlayersHouse_1F_EventScript_DontPushYourselfTooHard + goto_if_eq VAR_LITTLEROOT_HOUSES_STATE_MAY, 4, PlayersHouse_1F_EventScript_DontPushYourselfTooHard + goto_if_eq VAR_LITTLEROOT_HOUSES_STATE_BRENDAN, 4, PlayersHouse_1F_EventScript_DontPushYourselfTooHard goto_if_set FLAG_HAS_MATCH_CALL, PlayersHouse_1F_EventScript_TryRegisterMom goto_if_set FLAG_RESCUED_BIRCH, PlayersHouse_1F_EventScript_MomHealsParty - compare VAR_TEMP_1, 1 - goto_if_eq PlayersHouse_1F_EventScript_SeeYouHoney - compare VAR_LITTLEROOT_INTRO_STATE, 7 - goto_if_eq PlayersHouse_1F_EventScript_DidYouMeetProfBirch + goto_if_eq VAR_TEMP_1, 1, PlayersHouse_1F_EventScript_SeeYouHoney + goto_if_eq VAR_LITTLEROOT_INTRO_STATE, 7, PlayersHouse_1F_EventScript_DidYouMeetProfBirch msgbox PlayersHouse_1F_Text_IsntItNiceInHere, MSGBOX_DEFAULT release end @@ -351,8 +343,7 @@ PlayersHouse_1F_EventScript_TryGiveAmuletCoin:: goto_if_set FLAG_RECEIVED_AMULET_COIN, PlayersHouse_1F_EventScript_MomHealsParty msgbox PlayersHouse_1F_Text_GotDadsBadgeHeresSomethingFromMom, MSGBOX_DEFAULT giveitem ITEM_AMULET_COIN - compare VAR_RESULT, FALSE - goto_if_eq Common_EventScript_ShowBagIsFull + goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull msgbox PlayersHouse_1F_Text_DontPushYourselfTooHard, MSGBOX_DEFAULT setflag FLAG_RECEIVED_AMULET_COIN release @@ -432,14 +423,10 @@ PlayersHouse_1F_Movement_MovePlayerAwayFromDoor: PlayersHouse_1F_EventScript_GetSSTicketAndSeeLatiTV:: lockall checkplayergender - compare VAR_RESULT, MALE - call_if_eq PlayersHouse_1F_EventScript_SetUpObjectEventVarsMale - compare VAR_RESULT, FEMALE - call_if_eq PlayersHouse_1F_EventScript_SetUpObjectEventVarsFemale - compare VAR_0x8008, MALE - call_if_eq PlayersHouse_1F_EventScript_PlayerEnterRoomMale - compare VAR_0x8008, FEMALE - call_if_eq PlayersHouse_1F_EventScript_PlayerEnterRoomFemale + call_if_eq VAR_RESULT, MALE, PlayersHouse_1F_EventScript_SetUpObjectEventVarsMale + call_if_eq VAR_RESULT, FEMALE, PlayersHouse_1F_EventScript_SetUpObjectEventVarsFemale + call_if_eq VAR_0x8008, MALE, PlayersHouse_1F_EventScript_PlayerEnterRoomMale + call_if_eq VAR_0x8008, FEMALE, PlayersHouse_1F_EventScript_PlayerEnterRoomFemale applymovement VAR_0x8009, Common_Movement_FacePlayer waitmovement 0 playse SE_PIN @@ -448,58 +435,44 @@ PlayersHouse_1F_EventScript_GetSSTicketAndSeeLatiTV:: applymovement VAR_0x8009, Common_Movement_Delay48 waitmovement 0 delay 20 - compare VAR_0x8008, MALE - call_if_eq PlayersHouse_1F_EventScript_DadApproachPlayerMale - compare VAR_0x8008, FEMALE - call_if_eq PlayersHouse_1F_EventScript_DadApproachPlayerFemale + call_if_eq VAR_0x8008, MALE, PlayersHouse_1F_EventScript_DadApproachPlayerMale + call_if_eq VAR_0x8008, FEMALE, PlayersHouse_1F_EventScript_DadApproachPlayerFemale msgbox PlayersHouse_1F_Text_TicketFromBrineyCameForYou, MSGBOX_DEFAULT giveitem ITEM_SS_TICKET msgbox PlayersHouse_1F_Text_PortsInSlateportLilycove, MSGBOX_DEFAULT closemessage delay 20 - compare VAR_0x8008, MALE - call_if_eq PlayersHouse_1F_EventScript_MomApproachDadMale - compare VAR_0x8008, FEMALE - call_if_eq PlayersHouse_1F_EventScript_MomApproachDadFemale + call_if_eq VAR_0x8008, MALE, PlayersHouse_1F_EventScript_MomApproachDadMale + call_if_eq VAR_0x8008, FEMALE, PlayersHouse_1F_EventScript_MomApproachDadFemale msgbox PlayersHouse_1F_Text_BetterGetBackToGym, MSGBOX_DEFAULT closemessage - compare VAR_0x8008, MALE - call_if_eq PlayersHouse_1F_EventScript_DadExitsMale - compare VAR_0x8008, FEMALE - call_if_eq PlayersHouse_1F_EventScript_DadExitsFemale + call_if_eq VAR_0x8008, MALE, PlayersHouse_1F_EventScript_DadExitsMale + call_if_eq VAR_0x8008, FEMALE, PlayersHouse_1F_EventScript_DadExitsFemale playse SE_DOOR removeobject VAR_0x8009 setflag FLAG_RECEIVED_SS_TICKET delay 30 - compare VAR_0x8008, MALE - call_if_eq PlayersHouse_1F_EventScript_MomApproachPlayerMale - compare VAR_0x8008, FEMALE - call_if_eq PlayersHouse_1F_EventScript_MomApproachPlayerFemale + call_if_eq VAR_0x8008, MALE, PlayersHouse_1F_EventScript_MomApproachPlayerMale + call_if_eq VAR_0x8008, FEMALE, PlayersHouse_1F_EventScript_MomApproachPlayerFemale delay 20 msgbox PlayersHouse_1F_Text_DadShouldStayLonger, MSGBOX_DEFAULT closemessage setflag FLAG_SYS_TV_LATIAS_LATIOS special TurnOnTVScreen delay 60 - compare VAR_0x8008, MALE - call_if_eq PlayersHouse_1F_EventScript_MomNoticesLatiBroadcastMale - compare VAR_0x8008, FEMALE - call_if_eq PlayersHouse_1F_EventScript_MomNoticesLatiBroadcastFemale + call_if_eq VAR_0x8008, MALE, PlayersHouse_1F_EventScript_MomNoticesLatiBroadcastMale + call_if_eq VAR_0x8008, FEMALE, PlayersHouse_1F_EventScript_MomNoticesLatiBroadcastFemale msgbox PlayersHouse_1F_Text_IsThatABreakingStory, MSGBOX_DEFAULT closemessage - compare VAR_0x8008, MALE - call_if_eq PlayersHouse_1F_EventScript_PlayerApproachTVForLatiMale - compare VAR_0x8008, FEMALE - call_if_eq PlayersHouse_1F_EventScript_PlayerApproachTVForLatiFemale + call_if_eq VAR_0x8008, MALE, PlayersHouse_1F_EventScript_PlayerApproachTVForLatiMale + call_if_eq VAR_0x8008, FEMALE, PlayersHouse_1F_EventScript_PlayerApproachTVForLatiFemale msgbox PlayersHouse_1F_Text_LatiEmergencyNewsFlash, MSGBOX_DEFAULT closemessage clearflag FLAG_SYS_TV_LATIAS_LATIOS setflag FLAG_LATIOS_OR_LATIAS_ROAMING special TurnOffTVScreen - compare VAR_0x8008, MALE - call_if_eq PlayersHouse_1F_EventScript_MomApproachPlayerAfterTVMale - compare VAR_0x8008, FEMALE - call_if_eq PlayersHouse_1F_EventScript_MomApproachPlayerAfterTVFemale + call_if_eq VAR_0x8008, MALE, PlayersHouse_1F_EventScript_MomApproachPlayerAfterTVMale + call_if_eq VAR_0x8008, FEMALE, PlayersHouse_1F_EventScript_MomApproachPlayerAfterTVFemale msgbox PlayersHouse_1F_Text_WhatColorDidTheySay, MSGBOX_DEFAULT multichoice 22, 8, MULTI_TV_LATI, TRUE copyvar VAR_0x8004, VAR_RESULT diff --git a/data/scripts/prof_birch.inc b/data/scripts/prof_birch.inc index 7eb1730fcdfc..38a5dfec3238 100644 --- a/data/scripts/prof_birch.inc +++ b/data/scripts/prof_birch.inc @@ -1,23 +1,14 @@ ProfBirch_EventScript_UpdateLocation:: - compare VAR_PETALBURG_GYM_STATE, 0 - goto_if_eq Common_EventScript_NopReturn + goto_if_eq VAR_PETALBURG_GYM_STATE, 0, Common_EventScript_NopReturn goto_if_set FLAG_SYS_GAME_CLEAR, ProfBirch_EventScript_MoveToLab - compare VAR_BIRCH_STATE, 0 - call_if_eq ProfBirch_EventScript_MoveToLab - compare VAR_BIRCH_STATE, 1 - call_if_eq ProfBirch_EventScript_MoveToLab - compare VAR_BIRCH_STATE, 2 - call_if_eq ProfBirch_EventScript_MoveToRoute101 - compare VAR_BIRCH_STATE, 3 - call_if_eq ProfBirch_EventScript_MoveToRoute101 - compare VAR_BIRCH_STATE, 4 - call_if_eq ProfBirch_EventScript_MoveToRoute103 - compare VAR_BIRCH_STATE, 5 - call_if_eq ProfBirch_EventScript_MoveToRoute103 - compare VAR_BIRCH_STATE, 6 - call_if_eq ProfBirch_EventScript_MoveToLab - compare VAR_BIRCH_STATE, 7 - call_if_eq ProfBirch_EventScript_MoveToLab + call_if_eq VAR_BIRCH_STATE, 0, ProfBirch_EventScript_MoveToLab + call_if_eq VAR_BIRCH_STATE, 1, ProfBirch_EventScript_MoveToLab + call_if_eq VAR_BIRCH_STATE, 2, ProfBirch_EventScript_MoveToRoute101 + call_if_eq VAR_BIRCH_STATE, 3, ProfBirch_EventScript_MoveToRoute101 + call_if_eq VAR_BIRCH_STATE, 4, ProfBirch_EventScript_MoveToRoute103 + call_if_eq VAR_BIRCH_STATE, 5, ProfBirch_EventScript_MoveToRoute103 + call_if_eq VAR_BIRCH_STATE, 6, ProfBirch_EventScript_MoveToLab + call_if_eq VAR_BIRCH_STATE, 7, ProfBirch_EventScript_MoveToLab return ProfBirch_EventScript_MoveToLab:: @@ -49,8 +40,7 @@ ProfBirch_EventScript_RatePokedexOrRegister:: ProfBirch_EventScript_AskRatePokedex:: msgbox gBirchDexRatingText_AreYouCurious, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq ProfBirch_EventScript_DeclineRating + goto_if_eq VAR_RESULT, NO, ProfBirch_EventScript_DeclineRating call ProfBirch_EventScript_RatePokedex release end @@ -73,17 +63,16 @@ ProfBirch_EventScript_RatePokedex:: copyvar VAR_0x8008, VAR_0x8005 copyvar VAR_0x8009, VAR_0x8006 copyvar VAR_0x800A, VAR_RESULT - buffernumberstring 0, VAR_0x8008 @ Num Hoenn seen - buffernumberstring 1, VAR_0x8009 @ Num Hoenn caught + buffernumberstring STR_VAR_1, VAR_0x8008 @ Num Hoenn seen + buffernumberstring STR_VAR_2, VAR_0x8009 @ Num Hoenn caught msgbox gBirchDexRatingText_SoYouveSeenAndCaught, MSGBOX_DEFAULT call ProfBirch_EventScript_ShowRatingMessage - compare VAR_0x800A, 0 - goto_if_eq Common_EventScript_NopReturn @ National dex not enabled + goto_if_eq VAR_0x800A, 0, Common_EventScript_NopReturn @ National dex not enabled setvar VAR_0x8004, 1 specialvar VAR_RESULT, ScriptGetPokedexInfo copyvar VAR_0x8008, VAR_0x8005 copyvar VAR_0x8009, VAR_0x8006 - buffernumberstring 0, VAR_0x8008 @ Num National seen - buffernumberstring 1, VAR_0x8009 @ Num National caught + buffernumberstring STR_VAR_1, VAR_0x8008 @ Num National seen + buffernumberstring STR_VAR_2, VAR_0x8009 @ Num National caught msgbox gBirchDexRatingText_OnANationwideBasis, MSGBOX_DEFAULT return diff --git a/data/scripts/profile_man.inc b/data/scripts/profile_man.inc index 2c5b16122c26..4acf049bd8e7 100644 --- a/data/scripts/profile_man.inc +++ b/data/scripts/profile_man.inc @@ -28,10 +28,8 @@ ProfileMan_EventScript_CreateProfile:: call Common_ShowEasyChatScreen lock faceplayer - compare VAR_RESULT, 0 - goto_if_eq ProfileMan_EventScript_CancelShowProfile - compare VAR_RESULT, 1 - goto_if_eq ProfileMan_EventScript_ShowProfile + goto_if_eq VAR_RESULT, 0, ProfileMan_EventScript_CancelShowProfile + goto_if_eq VAR_RESULT, 1, ProfileMan_EventScript_ShowProfile end ProfileMan_EventScript_CancelShowProfile:: @@ -80,10 +78,8 @@ ProfileMan_EventScript_CreateNewProfile:: call Common_ShowEasyChatScreen lock faceplayer - compare VAR_RESULT, 0 - goto_if_eq ProfileMan_EventScript_CancelShowProfile - compare VAR_RESULT, 1 - goto_if_eq ProfileMan_EventScript_ShowProfile + goto_if_eq VAR_RESULT, 0, ProfileMan_EventScript_CancelShowProfile + goto_if_eq VAR_RESULT, 1, ProfileMan_EventScript_ShowProfile end ProfileMan_EventScript_DeclineNewProfile:: diff --git a/data/scripts/questionnaire.inc b/data/scripts/questionnaire.inc index 62e149bb7836..849b25a46a30 100644 --- a/data/scripts/questionnaire.inc +++ b/data/scripts/questionnaire.inc @@ -1,21 +1,16 @@ EventScript_Questionnaire:: lockall msgbox Questionnaire_Text_FillOut, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq Questionnaire_EventScript_Release + goto_if_eq VAR_RESULT, NO, Questionnaire_EventScript_Release setvar VAR_0x8004, EASY_CHAT_TYPE_QUESTIONNAIRE call Common_ShowEasyChatScreen lock faceplayer specialvar VAR_0x8008, GetMartEmployeeObjectEventId - compare VAR_0x8004, 1 - goto_if_eq Questionnaire_EventScript_PlayerInputMysteryEventPhrase - compare VAR_0x8004, 2 - goto_if_eq Questionnaire_EventScript_PlayerInputMysteryGiftPhrase - compare VAR_RESULT, 0 - goto_if_eq Questionnaire_EventScript_Release - compare VAR_RESULT, 1 - goto_if_eq Questionnaire_EventScript_ThankYou + goto_if_eq VAR_0x8004, 1, Questionnaire_EventScript_PlayerInputMysteryEventPhrase + goto_if_eq VAR_0x8004, 2, Questionnaire_EventScript_PlayerInputMysteryGiftPhrase + goto_if_eq VAR_RESULT, 0, Questionnaire_EventScript_Release + goto_if_eq VAR_RESULT, 1, Questionnaire_EventScript_ThankYou end Questionnaire_EventScript_PlayerInputMysteryEventPhrase:: diff --git a/data/scripts/record_mix.inc b/data/scripts/record_mix.inc index d1ad84d3a748..109fde2a8040 100644 --- a/data/scripts/record_mix.inc +++ b/data/scripts/record_mix.inc @@ -3,10 +3,8 @@ EventScript_MixRecordsPrompt:: lock faceplayer msgbox Text_WouldYouLikeToMixRecords, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq EventScript_MixRecords - compare VAR_RESULT, NO - goto_if_eq EventScript_EndMixRecords + goto_if_eq VAR_RESULT, YES, EventScript_MixRecords + goto_if_eq VAR_RESULT, NO, EventScript_EndMixRecords goto EventScript_EndMixRecords EventScript_MixRecords:: diff --git a/data/scripts/rival_graphics.inc b/data/scripts/rival_graphics.inc index a0fb15f0e4ab..26a5c8fbcf41 100644 --- a/data/scripts/rival_graphics.inc +++ b/data/scripts/rival_graphics.inc @@ -1,9 +1,7 @@ Common_EventScript_SetupRivalGfxId:: checkplayergender - compare VAR_RESULT, MALE - goto_if_eq EventScript_SetupRivalGfxIdFemale - compare VAR_RESULT, FEMALE - goto_if_eq EventScript_SetupRivalGfxIdMale + goto_if_eq VAR_RESULT, MALE, EventScript_SetupRivalGfxIdFemale + goto_if_eq VAR_RESULT, FEMALE, EventScript_SetupRivalGfxIdMale end EventScript_SetupRivalGfxIdFemale:: @@ -16,10 +14,8 @@ EventScript_SetupRivalGfxIdMale:: Common_EventScript_SetupRivalOnBikeGfxId:: checkplayergender - compare VAR_RESULT, MALE - goto_if_eq EventScript_SetupRivalOnBikeGfxIdFemale - compare VAR_RESULT, FEMALE - goto_if_eq EventScript_SetupRivalOnBikeGfxIdMale + goto_if_eq VAR_RESULT, MALE, EventScript_SetupRivalOnBikeGfxIdFemale + goto_if_eq VAR_RESULT, FEMALE, EventScript_SetupRivalOnBikeGfxIdMale end EventScript_SetupRivalOnBikeGfxIdFemale:: @@ -33,10 +29,8 @@ EventScript_SetupRivalOnBikeGfxIdMale:: @ Unused Common_EventScript_SetupRivalGfxIdSameGender:: checkplayergender - compare VAR_RESULT, MALE - goto_if_eq EventScript_SetupRivalGfxIdMale2 - compare VAR_RESULT, FEMALE - goto_if_eq EventScript_SetupRivalGfxIdFemale2 + goto_if_eq VAR_RESULT, MALE, EventScript_SetupRivalGfxIdMale2 + goto_if_eq VAR_RESULT, FEMALE, EventScript_SetupRivalGfxIdFemale2 end EventScript_SetupRivalGfxIdMale2:: diff --git a/data/scripts/roulette.inc b/data/scripts/roulette.inc index 1167a765bdd7..7163a449aac3 100644 --- a/data/scripts/roulette.inc +++ b/data/scripts/roulette.inc @@ -1,23 +1,19 @@ Roulette_EventScript_Table1:: - checkitem ITEM_COIN_CASE, 1 - compare VAR_RESULT, FALSE - goto_if_eq MauvilleCity_GameCorner_EventScript_NoCoinCase + checkitem ITEM_COIN_CASE + goto_if_eq VAR_RESULT, FALSE, MauvilleCity_GameCorner_EventScript_NoCoinCase setvar VAR_0x8004, 0 - getpricereduction POKENEWS_GAME_CORNER - compare VAR_RESULT, FALSE - goto_if_eq Roulette_EventScript_Play + getpokenewsactive POKENEWS_GAME_CORNER + goto_if_eq VAR_RESULT, FALSE, Roulette_EventScript_Play addvar VAR_0x8004, ROULETTE_SPECIAL_RATE goto Roulette_EventScript_Play end Roulette_EventScript_Table2:: - checkitem ITEM_COIN_CASE, 1 - compare VAR_RESULT, FALSE - goto_if_eq MauvilleCity_GameCorner_EventScript_NoCoinCase + checkitem ITEM_COIN_CASE + goto_if_eq VAR_RESULT, FALSE, MauvilleCity_GameCorner_EventScript_NoCoinCase setvar VAR_0x8004, 1 - getpricereduction POKENEWS_GAME_CORNER - compare VAR_RESULT, FALSE - goto_if_eq Roulette_EventScript_Play + getpokenewsactive POKENEWS_GAME_CORNER + goto_if_eq VAR_RESULT, FALSE, Roulette_EventScript_Play addvar VAR_0x8004, ROULETTE_SPECIAL_RATE goto Roulette_EventScript_Play end diff --git a/data/scripts/safari_zone.inc b/data/scripts/safari_zone.inc index 6dd0767f0cce..eb6a90abdfd7 100644 --- a/data/scripts/safari_zone.inc +++ b/data/scripts/safari_zone.inc @@ -1,21 +1,20 @@ SafariZone_EventScript_OutOfBallsMidBattle:: setvar VAR_SAFARI_ZONE_STATE, 1 special ExitSafariMode - setwarp MAP_ROUTE121_SAFARI_ZONE_ENTRANCE, 255, 2, 5 + setwarp MAP_ROUTE121_SAFARI_ZONE_ENTRANCE, 2, 5 end SafariZone_EventScript_Exit:: setvar VAR_SAFARI_ZONE_STATE, 1 special ExitSafariMode - warp MAP_ROUTE121_SAFARI_ZONE_ENTRANCE, 255, 2, 5 + warp MAP_ROUTE121_SAFARI_ZONE_ENTRANCE, 2, 5 waitstate end SafariZone_EventScript_RetirePrompt:: lockall msgbox SafariZone_Text_WouldYouLikeToExit, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq SafariZone_EventScript_Retire + goto_if_eq VAR_RESULT, YES, SafariZone_EventScript_Retire releaseall end @@ -43,11 +42,9 @@ SafariZone_EventScript_OutOfBalls:: EventScript_PokeBlockFeeder:: lockall special GetPokeblockFeederInFront - compare VAR_RESULT, 0xFFFF - goto_if_ne SafariZone_EventScript_PokeblockPresent + goto_if_ne VAR_RESULT, 0xFFFF, SafariZone_EventScript_PokeblockPresent msgbox SafariZone_Text_PlacePokeblockOnFeeder, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq SafariZone_EventScript_ChoosePokeblock + goto_if_eq VAR_RESULT, YES, SafariZone_EventScript_ChoosePokeblock releaseall end @@ -55,8 +52,7 @@ SafariZone_EventScript_ChoosePokeblock:: fadescreen FADE_TO_BLACK special OpenPokeblockCaseOnFeeder waitstate - compare VAR_RESULT, 0xFFFF - goto_if_ne SafariZone_EventScript_PokeblockPlaced + goto_if_ne VAR_RESULT, 0xFFFF, SafariZone_EventScript_PokeblockPlaced end SafariZone_EventScript_PokeblockPlaced:: diff --git a/data/scripts/secret_base.inc b/data/scripts/secret_base.inc index ae802cdfd2a2..d21bb9aab5c1 100644 --- a/data/scripts/secret_base.inc +++ b/data/scripts/secret_base.inc @@ -27,33 +27,24 @@ SecretBase_Text_DiscoveredSmallEntrance: SecretBase_EventScript_CheckEntrance:: special GetSecretBaseTypeInFrontOfPlayer special CheckPlayerHasSecretBase - compare VAR_RESULT, TRUE - goto_if_eq SecretBase_EventScript_AlreadyHasSecretBase + goto_if_eq VAR_RESULT, TRUE, SecretBase_EventScript_AlreadyHasSecretBase checkpartymove MOVE_SECRET_POWER setfieldeffectargument 0, VAR_RESULT - buffermovename 1, MOVE_SECRET_POWER - compare VAR_0x8007, SECRET_BASE_RED_CAVE - goto_if_eq SecretBase_EventScript_Cave - compare VAR_0x8007, SECRET_BASE_BROWN_CAVE - goto_if_eq SecretBase_EventScript_Cave - compare VAR_0x8007, SECRET_BASE_BLUE_CAVE - goto_if_eq SecretBase_EventScript_Cave - compare VAR_0x8007, SECRET_BASE_YELLOW_CAVE - goto_if_eq SecretBase_EventScript_Cave - compare VAR_0x8007, SECRET_BASE_TREE - goto_if_eq SecretBase_EventScript_Tree - compare VAR_0x8007, SECRET_BASE_SHRUB - goto_if_eq SecretBase_EventScript_Shrub + buffermovename STR_VAR_2, MOVE_SECRET_POWER + goto_if_eq VAR_0x8007, SECRET_BASE_RED_CAVE, SecretBase_EventScript_Cave + goto_if_eq VAR_0x8007, SECRET_BASE_BROWN_CAVE, SecretBase_EventScript_Cave + goto_if_eq VAR_0x8007, SECRET_BASE_BLUE_CAVE, SecretBase_EventScript_Cave + goto_if_eq VAR_0x8007, SECRET_BASE_YELLOW_CAVE, SecretBase_EventScript_Cave + goto_if_eq VAR_0x8007, SECRET_BASE_TREE, SecretBase_EventScript_Tree + goto_if_eq VAR_0x8007, SECRET_BASE_SHRUB, SecretBase_EventScript_Shrub end SecretBase_EventScript_Cave:: lockall - compare VAR_RESULT, PARTY_SIZE - goto_if_eq SecretBase_EventScript_CaveNoSecretPower - bufferpartymonnick 0, VAR_RESULT + goto_if_eq VAR_RESULT, PARTY_SIZE, SecretBase_EventScript_CaveNoSecretPower + bufferpartymonnick STR_VAR_1, VAR_RESULT msgbox SecretBase_Text_IndentUseSecretPower, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq SecretBase_EventScript_CancelOnEntrance + goto_if_eq VAR_RESULT, NO, SecretBase_EventScript_CancelOnEntrance msgbox Text_MonUsedFieldMove, MSGBOX_DEFAULT closemessage dofieldeffect FLDEFF_USE_SECRET_POWER_CAVE @@ -80,12 +71,10 @@ SecretBase_EventScript_CaveEnter:: SecretBase_EventScript_Tree:: lockall - compare VAR_RESULT, PARTY_SIZE - goto_if_eq SecretBase_EventScript_TreeNoSecretPower - bufferpartymonnick 0, VAR_RESULT + goto_if_eq VAR_RESULT, PARTY_SIZE, SecretBase_EventScript_TreeNoSecretPower + bufferpartymonnick STR_VAR_1, VAR_RESULT msgbox SecretBase_Text_TreeUseSecretPower, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq SecretBase_EventScript_CancelOnEntrance + goto_if_eq VAR_RESULT, NO, SecretBase_EventScript_CancelOnEntrance msgbox Text_MonUsedFieldMove, MSGBOX_DEFAULT closemessage dofieldeffect FLDEFF_USE_SECRET_POWER_TREE @@ -112,12 +101,10 @@ SecretBase_EventScript_TreeEnter:: SecretBase_EventScript_Shrub:: lockall - compare VAR_RESULT, PARTY_SIZE - goto_if_eq SecretBase_EventScript_ShrubNoSecretPower - bufferpartymonnick 0, VAR_RESULT + goto_if_eq VAR_RESULT, PARTY_SIZE, SecretBase_EventScript_ShrubNoSecretPower + bufferpartymonnick STR_VAR_1, VAR_RESULT msgbox SecretBase_Text_ClumpUseSecretPower, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq SecretBase_EventScript_CancelOnEntrance + goto_if_eq VAR_RESULT, NO, SecretBase_EventScript_CancelOnEntrance msgbox Text_MonUsedFieldMove, MSGBOX_DEFAULT closemessage dofieldeffect FLDEFF_USE_SECRET_POWER_SHRUB @@ -161,8 +148,7 @@ SecretBase_EventScript_FirstEntrance:: waitmovement 0 setvar VAR_INIT_SECRET_BASE, 1 msgbox SecretBase_Text_WantToMakeYourSecretBaseHere, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq SecretBase_EventScript_SetAsBase + goto_if_eq VAR_RESULT, YES, SecretBase_EventScript_SetAsBase closemessage playse SE_EXIT special ClearAndLeaveSecretBase @@ -185,8 +171,7 @@ SecretBase_EventScript_Enter:: setvar VAR_INIT_SECRET_BASE, 1 playse SE_EXIT special IsCurSecretBaseOwnedByAnotherPlayer - compare VAR_RESULT, FALSE - goto_if_eq SecretBase_EventScript_EnterPlayersBase + goto_if_eq VAR_RESULT, FALSE, SecretBase_EventScript_EnterPlayersBase clearflag FLAG_DECORATION_0 special EnterSecretBase setvar VAR_SECRET_BASE_INITIALIZED, 0 @@ -202,59 +187,43 @@ SecretBase_EventScript_EnterPlayersBase:: SecretBase_EventScript_AlreadyHasSecretBase:: checkpartymove MOVE_SECRET_POWER - compare VAR_RESULT, PARTY_SIZE - goto_if_eq SecretBase_EventScript_NoSecretPower + goto_if_eq VAR_RESULT, PARTY_SIZE, SecretBase_EventScript_NoSecretPower setfieldeffectargument 0, VAR_RESULT setorcopyvar VAR_0x8004, VAR_RESULT lockall special GetSecretBaseNearbyMapName msgbox SecretBase_Text_WouldYouLikeToMoveBases, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq SecretBase_EventScript_CancelOnEntrance + goto_if_eq VAR_RESULT, NO, SecretBase_EventScript_CancelOnEntrance msgbox SecretBase_Text_AllDecorationsWillBeReturned, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq SecretBase_EventScript_CancelOnEntrance + goto_if_eq VAR_RESULT, NO, SecretBase_EventScript_CancelOnEntrance fadescreenswapbuffers FADE_TO_BLACK special MoveOutOfSecretBaseFromOutside closemessage fadescreenswapbuffers FADE_FROM_BLACK msgbox SecretBase_Text_MovingCompletedUseSecretPower, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq SecretBase_EventScript_CancelOnEntrance - bufferpartymonnick 0, VAR_0x8004 - buffermovename 1, MOVE_SECRET_POWER + goto_if_eq VAR_RESULT, NO, SecretBase_EventScript_CancelOnEntrance + bufferpartymonnick STR_VAR_1, VAR_0x8004 + buffermovename STR_VAR_2, MOVE_SECRET_POWER msgbox Text_MonUsedFieldMove, MSGBOX_DEFAULT closemessage closemessage - compare VAR_0x8007, SECRET_BASE_RED_CAVE - goto_if_eq SecretBase_EventScript_CaveUseSecretPower - compare VAR_0x8007, SECRET_BASE_BROWN_CAVE - goto_if_eq SecretBase_EventScript_CaveUseSecretPower - compare VAR_0x8007, SECRET_BASE_BLUE_CAVE - goto_if_eq SecretBase_EventScript_CaveUseSecretPower - compare VAR_0x8007, SECRET_BASE_YELLOW_CAVE - goto_if_eq SecretBase_EventScript_CaveUseSecretPower - compare VAR_0x8007, SECRET_BASE_TREE - goto_if_eq SecretBase_EventScript_TreeUseSecretPower - compare VAR_0x8007, SECRET_BASE_SHRUB - goto_if_eq SecretBase_EventScript_ShrubUseSecretPower + goto_if_eq VAR_0x8007, SECRET_BASE_RED_CAVE, SecretBase_EventScript_CaveUseSecretPower + goto_if_eq VAR_0x8007, SECRET_BASE_BROWN_CAVE, SecretBase_EventScript_CaveUseSecretPower + goto_if_eq VAR_0x8007, SECRET_BASE_BLUE_CAVE, SecretBase_EventScript_CaveUseSecretPower + goto_if_eq VAR_0x8007, SECRET_BASE_YELLOW_CAVE, SecretBase_EventScript_CaveUseSecretPower + goto_if_eq VAR_0x8007, SECRET_BASE_TREE, SecretBase_EventScript_TreeUseSecretPower + goto_if_eq VAR_0x8007, SECRET_BASE_SHRUB, SecretBase_EventScript_ShrubUseSecretPower releaseall end SecretBase_EventScript_NoSecretPower:: lockall - compare VAR_0x8007, SECRET_BASE_RED_CAVE - goto_if_eq SecretBase_EventScript_CaveNoSecretPower - compare VAR_0x8007, SECRET_BASE_BROWN_CAVE - goto_if_eq SecretBase_EventScript_CaveNoSecretPower - compare VAR_0x8007, SECRET_BASE_BLUE_CAVE - goto_if_eq SecretBase_EventScript_CaveNoSecretPower - compare VAR_0x8007, SECRET_BASE_YELLOW_CAVE - goto_if_eq SecretBase_EventScript_CaveNoSecretPower - compare VAR_0x8007, SECRET_BASE_TREE - goto_if_eq SecretBase_EventScript_TreeNoSecretPower - compare VAR_0x8007, SECRET_BASE_SHRUB - goto_if_eq SecretBase_EventScript_ShrubNoSecretPower + goto_if_eq VAR_0x8007, SECRET_BASE_RED_CAVE, SecretBase_EventScript_CaveNoSecretPower + goto_if_eq VAR_0x8007, SECRET_BASE_BROWN_CAVE, SecretBase_EventScript_CaveNoSecretPower + goto_if_eq VAR_0x8007, SECRET_BASE_BLUE_CAVE, SecretBase_EventScript_CaveNoSecretPower + goto_if_eq VAR_0x8007, SECRET_BASE_YELLOW_CAVE, SecretBase_EventScript_CaveNoSecretPower + goto_if_eq VAR_0x8007, SECRET_BASE_TREE, SecretBase_EventScript_TreeNoSecretPower + goto_if_eq VAR_0x8007, SECRET_BASE_SHRUB, SecretBase_EventScript_ShrubNoSecretPower end SecretBase_EventScript_CancelOnEntrance:: @@ -302,11 +271,9 @@ SecretBase_EventScript_PutAwayDecoration:: SecretBase_EventScript_PutAwayDecorationLoop:: special PutAwayDecorationIteration - compare VAR_RESULT, 1 - goto_if_eq SecretBase_EventScript_PutAwayDecorationEnd + goto_if_eq VAR_RESULT, 1, SecretBase_EventScript_PutAwayDecorationEnd addvar VAR_0x8004, 1 - compare VAR_0x8005, 0 - goto_if_eq SecretBase_EventScript_PutAwayDecorationLoop + goto_if_eq VAR_0x8005, 0, SecretBase_EventScript_PutAwayDecorationLoop removeobject VAR_0x8006 setflag VAR_0x8005 @ UB: VAR_0x8005 is set to a flag by PutAwayDecorationIteration, but ScrCmd_setflag doesn't use VarGet goto SecretBase_EventScript_PutAwayDecorationLoop @@ -317,26 +284,16 @@ SecretBase_EventScript_PutAwayDecorationEnd:: SecretBase_EventScript_RecordMixTrainer:: special GetSecretBaseOwnerAndState - compare VAR_0x8004, 0 - goto_if_eq SecretBase_EventScript_Trainer0 - compare VAR_0x8004, 1 - goto_if_eq SecretBase_EventScript_Trainer1 - compare VAR_0x8004, 2 - goto_if_eq SecretBase_EventScript_Trainer2 - compare VAR_0x8004, 3 - goto_if_eq SecretBase_EventScript_Trainer3 - compare VAR_0x8004, 4 - goto_if_eq SecretBase_EventScript_Trainer4 - compare VAR_0x8004, 5 - goto_if_eq SecretBase_EventScript_Trainer5 - compare VAR_0x8004, 6 - goto_if_eq SecretBase_EventScript_Trainer6 - compare VAR_0x8004, 7 - goto_if_eq SecretBase_EventScript_Trainer7 - compare VAR_0x8004, 8 - goto_if_eq SecretBase_EventScript_Trainer8 - compare VAR_0x8004, 9 - goto_if_eq SecretBase_EventScript_Trainer9 + goto_if_eq VAR_0x8004, 0, SecretBase_EventScript_Trainer0 + goto_if_eq VAR_0x8004, 1, SecretBase_EventScript_Trainer1 + goto_if_eq VAR_0x8004, 2, SecretBase_EventScript_Trainer2 + goto_if_eq VAR_0x8004, 3, SecretBase_EventScript_Trainer3 + goto_if_eq VAR_0x8004, 4, SecretBase_EventScript_Trainer4 + goto_if_eq VAR_0x8004, 5, SecretBase_EventScript_Trainer5 + goto_if_eq VAR_0x8004, 6, SecretBase_EventScript_Trainer6 + goto_if_eq VAR_0x8004, 7, SecretBase_EventScript_Trainer7 + goto_if_eq VAR_0x8004, 8, SecretBase_EventScript_Trainer8 + goto_if_eq VAR_0x8004, 9, SecretBase_EventScript_Trainer9 end @ VAR_RESULT is initially set by GetSecretBaseOwnerAndState @@ -344,16 +301,13 @@ SecretBase_EventScript_Trainer0:: lock faceplayer goto_if_unset FLAG_SYS_GAME_CLEAR, SecretBase_EventScript_Trainer0PreChampion - compare VAR_RESULT, 1 - goto_if_eq SecretBase_EventScript_Trainer0PostBattle + goto_if_eq VAR_RESULT, 1, SecretBase_EventScript_Trainer0PostBattle msgbox SecretBase_Text_Trainer0Intro, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq SecretBase_EventScript_Trainer0DeclineBattle + goto_if_eq VAR_RESULT, NO, SecretBase_EventScript_Trainer0DeclineBattle setvar VAR_RESULT, 1 special SetBattledOwnerFromResult call Common_EventScript_SaveGame - compare VAR_RESULT, 0 - goto_if_eq SecretBase_EventScript_Trainer0DeclineBattle + goto_if_eq VAR_RESULT, 0, SecretBase_EventScript_Trainer0DeclineBattle msgbox SecretBase_Text_Trainer0AcceptBattle, MSGBOX_DEFAULT goto SecretBase_EventScript_BattleTrainer end @@ -381,16 +335,13 @@ SecretBase_EventScript_Trainer1:: lock faceplayer goto_if_unset FLAG_SYS_GAME_CLEAR, SecretBase_EventScript_Trainer1PreChampion - compare VAR_RESULT, 1 - goto_if_eq SecretBase_EventScript_Trainer1PostBattle + goto_if_eq VAR_RESULT, 1, SecretBase_EventScript_Trainer1PostBattle msgbox SecretBase_Text_Trainer1Intro, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq SecretBase_EventScript_Trainer1DeclineBattle + goto_if_eq VAR_RESULT, NO, SecretBase_EventScript_Trainer1DeclineBattle setvar VAR_RESULT, 1 special SetBattledOwnerFromResult call Common_EventScript_SaveGame - compare VAR_RESULT, 0 - goto_if_eq SecretBase_EventScript_Trainer1DeclineBattle + goto_if_eq VAR_RESULT, 0, SecretBase_EventScript_Trainer1DeclineBattle msgbox SecretBase_Text_Trainer1AcceptBattle, MSGBOX_DEFAULT goto SecretBase_EventScript_BattleTrainer end @@ -418,16 +369,13 @@ SecretBase_EventScript_Trainer2:: lock faceplayer goto_if_unset FLAG_SYS_GAME_CLEAR, SecretBase_EventScript_Trainer2PreChampion - compare VAR_RESULT, 1 - goto_if_eq SecretBase_EventScript_Trainer2PostBattle + goto_if_eq VAR_RESULT, 1, SecretBase_EventScript_Trainer2PostBattle msgbox SecretBase_Text_Trainer2Intro, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq SecretBase_EventScript_Trainer2DeclineBattle + goto_if_eq VAR_RESULT, NO, SecretBase_EventScript_Trainer2DeclineBattle setvar VAR_RESULT, 1 special SetBattledOwnerFromResult call Common_EventScript_SaveGame - compare VAR_RESULT, 0 - goto_if_eq SecretBase_EventScript_Trainer2DeclineBattle + goto_if_eq VAR_RESULT, 0, SecretBase_EventScript_Trainer2DeclineBattle msgbox SecretBase_Text_Trainer2AcceptBattle, MSGBOX_DEFAULT goto SecretBase_EventScript_BattleTrainer end @@ -455,16 +403,13 @@ SecretBase_EventScript_Trainer3:: lock faceplayer goto_if_unset FLAG_SYS_GAME_CLEAR, SecretBase_EventScript_Trainer3PreChampion - compare VAR_RESULT, 1 - goto_if_eq SecretBase_EventScript_Trainer3PostBattle + goto_if_eq VAR_RESULT, 1, SecretBase_EventScript_Trainer3PostBattle msgbox SecretBase_Text_Trainer3Intro, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq SecretBase_EventScript_Trainer3DeclineBattle + goto_if_eq VAR_RESULT, NO, SecretBase_EventScript_Trainer3DeclineBattle setvar VAR_RESULT, 1 special SetBattledOwnerFromResult call Common_EventScript_SaveGame - compare VAR_RESULT, 0 - goto_if_eq SecretBase_EventScript_Trainer3DeclineBattle + goto_if_eq VAR_RESULT, 0, SecretBase_EventScript_Trainer3DeclineBattle msgbox SecretBase_Text_Trainer3AcceptBattle, MSGBOX_DEFAULT goto SecretBase_EventScript_BattleTrainer end @@ -492,16 +437,13 @@ SecretBase_EventScript_Trainer4:: lock faceplayer goto_if_unset FLAG_SYS_GAME_CLEAR, SecretBase_EventScript_Trainer4PreChampion - compare VAR_RESULT, 1 - goto_if_eq SecretBase_EventScript_Trainer4PostBattle + goto_if_eq VAR_RESULT, 1, SecretBase_EventScript_Trainer4PostBattle msgbox SecretBase_Text_Trainer4Intro, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq SecretBase_EventScript_Trainer4DeclineBattle + goto_if_eq VAR_RESULT, NO, SecretBase_EventScript_Trainer4DeclineBattle setvar VAR_RESULT, 1 special SetBattledOwnerFromResult call Common_EventScript_SaveGame - compare VAR_RESULT, 0 - goto_if_eq SecretBase_EventScript_Trainer4DeclineBattle + goto_if_eq VAR_RESULT, 0, SecretBase_EventScript_Trainer4DeclineBattle msgbox SecretBase_Text_Trainer4AcceptBattle, MSGBOX_DEFAULT goto SecretBase_EventScript_BattleTrainer end @@ -529,16 +471,13 @@ SecretBase_EventScript_Trainer5:: lock faceplayer goto_if_unset FLAG_SYS_GAME_CLEAR, SecretBase_EventScript_Trainer5PreChampion - compare VAR_RESULT, 1 - goto_if_eq SecretBase_EventScript_Trainer5PostBattle + goto_if_eq VAR_RESULT, 1, SecretBase_EventScript_Trainer5PostBattle msgbox SecretBase_Text_Trainer5Intro, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq SecretBase_EventScript_Trainer5DeclineBattle + goto_if_eq VAR_RESULT, NO, SecretBase_EventScript_Trainer5DeclineBattle setvar VAR_RESULT, 1 special SetBattledOwnerFromResult call Common_EventScript_SaveGame - compare VAR_RESULT, 0 - goto_if_eq SecretBase_EventScript_Trainer5DeclineBattle + goto_if_eq VAR_RESULT, 0, SecretBase_EventScript_Trainer5DeclineBattle msgbox SecretBase_Text_Trainer5AcceptBattle, MSGBOX_DEFAULT goto SecretBase_EventScript_BattleTrainer end @@ -566,16 +505,13 @@ SecretBase_EventScript_Trainer6:: lock faceplayer goto_if_unset FLAG_SYS_GAME_CLEAR, SecretBase_EventScript_Trainer6PreChampion - compare VAR_RESULT, 1 - goto_if_eq SecretBase_EventScript_Trainer6PostBattle + goto_if_eq VAR_RESULT, 1, SecretBase_EventScript_Trainer6PostBattle msgbox SecretBase_Text_Trainer6Intro, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq SecretBase_EventScript_Trainer6DeclineBattle + goto_if_eq VAR_RESULT, NO, SecretBase_EventScript_Trainer6DeclineBattle setvar VAR_RESULT, 1 special SetBattledOwnerFromResult call Common_EventScript_SaveGame - compare VAR_RESULT, 0 - goto_if_eq SecretBase_EventScript_Trainer6DeclineBattle + goto_if_eq VAR_RESULT, 0, SecretBase_EventScript_Trainer6DeclineBattle msgbox SecretBase_Text_Trainer6AcceptBattle, MSGBOX_DEFAULT goto SecretBase_EventScript_BattleTrainer end @@ -603,16 +539,13 @@ SecretBase_EventScript_Trainer7:: lock faceplayer goto_if_unset FLAG_SYS_GAME_CLEAR, SecretBase_EventScript_Trainer7PreChampion - compare VAR_RESULT, 1 - goto_if_eq SecretBase_EventScript_Trainer7PostBattle + goto_if_eq VAR_RESULT, 1, SecretBase_EventScript_Trainer7PostBattle msgbox SecretBase_Text_Trainer7Intro, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq SecretBase_EventScript_Trainer7DeclineBattle + goto_if_eq VAR_RESULT, NO, SecretBase_EventScript_Trainer7DeclineBattle setvar VAR_RESULT, 1 special SetBattledOwnerFromResult call Common_EventScript_SaveGame - compare VAR_RESULT, 0 - goto_if_eq SecretBase_EventScript_Trainer7DeclineBattle + goto_if_eq VAR_RESULT, 0, SecretBase_EventScript_Trainer7DeclineBattle msgbox SecretBase_Text_Trainer7AcceptBattle, MSGBOX_DEFAULT goto SecretBase_EventScript_BattleTrainer end @@ -640,16 +573,13 @@ SecretBase_EventScript_Trainer8:: lock faceplayer goto_if_unset FLAG_SYS_GAME_CLEAR, SecretBase_EventScript_Trainer8PreChampion - compare VAR_RESULT, 1 - goto_if_eq SecretBase_EventScript_Trainer8PostBattle + goto_if_eq VAR_RESULT, 1, SecretBase_EventScript_Trainer8PostBattle msgbox SecretBase_Text_Trainer8Intro, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq SecretBase_EventScript_Trainer8DeclineBattle + goto_if_eq VAR_RESULT, NO, SecretBase_EventScript_Trainer8DeclineBattle setvar VAR_RESULT, 1 special SetBattledOwnerFromResult call Common_EventScript_SaveGame - compare VAR_RESULT, 0 - goto_if_eq SecretBase_EventScript_Trainer8DeclineBattle + goto_if_eq VAR_RESULT, 0, SecretBase_EventScript_Trainer8DeclineBattle msgbox SecretBase_Text_Trainer8AcceptBattle, MSGBOX_DEFAULT goto SecretBase_EventScript_BattleTrainer end @@ -677,16 +607,13 @@ SecretBase_EventScript_Trainer9:: lock faceplayer goto_if_unset FLAG_SYS_GAME_CLEAR, SecretBase_EventScript_Trainer9PreChampion - compare VAR_RESULT, 1 - goto_if_eq SecretBase_EventScript_Trainer9PostBattle + goto_if_eq VAR_RESULT, 1, SecretBase_EventScript_Trainer9PostBattle msgbox SecretBase_Text_Trainer9Intro, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq SecretBase_EventScript_Trainer9DeclineBattle + goto_if_eq VAR_RESULT, NO, SecretBase_EventScript_Trainer9DeclineBattle setvar VAR_RESULT, 1 special SetBattledOwnerFromResult call Common_EventScript_SaveGame - compare VAR_RESULT, 0 - goto_if_eq SecretBase_EventScript_Trainer9DeclineBattle + goto_if_eq VAR_RESULT, 0, SecretBase_EventScript_Trainer9DeclineBattle msgbox SecretBase_Text_Trainer9AcceptBattle, MSGBOX_DEFAULT goto SecretBase_EventScript_BattleTrainer end @@ -715,12 +642,9 @@ SecretBase_EventScript_BattleTrainer:: setvar VAR_0x8005, 0 special DoSpecialTrainerBattle waitstate - compare VAR_RESULT, B_OUTCOME_DREW - call_if_eq SecretBase_EventScript_DrewSecretBaseBattle - compare VAR_RESULT, B_OUTCOME_WON - call_if_eq SecretBase_EventScript_WonSecretBaseBattle - compare VAR_RESULT, B_OUTCOME_LOST - call_if_eq SecretBase_EventScript_LostSecretBaseBattle + call_if_eq VAR_RESULT, B_OUTCOME_DREW, SecretBase_EventScript_DrewSecretBaseBattle + call_if_eq VAR_RESULT, B_OUTCOME_WON, SecretBase_EventScript_WonSecretBaseBattle + call_if_eq VAR_RESULT, B_OUTCOME_LOST, SecretBase_EventScript_LostSecretBaseBattle special HealPlayerParty release end diff --git a/data/scripts/secret_power_tm.inc b/data/scripts/secret_power_tm.inc index 41c21e1004fc..11a5d5b6680d 100644 --- a/data/scripts/secret_power_tm.inc +++ b/data/scripts/secret_power_tm.inc @@ -37,26 +37,21 @@ Route111_EventScript_SecretPowerMan:: lock faceplayer msgbox Route111_Text_MakingRoomUseTMToMakeYourOwn, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq Route111_EventScript_GiveSecretPower + goto_if_eq VAR_RESULT, YES, Route111_EventScript_GiveSecretPower msgbox Route111_Text_DontWantThis, MSGBOX_DEFAULT release end Route111_EventScript_GiveSecretPower:: giveitem ITEM_TM43 - compare VAR_RESULT, FALSE - goto_if_eq Route111_EventScript_NoRoomForSecretPower + goto_if_eq VAR_RESULT, FALSE, Route111_EventScript_NoRoomForSecretPower msgbox Route111_Text_ExplainSecretPower, MSGBOX_DEFAULT closemessage setflag FLAG_RECEIVED_SECRET_POWER clearflag FLAG_HIDE_SLATEPORT_CITY_TM_SALESMAN - compare VAR_FACING, DIR_WEST - call_if_eq Route111_EventScript_SecretPowerManExit - compare VAR_FACING, DIR_EAST - call_if_eq Route111_EventScript_SecretPowerManExit - compare VAR_FACING, DIR_NORTH - call_if_eq Route111_EventScript_SecretPowerManExitNorth + call_if_eq VAR_FACING, DIR_WEST, Route111_EventScript_SecretPowerManExit + call_if_eq VAR_FACING, DIR_EAST, Route111_EventScript_SecretPowerManExit + call_if_eq VAR_FACING, DIR_NORTH, Route111_EventScript_SecretPowerManExitNorth removeobject VAR_LAST_TALKED release end diff --git a/data/scripts/shared_secret_base.inc b/data/scripts/shared_secret_base.inc index ef389d3fce3d..576e9392114b 100644 --- a/data/scripts/shared_secret_base.inc +++ b/data/scripts/shared_secret_base.inc @@ -1,224 +1,215 @@ SecretBase_MapScripts:: - map_script MAP_SCRIPT_ON_WARP_INTO_MAP_TABLE, SecretBase_OnWarp - map_script MAP_SCRIPT_ON_TRANSITION, SecretBase_OnTransition - map_script MAP_SCRIPT_ON_FRAME_TABLE, SecretBase_OnFrame - map_script MAP_SCRIPT_ON_RESUME, SecretBase_OnResume - .byte 0 + map_script MAP_SCRIPT_ON_WARP_INTO_MAP_TABLE, SecretBase_OnWarp + map_script MAP_SCRIPT_ON_TRANSITION, SecretBase_OnTransition + map_script MAP_SCRIPT_ON_FRAME_TABLE, SecretBase_OnFrame + map_script MAP_SCRIPT_ON_RESUME, SecretBase_OnResume + .byte 0 SecretBase_OnWarp: - map_script_2 VAR_SECRET_BASE_INITIALIZED, 0, SecretBase_EventScript_InitDecorations - .2byte 0 + map_script_2 VAR_SECRET_BASE_INITIALIZED, 0, SecretBase_EventScript_InitDecorations + .2byte 0 SecretBase_OnTransition: - call SecretBase_EventScript_SetDecorationFlags - special SetSecretBaseOwnerGfxId - special InitSecretBaseVars - end + call SecretBase_EventScript_SetDecorationFlags + special SetSecretBaseOwnerGfxId + special InitSecretBaseVars + end SecretBase_OnFrame: - map_script_2 VAR_INIT_SECRET_BASE, 0, SecretBase_EventScript_FirstEntrance - .2byte 0 + map_script_2 VAR_INIT_SECRET_BASE, 0, SecretBase_EventScript_FirstEntrance + .2byte 0 SecretBase_OnResume: - setstepcallback STEP_CB_SECRET_BASE - end + setstepcallback STEP_CB_SECRET_BASE + end SecretBase_EventScript_PC:: - lockall - playse SE_PC_LOGIN - message SecretBase_Text_BootUpPC - dofieldeffect FLDEFF_PCTURN_ON - waitstate - waitmessage - waitbuttonpress - playse SE_SELECT - goto SecretBase_EventScript_PCShowMainMenu - end + lockall + playse SE_PC_LOGIN + message SecretBase_Text_BootUpPC + dofieldeffect FLDEFF_PCTURN_ON + waitstate + waitmessage + waitbuttonpress + playse SE_SELECT + goto SecretBase_EventScript_PCShowMainMenu + end SecretBase_EventScript_PCShowMainMenu:: - message SecretBase_Text_WhatWouldYouLikeToDo - waitmessage - goto_if_set FLAG_SECRET_BASE_REGISTRY_ENABLED, SecretBase_EventScript_PCMainMenuWithRegister - goto SecretBase_EventScript_PCMainMenuWithoutRegister - end + message SecretBase_Text_WhatWouldYouLikeToDo + waitmessage + goto_if_set FLAG_SECRET_BASE_REGISTRY_ENABLED, SecretBase_EventScript_PCMainMenuWithRegister + goto SecretBase_EventScript_PCMainMenuWithoutRegister + end SecretBase_EventScript_PCCancel:: - lockall - goto SecretBase_EventScript_PCShowMainMenu - end + lockall + goto SecretBase_EventScript_PCShowMainMenu + end SecretBase_EventScript_PCMainMenuWithRegister:: - multichoice 0, 0, MULTI_BASE_PC_WITH_REGISTRY, FALSE - switch VAR_RESULT - case 0, SecretBase_EventScript_PCDecorationMenu - case 1, SecretBase_EventScript_PCPackUp - case 2, SecretBase_EventScript_PCRegistryMenu - case 3, SecretBase_EventScript_PCTurnOff - case MULTI_B_PRESSED, SecretBase_EventScript_PCTurnOff - end + multichoice 0, 0, MULTI_BASE_PC_WITH_REGISTRY, FALSE + switch VAR_RESULT + case 0, SecretBase_EventScript_PCDecorationMenu + case 1, SecretBase_EventScript_PCPackUp + case 2, SecretBase_EventScript_PCRegistryMenu + case 3, SecretBase_EventScript_PCTurnOff + case MULTI_B_PRESSED, SecretBase_EventScript_PCTurnOff + end SecretBase_EventScript_PCMainMenuWithoutRegister:: - multichoice 0, 0, MULTI_BASE_PC_NO_REGISTRY, FALSE - switch VAR_RESULT - case 0, SecretBase_EventScript_PCDecorationMenu - case 1, SecretBase_EventScript_PCPackUp - case 2, SecretBase_EventScript_PCTurnOff - case MULTI_B_PRESSED, SecretBase_EventScript_PCTurnOff - end + multichoice 0, 0, MULTI_BASE_PC_NO_REGISTRY, FALSE + switch VAR_RESULT + case 0, SecretBase_EventScript_PCDecorationMenu + case 1, SecretBase_EventScript_PCPackUp + case 2, SecretBase_EventScript_PCTurnOff + case MULTI_B_PRESSED, SecretBase_EventScript_PCTurnOff + end SecretBase_EventScript_PCPackUp:: - msgbox SecretBase_Text_AllDecorationsWillBeReturned, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq SecretBase_EventScript_PCShowMainMenu - closemessage - special MoveOutOfSecretBase - releaseall - end + msgbox SecretBase_Text_AllDecorationsWillBeReturned, MSGBOX_YESNO + goto_if_eq VAR_RESULT, NO, SecretBase_EventScript_PCShowMainMenu + closemessage + special MoveOutOfSecretBase + releaseall + end SecretBase_EventScript_PCDecorationMenu:: - special ShowSecretBaseDecorationMenu - end + special ShowSecretBaseDecorationMenu + end SecretBase_EventScript_PCRegistryMenu:: - special ShowSecretBaseRegistryMenu - end + special ShowSecretBaseRegistryMenu + end SecretBase_EventScript_RecordMixingPC:: - lockall - message SecretBase_Text_BootUpPC - playse SE_PC_LOGIN - dofieldeffect FLDEFF_PCTURN_ON - waitstate - waitmessage - waitbuttonpress - playse SE_SELECT - goto SecretBase_EventScript_PCRegisterMenu - end + lockall + message SecretBase_Text_BootUpPC + playse SE_PC_LOGIN + dofieldeffect FLDEFF_PCTURN_ON + waitstate + waitmessage + waitbuttonpress + playse SE_SELECT + goto SecretBase_EventScript_PCRegisterMenu + end SecretBase_EventScript_PCRegisterMenu:: - message SecretBase_Text_WhatWouldYouLikeToDo - waitmessage - multichoice 0, 0, MULTI_REGISTER_MENU, FALSE - switch VAR_RESULT - case 0, SecretBase_EventScript_PCRegister - case 1, SecretBase_EventScript_PCRegistryMenu - case 2, SecretBase_EventScript_PCRegistryInfo - case 3, SecretBase_EventScript_PCTurnOff - case MULTI_B_PRESSED, SecretBase_EventScript_PCTurnOff - end + message SecretBase_Text_WhatWouldYouLikeToDo + waitmessage + multichoice 0, 0, MULTI_REGISTER_MENU, FALSE + switch VAR_RESULT + case 0, SecretBase_EventScript_PCRegister + case 1, SecretBase_EventScript_PCRegistryMenu + case 2, SecretBase_EventScript_PCRegistryInfo + case 3, SecretBase_EventScript_PCTurnOff + case MULTI_B_PRESSED, SecretBase_EventScript_PCTurnOff + end SecretBase_EventScript_ShowRegisterMenu:: - lockall - goto SecretBase_EventScript_PCRegisterMenu - end + lockall + goto SecretBase_EventScript_PCRegisterMenu + end SecretBase_EventScript_PCRegister:: - special GetCurSecretBaseRegistrationValidity - compare VAR_RESULT, 1 - goto_if_eq SecretBase_EventScript_AlreadyRegistered - compare VAR_RESULT, 2 - goto_if_eq SecretBase_EventScript_CantRegisterTooManyBases - special CopyCurSecretBaseOwnerName_StrVar1 - msgbox SecretBase_Text_WantToRegisterSecretBase, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq SecretBase_EventScript_PCRegisterMenu - msgbox SecretBase_Text_RegistrationCompleted, MSGBOX_SIGN - special ToggleCurSecretBaseRegistry - special DoSecretBasePCTurnOffEffect - releaseall - end + special GetCurSecretBaseRegistrationValidity + goto_if_eq VAR_RESULT, 1, SecretBase_EventScript_AlreadyRegistered + goto_if_eq VAR_RESULT, 2, SecretBase_EventScript_CantRegisterTooManyBases + special CopyCurSecretBaseOwnerName_StrVar1 + msgbox SecretBase_Text_WantToRegisterSecretBase, MSGBOX_YESNO + goto_if_eq VAR_RESULT, NO, SecretBase_EventScript_PCRegisterMenu + msgbox SecretBase_Text_RegistrationCompleted, MSGBOX_SIGN + special ToggleCurSecretBaseRegistry + special DoSecretBasePCTurnOffEffect + releaseall + end SecretBase_EventScript_AlreadyRegistered:: - msgbox SecretBase_Text_AlreadyRegisteredDelete, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq SecretBase_EventScript_PCRegisterMenu - msgbox SecretBase_Text_DataUnregistered, MSGBOX_SIGN - special ToggleCurSecretBaseRegistry - special DoSecretBasePCTurnOffEffect - releaseall - end + msgbox SecretBase_Text_AlreadyRegisteredDelete, MSGBOX_YESNO + goto_if_eq VAR_RESULT, NO, SecretBase_EventScript_PCRegisterMenu + msgbox SecretBase_Text_DataUnregistered, MSGBOX_SIGN + special ToggleCurSecretBaseRegistry + special DoSecretBasePCTurnOffEffect + releaseall + end SecretBase_EventScript_CantRegisterTooManyBases:: - msgbox SecretBase_Text_TooManyBasesDeleteSome, MSGBOX_SIGN - special DoSecretBasePCTurnOffEffect - closemessage - releaseall - end + msgbox SecretBase_Text_TooManyBasesDeleteSome, MSGBOX_SIGN + special DoSecretBasePCTurnOffEffect + closemessage + releaseall + end SecretBase_EventScript_PCRegistryInfo:: - msgbox SecretBase_Text_RegistryInfo, MSGBOX_DEFAULT - goto SecretBase_EventScript_PCRegisterMenu - end + msgbox SecretBase_Text_RegistryInfo, MSGBOX_DEFAULT + goto SecretBase_EventScript_PCRegisterMenu + end SecretBase_EventScript_PCTurnOff:: - special DoSecretBasePCTurnOffEffect - closemessage - releaseall - end + special DoSecretBasePCTurnOffEffect + closemessage + releaseall + end @ Unused SecretBase_EventScript_Poster:: - special CheckInteractedWithFriendsPosterDecor - end + special CheckInteractedWithFriendsPosterDecor + end @ Unused SecretBase_EventScript_FurnitureBottom:: - special CheckInteractedWithFriendsFurnitureBottom - end + special CheckInteractedWithFriendsFurnitureBottom + end @ Unused SecretBase_EventScript_FurnitureMiddle:: - special CheckInteractedWithFriendsFurnitureMiddle - end + special CheckInteractedWithFriendsFurnitureMiddle + end @ Unused SecretBase_EventScript_FurnitureTop:: - special CheckInteractedWithFriendsFurnitureTop - end + special CheckInteractedWithFriendsFurnitureTop + end SecretBase_EventScript_SandOrnament:: - special CheckInteractedWithFriendsSandOrnament - dofieldeffect FLDEFF_SAND_PILLAR - waitstate - end + special CheckInteractedWithFriendsSandOrnament + dofieldeffect FLDEFF_SAND_PILLAR + waitstate + end SecretBase_EventScript_ShieldOrToyTV:: - special InteractWithShieldOrTVDecoration - compare VAR_RESULT, 0 - goto_if_eq SecretBase_EventScript_BattleTowerShield - compare VAR_RESULT, 1 - goto_if_eq SecretBase_EventScript_ToyTV - compare VAR_RESULT, 2 - goto_if_eq SecretBase_EventScript_SeedotTV - compare VAR_RESULT, 3 - goto_if_eq SecretBase_EventScript_SkittyTV - end + special InteractWithShieldOrTVDecoration + goto_if_eq VAR_RESULT, 0, SecretBase_EventScript_BattleTowerShield + goto_if_eq VAR_RESULT, 1, SecretBase_EventScript_ToyTV + goto_if_eq VAR_RESULT, 2, SecretBase_EventScript_SeedotTV + goto_if_eq VAR_RESULT, 3, SecretBase_EventScript_SkittyTV + end SecretBase_EventScript_BattleTowerShield:: - msgbox SecretBase_Text_BattleTowerShield, MSGBOX_SIGN - end + msgbox SecretBase_Text_BattleTowerShield, MSGBOX_SIGN + end SecretBase_EventScript_ToyTV:: - msgbox SecretBase_Text_ToyTV, MSGBOX_SIGN - end + msgbox SecretBase_Text_ToyTV, MSGBOX_SIGN + end SecretBase_EventScript_SeedotTV:: - msgbox SecretBase_Text_SeedotTV, MSGBOX_SIGN - end + msgbox SecretBase_Text_SeedotTV, MSGBOX_SIGN + end SecretBase_EventScript_SkittyTV:: - msgbox SecretBase_Text_SkittyTV, MSGBOX_SIGN - end + msgbox SecretBase_Text_SkittyTV, MSGBOX_SIGN + end SecretBase_Text_SmallIndentInWall:: - .string "There's a small indent in the wall.$" + .string "There's a small indent in the wall.$" SecretBase_Text_IndentUseSecretPower:: - .string "There's a small indent in the wall.\p" - .string "Use the SECRET POWER?$" + .string "There's a small indent in the wall.\p" + .string "Use the SECRET POWER?$" SecretBase_Text_DiscoveredSmallCavern:: - .string "Discovered a small cavern!$" + .string "Discovered a small cavern!$" SecretBase_Text_WantToMakeYourSecretBaseHere: - .string "Want to make your SECRET BASE here?$" + .string "Want to make your SECRET BASE here?$" diff --git a/data/scripts/std_msgbox.inc b/data/scripts/std_msgbox.inc index 941cc0e96176..c46da56cbf6f 100644 --- a/data/scripts/std_msgbox.inc +++ b/data/scripts/std_msgbox.inc @@ -1,7 +1,7 @@ Std_MsgboxNPC: lock faceplayer - message 0x0 + message NULL waitmessage waitbuttonpress release @@ -9,33 +9,34 @@ Std_MsgboxNPC: Std_MsgboxSign: lockall - message 0x0 + message NULL waitmessage waitbuttonpress releaseall return Std_MsgboxDefault: - message 0x0 + message NULL waitmessage waitbuttonpress return Std_MsgboxYesNo: - message 0x0 + message NULL waitmessage yesnobox 20, 8 return Std_MsgboxGetPoints: - message 0x0 + message NULL playfanfare MUS_OBTAIN_B_POINTS waitfanfare waitmessage return -Std_10: - pokenavcall 0x0 +@ Never used, pokenavcall is always used directly instead +Std_MsgboxPokenav: + pokenavcall NULL waitmessage return diff --git a/data/scripts/surf.inc b/data/scripts/surf.inc index 91580422e1cb..edb116f991ed 100644 --- a/data/scripts/surf.inc +++ b/data/scripts/surf.inc @@ -1,13 +1,11 @@ EventScript_UseSurf:: checkpartymove MOVE_SURF - compare VAR_RESULT, PARTY_SIZE - goto_if_eq EventScript_EndUseSurf - bufferpartymonnick 0, VAR_RESULT + goto_if_eq VAR_RESULT, PARTY_SIZE, EventScript_EndUseSurf + bufferpartymonnick STR_VAR_1, VAR_RESULT setfieldeffectargument 0, VAR_RESULT lockall msgbox gText_WantToUseSurf, MSGBOX_YESNO - compare VAR_RESULT, NO - goto_if_eq EventScript_ReleaseUseSurf + goto_if_eq VAR_RESULT, NO, EventScript_ReleaseUseSurf msgbox gText_PlayerUsedSurf, MSGBOX_DEFAULT dofieldeffect FLDEFF_USE_SURF EventScript_ReleaseUseSurf:: diff --git a/data/scripts/trainer_battle.inc b/data/scripts/trainer_battle.inc index a59b58a6f7f1..bbbcaf3ba3e2 100644 --- a/data/scripts/trainer_battle.inc +++ b/data/scripts/trainer_battle.inc @@ -13,8 +13,7 @@ EventScript_TryDoNormalTrainerBattle:: applymovement VAR_LAST_TALKED, Movement_RevealTrainer waitmovement 0 specialvar VAR_RESULT, GetTrainerFlag - compare VAR_RESULT, FALSE - goto_if_ne EventScript_NoNormalTrainerBattle + goto_if_ne VAR_RESULT, FALSE, EventScript_NoNormalTrainerBattle special PlayTrainerEncounterMusic special SetTrainerFacingDirection goto EventScript_ShowTrainerIntroMsg @@ -27,11 +26,9 @@ EventScript_TryDoDoubleTrainerBattle:: faceplayer call EventScript_RevealTrainer specialvar VAR_RESULT, GetTrainerFlag - compare VAR_RESULT, FALSE - goto_if_ne EventScript_NoDoubleTrainerBattle + goto_if_ne VAR_RESULT, FALSE, EventScript_NoDoubleTrainerBattle special HasEnoughMonsForDoubleBattle - compare VAR_RESULT, PLAYER_HAS_TWO_USABLE_MONS - goto_if_ne EventScript_NotEnoughMonsForDoubleBattle + goto_if_ne VAR_RESULT, PLAYER_HAS_TWO_USABLE_MONS, EventScript_NotEnoughMonsForDoubleBattle special PlayTrainerEncounterMusic special SetTrainerFacingDirection goto EventScript_ShowTrainerIntroMsg @@ -50,14 +47,13 @@ EventScript_DoNoIntroTrainerBattle:: applymovement VAR_LAST_TALKED, Movement_RevealTrainer waitmovement 0 special PlayTrainerEncounterMusic - trainerbattlebegin + dotrainerbattle gotopostbattlescript EventScript_TryDoRematchBattle:: call EventScript_RevealTrainer specialvar VAR_RESULT, IsTrainerReadyForRematch - compare VAR_RESULT, FALSE - goto_if_eq EventScript_NoRematchTrainerBattle + goto_if_eq VAR_RESULT, FALSE, EventScript_NoRematchTrainerBattle special PlayTrainerEncounterMusic special SetTrainerFacingDirection special ShowTrainerIntroSpeech @@ -73,11 +69,9 @@ EventScript_NoRematchTrainerBattle:: EventScript_TryDoDoubleRematchBattle:: specialvar VAR_RESULT, IsTrainerReadyForRematch - compare VAR_RESULT, FALSE - goto_if_eq EventScript_NoDoubleRematchTrainerBattle + goto_if_eq VAR_RESULT, FALSE, EventScript_NoDoubleRematchTrainerBattle special HasEnoughMonsForDoubleBattle - compare VAR_RESULT, PLAYER_HAS_TWO_USABLE_MONS - goto_if_ne EventScript_NotEnoughMonsForDoubleRematchBattle + goto_if_ne VAR_RESULT, PLAYER_HAS_TWO_USABLE_MONS, EventScript_NotEnoughMonsForDoubleRematchBattle special PlayTrainerEncounterMusic special SetTrainerFacingDirection special ShowTrainerIntroSpeech @@ -112,31 +106,25 @@ EventScript_ShowTrainerIntroMsg:: waitmessage waitbuttonpress special TryPrepareSecondApproachingTrainer - compare VAR_RESULT, TRUE - goto_if_eq EventScript_TrainerApproach + goto_if_eq VAR_RESULT, TRUE, EventScript_TrainerApproach goto EventScript_DoTrainerBattle EventScript_DoTrainerBattle:: - trainerbattlebegin + dotrainerbattle @ Below battle mode check only needed in FRLG specialvar VAR_RESULT, GetTrainerBattleMode - compare VAR_RESULT, TRAINER_BATTLE_SINGLE - goto_if_eq EventScript_EndTrainerBattle - compare VAR_RESULT, TRAINER_BATTLE_CONTINUE_SCRIPT - goto_if_eq EventScript_EndTrainerBattle - compare VAR_RESULT, TRAINER_BATTLE_CONTINUE_SCRIPT_NO_MUSIC - goto_if_eq EventScript_EndTrainerBattle - compare VAR_RESULT, TRAINER_BATTLE_CONTINUE_SCRIPT_DOUBLE - goto_if_eq EventScript_EndTrainerBattle - compare VAR_RESULT, TRAINER_BATTLE_CONTINUE_SCRIPT_DOUBLE_NO_MUSIC - goto_if_eq EventScript_EndTrainerBattle + goto_if_eq VAR_RESULT, TRAINER_BATTLE_SINGLE, EventScript_EndTrainerBattle + goto_if_eq VAR_RESULT, TRAINER_BATTLE_CONTINUE_SCRIPT, EventScript_EndTrainerBattle + goto_if_eq VAR_RESULT, TRAINER_BATTLE_CONTINUE_SCRIPT_NO_MUSIC, EventScript_EndTrainerBattle + goto_if_eq VAR_RESULT, TRAINER_BATTLE_CONTINUE_SCRIPT_DOUBLE, EventScript_EndTrainerBattle + goto_if_eq VAR_RESULT, TRAINER_BATTLE_CONTINUE_SCRIPT_DOUBLE_NO_MUSIC, EventScript_EndTrainerBattle EventScript_EndTrainerBattle:: gotobeatenscript releaseall end Std_MsgboxAutoclose:: - message 0x0 + message NULL waitmessage waitbuttonpress release diff --git a/data/scripts/trainer_hill.inc b/data/scripts/trainer_hill.inc index f3ba5f035a2f..b7f815351449 100644 --- a/data/scripts/trainer_hill.inc +++ b/data/scripts/trainer_hill.inc @@ -2,12 +2,9 @@ TrainerHill_OnResume: setvar VAR_TEMP_2, 0 trainerhill_resumetimer frontier_get FRONTIER_DATA_BATTLE_OUTCOME - compare VAR_RESULT, B_OUTCOME_LOST - goto_if_eq TrainerHill_1F_EventScript_Lost - compare VAR_RESULT, B_OUTCOME_DREW - goto_if_eq TrainerHill_1F_EventScript_Lost - compare VAR_RESULT, B_OUTCOME_FORFEITED - goto_if_eq TrainerHill_1F_EventScript_Lost + goto_if_eq VAR_RESULT, B_OUTCOME_LOST, TrainerHill_1F_EventScript_Lost + goto_if_eq VAR_RESULT, B_OUTCOME_DREW, TrainerHill_1F_EventScript_Lost + goto_if_eq VAR_RESULT, B_OUTCOME_FORFEITED, TrainerHill_1F_EventScript_Lost end TrainerHill_OnWarp: @@ -35,13 +32,12 @@ EventScript_TrainerHillTimer:: TrainerHill_1F_EventScript_DummyWarpToEntranceCounter:: setvar VAR_TEMP_2, 1 trainerhill_getusingereader - compare VAR_RESULT, TRUE @ VAR_RESULT always FALSE here - goto_if_eq TrainerHill_1F_EventScript_WarpSilentToEntranceCounter + goto_if_eq VAR_RESULT, TRUE, TrainerHill_1F_EventScript_WarpSilentToEntranceCounter @ VAR_RESULT always FALSE here end @ Never reached TrainerHill_1F_EventScript_WarpSilentToEntranceCounter:: - warpsilent MAP_TRAINER_HILL_ENTRANCE, 255, 9, 6 + warpsilent MAP_TRAINER_HILL_ENTRANCE, 9, 6 waitstate end @@ -53,7 +49,7 @@ TrainerHill_1F_EventScript_Lost:: TrainerHill_EventScript_WarpToEntranceCounter:: setvar VAR_TEMP_1, 0 - warp MAP_TRAINER_HILL_ENTRANCE, 255, 9, 6 + warp MAP_TRAINER_HILL_ENTRANCE, 9, 6 waitstate end diff --git a/data/scripts/trainer_script.inc b/data/scripts/trainer_script.inc index 2a2384c667f6..c0998aef8e34 100644 --- a/data/scripts/trainer_script.inc +++ b/data/scripts/trainer_script.inc @@ -1,6 +1,6 @@ Std_RegisteredInMatchCall:: - buffertrainerclassname 0, VAR_0x8000 - buffertrainername 1, VAR_0x8000 + buffertrainerclassname STR_VAR_1, VAR_0x8000 + buffertrainername STR_VAR_2, VAR_0x8000 closemessage delay 30 playfanfare MUS_REGISTER_MATCH_CALL @@ -12,8 +12,7 @@ Std_RegisteredInMatchCall:: EventScript_TryGetTrainerScript:: special ShouldTryGetTrainerScript - compare VAR_RESULT, 1 - goto_if_eq EventScript_GotoTrainerScript + goto_if_eq VAR_RESULT, TRUE, EventScript_GotoTrainerScript releaseall end diff --git a/data/scripts/tv.inc b/data/scripts/tv.inc index 14f3ade48d76..a5a093226f0b 100644 --- a/data/scripts/tv.inc +++ b/data/scripts/tv.inc @@ -3,29 +3,23 @@ EventScript_TV:: incrementgamestat GAME_STAT_WATCHED_TV special ResetTVShowState specialvar VAR_RESULT, CheckForPlayersHouseNews - compare VAR_RESULT, PLAYERS_HOUSE_TV_MOVIE - goto_if_eq EventScript_PlayersHouseMovie - compare VAR_RESULT, PLAYERS_HOUSE_TV_LATI - goto_if_eq EventScript_PlayersHouseLatiNewsFlash + goto_if_eq VAR_RESULT, PLAYERS_HOUSE_TV_MOVIE, EventScript_PlayersHouseMovie + goto_if_eq VAR_RESULT, PLAYERS_HOUSE_TV_LATI, EventScript_PlayersHouseLatiNewsFlash goto_if_unset FLAG_SYS_TV_START, EventScript_MomDadMightLikeThis1 goto_if_set FLAG_SYS_TV_WATCH, EventScript_MomDadMightLikeThis1 specialvar VAR_RESULT, IsGabbyAndTyShowOnTheAir - compare VAR_RESULT, TRUE - goto_if_eq EventScript_DoInSearchOfTrainers + goto_if_eq VAR_RESULT, TRUE, EventScript_DoInSearchOfTrainers goto EventScript_TryDoPokeNews end EventScript_TryDoTVShow:: specialvar VAR_0x8004, GetRandomActiveShowIdx - compare VAR_0x8004, 255 - goto_if_eq EventScript_MomDadMightLikeThis2 + goto_if_eq VAR_0x8004, 255, EventScript_MomDadMightLikeThis2 specialvar VAR_RESULT, GetNextActiveShowIfMassOutbreak - compare VAR_RESULT, 255 - goto_if_eq EventScript_MomDadMightLikeThis2 + goto_if_eq VAR_RESULT, 255, EventScript_MomDadMightLikeThis2 copyvar VAR_0x8004, VAR_RESULT specialvar VAR_RESULT, GetSelectedTVShow - compare VAR_RESULT, 0 - goto_if_ne EventScript_DoTVShow + goto_if_ne VAR_RESULT, 0, EventScript_DoTVShow end EventScript_MomDadMightLikeThis1:: @@ -52,12 +46,13 @@ EventScript_PlayersHouseLatiNewsFlash:: releaseall end +@ The following is a loop for the TV show messages +@ VAR_RESULT is set to TRUE when the show has printed its final message EventScript_DoTVShow:: special DoTVShow waitmessage waitbuttonpress - compare VAR_RESULT, 1 - goto_if_ne EventScript_DoTVShow + goto_if_ne VAR_RESULT, TRUE, EventScript_DoTVShow goto EventScript_TurnOffTV end @@ -75,8 +70,7 @@ EventScript_MomDadMightLikeThis2:: EventScript_TryDoPokeNews:: special DoPokeNews - compare VAR_RESULT, FALSE - goto_if_eq EventScript_TryDoTVShow + goto_if_eq VAR_RESULT, FALSE, EventScript_TryDoTVShow waitmessage waitbuttonpress goto EventScript_TurnOffTV @@ -86,7 +80,6 @@ EventScript_DoInSearchOfTrainers:: special DoTVShowInSearchOfTrainers waitmessage waitbuttonpress - compare VAR_RESULT, 0 - goto_if_eq EventScript_DoInSearchOfTrainers + goto_if_eq VAR_RESULT, 0, EventScript_DoInSearchOfTrainers goto EventScript_TurnOffTV end diff --git a/gflib/sprite.h b/gflib/sprite.h index 595ecd7dbd9a..e53737981b2d 100644 --- a/gflib/sprite.h +++ b/gflib/sprite.h @@ -281,7 +281,6 @@ void FreeSpriteTiles(struct Sprite *sprite); void FreeSpritePalette(struct Sprite *sprite); void FreeSpriteOamMatrix(struct Sprite *sprite); void DestroySpriteAndFreeResources(struct Sprite *sprite); -void sub_800142C(u32 a1, u32 a2, u16 *a3, u16 a4, u32 a5); void AnimateSprite(struct Sprite *sprite); void SetSpriteMatrixAnchor(struct Sprite* sprite, s16 x, s16 y); void StartSpriteAnim(struct Sprite *sprite, u8 animNum); diff --git a/gflib/string_util.c b/gflib/string_util.c index 9463b4a7b467..bc6f976c7131 100644 --- a/gflib/string_util.c +++ b/gflib/string_util.c @@ -25,10 +25,10 @@ static const s32 sPowersOfTen[] = 1000000000, }; -u8 *StringCopy10(u8 *dest, const u8 *src) +u8 *StringCopy_Nickname(u8 *dest, const u8 *src) { u8 i; - u32 limit = 10; + u32 limit = POKEMON_NAME_LENGTH; for (i = 0; i < limit; i++) { @@ -42,10 +42,10 @@ u8 *StringCopy10(u8 *dest, const u8 *src) return &dest[i]; } -u8 *StringGetEnd10(u8 *str) +u8 *StringGet_Nickname(u8 *str) { u8 i; - u32 limit = 10; + u32 limit = POKEMON_NAME_LENGTH; for (i = 0; i < limit; i++) if (str[i] == EOS) @@ -55,10 +55,10 @@ u8 *StringGetEnd10(u8 *str) return &str[i]; } -u8 *StringCopy7(u8 *dest, const u8 *src) +u8 *StringCopy_PlayerName(u8 *dest, const u8 *src) { s32 i; - s32 limit = 7; + s32 limit = PLAYER_NAME_LENGTH; for (i = 0; i < limit; i++) { diff --git a/gflib/string_util.h b/gflib/string_util.h index 7f3b64add81c..0a8a99fb98d3 100644 --- a/gflib/string_util.h +++ b/gflib/string_util.h @@ -13,9 +13,9 @@ enum StringConvertMode STR_CONV_MODE_LEADING_ZEROS }; -u8 *StringCopy10(u8 *dest, const u8 *src); -u8 *StringGetEnd10(u8 *str); -u8 *StringCopy7(u8 *dest, const u8 *src); +u8 *StringCopy_Nickname(u8 *dest, const u8 *src); +u8 *StringGet_Nickname(u8 *str); +u8 *StringCopy_PlayerName(u8 *dest, const u8 *src); u8 *StringCopy(u8 *dest, const u8 *src); u8 *StringAppend(u8 *dest, const u8 *src); u8 *StringCopyN(u8 *dest, const u8 *src, u8 n); diff --git a/include/battle_anim.h b/include/battle_anim.h index 8745b0d26434..d8b2cd4dbcfe 100644 --- a/include/battle_anim.h +++ b/include/battle_anim.h @@ -112,7 +112,6 @@ void GetBattleAnimBg1Data(struct BattleAnimBgData*); void GetBattleAnimBgData(struct BattleAnimBgData*, u32 arg1); u8 GetBattlerSpriteSubpriority(u8 battlerId); bool8 TranslateAnimHorizontalArc(struct Sprite *sprite); -void sub_80A6630(struct Sprite *sprite); void TranslateSpriteLinearByIdFixedPoint(struct Sprite *sprite); void ResetSpriteRotScale(u8 spriteId); void SetSpriteRotScale(u8 spriteId, s16 xScale, s16 yScale, u16 rotation); @@ -129,7 +128,6 @@ void AnimLoadCompressedBgTilemapHandleContest(struct BattleAnimBgData*, const vo void AnimLoadCompressedBgGfx(u32, const u32*, u32); void UpdateAnimBg3ScreenSize(bool8); void TranslateSpriteInGrowingCircle(struct Sprite *); -void sub_80A653C(struct Sprite *); void SetBattlerSpriteYOffsetFromYScale(u8 spriteId); void PrepareEruptAnimTaskData(struct Task *task, u8 a2, s16 a3, s16 a4, s16 a5, s16 a6, u16 a7); u8 UpdateEruptAnimTask(struct Task *task); diff --git a/include/constants/event_objects.h b/include/constants/event_objects.h index 1958c792e16a..6b99f19bd4ee 100644 --- a/include/constants/event_objects.h +++ b/include/constants/event_objects.h @@ -311,5 +311,6 @@ #define LOCALID_MOSSDEEP_MART_CLERK 1 #define LOCALID_SOOTOPOLIS_MART_CLERK 1 #define LOCALID_BATTLE_FRONTIER_MART_CLERK 1 +#define LOCALID_SLATEPORT_ENERGY_GURU 25 #endif // GUARD_CONSTANTS_EVENT_OBJECTS_H diff --git a/include/constants/maps.h b/include/constants/maps.h index b849749a95ba..6524f8c14afd 100644 --- a/include/constants/maps.h +++ b/include/constants/maps.h @@ -15,4 +15,16 @@ #define MAP_GROUP_SPECIAL_MONS_1 MAP_GROUP(METEOR_FALLS_1F_1R) #define MAP_GROUP_SPECIAL_MONS_2 MAP_GROUP(SAFARI_ZONE_NORTHWEST) +// IDs for dynamic warps. Both are used in the dest_warp_id field for warp events, but they +// are never read in practice. A dest_map of MAP_NONE is used to indicate that a +// dynamic warp should be used, at which point the warp id is ignored. It can be passed to +// SetDynamicWarp/SetDynamicWarpWithCoords as the first argument, but this argument is unused. +// As only one dynamic warp is saved at a time there's no need to distinguish between them. +#define WARP_ID_SECRET_BASE 0x7E +#define WARP_ID_DYNAMIC 0x7F + +// Used to indicate an invalid warp id, for dummy warps or when a warp should +// use the given coordinates rather than the coordinates of a target warp. +#define WARP_ID_NONE (-1) + #endif // GUARD_CONSTANTS_MAPS_H diff --git a/include/constants/metatile_behaviors.h b/include/constants/metatile_behaviors.h index dde821358718..5f37713f30b6 100755 --- a/include/constants/metatile_behaviors.h +++ b/include/constants/metatile_behaviors.h @@ -117,10 +117,10 @@ #define MB_BRIDGE_OVER_POND_LOW 0x71 #define MB_BRIDGE_OVER_POND_MED 0x72 #define MB_BRIDGE_OVER_POND_HIGH 0x73 -#define MB_PACIFIDLOG_VERTICAL_LOG_1 0x74 -#define MB_PACIFIDLOG_VERTICAL_LOG_2 0x75 -#define MB_PACIFIDLOG_HORIZONTAL_LOG_1 0x76 -#define MB_PACIFIDLOG_HORIZONTAL_LOG_2 0x77 +#define MB_PACIFIDLOG_VERTICAL_LOG_TOP 0x74 +#define MB_PACIFIDLOG_VERTICAL_LOG_BOTTOM 0x75 +#define MB_PACIFIDLOG_HORIZONTAL_LOG_LEFT 0x76 +#define MB_PACIFIDLOG_HORIZONTAL_LOG_RIGHT 0x77 #define MB_FORTREE_BRIDGE 0x78 #define MB_UNUSED_79 0x79 #define MB_BRIDGE_OVER_POND_MED_EDGE_1 0x7A diff --git a/include/constants/metatile_labels.h b/include/constants/metatile_labels.h index 51912008282e..3c484e39a2c1 100644 --- a/include/constants/metatile_labels.h +++ b/include/constants/metatile_labels.h @@ -182,22 +182,22 @@ #define METATILE_Cave_ShoalCave_BlueStone_Small 0x35B // gTileset_Pacifidlog -#define METATILE_Pacifidlog_Door 0x21A -#define METATILE_Pacifidlog_FloatingLogs_Horizontal0 0x250 -#define METATILE_Pacifidlog_FloatingLogs_Horizontal1 0x251 -#define METATILE_Pacifidlog_HalfSubmergedLogs_Horizontal0 0x252 -#define METATILE_Pacifidlog_HalfSubmergedLogs_Horizontal1 0x253 -#define METATILE_Pacifidlog_SubmergedLogs_Horizontal0 0x254 -#define METATILE_Pacifidlog_SubmergedLogs_Horizontal1 0x255 -#define METATILE_Pacifidlog_FloatingLogs_Vertical0 0x258 -#define METATILE_Pacifidlog_FloatingLogs_Vertical1 0x260 -#define METATILE_Pacifidlog_HalfSubmergedLogs_Vertical0 0x259 -#define METATILE_Pacifidlog_HalfSubmergedLogs_Vertical1 0x261 -#define METATILE_Pacifidlog_SubmergedLogs_Vertical0 0x25A -#define METATILE_Pacifidlog_SubmergedLogs_Vertical1 0x262 -#define METATILE_Pacifidlog_SkyPillar_CrackedFloor_Hole 0x237 -#define METATILE_Pacifidlog_SkyPillar_DoorOpen_Top 0x2AA -#define METATILE_Pacifidlog_SkyPillar_DoorOpen_Bottom 0x2B2 +#define METATILE_Pacifidlog_Door 0x21A +#define METATILE_Pacifidlog_FloatingLogs_HorizontalLeft 0x250 +#define METATILE_Pacifidlog_FloatingLogs_HorizontalRight 0x251 +#define METATILE_Pacifidlog_HalfSubmergedLogs_HorizontalLeft 0x252 +#define METATILE_Pacifidlog_HalfSubmergedLogs_HorizontalRight 0x253 +#define METATILE_Pacifidlog_SubmergedLogs_HorizontalLeft 0x254 +#define METATILE_Pacifidlog_SubmergedLogs_HorizontalRight 0x255 +#define METATILE_Pacifidlog_FloatingLogs_VerticalTop 0x258 +#define METATILE_Pacifidlog_FloatingLogs_VerticalBottom 0x260 +#define METATILE_Pacifidlog_HalfSubmergedLogs_VerticalTop 0x259 +#define METATILE_Pacifidlog_HalfSubmergedLogs_VerticalBottom 0x261 +#define METATILE_Pacifidlog_SubmergedLogs_VerticalTop 0x25A +#define METATILE_Pacifidlog_SubmergedLogs_VerticalBottom 0x262 +#define METATILE_Pacifidlog_SkyPillar_CrackedFloor_Hole 0x237 +#define METATILE_Pacifidlog_SkyPillar_DoorOpen_Top 0x2AA +#define METATILE_Pacifidlog_SkyPillar_DoorOpen_Bottom 0x2B2 // gTileset_Fortree #define METATILE_Fortree_LongGrass_Root 0x208 diff --git a/include/constants/party_menu.h b/include/constants/party_menu.h index e31debb49be0..f95bfa90ff94 100644 --- a/include/constants/party_menu.h +++ b/include/constants/party_menu.h @@ -1,6 +1,8 @@ #ifndef GUARD_CONSTANTS_PARTY_MENU_H #define GUARD_CONSTANTS_PARTY_MENU_H +#define PARTY_NOTHING_CHOSEN 0xFF + #define AILMENT_NONE 0 #define AILMENT_PSN 1 #define AILMENT_PRZ 2 diff --git a/include/constants/slot_machine.h b/include/constants/slot_machine.h index 81848f20844a..865d7e5d0b79 100644 --- a/include/constants/slot_machine.h +++ b/include/constants/slot_machine.h @@ -3,4 +3,13 @@ #define SLOT_MACHINE_COUNT 12 +// Slot machine IDs +#define SLOT_MACHINE_UNLUCKIEST 0 +#define SLOT_MACHINE_UNLUCKIER 1 +#define SLOT_MACHINE_UNLUCKY 2 +#define SLOT_MACHINE_LUCKY 3 +#define SLOT_MACHINE_LUCKIER 4 +#define SLOT_MACHINE_LUCKIEST 5 +#define NUM_SLOT_MACHINE_IDS 6 + #endif // GUARD_CONSTANTS_SLOT_MACHINE_H diff --git a/include/constants/tv.h b/include/constants/tv.h index 3fe6c57b24e0..4c8dd4fa8389 100644 --- a/include/constants/tv.h +++ b/include/constants/tv.h @@ -8,6 +8,14 @@ #define POKENEWS_BLENDMASTER 4 #define NUM_POKENEWS_TYPES 4 // Excludes NONE +#define POKENEWS_STATE_INACTIVE 0 +#define POKENEWS_STATE_UPCOMING 1 +#define POKENEWS_STATE_ACTIVE 2 + +// Number of days to count down until the news event occurs. +// Nothing is aired on TV the first day +#define POKENEWS_COUNTDOWN 4 + // TV shows are categorized as being in one of 3 groups // - TVGROUP_NORMAL, TV shows that can appear without Record Mixing // - TVGROUP_RECORD_MIX, TV shows that can only appear via Record Mixing diff --git a/include/event_object_movement.h b/include/event_object_movement.h index 6ad4b55e4f07..bd82320271d9 100644 --- a/include/event_object_movement.h +++ b/include/event_object_movement.h @@ -96,8 +96,7 @@ void SetSpritePosToOffsetMapCoords(s16 *, s16 *, s16, s16); void ObjectEventClearHeldMovement(struct ObjectEvent *); void ObjectEventClearHeldMovementIfActive(struct ObjectEvent *); void TrySpawnObjectEvents(s16, s16); -u8 CreateObjectSprite(u8 graphicsId, u8 a1, s16 x, s16 y, u8 z, u8 direction); -u8 AddPseudoObjectEvent(u16, void (*)(struct Sprite *), s16 x, s16 y, u8 subpriority); +u8 CreateObjectGraphicsSprite(u16, void (*)(struct Sprite *), s16 x, s16 y, u8 subpriority); u8 TrySpawnObjectEvent(u8, u8, u8); u8 SpawnSpecialObjectEventParameterized(u8 graphicsId, u8 movementBehavior, u8 localId, s16 x, s16 y, u8 z); u8 SpawnSpecialObjectEvent(struct ObjectEventTemplate *); @@ -110,8 +109,8 @@ const struct ObjectEventGraphicsInfo *GetObjectEventGraphicsInfo(u8 graphicsId); void SetObjectInvisibility(u8, u8, u8, bool8); void FreeAndReserveObjectSpritePalettes(void); void SetObjectEventSpritePosByLocalIdAndMap(u8 localId, u8 mapNum, u8 mapGroup, s16 x, s16 y); -void ResetObjectPriority(u8, u8, u8); -void SetObjectPriority(u8, u8, u8, u8); +void ResetObjectSubpriority(u8, u8, u8); +void SetObjectSubpriority(u8, u8, u8, u8); void AllowObjectAtPosTriggerGroundEffects(s16, s16); void ObjectEventGetLocalIdAndMap(struct ObjectEvent *objectEvent, void *localId, void *mapNum, void *mapGroup); void ShiftObjectEventCoords(struct ObjectEvent *, s16, s16); @@ -180,7 +179,6 @@ void SetAndStartSpriteAnim(struct Sprite *, u8, u8); bool8 SpriteAnimEnded(struct Sprite *); void UnfreezeObjectEvents(void); void FreezeObjectEventsExceptOne(u8 objectEventId); -void TurnObjectEventSprite(u8, u8); void FreezeObjectEventsExceptTwo(u8 objectEventId1, u8 objectEventId2); void FreezeObjectEvents(void); bool8 FreezeObjectEvent(struct ObjectEvent *objectEvent); @@ -414,10 +412,13 @@ u8 MovementType_RunInPlace_Step0(struct ObjectEvent *, struct Sprite *); u8 MovementType_Invisible_Step0(struct ObjectEvent *, struct Sprite *); u8 MovementType_Invisible_Step1(struct ObjectEvent *, struct Sprite *); u8 MovementType_Invisible_Step2(struct ObjectEvent *, struct Sprite *); -void SetObjectEventSpriteInvisibility(u8 objectEventId, bool32 invisible); -bool32 IsObjectEventSpriteInvisible(u8 objectEventId); -void SetObjectEventSpriteGraphics(u8 objectEventId, u8 graphicsId); -void SetObjectEventSpriteAnim(u8 objectEventId, u8 animNum); -bool32 IsObjectEventSpriteAnimating(u8 objectEventId); + +u8 CreateVirtualObject(u8 graphicsId, u8 virtualObjId, s16 x, s16 y, u8 z, u8 direction); +void TurnVirtualObject(u8 virtualObjId, u8 direction); +void SetVirtualObjectGraphics(u8 virtualObjId, u8 graphicsId); +void SetVirtualObjectInvisibility(u8 virtualObjId, bool32 invisible); +bool32 IsVirtualObjectInvisible(u8 virtualObjId); +void SetVirtualObjectSpriteAnim(u8 virtualObjId, u8 animNum); +bool32 IsVirtualObjectAnimating(u8 virtualObjId); #endif //GUARD_EVENT_OBJECT_MOVEMENT_H diff --git a/include/field_control_avatar.h b/include/field_control_avatar.h index 17e5afb63e62..e02fcd5afe0c 100644 --- a/include/field_control_avatar.h +++ b/include/field_control_avatar.h @@ -25,15 +25,9 @@ struct FieldInput void FieldClearPlayerInput(struct FieldInput *pStruct); void FieldGetPlayerInput(struct FieldInput *pStruct, u16 keys, u16 heldKeys); int ProcessPlayerFieldInput(struct FieldInput *pStruct); -u8 *sub_80682A8(struct MapPosition *, u8, u8); void overworld_poison_timer_set(void); void RestartWildEncounterImmunitySteps(void); -u8 *sub_8068E24(struct MapPosition *); const u8 *GetObjectEventScriptPointerPlayerFacing(void); -bool8 sub_8068870(u16 a); -bool8 sub_8068894(void); -bool8 sub_8068A64(struct MapPosition *, u16); -u8 sub_8068F18(void); bool8 TryDoDiveWarp(struct MapPosition *position, u16 b); int SetCableClubWarp(void); u8 TrySetDiveWarp(void); diff --git a/include/field_screen_effect.h b/include/field_screen_effect.h index 4e4725041a89..6dc9b077d219 100644 --- a/include/field_screen_effect.h +++ b/include/field_screen_effect.h @@ -22,7 +22,7 @@ void FieldCB_ReturnToFieldNoScript(void); void FieldCB_ReturnToFieldNoScriptCheckMusic(void); void DoWarp(void); void DoDiveWarp(void); -void DoSootopolisLegendWarp(void); +void DoWhiteFadeWarp(void); void DoDoorWarp(void); void DoFallWarp(void); void DoEscalatorWarp(u8 metatileBehavior); @@ -33,13 +33,12 @@ void DoMossdeepGymWarp(void); void DoPortholeWarp(void); void DoCableClubWarp(void); void DoContestHallWarp(void); -void AnimateFlash(u8 flashLevel); +void AnimateFlash(u8 newFlashLevel); void WriteBattlePyramidViewScanlineEffectBuffer(void); void DoSpinEnterWarp(void); void DoSpinExitWarp(void); void DoOrbEffect(void); void FadeOutOrbEffect(void); -void sub_80B05B4(void); void WriteFlashScanlineEffectBuffer(u8 flashLevel); bool8 IsPlayerStandingStill(void); diff --git a/include/field_special_scene.h b/include/field_special_scene.h index a54b344d9b9f..3f701f41bf05 100644 --- a/include/field_special_scene.h +++ b/include/field_special_scene.h @@ -9,7 +9,6 @@ void Task_Truck3(u8 taskId); void Task_HandleTruckSequence(u8 taskId); void ExecuteTruckSequence(void); void EndTruckSequence(u8); -void sub_80C791C(void); void FieldCB_ShowPortholeView(void); #endif // GUARD_FIELD_SPECIAL_SCENE_H diff --git a/include/field_weather.h b/include/field_weather.h index 72a56ab6ec0d..1d8cfe422000 100644 --- a/include/field_weather.h +++ b/include/field_weather.h @@ -221,9 +221,9 @@ void Bubbles_Main(void); void Bubbles_InitAll(void); bool8 Bubbles_Finish(void); -u8 GetSav1Weather(void); -void SetSav1Weather(u32 weather); -void SetSav1WeatherFromCurrMapHeader(void); +u8 GetSavedWeather(void); +void SetSavedWeather(u32 weather); +void SetSavedWeatherFromCurrMapHeader(void); void SetWeather(u32 weather); void DoCurrentWeather(void); void UpdateWeatherPerDay(u16 increment); diff --git a/include/global.h b/include/global.h index 53e9ba134178..024280f98697 100644 --- a/include/global.h +++ b/include/global.h @@ -10,6 +10,7 @@ #include "constants/vars.h" #include "constants/species.h" #include "constants/berry.h" +#include "constants/maps.h" // Prevent cross-jump optimization. #define BLOCK_CROSS_JUMP asm(""); @@ -971,10 +972,10 @@ struct SaveBlock1 /*0x2B92*/ u8 outbreakLocationMapNum; /*0x2B93*/ u8 outbreakLocationMapGroup; /*0x2B94*/ u8 outbreakPokemonLevel; - /*0x2B95*/ u8 outbreakUnk1; - /*0x2B96*/ u16 outbreakUnk2; + /*0x2B95*/ u8 outbreakUnused1; + /*0x2B96*/ u16 outbreakUnused2; /*0x2B98*/ u16 outbreakPokemonMoves[MAX_MON_MOVES]; - /*0x2BA0*/ u8 outbreakUnk4; + /*0x2BA0*/ u8 outbreakUnused3; /*0x2BA1*/ u8 outbreakPokemonProbability; /*0x2BA2*/ u16 outbreakDaysLeft; /*0x2BA4*/ struct GabbyAndTyData gabbyAndTyData; diff --git a/include/global.tv.h b/include/global.tv.h index 2bc7dda99816..e24ead3f21d6 100644 --- a/include/global.tv.h +++ b/include/global.tv.h @@ -61,7 +61,7 @@ typedef union // size = 0x24 /*0x0F*/ u8 filler_0F[1]; /*0x10*/ u8 nickname[PLAYER_NAME_LENGTH + 1]; /*0x18*/ u16 words18[2]; - /*0x1C*/ u16 words[4]; + /*0x1C*/ u16 words[2]; } fanclubOpinions; // TVSHOW_DUMMY @@ -334,7 +334,7 @@ typedef union // size = 0x24 /*0x00*/ u8 kind; /*0x01*/ bool8 active; /*0x02*/ u8 avgLevel; - /*0x03*/ u8 nDecorations; + /*0x03*/ u8 numDecorations; /*0x04*/ u8 decorations[4]; /*0x08*/ u16 species; /*0x0a*/ u16 move; @@ -437,8 +437,8 @@ typedef union // size = 0x24 struct { /*0x00*/ u8 kind; /*0x01*/ bool8 active; - /*0x02*/ u8 nMonsCaught; - /*0x03*/ u8 nPkblkUsed; + /*0x02*/ u8 monsCaught; + /*0x03*/ u8 pokeblocksUsed; /*0x04*/ u8 language; /*0x05*/ u8 filler_05[14]; /*0x13*/ u8 playerName[PLAYER_NAME_LENGTH + 1]; @@ -449,27 +449,27 @@ typedef union // size = 0x24 struct { /*0x00*/ u8 kind; /*0x01*/ bool8 active; - /*0x02*/ u8 var02; - /*0x03*/ u8 var03; + /*0x02*/ u8 unused1; + /*0x03*/ u8 unused3; /*0x04*/ u16 moves[MAX_MON_MOVES]; /*0x0C*/ u16 species; - /*0x0E*/ u16 var0E; + /*0x0E*/ u16 unused2; /*0x10*/ u8 locationMapNum; /*0x11*/ u8 locationMapGroup; - /*0x12*/ u8 var12; + /*0x12*/ u8 unused4; /*0x13*/ u8 probability; /*0x14*/ u8 level; - /*0x15*/ u8 var15; + /*0x15*/ u8 unused5; /*0x16*/ u16 daysLeft; /*0x18*/ u8 language; } massOutbreak; } TVShow; -typedef struct // 2b50 +typedef struct { u8 kind; u8 state; - u16 days; + u16 dayCountdown; } PokeNews; struct GabbyAndTyData diff --git a/include/mail.h b/include/mail.h index 8236811cbda2..68c532b31057 100644 --- a/include/mail.h +++ b/include/mail.h @@ -27,7 +27,7 @@ u16 MailSpeciesToSpecies(u16 mailSpecies, u16 *buffer); u8 GiveMailToMon(struct Pokemon *mon, struct Mail *mail); void TakeMailFromMon(struct Pokemon *mon); void ClearMailItemId(u8 mailId); -u8 TakeMailFromMon2(struct Pokemon *mon); +u8 TakeMailFromMonAndSave(struct Pokemon *mon); bool8 ItemIsMail(u16 itemId); #endif // GUARD_MAIL_H diff --git a/include/mauville_old_man.h b/include/mauville_old_man.h index 23a3cabfb45c..b22294f1bef5 100644 --- a/include/mauville_old_man.h +++ b/include/mauville_old_man.h @@ -6,9 +6,7 @@ extern struct BardSong gBardSong; void SetMauvilleOldMan(void); u8 GetCurrentMauvilleOldMan(void); void SetMauvilleOldManObjEventGfx(void); -u8 sub_81201C8(void); void SanitizeMauvilleOldManForRuby(OldMan *dest); -void sub_8120670(void); void SanitizeReceivedRubyOldMan(union OldMan * oldMan, u32 r1, u32 r6); void SanitizeReceivedEmeraldOldMan(union OldMan * oldMan, u32 unused, u32 a2); void ResetMauvilleOldManFlag(void); diff --git a/include/metatile_behavior.h b/include/metatile_behavior.h index 23c84dffb1df..5895426cf0c2 100644 --- a/include/metatile_behavior.h +++ b/include/metatile_behavior.h @@ -102,10 +102,10 @@ bool8 MetatileBehavior_IsShortGrass(u8); bool8 MetatileBehavior_IsHotSprings(u8); bool8 MetatileBehavior_IsWaterfall(u8); bool8 MetatileBehavior_IsFortreeBridge(u8); -bool8 MetatileBehavior_IsPacifidlogVerticalLog1(u8); -bool8 MetatileBehavior_IsPacifidlogVerticalLog2(u8); -bool8 MetatileBehavior_IsPacifidlogHorizontalLog1(u8); -bool8 MetatileBehavior_IsPacifidlogHorizontalLog2(u8); +bool8 MetatileBehavior_IsPacifidlogVerticalLogTop(u8); +bool8 MetatileBehavior_IsPacifidlogVerticalLogBottom(u8); +bool8 MetatileBehavior_IsPacifidlogHorizontalLogLeft(u8); +bool8 MetatileBehavior_IsPacifidlogHorizontalLogRight(u8); bool8 MetatileBehavior_IsPacifidlogLog(u8); bool8 MetatileBehavior_IsTrickHousePuzzleDoor(u8); bool8 MetatileBehavior_IsRegionMap(u8); diff --git a/include/mystery_event_script.h b/include/mystery_event_script.h index 32b9f009f658..198a07e85707 100644 --- a/include/mystery_event_script.h +++ b/include/mystery_event_script.h @@ -1,8 +1,16 @@ #ifndef GUARD_MYSTERY_EVENT_SCRIPT_H #define GUARD_MYSTERY_EVENT_SCRIPT_H +enum { + MEVENT_STATUS_LOAD_OK, + MEVENT_STATUS_LOAD_ERROR, + MEVENT_STATUS_SUCCESS, + MEVENT_STATUS_FAILURE, + MEVENT_STATUS_FF = 0xFF +}; + void InitMysteryEventScriptContext(u8 *script); -bool32 RunMysteryEventScriptContextCommand(u32 *script); +bool32 RunMysteryEventScriptContextCommand(u32 *status); u32 RunMysteryEventScript(u8 *script); void SetMysteryEventScriptStatus(u32 val); u16 GetRecordMixingGift(void); diff --git a/include/overworld.h b/include/overworld.h index e1cf100db58a..04b61f7fd740 100644 --- a/include/overworld.h +++ b/include/overworld.h @@ -67,8 +67,8 @@ void SetGameStat(u8 index, u32 value); void ApplyNewEncryptionKeyToGameStats(u32 newKey); void LoadObjEventTemplatesFromHeader(void); void LoadSaveblockObjEventScripts(void); -void Overworld_SetObjEventTemplateCoords(u8 localId, s16 x, s16 y); -void Overworld_SetObjEventTemplateMovementType(u8 localId, u8 movementType); +void SetObjEventTemplateCoords(u8 localId, s16 x, s16 y); +void SetObjEventTemplateMovementType(u8 localId, u8 movementType); const struct MapLayout *GetMapLayout(void); void ApplyCurrentWarp(void); struct MapHeader const *const Overworld_GetMapHeaderByGroupAndId(u16 mapGroup, u16 mapNum); @@ -98,8 +98,8 @@ void ResetInitialPlayerAvatarState(void); void StoreInitialPlayerAvatarState(void); bool32 Overworld_IsBikingAllowed(void); void SetDefaultFlashLevel(void); -void Overworld_SetFlashLevel(s32 flashLevel); -u8 Overworld_GetFlashLevel(void); +void SetFlashLevel(s32 flashLevel); +u8 GetFlashLevel(void); void SetCurrentMapLayout(u16 mapLayoutId); void SetObjectEventLoadFlag(u8 var); u16 GetLocationMusic(struct WarpData *warp); diff --git a/include/script_menu.h b/include/script_menu.h index 086ad147f064..a690ef8b8b58 100644 --- a/include/script_menu.h +++ b/include/script_menu.h @@ -8,7 +8,7 @@ bool8 ScriptMenu_MultichoiceWithDefault(u8 left, u8 top, u8 multichoiceId, bool8 bool8 ScriptMenu_YesNo(u8 left, u8 top); bool8 ScriptMenu_MultichoiceGrid(u8 left, u8 top, u8 multichoiceId, bool8 ignoreBPress, u8 columnCount); bool8 ScriptMenu_ShowPokemonPic(u16 species, u8 x, u8 y); -bool8 (*ScriptMenu_GetPicboxWaitFunc(void))(void); +bool8 (*ScriptMenu_HidePokemonPic(void))(void); int ConvertPixelWidthToTileWidth(int width); u8 CreateWindowFromRect(u8 x, u8 y, u8 width, u8 height); void ClearToTransparentAndRemoveWindow(u8 windowId); diff --git a/include/tv.h b/include/tv.h index 30cd13326512..31c8fcc50fb0 100644 --- a/include/tv.h +++ b/include/tv.h @@ -19,7 +19,7 @@ void HideBattleTowerReporter(void); void ReceiveTvShowsData(void *src, u32 size, u8 masterIdx); void TryPutSpotTheCutiesOnAir(struct Pokemon *pokemon, u8 ribbonMonDataIdx); u32 GetPlayerIDAsU32(void); -bool8 GetPriceReduction(u8 newsKind); +bool8 IsPokeNewsActive(u8 newsKind); void SanitizeTVShowLocationsForRuby(TVShow *shows); size_t CountDigits(int value); u8 GetRibbonCount(struct Pokemon *pokemon); diff --git a/src/apprentice.c b/src/apprentice.c index 6255b9215a5b..2ab2f0e5a1ed 100644 --- a/src/apprentice.c +++ b/src/apprentice.c @@ -127,7 +127,7 @@ void BufferApprenticeChallengeText(u8 saveApprenticeId) for (i = 0; num != 0 && i < APPRENTICE_COUNT; num /= 10, i++) ; - StringCopy7(gStringVar1, gSaveBlock2Ptr->apprentices[saveApprenticeId].playerName); + StringCopy_PlayerName(gStringVar1, gSaveBlock2Ptr->apprentices[saveApprenticeId].playerName); ConvertInternationalString(gStringVar1, gSaveBlock2Ptr->apprentices[saveApprenticeId].language); ConvertIntToDecimalStringN(gStringVar2, gSaveBlock2Ptr->apprentices[saveApprenticeId].number, STR_CONV_MODE_RIGHT_ALIGN, i); challengeText = sApprenticeChallengeTexts[gSaveBlock2Ptr->apprentices[saveApprenticeId].id]; diff --git a/src/battle_arena.c b/src/battle_arena.c index 8a993f770f9f..f744a3b2b58e 100644 --- a/src/battle_arena.c +++ b/src/battle_arena.c @@ -798,7 +798,7 @@ static void InitArenaChallenge(void) if (!isCurrent) gSaveBlock2Ptr->frontier.arenaWinStreaks[lvlMode] = 0; - SetDynamicWarp(0, gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, -1); + SetDynamicWarp(0, gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, WARP_ID_NONE); gTrainerBattleOpponent_A = 0; } diff --git a/src/battle_controller_link_opponent.c b/src/battle_controller_link_opponent.c index 2ec2e61dc03c..668dd01b42fc 100644 --- a/src/battle_controller_link_opponent.c +++ b/src/battle_controller_link_opponent.c @@ -602,7 +602,7 @@ static u32 CopyLinkOpponentMonData(u8 monId, u8 *dst) battleMon.abilityNum = GetMonData(&gEnemyParty[monId], MON_DATA_ABILITY_NUM); battleMon.otId = GetMonData(&gEnemyParty[monId], MON_DATA_OT_ID); GetMonData(&gEnemyParty[monId], MON_DATA_NICKNAME, nickname); - StringCopy10(battleMon.nickname, nickname); + StringCopy_Nickname(battleMon.nickname, nickname); GetMonData(&gEnemyParty[monId], MON_DATA_OT_NAME, battleMon.otName); src = (u8 *)&battleMon; for (size = 0; size < sizeof(battleMon); size++) diff --git a/src/battle_controller_link_partner.c b/src/battle_controller_link_partner.c index 0fa156a437f1..14d806576ae1 100644 --- a/src/battle_controller_link_partner.c +++ b/src/battle_controller_link_partner.c @@ -489,7 +489,7 @@ static u32 CopyLinkPartnerMonData(u8 monId, u8 *dst) battleMon.abilityNum = GetMonData(&gPlayerParty[monId], MON_DATA_ABILITY_NUM); battleMon.otId = GetMonData(&gPlayerParty[monId], MON_DATA_OT_ID); GetMonData(&gPlayerParty[monId], MON_DATA_NICKNAME, nickname); - StringCopy10(battleMon.nickname, nickname); + StringCopy_Nickname(battleMon.nickname, nickname); GetMonData(&gPlayerParty[monId], MON_DATA_OT_NAME, battleMon.otName); src = (u8 *)&battleMon; for (size = 0; size < sizeof(battleMon); size++) diff --git a/src/battle_controller_opponent.c b/src/battle_controller_opponent.c index 8e1a8327a00b..c3830780b353 100644 --- a/src/battle_controller_opponent.c +++ b/src/battle_controller_opponent.c @@ -602,7 +602,7 @@ static u32 GetOpponentMonData(u8 monId, u8 *dst) battleMon.abilityNum = GetMonData(&gEnemyParty[monId], MON_DATA_ABILITY_NUM); battleMon.otId = GetMonData(&gEnemyParty[monId], MON_DATA_OT_ID); GetMonData(&gEnemyParty[monId], MON_DATA_NICKNAME, nickname); - StringCopy10(battleMon.nickname, nickname); + StringCopy_Nickname(battleMon.nickname, nickname); GetMonData(&gEnemyParty[monId], MON_DATA_OT_NAME, battleMon.otName); src = (u8 *)&battleMon; for (size = 0; size < sizeof(battleMon); size++) diff --git a/src/battle_controller_player.c b/src/battle_controller_player.c index ff5591e55b33..2133d5b6f450 100644 --- a/src/battle_controller_player.c +++ b/src/battle_controller_player.c @@ -1647,7 +1647,7 @@ static u32 CopyPlayerMonData(u8 monId, u8 *dst) battleMon.abilityNum = GetMonData(&gPlayerParty[monId], MON_DATA_ABILITY_NUM); battleMon.otId = GetMonData(&gPlayerParty[monId], MON_DATA_OT_ID); GetMonData(&gPlayerParty[monId], MON_DATA_NICKNAME, nickname); - StringCopy10(battleMon.nickname, nickname); + StringCopy_Nickname(battleMon.nickname, nickname); GetMonData(&gPlayerParty[monId], MON_DATA_OT_NAME, battleMon.otName); src = (u8 *)&battleMon; for (size = 0; size < sizeof(battleMon); size++) diff --git a/src/battle_controller_player_partner.c b/src/battle_controller_player_partner.c index 2c9098271393..c2ff08a239a7 100644 --- a/src/battle_controller_player_partner.c +++ b/src/battle_controller_player_partner.c @@ -673,7 +673,7 @@ static u32 CopyPlayerPartnerMonData(u8 monId, u8 *dst) battleMon.abilityNum = GetMonData(&gPlayerParty[monId], MON_DATA_ABILITY_NUM); battleMon.otId = GetMonData(&gPlayerParty[monId], MON_DATA_OT_ID); GetMonData(&gPlayerParty[monId], MON_DATA_NICKNAME, nickname); - StringCopy10(battleMon.nickname, nickname); + StringCopy_Nickname(battleMon.nickname, nickname); GetMonData(&gPlayerParty[monId], MON_DATA_OT_NAME, battleMon.otName); src = (u8 *)&battleMon; for (size = 0; size < sizeof(battleMon); size++) diff --git a/src/battle_controller_recorded_opponent.c b/src/battle_controller_recorded_opponent.c index 54156da35bc7..4a35ef723d40 100644 --- a/src/battle_controller_recorded_opponent.c +++ b/src/battle_controller_recorded_opponent.c @@ -585,7 +585,7 @@ static u32 CopyRecordedOpponentMonData(u8 monId, u8 *dst) battleMon.abilityNum = GetMonData(&gEnemyParty[monId], MON_DATA_ABILITY_NUM); battleMon.otId = GetMonData(&gEnemyParty[monId], MON_DATA_OT_ID); GetMonData(&gEnemyParty[monId], MON_DATA_NICKNAME, nickname); - StringCopy10(battleMon.nickname, nickname); + StringCopy_Nickname(battleMon.nickname, nickname); GetMonData(&gEnemyParty[monId], MON_DATA_OT_NAME, battleMon.otName); src = (u8 *)&battleMon; for (size = 0; size < sizeof(battleMon); size++) diff --git a/src/battle_controller_recorded_player.c b/src/battle_controller_recorded_player.c index a28e87a4234b..e25482fb5781 100644 --- a/src/battle_controller_recorded_player.c +++ b/src/battle_controller_recorded_player.c @@ -564,7 +564,7 @@ static u32 CopyRecordedPlayerMonData(u8 monId, u8 *dst) battleMon.abilityNum = GetMonData(&gPlayerParty[monId], MON_DATA_ABILITY_NUM); battleMon.otId = GetMonData(&gPlayerParty[monId], MON_DATA_OT_ID); GetMonData(&gPlayerParty[monId], MON_DATA_NICKNAME, nickname); - StringCopy10(battleMon.nickname, nickname); + StringCopy_Nickname(battleMon.nickname, nickname); GetMonData(&gPlayerParty[monId], MON_DATA_OT_NAME, battleMon.otName); src = (u8 *)&battleMon; for (size = 0; size < sizeof(battleMon); size++) diff --git a/src/battle_controller_wally.c b/src/battle_controller_wally.c index f7c3312577a4..c4c0c11a9e95 100644 --- a/src/battle_controller_wally.c +++ b/src/battle_controller_wally.c @@ -491,7 +491,7 @@ static u32 CopyWallyMonData(u8 monId, u8 *dst) battleMon.abilityNum = GetMonData(&gPlayerParty[monId], MON_DATA_ABILITY_NUM); battleMon.otId = GetMonData(&gPlayerParty[monId], MON_DATA_OT_ID); GetMonData(&gPlayerParty[monId], MON_DATA_NICKNAME, nickname); - StringCopy10(battleMon.nickname, nickname); + StringCopy_Nickname(battleMon.nickname, nickname); GetMonData(&gPlayerParty[monId], MON_DATA_OT_NAME, battleMon.otName); src = (u8 *)&battleMon; for (size = 0; size < sizeof(battleMon); size++) diff --git a/src/battle_dome.c b/src/battle_dome.c index 1b067924ff49..29366298511b 100644 --- a/src/battle_dome.c +++ b/src/battle_dome.c @@ -2099,7 +2099,7 @@ static void InitDomeChallenge(void) if (!(gSaveBlock2Ptr->frontier.winStreakActiveFlags & sWinStreakFlags[battleMode][lvlMode])) gSaveBlock2Ptr->frontier.domeWinStreaks[battleMode][lvlMode] = 0; - SetDynamicWarp(0, gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, -1); + SetDynamicWarp(0, gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, WARP_ID_NONE); gTrainerBattleOpponent_A = 0; } diff --git a/src/battle_factory.c b/src/battle_factory.c index 8f1001e9cac8..23fa664f3388 100644 --- a/src/battle_factory.c +++ b/src/battle_factory.c @@ -217,7 +217,7 @@ static void InitFactoryChallenge(void) for (i = 0; i < FRONTIER_PARTY_SIZE; i++) gFrontierTempParty[i] = 0xFFFF; - SetDynamicWarp(0, gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, -1); + SetDynamicWarp(0, gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, WARP_ID_NONE); gTrainerBattleOpponent_A = 0; } diff --git a/src/battle_interface.c b/src/battle_interface.c index 96bab7f90b06..26209fe2d7fe 100644 --- a/src/battle_interface.c +++ b/src/battle_interface.c @@ -1893,7 +1893,7 @@ static void UpdateNickInHealthbox(u8 healthboxSpriteId, struct Pokemon *mon) StringCopy(gDisplayedStringBattle, gText_HealthboxNickname); GetMonData(mon, MON_DATA_NICKNAME, nickname); - StringGetEnd10(nickname); + StringGet_Nickname(nickname); ptr = StringAppend(gDisplayedStringBattle, nickname); gender = GetMonGender(mon); diff --git a/src/battle_message.c b/src/battle_message.c index b88eedfb376e..1df935694586 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -2400,7 +2400,7 @@ static const u8* TryGetStatusString(u8 *src) { \ GetMonData(&gPlayerParty[monIndex], MON_DATA_NICKNAME, text); \ } \ - StringGetEnd10(text); \ + StringGet_Nickname(text); \ toCpy = text; u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst) @@ -2466,49 +2466,49 @@ u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst) case B_TXT_PLAYER_MON1_NAME: // first player poke name GetMonData(&gPlayerParty[gBattlerPartyIndexes[GetBattlerAtPosition(B_POSITION_PLAYER_LEFT)]], MON_DATA_NICKNAME, text); - StringGetEnd10(text); + StringGet_Nickname(text); toCpy = text; break; case B_TXT_OPPONENT_MON1_NAME: // first enemy poke name GetMonData(&gEnemyParty[gBattlerPartyIndexes[GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT)]], MON_DATA_NICKNAME, text); - StringGetEnd10(text); + StringGet_Nickname(text); toCpy = text; break; case B_TXT_PLAYER_MON2_NAME: // second player poke name GetMonData(&gPlayerParty[gBattlerPartyIndexes[GetBattlerAtPosition(B_POSITION_PLAYER_RIGHT)]], MON_DATA_NICKNAME, text); - StringGetEnd10(text); + StringGet_Nickname(text); toCpy = text; break; case B_TXT_OPPONENT_MON2_NAME: // second enemy poke name GetMonData(&gEnemyParty[gBattlerPartyIndexes[GetBattlerAtPosition(B_POSITION_OPPONENT_RIGHT)]], MON_DATA_NICKNAME, text); - StringGetEnd10(text); + StringGet_Nickname(text); toCpy = text; break; case B_TXT_LINK_PLAYER_MON1_NAME: // link first player poke name GetMonData(&gPlayerParty[gBattlerPartyIndexes[gLinkPlayers[multiplayerId].id]], MON_DATA_NICKNAME, text); - StringGetEnd10(text); + StringGet_Nickname(text); toCpy = text; break; case B_TXT_LINK_OPPONENT_MON1_NAME: // link first opponent poke name GetMonData(&gEnemyParty[gBattlerPartyIndexes[gLinkPlayers[multiplayerId].id ^ 1]], MON_DATA_NICKNAME, text); - StringGetEnd10(text); + StringGet_Nickname(text); toCpy = text; break; case B_TXT_LINK_PLAYER_MON2_NAME: // link second player poke name GetMonData(&gPlayerParty[gBattlerPartyIndexes[gLinkPlayers[multiplayerId].id ^ 2]], MON_DATA_NICKNAME, text); - StringGetEnd10(text); + StringGet_Nickname(text); toCpy = text; break; case B_TXT_LINK_OPPONENT_MON2_NAME: // link second opponent poke name GetMonData(&gEnemyParty[gBattlerPartyIndexes[gLinkPlayers[multiplayerId].id ^ 3]], MON_DATA_NICKNAME, text); - StringGetEnd10(text); + StringGet_Nickname(text); toCpy = text; break; case B_TXT_ATK_NAME_WITH_PREFIX_MON1: // attacker name with prefix, only battlerId 0/1 @@ -2521,7 +2521,7 @@ u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst) else GetMonData(&gEnemyParty[gBattlerPartyIndexes[GetBattlerAtPosition(GET_BATTLER_SIDE(gBattlerAttacker)) + 2]], MON_DATA_NICKNAME, text); - StringGetEnd10(text); + StringGet_Nickname(text); toCpy = text; break; case B_TXT_ATK_NAME_WITH_PREFIX: // attacker name with prefix @@ -2903,7 +2903,7 @@ static void ExpandBattleTextBuffPlaceholders(const u8 *src, u8 *dst) GetMonData(&gEnemyParty[src[srcID + 2]], MON_DATA_NICKNAME, text); } - StringGetEnd10(text); + StringGet_Nickname(text); StringAppend(dst, text); srcID += 3; break; @@ -2920,7 +2920,7 @@ static void ExpandBattleTextBuffPlaceholders(const u8 *src, u8 *dst) GetMonData(&gPlayerParty[src[srcID + 2]], MON_DATA_NICKNAME, dst); else GetMonData(&gEnemyParty[src[srcID + 2]], MON_DATA_NICKNAME, dst); - StringGetEnd10(dst); + StringGet_Nickname(dst); srcID += 3; break; case B_BUFF_NEGATIVE_FLAVOR: // flavor table diff --git a/src/battle_palace.c b/src/battle_palace.c index c4e48a4b2b7c..0fa65200a6f0 100644 --- a/src/battle_palace.c +++ b/src/battle_palace.c @@ -93,7 +93,7 @@ static void InitPalaceChallenge(void) if (!(gSaveBlock2Ptr->frontier.winStreakActiveFlags & sWinStreakFlags[battleMode][lvlMode])) gSaveBlock2Ptr->frontier.palaceWinStreaks[battleMode][lvlMode] = 0; - SetDynamicWarp(0, gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, -1); + SetDynamicWarp(0, gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, WARP_ID_NONE); gTrainerBattleOpponent_A = 0; } diff --git a/src/battle_pyramid.c b/src/battle_pyramid.c index 48155c833981..b10690ce454b 100644 --- a/src/battle_pyramid.c +++ b/src/battle_pyramid.c @@ -34,7 +34,6 @@ #include "constants/frontier_util.h" #include "constants/items.h" #include "constants/layouts.h" -#include "constants/maps.h" #include "constants/metatile_labels.h" #include "constants/moves.h" #include "constants/trainers.h" diff --git a/src/battle_setup.c b/src/battle_setup.c index a9d4eeddf53c..f928cf3f94fb 100644 --- a/src/battle_setup.c +++ b/src/battle_setup.c @@ -43,7 +43,6 @@ #include "constants/items.h" #include "constants/songs.h" #include "constants/map_types.h" -#include "constants/maps.h" #include "constants/trainers.h" #include "constants/trainer_hill.h" #include "constants/weather.h" @@ -687,7 +686,7 @@ u8 BattleSetup_GetTerrainId(void) } if (gSaveBlock1Ptr->location.mapGroup == MAP_GROUP(ROUTE113) && gSaveBlock1Ptr->location.mapNum == MAP_NUM(ROUTE113)) return BATTLE_TERRAIN_SAND; - if (GetSav1Weather() == WEATHER_SANDSTORM) + if (GetSavedWeather() == WEATHER_SANDSTORM) return BATTLE_TERRAIN_SAND; return BATTLE_TERRAIN_PLAIN; @@ -700,7 +699,7 @@ static u8 GetBattleTransitionTypeByMap(void) PlayerGetDestCoords(&x, &y); tileBehavior = MapGridGetMetatileBehaviorAt(x, y); - if (Overworld_GetFlashLevel()) + if (GetFlashLevel()) return TRANSITION_TYPE_FLASH; if (!MetatileBehavior_IsSurfableWaterOrUnderwater(tileBehavior)) { diff --git a/src/battle_tent.c b/src/battle_tent.c index 26b2e8bb1152..53c91c87137c 100644 --- a/src/battle_tent.c +++ b/src/battle_tent.c @@ -114,7 +114,7 @@ static void InitVerdanturfTentChallenge(void) gSaveBlock2Ptr->frontier.challengeStatus = 0; gSaveBlock2Ptr->frontier.curChallengeBattleNum = 0; gSaveBlock2Ptr->frontier.challengePaused = FALSE; - SetDynamicWarp(0, gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, -1); + SetDynamicWarp(0, gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, WARP_ID_NONE); } static void GetVerdanturfTentPrize(void) @@ -176,7 +176,7 @@ static void InitFallarborTentChallenge(void) gSaveBlock2Ptr->frontier.challengeStatus = 0; gSaveBlock2Ptr->frontier.curChallengeBattleNum = 0; gSaveBlock2Ptr->frontier.challengePaused = FALSE; - SetDynamicWarp(0, gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, -1); + SetDynamicWarp(0, gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, WARP_ID_NONE); } static void GetFallarborTentPrize(void) @@ -231,7 +231,7 @@ static void InitSlateportTentChallenge(void) gSaveBlock2Ptr->frontier.challengeStatus = 0; gSaveBlock2Ptr->frontier.curChallengeBattleNum = 0; gSaveBlock2Ptr->frontier.challengePaused = FALSE; - SetDynamicWarp(0, gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, -1); + SetDynamicWarp(0, gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, WARP_ID_NONE); } static void GetSlateportTentPrize(void) diff --git a/src/battle_tower.c b/src/battle_tower.c index d9bd18bf7368..7ed15d1e65cf 100644 --- a/src/battle_tower.c +++ b/src/battle_tower.c @@ -918,7 +918,7 @@ static void InitTowerChallenge(void) gSaveBlock2Ptr->frontier.towerWinStreaks[battleMode][lvlMode] = 0; ValidateBattleTowerRecordChecksums(); - SetDynamicWarp(0, gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, -1); + SetDynamicWarp(0, gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, WARP_ID_NONE); gTrainerBattleOpponent_A = 0; } @@ -2160,7 +2160,7 @@ static void SaveBattleTowerRecord(void) playerRecord->lvlMode = lvlMode; playerRecord->facilityClass = class; CopyTrainerId(playerRecord->trainerId, gSaveBlock2Ptr->playerTrainerId); - StringCopy7(playerRecord->name, gSaveBlock2Ptr->playerName); + StringCopy_PlayerName(playerRecord->name, gSaveBlock2Ptr->playerName); playerRecord->winStreak = GetCurrentBattleTowerWinStreak(lvlMode, battleMode); for (i = 0; i < EASY_CHAT_BATTLE_WORDS_COUNT; i++) @@ -2831,7 +2831,7 @@ static void FillEReaderTrainerWithPlayerData(void) } CopyTrainerId(ereaderTrainer->trainerId, gSaveBlock2Ptr->playerTrainerId); - StringCopy7(ereaderTrainer->name, gSaveBlock2Ptr->playerName); + StringCopy_PlayerName(ereaderTrainer->name, gSaveBlock2Ptr->playerName); ereaderTrainer->winStreak = 1; diff --git a/src/braille_puzzles.c b/src/braille_puzzles.c index 61fab39e28c1..26caa830d300 100644 --- a/src/braille_puzzles.c +++ b/src/braille_puzzles.c @@ -6,7 +6,6 @@ #include "sound.h" #include "task.h" #include "constants/field_effects.h" -#include "constants/maps.h" #include "constants/songs.h" #include "constants/metatile_labels.h" #include "fieldmap.h" diff --git a/src/cable_car.c b/src/cable_car.c index c3e6564f8d83..c81764728b42 100644 --- a/src/cable_car.c +++ b/src/cable_car.c @@ -826,7 +826,7 @@ static void CreateCableCarSprites(void) case FALSE: default: // Create player sprite - spriteId = AddPseudoObjectEvent(playerGraphicsIds[gSaveBlock2Ptr->playerGender], SpriteCB_Player, 200, 73, 102); + spriteId = CreateObjectGraphicsSprite(playerGraphicsIds[gSaveBlock2Ptr->playerGender], SpriteCB_Player, 200, 73, 102); if (spriteId != MAX_SPRITES) { gSprites[spriteId].oam.priority = 2; @@ -854,7 +854,7 @@ static void CreateCableCarSprites(void) case TRUE: CopyToBgTilemapBufferRect_ChangePalette(0, sCableCar->groundTilemap + 0x24, 24, 26, 12, 3, 17); // Create player sprite - spriteId = AddPseudoObjectEvent(playerGraphicsIds[gSaveBlock2Ptr->playerGender], SpriteCB_Player, 128, 39, 102); + spriteId = CreateObjectGraphicsSprite(playerGraphicsIds[gSaveBlock2Ptr->playerGender], SpriteCB_Player, 128, 39, 102); if (spriteId != MAX_SPRITES) { gSprites[spriteId].oam.priority = 2; @@ -891,7 +891,7 @@ static void CreateCableCarSprites(void) if ((rval % 64) == 0) { // Unclear if this was intentional, but the - 1 in the below ARRAY_COUNT means the Zigzagoon is never used - spriteId = AddPseudoObjectEvent(hikerGraphicsIds[rval % (ARRAY_COUNT(hikerGraphicsIds) - 1)], hikerCallbacks[GOING_DOWN], hikerCoords[GOING_DOWN][0], hikerCoords[GOING_DOWN][1], 106); + spriteId = CreateObjectGraphicsSprite(hikerGraphicsIds[rval % (ARRAY_COUNT(hikerGraphicsIds) - 1)], hikerCallbacks[GOING_DOWN], hikerCoords[GOING_DOWN][0], hikerCoords[GOING_DOWN][1], 106); if (spriteId != MAX_SPRITES) { gSprites[spriteId].oam.priority = 2; diff --git a/src/cable_club.c b/src/cable_club.c index 1f943b03ab74..4ee2797f4d6d 100644 --- a/src/cable_club.c +++ b/src/cable_club.c @@ -1031,7 +1031,7 @@ void CleanupLinkRoomState(void) LoadPlayerParty(); SavePlayerBag(); } - SetWarpDestinationToDynamicWarp(0x7F); + SetWarpDestinationToDynamicWarp(WARP_ID_DYNAMIC); } void ExitLinkRoom(void) diff --git a/src/contest.c b/src/contest.c index b5a035ff85db..ced9f90cdead 100644 --- a/src/contest.c +++ b/src/contest.c @@ -2794,7 +2794,7 @@ void CreateContestMonFromParty(u8 partyIndex) gContestMons[gContestPlayerMonIndex].highestRank = 0; gContestMons[gContestPlayerMonIndex].species = GetMonData(&gPlayerParty[partyIndex], MON_DATA_SPECIES); GetMonData(&gPlayerParty[partyIndex], MON_DATA_NICKNAME, name); - StringGetEnd10(name); + StringGet_Nickname(name); if (gLinkContestFlags & LINK_CONTEST_FLAG_IS_LINK) { StripMonNameForLinkContest(name, GetMonData(&gPlayerParty[partyIndex], MON_DATA_LANGUAGE)); diff --git a/src/contest_util.c b/src/contest_util.c index 6fd74a68aaf0..1ca217526535 100644 --- a/src/contest_util.c +++ b/src/contest_util.c @@ -2253,10 +2253,10 @@ void Task_LinkContest_FinalizeConnection(u8 taskId) { // Succesfully connected for (i = 0; i < CONTESTANT_COUNT; i++) - StringGetEnd10(gContestMons[i].nickname); + StringGet_Nickname(gContestMons[i].nickname); DestroyTask(taskId); - SetDynamicWarp(0, gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, -1); + SetDynamicWarp(0, gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, WARP_ID_NONE); ScriptContext2_Disable(); EnableBothScriptContexts(); } diff --git a/src/data/lilycove_lady.h b/src/data/lilycove_lady.h index 1f1caa35f33f..dd0885ff820e 100644 --- a/src/data/lilycove_lady.h +++ b/src/data/lilycove_lady.h @@ -5,11 +5,11 @@ static const u16 sContestLadyMonGfxId[] = { - OBJ_EVENT_GFX_ZIGZAGOON_1, - OBJ_EVENT_GFX_SKITTY, - OBJ_EVENT_GFX_POOCHYENA, - OBJ_EVENT_GFX_KECLEON, - OBJ_EVENT_GFX_PIKACHU + [CONTEST_CATEGORY_COOL] = OBJ_EVENT_GFX_ZIGZAGOON_1, + [CONTEST_CATEGORY_BEAUTY] = OBJ_EVENT_GFX_SKITTY, + [CONTEST_CATEGORY_CUTE] = OBJ_EVENT_GFX_POOCHYENA, + [CONTEST_CATEGORY_SMART] = OBJ_EVENT_GFX_KECLEON, + [CONTEST_CATEGORY_TOUGH] = OBJ_EVENT_GFX_PIKACHU }; static const u16 sLilycoveLadyGfxId[] = @@ -434,36 +434,36 @@ static const u16 sFavorLadyPrizes[] = static const u8 *const sContestLadyMonNames[] = { - gText_ContestLady_Handsome, - gText_ContestLady_Vinny, - gText_ContestLady_Moreme, - gText_ContestLady_Ironhard, - gText_ContestLady_Muscle + [CONTEST_CATEGORY_COOL] = gText_ContestLady_Handsome, + [CONTEST_CATEGORY_BEAUTY] = gText_ContestLady_Vinny, + [CONTEST_CATEGORY_CUTE] = gText_ContestLady_Moreme, + [CONTEST_CATEGORY_SMART] = gText_ContestLady_Ironhard, + [CONTEST_CATEGORY_TOUGH] = gText_ContestLady_Muscle }; static const u8 *const sContestLadyCategoryNames[] = { - gText_ContestLady_Coolness, - gText_ContestLady_Beauty, - gText_ContestLady_Cuteness, - gText_ContestLady_Smartness, - gText_ContestLady_Toughness + [CONTEST_CATEGORY_COOL] = gText_ContestLady_Coolness, + [CONTEST_CATEGORY_BEAUTY] = gText_ContestLady_Beauty, + [CONTEST_CATEGORY_CUTE] = gText_ContestLady_Cuteness, + [CONTEST_CATEGORY_SMART] = gText_ContestLady_Smartness, + [CONTEST_CATEGORY_TOUGH] = gText_ContestLady_Toughness }; static const u8 *const sContestNames[] = { - gText_CoolnessContest, - gText_BeautyContest, - gText_CutenessContest, - gText_SmartnessContest, - gText_ToughnessContest + [CONTEST_CATEGORY_COOL] = gText_CoolnessContest, + [CONTEST_CATEGORY_BEAUTY] = gText_BeautyContest, + [CONTEST_CATEGORY_CUTE] = gText_CutenessContest, + [CONTEST_CATEGORY_SMART] = gText_SmartnessContest, + [CONTEST_CATEGORY_TOUGH] = gText_ToughnessContest }; static const u16 sContestLadyMonSpecies[] = { - SPECIES_ZIGZAGOON, - SPECIES_SKITTY, - SPECIES_POOCHYENA, - SPECIES_KECLEON, - SPECIES_PIKACHU + [CONTEST_CATEGORY_COOL] = SPECIES_ZIGZAGOON, + [CONTEST_CATEGORY_BEAUTY] = SPECIES_SKITTY, + [CONTEST_CATEGORY_CUTE] = SPECIES_POOCHYENA, + [CONTEST_CATEGORY_SMART] = SPECIES_KECLEON, + [CONTEST_CATEGORY_TOUGH] = SPECIES_PIKACHU }; diff --git a/src/daycare.c b/src/daycare.c index c900e3493363..ebbab762ade7 100644 --- a/src/daycare.c +++ b/src/daycare.c @@ -96,7 +96,7 @@ u8 *GetMonNickname2(struct Pokemon *mon, u8 *dest) u8 nickname[POKEMON_NAME_LENGTH * 2]; GetMonData(mon, MON_DATA_NICKNAME, nickname); - return StringCopy10(dest, nickname); + return StringCopy_Nickname(dest, nickname); } u8 *GetBoxMonNickname(struct BoxPokemon *mon, u8 *dest) @@ -104,7 +104,7 @@ u8 *GetBoxMonNickname(struct BoxPokemon *mon, u8 *dest) u8 nickname[POKEMON_NAME_LENGTH * 2]; GetBoxMonData(mon, MON_DATA_NICKNAME, nickname); - return StringCopy10(dest, nickname); + return StringCopy_Nickname(dest, nickname); } u8 CountPokemonInDaycare(struct DayCare *daycare) diff --git a/src/decoration.c b/src/decoration.c index bb2dea7f975e..118b4918e666 100644 --- a/src/decoration.c +++ b/src/decoration.c @@ -1175,7 +1175,7 @@ static void SetInitialPositions(u8 taskId) static void WarpToInitialPosition(u8 taskId) { DrawWholeMapView(); - SetWarpDestination(gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, -1, gTasks[taskId].tInitialX, gTasks[taskId].tInitialY); + SetWarpDestination(gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, WARP_ID_NONE, gTasks[taskId].tInitialX, gTasks[taskId].tInitialY); WarpIntoMap(); } @@ -1395,9 +1395,9 @@ static void SetUpPlacingDecorationPlayerAvatar(u8 taskId, struct PlaceDecoration x -= 8; if (gSaveBlock2Ptr->playerGender == MALE) - sDecor_CameraSpriteObjectIdx2 = AddPseudoObjectEvent(OBJ_EVENT_GFX_BRENDAN_DECORATING, SpriteCallbackDummy, x, 72, 0); + sDecor_CameraSpriteObjectIdx2 = CreateObjectGraphicsSprite(OBJ_EVENT_GFX_BRENDAN_DECORATING, SpriteCallbackDummy, x, 72, 0); else - sDecor_CameraSpriteObjectIdx2 = AddPseudoObjectEvent(OBJ_EVENT_GFX_MAY_DECORATING, SpriteCallbackDummy, x, 72, 0); + sDecor_CameraSpriteObjectIdx2 = CreateObjectGraphicsSprite(OBJ_EVENT_GFX_MAY_DECORATING, SpriteCallbackDummy, x, 72, 0); gSprites[sDecor_CameraSpriteObjectIdx2].oam.priority = 1; DestroySprite(&gSprites[sDecor_CameraSpriteObjectIdx1]); @@ -2027,7 +2027,7 @@ static u8 gpu_pal_decompress_alloc_tag_and_upload(struct PlaceDecorationGraphics ClearPlaceDecorationGraphicsDataBuffer(data); data->decoration = &gDecorations[decor]; if (data->decoration->permission == DECORPERM_SPRITE) - return AddPseudoObjectEvent(data->decoration->tiles[0], SpriteCallbackDummy, 0, 0, 1); + return CreateObjectGraphicsSprite(data->decoration->tiles[0], SpriteCallbackDummy, 0, 0, 1); FreeSpritePaletteByTag(PLACE_DECORATION_SELECTOR_TAG); SetDecorSelectionMetatiles(data); @@ -2106,7 +2106,7 @@ static u8 AddDecorationIconObjectFromObjectEvent(u16 tilesTag, u16 paletteTag, u } else { - spriteId = AddPseudoObjectEvent(sPlaceDecorationGraphicsDataBuffer.decoration->tiles[0], SpriteCallbackDummy, 0, 0, 1); + spriteId = CreateObjectGraphicsSprite(sPlaceDecorationGraphicsDataBuffer.decoration->tiles[0], SpriteCallbackDummy, 0, 0, 1); } return spriteId; } @@ -2285,9 +2285,9 @@ static void SetUpPuttingAwayDecorationPlayerAvatar(void) LoadPlayerSpritePalette(); gFieldCamera.spriteId = CreateSprite(&sPuttingAwayCursorSpriteTemplate, 120, 80, 0); if (gSaveBlock2Ptr->playerGender == MALE) - sDecor_CameraSpriteObjectIdx2 = AddPseudoObjectEvent(OBJ_EVENT_GFX_BRENDAN_DECORATING, SpriteCallbackDummy, 136, 72, 0); + sDecor_CameraSpriteObjectIdx2 = CreateObjectGraphicsSprite(OBJ_EVENT_GFX_BRENDAN_DECORATING, SpriteCallbackDummy, 136, 72, 0); else - sDecor_CameraSpriteObjectIdx2 = AddPseudoObjectEvent(OBJ_EVENT_GFX_MAY_DECORATING, SpriteCallbackDummy, 136, 72, 0); + sDecor_CameraSpriteObjectIdx2 = CreateObjectGraphicsSprite(OBJ_EVENT_GFX_MAY_DECORATING, SpriteCallbackDummy, 136, 72, 0); gSprites[sDecor_CameraSpriteObjectIdx2].oam.priority = 1; DestroySprite(&gSprites[sDecor_CameraSpriteObjectIdx1]); diff --git a/src/easy_chat.c b/src/easy_chat.c index 1b992caf2d6d..f9ba44ba79b4 100644 --- a/src/easy_chat.c +++ b/src/easy_chat.c @@ -5011,7 +5011,7 @@ static void TryAddInterviewObjectEvents(void) return; // Add object for reporter/interviewing fan (facing left) - spriteId = AddPseudoObjectEvent(graphicsId, SpriteCallbackDummy, 76, 40, 0); + spriteId = CreateObjectGraphicsSprite(graphicsId, SpriteCallbackDummy, 76, 40, 0); if (spriteId != MAX_SPRITES) { gSprites[spriteId].oam.priority = 0; @@ -5019,7 +5019,7 @@ static void TryAddInterviewObjectEvents(void) } // Add object for player (facing right) - spriteId = AddPseudoObjectEvent( + spriteId = CreateObjectGraphicsSprite( gSaveBlock2Ptr->playerGender == MALE ? OBJ_EVENT_GFX_RIVAL_BRENDAN_NORMAL : OBJ_EVENT_GFX_RIVAL_MAY_NORMAL, SpriteCallbackDummy, 52, diff --git a/src/event_object_movement.c b/src/event_object_movement.c index 107ee47abe87..d92569d32882 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -26,7 +26,6 @@ #include "constants/event_objects.h" #include "constants/field_effects.h" #include "constants/items.h" -#include "constants/maps.h" #include "constants/mauville_old_man.h" #include "constants/trainer_types.h" #include "constants/union_room.h" @@ -115,7 +114,7 @@ static void DoRippleFieldEffect(struct ObjectEvent*, struct Sprite*); static void DoGroundEffects_OnSpawn(struct ObjectEvent*, struct Sprite*); static void DoGroundEffects_OnBeginStep(struct ObjectEvent*, struct Sprite*); static void DoGroundEffects_OnFinishStep(struct ObjectEvent*, struct Sprite*); -static void UpdateObjectEventSpritePosition(struct Sprite*); +static void VirtualObject_UpdateAnim(struct Sprite*); static void ApplyLevitateMovement(u8); static bool8 MovementType_Disguise_Callback(struct ObjectEvent *, struct Sprite *); static bool8 MovementType_Buried_Callback(struct ObjectEvent *, struct Sprite *); @@ -127,7 +126,7 @@ static void SetObjectEventDynamicGraphicsId(struct ObjectEvent *); static void RemoveObjectEventInternal(struct ObjectEvent *); static u16 GetObjectEventFlagIdByObjectEventId(u8); static void UpdateObjectEventVisibility(struct ObjectEvent *, struct Sprite *); -static void MakeObjectTemplateFromObjectEventTemplate(struct ObjectEventTemplate *, struct SpriteTemplate *, const struct SubspriteTable **); +static void MakeSpriteTemplateFromObjectEventTemplate(struct ObjectEventTemplate *, struct SpriteTemplate *, const struct SubspriteTable **); static void GetObjectEventMovingCameraOffset(s16 *, s16 *); static struct ObjectEventTemplate *GetObjectEventTemplateByLocalIdAndMap(u8, u8, u8); static void LoadObjectEventPalette(u16); @@ -149,7 +148,7 @@ static void ObjectEventSetSingleMovement(struct ObjectEvent *, struct Sprite *, static void SetSpriteDataForNormalStep(struct Sprite *, u8, u8); static void InitSpriteForFigure8Anim(struct Sprite *sprite); static bool8 AnimateSpriteInFigure8(struct Sprite *sprite); -static void UpdateObjectEventSprite(struct Sprite *); +static void SpriteCB_VirtualObject(struct Sprite *); static void DoShadowFieldEffect(struct ObjectEvent *); static void SetJumpSpriteData(struct Sprite *, u8, u8, u8); static void SetWalkSlowSpriteData(struct Sprite *sprite, u8 direction); @@ -1141,7 +1140,7 @@ static const u8 sPlayerDirectionToCopyDirection[][4] = { static void ClearObjectEvent(struct ObjectEvent *objectEvent) { *objectEvent = (struct ObjectEvent){}; - objectEvent->localId = 0xFF; + objectEvent->localId = OBJ_EVENT_ID_PLAYER; objectEvent->mapNum = MAP_NUM(UNDEFINED); objectEvent->mapGroup = MAP_GROUP(UNDEFINED); objectEvent->movementActionId = MOVEMENT_ACTION_NONE; @@ -1443,7 +1442,7 @@ static u8 TrySpawnObjectEventTemplate(struct ObjectEventTemplate *objectEventTem const struct SubspriteTable *subspriteTables = NULL; graphicsInfo = GetObjectEventGraphicsInfo(objectEventTemplate->graphicsId); - MakeObjectTemplateFromObjectEventTemplate(objectEventTemplate, &spriteTemplate, &subspriteTables); + MakeSpriteTemplateFromObjectEventTemplate(objectEventTemplate, &spriteTemplate, &subspriteTables); spriteFrameImage.size = graphicsInfo->size; spriteTemplate.images = &spriteFrameImage; objectEventId = TrySetupObjectEventSprite(objectEventTemplate, &spriteTemplate, mapNum, mapGroup, cameraX, cameraY); @@ -1499,7 +1498,7 @@ u8 TrySpawnObjectEvent(u8 localId, u8 mapNum, u8 mapGroup) return TrySpawnObjectEventTemplate(objectEventTemplate, mapNum, mapGroup, cameraX, cameraY); } -static void MakeObjectTemplateFromObjectEventGraphicsInfo(u16 graphicsId, void (*callback)(struct Sprite *), struct SpriteTemplate *spriteTemplate, const struct SubspriteTable **subspriteTables) +static void CopyObjectGraphicsInfoToSpriteTemplate(u16 graphicsId, void (*callback)(struct Sprite *), struct SpriteTemplate *spriteTemplate, const struct SubspriteTable **subspriteTables) { const struct ObjectEventGraphicsInfo *graphicsInfo = GetObjectEventGraphicsInfo(graphicsId); @@ -1513,17 +1512,18 @@ static void MakeObjectTemplateFromObjectEventGraphicsInfo(u16 graphicsId, void ( *subspriteTables = graphicsInfo->subspriteTables; } -static void MakeObjectTemplateFromObjectEventGraphicsInfoWithCallbackIndex(u16 graphicsId, u16 callbackIndex, struct SpriteTemplate *spriteTemplate, const struct SubspriteTable **subspriteTables) +static void CopyObjectGraphicsInfoToSpriteTemplate_WithMovementType(u16 graphicsId, u16 movementType, struct SpriteTemplate *spriteTemplate, const struct SubspriteTable **subspriteTables) { - MakeObjectTemplateFromObjectEventGraphicsInfo(graphicsId, sMovementTypeCallbacks[callbackIndex], spriteTemplate, subspriteTables); + CopyObjectGraphicsInfoToSpriteTemplate(graphicsId, sMovementTypeCallbacks[movementType], spriteTemplate, subspriteTables); } -static void MakeObjectTemplateFromObjectEventTemplate(struct ObjectEventTemplate *objectEventTemplate, struct SpriteTemplate *spriteTemplate, const struct SubspriteTable **subspriteTables) +static void MakeSpriteTemplateFromObjectEventTemplate(struct ObjectEventTemplate *objectEventTemplate, struct SpriteTemplate *spriteTemplate, const struct SubspriteTable **subspriteTables) { - MakeObjectTemplateFromObjectEventGraphicsInfoWithCallbackIndex(objectEventTemplate->graphicsId, objectEventTemplate->movementType, spriteTemplate, subspriteTables); + CopyObjectGraphicsInfoToSpriteTemplate_WithMovementType(objectEventTemplate->graphicsId, objectEventTemplate->movementType, spriteTemplate, subspriteTables); } -u8 AddPseudoObjectEvent(u16 graphicsId, void (*callback)(struct Sprite *), s16 x, s16 y, u8 subpriority) +// Used to create a sprite using a graphicsId associated with object events. +u8 CreateObjectGraphicsSprite(u16 graphicsId, void (*callback)(struct Sprite *), s16 x, s16 y, u8 subpriority) { struct SpriteTemplate *spriteTemplate; const struct SubspriteTable *subspriteTables; @@ -1531,7 +1531,7 @@ u8 AddPseudoObjectEvent(u16 graphicsId, void (*callback)(struct Sprite *), s16 x u8 spriteId; spriteTemplate = malloc(sizeof(struct SpriteTemplate)); - MakeObjectTemplateFromObjectEventGraphicsInfo(graphicsId, callback, spriteTemplate, &subspriteTables); + CopyObjectGraphicsInfoToSpriteTemplate(graphicsId, callback, spriteTemplate, &subspriteTables); if (spriteTemplate->paletteTag != TAG_NONE) LoadObjectEventPalette(spriteTemplate->paletteTag); @@ -1547,9 +1547,15 @@ u8 AddPseudoObjectEvent(u16 graphicsId, void (*callback)(struct Sprite *), s16 x return spriteId; } -// Used to create sprite object events instead of a full object event -// Used when resources are limiting, e.g. for the audience in contests or group members in Union Room -u8 CreateObjectSprite(u8 graphicsId, u8 objectEventId, s16 x, s16 y, u8 z, u8 direction) +#define sVirtualObjId data[0] +#define sVirtualObjElev data[1] + +// "Virtual Objects" are a class of sprites used instead of a full object event. +// Used when more objects are needed than the object event limit (for Contest / Battle Dome audiences and group members in Union Room). +// A unique id is given as an argument and stored in the sprite data to allow referring back to the same virtual object. +// They can be turned (and, in the case of the Union Room, animated teleporting in and out) but do not have movement types +// or any of the other data normally associated with object events. +u8 CreateVirtualObject(u8 graphicsId, u8 virtualObjId, s16 x, s16 y, u8 z, u8 direction) { u8 spriteId; struct Sprite *sprite; @@ -1558,7 +1564,7 @@ u8 CreateObjectSprite(u8 graphicsId, u8 objectEventId, s16 x, s16 y, u8 z, u8 di const struct ObjectEventGraphicsInfo *graphicsInfo; graphicsInfo = GetObjectEventGraphicsInfo(graphicsId); - MakeObjectTemplateFromObjectEventGraphicsInfo(graphicsId, UpdateObjectEventSprite, &spriteTemplate, &subspriteTables); + CopyObjectGraphicsInfoToSpriteTemplate(graphicsId, SpriteCB_VirtualObject, &spriteTemplate, &subspriteTables); *(u16 *)&spriteTemplate.paletteTag = TAG_NONE; x += MAP_OFFSET; y += MAP_OFFSET; @@ -1575,8 +1581,8 @@ u8 CreateObjectSprite(u8 graphicsId, u8 objectEventId, s16 x, s16 y, u8 z, u8 di sprite->oam.paletteNum -= 16; sprite->coordOffsetEnabled = TRUE; - sprite->sObjEventId = objectEventId; - sprite->data[1] = z; + sprite->sVirtualObjId = virtualObjId; + sprite->sVirtualObjElev = z; if (graphicsInfo->paletteSlot == 10) LoadSpecialObjectReflectionPalette(graphicsInfo->paletteTag, graphicsInfo->paletteSlot); else if (graphicsInfo->paletteSlot >= 16) @@ -1698,7 +1704,7 @@ static void SpawnObjectEventOnReturnToField(u8 objectEventId, s16 x, s16 y) subspriteTables = NULL; graphicsInfo = GetObjectEventGraphicsInfo(objectEvent->graphicsId); spriteFrameImage.size = graphicsInfo->size; - MakeObjectTemplateFromObjectEventGraphicsInfoWithCallbackIndex(objectEvent->graphicsId, objectEvent->movementType, &spriteTemplate, &subspriteTables); + CopyObjectGraphicsInfoToSpriteTemplate_WithMovementType(objectEvent->graphicsId, objectEvent->movementType, &spriteTemplate, &subspriteTables); spriteTemplate.images = &spriteFrameImage; *(u16 *)&spriteTemplate.paletteTag = TAG_NONE; @@ -1916,7 +1922,7 @@ void AllowObjectAtPosTriggerGroundEffects(s16 x, s16 y) } } -void SetObjectPriority(u8 localId, u8 mapNum, u8 mapGroup, u8 subpriority) +void SetObjectSubpriority(u8 localId, u8 mapNum, u8 mapGroup, u8 subpriority) { u8 objectEventId; struct ObjectEvent *objectEvent; @@ -1931,7 +1937,7 @@ void SetObjectPriority(u8 localId, u8 mapNum, u8 mapGroup, u8 subpriority) } } -void ResetObjectPriority(u8 localId, u8 mapNum, u8 mapGroup) +void ResetObjectSubpriority(u8 localId, u8 mapNum, u8 mapGroup) { u8 objectEventId; struct ObjectEvent *objectEvent; @@ -8511,50 +8517,50 @@ void UpdateObjectEventSpriteInvisibility(struct Sprite *sprite, bool8 invisible) #define sAnimNum data[3] #define sAnimState data[4] -static void UpdateObjectEventSprite(struct Sprite *sprite) +static void SpriteCB_VirtualObject(struct Sprite *sprite) { - UpdateObjectEventSpritePosition(sprite); - SetObjectSubpriorityByZCoord(sprite->data[1], sprite, 1); + VirtualObject_UpdateAnim(sprite); + SetObjectSubpriorityByZCoord(sprite->sVirtualObjElev, sprite, 1); UpdateObjectEventSpriteInvisibility(sprite, sprite->sInvisible); } // Unused -static void DestroyObjectEventSprites(void) +static void DestroyVirtualObjects(void) { int i; for (i = 0; i < MAX_SPRITES; i++) { struct Sprite *sprite = &gSprites[i]; - if(sprite->inUse && sprite->callback == UpdateObjectEventSprite) + if(sprite->inUse && sprite->callback == SpriteCB_VirtualObject) DestroySprite(sprite); } } -static int GetObjectEventSpriteId(u8 objectEventId) // this should return a u8, because all that call this shifts to u8, but it wont match because it doesnt shift u8 at the end. +static int GetVirtualObjectSpriteId(u8 virtualObjId) { int i; for (i = 0; i < MAX_SPRITES; i++) { struct Sprite *sprite = &gSprites[i]; - if (sprite->inUse && sprite->callback == UpdateObjectEventSprite && (u8)sprite->sObjEventId == objectEventId) + if (sprite->inUse && sprite->callback == SpriteCB_VirtualObject && (u8)sprite->sVirtualObjId == virtualObjId) return i; } return MAX_SPRITES; } -void TurnObjectEventSprite(u8 objectEventId, u8 direction) +void TurnVirtualObject(u8 virtualObjId, u8 direction) { - u8 spriteId = GetObjectEventSpriteId(objectEventId); + u8 spriteId = GetVirtualObjectSpriteId(virtualObjId); if (spriteId != MAX_SPRITES) StartSpriteAnim(&gSprites[spriteId], GetFaceDirectionAnimNum(direction)); } -void SetObjectEventSpriteGraphics(u8 objectEventId, u8 graphicsId) +void SetVirtualObjectGraphics(u8 virtualObjId, u8 graphicsId) { - int spriteId = GetObjectEventSpriteId(objectEventId); + int spriteId = GetVirtualObjectSpriteId(virtualObjId); if (spriteId != MAX_SPRITES) { @@ -8582,9 +8588,9 @@ void SetObjectEventSpriteGraphics(u8 objectEventId, u8 graphicsId) } } -void SetObjectEventSpriteInvisibility(u8 objectEventId, bool32 invisible) +void SetVirtualObjectInvisibility(u8 virtualObjId, bool32 invisible) { - u8 spriteId = GetObjectEventSpriteId(objectEventId); + u8 spriteId = GetVirtualObjectSpriteId(virtualObjId); if (spriteId == MAX_SPRITES) return; @@ -8595,9 +8601,9 @@ void SetObjectEventSpriteInvisibility(u8 objectEventId, bool32 invisible) gSprites[spriteId].sInvisible = FALSE; } -bool32 IsObjectEventSpriteInvisible(u8 objectEventId) +bool32 IsVirtualObjectInvisible(u8 virtualObjId) { - u8 spriteId = GetObjectEventSpriteId(objectEventId); + u8 spriteId = GetVirtualObjectSpriteId(virtualObjId); if (spriteId == MAX_SPRITES) return FALSE; @@ -8605,9 +8611,9 @@ bool32 IsObjectEventSpriteInvisible(u8 objectEventId) return (gSprites[spriteId].sInvisible == TRUE); } -void SetObjectEventSpriteAnim(u8 objectEventId, u8 animNum) +void SetVirtualObjectSpriteAnim(u8 virtualObjId, u8 animNum) { - u8 spriteId = GetObjectEventSpriteId(objectEventId); + u8 spriteId = GetVirtualObjectSpriteId(virtualObjId); if (spriteId != MAX_SPRITES) { @@ -8620,18 +8626,18 @@ static void MoveUnionRoomObjectUp(struct Sprite *sprite) { switch(sprite->sAnimState) { - case 0: + case 0: + sprite->y2 = 0; + sprite->sAnimState++; + case 1: + sprite->y2 -= 8; + if (sprite->y2 == -DISPLAY_HEIGHT) + { sprite->y2 = 0; - sprite->sAnimState++; - case 1: - sprite->y2 -= 8; - if (sprite->y2 == -DISPLAY_HEIGHT) - { - sprite->y2 = 0; - sprite->sInvisible = TRUE; - sprite->sAnimNum = 0; - sprite->sAnimState = 0; - } + sprite->sInvisible = TRUE; + sprite->sAnimNum = 0; + sprite->sAnimState = 0; + } } } @@ -8639,40 +8645,40 @@ static void MoveUnionRoomObjectDown(struct Sprite *sprite) { switch(sprite->sAnimState) { - case 0: - sprite->y2 = -DISPLAY_HEIGHT; - sprite->sAnimState++; - case 1: - sprite->y2 += 8; - if(sprite->y2 == 0) - { - sprite->sAnimNum = 0; - sprite->sAnimState = 0; - } + case 0: + sprite->y2 = -DISPLAY_HEIGHT; + sprite->sAnimState++; + case 1: + sprite->y2 += 8; + if(sprite->y2 == 0) + { + sprite->sAnimNum = 0; + sprite->sAnimState = 0; + } } } -static void UpdateObjectEventSpritePosition(struct Sprite *sprite) +static void VirtualObject_UpdateAnim(struct Sprite *sprite) { switch(sprite->sAnimNum) { - case UNION_ROOM_SPAWN_IN: - MoveUnionRoomObjectDown(sprite); - break; - case UNION_ROOM_SPAWN_OUT: - MoveUnionRoomObjectUp(sprite); - break; - case 0: - break; - default: - sprite->sAnimNum = 0; - break; + case UNION_ROOM_SPAWN_IN: + MoveUnionRoomObjectDown(sprite); + break; + case UNION_ROOM_SPAWN_OUT: + MoveUnionRoomObjectUp(sprite); + break; + case 0: + break; + default: + sprite->sAnimNum = 0; + break; } } -bool32 IsObjectEventSpriteAnimating(u8 objectEventId) +bool32 IsVirtualObjectAnimating(u8 virtualObjId) { - u8 spriteId = GetObjectEventSpriteId(objectEventId); + u8 spriteId = GetVirtualObjectSpriteId(virtualObjId); if (spriteId == MAX_SPRITES) return FALSE; diff --git a/src/evolution_scene.c b/src/evolution_scene.c index 99ff26821313..327e48d19509 100644 --- a/src/evolution_scene.c +++ b/src/evolution_scene.c @@ -252,7 +252,7 @@ void EvolutionScene(struct Pokemon* mon, u16 postEvoSpecies, bool8 canStopEvo, u AllocateMonSpritesGfx(); GetMonData(mon, MON_DATA_NICKNAME, name); - StringCopy10(gStringVar1, name); + StringCopy_Nickname(gStringVar1, name); StringCopy(gStringVar2, gSpeciesNames[postEvoSpecies]); // preEvo sprite @@ -474,7 +474,7 @@ void TradeEvolutionScene(struct Pokemon* mon, u16 postEvoSpecies, u8 preEvoSprit u8 ID; GetMonData(mon, MON_DATA_NICKNAME, name); - StringCopy10(gStringVar1, name); + StringCopy_Nickname(gStringVar1, name); StringCopy(gStringVar2, gSpeciesNames[postEvoSpecies]); gAffineAnimsDisabled = TRUE; @@ -787,7 +787,7 @@ static void Task_EvolutionScene(u8 taskId) gTasks[taskId].tLearnsFirstMove = FALSE; gTasks[taskId].tLearnMoveState = MVSTATE_INTRO_MSG_1; GetMonData(mon, MON_DATA_NICKNAME, text); - StringCopy10(gBattleTextBuff1, text); + StringCopy_Nickname(gBattleTextBuff1, text); if (var == MON_HAS_MAX_MOVES) gTasks[taskId].tState = EVOSTATE_REPLACE_MOVE; @@ -1202,7 +1202,7 @@ static void Task_TradeEvolutionScene(u8 taskId) gTasks[taskId].tLearnsFirstMove = FALSE; gTasks[taskId].tLearnMoveState = 0; GetMonData(mon, MON_DATA_NICKNAME, text); - StringCopy10(gBattleTextBuff1, text); + StringCopy_Nickname(gBattleTextBuff1, text); if (var == MON_HAS_MAX_MOVES) gTasks[taskId].tState = T_EVOSTATE_REPLACE_MOVE; diff --git a/src/faraway_island.c b/src/faraway_island.c index 3927d9ad545e..9ddb66de5c2e 100755 --- a/src/faraway_island.c +++ b/src/faraway_island.c @@ -7,7 +7,6 @@ #include "sprite.h" #include "constants/event_objects.h" #include "constants/field_effects.h" -#include "constants/maps.h" #include "constants/metatile_behaviors.h" static u8 GetValidMewMoveDirection(u8); diff --git a/src/field_control_avatar.c b/src/field_control_avatar.c index 6d338c06d7ed..8d6b564d2590 100644 --- a/src/field_control_avatar.c +++ b/src/field_control_avatar.c @@ -32,7 +32,6 @@ #include "constants/event_objects.h" #include "constants/field_poison.h" #include "constants/map_types.h" -#include "constants/maps.h" #include "constants/songs.h" #include "constants/trainer_hill.h" @@ -691,7 +690,7 @@ static bool8 TryArrowWarp(struct MapPosition *position, u16 metatileBehavior, u8 { s8 warpEventId = GetWarpEventAtMapPosition(&gMapHeader, position); - if (IsArrowWarpMetatileBehavior(metatileBehavior, direction) == TRUE && warpEventId != -1) + if (IsArrowWarpMetatileBehavior(metatileBehavior, direction) == TRUE && warpEventId != WARP_ID_NONE) { StoreInitialPlayerAvatarState(); SetupWarp(&gMapHeader, warpEventId, position); @@ -705,7 +704,7 @@ static bool8 TryStartWarpEventScript(struct MapPosition *position, u16 metatileB { s8 warpEventId = GetWarpEventAtMapPosition(&gMapHeader, position); - if (warpEventId != -1 && IsWarpMetatileBehavior(metatileBehavior) == TRUE) + if (warpEventId != WARP_ID_NONE && IsWarpMetatileBehavior(metatileBehavior) == TRUE) { StoreInitialPlayerAvatarState(); SetupWarp(&gMapHeader, warpEventId, position); @@ -847,7 +846,7 @@ static bool8 TryDoorWarp(struct MapPosition *position, u16 metatileBehavior, u8 if (MetatileBehavior_IsWarpDoor(metatileBehavior) == TRUE) { warpEventId = GetWarpEventAtMapPosition(&gMapHeader, position); - if (warpEventId != -1 && IsWarpMetatileBehavior(metatileBehavior) == TRUE) + if (warpEventId != WARP_ID_NONE && IsWarpMetatileBehavior(metatileBehavior) == TRUE) { StoreInitialPlayerAvatarState(); SetupWarp(&gMapHeader, warpEventId, position); @@ -873,7 +872,7 @@ static s8 GetWarpEventAtPosition(struct MapHeader *mapHeader, u16 x, u16 y, u8 e return i; } } - return -1; + return WARP_ID_NONE; } static u8 *TryRunCoordEventScript(struct CoordEvent *coordEvent) diff --git a/src/field_door.c b/src/field_door.c index f53e83d7a697..988ea615d0ca 100644 --- a/src/field_door.c +++ b/src/field_door.c @@ -5,7 +5,6 @@ #include "fieldmap.h" #include "metatile_behavior.h" #include "task.h" -#include "constants/maps.h" #include "constants/songs.h" #include "constants/metatile_labels.h" diff --git a/src/field_player_avatar.c b/src/field_player_avatar.c index 9e54823a63a8..6cf468b3e00c 100644 --- a/src/field_player_avatar.c +++ b/src/field_player_avatar.c @@ -26,7 +26,6 @@ #include "constants/event_object_movement.h" #include "constants/field_effects.h" #include "constants/items.h" -#include "constants/maps.h" #include "constants/moves.h" #include "constants/songs.h" #include "constants/trainer_types.h" diff --git a/src/field_poison.c b/src/field_poison.c index 132ce571e180..90013243cd8a 100644 --- a/src/field_poison.c +++ b/src/field_poison.c @@ -50,7 +50,7 @@ static void FaintFromFieldPoison(u8 partyIdx) AdjustFriendship(pokemon, FRIENDSHIP_EVENT_FAINT_FIELD_PSN); SetMonData(pokemon, MON_DATA_STATUS, &status); GetMonData(pokemon, MON_DATA_NICKNAME, gStringVar1); - StringGetEnd10(gStringVar1); + StringGet_Nickname(gStringVar1); } static bool32 MonFaintedFromPoison(u8 partyIdx) diff --git a/src/field_screen_effect.c b/src/field_screen_effect.c index 0cf5e414569a..eda14672588f 100644 --- a/src/field_screen_effect.c +++ b/src/field_screen_effect.c @@ -35,7 +35,6 @@ #include "trainer_hill.h" #include "fldeff.h" -// This file's functions. static void Task_ExitNonAnimDoor(u8); static void Task_ExitNonDoor(u8); static void Task_DoContestHallWarp(u8); @@ -50,9 +49,9 @@ static void Task_EnableScriptAfterMusicFade(u8 taskId); // data[0] is used universally by tasks in this file as a state for switches #define tState data[0] -// const -static const u16 sFlashLevelPixelRadii[] = { 200, 72, 64, 56, 48, 40, 32, 24, 0 }; -const s32 gMaxFlashLevel = ARRAY_COUNT(sFlashLevelPixelRadii) - 1; +// Smaller flash level -> larger flash radius +static const u16 sFlashLevelToRadius[] = { 200, 72, 64, 56, 48, 40, 32, 24, 0 }; +const s32 gMaxFlashLevel = ARRAY_COUNT(sFlashLevelToRadius) - 1; const struct ScanlineEffectParams sFlashEffectParams = { @@ -503,7 +502,7 @@ void DoDiveWarp(void) CreateTask(Task_WarpAndLoadMap, 10); } -void DoSootopolisLegendWarp(void) +void DoWhiteFadeWarp(void) { ScriptContext2_Enable(); TryFadeOutOldMapMusic(); @@ -971,14 +970,14 @@ static u8 StartUpdateOrbFlashEffect(s32 centerX, s32 centerY, s32 initialFlashRa #undef tFlashRadiusDelta #undef tClearScanlineEffect -// A higher flashLevel value is a smaller flash radius (more darkness). 0 is full brightness -void AnimateFlash(u8 flashLevel) +// A higher flash level is a smaller flash radius (more darkness). 0 is full brightness +void AnimateFlash(u8 newFlashLevel) { - u8 curFlashLevel = Overworld_GetFlashLevel(); + u8 curFlashLevel = GetFlashLevel(); bool8 fullBrightness = FALSE; - if (!flashLevel) + if (newFlashLevel == 0) fullBrightness = TRUE; - StartUpdateFlashLevelEffect(DISPLAY_WIDTH / 2, DISPLAY_HEIGHT / 2, sFlashLevelPixelRadii[curFlashLevel], sFlashLevelPixelRadii[flashLevel], fullBrightness, 1); + StartUpdateFlashLevelEffect(DISPLAY_WIDTH / 2, DISPLAY_HEIGHT / 2, sFlashLevelToRadius[curFlashLevel], sFlashLevelToRadius[newFlashLevel], fullBrightness, 1); StartWaitForFlashUpdate(); ScriptContext2_Enable(); } @@ -987,7 +986,7 @@ void WriteFlashScanlineEffectBuffer(u8 flashLevel) { if (flashLevel) { - SetFlashScanlineEffectWindowBoundaries(&gScanlineEffectRegBuffers[0][0], DISPLAY_WIDTH / 2, DISPLAY_HEIGHT / 2, sFlashLevelPixelRadii[flashLevel]); + SetFlashScanlineEffectWindowBoundaries(&gScanlineEffectRegBuffers[0][0], DISPLAY_WIDTH / 2, DISPLAY_HEIGHT / 2, sFlashLevelToRadius[flashLevel]); CpuFastSet(&gScanlineEffectRegBuffers[0], &gScanlineEffectRegBuffers[1], 480); } } diff --git a/src/field_special_scene.c b/src/field_special_scene.c index 39e5d669809a..d8b9eb05d16f 100644 --- a/src/field_special_scene.c +++ b/src/field_special_scene.c @@ -325,7 +325,7 @@ void Task_HandlePorthole(u8 taskId) static void ShowSSTidalWhileSailing(void) { - u8 spriteId = AddPseudoObjectEvent(OBJ_EVENT_GFX_SS_TIDAL, SpriteCallbackDummy, 112, 80, 0); + u8 spriteId = CreateObjectGraphicsSprite(OBJ_EVENT_GFX_SS_TIDAL, SpriteCallbackDummy, 112, 80, 0); gSprites[spriteId].coordOffsetEnabled = FALSE; @@ -349,7 +349,7 @@ void LookThroughPorthole(void) FlagSet(FLAG_SYS_CRUISE_MODE); FlagSet(FLAG_DONT_TRANSITION_MUSIC); FlagSet(FLAG_HIDE_MAP_NAME_POPUP); - SetDynamicWarp(0, gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, -1); + SetDynamicWarp(0, gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, WARP_ID_NONE); TrySetPortholeWarpDestination(); DoPortholeWarp(); } diff --git a/src/field_specials.c b/src/field_specials.c index ef569ca0061c..96eb949e5579 100644 --- a/src/field_specials.c +++ b/src/field_specials.c @@ -55,7 +55,6 @@ #include "constants/items.h" #include "constants/heal_locations.h" #include "constants/map_types.h" -#include "constants/maps.h" #include "constants/mystery_gift.h" #include "constants/script_menu.h" #include "constants/slot_machine.h" @@ -960,13 +959,9 @@ u8 GetBattleOutcome(void) void CableCarWarp(void) { if (gSpecialVar_0x8004 != 0) - { - SetWarpDestination(MAP_GROUP(ROUTE112_CABLE_CAR_STATION), MAP_NUM(ROUTE112_CABLE_CAR_STATION), -1, 6, 4); - } + SetWarpDestination(MAP_GROUP(ROUTE112_CABLE_CAR_STATION), MAP_NUM(ROUTE112_CABLE_CAR_STATION), WARP_ID_NONE, 6, 4); else - { - SetWarpDestination(MAP_GROUP(MT_CHIMNEY_CABLE_CAR_STATION), MAP_NUM(MT_CHIMNEY_CABLE_CAR_STATION), -1, 6, 4); - } + SetWarpDestination(MAP_GROUP(MT_CHIMNEY_CABLE_CAR_STATION), MAP_NUM(MT_CHIMNEY_CABLE_CAR_STATION), WARP_ID_NONE, 6, 4); } void SetHiddenItemFlag(void) @@ -1335,15 +1330,40 @@ void BufferEReaderTrainerName(void) u16 GetSlotMachineId(void) { - static const u8 sSlotMachineRandomSeeds[] = {12, 2, 4, 5, 1, 8, 7, 11, 3, 10, 9, 6}; - static const u8 sSlotMachineIds[] = {0, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 5}; - static const u8 sSlotMachineServiceDayIds[] = {3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5}; + static const u8 sSlotMachineRandomSeeds[SLOT_MACHINE_COUNT] = {12, 2, 4, 5, 1, 8, 7, 11, 3, 10, 9, 6}; + static const u8 sSlotMachineIds[SLOT_MACHINE_COUNT] = { + SLOT_MACHINE_UNLUCKIEST, + SLOT_MACHINE_UNLUCKIER, + SLOT_MACHINE_UNLUCKIER, + SLOT_MACHINE_UNLUCKY, + SLOT_MACHINE_UNLUCKY, + SLOT_MACHINE_UNLUCKY, + SLOT_MACHINE_LUCKY, + SLOT_MACHINE_LUCKY, + SLOT_MACHINE_LUCKY, + SLOT_MACHINE_LUCKIER, + SLOT_MACHINE_LUCKIER, + SLOT_MACHINE_LUCKIEST + }; + static const u8 sSlotMachineServiceDayIds[SLOT_MACHINE_COUNT] = { + SLOT_MACHINE_LUCKY, + SLOT_MACHINE_LUCKY, + SLOT_MACHINE_LUCKY, + SLOT_MACHINE_LUCKY, + SLOT_MACHINE_LUCKY, + SLOT_MACHINE_LUCKY, + SLOT_MACHINE_LUCKIER, + SLOT_MACHINE_LUCKIER, + SLOT_MACHINE_LUCKIER, + SLOT_MACHINE_LUCKIER, + SLOT_MACHINE_LUCKIEST, + SLOT_MACHINE_LUCKIEST + }; u32 rnd = gSaveBlock1Ptr->dewfordTrends[0].trendiness + gSaveBlock1Ptr->dewfordTrends[0].rand + sSlotMachineRandomSeeds[gSpecialVar_0x8004]; - if (GetPriceReduction(POKENEWS_GAME_CORNER)) - { + if (IsPokeNewsActive(POKENEWS_GAME_CORNER)) return sSlotMachineServiceDayIds[rnd % SLOT_MACHINE_COUNT]; - } + return sSlotMachineIds[rnd % SLOT_MACHINE_COUNT]; } @@ -1550,17 +1570,13 @@ bool8 FoundBlackGlasses(void) void SetRoute119Weather(void) { if (IsMapTypeOutdoors(GetLastUsedWarpMapType()) != TRUE) - { - SetSav1Weather(WEATHER_ROUTE119_CYCLE); - } + SetSavedWeather(WEATHER_ROUTE119_CYCLE); } void SetRoute123Weather(void) { if (IsMapTypeOutdoors(GetLastUsedWarpMapType()) != TRUE) - { - SetSav1Weather(WEATHER_ROUTE123_CYCLE); - } + SetSavedWeather(WEATHER_ROUTE123_CYCLE); } u8 GetLeadMonIndex(void) @@ -3029,6 +3045,8 @@ void CloseFrontierExchangeCornerItemIconWindow(void) RemoveWindow(sFrontierExchangeCorner_ItemIconWindowId); } +#define TAG_ITEM_ICON 5500 + static void FillFrontierExchangeCornerWindowAndItemIcon(u16 menu, u16 selection) { #include "data/battle_frontier/battle_frontier_exchange_corner.h" @@ -3046,9 +3064,9 @@ static void FillFrontierExchangeCornerWindowAndItemIcon(u16 menu, u16 selection) } else { - FreeSpriteTilesByTag(5500); - FreeSpritePaletteByTag(5500); - sScrollableMultichoice_ItemSpriteId = AddDecorationIconObject(sFrontierExchangeCorner_Decor1[selection], 33, 88, 0, 5500, 5500); + FreeSpriteTilesByTag(TAG_ITEM_ICON); + FreeSpritePaletteByTag(TAG_ITEM_ICON); + sScrollableMultichoice_ItemSpriteId = AddDecorationIconObject(sFrontierExchangeCorner_Decor1[selection], 33, 88, 0, TAG_ITEM_ICON, TAG_ITEM_ICON); } break; case SCROLL_MULTI_BF_EXCHANGE_CORNER_DECOR_VENDOR_2: @@ -3059,9 +3077,9 @@ static void FillFrontierExchangeCornerWindowAndItemIcon(u16 menu, u16 selection) } else { - FreeSpriteTilesByTag(5500); - FreeSpritePaletteByTag(5500); - sScrollableMultichoice_ItemSpriteId = AddDecorationIconObject(sFrontierExchangeCorner_Decor2[selection], 33, 88, 0, 5500, 5500); + FreeSpriteTilesByTag(TAG_ITEM_ICON); + FreeSpritePaletteByTag(TAG_ITEM_ICON); + sScrollableMultichoice_ItemSpriteId = AddDecorationIconObject(sFrontierExchangeCorner_Decor2[selection], 33, 88, 0, TAG_ITEM_ICON, TAG_ITEM_ICON); } break; case SCROLL_MULTI_BF_EXCHANGE_CORNER_VITAMIN_VENDOR: @@ -3078,9 +3096,9 @@ static void FillFrontierExchangeCornerWindowAndItemIcon(u16 menu, u16 selection) static void ShowFrontierExchangeCornerItemIcon(u16 item) { - FreeSpriteTilesByTag(5500); - FreeSpritePaletteByTag(5500); - sScrollableMultichoice_ItemSpriteId = AddItemIconSprite(5500, 5500, item); + FreeSpriteTilesByTag(TAG_ITEM_ICON); + FreeSpritePaletteByTag(TAG_ITEM_ICON); + sScrollableMultichoice_ItemSpriteId = AddItemIconSprite(TAG_ITEM_ICON, TAG_ITEM_ICON, item); if (sScrollableMultichoice_ItemSpriteId != MAX_SPRITES) { @@ -3416,7 +3434,7 @@ static void ChangeDeoxysRockLevel(u8 rockLevel) gFieldEffectArguments[5] = 5; FieldEffectStart(FLDEFF_MOVE_DEOXYS_ROCK); - Overworld_SetObjEventTemplateCoords(1, sDeoxysRockCoords[rockLevel][0], sDeoxysRockCoords[rockLevel][1]); + SetObjEventTemplateCoords(LOCALID_BIRTH_ISLAND_EXTERIOR_ROCK, sDeoxysRockCoords[rockLevel][0], sDeoxysRockCoords[rockLevel][1]); } static void WaitForDeoxysRockMovement(u8 taskId) diff --git a/src/field_tasks.c b/src/field_tasks.c index 187270f7a8be..760d853693d9 100644 --- a/src/field_tasks.c +++ b/src/field_tasks.c @@ -21,20 +21,40 @@ #include "constants/songs.h" #include "constants/metatile_labels.h" +/* This file handles some persistent tasks that run in the overworld. + * - Task_RunTimeBasedEvents: Periodically updates local time and RTC events. Also triggers ambient cries. + * - Task_MuddySlope: Handles the metatile animation when the player steps on muddy slopes. + * - Task_RunPerStepCallback: Calls one of the functions in sPerStepCallbacks, listed below... + * . DummyPerStepCallback: Default, does nothing + * . AshGrassPerStepCallback: Removes the ash from ash-covered grass that the player steps on. + * . FortreeBridgePerStepCallback: Depresses Fortree log bridges that the player steps on. + * . PacifidlogBridgePerStepCallback: Submerges Pacifidlog log bridges that the player steps on. + * . SootopolisGymIcePerStepCallback: Cracks/breaks ice in Sootopolis Gym that the player steps on. + * . EndTruckSequence: Sets the moving truck boxes to their final position when the truck sequence ends. + * . SecretBasePerStepCallback: Records the decorations in a friend's secret base that the player steps on. + * . CrackedFloorPerStepCallback: Breaks cracked floors that the player steps on. + * + * NOTE: "PerStep" is perhaps misleading. One function in sPerStepCallbacks is called + * every frame while in the overworld by Task_RunPerStepCallback regardless of + * whether or not steps are being taken. However, nearly all of the functions in + * the table check if the player has moved from their previous position before + * doing anything else. + */ + struct PacifidlogMetatileOffsets { s8 x; s8 y; - u16 tileId; + u16 metatileId; }; -static void DummyPerStepCallback(u8 taskId); -static void AshGrassPerStepCallback(u8 taskId); -static void FortreeBridgePerStepCallback(u8 taskId); -static void PacifidlogBridgePerStepCallback(u8 taskId); -static void SootopolisGymIcePerStepCallback(u8 taskId); -static void CrackedFloorPerStepCallback(u8 taskId); -static void Task_MuddySlope(u8 taskId); +static void DummyPerStepCallback(u8); +static void AshGrassPerStepCallback(u8); +static void FortreeBridgePerStepCallback(u8); +static void PacifidlogBridgePerStepCallback(u8); +static void SootopolisGymIcePerStepCallback(u8); +static void CrackedFloorPerStepCallback(u8); +static void Task_MuddySlope(u8); static const TaskFunc sPerStepCallbacks[] = { @@ -48,29 +68,35 @@ static const TaskFunc sPerStepCallbacks[] = [STEP_CB_CRACKED_FLOOR] = CrackedFloorPerStepCallback }; -// they are in pairs but declared as 1D array +// Each array has 4 pairs of data, each pair representing two metatiles of a log and their relative position. +// The 4 pairs are for: +// 0: If the player is standing on the top of a vertical log +// 1: If the player is standing on the bottom of a vertical log +// 2: If the player is standing on the left of a horizontal log +// 3: If the player is standing on the right of a horizontal log +// i.e. the element with an offset of 0,0 is the one the player is standing on. static const struct PacifidlogMetatileOffsets sHalfSubmergedBridgeMetatileOffsets[] = { - { 0, 0, METATILE_Pacifidlog_HalfSubmergedLogs_Vertical0}, {0, 1, METATILE_Pacifidlog_HalfSubmergedLogs_Vertical1}, - { 0, -1, METATILE_Pacifidlog_HalfSubmergedLogs_Vertical0}, {0, 0, METATILE_Pacifidlog_HalfSubmergedLogs_Vertical1}, - { 0, 0, METATILE_Pacifidlog_HalfSubmergedLogs_Horizontal0}, {1, 0, METATILE_Pacifidlog_HalfSubmergedLogs_Horizontal1}, - {-1, 0, METATILE_Pacifidlog_HalfSubmergedLogs_Horizontal0}, {0, 0, METATILE_Pacifidlog_HalfSubmergedLogs_Horizontal1} + { 0, 0, METATILE_Pacifidlog_HalfSubmergedLogs_VerticalTop}, {0, 1, METATILE_Pacifidlog_HalfSubmergedLogs_VerticalBottom}, + { 0, -1, METATILE_Pacifidlog_HalfSubmergedLogs_VerticalTop}, {0, 0, METATILE_Pacifidlog_HalfSubmergedLogs_VerticalBottom}, + { 0, 0, METATILE_Pacifidlog_HalfSubmergedLogs_HorizontalLeft}, {1, 0, METATILE_Pacifidlog_HalfSubmergedLogs_HorizontalRight}, + {-1, 0, METATILE_Pacifidlog_HalfSubmergedLogs_HorizontalLeft}, {0, 0, METATILE_Pacifidlog_HalfSubmergedLogs_HorizontalRight} }; static const struct PacifidlogMetatileOffsets sFullySubmergedBridgeMetatileOffsets[] = { - { 0, 0, METATILE_Pacifidlog_SubmergedLogs_Vertical0}, {0, 1, METATILE_Pacifidlog_SubmergedLogs_Vertical1}, - { 0, -1, METATILE_Pacifidlog_SubmergedLogs_Vertical0}, {0, 0, METATILE_Pacifidlog_SubmergedLogs_Vertical1}, - { 0, 0, METATILE_Pacifidlog_SubmergedLogs_Horizontal0}, {1, 0, METATILE_Pacifidlog_SubmergedLogs_Horizontal1}, - {-1, 0, METATILE_Pacifidlog_SubmergedLogs_Horizontal0}, {0, 0, METATILE_Pacifidlog_SubmergedLogs_Horizontal1} + { 0, 0, METATILE_Pacifidlog_SubmergedLogs_VerticalTop}, {0, 1, METATILE_Pacifidlog_SubmergedLogs_VerticalBottom}, + { 0, -1, METATILE_Pacifidlog_SubmergedLogs_VerticalTop}, {0, 0, METATILE_Pacifidlog_SubmergedLogs_VerticalBottom}, + { 0, 0, METATILE_Pacifidlog_SubmergedLogs_HorizontalLeft}, {1, 0, METATILE_Pacifidlog_SubmergedLogs_HorizontalRight}, + {-1, 0, METATILE_Pacifidlog_SubmergedLogs_HorizontalLeft}, {0, 0, METATILE_Pacifidlog_SubmergedLogs_HorizontalRight} }; static const struct PacifidlogMetatileOffsets sFloatingBridgeMetatileOffsets[] = { - { 0, 0, METATILE_Pacifidlog_FloatingLogs_Vertical0}, {0, 1, METATILE_Pacifidlog_FloatingLogs_Vertical1}, - { 0, -1, METATILE_Pacifidlog_FloatingLogs_Vertical0}, {0, 0, METATILE_Pacifidlog_FloatingLogs_Vertical1}, - { 0, 0, METATILE_Pacifidlog_FloatingLogs_Horizontal0}, {1, 0, METATILE_Pacifidlog_FloatingLogs_Horizontal1}, - {-1, 0, METATILE_Pacifidlog_FloatingLogs_Horizontal0}, {0, 0, METATILE_Pacifidlog_FloatingLogs_Horizontal1} + { 0, 0, METATILE_Pacifidlog_FloatingLogs_VerticalTop}, {0, 1, METATILE_Pacifidlog_FloatingLogs_VerticalBottom}, + { 0, -1, METATILE_Pacifidlog_FloatingLogs_VerticalTop}, {0, 0, METATILE_Pacifidlog_FloatingLogs_VerticalBottom}, + { 0, 0, METATILE_Pacifidlog_FloatingLogs_HorizontalLeft}, {1, 0, METATILE_Pacifidlog_FloatingLogs_HorizontalRight}, + {-1, 0, METATILE_Pacifidlog_FloatingLogs_HorizontalLeft}, {0, 0, METATILE_Pacifidlog_FloatingLogs_HorizontalRight} }; // Each element corresponds to a y coordinate row in the sootopolis gym 1F map. @@ -104,16 +130,11 @@ static const u16 sSootopolisGymIceRowVars[] = 0 }; -static const u16 sMuddySlopeMetatiles[] = { - METATILE_General_MuddySlope_Frame0, - METATILE_General_MuddySlope_Frame3, - METATILE_General_MuddySlope_Frame2, - METATILE_General_MuddySlope_Frame1 -}; +#define tCallbackId data[0] static void Task_RunPerStepCallback(u8 taskId) { - int idx = gTasks[taskId].data[0]; + int idx = gTasks[taskId].tCallbackId; sPerStepCallbacks[idx](taskId); } @@ -121,23 +142,23 @@ static void Task_RunPerStepCallback(u8 taskId) #define tAmbientCryState data[1] #define tAmbientCryDelay data[2] +#define TIME_UPDATE_INTERVAL (1 << 12) + static void RunTimeBasedEvents(s16 *data) { switch (tState) { - case 0: - if (gMain.vblankCounter1 & 0x1000) - { - DoTimeBasedEvents(); - tState++; - } - break; - case 1: - if (!(gMain.vblankCounter1 & 0x1000)) - { - tState--; - } - break; + case 0: + if (gMain.vblankCounter1 & TIME_UPDATE_INTERVAL) + { + DoTimeBasedEvents(); + tState++; + } + break; + case 1: + if (!(gMain.vblankCounter1 & TIME_UPDATE_INTERVAL)) + tState--; + break; } } @@ -153,22 +174,20 @@ static void Task_RunTimeBasedEvents(u8 taskId) } #undef tState -#undef tAmbientCryState -#undef tAmbientCryDelay void SetUpFieldTasks(void) { if (!FuncIsActiveTask(Task_RunPerStepCallback)) { - u8 taskId = CreateTask(Task_RunPerStepCallback, 0x50); - gTasks[taskId].data[0] = 0; + u8 taskId = CreateTask(Task_RunPerStepCallback, 80); + gTasks[taskId].tCallbackId = STEP_CB_DUMMY; } if (!FuncIsActiveTask(Task_MuddySlope)) - CreateTask(Task_MuddySlope, 0x50); + CreateTask(Task_MuddySlope, 80); if (!FuncIsActiveTask(Task_RunTimeBasedEvents)) - CreateTask(Task_RunTimeBasedEvents, 0x50); + CreateTask(Task_RunTimeBasedEvents, 80); } void ActivatePerStepCallback(u8 callbackId) @@ -179,17 +198,13 @@ void ActivatePerStepCallback(u8 callbackId) s32 i; s16 *data = gTasks[taskId].data; - for (i = 0; i < 16; i++) + for (i = 0; i < NUM_TASK_DATA; i++) data[i] = 0; if (callbackId >= ARRAY_COUNT(sPerStepCallbacks)) - { - data[0] = 0; - } + tCallbackId = STEP_CB_DUMMY; else - { - data[0] = callbackId; - } + tCallbackId = callbackId; } } @@ -200,18 +215,20 @@ void ResetFieldTasksArgs(void) taskId = FindTaskIdByFunc(Task_RunPerStepCallback); if (taskId != TASK_NONE) - { data = gTasks[taskId].data; - } + taskId = FindTaskIdByFunc(Task_RunTimeBasedEvents); if (taskId != TASK_NONE) { data = gTasks[taskId].data; - data[1] = 0; - data[2] = 0; + tAmbientCryState = 0; + tAmbientCryDelay = 0; } } +#undef tAmbientCryState +#undef tAmbientCryDelay + static void DummyPerStepCallback(u8 taskId) { @@ -219,282 +236,377 @@ static void DummyPerStepCallback(u8 taskId) static const struct PacifidlogMetatileOffsets *GetPacifidlogBridgeMetatileOffsets(const struct PacifidlogMetatileOffsets *offsets, u16 metatileBehavior) { - if (MetatileBehavior_IsPacifidlogVerticalLog1(metatileBehavior)) + if (MetatileBehavior_IsPacifidlogVerticalLogTop(metatileBehavior)) return &offsets[0 * 2]; - else if (MetatileBehavior_IsPacifidlogVerticalLog2(metatileBehavior)) + else if (MetatileBehavior_IsPacifidlogVerticalLogBottom(metatileBehavior)) return &offsets[1 * 2]; - else if (MetatileBehavior_IsPacifidlogHorizontalLog1(metatileBehavior)) + else if (MetatileBehavior_IsPacifidlogHorizontalLogLeft(metatileBehavior)) return &offsets[2 * 2]; - else if (MetatileBehavior_IsPacifidlogHorizontalLog2(metatileBehavior)) + else if (MetatileBehavior_IsPacifidlogHorizontalLogRight(metatileBehavior)) return &offsets[3 * 2]; else return NULL; } -static void SetPacifidlogBridgeMetatiles(const struct PacifidlogMetatileOffsets *offsets, s16 x, s16 y, bool32 redrawMap) +static void TrySetPacifidlogBridgeMetatiles(const struct PacifidlogMetatileOffsets *offsets, s16 x, s16 y, bool32 redrawMap) { offsets = GetPacifidlogBridgeMetatileOffsets(offsets, MapGridGetMetatileBehaviorAt(x, y)); + + // If offsets is NULL, position is not a log (don't set it) if (offsets) { - MapGridSetMetatileIdAt(x + offsets[0].x, y + offsets[0].y, offsets[0].tileId); + // Set both metatiles of the log + MapGridSetMetatileIdAt(x + offsets[0].x, y + offsets[0].y, offsets[0].metatileId); if (redrawMap) CurrentMapDrawMetatileAt(x + offsets[0].x, y + offsets[0].y); - MapGridSetMetatileIdAt(x + offsets[1].x, y + offsets[1].y, offsets[1].tileId); + MapGridSetMetatileIdAt(x + offsets[1].x, y + offsets[1].y, offsets[1].metatileId); if (redrawMap) CurrentMapDrawMetatileAt(x + offsets[1].x, y + offsets[1].y); } } -static void UpdateHalfSubmergedBridgeMetatiles(s16 x, s16 y, bool32 redrawMap) +static void TrySetLogBridgeHalfSubmerged(s16 x, s16 y, bool32 redrawMap) { - SetPacifidlogBridgeMetatiles(sHalfSubmergedBridgeMetatileOffsets, x, y, redrawMap); + TrySetPacifidlogBridgeMetatiles(sHalfSubmergedBridgeMetatileOffsets, x, y, redrawMap); } -static void UpdateFullySubmergedBridgeMetatiles(s16 x, s16 y, bool32 redrawMap) +static void TrySetLogBridgeFullySubmerged(s16 x, s16 y, bool32 redrawMap) { - SetPacifidlogBridgeMetatiles(sFullySubmergedBridgeMetatileOffsets, x, y, redrawMap); + TrySetPacifidlogBridgeMetatiles(sFullySubmergedBridgeMetatileOffsets, x, y, redrawMap); } -static void UpdateFloatingBridgeMetatiles(s16 x, s16 y, bool32 redrawMap) +static void TrySetLogBridgeFloating(s16 x, s16 y, bool32 redrawMap) { - SetPacifidlogBridgeMetatiles(sFloatingBridgeMetatileOffsets, x, y, redrawMap); + TrySetPacifidlogBridgeMetatiles(sFloatingBridgeMetatileOffsets, x, y, redrawMap); } -static bool32 StandingOnNewPacifidlogBridge(s16 x1, s16 y1, s16 x2, s16 y2) +// Returns FALSE if player has moved from one end of a log to the other (log should remain submerged). +// Otherwise it returns TRUE. +static bool32 ShouldRaisePacifidlogLogs(s16 newX, s16 newY, s16 oldX, s16 oldY) { - u16 metatileBehavior = MapGridGetMetatileBehaviorAt(x2, y2); + u16 oldBehavior = MapGridGetMetatileBehaviorAt(oldX, oldY); - if (MetatileBehavior_IsPacifidlogVerticalLog1(metatileBehavior)) + if (MetatileBehavior_IsPacifidlogVerticalLogTop(oldBehavior)) { - if (y1 > y2) + // Still on same one if moved from top to bottom + if (newY > oldY) return FALSE; } - else if (MetatileBehavior_IsPacifidlogVerticalLog2(metatileBehavior)) + else if (MetatileBehavior_IsPacifidlogVerticalLogBottom(oldBehavior)) { - if (y1 < y2) + // Still on same one if moved from bottom to top + if (newY < oldY) return FALSE; } - else if (MetatileBehavior_IsPacifidlogHorizontalLog1(metatileBehavior)) + else if (MetatileBehavior_IsPacifidlogHorizontalLogLeft(oldBehavior)) { - if (x1 > x2) + // Still on same one if moved from left to right + if (newX > oldX) return FALSE; } - else if (MetatileBehavior_IsPacifidlogHorizontalLog2(metatileBehavior)) + else if (MetatileBehavior_IsPacifidlogHorizontalLogRight(oldBehavior)) { - if (x1 < x2) + // Still on same one if moved from right to left + if (newX < oldX) return FALSE; } + + // Player is either on a different log or no log at all return TRUE; } -static bool32 StandingOnSamePacifidlogBridge(s16 x1, s16 y1, s16 x2, s16 y2) +// Returns FALSE if player has moved from one end of a log to the other (log should remain submerged). +// Otherwise it returns TRUE. +// This is the effectively the same as ShouldRaisePacifidlogLogs, as it swaps both the conditions and which position's behavior to check. +// In effect the previous function asks "was the player's previous position not the other end of a log they're standing on?" +// while this function asks "is the player's current position not the other end of a log they were previously standing on?" +// and with the same positions both questions always have the same answer. +static bool32 ShouldSinkPacifidlogLogs(s16 newX, s16 newY, s16 oldX, s16 oldY) { - u16 metatileBehavior = MapGridGetMetatileBehaviorAt(x1, y1); + u16 newBehavior = MapGridGetMetatileBehaviorAt(newX, newY); - if (MetatileBehavior_IsPacifidlogVerticalLog1(metatileBehavior)) + if (MetatileBehavior_IsPacifidlogVerticalLogTop(newBehavior)) { - if (y1 < y2) + // Still on same one if moved from bottom to top + if (newY < oldY) return FALSE; } - else if (MetatileBehavior_IsPacifidlogVerticalLog2(metatileBehavior)) + else if (MetatileBehavior_IsPacifidlogVerticalLogBottom(newBehavior)) { - if (y1 > y2) + // Still on same one if moved from top to bottom + if (newY > oldY) return FALSE; } - else if (MetatileBehavior_IsPacifidlogHorizontalLog1(metatileBehavior)) + else if (MetatileBehavior_IsPacifidlogHorizontalLogLeft(newBehavior)) { - if (x1 < x2) + // Still on same one if moved from right to left + if (newX < oldX) return FALSE; } - else if (MetatileBehavior_IsPacifidlogHorizontalLog2(metatileBehavior)) + else if (MetatileBehavior_IsPacifidlogHorizontalLogRight(newBehavior)) { - if (x1 > x2) + // Still on same one if moved from left to right + if (newX > oldX) return FALSE; } return TRUE; } +#define tState data[1] +#define tPrevX data[2] +#define tPrevY data[3] +#define tToRaiseX data[4] +#define tToRaiseY data[5] +#define tDelay data[6] + static void PacifidlogBridgePerStepCallback(u8 taskId) { s16 *data; s16 x, y; data = gTasks[taskId].data; PlayerGetDestCoords(&x, &y); - switch (data[1]) + switch (tState) { - case 0: - data[2] = x; - data[3] = y; - UpdateFullySubmergedBridgeMetatiles(x, y, TRUE); - data[1] = 1; - break; - case 1: - if (x != data[2] || y != data[3]) - { - if (StandingOnNewPacifidlogBridge(x, y, data[2], data[3])) - { - UpdateHalfSubmergedBridgeMetatiles(data[2], data[3], TRUE); - UpdateFloatingBridgeMetatiles(data[2], data[3], FALSE); - data[4] = data[2]; - data[5] = data[3]; - data[1] = 2; - data[6] = 8; - } - else - { - data[4] = -1; - data[5] = -1; - } + case 0: + tPrevX = x; + tPrevY = y; + + // If player is already standing on a log when the callback + // is set then immediately set it to submerged + TrySetLogBridgeFullySubmerged(x, y, TRUE); + tState = 1; + break; + case 1: + // Skip if player hasn't moved + if (x == tPrevX && y == tPrevY) + return; + + if (ShouldRaisePacifidlogLogs(x, y, tPrevX, tPrevY)) + { + // Player's previous position is not the other end of a log + // they're standing on, try and set it half-submerged (rising to surface). + // The floating metatile is queued up by setting it but not drawing it, + // but this is pointless as state 2 will handle it in full anyway. + TrySetLogBridgeHalfSubmerged(tPrevX, tPrevY, TRUE); + TrySetLogBridgeFloating(tPrevX, tPrevY, FALSE); + tToRaiseX = tPrevX; + tToRaiseY = tPrevY; + tState = 2; + tDelay = 8; + } + else + { + // Player has moved but is still on the same log bridge section. + // Keep it submerged. + tToRaiseX = -1; + tToRaiseY = -1; + } - if (StandingOnSamePacifidlogBridge(x, y, data[2], data[3])) - { - UpdateHalfSubmergedBridgeMetatiles(x, y, TRUE); - data[1] = 2; - data[6] = 8; - } + if (ShouldSinkPacifidlogLogs(x, y, tPrevX, tPrevY)) + { + // Player's current position is not the other end of a log + // they were previously standing on, try and set it half-submerged (sinking) + TrySetLogBridgeHalfSubmerged(x, y, TRUE); + tState = 2; + tDelay = 8; + } - data[2] = x; - data[3] = y; - if (MetatileBehavior_IsPacifidlogLog(MapGridGetMetatileBehaviorAt(x, y))) - PlaySE(SE_PUDDLE); - } - break; - case 2: - if ((--data[6]) == 0) - { - UpdateFullySubmergedBridgeMetatiles(x, y, TRUE); - if (data[4] != -1 && data[5] != -1) - UpdateFloatingBridgeMetatiles(data[4], data[5], TRUE); + tPrevX = x; + tPrevY = y; - data[1] = 1; - } - break; + // If player's new position is a log play the puddle SE + if (MetatileBehavior_IsPacifidlogLog(MapGridGetMetatileBehaviorAt(x, y))) + PlaySE(SE_PUDDLE); + break; + case 2: + if (--tDelay == 0) + { + // If player's current position is a log submerge it fully. + TrySetLogBridgeFullySubmerged(x, y, TRUE); + + // Player's previous position is not the other end of a log + // they're standing on, try to raise their previous position. + if (tToRaiseX != -1 && tToRaiseY != -1) + TrySetLogBridgeFloating(tToRaiseX, tToRaiseY, TRUE); + + tState = 1; + } + break; } } -static void SetLoweredForetreeBridgeMetatile(s16 x, s16 y) +#undef tState +#undef tPrevX +#undef tPrevY +#undef tToRaiseX +#undef tToRaiseY +#undef tDelay + +static void TryLowerFortreeBridge(s16 x, s16 y) { u8 z = PlayerGetZCoord(); if (!(z & 1)) { switch (MapGridGetMetatileIdAt(x, y)) { - case METATILE_Fortree_BridgeOverGrass_Raised: - MapGridSetMetatileIdAt(x, y, METATILE_Fortree_BridgeOverGrass_Lowered); - break; - case METATILE_Fortree_BridgeOverTrees_Raised: - MapGridSetMetatileIdAt(x, y, METATILE_Fortree_BridgeOverTrees_Lowered); - break; + case METATILE_Fortree_BridgeOverGrass_Raised: + MapGridSetMetatileIdAt(x, y, METATILE_Fortree_BridgeOverGrass_Lowered); + break; + case METATILE_Fortree_BridgeOverTrees_Raised: + MapGridSetMetatileIdAt(x, y, METATILE_Fortree_BridgeOverTrees_Lowered); + break; } } } -static void SetNormalFortreeBridgeMetatile(s16 x, s16 y) +static void TryRaiseFortreeBridge(s16 x, s16 y) { u8 z = PlayerGetZCoord(); if (!(z & 1)) { switch (MapGridGetMetatileIdAt(x, y)) { - case METATILE_Fortree_BridgeOverGrass_Lowered: - MapGridSetMetatileIdAt(x, y, METATILE_Fortree_BridgeOverGrass_Raised); - break; - case METATILE_Fortree_BridgeOverTrees_Lowered: - MapGridSetMetatileIdAt(x, y, METATILE_Fortree_BridgeOverTrees_Raised); - break; + case METATILE_Fortree_BridgeOverGrass_Lowered: + MapGridSetMetatileIdAt(x, y, METATILE_Fortree_BridgeOverGrass_Raised); + break; + case METATILE_Fortree_BridgeOverTrees_Lowered: + MapGridSetMetatileIdAt(x, y, METATILE_Fortree_BridgeOverTrees_Raised); + break; } } } +#define tState data[1] +#define tPrevX data[2] +#define tPrevY data[3] +#define tOldBridgeX data[4] +#define tOldBridgeY data[5] +#define tBounceTime data[6] + static void FortreeBridgePerStepCallback(u8 taskId) { bool8 isFortreeBridgeCur; bool8 isFortreeBridgePrev; - u8 z, flag; - s16 x, y, x2, y2; + u8 z, onBridgeElevation; + s16 x, y, prevX, prevY; s16 *data = gTasks[taskId].data; PlayerGetDestCoords(&x, &y); - switch (data[1]) + switch (tState) { - default: - break; - case 0: - data[2] = x; - data[3] = y; - if (MetatileBehavior_IsFortreeBridge(MapGridGetMetatileBehaviorAt(x, y))) - { - SetLoweredForetreeBridgeMetatile(x, y); - CurrentMapDrawMetatileAt(x, y); - } - data[1] = 1; + default: + break; + case 0: + tPrevX = x; + tPrevY = y; + + // If player is already on bridge when callback is set then lower it immediately. + if (MetatileBehavior_IsFortreeBridge(MapGridGetMetatileBehaviorAt(x, y))) + { + TryLowerFortreeBridge(x, y); + CurrentMapDrawMetatileAt(x, y); + } + tState = 1; + break; + case 1: + prevX = tPrevX; + prevY = tPrevY; + + // Skip if player hasn't moved + if (x == prevX && y == prevY) break; - case 1: - x2 = data[2]; - y2 = data[3]; - if (x == x2 && y == y2) - break; - - isFortreeBridgeCur = MetatileBehavior_IsFortreeBridge(MapGridGetMetatileBehaviorAt(x, y)); - isFortreeBridgePrev = MetatileBehavior_IsFortreeBridge(MapGridGetMetatileBehaviorAt(x2, y2)); - z = PlayerGetZCoord(); - flag = 0; - if ((u8)(z & 1) == 0) - flag = 1; - - if (flag && (isFortreeBridgeCur == 1 || isFortreeBridgePrev == 1)) - PlaySE(SE_BRIDGE_WALK); - - if (isFortreeBridgePrev) - { - SetNormalFortreeBridgeMetatile(x2, y2); - CurrentMapDrawMetatileAt(x2, y2); - SetLoweredForetreeBridgeMetatile(x, y); - CurrentMapDrawMetatileAt(x, y); - } - data[4] = x2; - data[5] = y2; - data[2] = x; - data[3] = y; - if (!isFortreeBridgePrev) - break; + isFortreeBridgeCur = MetatileBehavior_IsFortreeBridge(MapGridGetMetatileBehaviorAt(x, y)); + isFortreeBridgePrev = MetatileBehavior_IsFortreeBridge(MapGridGetMetatileBehaviorAt(prevX, prevY)); + + // Make sure player isn't below bridge + z = PlayerGetZCoord(); + onBridgeElevation = FALSE; + if ((u8)(z & 1) == 0) + onBridgeElevation = TRUE; + + if (onBridgeElevation && (isFortreeBridgeCur == TRUE || isFortreeBridgePrev == TRUE)) + PlaySE(SE_BRIDGE_WALK); + + // Because this doesn't check for isFortreeBridgeCur, bridge sections aren't + // lowered when first stepping onto them from anything other than another bridge. + #ifdef BUGFIX + if (isFortreeBridgePrev || isFortreeBridgeCur) + #else + if (isFortreeBridgePrev) + #endif + { + // Raise old bridge + TryRaiseFortreeBridge(prevX, prevY); + CurrentMapDrawMetatileAt(prevX, prevY); + + // Lower new bridge + TryLowerFortreeBridge(x, y); + CurrentMapDrawMetatileAt(x, y); + } + + // These should really be set below the !isFortreeBridgePrev conditional, + // but it doesn't matter because it's not read until case 2 anyway. + tOldBridgeX = prevX; + tOldBridgeY = prevY; + + tPrevX = x; + tPrevY = y; + if (!isFortreeBridgePrev) + break; - data[6] = 16; - data[1] = 2; - // fallthrough + tBounceTime = 16; + tState = 2; + // fallthrough + case 2: + tBounceTime--; + prevX = tOldBridgeX; + prevY = tOldBridgeY; + switch (tBounceTime % 7) + { + case 0: + CurrentMapDrawMetatileAt(prevX, prevY); + case 1: case 2: - data[6]--; - x2 = data[4]; - y2 = data[5]; - switch (data[6] % 7) - { - case 0: - CurrentMapDrawMetatileAt(x2, y2); - case 1: - case 2: - case 3: - break; - case 4: - SetLoweredForetreeBridgeMetatile(x2, y2); - CurrentMapDrawMetatileAt(x2, y2); - SetNormalFortreeBridgeMetatile(x2, y2); - case 5: - case 6: - case 7: - break; - } - if (data[6] == 0) - { - data[1] = 1; - } + case 3: break; + case 4: + // Bounce bridge section that player has stepped off of + TryLowerFortreeBridge(prevX, prevY); + CurrentMapDrawMetatileAt(prevX, prevY); + TryRaiseFortreeBridge(prevX, prevY); + case 5: + case 6: + case 7: // Not possible with % 7 + break; + } + if (tBounceTime == 0) + tState = 1; + break; } } +#undef tState +#undef tPrevX +#undef tPrevY +#undef tOldBridgeX +#undef tOldBridgeY +#undef tBounceTime + +// Boundaries of the ice puzzle in Sootopolis Gym +#define ICE_PUZZLE_L 3 +#define ICE_PUZZLE_R 13 +#define ICE_PUZZLE_T 6 +#define ICE_PUZZLE_B 19 + +#define ICE_PUZZLE_WIDTH (ICE_PUZZLE_R - ICE_PUZZLE_L + 1) +#define ICE_PUZZLE_HEIGHT (ICE_PUZZLE_B - ICE_PUZZLE_T + 1) + static bool32 CoordInIcePuzzleRegion(s16 x, s16 y) { - if ((u16)(x - 3) < 11 && (u16)(y - 6) < 14 && sSootopolisGymIceRowVars[y]) + if ((u16)(x - ICE_PUZZLE_L) < ICE_PUZZLE_WIDTH + && (u16)(y - ICE_PUZZLE_T) < ICE_PUZZLE_HEIGHT + && sSootopolisGymIceRowVars[y]) return TRUE; else return FALSE; @@ -503,17 +615,17 @@ static bool32 CoordInIcePuzzleRegion(s16 x, s16 y) static void MarkIcePuzzleCoordVisited(s16 x, s16 y) { if (CoordInIcePuzzleRegion(x, y)) - *GetVarPointer(sSootopolisGymIceRowVars[y]) |= (1 << (x - 3)); + *GetVarPointer(sSootopolisGymIceRowVars[y]) |= (1 << (x - ICE_PUZZLE_L)); } static bool32 IsIcePuzzleCoordVisited(s16 x, s16 y) { - u32 var; + u16 var; if (!CoordInIcePuzzleRegion(x, y)) return FALSE; - var = VarGet(sSootopolisGymIceRowVars[y]) << 16; - if ((0x10000 << (x - 3)) & var) // TODO: fix that if + var = VarGet(sSootopolisGymIceRowVars[y]); + if (var &= (1 << (x - ICE_PUZZLE_L))) return TRUE; else return FALSE; @@ -534,116 +646,155 @@ void SetSootopolisGymCrackedIceMetatiles(void) } } +#define tState data[1] +#define tPrevX data[2] +#define tPrevY data[3] +#define tIceX data[4] +#define tIceY data[5] +#define tDelay data[6] + static void SootopolisGymIcePerStepCallback(u8 taskId) { s16 x, y; u16 tileBehavior; u16 *iceStepCount; s16 *data = gTasks[taskId].data; - switch (data[1]) + switch (tState) { - case 0: - PlayerGetDestCoords(&x, &y); - data[2] = x; - data[3] = y; - data[1] = 1; - break; - case 1: - PlayerGetDestCoords(&x, &y); - if (x != data[2] || y != data[3]) - { - data[2] = x; - data[3] = y; - tileBehavior = MapGridGetMetatileBehaviorAt(x, y); - iceStepCount = GetVarPointer(VAR_ICE_STEP_COUNT); - if (MetatileBehavior_IsThinIce(tileBehavior) == TRUE) - { - (*iceStepCount)++; - data[6] = 4; - data[1] = 2; - data[4] = x; - data[5] = y; - } - else if (MetatileBehavior_IsCrackedIce(tileBehavior) == TRUE) - { - *iceStepCount = 0; - data[6] = 4; - data[1] = 3; - data[4] = x; - data[5] = y; - } - } - break; - case 2: - if (data[6] != 0) - { - data[6]--; - } - else - { - x = data[4]; - y = data[5]; - PlaySE(SE_ICE_CRACK); - MapGridSetMetatileIdAt(x, y, METATILE_SootopolisGym_Ice_Cracked); - CurrentMapDrawMetatileAt(x, y); - MarkIcePuzzleCoordVisited(x - MAP_OFFSET, y - MAP_OFFSET); - data[1] = 1; - } - break; - case 3: - if (data[6] != 0) - { - data[6]--; - } - else - { - x = data[4]; - y = data[5]; - PlaySE(SE_ICE_BREAK); - MapGridSetMetatileIdAt(x, y, METATILE_SootopolisGym_Ice_Broken); - CurrentMapDrawMetatileAt(x, y); - data[1] = 1; - } - break; + case 0: + PlayerGetDestCoords(&x, &y); + tPrevX = x; + tPrevY = y; + tState = 1; + break; + case 1: + PlayerGetDestCoords(&x, &y); + // End if player hasn't moved + if (x == tPrevX && y == tPrevY) + return; + + tPrevX = x; + tPrevY = y; + tileBehavior = MapGridGetMetatileBehaviorAt(x, y); + iceStepCount = GetVarPointer(VAR_ICE_STEP_COUNT); + if (MetatileBehavior_IsThinIce(tileBehavior) == TRUE) + { + // Thin ice, set it to cracked ice + (*iceStepCount)++; + tDelay = 4; + tState = 2; + tIceX = x; + tIceY = y; + } + else if (MetatileBehavior_IsCrackedIce(tileBehavior) == TRUE) + { + // Cracked ice, set it to broken ice + *iceStepCount = 0; + tDelay = 4; + tState = 3; + tIceX = x; + tIceY = y; + } + break; + case 2: + if (tDelay != 0) + { + tDelay--; + } + else + { + // Crack ice + x = tIceX; + y = tIceY; + PlaySE(SE_ICE_CRACK); + MapGridSetMetatileIdAt(x, y, METATILE_SootopolisGym_Ice_Cracked); + CurrentMapDrawMetatileAt(x, y); + MarkIcePuzzleCoordVisited(x - MAP_OFFSET, y - MAP_OFFSET); + tState = 1; + } + break; + case 3: + if (tDelay != 0) + { + tDelay--; + } + else + { + // Break ice + x = tIceX; + y = tIceY; + PlaySE(SE_ICE_BREAK); + MapGridSetMetatileIdAt(x, y, METATILE_SootopolisGym_Ice_Broken); + CurrentMapDrawMetatileAt(x, y); + tState = 1; + } + break; } } +#undef tState +#undef tPrevX +#undef tPrevY +#undef tIceX +#undef tIceY +#undef tDelay + +#define tPrevX data[1] +#define tPrevY data[2] + static void AshGrassPerStepCallback(u8 taskId) { s16 x, y; u16 *ashGatherCount; s16 *data = gTasks[taskId].data; PlayerGetDestCoords(&x, &y); - if (x != data[1] || y != data[2]) + + // End if player hasn't moved + if (x == tPrevX && y == tPrevY) + return; + + tPrevX = x; + tPrevY = y; + if (MetatileBehavior_IsAshGrass(MapGridGetMetatileBehaviorAt(x, y))) { - data[1] = x; - data[2] = y; - if (MetatileBehavior_IsAshGrass(MapGridGetMetatileBehaviorAt(x, y))) - { - if (MapGridGetMetatileIdAt(x, y) == METATILE_Fallarbor_AshGrass) - StartAshFieldEffect(x, y, METATILE_Fallarbor_NormalGrass, 4); - else - StartAshFieldEffect(x, y, METATILE_Lavaridge_NormalGrass, 4); + // Remove ash from grass + if (MapGridGetMetatileIdAt(x, y) == METATILE_Fallarbor_AshGrass) + StartAshFieldEffect(x, y, METATILE_Fallarbor_NormalGrass, 4); + else + StartAshFieldEffect(x, y, METATILE_Lavaridge_NormalGrass, 4); - if (CheckBagHasItem(ITEM_SOOT_SACK, 1)) - { - ashGatherCount = GetVarPointer(VAR_ASH_GATHER_COUNT); - if (*ashGatherCount < 9999) - (*ashGatherCount)++; - } + // Try to gather ash + if (CheckBagHasItem(ITEM_SOOT_SACK, 1)) + { + ashGatherCount = GetVarPointer(VAR_ASH_GATHER_COUNT); + if (*ashGatherCount < 9999) + (*ashGatherCount)++; } } } +#undef tPrevX +#undef tPrevY + // This function uses the constants for gTileset_Cave's metatile labels, but other tilesets with // the CrackedFloorPerStepCallback callback use the same metatile numbers for the cracked floor // and hole metatiles, such as gTileset_MirageTower. static void SetCrackedFloorHoleMetatile(s16 x, s16 y) { - MapGridSetMetatileIdAt(x, y, MapGridGetMetatileIdAt(x, y) == METATILE_Cave_CrackedFloor ? METATILE_Cave_CrackedFloor_Hole : METATILE_Pacifidlog_SkyPillar_CrackedFloor_Hole); + u16 metatileId = MapGridGetMetatileIdAt(x, y) == METATILE_Cave_CrackedFloor ? METATILE_Cave_CrackedFloor_Hole : METATILE_Pacifidlog_SkyPillar_CrackedFloor_Hole; + MapGridSetMetatileIdAt(x, y, metatileId); CurrentMapDrawMetatileAt(x, y); } +#define tPrevX data[2] +#define tPrevY data[3] +#define tFloor1Delay data[4] +#define tFloor1X data[5] +#define tFloor1Y data[6] +#define tFloor2Delay data[7] +#define tFloor2X data[8] +#define tFloor2Y data[9] + static void CrackedFloorPerStepCallback(u8 taskId) { s16 x, y; @@ -651,113 +802,153 @@ static void CrackedFloorPerStepCallback(u8 taskId) s16 *data = gTasks[taskId].data; PlayerGetDestCoords(&x, &y); behavior = MapGridGetMetatileBehaviorAt(x, y); - if (data[4] != 0 && (--data[4]) == 0) - SetCrackedFloorHoleMetatile(data[5], data[6]); - if (data[7] != 0 && (--data[7]) == 0) - SetCrackedFloorHoleMetatile(data[8], data[9]); + // Update up to 2 previous cracked floor spaces + if (tFloor1Delay != 0 && (--tFloor1Delay) == 0) + SetCrackedFloorHoleMetatile(tFloor1X, tFloor1Y); + if (tFloor2Delay != 0 && (--tFloor2Delay) == 0) + SetCrackedFloorHoleMetatile(tFloor2X, tFloor2Y); if (MetatileBehavior_IsCrackedFloorHole(behavior)) VarSet(VAR_ICE_STEP_COUNT, 0); // this var does double duty - if ((x != data[2] || y != data[3])) + // End if player hasn't moved + if (x == tPrevX && y == tPrevY) + return; + + tPrevX = x; + tPrevY = y; + if (MetatileBehavior_IsCrackedFloor(behavior)) { - data[2] = x; - data[3] = y; - if (MetatileBehavior_IsCrackedFloor(behavior)) - { - if (GetPlayerSpeed() != 4) - VarSet(VAR_ICE_STEP_COUNT, 0); // this var does double duty + if (GetPlayerSpeed() != BIKE_SPEED_FASTEST) + VarSet(VAR_ICE_STEP_COUNT, 0); // this var does double duty - if (data[4] == 0) - { - data[4] = 3; - data[5] = x; - data[6] = y; - } - else if (data[7] == 0) - { - data[7] = 3; - data[8] = x; - data[9] = y; - } + if (tFloor1Delay == 0) + { + tFloor1Delay = 3; + tFloor1X = x; + tFloor1Y = y; + } + else if (tFloor2Delay == 0) + { + tFloor2Delay = 3; + tFloor2X = x; + tFloor2Y = y; } } } +#undef tPrevX +#undef tPrevY +#undef tFloor1Delay +#undef tFloor1X +#undef tFloor1Y +#undef tFloor2Delay +#undef tFloor2X +#undef tFloor2Y + +#define tMapId data[0] +#define tState data[1] +#define tPrevX data[2] +#define tPrevY data[3] +// data[4] - data[15] are data about up to 4 individual animating muddy slope metatiles +// They're divided into groups of 3, i.e data[4]-[6] track one metatile, data[7]-[9] another, and so on. +// For each data triplet, the 1sst is the animation time, and the 2nd/3rd are the x/y coordinates. +#define SLOPE_DATA_START 4 +#define SLOPE_DATA_END (3 * SLOPE_DATA_SIZE + SLOPE_DATA_START) // 13, which is the last slope data start point +enum { + SLOPE_TIME, + SLOPE_X, + SLOPE_Y, + SLOPE_DATA_SIZE +}; +#define tSlopeAnimTime(i) data[(i) * SLOPE_DATA_SIZE + SLOPE_DATA_START + SLOPE_TIME] + +static const u16 sMuddySlopeMetatiles[] = { + METATILE_General_MuddySlope_Frame0, + METATILE_General_MuddySlope_Frame3, + METATILE_General_MuddySlope_Frame2, + METATILE_General_MuddySlope_Frame1 +}; + +#define SLOPE_ANIM_TIME 32 +#define SLOPE_ANIM_STEP_TIME (SLOPE_ANIM_TIME / (int)ARRAY_COUNT(sMuddySlopeMetatiles)) + static void SetMuddySlopeMetatile(s16 *data, s16 x, s16 y) { - u16 tile; - if ((--data[0]) == 0) - tile = METATILE_General_MuddySlope_Frame0; + u16 metatileId; + if ((--data[SLOPE_TIME]) == 0) + metatileId = METATILE_General_MuddySlope_Frame0; else - tile = sMuddySlopeMetatiles[data[0] / 8]; + metatileId = sMuddySlopeMetatiles[data[SLOPE_TIME] / SLOPE_ANIM_STEP_TIME]; - MapGridSetMetatileIdAt(x, y, tile); + MapGridSetMetatileIdAt(x, y, metatileId); CurrentMapDrawMetatileAt(x, y); MapGridSetMetatileIdAt(x, y, METATILE_General_MuddySlope_Frame0); } static void Task_MuddySlope(u8 taskId) { - s16 x, y, x2, y2; + s16 x, y, cameraOffsetX, cameraOffsetY; int i; u16 mapId; s16 *data = gTasks[taskId].data; PlayerGetDestCoords(&x, &y); mapId = (gSaveBlock1Ptr->location.mapGroup << 8) | gSaveBlock1Ptr->location.mapNum; - switch (data[1]) + switch (tState) { - case 0: - data[0] = mapId; - data[2] = x; - data[3] = y; - data[1] = 1; - data[4] = 0; - data[7] = 0; - data[10] = 0; - data[13] = 0; + case 0: + tMapId = mapId; + tPrevX = x; + tPrevY = y; + tState = 1; + tSlopeAnimTime(0) = 0; + tSlopeAnimTime(1) = 0; + tSlopeAnimTime(2) = 0; + tSlopeAnimTime(3) = 0; + break; + case 1: + // Skip if player hasn't moved + if (tPrevX == x && tPrevY == y) break; - case 1: - if (data[2] != x || data[3] != y) + + tPrevX = x; + tPrevY = y; + if (MetatileBehavior_IsMuddySlope(MapGridGetMetatileBehaviorAt(x, y))) + { + for (i = SLOPE_DATA_START; i <= SLOPE_DATA_END; i += SLOPE_DATA_SIZE) { - data[2] = x; - data[3] = y; - if (MetatileBehavior_IsMuddySlope(MapGridGetMetatileBehaviorAt(x, y))) + if (data[i] == 0) { - for (i = 4; i < 14; i += 3) - { - if (data[i] == 0) - { - data[i] = 32; - data[i + 1] = x; - data[i + 2] = y; - break; - } - } + data[i + SLOPE_TIME] = SLOPE_ANIM_TIME; + data[i + SLOPE_X] = x; + data[i + SLOPE_Y] = y; + break; } } - break; + } + break; } - if (gCamera.active && mapId != data[0]) + + if (gCamera.active && mapId != tMapId) { - data[0] = mapId; - x2 = gCamera.x; - y2 = gCamera.y; + tMapId = mapId; + cameraOffsetX = gCamera.x; + cameraOffsetY = gCamera.y; } else { - x2 = 0; - y2 = 0; + cameraOffsetX = 0; + cameraOffsetY = 0; } - for (i = 4; i < 14; i += 3) + for (i = SLOPE_DATA_START; i <= SLOPE_DATA_END; i += SLOPE_DATA_SIZE) { - if (data[i]) + if (data[i + SLOPE_TIME]) { - data[i + 1] -= x2; - data[i + 2] -= y2; - SetMuddySlopeMetatile(&data[i], data[i + 1], data[i + 2]); + data[i + SLOPE_X] -= cameraOffsetX; + data[i + SLOPE_Y] -= cameraOffsetY; + SetMuddySlopeMetatile(&data[i + SLOPE_TIME], data[i + SLOPE_X], data[i + SLOPE_Y]); } } } diff --git a/src/field_weather_effect.c b/src/field_weather_effect.c index 5720363c21e1..2b87557c21a6 100644 --- a/src/field_weather_effect.c +++ b/src/field_weather_effect.c @@ -2487,19 +2487,19 @@ static void CreateAbnormalWeatherTask(void) static u8 TranslateWeatherNum(u8); static void UpdateRainCounter(u8, u8); -void SetSav1Weather(u32 weather) +void SetSavedWeather(u32 weather) { u8 oldWeather = gSaveBlock1Ptr->weather; gSaveBlock1Ptr->weather = TranslateWeatherNum(weather); UpdateRainCounter(gSaveBlock1Ptr->weather, oldWeather); } -u8 GetSav1Weather(void) +u8 GetSavedWeather(void) { return gSaveBlock1Ptr->weather; } -void SetSav1WeatherFromCurrMapHeader(void) +void SetSavedWeatherFromCurrMapHeader(void) { u8 oldWeather = gSaveBlock1Ptr->weather; gSaveBlock1Ptr->weather = TranslateWeatherNum(gMapHeader.weather); @@ -2508,19 +2508,19 @@ void SetSav1WeatherFromCurrMapHeader(void) void SetWeather(u32 weather) { - SetSav1Weather(weather); - SetNextWeather(GetSav1Weather()); + SetSavedWeather(weather); + SetNextWeather(GetSavedWeather()); } void SetWeather_Unused(u32 weather) { - SetSav1Weather(weather); - SetCurrentAndNextWeather(GetSav1Weather()); + SetSavedWeather(weather); + SetCurrentAndNextWeather(GetSavedWeather()); } void DoCurrentWeather(void) { - u8 weather = GetSav1Weather(); + u8 weather = GetSavedWeather(); if (weather == WEATHER_ABNORMAL) { @@ -2539,7 +2539,7 @@ void DoCurrentWeather(void) void ResumePausedWeather(void) { - u8 weather = GetSav1Weather(); + u8 weather = GetSavedWeather(); if (weather == WEATHER_ABNORMAL) { diff --git a/src/frontier_pass.c b/src/frontier_pass.c index 8ce1e14dc47f..07dd8f2289b6 100644 --- a/src/frontier_pass.c +++ b/src/frontier_pass.c @@ -26,7 +26,6 @@ #include "overworld.h" #include "math_util.h" #include "constants/battle_frontier.h" -#include "constants/maps.h" #include "constants/rgb.h" #include "constants/region_map_sections.h" #include "constants/songs.h" diff --git a/src/heal_location.c b/src/heal_location.c index 5eda24d67ad5..ab8dc52650b9 100644 --- a/src/heal_location.c +++ b/src/heal_location.c @@ -1,6 +1,5 @@ #include "global.h" #include "heal_location.h" -#include "constants/maps.h" #include "constants/heal_locations.h" #include "data/heal_locations.h" diff --git a/src/lilycove_lady.c b/src/lilycove_lady.c index 0b2be39b5da6..85340ed96ef3 100644 --- a/src/lilycove_lady.c +++ b/src/lilycove_lady.c @@ -183,7 +183,7 @@ bool8 HasAnotherPlayerGivenFavorLadyItem(void) sFavorLadyPtr = &gSaveBlock1Ptr->lilycoveLady.favor; if (sFavorLadyPtr->playerName[0] != EOS) { - StringCopy7(gStringVar3, sFavorLadyPtr->playerName); + StringCopy_PlayerName(gStringVar3, sFavorLadyPtr->playerName); ConvertInternationalString(gStringVar3, sFavorLadyPtr->language); return TRUE; } @@ -204,7 +204,7 @@ void BufferFavorLadyItemName(void) static void SetFavorLadyPlayerName(const u8 *src, u8 *dest) { memset(dest, EOS, PLAYER_NAME_LENGTH + 1); - StringCopy7(dest, src); + StringCopy_PlayerName(dest, src); } void BufferFavorLadyPlayerName(void) @@ -396,12 +396,12 @@ static u8 BufferQuizAuthorName(void) sQuizLadyPtr = &gSaveBlock1Ptr->lilycoveLady.quiz; if (sQuizLadyPtr->playerName[0] == EOS) { - StringCopy7(gStringVar1, gText_QuizLady_Lady); + StringCopy_PlayerName(gStringVar1, gText_QuizLady_Lady); authorNameId = QUIZ_AUTHOR_NAME_LADY; } else { - StringCopy7(gStringVar1, sQuizLadyPtr->playerName); + StringCopy_PlayerName(gStringVar1, sQuizLadyPtr->playerName); ConvertInternationalString(gStringVar1, sQuizLadyPtr->language); nameLen = GetPlayerNameLength(sQuizLadyPtr->playerName); if (nameLen == GetPlayerNameLength(gSaveBlock2Ptr->playerName)) @@ -552,7 +552,7 @@ void QuizLadyRecordCustomQuizData(void) sQuizLadyPtr->prize = gSpecialVar_ItemId; for (i = 0; i < TRAINER_ID_LENGTH; i++) sQuizLadyPtr->playerTrainerId[i] = gSaveBlock2Ptr->playerTrainerId[i]; - StringCopy7(sQuizLadyPtr->playerName, gSaveBlock2Ptr->playerName); + StringCopy_PlayerName(sQuizLadyPtr->playerName, gSaveBlock2Ptr->playerName); sQuizLadyPtr->language = gGameLanguage; } @@ -696,7 +696,7 @@ static void BufferContestLadyCategoryAndMonName(u8 *category, u8 *nickname) { sContestLadyPtr = &gSaveBlock1Ptr->lilycoveLady.contest; StringCopy(category, sContestLadyCategoryNames[sContestLadyPtr->category]); - StringCopy10(nickname, sContestLadyMonNames[sContestLadyPtr->category]); + StringCopy_Nickname(nickname, sContestLadyMonNames[sContestLadyPtr->category]); } void BufferContestLadyMonName(u8 *category, u8 *nickname) diff --git a/src/link.c b/src/link.c index 01cc06e7c0cf..1084d4a6debf 100644 --- a/src/link.c +++ b/src/link.c @@ -292,10 +292,9 @@ static void LinkTestScreen(void) gLinkType = LINKTYPE_TRADE; OpenLink(); SeedRng(gMain.vblankCounter2); - for (i = 0; i < MAX_LINK_PLAYERS; i++) - { + for (i = 0; i < TRAINER_ID_LENGTH; i++) gSaveBlock2Ptr->playerTrainerId[i] = Random() % 256; - } + InitLinkTestBG(0, 2, 4, 0, 0); SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_MODE_0 | DISPCNT_OBJ_1D_MAP | DISPCNT_BG0_ON | DISPCNT_BG2_ON | DISPCNT_OBJ_ON); CreateTask(Task_DestroySelf, 0); diff --git a/src/lottery_corner.c b/src/lottery_corner.c index 2cbf0a808992..f19e9f7b7b80 100644 --- a/src/lottery_corner.c +++ b/src/lottery_corner.c @@ -113,7 +113,7 @@ void PickLotteryCornerTicket(void) gSpecialVar_0x8006 = 1; GetBoxMonData(&gPokemonStoragePtr->boxes[box][slot], MON_DATA_NICKNAME, gStringVar1); } - StringGetEnd10(gStringVar1); + StringGet_Nickname(gStringVar1); } } diff --git a/src/mail_data.c b/src/mail_data.c index 683bd854eadd..ca50a687e760 100644 --- a/src/mail_data.c +++ b/src/mail_data.c @@ -157,7 +157,7 @@ void ClearMailItemId(u8 mailId) gSaveBlock1Ptr->mail[mailId].itemId = ITEM_NONE; } -u8 TakeMailFromMon2(struct Pokemon *mon) +u8 TakeMailFromMonAndSave(struct Pokemon *mon) { u8 i; u8 newHeldItem[2]; @@ -179,6 +179,7 @@ u8 TakeMailFromMon2(struct Pokemon *mon) } } + // No space to save mail return MAIL_NONE; } diff --git a/src/match_call.c b/src/match_call.c index 85df5822d244..de7f13416d46 100644 --- a/src/match_call.c +++ b/src/match_call.c @@ -29,7 +29,6 @@ #include "constants/abilities.h" #include "constants/battle_frontier.h" #include "constants/event_objects.h" -#include "constants/maps.h" #include "constants/region_map_sections.h" #include "constants/songs.h" #include "constants/trainers.h" diff --git a/src/menu_helpers.c b/src/menu_helpers.c index 5bc197010be6..d5cf83bd24c7 100644 --- a/src/menu_helpers.c +++ b/src/menu_helpers.c @@ -16,7 +16,6 @@ #include "decompress.h" #include "constants/songs.h" #include "constants/items.h" -#include "constants/maps.h" #define TAG_SWAP_LINE 109 diff --git a/src/menu_specialized.c b/src/menu_specialized.c index 20d67ca7f98b..cd77f4a59c68 100644 --- a/src/menu_specialized.c +++ b/src/menu_specialized.c @@ -919,7 +919,7 @@ static u8 *GetConditionMenuMonString(u8 *dst, u16 boxId, u16 monId) if (GetBoxOrPartyMonData(box, mon, MON_DATA_IS_EGG, NULL)) return StringCopyPadded(dst, gText_EggNickname, 0, 12); GetBoxOrPartyMonData(box, mon, MON_DATA_NICKNAME, dst); - StringGetEnd10(dst); + StringGet_Nickname(dst); species = GetBoxOrPartyMonData(box, mon, MON_DATA_SPECIES, NULL); if (box == TOTAL_BOXES_COUNT) // Party mon. { diff --git a/src/metatile_behavior.c b/src/metatile_behavior.c index ad5eb42ccd9c..6b58e3f05b5c 100644 --- a/src/metatile_behavior.c +++ b/src/metatile_behavior.c @@ -126,10 +126,10 @@ static const u8 sTileBitAttributes[] = [MB_BRIDGE_OVER_POND_LOW] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE), [MB_BRIDGE_OVER_POND_MED] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE), [MB_BRIDGE_OVER_POND_HIGH] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE), - [MB_PACIFIDLOG_VERTICAL_LOG_1] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE), - [MB_PACIFIDLOG_VERTICAL_LOG_2] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE), - [MB_PACIFIDLOG_HORIZONTAL_LOG_1] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE), - [MB_PACIFIDLOG_HORIZONTAL_LOG_2] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + [MB_PACIFIDLOG_VERTICAL_LOG_TOP] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + [MB_PACIFIDLOG_VERTICAL_LOG_BOTTOM] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + [MB_PACIFIDLOG_HORIZONTAL_LOG_LEFT] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE), + [MB_PACIFIDLOG_HORIZONTAL_LOG_RIGHT] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE), [MB_FORTREE_BRIDGE] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE), [MB_UNUSED_79] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE), [MB_BRIDGE_OVER_POND_MED_EDGE_1] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE), @@ -1131,33 +1131,33 @@ bool8 MetatileBehavior_IsFortreeBridge(u8 metatileBehavior) return FALSE; } -bool8 MetatileBehavior_IsPacifidlogVerticalLog1(u8 metatileBehavior) +bool8 MetatileBehavior_IsPacifidlogVerticalLogTop(u8 metatileBehavior) { - if (metatileBehavior == MB_PACIFIDLOG_VERTICAL_LOG_1) + if (metatileBehavior == MB_PACIFIDLOG_VERTICAL_LOG_TOP) return TRUE; else return FALSE; } -bool8 MetatileBehavior_IsPacifidlogVerticalLog2(u8 metatileBehavior) +bool8 MetatileBehavior_IsPacifidlogVerticalLogBottom(u8 metatileBehavior) { - if (metatileBehavior == MB_PACIFIDLOG_VERTICAL_LOG_2) + if (metatileBehavior == MB_PACIFIDLOG_VERTICAL_LOG_BOTTOM) return TRUE; else return FALSE; } -bool8 MetatileBehavior_IsPacifidlogHorizontalLog1(u8 metatileBehavior) +bool8 MetatileBehavior_IsPacifidlogHorizontalLogLeft(u8 metatileBehavior) { - if (metatileBehavior == MB_PACIFIDLOG_HORIZONTAL_LOG_1) + if (metatileBehavior == MB_PACIFIDLOG_HORIZONTAL_LOG_LEFT) return TRUE; else return FALSE; } -bool8 MetatileBehavior_IsPacifidlogHorizontalLog2(u8 metatileBehavior) +bool8 MetatileBehavior_IsPacifidlogHorizontalLogRight(u8 metatileBehavior) { - if (metatileBehavior == MB_PACIFIDLOG_HORIZONTAL_LOG_2) + if (metatileBehavior == MB_PACIFIDLOG_HORIZONTAL_LOG_RIGHT) return TRUE; else return FALSE; @@ -1165,10 +1165,10 @@ bool8 MetatileBehavior_IsPacifidlogHorizontalLog2(u8 metatileBehavior) bool8 MetatileBehavior_IsPacifidlogLog(u8 metatileBehavior) { - if (metatileBehavior == MB_PACIFIDLOG_VERTICAL_LOG_1 - || metatileBehavior == MB_PACIFIDLOG_VERTICAL_LOG_2 - || metatileBehavior == MB_PACIFIDLOG_HORIZONTAL_LOG_1 - || metatileBehavior == MB_PACIFIDLOG_HORIZONTAL_LOG_2) + if (metatileBehavior == MB_PACIFIDLOG_VERTICAL_LOG_TOP + || metatileBehavior == MB_PACIFIDLOG_VERTICAL_LOG_BOTTOM + || metatileBehavior == MB_PACIFIDLOG_HORIZONTAL_LOG_LEFT + || metatileBehavior == MB_PACIFIDLOG_HORIZONTAL_LOG_RIGHT) return TRUE; else return FALSE; diff --git a/src/mirage_tower.c b/src/mirage_tower.c index 9473b0f82eb8..7300262988b2 100644 --- a/src/mirage_tower.c +++ b/src/mirage_tower.c @@ -15,7 +15,6 @@ #include "task.h" #include "window.h" #include "constants/event_objects.h" -#include "constants/maps.h" #include "constants/rgb.h" #include "constants/songs.h" #include "constants/metatile_labels.h" diff --git a/src/move_relearner.c b/src/move_relearner.c index 92d230616756..2b925135f04c 100644 --- a/src/move_relearner.c +++ b/src/move_relearner.c @@ -912,7 +912,7 @@ static void CreateLearnableMovesList(void) } GetMonData(&gPlayerParty[sMoveRelearnerStruct->partyMon], MON_DATA_NICKNAME, nickname); - StringCopy10(gStringVar1, nickname); + StringCopy_Nickname(gStringVar1, nickname); sMoveRelearnerStruct->menuItems[sMoveRelearnerStruct->numMenuChoices].name = gText_Cancel; sMoveRelearnerStruct->menuItems[sMoveRelearnerStruct->numMenuChoices].id = LIST_CANCEL; sMoveRelearnerStruct->numMenuChoices++; diff --git a/src/mystery_event_menu.c b/src/mystery_event_menu.c index 717931268a35..0007664ba178 100644 --- a/src/mystery_event_menu.c +++ b/src/mystery_event_menu.c @@ -111,16 +111,16 @@ static bool8 GetEventLoadMessage(u8 *dest, u32 status) { bool8 retVal = TRUE; - if (status == 0) + if (status == MEVENT_STATUS_LOAD_OK) { StringCopy(dest, gText_EventSafelyLoaded); retVal = FALSE; } - if (status == 2) + if (status == MEVENT_STATUS_SUCCESS) retVal = FALSE; - if (status == 1) + if (status == MEVENT_STATUS_LOAD_ERROR) StringCopy(dest, gText_LoadErrorEndingSession); return retVal; @@ -193,7 +193,7 @@ static void CB2_MysteryEventMenu(void) } else { - GetEventLoadMessage(gStringVar4, 1); + GetEventLoadMessage(gStringVar4, MEVENT_STATUS_LOAD_ERROR); PrintMysteryMenuText(0, gStringVar4, 1, 2, 1); gMain.state = 13; } @@ -206,7 +206,7 @@ static void CB2_MysteryEventMenu(void) if (GetLinkPlayerDataExchangeStatusTimed(2, 2) == EXCHANGE_DIFF_SELECTIONS) { SetCloseLinkCallback(); - GetEventLoadMessage(gStringVar4, 1); + GetEventLoadMessage(gStringVar4, MEVENT_STATUS_LOAD_ERROR); PrintMysteryMenuText(0, gStringVar4, 1, 2, 1); gMain.state = 13; } @@ -218,7 +218,7 @@ static void CB2_MysteryEventMenu(void) else { CloseLink(); - GetEventLoadMessage(gStringVar4, 1); + GetEventLoadMessage(gStringVar4, MEVENT_STATUS_LOAD_ERROR); PrintMysteryMenuText(0, gStringVar4, 1, 2, 1); gMain.state = 13; } @@ -252,9 +252,9 @@ static void CB2_MysteryEventMenu(void) case 11: if (gReceivedRemoteLinkPlayers == 0) { - u16 unkVal = RunMysteryEventScript(gDecompressionBuffer); + u16 status = RunMysteryEventScript(gDecompressionBuffer); CpuFill32(0, gDecompressionBuffer, 0x7D4); - if (!GetEventLoadMessage(gStringVar4, unkVal)) + if (!GetEventLoadMessage(gStringVar4, status)) TrySavingData(SAVE_NORMAL); gMain.state++; } @@ -290,7 +290,7 @@ static void CB2_MysteryEventMenu(void) if (gLinkStatus & 0x40 && !IsLinkMaster()) { CloseLink(); - GetEventLoadMessage(gStringVar4, 1); + GetEventLoadMessage(gStringVar4, MEVENT_STATUS_LOAD_ERROR); PrintMysteryMenuText(0, gStringVar4, 1, 2, 1); gMain.state = 13; } diff --git a/src/mystery_event_script.c b/src/mystery_event_script.c index 18a1a0d07cb3..5f08c629486e 100644 --- a/src/mystery_event_script.c +++ b/src/mystery_event_script.c @@ -22,6 +22,11 @@ extern ScrCmdFunc gMysteryEventScriptCmdTableEnd[]; #define LANGUAGE_MASK 0x1 #define VERSION_MASK 0x200 +#define mScriptBase data[0] +#define mOffset data[1] +#define mStatus data[2] +#define mValid data[3] + EWRAM_DATA static struct ScriptContext sMysteryEventScriptContext = {0}; static bool32 CheckCompatibility(u16 a1, u32 a2, u16 a3, u32 a4) @@ -44,22 +49,22 @@ static bool32 CheckCompatibility(u16 a1, u32 a2, u16 a3, u32 a4) static void SetIncompatible(void) { StringExpandPlaceholders(gStringVar4, gText_MysteryEventCantBeUsed); - SetMysteryEventScriptStatus(3); + SetMysteryEventScriptStatus(MEVENT_STATUS_FAILURE); } static void InitMysteryEventScript(struct ScriptContext *ctx, u8 *script) { InitScriptContext(ctx, gMysteryEventScriptCmdTable, gMysteryEventScriptCmdTableEnd); SetupBytecodeScript(ctx, script); - ctx->data[0] = (u32)script; - ctx->data[1] = 0; - ctx->data[2] = 0; - ctx->data[3] = 0; + ctx->mScriptBase = (u32)script; + ctx->mOffset = 0; + ctx->mStatus = MEVENT_STATUS_LOAD_OK; + ctx->mValid = FALSE; } static bool32 RunMysteryEventScriptCommand(struct ScriptContext *ctx) { - if (RunScriptCommand(ctx) && ctx->data[3]) + if (RunScriptCommand(ctx) && ctx->mValid) return TRUE; else return FALSE; @@ -70,10 +75,10 @@ void InitMysteryEventScriptContext(u8 *script) InitMysteryEventScript(&sMysteryEventScriptContext, script); } -bool32 RunMysteryEventScriptContextCommand(u32 *script) +bool32 RunMysteryEventScriptContextCommand(u32 *status) { bool32 ret = RunMysteryEventScriptCommand(&sMysteryEventScriptContext); - *script = sMysteryEventScriptContext.data[2]; + *status = sMysteryEventScriptContext.mStatus; return ret; } @@ -84,12 +89,12 @@ u32 RunMysteryEventScript(u8 *script) InitMysteryEventScript(ctx, script); while (RunMysteryEventScriptCommand(ctx)); - return ctx->data[2]; + return ctx->mStatus; } -void SetMysteryEventScriptStatus(u32 val) +void SetMysteryEventScriptStatus(u32 status) { - sMysteryEventScriptContext.data[2] = val; + sMysteryEventScriptContext.mStatus = status; } static int CalcRecordMixingGiftChecksum(void) @@ -174,14 +179,14 @@ bool8 MEScrCmd_checkcompat(struct ScriptContext *ctx) u16 v3; u32 v4; - ctx->data[1] = ScriptReadWord(ctx); + ctx->mOffset = ScriptReadWord(ctx); v1 = ScriptReadHalfword(ctx); v2 = ScriptReadWord(ctx); v3 = ScriptReadHalfword(ctx); v4 = ScriptReadWord(ctx); if (CheckCompatibility(v1, v2, v3, v4) == TRUE) - ctx->data[3] = 1; + ctx->mValid = TRUE; else SetIncompatible(); @@ -195,23 +200,23 @@ bool8 MEScrCmd_nop(struct ScriptContext *ctx) bool8 MEScrCmd_setstatus(struct ScriptContext *ctx) { - u8 value = ScriptReadByte(ctx); - ctx->data[2] = value; + u8 status = ScriptReadByte(ctx); + ctx->mStatus = status; return FALSE; } bool8 MEScrCmd_setmsg(struct ScriptContext *ctx) { - u8 value = ScriptReadByte(ctx); - u8 *str = (u8 *)(ScriptReadWord(ctx) - ctx->data[1] + ctx->data[0]); - if (value == 0xFF || value == ctx->data[2]) + u8 status = ScriptReadByte(ctx); + u8 *str = (u8 *)(ScriptReadWord(ctx) - ctx->mOffset + ctx->mScriptBase); + if (status == MEVENT_STATUS_FF || status == ctx->mStatus) StringExpandPlaceholders(gStringVar4, str); return FALSE; } bool8 MEScrCmd_runscript(struct ScriptContext *ctx) { - u8 *script = (u8 *)(ScriptReadWord(ctx) - ctx->data[1] + ctx->data[0]); + u8 *script = (u8 *)(ScriptReadWord(ctx) - ctx->mOffset + ctx->mScriptBase); ScriptContext2_RunNewScript(script); return FALSE; } @@ -221,7 +226,7 @@ bool8 MEScrCmd_setenigmaberry(struct ScriptContext *ctx) u8 *str; const u8 *message; bool32 haveBerry = IsEnigmaBerryValid(); - u8 *berry = (u8 *)(ScriptReadWord(ctx) - ctx->data[1] + ctx->data[0]); + u8 *berry = (u8 *)(ScriptReadWord(ctx) - ctx->mOffset + ctx->mScriptBase); StringCopyN(gStringVar1, gSaveBlock1Ptr->enigmaBerry.berry.name, BERRY_NAME_LENGTH + 1); SetEnigmaBerry(berry); StringCopyN(gStringVar2, gSaveBlock1Ptr->enigmaBerry.berry.name, BERRY_NAME_LENGTH + 1); @@ -244,12 +249,12 @@ bool8 MEScrCmd_setenigmaberry(struct ScriptContext *ctx) StringExpandPlaceholders(str, message); - ctx->data[2] = 2; + ctx->mStatus = MEVENT_STATUS_SUCCESS; if (IsEnigmaBerryValid() == TRUE) VarSet(VAR_ENIGMA_BERRY_AVAILABLE, 1); else - ctx->data[2] = 1; + ctx->mStatus = MEVENT_STATUS_LOAD_ERROR; return FALSE; } @@ -260,7 +265,7 @@ bool8 MEScrCmd_giveribbon(struct ScriptContext *ctx) u8 ribbonId = ScriptReadByte(ctx); GiveGiftRibbonToParty(index, ribbonId); StringExpandPlaceholders(gStringVar4, gText_MysteryEventSpecialRibbon); - ctx->data[2] = 2; + ctx->mStatus = MEVENT_STATUS_SUCCESS; return FALSE; } @@ -269,8 +274,8 @@ bool8 MEScrCmd_initramscript(struct ScriptContext *ctx) u8 mapGroup = ScriptReadByte(ctx); u8 mapNum = ScriptReadByte(ctx); u8 objectId = ScriptReadByte(ctx); - u8 *script = (u8 *)(ScriptReadWord(ctx) - ctx->data[1] + ctx->data[0]); - u8 *scriptEnd = (u8 *)(ScriptReadWord(ctx) - ctx->data[1] + ctx->data[0]); + u8 *script = (u8 *)(ScriptReadWord(ctx) - ctx->mOffset + ctx->mScriptBase); + u8 *scriptEnd = (u8 *)(ScriptReadWord(ctx) - ctx->mOffset + ctx->mScriptBase); InitRamScript(script, scriptEnd - script, mapGroup, mapNum, objectId); return FALSE; } @@ -279,7 +284,7 @@ bool8 MEScrCmd_givenationaldex(struct ScriptContext *ctx) { EnableNationalPokedex(); StringExpandPlaceholders(gStringVar4, gText_MysteryEventNationalDex); - ctx->data[2] = 2; + ctx->mStatus = MEVENT_STATUS_SUCCESS; return FALSE; } @@ -287,7 +292,7 @@ bool8 MEScrCmd_addrareword(struct ScriptContext *ctx) { UnlockAdditionalPhrase(ScriptReadByte(ctx)); StringExpandPlaceholders(gStringVar4, gText_MysteryEventRareWord); - ctx->data[2] = 2; + ctx->mStatus = MEVENT_STATUS_SUCCESS; return FALSE; } @@ -306,7 +311,7 @@ bool8 MEScrCmd_givepokemon(struct ScriptContext *ctx) struct Pokemon pokemon; u16 species; u16 heldItem; - u32 data = ScriptReadWord(ctx) - ctx->data[1] + ctx->data[0]; + u32 data = ScriptReadWord(ctx) - ctx->mOffset + ctx->mScriptBase; void *pokemonPtr = (void *)data; void *mailPtr = (void *)(data + sizeof(struct Pokemon)); @@ -321,7 +326,7 @@ bool8 MEScrCmd_givepokemon(struct ScriptContext *ctx) if (gPlayerPartyCount == PARTY_SIZE) { StringExpandPlaceholders(gStringVar4, gText_MysteryEventFullParty); - ctx->data[2] = 3; + ctx->mStatus = MEVENT_STATUS_FAILURE; } else { @@ -341,7 +346,7 @@ bool8 MEScrCmd_givepokemon(struct ScriptContext *ctx) CompactPartySlots(); CalculatePlayerPartyCount(); StringExpandPlaceholders(gStringVar4, gText_MysteryEventSentOver); - ctx->data[2] = 2; + ctx->mStatus = MEVENT_STATUS_SUCCESS; } return FALSE; @@ -349,11 +354,11 @@ bool8 MEScrCmd_givepokemon(struct ScriptContext *ctx) bool8 MEScrCmd_addtrainer(struct ScriptContext *ctx) { - u32 data = ScriptReadWord(ctx) - ctx->data[1] + ctx->data[0]; + u32 data = ScriptReadWord(ctx) - ctx->mOffset + ctx->mScriptBase; memcpy(&gSaveBlock2Ptr->frontier.ereaderTrainer, (void *)data, sizeof(gSaveBlock2Ptr->frontier.ereaderTrainer)); ValidateEReaderTrainer(); StringExpandPlaceholders(gStringVar4, gText_MysteryEventNewTrainer); - ctx->data[2] = 2; + ctx->mStatus = MEVENT_STATUS_SUCCESS; return FALSE; } @@ -361,19 +366,19 @@ bool8 MEScrCmd_enableresetrtc(struct ScriptContext *ctx) { EnableResetRTC(); StringExpandPlaceholders(gStringVar4, gText_InGameClockUsable); - ctx->data[2] = 2; + ctx->mStatus = MEVENT_STATUS_SUCCESS; return FALSE; } bool8 MEScrCmd_checksum(struct ScriptContext *ctx) { int checksum = ScriptReadWord(ctx); - u8 *data = (u8 *)(ScriptReadWord(ctx) - ctx->data[1] + ctx->data[0]); - u8 *dataEnd = (u8 *)(ScriptReadWord(ctx) - ctx->data[1] + ctx->data[0]); + u8 *data = (u8 *)(ScriptReadWord(ctx) - ctx->mOffset + ctx->mScriptBase); + u8 *dataEnd = (u8 *)(ScriptReadWord(ctx) - ctx->mOffset + ctx->mScriptBase); if (checksum != CalcByteArraySum(data, dataEnd - data)) { - ctx->data[3] = 0; - ctx->data[2] = 1; + ctx->mValid = FALSE; + ctx->mStatus = MEVENT_STATUS_LOAD_ERROR; } return TRUE; } @@ -381,12 +386,12 @@ bool8 MEScrCmd_checksum(struct ScriptContext *ctx) bool8 MEScrCmd_crc(struct ScriptContext *ctx) { int crc = ScriptReadWord(ctx); - u8 *data = (u8 *)(ScriptReadWord(ctx) - ctx->data[1] + ctx->data[0]); - u8 *dataEnd = (u8 *)(ScriptReadWord(ctx) - ctx->data[1] + ctx->data[0]); + u8 *data = (u8 *)(ScriptReadWord(ctx) - ctx->mOffset + ctx->mScriptBase); + u8 *dataEnd = (u8 *)(ScriptReadWord(ctx) - ctx->mOffset + ctx->mScriptBase); if (crc != CalcCRC16(data, dataEnd - data)) { - ctx->data[3] = 0; - ctx->data[2] = 1; + ctx->mValid = FALSE; + ctx->mStatus = MEVENT_STATUS_LOAD_ERROR; } return TRUE; } diff --git a/src/naming_screen.c b/src/naming_screen.c index dcd60259b753..5aef44f149f8 100644 --- a/src/naming_screen.c +++ b/src/naming_screen.c @@ -1409,7 +1409,7 @@ static void NamingScreen_CreatePlayerIcon(void) u8 spriteId; rivalGfxId = GetRivalAvatarGraphicsIdByStateIdAndGender(0, sNamingScreen->monSpecies); - spriteId = AddPseudoObjectEvent(rivalGfxId, SpriteCallbackDummy, 56, 37, 0); + spriteId = CreateObjectGraphicsSprite(rivalGfxId, SpriteCallbackDummy, 56, 37, 0); gSprites[spriteId].oam.priority = 3; StartSpriteAnim(&gSprites[spriteId], 4); } @@ -1436,7 +1436,7 @@ static void NamingScreen_CreateWaldaDadIcon(void) { u8 spriteId; - spriteId = AddPseudoObjectEvent(OBJ_EVENT_GFX_MAN_1, SpriteCallbackDummy, 56, 37, 0); + spriteId = CreateObjectGraphicsSprite(OBJ_EVENT_GFX_MAN_1, SpriteCallbackDummy, 56, 37, 0); gSprites[spriteId].oam.priority = 3; StartSpriteAnim(&gSprites[spriteId], 4); } diff --git a/src/new_game.c b/src/new_game.c index 4bd3d37041c9..077b86775c0e 100644 --- a/src/new_game.c +++ b/src/new_game.c @@ -29,7 +29,6 @@ #include "pokedex.h" #include "apprentice.h" #include "frontier_util.h" -#include "constants/maps.h" #include "pokedex.h" #include "save.h" #include "link_rfu.h" @@ -126,7 +125,7 @@ static void ClearFrontierRecord(void) static void WarpToTruck(void) { - SetWarpDestination(MAP_GROUP(INSIDE_OF_TRUCK), MAP_NUM(INSIDE_OF_TRUCK), -1, -1, -1); + SetWarpDestination(MAP_GROUP(INSIDE_OF_TRUCK), MAP_NUM(INSIDE_OF_TRUCK), WARP_ID_NONE, -1, -1); WarpIntoMap(); } diff --git a/src/overworld.c b/src/overworld.c index 518771875b46..4aa579fdd2b1 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -62,7 +62,6 @@ #include "constants/abilities.h" #include "constants/layouts.h" #include "constants/map_types.h" -#include "constants/maps.h" #include "constants/region_map_sections.h" #include "constants/songs.h" #include "constants/trainer_hill.h" @@ -175,7 +174,6 @@ static u8 GetAdjustedInitialTransitionFlags(struct InitialPlayerAvatarState *, u static u8 GetAdjustedInitialDirection(struct InitialPlayerAvatarState *, u8, u16, u8); static u16 GetCenterScreenMetatileBehavior(void); -// IWRAM bss vars static void *sUnusedOverworldCallback; static u8 sPlayerLinkStates[MAX_LINK_PLAYERS]; // This callback is called with a player's key code. It then returns an @@ -185,7 +183,6 @@ static u16 (*sPlayerKeyInterceptCallback)(u32); static bool8 sReceivingFromLink; static u8 sRfuKeepAliveTimer; -// IWRAM common u16 *gBGTilemapBuffers1; u16 *gBGTilemapBuffers2; u16 *gBGTilemapBuffers3; @@ -195,7 +192,6 @@ bool8 (*gFieldCallback2)(void); u8 gLocalLinkPlayerId; // This is our player id in a multiplayer mode. u8 gFieldLinkPlayerCount; -// EWRAM vars EWRAM_DATA static u8 sObjectEventLoadFlag = 0; EWRAM_DATA struct WarpData gLastUsedWarp = {0}; EWRAM_DATA static struct WarpData sWarpDestination = {0}; // new warp position @@ -207,12 +203,11 @@ EWRAM_DATA static u16 sAmbientCrySpecies = 0; EWRAM_DATA static bool8 sIsAmbientCryWaterMon = FALSE; EWRAM_DATA struct LinkPlayerObjectEvent gLinkPlayerObjectEvents[4] = {0}; -// const rom data static const struct WarpData sDummyWarpData = { - .mapGroup = -1, - .mapNum = -1, - .warpId = -1, + .mapGroup = MAP_GROUP(UNDEFINED), + .mapNum = MAP_NUM(UNDEFINED), + .warpId = WARP_ID_NONE, .x = -1, .y = -1, }; @@ -495,7 +490,7 @@ void LoadSaveblockObjEventScripts(void) savObjTemplates[i].script = mapHeaderObjTemplates[i].script; } -void Overworld_SetObjEventTemplateCoords(u8 localId, s16 x, s16 y) +void SetObjEventTemplateCoords(u8 localId, s16 x, s16 y) { s32 i; struct ObjectEventTemplate *savObjTemplates = gSaveBlock1Ptr->objectEventTemplates; @@ -512,7 +507,7 @@ void Overworld_SetObjEventTemplateCoords(u8 localId, s16 x, s16 y) } } -void Overworld_SetObjEventTemplateMovementType(u8 localId, u8 movementType) +void SetObjEventTemplateMovementType(u8 localId, u8 movementType) { s32 i; @@ -570,11 +565,11 @@ static void SetWarpData(struct WarpData *warp, s8 mapGroup, s8 mapNum, s8 warpId static bool32 IsDummyWarp(struct WarpData *warp) { - if (warp->mapGroup != -1) + if (warp->mapGroup != (s8)MAP_GROUP(UNDEFINED)) return FALSE; - else if (warp->mapNum != -1) + else if (warp->mapNum != (s8)MAP_NUM(UNDEFINED)) return FALSE; - else if (warp->warpId != -1) + else if (warp->warpId != WARP_ID_NONE) return FALSE; else if (warp->x != -1) return FALSE; @@ -612,16 +607,20 @@ static void SetPlayerCoordsFromWarp(void) { if (gSaveBlock1Ptr->location.warpId >= 0 && gSaveBlock1Ptr->location.warpId < gMapHeader.events->warpCount) { + // warpId is a valid warp for this map, use the coords of that warp. gSaveBlock1Ptr->pos.x = gMapHeader.events->warps[gSaveBlock1Ptr->location.warpId].x; gSaveBlock1Ptr->pos.y = gMapHeader.events->warps[gSaveBlock1Ptr->location.warpId].y; } else if (gSaveBlock1Ptr->location.x >= 0 && gSaveBlock1Ptr->location.y >= 0) { + // Invalid warpId given. The given coords are valid, use those instead. + // WARP_ID_NONE is used to reach this intentionally. gSaveBlock1Ptr->pos.x = gSaveBlock1Ptr->location.x; gSaveBlock1Ptr->pos.y = gSaveBlock1Ptr->location.y; } else { + // Invalid warpId and coords given. Put player in center of map. gSaveBlock1Ptr->pos.x = gMapHeader.mapLayout->width / 2; gSaveBlock1Ptr->pos.y = gMapHeader.mapLayout->height / 2; } @@ -663,7 +662,7 @@ void SetWarpDestinationToHealLocation(u8 healLocationId) { const struct HealLocation *warp = GetHealLocation(healLocationId); if (warp) - SetWarpDestination(warp->group, warp->map, -1, warp->x, warp->y); + SetWarpDestination(warp->group, warp->map, WARP_ID_NONE, warp->x, warp->y); } void SetWarpDestinationToLastHealLocation(void) @@ -675,7 +674,7 @@ void SetLastHealLocationWarp(u8 healLocationId) { const struct HealLocation *healLocation = GetHealLocation(healLocationId); if (healLocation) - SetWarpData(&gSaveBlock1Ptr->lastHealLocation, healLocation->group, healLocation->map, -1, healLocation->x, healLocation->y); + SetWarpData(&gSaveBlock1Ptr->lastHealLocation, healLocation->group, healLocation->map, WARP_ID_NONE, healLocation->x, healLocation->y); } void UpdateEscapeWarp(s16 x, s16 y) @@ -683,7 +682,7 @@ void UpdateEscapeWarp(s16 x, s16 y) u8 currMapType = GetCurrentMapType(); u8 destMapType = GetMapTypeByGroupAndId(sWarpDestination.mapGroup, sWarpDestination.mapNum); if (IsMapTypeOutdoors(currMapType) && IsMapTypeOutdoors(destMapType) != TRUE) - SetEscapeWarp(gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, -1, x - MAP_OFFSET, y - MAP_OFFSET + 1); + SetEscapeWarp(gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, WARP_ID_NONE, x - MAP_OFFSET, y - MAP_OFFSET + 1); } void SetEscapeWarp(s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y) @@ -716,7 +715,7 @@ void SetWarpDestinationToFixedHoleWarp(s16 x, s16 y) if (IsDummyWarp(&sFixedHoleWarp) == TRUE) sWarpDestination = gLastUsedWarp; else - SetWarpDestination(sFixedHoleWarp.mapGroup, sFixedHoleWarp.mapNum, -1, x, y); + SetWarpDestination(sFixedHoleWarp.mapGroup, sFixedHoleWarp.mapNum, WARP_ID_NONE, x, y); } static void SetWarpDestinationToContinueGameWarp(void) @@ -733,7 +732,7 @@ void SetContinueGameWarpToHealLocation(u8 healLocationId) { const struct HealLocation *warp = GetHealLocation(healLocationId); if (warp) - SetWarpData(&gSaveBlock1Ptr->continueGameWarp, warp->group, warp->map, -1, warp->x, warp->y); + SetWarpData(&gSaveBlock1Ptr->continueGameWarp, warp->group, warp->map, WARP_ID_NONE, warp->x, warp->y); } void SetContinueGameWarpToDynamicWarp(int unused) @@ -763,7 +762,7 @@ static bool8 SetDiveWarp(u8 dir, u16 x, u16 y) if (connection != NULL) { - SetWarpDestination(connection->mapGroup, connection->mapNum, -1, x, y); + SetWarpDestination(connection->mapGroup, connection->mapNum, WARP_ID_NONE, x, y); } else { @@ -789,7 +788,7 @@ void LoadMapFromCameraTransition(u8 mapGroup, u8 mapNum) { s32 paletteIndex; - SetWarpDestination(mapGroup, mapNum, -1, -1, -1); + SetWarpDestination(mapGroup, mapNum, WARP_ID_NONE, -1, -1); // Dont transition map music between BF Outside West/East if (gMapHeader.regionMapSectionId != MAPSEC_BATTLE_FRONTIER) @@ -804,7 +803,7 @@ void LoadMapFromCameraTransition(u8 mapGroup, u8 mapNum) RestartWildEncounterImmunitySteps(); TryUpdateRandomTrainerRematches(mapGroup, mapNum); DoTimeBasedEvents(); - SetSav1WeatherFromCurrMapHeader(); + SetSavedWeatherFromCurrMapHeader(); ChooseAmbientCrySpecies(); SetDefaultFlashLevel(); Overworld_ClearSavedMusic(); @@ -855,7 +854,7 @@ static void LoadMapFromWarp(bool32 a1) TryUpdateRandomTrainerRematches(gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum); if (a1 != TRUE) DoTimeBasedEvents(); - SetSav1WeatherFromCurrMapHeader(); + SetSavedWeatherFromCurrMapHeader(); ChooseAmbientCrySpecies(); if (isOutdoors) FlagClear(FLAG_SYS_USE_FLASH); @@ -968,6 +967,10 @@ bool32 Overworld_IsBikingAllowed(void) return TRUE; } +// Flash level of 0 is fully bright +// Flash level of 1 is the largest flash radius +// Flash level of 7 is the smallest flash radius +// Flash level of 8 is fully black void SetDefaultFlashLevel(void) { if (!gMapHeader.cave) @@ -978,14 +981,14 @@ void SetDefaultFlashLevel(void) gSaveBlock1Ptr->flashLevel = gMaxFlashLevel - 1; } -void Overworld_SetFlashLevel(s32 flashLevel) +void SetFlashLevel(s32 flashLevel) { if (flashLevel < 0 || flashLevel > gMaxFlashLevel) flashLevel = 0; gSaveBlock1Ptr->flashLevel = flashLevel; } -u8 Overworld_GetFlashLevel(void) +u8 GetFlashLevel(void) { return gSaveBlock1Ptr->flashLevel; } @@ -1100,7 +1103,7 @@ u16 GetCurrLocationDefaultMusic(void) // Play the desert music only when the sandstorm is active on Route 111. if (gSaveBlock1Ptr->location.mapGroup == MAP_GROUP(ROUTE111) && gSaveBlock1Ptr->location.mapNum == MAP_NUM(ROUTE111) - && GetSav1Weather() == WEATHER_SANDSTORM) + && GetSavedWeather() == WEATHER_SANDSTORM) return MUS_ROUTE111; music = GetLocationMusic(&gSaveBlock1Ptr->location); @@ -1790,7 +1793,7 @@ static void InitCurrentFlashLevelScanlineEffect(void) WriteBattlePyramidViewScanlineEffectBuffer(); ScanlineEffect_SetParams(sFlashEffectParams); } - else if ((flashLevel = Overworld_GetFlashLevel())) + else if ((flashLevel = GetFlashLevel())) { WriteFlashScanlineEffectBuffer(flashLevel); ScanlineEffect_SetParams(sFlashEffectParams); @@ -3147,17 +3150,17 @@ static u8 FlipVerticalAndClearForced(u8 newFacing, u8 oldFacing) return oldFacing; } -static u8 LinkPlayerDetectCollision(u8 selfObjEventId, u8 a2, s16 x, s16 y) +static bool8 LinkPlayerDetectCollision(u8 selfObjEventId, u8 direction, s16 x, s16 y) { u8 i; - for (i = 0; i < 16; i++) + for (i = 0; i < OBJECT_EVENTS_COUNT; i++) { if (i != selfObjEventId) { if ((gObjectEvents[i].currentCoords.x == x && gObjectEvents[i].currentCoords.y == y) || (gObjectEvents[i].previousCoords.x == x && gObjectEvents[i].previousCoords.y == y)) { - return 1; + return TRUE; } } } @@ -3177,14 +3180,14 @@ static void CreateLinkPlayerSprite(u8 linkPlayerId, u8 gameVersion) { case VERSION_FIRE_RED: case VERSION_LEAF_GREEN: - objEvent->spriteId = AddPseudoObjectEvent(GetFRLGAvatarGraphicsIdByGender(linkGender(objEvent)), SpriteCB_LinkPlayer, 0, 0, 0); + objEvent->spriteId = CreateObjectGraphicsSprite(GetFRLGAvatarGraphicsIdByGender(linkGender(objEvent)), SpriteCB_LinkPlayer, 0, 0, 0); break; case VERSION_RUBY: case VERSION_SAPPHIRE: - objEvent->spriteId = AddPseudoObjectEvent(GetRSAvatarGraphicsIdByGender(linkGender(objEvent)), SpriteCB_LinkPlayer, 0, 0, 0); + objEvent->spriteId = CreateObjectGraphicsSprite(GetRSAvatarGraphicsIdByGender(linkGender(objEvent)), SpriteCB_LinkPlayer, 0, 0, 0); break; case VERSION_EMERALD: - objEvent->spriteId = AddPseudoObjectEvent(GetRivalAvatarGraphicsIdByStateIdAndGender(PLAYER_AVATAR_STATE_NORMAL, linkGender(objEvent)), SpriteCB_LinkPlayer, 0, 0, 0); + objEvent->spriteId = CreateObjectGraphicsSprite(GetRivalAvatarGraphicsIdByStateIdAndGender(PLAYER_AVATAR_STATE_NORMAL, linkGender(objEvent)), SpriteCB_LinkPlayer, 0, 0, 0); break; } diff --git a/src/party_menu.c b/src/party_menu.c index 43f5220346b5..34aff619fe83 100755 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -69,7 +69,6 @@ #include "constants/field_effects.h" #include "constants/item_effects.h" #include "constants/items.h" -#include "constants/maps.h" #include "constants/moves.h" #include "constants/party_menu.h" #include "constants/rgb.h" @@ -954,7 +953,7 @@ static void DisplayPartyPokemonDataForMultiBattle(u8 slot) { menuBox->infoRects->blitFunc(menuBox->windowId, 0, 0, 0, 0, FALSE); StringCopy(gStringVar1, gMultiPartnerParty[actualSlot].nickname); - StringGetEnd10(gStringVar1); + StringGet_Nickname(gStringVar1); ConvertInternationalPlayerName(gStringVar1); DisplayPartyPokemonBarDetail(menuBox->windowId, gStringVar1, 0, menuBox->infoRects->dimensions); DisplayPartyPokemonLevel(gMultiPartnerParty[actualSlot].level, menuBox); @@ -1622,7 +1621,7 @@ static s8 GetNewSlotDoubleLayout(s8 slotId, s8 movementDir) u8* GetMonNickname(struct Pokemon *mon, u8 *dest) { GetMonData(mon, MON_DATA_NICKNAME, dest); - return StringGetEnd10(dest); + return StringGet_Nickname(dest); } #define tKeepOpen data[0] @@ -3343,7 +3342,7 @@ static void Task_HandleSendMailToPCYesNoInput(u8 taskId) switch (Menu_ProcessInputNoWrapClearOnChoose()) { case 0: // Yes, send to PC - if (TakeMailFromMon2(&gPlayerParty[gPartyMenu.slotId]) != 0xFF) + if (TakeMailFromMonAndSave(&gPlayerParty[gPartyMenu.slotId]) != MAIL_NONE) { DisplayPartyMenuMessage(gText_MailSentToPC, FALSE); gTasks[taskId].func = Task_UpdateHeldItemSprite; @@ -6133,7 +6132,7 @@ static void BufferMonSelection(void) { gSpecialVar_0x8004 = GetCursorSelectionMonId(); if (gSpecialVar_0x8004 >= PARTY_SIZE) - gSpecialVar_0x8004 = 0xFF; + gSpecialVar_0x8004 = PARTY_NOTHING_CHOSEN; gFieldCallback2 = CB2_FadeFromPartyMenu; SetMainCallback2(CB2_ReturnToField); } @@ -6176,7 +6175,7 @@ static void CB2_ChooseContestMon(void) { gContestMonPartyIndex = GetCursorSelectionMonId(); if (gContestMonPartyIndex >= PARTY_SIZE) - gContestMonPartyIndex = 0xFF; + gContestMonPartyIndex = PARTY_NOTHING_CHOSEN; gSpecialVar_0x8004 = gContestMonPartyIndex; gFieldCallback2 = CB2_FadeFromPartyMenu; SetMainCallback2(CB2_ReturnToField); @@ -6221,7 +6220,7 @@ static void CB2_ChooseMonForMoveRelearner(void) { gSpecialVar_0x8004 = GetCursorSelectionMonId(); if (gSpecialVar_0x8004 >= PARTY_SIZE) - gSpecialVar_0x8004 = 0xFF; + gSpecialVar_0x8004 = PARTY_NOTHING_CHOSEN; else gSpecialVar_0x8005 = GetNumberOfRelearnableMoves(&gPlayerParty[gSpecialVar_0x8004]); gFieldCallback2 = CB2_FadeFromPartyMenu; diff --git a/src/pokeball.c b/src/pokeball.c index 501d86ca3569..cb68d6883367 100644 --- a/src/pokeball.c +++ b/src/pokeball.c @@ -1138,7 +1138,7 @@ static void SpriteCB_TradePokeball(struct Sprite *sprite) sprite->callback = SpriteCB_TradePokeballSendOff; #ifdef BUGFIX // FIX: If this is used on a sprite that has previously had an affine animation, it will not - // play the shrink anim properly due to being paused. Works together with the fix to `sub_817F77C`. + // play the shrink anim properly due to being paused. Works together with the fix to ResetSpriteAfterAnim. gSprites[monSpriteId].affineAnimPaused = FALSE; #endif // BUGFIX StartSpriteAffineAnim(&gSprites[monSpriteId], BATTLER_AFFINE_RETURN); diff --git a/src/pokedex_area_screen.c b/src/pokedex_area_screen.c index e2973dcab3a7..141041f4f18d 100755 --- a/src/pokedex_area_screen.c +++ b/src/pokedex_area_screen.c @@ -16,7 +16,6 @@ #include "trig.h" #include "pokedex_area_region_map.h" #include "wild_encounter.h" -#include "constants/maps.h" #include "constants/region_map_sections.h" #include "constants/rgb.h" #include "constants/songs.h" diff --git a/src/pokemon.c b/src/pokemon.c index 1607e1a40f4f..939c2429da0c 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -4647,7 +4647,7 @@ void CopyPlayerPartyMonToBattleData(u8 battlerId, u8 partyIndex) gBattleMons[battlerId].type2 = gBaseStats[gBattleMons[battlerId].species].type2; gBattleMons[battlerId].ability = GetAbilityBySpecies(gBattleMons[battlerId].species, gBattleMons[battlerId].abilityNum); GetMonData(&gPlayerParty[partyIndex], MON_DATA_NICKNAME, nickname); - StringCopy10(gBattleMons[battlerId].nickname, nickname); + StringCopy_Nickname(gBattleMons[battlerId].nickname, nickname); GetMonData(&gPlayerParty[partyIndex], MON_DATA_OT_NAME, gBattleMons[battlerId].otName); hpSwitchout = &gBattleStruct->hpOnSwitchout[GetBattlerSide(battlerId)]; diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c index f18dc68d1327..755cc7de0741 100644 --- a/src/pokemon_storage_system.c +++ b/src/pokemon_storage_system.c @@ -37,7 +37,6 @@ #include "walda_phrase.h" #include "window.h" #include "constants/items.h" -#include "constants/maps.h" #include "constants/moves.h" #include "constants/rgb.h" #include "constants/songs.h" @@ -6889,7 +6888,7 @@ static void SetDisplayMonData(void *pokemon, u8 mode) sStorage->displayMonIsEgg = GetMonData(mon, MON_DATA_IS_EGG); GetMonData(mon, MON_DATA_NICKNAME, sStorage->displayMonName); - StringGetEnd10(sStorage->displayMonName); + StringGet_Nickname(sStorage->displayMonName); sStorage->displayMonLevel = GetMonData(mon, MON_DATA_LEVEL); sStorage->displayMonMarkings = GetMonData(mon, MON_DATA_MARKINGS); sStorage->displayMonPersonality = GetMonData(mon, MON_DATA_PERSONALITY); @@ -6914,7 +6913,7 @@ static void SetDisplayMonData(void *pokemon, u8 mode) GetBoxMonData(boxMon, MON_DATA_NICKNAME, sStorage->displayMonName); - StringGetEnd10(sStorage->displayMonName); + StringGet_Nickname(sStorage->displayMonName); sStorage->displayMonLevel = GetLevelFromBoxMonExp(boxMon); sStorage->displayMonMarkings = GetBoxMonData(boxMon, MON_DATA_MARKINGS); sStorage->displayMonPersonality = GetBoxMonData(boxMon, MON_DATA_PERSONALITY); diff --git a/src/pokenav_conditions.c b/src/pokenav_conditions.c index e61b1156863f..94ed4e8d8ccb 100644 --- a/src/pokenav_conditions.c +++ b/src/pokenav_conditions.c @@ -351,7 +351,7 @@ static u8 *CopyConditionMonNameGender(u8 *str, u16 listId, bool8 arg3) return StringCopyPadded(str, gText_EggNickname, CHAR_SPACE, 12); GetBoxOrPartyMonData(boxId, monId, MON_DATA_NICKNAME, str); - StringGetEnd10(str); + StringGet_Nickname(str); species = GetBoxOrPartyMonData(boxId, monId, MON_DATA_SPECIES, NULL); if (boxId == TOTAL_BOXES_COUNT) { diff --git a/src/pokenav_conditions_search_results.c b/src/pokenav_conditions_search_results.c index c8790e3598b7..bbc07df2c3d6 100644 --- a/src/pokenav_conditions_search_results.c +++ b/src/pokenav_conditions_search_results.c @@ -711,7 +711,7 @@ static void BufferSearchMonListItem(struct PokenavMonListItem * item, u8 * dest) GetBoxMonData(mon, MON_DATA_NICKNAME, gStringVar3); } - StringGetEnd10(gStringVar3); + StringGet_Nickname(gStringVar3); dest = GetStringClearToWidth(dest, FONT_NORMAL, gStringVar3, 60); switch (gender) { diff --git a/src/pokenav_ribbons_list.c b/src/pokenav_ribbons_list.c index 1d72f6a980a0..724ced507ee1 100644 --- a/src/pokenav_ribbons_list.c +++ b/src/pokenav_ribbons_list.c @@ -721,7 +721,7 @@ static void BufferRibbonMonInfoText(struct PokenavListItem * listItem, u8 * dest GetBoxMonData(mon, MON_DATA_NICKNAME, gStringVar3); } - StringGetEnd10(gStringVar3); + StringGet_Nickname(gStringVar3); dest = GetStringClearToWidth(dest, FONT_NORMAL, gStringVar3, 60); switch (gender) { diff --git a/src/pokenav_ribbons_summary.c b/src/pokenav_ribbons_summary.c index 81d5b900bd77..581228ff41fb 100644 --- a/src/pokenav_ribbons_summary.c +++ b/src/pokenav_ribbons_summary.c @@ -397,7 +397,7 @@ static void GetMonNicknameLevelGender(u8 *nick, u8 *level, u8 *gender) *level = GetLevelFromBoxMonExp(boxMon); GetBoxMonData(boxMon, MON_DATA_NICKNAME, nick); } - StringGetEnd10(nick); + StringGet_Nickname(nick); } static void GetMonSpeciesPersonalityOtId(u16 *species, u32 *personality, u32 *otId) diff --git a/src/region_map.c b/src/region_map.c index 759a26e84a4c..0dc90267425b 100644 --- a/src/region_map.c +++ b/src/region_map.c @@ -7,7 +7,6 @@ #include "palette.h" #include "party_menu.h" #include "trig.h" -#include "constants/maps.h" #include "overworld.h" #include "event_data.h" #include "secret_base.h" @@ -290,56 +289,56 @@ static const u32 sFlyTargetIcons_Gfx[] = INCBIN_U32("graphics/pokenav/region_map static const u8 sMapHealLocations[][3] = { - {MAP_GROUP(LITTLEROOT_TOWN), MAP_NUM(LITTLEROOT_TOWN), HEAL_LOCATION_LITTLEROOT_TOWN_BRENDANS_HOUSE_2F}, - {MAP_GROUP(OLDALE_TOWN), MAP_NUM(OLDALE_TOWN), HEAL_LOCATION_OLDALE_TOWN}, - {MAP_GROUP(DEWFORD_TOWN), MAP_NUM(DEWFORD_TOWN), HEAL_LOCATION_DEWFORD_TOWN}, - {MAP_GROUP(LAVARIDGE_TOWN), MAP_NUM(LAVARIDGE_TOWN), HEAL_LOCATION_LAVARIDGE_TOWN}, - {MAP_GROUP(FALLARBOR_TOWN), MAP_NUM(FALLARBOR_TOWN), HEAL_LOCATION_FALLARBOR_TOWN}, - {MAP_GROUP(VERDANTURF_TOWN), MAP_NUM(VERDANTURF_TOWN), HEAL_LOCATION_VERDANTURF_TOWN}, - {MAP_GROUP(PACIFIDLOG_TOWN), MAP_NUM(PACIFIDLOG_TOWN), HEAL_LOCATION_PACIFIDLOG_TOWN}, - {MAP_GROUP(PETALBURG_CITY), MAP_NUM(PETALBURG_CITY), HEAL_LOCATION_PETALBURG_CITY}, - {MAP_GROUP(SLATEPORT_CITY), MAP_NUM(SLATEPORT_CITY), HEAL_LOCATION_SLATEPORT_CITY}, - {MAP_GROUP(MAUVILLE_CITY), MAP_NUM(MAUVILLE_CITY), HEAL_LOCATION_MAUVILLE_CITY}, - {MAP_GROUP(RUSTBORO_CITY), MAP_NUM(RUSTBORO_CITY), HEAL_LOCATION_RUSTBORO_CITY}, - {MAP_GROUP(FORTREE_CITY), MAP_NUM(FORTREE_CITY), HEAL_LOCATION_FORTREE_CITY}, - {MAP_GROUP(LILYCOVE_CITY), MAP_NUM(LILYCOVE_CITY), HEAL_LOCATION_LILYCOVE_CITY}, - {MAP_GROUP(MOSSDEEP_CITY), MAP_NUM(MOSSDEEP_CITY), HEAL_LOCATION_MOSSDEEP_CITY}, - {MAP_GROUP(SOOTOPOLIS_CITY), MAP_NUM(SOOTOPOLIS_CITY), HEAL_LOCATION_SOOTOPOLIS_CITY}, - {MAP_GROUP(EVER_GRANDE_CITY), MAP_NUM(EVER_GRANDE_CITY), HEAL_LOCATION_EVER_GRANDE_CITY}, - {MAP_GROUP(ROUTE101), MAP_NUM(ROUTE101), 0}, - {MAP_GROUP(ROUTE102), MAP_NUM(ROUTE102), 0}, - {MAP_GROUP(ROUTE103), MAP_NUM(ROUTE103), 0}, - {MAP_GROUP(ROUTE104), MAP_NUM(ROUTE104), 0}, - {MAP_GROUP(ROUTE105), MAP_NUM(ROUTE105), 0}, - {MAP_GROUP(ROUTE106), MAP_NUM(ROUTE106), 0}, - {MAP_GROUP(ROUTE107), MAP_NUM(ROUTE107), 0}, - {MAP_GROUP(ROUTE108), MAP_NUM(ROUTE108), 0}, - {MAP_GROUP(ROUTE109), MAP_NUM(ROUTE109), 0}, - {MAP_GROUP(ROUTE110), MAP_NUM(ROUTE110), 0}, - {MAP_GROUP(ROUTE111), MAP_NUM(ROUTE111), 0}, - {MAP_GROUP(ROUTE112), MAP_NUM(ROUTE112), 0}, - {MAP_GROUP(ROUTE113), MAP_NUM(ROUTE113), 0}, - {MAP_GROUP(ROUTE114), MAP_NUM(ROUTE114), 0}, - {MAP_GROUP(ROUTE115), MAP_NUM(ROUTE115), 0}, - {MAP_GROUP(ROUTE116), MAP_NUM(ROUTE116), 0}, - {MAP_GROUP(ROUTE117), MAP_NUM(ROUTE117), 0}, - {MAP_GROUP(ROUTE118), MAP_NUM(ROUTE118), 0}, - {MAP_GROUP(ROUTE119), MAP_NUM(ROUTE119), 0}, - {MAP_GROUP(ROUTE120), MAP_NUM(ROUTE120), 0}, - {MAP_GROUP(ROUTE121), MAP_NUM(ROUTE121), 0}, - {MAP_GROUP(ROUTE122), MAP_NUM(ROUTE122), 0}, - {MAP_GROUP(ROUTE123), MAP_NUM(ROUTE123), 0}, - {MAP_GROUP(ROUTE124), MAP_NUM(ROUTE124), 0}, - {MAP_GROUP(ROUTE125), MAP_NUM(ROUTE125), 0}, - {MAP_GROUP(ROUTE126), MAP_NUM(ROUTE126), 0}, - {MAP_GROUP(ROUTE127), MAP_NUM(ROUTE127), 0}, - {MAP_GROUP(ROUTE128), MAP_NUM(ROUTE128), 0}, - {MAP_GROUP(ROUTE129), MAP_NUM(ROUTE129), 0}, - {MAP_GROUP(ROUTE130), MAP_NUM(ROUTE130), 0}, - {MAP_GROUP(ROUTE131), MAP_NUM(ROUTE131), 0}, - {MAP_GROUP(ROUTE132), MAP_NUM(ROUTE132), 0}, - {MAP_GROUP(ROUTE133), MAP_NUM(ROUTE133), 0}, - {MAP_GROUP(ROUTE134), MAP_NUM(ROUTE134), 0} + [MAPSEC_LITTLEROOT_TOWN] = {MAP_GROUP(LITTLEROOT_TOWN), MAP_NUM(LITTLEROOT_TOWN), HEAL_LOCATION_LITTLEROOT_TOWN_BRENDANS_HOUSE_2F}, + [MAPSEC_OLDALE_TOWN] = {MAP_GROUP(OLDALE_TOWN), MAP_NUM(OLDALE_TOWN), HEAL_LOCATION_OLDALE_TOWN}, + [MAPSEC_DEWFORD_TOWN] = {MAP_GROUP(DEWFORD_TOWN), MAP_NUM(DEWFORD_TOWN), HEAL_LOCATION_DEWFORD_TOWN}, + [MAPSEC_LAVARIDGE_TOWN] = {MAP_GROUP(LAVARIDGE_TOWN), MAP_NUM(LAVARIDGE_TOWN), HEAL_LOCATION_LAVARIDGE_TOWN}, + [MAPSEC_FALLARBOR_TOWN] = {MAP_GROUP(FALLARBOR_TOWN), MAP_NUM(FALLARBOR_TOWN), HEAL_LOCATION_FALLARBOR_TOWN}, + [MAPSEC_VERDANTURF_TOWN] = {MAP_GROUP(VERDANTURF_TOWN), MAP_NUM(VERDANTURF_TOWN), HEAL_LOCATION_VERDANTURF_TOWN}, + [MAPSEC_PACIFIDLOG_TOWN] = {MAP_GROUP(PACIFIDLOG_TOWN), MAP_NUM(PACIFIDLOG_TOWN), HEAL_LOCATION_PACIFIDLOG_TOWN}, + [MAPSEC_PETALBURG_CITY] = {MAP_GROUP(PETALBURG_CITY), MAP_NUM(PETALBURG_CITY), HEAL_LOCATION_PETALBURG_CITY}, + [MAPSEC_SLATEPORT_CITY] = {MAP_GROUP(SLATEPORT_CITY), MAP_NUM(SLATEPORT_CITY), HEAL_LOCATION_SLATEPORT_CITY}, + [MAPSEC_MAUVILLE_CITY] = {MAP_GROUP(MAUVILLE_CITY), MAP_NUM(MAUVILLE_CITY), HEAL_LOCATION_MAUVILLE_CITY}, + [MAPSEC_RUSTBORO_CITY] = {MAP_GROUP(RUSTBORO_CITY), MAP_NUM(RUSTBORO_CITY), HEAL_LOCATION_RUSTBORO_CITY}, + [MAPSEC_FORTREE_CITY] = {MAP_GROUP(FORTREE_CITY), MAP_NUM(FORTREE_CITY), HEAL_LOCATION_FORTREE_CITY}, + [MAPSEC_LILYCOVE_CITY] = {MAP_GROUP(LILYCOVE_CITY), MAP_NUM(LILYCOVE_CITY), HEAL_LOCATION_LILYCOVE_CITY}, + [MAPSEC_MOSSDEEP_CITY] = {MAP_GROUP(MOSSDEEP_CITY), MAP_NUM(MOSSDEEP_CITY), HEAL_LOCATION_MOSSDEEP_CITY}, + [MAPSEC_SOOTOPOLIS_CITY] = {MAP_GROUP(SOOTOPOLIS_CITY), MAP_NUM(SOOTOPOLIS_CITY), HEAL_LOCATION_SOOTOPOLIS_CITY}, + [MAPSEC_EVER_GRANDE_CITY] = {MAP_GROUP(EVER_GRANDE_CITY), MAP_NUM(EVER_GRANDE_CITY), HEAL_LOCATION_EVER_GRANDE_CITY}, + [MAPSEC_ROUTE_101] = {MAP_GROUP(ROUTE101), MAP_NUM(ROUTE101), 0}, + [MAPSEC_ROUTE_102] = {MAP_GROUP(ROUTE102), MAP_NUM(ROUTE102), 0}, + [MAPSEC_ROUTE_103] = {MAP_GROUP(ROUTE103), MAP_NUM(ROUTE103), 0}, + [MAPSEC_ROUTE_104] = {MAP_GROUP(ROUTE104), MAP_NUM(ROUTE104), 0}, + [MAPSEC_ROUTE_105] = {MAP_GROUP(ROUTE105), MAP_NUM(ROUTE105), 0}, + [MAPSEC_ROUTE_106] = {MAP_GROUP(ROUTE106), MAP_NUM(ROUTE106), 0}, + [MAPSEC_ROUTE_107] = {MAP_GROUP(ROUTE107), MAP_NUM(ROUTE107), 0}, + [MAPSEC_ROUTE_108] = {MAP_GROUP(ROUTE108), MAP_NUM(ROUTE108), 0}, + [MAPSEC_ROUTE_109] = {MAP_GROUP(ROUTE109), MAP_NUM(ROUTE109), 0}, + [MAPSEC_ROUTE_110] = {MAP_GROUP(ROUTE110), MAP_NUM(ROUTE110), 0}, + [MAPSEC_ROUTE_111] = {MAP_GROUP(ROUTE111), MAP_NUM(ROUTE111), 0}, + [MAPSEC_ROUTE_112] = {MAP_GROUP(ROUTE112), MAP_NUM(ROUTE112), 0}, + [MAPSEC_ROUTE_113] = {MAP_GROUP(ROUTE113), MAP_NUM(ROUTE113), 0}, + [MAPSEC_ROUTE_114] = {MAP_GROUP(ROUTE114), MAP_NUM(ROUTE114), 0}, + [MAPSEC_ROUTE_115] = {MAP_GROUP(ROUTE115), MAP_NUM(ROUTE115), 0}, + [MAPSEC_ROUTE_116] = {MAP_GROUP(ROUTE116), MAP_NUM(ROUTE116), 0}, + [MAPSEC_ROUTE_117] = {MAP_GROUP(ROUTE117), MAP_NUM(ROUTE117), 0}, + [MAPSEC_ROUTE_118] = {MAP_GROUP(ROUTE118), MAP_NUM(ROUTE118), 0}, + [MAPSEC_ROUTE_119] = {MAP_GROUP(ROUTE119), MAP_NUM(ROUTE119), 0}, + [MAPSEC_ROUTE_120] = {MAP_GROUP(ROUTE120), MAP_NUM(ROUTE120), 0}, + [MAPSEC_ROUTE_121] = {MAP_GROUP(ROUTE121), MAP_NUM(ROUTE121), 0}, + [MAPSEC_ROUTE_122] = {MAP_GROUP(ROUTE122), MAP_NUM(ROUTE122), 0}, + [MAPSEC_ROUTE_123] = {MAP_GROUP(ROUTE123), MAP_NUM(ROUTE123), 0}, + [MAPSEC_ROUTE_124] = {MAP_GROUP(ROUTE124), MAP_NUM(ROUTE124), 0}, + [MAPSEC_ROUTE_125] = {MAP_GROUP(ROUTE125), MAP_NUM(ROUTE125), 0}, + [MAPSEC_ROUTE_126] = {MAP_GROUP(ROUTE126), MAP_NUM(ROUTE126), 0}, + [MAPSEC_ROUTE_127] = {MAP_GROUP(ROUTE127), MAP_NUM(ROUTE127), 0}, + [MAPSEC_ROUTE_128] = {MAP_GROUP(ROUTE128), MAP_NUM(ROUTE128), 0}, + [MAPSEC_ROUTE_129] = {MAP_GROUP(ROUTE129), MAP_NUM(ROUTE129), 0}, + [MAPSEC_ROUTE_130] = {MAP_GROUP(ROUTE130), MAP_NUM(ROUTE130), 0}, + [MAPSEC_ROUTE_131] = {MAP_GROUP(ROUTE131), MAP_NUM(ROUTE131), 0}, + [MAPSEC_ROUTE_132] = {MAP_GROUP(ROUTE132), MAP_NUM(ROUTE132), 0}, + [MAPSEC_ROUTE_133] = {MAP_GROUP(ROUTE133), MAP_NUM(ROUTE133), 0}, + [MAPSEC_ROUTE_134] = {MAP_GROUP(ROUTE134), MAP_NUM(ROUTE134), 0} }; static const u8 *const sEverGrandeCityNames[] = @@ -2013,7 +2012,7 @@ static void CB_ExitFlyMap(void) if (sMapHealLocations[sFlyMap->regionMap.mapSecId][2] != 0) SetWarpDestinationToHealLocation(sMapHealLocations[sFlyMap->regionMap.mapSecId][2]); else - SetWarpDestinationToMapWarp(sMapHealLocations[sFlyMap->regionMap.mapSecId][0], sMapHealLocations[sFlyMap->regionMap.mapSecId][1], -1); + SetWarpDestinationToMapWarp(sMapHealLocations[sFlyMap->regionMap.mapSecId][0], sMapHealLocations[sFlyMap->regionMap.mapSecId][1], WARP_ID_NONE); break; } ReturnToFieldFromFlyMapSelect(); diff --git a/src/roamer.c b/src/roamer.c index b8d10096742b..4811ac3b22ad 100644 --- a/src/roamer.c +++ b/src/roamer.c @@ -3,7 +3,6 @@ #include "pokemon.h" #include "random.h" #include "roamer.h" -#include "constants/maps.h" // Despite having a variable to track it, the roamer is // hard-coded to only ever be in map group 0 diff --git a/src/rotating_gate.c b/src/rotating_gate.c index ea2eec126187..23fbb3e1d6be 100644 --- a/src/rotating_gate.c +++ b/src/rotating_gate.c @@ -5,7 +5,6 @@ #include "fieldmap.h" #include "sound.h" #include "sprite.h" -#include "constants/maps.h" #include "constants/songs.h" #define ROTATING_GATE_TILE_TAG 0x1300 diff --git a/src/save_location.c b/src/save_location.c index b201ca1c0d8c..74d2f2c44d0f 100644 --- a/src/save_location.c +++ b/src/save_location.c @@ -1,6 +1,5 @@ #include "global.h" #include "save_location.h" -#include "constants/maps.h" #define LIST_END 0xFFFF diff --git a/src/scrcmd.c b/src/scrcmd.c index 6007fb49314b..2c18cb565e8c 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -49,7 +49,6 @@ #include "tv.h" #include "window.h" #include "constants/event_objects.h" -#include "constants/maps.h" typedef u16 (*SpecialFunc)(void); typedef void (*NativeFunc)(void); @@ -58,11 +57,11 @@ EWRAM_DATA const u8 *gRamScriptRetAddr = NULL; static EWRAM_DATA u32 sAddressOffset = 0; // For relative addressing in vgoto etc., used by saved scripts (e.g. Mystery Event) static EWRAM_DATA u16 sPauseCounter = 0; static EWRAM_DATA u16 sMovingNpcId = 0; -static EWRAM_DATA u16 sMovingNpcMapBank = 0; -static EWRAM_DATA u16 sMovingNpcMapId = 0; +static EWRAM_DATA u16 sMovingNpcMapGroup = 0; +static EWRAM_DATA u16 sMovingNpcMapNum = 0; static EWRAM_DATA u16 sFieldEffectScriptId = 0; -static u8 gBrailleWindowId; +static u8 sBrailleWindowId; extern const SpecialFunc gSpecials[]; extern const u8 *gStdScripts[]; @@ -287,7 +286,7 @@ bool8 ScrCmd_returnram(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_killscript(struct ScriptContext *ctx) +bool8 ScrCmd_endram(struct ScriptContext *ctx) { ClearRamScript(); StopScript(ctx); @@ -296,9 +295,9 @@ bool8 ScrCmd_killscript(struct ScriptContext *ctx) bool8 ScrCmd_setmysteryeventstatus(struct ScriptContext *ctx) { - u8 value = ScriptReadByte(ctx); + u8 status = ScriptReadByte(ctx); - SetMysteryEventScriptStatus(value); + SetMysteryEventScriptStatus(status); return FALSE; } @@ -310,7 +309,7 @@ bool8 ScrCmd_loadword(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_loadbytefromaddr(struct ScriptContext *ctx) +bool8 ScrCmd_loadbytefromptr(struct ScriptContext *ctx) { u8 index = ScriptReadByte(ctx); @@ -318,7 +317,7 @@ bool8 ScrCmd_loadbytefromaddr(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_writebytetoaddr(struct ScriptContext *ctx) +bool8 ScrCmd_setptr(struct ScriptContext *ctx) { u8 value = ScriptReadByte(ctx); @@ -406,7 +405,7 @@ bool8 ScrCmd_compare_local_to_value(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_compare_local_to_addr(struct ScriptContext *ctx) +bool8 ScrCmd_compare_local_to_ptr(struct ScriptContext *ctx) { const u8 value1 = ctx->data[ScriptReadByte(ctx)]; const u8 value2 = *(const u8 *)ScriptReadWord(ctx); @@ -415,7 +414,7 @@ bool8 ScrCmd_compare_local_to_addr(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_compare_addr_to_local(struct ScriptContext *ctx) +bool8 ScrCmd_compare_ptr_to_local(struct ScriptContext *ctx) { const u8 value1 = *(const u8 *)ScriptReadWord(ctx); const u8 value2 = ctx->data[ScriptReadByte(ctx)]; @@ -424,7 +423,7 @@ bool8 ScrCmd_compare_addr_to_local(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_compare_addr_to_value(struct ScriptContext *ctx) +bool8 ScrCmd_compare_ptr_to_value(struct ScriptContext *ctx) { const u8 value1 = *(const u8 *)ScriptReadWord(ctx); const u8 value2 = ScriptReadByte(ctx); @@ -433,7 +432,7 @@ bool8 ScrCmd_compare_addr_to_value(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_compare_addr_to_addr(struct ScriptContext *ctx) +bool8 ScrCmd_compare_ptr_to_ptr(struct ScriptContext *ctx) { const u8 value1 = *(const u8 *)ScriptReadWord(ctx); const u8 value2 = *(const u8 *)ScriptReadWord(ctx); @@ -610,11 +609,9 @@ bool8 ScrCmd_animateflash(struct ScriptContext *ctx) return TRUE; } -bool8 ScrCmd_setflashradius(struct ScriptContext *ctx) +bool8 ScrCmd_setflashlevel(struct ScriptContext *ctx) { - u16 flashLevel = VarGet(ScriptReadHalfword(ctx)); - - Overworld_SetFlashLevel(flashLevel); + SetFlashLevel(VarGet(ScriptReadHalfword(ctx))); return FALSE; } @@ -649,17 +646,17 @@ bool8 ScrCmd_fadescreenswapbuffers(struct ScriptContext *ctx) switch (mode) { - case FADE_TO_BLACK: - case FADE_TO_WHITE: - default: - CpuCopy32(gPlttBufferUnfaded, gPaletteDecompressionBuffer, PLTT_DECOMP_BUFFER_SIZE); - FadeScreen(mode, 0); - break; - case FADE_FROM_BLACK: - case FADE_FROM_WHITE: - CpuCopy32(gPaletteDecompressionBuffer, gPlttBufferUnfaded, PLTT_DECOMP_BUFFER_SIZE); - FadeScreen(mode, 0); - break; + case FADE_TO_BLACK: + case FADE_TO_WHITE: + default: + CpuCopy32(gPlttBufferUnfaded, gPaletteDecompressionBuffer, PLTT_DECOMP_BUFFER_SIZE); + FadeScreen(mode, 0); + break; + case FADE_FROM_BLACK: + case FADE_FROM_WHITE: + CpuCopy32(gPaletteDecompressionBuffer, gPlttBufferUnfaded, PLTT_DECOMP_BUFFER_SIZE); + FadeScreen(mode, 0); + break; } SetupNativeScript(ctx, IsPaletteNotActive); @@ -668,9 +665,7 @@ bool8 ScrCmd_fadescreenswapbuffers(struct ScriptContext *ctx) static bool8 RunPauseTimer(void) { - sPauseCounter--; - - if (sPauseCounter == 0) + if (--sPauseCounter == 0) return TRUE; else return FALSE; @@ -711,13 +706,13 @@ bool8 ScrCmd_setweather(struct ScriptContext *ctx) { u16 weather = VarGet(ScriptReadHalfword(ctx)); - SetSav1Weather(weather); + SetSavedWeather(weather); return FALSE; } bool8 ScrCmd_resetweather(struct ScriptContext *ctx) { - SetSav1WeatherFromCurrMapHeader(); + SetSavedWeatherFromCurrMapHeader(); return FALSE; } @@ -794,7 +789,7 @@ bool8 ScrCmd_warphole(struct ScriptContext *ctx) if (mapGroup == MAP_GROUP(UNDEFINED) && mapNum == MAP_NUM(UNDEFINED)) SetWarpDestinationToFixedHoleWarp(x - MAP_OFFSET, y - MAP_OFFSET); else - SetWarpDestination(mapGroup, mapNum, -1, x - MAP_OFFSET, y - MAP_OFFSET); + SetWarpDestination(mapGroup, mapNum, WARP_ID_NONE, x - MAP_OFFSET, y - MAP_OFFSET); DoFallWarp(); ResetInitialPlayerAvatarState(); return TRUE; @@ -945,9 +940,9 @@ bool8 ScrCmd_waitfanfare(struct ScriptContext *ctx) bool8 ScrCmd_playbgm(struct ScriptContext *ctx) { u16 songId = ScriptReadHalfword(ctx); - bool8 val = ScriptReadByte(ctx); + bool8 save = ScriptReadByte(ctx); - if (val == TRUE) + if (save == TRUE) Overworld_SetSavedMusic(songId); PlayNewMapMusic(songId); return FALSE; @@ -1018,7 +1013,7 @@ bool8 ScrCmd_applymovement_at(struct ScriptContext *ctx) static bool8 WaitForMovementFinish(void) { - return ScriptMovement_IsObjectMovementFinished(sMovingNpcId, sMovingNpcMapId, sMovingNpcMapBank); + return ScriptMovement_IsObjectMovementFinished(sMovingNpcId, sMovingNpcMapNum, sMovingNpcMapGroup); } bool8 ScrCmd_waitmovement(struct ScriptContext *ctx) @@ -1027,8 +1022,8 @@ bool8 ScrCmd_waitmovement(struct ScriptContext *ctx) if (localId != 0) sMovingNpcId = localId; - sMovingNpcMapBank = gSaveBlock1Ptr->location.mapGroup; - sMovingNpcMapId = gSaveBlock1Ptr->location.mapNum; + sMovingNpcMapGroup = gSaveBlock1Ptr->location.mapGroup; + sMovingNpcMapNum = gSaveBlock1Ptr->location.mapNum; SetupNativeScript(ctx, WaitForMovementFinish); return TRUE; } @@ -1036,15 +1031,15 @@ bool8 ScrCmd_waitmovement(struct ScriptContext *ctx) bool8 ScrCmd_waitmovement_at(struct ScriptContext *ctx) { u16 localId = VarGet(ScriptReadHalfword(ctx)); - u8 mapBank; - u8 mapId; + u8 mapGroup; + u8 mapNum; if (localId != 0) sMovingNpcId = localId; - mapBank = ScriptReadByte(ctx); - mapId = ScriptReadByte(ctx); - sMovingNpcMapBank = mapBank; - sMovingNpcMapId = mapId; + mapGroup = ScriptReadByte(ctx); + mapNum = ScriptReadByte(ctx); + sMovingNpcMapGroup = mapGroup; + sMovingNpcMapNum = mapNum; SetupNativeScript(ctx, WaitForMovementFinish); return TRUE; } @@ -1101,7 +1096,7 @@ bool8 ScrCmd_setobjectxyperm(struct ScriptContext *ctx) u16 x = VarGet(ScriptReadHalfword(ctx)); u16 y = VarGet(ScriptReadHalfword(ctx)); - Overworld_SetObjEventTemplateCoords(localId, x, y); + SetObjEventTemplateCoords(localId, x, y); return FALSE; } @@ -1133,24 +1128,24 @@ bool8 ScrCmd_hideobject_at(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_setobjectpriority(struct ScriptContext *ctx) +bool8 ScrCmd_setobjectsubpriority(struct ScriptContext *ctx) { u16 localId = VarGet(ScriptReadHalfword(ctx)); u8 mapGroup = ScriptReadByte(ctx); u8 mapNum = ScriptReadByte(ctx); u8 priority = ScriptReadByte(ctx); - SetObjectPriority(localId, mapNum, mapGroup, priority + 83); + SetObjectSubpriority(localId, mapNum, mapGroup, priority + 83); return FALSE; } -bool8 ScrCmd_resetobjectpriority(struct ScriptContext *ctx) +bool8 ScrCmd_resetobjectsubpriority(struct ScriptContext *ctx) { u16 localId = VarGet(ScriptReadHalfword(ctx)); u8 mapGroup = ScriptReadByte(ctx); u8 mapNum = ScriptReadByte(ctx); - ResetObjectPriority(localId, mapNum, mapGroup); + ResetObjectSubpriority(localId, mapNum, mapGroup); return FALSE; } @@ -1178,29 +1173,29 @@ bool8 ScrCmd_setobjectmovementtype(struct ScriptContext *ctx) u16 localId = VarGet(ScriptReadHalfword(ctx)); u8 movementType = ScriptReadByte(ctx); - Overworld_SetObjEventTemplateMovementType(localId, movementType); + SetObjEventTemplateMovementType(localId, movementType); return FALSE; } bool8 ScrCmd_createvobject(struct ScriptContext *ctx) { u8 graphicsId = ScriptReadByte(ctx); - u8 objectEventId = ScriptReadByte(ctx); + u8 virtualObjId = ScriptReadByte(ctx); u16 x = VarGet(ScriptReadHalfword(ctx)); u32 y = VarGet(ScriptReadHalfword(ctx)); u8 elevation = ScriptReadByte(ctx); u8 direction = ScriptReadByte(ctx); - CreateObjectSprite(graphicsId, objectEventId, x, y, elevation, direction); + CreateVirtualObject(graphicsId, virtualObjId, x, y, elevation, direction); return FALSE; } bool8 ScrCmd_turnvobject(struct ScriptContext *ctx) { - u8 objectEventId = ScriptReadByte(ctx); + u8 virtualObjId = ScriptReadByte(ctx); u8 direction = ScriptReadByte(ctx); - TurnObjectEventSprite(objectEventId, direction); + TurnVirtualObject(virtualObjId, direction); return FALSE; } @@ -1311,7 +1306,7 @@ bool8 ScrCmd_messageinstant(struct ScriptContext *ctx) msg = (const u8 *)ctx->data[0]; LoadMessageBoxAndBorderGfx(); DrawDialogueFrame(0, 1); - AddTextPrinterParameterized(0, FONT_NORMAL, msg, 0, 1, 0, 0); + AddTextPrinterParameterized(0, FONT_NORMAL, msg, 0, 1, 0, NULL); return FALSE; } @@ -1463,7 +1458,9 @@ bool8 ScrCmd_showmonpic(struct ScriptContext *ctx) bool8 ScrCmd_hidemonpic(struct ScriptContext *ctx) { - bool8 (*func)(void) = ScriptMenu_GetPicboxWaitFunc(); + // The hide function returns a pointer to a function + // that returns true once the pic is hidden + bool8 (*func)(void) = ScriptMenu_HidePokemonPic(); if (func == NULL) return FALSE; @@ -1528,13 +1525,13 @@ bool8 ScrCmd_braillemessage(struct ScriptContext *ctx) yText = (yText - yWindow - 1) * 8; winTemplate = CreateWindowTemplate(0, xWindow, yWindow + 1, width, height, 0xF, 0x1); - gBrailleWindowId = AddWindow(&winTemplate); - LoadUserWindowBorderGfx(gBrailleWindowId, 0x214, 0xE0); - DrawStdWindowFrame(gBrailleWindowId, 0); - PutWindowTilemap(gBrailleWindowId); - FillWindowPixelBuffer(gBrailleWindowId, PIXEL_FILL(1)); - AddTextPrinterParameterized(gBrailleWindowId, FONT_BRAILLE, gStringVar4, xText, yText, TEXT_SKIP_DRAW, NULL); - CopyWindowToVram(gBrailleWindowId, COPYWIN_FULL); + sBrailleWindowId = AddWindow(&winTemplate); + LoadUserWindowBorderGfx(sBrailleWindowId, 0x214, 0xE0); + DrawStdWindowFrame(sBrailleWindowId, 0); + PutWindowTilemap(sBrailleWindowId); + FillWindowPixelBuffer(sBrailleWindowId, PIXEL_FILL(1)); + AddTextPrinterParameterized(sBrailleWindowId, FONT_BRAILLE, gStringVar4, xText, yText, TEXT_SKIP_DRAW, NULL); + CopyWindowToVram(sBrailleWindowId, COPYWIN_FULL); return FALSE; } @@ -1578,7 +1575,7 @@ bool8 ScrCmd_bufferpartymonnick(struct ScriptContext *ctx) u16 partyIndex = VarGet(ScriptReadHalfword(ctx)); GetMonData(&gPlayerParty[partyIndex], MON_DATA_NICKNAME, sScriptStringVars[stringVarIndex]); - StringGetEnd10(sScriptStringVars[stringVarIndex]); + StringGet_Nickname(sScriptStringVars[stringVarIndex]); return FALSE; } @@ -1638,12 +1635,12 @@ bool8 ScrCmd_bufferstdstring(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_buffercontesttype(struct ScriptContext *ctx) +bool8 ScrCmd_buffercontestname(struct ScriptContext *ctx) { u8 stringVarIndex = ScriptReadByte(ctx); - u16 index = VarGet(ScriptReadHalfword(ctx)); + u16 category = VarGet(ScriptReadHalfword(ctx)); - BufferContestName(sScriptStringVars[stringVarIndex], index); + BufferContestName(sScriptStringVars[stringVarIndex], category); return FALSE; } @@ -1656,7 +1653,7 @@ bool8 ScrCmd_bufferstring(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_vloadword(struct ScriptContext *ctx) +bool8 ScrCmd_vbuffermessage(struct ScriptContext *ctx) { const u8 *ptr = (u8 *)(ScriptReadWord(ctx) - sAddressOffset); @@ -1933,17 +1930,17 @@ bool8 ScrCmd_setberrytree(struct ScriptContext *ctx) u8 growthStage = ScriptReadByte(ctx); if (berry == 0) - PlantBerryTree(treeId, 0, growthStage, FALSE); + PlantBerryTree(treeId, berry, growthStage, FALSE); else PlantBerryTree(treeId, berry, growthStage, FALSE); return FALSE; } -bool8 ScrCmd_getpricereduction(struct ScriptContext *ctx) +bool8 ScrCmd_getpokenewsactive(struct ScriptContext *ctx) { u16 newsKind = VarGet(ScriptReadHalfword(ctx)); - gSpecialVar_Result = GetPriceReduction(newsKind); + gSpecialVar_Result = IsPokeNewsActive(newsKind); return FALSE; } @@ -1985,7 +1982,7 @@ bool8 ScrCmd_dofieldeffect(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_setfieldeffectarg(struct ScriptContext *ctx) +bool8 ScrCmd_setfieldeffectargument(struct ScriptContext *ctx) { u8 argNum = ScriptReadByte(ctx); @@ -2230,9 +2227,7 @@ bool8 ScrCmd_checkmoneventlegal(struct ScriptContext *ctx) return FALSE; } -// TODO: Should be renamed. Name implies general usage, but its specifically for Wonder Card -// See GetSavedRamScriptIfValid, which is NULL if ValidateSavedWonderCard returns FALSE -bool8 ScrCmd_gotoram(struct ScriptContext *ctx) +bool8 ScrCmd_trywondercardscript(struct ScriptContext *ctx) { const u8* script = GetSavedRamScriptIfValid(); @@ -2244,7 +2239,7 @@ bool8 ScrCmd_gotoram(struct ScriptContext *ctx) return FALSE; } -// Unused +// This warp is only used by the Union Room. // For the warp used by the Aqua Hideout, see DoTeleportTileWarp bool8 ScrCmd_warpspinenter(struct ScriptContext *ctx) { @@ -2273,8 +2268,8 @@ bool8 ScrCmd_setmonmetlocation(struct ScriptContext *ctx) static void CloseBrailleWindow(void) { - ClearStdWindowAndFrame(gBrailleWindowId, 1); - RemoveWindow(gBrailleWindowId); + ClearStdWindowAndFrame(sBrailleWindowId, 1); + RemoveWindow(sBrailleWindowId); } bool8 ScrCmd_buffertrainerclassname(struct ScriptContext *ctx) @@ -2300,7 +2295,7 @@ void SetMovingNpcId(u16 npcId) sMovingNpcId = npcId; } -bool8 ScrCmd_warpsootopolislegend(struct ScriptContext *ctx) +bool8 ScrCmd_warpwhitefade(struct ScriptContext *ctx) { u8 mapGroup = ScriptReadByte(ctx); u8 mapNum = ScriptReadByte(ctx); @@ -2309,7 +2304,7 @@ bool8 ScrCmd_warpsootopolislegend(struct ScriptContext *ctx) u16 y = VarGet(ScriptReadHalfword(ctx)); SetWarpDestination(mapGroup, mapNum, warpId, x, y); - DoSootopolisLegendWarp(); + DoWhiteFadeWarp(); ResetInitialPlayerAvatarState(); return TRUE; } diff --git a/src/script.c b/src/script.c index b10e0db49d12..4728e739cdc2 100644 --- a/src/script.c +++ b/src/script.c @@ -3,7 +3,7 @@ #include "event_data.h" #include "mystery_gift.h" #include "util.h" -#include "constants/maps.h" +#include "constants/event_objects.h" #include "constants/map_scripts.h" #define RAM_SCRIPT_MAGIC 51 @@ -399,6 +399,8 @@ const u8 *GetRamScript(u8 objectId, const u8 *script) } } +#define NO_OBJECT OBJ_EVENT_ID_PLAYER + bool32 ValidateSavedRamScript(void) { struct RamScriptData *scriptData = &gSaveBlock1Ptr->ramScript.data; @@ -408,7 +410,7 @@ bool32 ValidateSavedRamScript(void) return FALSE; if (scriptData->mapNum != MAP_NUM(UNDEFINED)) return FALSE; - if (scriptData->objectId != 0xFF) + if (scriptData->objectId != NO_OBJECT) return FALSE; if (CalculateRamScriptChecksum() != gSaveBlock1Ptr->ramScript.checksum) return FALSE; @@ -426,7 +428,7 @@ u8 *GetSavedRamScriptIfValid(void) return NULL; if (scriptData->mapNum != MAP_NUM(UNDEFINED)) return NULL; - if (scriptData->objectId != 0xFF) + if (scriptData->objectId != NO_OBJECT) return NULL; if (CalculateRamScriptChecksum() != gSaveBlock1Ptr->ramScript.checksum) { @@ -443,5 +445,5 @@ void InitRamScript_NoObjectEvent(u8 *script, u16 scriptSize) { if (scriptSize > sizeof(gSaveBlock1Ptr->ramScript.data.script)) scriptSize = sizeof(gSaveBlock1Ptr->ramScript.data.script); - InitRamScript(script, scriptSize, MAP_GROUP(UNDEFINED), MAP_NUM(UNDEFINED), 0xFF); + InitRamScript(script, scriptSize, MAP_GROUP(UNDEFINED), MAP_NUM(UNDEFINED), NO_OBJECT); } diff --git a/src/script_menu.c b/src/script_menu.c index ae0fe91e6702..1680758f2126 100644 --- a/src/script_menu.c +++ b/src/script_menu.c @@ -563,6 +563,7 @@ static void Task_PokemonPicWindow(u8 taskId) task->tState++; break; case 1: + // Wait until state is advanced by ScriptMenu_HidePokemonPic break; case 2: FreeResourcesAndDestroySprite(&gSprites[task->tMonSpriteId], task->tMonSpriteId); @@ -600,7 +601,7 @@ bool8 ScriptMenu_ShowPokemonPic(u16 species, u8 x, u8 y) } } -bool8 (*ScriptMenu_GetPicboxWaitFunc(void))(void) +bool8 (*ScriptMenu_HidePokemonPic(void))(void) { u8 taskId = FindTaskIdByFunc(Task_PokemonPicWindow); diff --git a/src/script_pokemon_util.c b/src/script_pokemon_util.c index 07e86656e020..ae7aa92dc809 100755 --- a/src/script_pokemon_util.c +++ b/src/script_pokemon_util.c @@ -150,7 +150,12 @@ void CreateScriptedWildMon(u16 species, u8 level, u16 item) void ScriptSetMonMoveSlot(u8 monIndex, u16 move, u8 slot) { +// Allows monIndex to go out of bounds of gPlayerParty. Doesn't occur in vanilla +#ifdef BUGFIX + if (monIndex >= PARTY_SIZE) +#else if (monIndex > PARTY_SIZE) +#endif monIndex = gPlayerPartyCount - 1; SetMonMoveSlot(&gPlayerParty[monIndex], move, slot); diff --git a/src/secret_base.c b/src/secret_base.c index 72560ee23b78..8fc97141fce3 100644 --- a/src/secret_base.c +++ b/src/secret_base.c @@ -39,7 +39,6 @@ #include "constants/event_objects.h" #include "constants/field_specials.h" #include "constants/items.h" -#include "constants/maps.h" #include "constants/map_types.h" #include "constants/metatile_behaviors.h" #include "constants/metatile_labels.h" @@ -446,7 +445,7 @@ void EnterSecretBase(void) { CreateTask(Task_EnterSecretBase, 0); FadeScreen(FADE_TO_BLACK, 0); - SetDynamicWarp(0, gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, -1); + SetDynamicWarp(0, gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, WARP_ID_NONE); } bool8 SecretBaseMapPopupEnabled(void) @@ -490,7 +489,7 @@ static void Task_EnterNewlyCreatedSecretBase(u8 taskId) SetWarpDestination( gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, - -1, + WARP_ID_NONE, GET_BASE_COMPUTER_X(secretBaseGroup), GET_BASE_COMPUTER_Y(secretBaseGroup)); WarpIntoMap(); @@ -700,7 +699,7 @@ static void Task_WarpOutOfSecretBase(u8 taskId) gTasks[taskId].data[0] = 2; break; case 2: - SetWarpDestinationToDynamicWarp(0x7e); + SetWarpDestinationToDynamicWarp(WARP_ID_SECRET_BASE); WarpIntoMap(); gFieldCallback = FieldCB_DefaultWarpExit; SetMainCallback2(CB2_LoadMap); @@ -1215,108 +1214,107 @@ void SecretBasePerStepCallback(u8 taskId) tState = 1; break; case 1: + // End if player hasn't moved PlayerGetDestCoords(&x, &y); - if (x != tPlayerX || y != tPlayerY) + if (x == tPlayerX && y == tPlayerY) + return; + + tPlayerX = x; + tPlayerY = y; + VarSet(VAR_SECRET_BASE_STEP_COUNTER, VarGet(VAR_SECRET_BASE_STEP_COUNTER) + 1); + behavior = MapGridGetMetatileBehaviorAt(x, y); + tileId = MapGridGetMetatileIdAt(x, y); + if (tileId == METATILE_SecretBase_SolidBoard_Top || tileId == METATILE_SecretBase_SolidBoard_Bottom) { - tPlayerX = x; - tPlayerY = y; - VarSet(VAR_SECRET_BASE_STEP_COUNTER, VarGet(VAR_SECRET_BASE_STEP_COUNTER) + 1); - behavior = MapGridGetMetatileBehaviorAt(x, y); - tileId = MapGridGetMetatileIdAt(x, y); - if (tileId == METATILE_SecretBase_SolidBoard_Top || tileId == METATILE_SecretBase_SolidBoard_Bottom) - { - if (sInFriendSecretBase == TRUE) - { - VarSet(VAR_SECRET_BASE_HIGH_TV_FLAGS, VarGet(VAR_SECRET_BASE_HIGH_TV_FLAGS) | SECRET_BASE_USED_SOLID_BOARD); - } - } - else if (tileId == METATILE_SecretBase_SmallChair - || tileId == METATILE_SecretBase_PokemonChair - || tileId == METATILE_SecretBase_HeavyChair - || tileId == METATILE_SecretBase_PrettyChair - || tileId == METATILE_SecretBase_ComfortChair - || tileId == METATILE_SecretBase_RaggedChair - || tileId == METATILE_SecretBase_BrickChair - || tileId == METATILE_SecretBase_CampChair - || tileId == METATILE_SecretBase_HardChair) - { - if (sInFriendSecretBase == TRUE) - VarSet(VAR_SECRET_BASE_LOW_TV_FLAGS, VarGet(VAR_SECRET_BASE_LOW_TV_FLAGS) | SECRET_BASE_USED_CHAIR); - } - else if (tileId == METATILE_SecretBase_RedTent_DoorTop - || tileId == METATILE_SecretBase_RedTent_Door - || tileId == METATILE_SecretBase_BlueTent_DoorTop - || tileId == METATILE_SecretBase_BlueTent_Door) - { - if (sInFriendSecretBase == TRUE) - VarSet(VAR_SECRET_BASE_LOW_TV_FLAGS, VarGet(VAR_SECRET_BASE_LOW_TV_FLAGS) | SECRET_BASE_USED_TENT); - } - else if ((behavior == MB_IMPASSABLE_NORTHEAST && tileId == METATILE_SecretBase_Stand_CornerRight) - || (behavior == MB_IMPASSABLE_NORTHWEST && MapGridGetMetatileIdAt(x, y) == METATILE_SecretBase_Stand_CornerLeft)) - { - if (sInFriendSecretBase == TRUE) - VarSet(VAR_SECRET_BASE_HIGH_TV_FLAGS, VarGet(VAR_SECRET_BASE_HIGH_TV_FLAGS) | SECRET_BASE_USED_STAND); - } - else if (behavior == MB_IMPASSABLE_WEST_AND_EAST && tileId == METATILE_SecretBase_Slide_StairLanding) - { - if (sInFriendSecretBase == TRUE) - { - VarSet(VAR_SECRET_BASE_HIGH_TV_FLAGS, VarGet(VAR_SECRET_BASE_HIGH_TV_FLAGS) ^ SECRET_BASE_USED_SLIDE); - VarSet(VAR_SECRET_BASE_HIGH_TV_FLAGS, VarGet(VAR_SECRET_BASE_HIGH_TV_FLAGS) | SECRET_BASE_DECLINED_SLIDE); - } - } - else if (behavior == MB_SLIDE_SOUTH && tileId == METATILE_SecretBase_Slide_SlideTop) + if (sInFriendSecretBase == TRUE) + VarSet(VAR_SECRET_BASE_HIGH_TV_FLAGS, VarGet(VAR_SECRET_BASE_HIGH_TV_FLAGS) | SECRET_BASE_USED_SOLID_BOARD); + } + else if (tileId == METATILE_SecretBase_SmallChair + || tileId == METATILE_SecretBase_PokemonChair + || tileId == METATILE_SecretBase_HeavyChair + || tileId == METATILE_SecretBase_PrettyChair + || tileId == METATILE_SecretBase_ComfortChair + || tileId == METATILE_SecretBase_RaggedChair + || tileId == METATILE_SecretBase_BrickChair + || tileId == METATILE_SecretBase_CampChair + || tileId == METATILE_SecretBase_HardChair) + { + if (sInFriendSecretBase == TRUE) + VarSet(VAR_SECRET_BASE_LOW_TV_FLAGS, VarGet(VAR_SECRET_BASE_LOW_TV_FLAGS) | SECRET_BASE_USED_CHAIR); + } + else if (tileId == METATILE_SecretBase_RedTent_DoorTop + || tileId == METATILE_SecretBase_RedTent_Door + || tileId == METATILE_SecretBase_BlueTent_DoorTop + || tileId == METATILE_SecretBase_BlueTent_Door) + { + if (sInFriendSecretBase == TRUE) + VarSet(VAR_SECRET_BASE_LOW_TV_FLAGS, VarGet(VAR_SECRET_BASE_LOW_TV_FLAGS) | SECRET_BASE_USED_TENT); + } + else if ((behavior == MB_IMPASSABLE_NORTHEAST && tileId == METATILE_SecretBase_Stand_CornerRight) + || (behavior == MB_IMPASSABLE_NORTHWEST && MapGridGetMetatileIdAt(x, y) == METATILE_SecretBase_Stand_CornerLeft)) + { + if (sInFriendSecretBase == TRUE) + VarSet(VAR_SECRET_BASE_HIGH_TV_FLAGS, VarGet(VAR_SECRET_BASE_HIGH_TV_FLAGS) | SECRET_BASE_USED_STAND); + } + else if (behavior == MB_IMPASSABLE_WEST_AND_EAST && tileId == METATILE_SecretBase_Slide_StairLanding) + { + if (sInFriendSecretBase == TRUE) { - if (sInFriendSecretBase == TRUE) - { - VarSet(VAR_SECRET_BASE_HIGH_TV_FLAGS, VarGet(VAR_SECRET_BASE_HIGH_TV_FLAGS) | SECRET_BASE_USED_SLIDE); - VarSet(VAR_SECRET_BASE_HIGH_TV_FLAGS, VarGet(VAR_SECRET_BASE_HIGH_TV_FLAGS) ^ SECRET_BASE_DECLINED_SLIDE); - } + VarSet(VAR_SECRET_BASE_HIGH_TV_FLAGS, VarGet(VAR_SECRET_BASE_HIGH_TV_FLAGS) ^ SECRET_BASE_USED_SLIDE); + VarSet(VAR_SECRET_BASE_HIGH_TV_FLAGS, VarGet(VAR_SECRET_BASE_HIGH_TV_FLAGS) | SECRET_BASE_DECLINED_SLIDE); } - else if (MetatileBehavior_IsSecretBaseGlitterMat(behavior) == TRUE) + } + else if (behavior == MB_SLIDE_SOUTH && tileId == METATILE_SecretBase_Slide_SlideTop) + { + if (sInFriendSecretBase == TRUE) { - if (sInFriendSecretBase == TRUE) - VarSet(VAR_SECRET_BASE_HIGH_TV_FLAGS, VarGet(VAR_SECRET_BASE_HIGH_TV_FLAGS) | SECRET_BASE_USED_GLITTER_MAT); + VarSet(VAR_SECRET_BASE_HIGH_TV_FLAGS, VarGet(VAR_SECRET_BASE_HIGH_TV_FLAGS) | SECRET_BASE_USED_SLIDE); + VarSet(VAR_SECRET_BASE_HIGH_TV_FLAGS, VarGet(VAR_SECRET_BASE_HIGH_TV_FLAGS) ^ SECRET_BASE_DECLINED_SLIDE); } - else if (MetatileBehavior_IsSecretBaseBalloon(behavior) == TRUE) + } + else if (MetatileBehavior_IsSecretBaseGlitterMat(behavior) == TRUE) + { + if (sInFriendSecretBase == TRUE) + VarSet(VAR_SECRET_BASE_HIGH_TV_FLAGS, VarGet(VAR_SECRET_BASE_HIGH_TV_FLAGS) | SECRET_BASE_USED_GLITTER_MAT); + } + else if (MetatileBehavior_IsSecretBaseBalloon(behavior) == TRUE) + { + PopSecretBaseBalloon(MapGridGetMetatileIdAt(x, y), x, y); + if (sInFriendSecretBase == TRUE) { - PopSecretBaseBalloon(MapGridGetMetatileIdAt(x, y), x, y); - if (sInFriendSecretBase == TRUE) + switch ((int)MapGridGetMetatileIdAt(x, y)) { - switch ((int)MapGridGetMetatileIdAt(x, y)) - { - case METATILE_SecretBase_RedBalloon: - case METATILE_SecretBase_BlueBalloon: - case METATILE_SecretBase_YellowBalloon: - VarSet(VAR_SECRET_BASE_LOW_TV_FLAGS, VarGet(VAR_SECRET_BASE_LOW_TV_FLAGS) | SECRET_BASE_USED_BALLOON); - break; - case METATILE_SecretBase_MudBall: - VarSet(VAR_SECRET_BASE_LOW_TV_FLAGS, VarGet(VAR_SECRET_BASE_LOW_TV_FLAGS) | SECRET_BASE_USED_MUD_BALL); - break; - } + case METATILE_SecretBase_RedBalloon: + case METATILE_SecretBase_BlueBalloon: + case METATILE_SecretBase_YellowBalloon: + VarSet(VAR_SECRET_BASE_LOW_TV_FLAGS, VarGet(VAR_SECRET_BASE_LOW_TV_FLAGS) | SECRET_BASE_USED_BALLOON); + break; + case METATILE_SecretBase_MudBall: + VarSet(VAR_SECRET_BASE_LOW_TV_FLAGS, VarGet(VAR_SECRET_BASE_LOW_TV_FLAGS) | SECRET_BASE_USED_MUD_BALL); + break; } } - else if (MetatileBehavior_IsSecretBaseBreakableDoor(behavior) == TRUE) - { - if (sInFriendSecretBase == TRUE) - VarSet(VAR_SECRET_BASE_HIGH_TV_FLAGS, VarGet(VAR_SECRET_BASE_HIGH_TV_FLAGS) | SECRET_BASE_USED_BREAKABLE_DOOR); + } + else if (MetatileBehavior_IsSecretBaseBreakableDoor(behavior) == TRUE) + { + if (sInFriendSecretBase == TRUE) + VarSet(VAR_SECRET_BASE_HIGH_TV_FLAGS, VarGet(VAR_SECRET_BASE_HIGH_TV_FLAGS) | SECRET_BASE_USED_BREAKABLE_DOOR); - ShatterSecretBaseBreakableDoor(x, y); - } - else if (MetatileBehavior_IsSecretBaseSoundMat(behavior) == TRUE){ - if (sInFriendSecretBase == TRUE) - VarSet(VAR_SECRET_BASE_LOW_TV_FLAGS, VarGet(VAR_SECRET_BASE_LOW_TV_FLAGS) | SECRET_BASE_USED_NOTE_MAT); - } - else if (MetatileBehavior_IsSecretBaseJumpMat(behavior) == TRUE) - { - if (sInFriendSecretBase == TRUE) - VarSet(VAR_SECRET_BASE_HIGH_TV_FLAGS, VarGet(VAR_SECRET_BASE_HIGH_TV_FLAGS) | SECRET_BASE_USED_JUMP_MAT); - } - else if (MetatileBehavior_IsSecretBaseSpinMat(behavior) == TRUE) - { - if (sInFriendSecretBase == TRUE) - VarSet(VAR_SECRET_BASE_HIGH_TV_FLAGS, VarGet(VAR_SECRET_BASE_HIGH_TV_FLAGS) | SECRET_BASE_USED_SPIN_MAT); - } + ShatterSecretBaseBreakableDoor(x, y); + } + else if (MetatileBehavior_IsSecretBaseSoundMat(behavior) == TRUE){ + if (sInFriendSecretBase == TRUE) + VarSet(VAR_SECRET_BASE_LOW_TV_FLAGS, VarGet(VAR_SECRET_BASE_LOW_TV_FLAGS) | SECRET_BASE_USED_NOTE_MAT); + } + else if (MetatileBehavior_IsSecretBaseJumpMat(behavior) == TRUE) + { + if (sInFriendSecretBase == TRUE) + VarSet(VAR_SECRET_BASE_HIGH_TV_FLAGS, VarGet(VAR_SECRET_BASE_HIGH_TV_FLAGS) | SECRET_BASE_USED_JUMP_MAT); + } + else if (MetatileBehavior_IsSecretBaseSpinMat(behavior) == TRUE) + { + if (sInFriendSecretBase == TRUE) + VarSet(VAR_SECRET_BASE_HIGH_TV_FLAGS, VarGet(VAR_SECRET_BASE_HIGH_TV_FLAGS) | SECRET_BASE_USED_SPIN_MAT); } break; case 2: diff --git a/src/shop.c b/src/shop.c index fa4a73bbbd37..f41ae315f162 100755 --- a/src/shop.c +++ b/src/shop.c @@ -562,7 +562,7 @@ static void BuyMenuPrintPriceInList(u8 windowId, u32 itemId, u8 y) { ConvertIntToDecimalStringN( gStringVar1, - ItemId_GetPrice(itemId) >> GetPriceReduction(POKENEWS_SLATEPORT), + ItemId_GetPrice(itemId) >> IsPokeNewsActive(POKENEWS_SLATEPORT), STR_CONV_MODE_LEFT_ALIGN, 5); } @@ -847,7 +847,7 @@ static void BuyMenuDrawObjectEvents(void) graphicsInfo = GetObjectEventGraphicsInfo(gObjectEvents[sShopData->viewportObjects[i][OBJ_EVENT_ID]].graphicsId); - spriteId = AddPseudoObjectEvent( + spriteId = CreateObjectGraphicsSprite( gObjectEvents[sShopData->viewportObjects[i][OBJ_EVENT_ID]].graphicsId, SpriteCallbackDummy, (u16)sShopData->viewportObjects[i][X_COORD] * 16 + 8, @@ -934,7 +934,7 @@ static void Task_BuyMenu(u8 taskId) if (sMartInfo.martType == MART_TYPE_NORMAL) { - sShopData->totalCost = (ItemId_GetPrice(itemId) >> GetPriceReduction(POKENEWS_SLATEPORT)); + sShopData->totalCost = (ItemId_GetPrice(itemId) >> IsPokeNewsActive(POKENEWS_SLATEPORT)); } else { @@ -1014,7 +1014,7 @@ static void Task_BuyHowManyDialogueHandleInput(u8 taskId) if (AdjustQuantityAccordingToDPadInput(&tItemCount, sShopData->maxQuantity) == TRUE) { - sShopData->totalCost = (ItemId_GetPrice(tItemId) >> GetPriceReduction(POKENEWS_SLATEPORT)) * tItemCount; + sShopData->totalCost = (ItemId_GetPrice(tItemId) >> IsPokeNewsActive(POKENEWS_SLATEPORT)) * tItemCount; BuyMenuPrintItemQuantityAndPrice(taskId); } else diff --git a/src/slot_machine.c b/src/slot_machine.c index 1c21f230d3a9..6cbcd76fdf3b 100644 --- a/src/slot_machine.c +++ b/src/slot_machine.c @@ -557,10 +557,10 @@ static struct SpriteFrameImage *sImageTables_DigitalDisplay[NUM_DIG_DISPLAY_SPRI // Const rom data. static const struct DigitalDisplaySprite *const sDigitalDisplayScenes[]; static const u16 sUnkPalette[]; -static const u8 sLuckyRoundProbabilities[][3]; +static const u8 sLuckyRoundProbabilities[NUM_SLOT_MACHINE_IDS][MAX_BET]; static const u8 sBiasTags[]; -static const u16 sLuckyFlagSettings_Top3[]; -static const u16 sLuckyFlagSettings_NotTop3[]; +static const u16 sLuckyFlagSettings_Top3[3]; +static const u16 sLuckyFlagSettings_NotTop3[5]; static const s16 sDigitalDisplay_SpriteCoords[][2]; static const SpriteCallback sDigitalDisplay_SpriteCallbacks[]; static const struct SpriteTemplate *const sSpriteTemplates_DigitalDisplay[NUM_DIG_DISPLAY_SPRITES]; @@ -582,8 +582,8 @@ static const struct SpriteSheet sSlotMachineSpriteSheets[22]; static const struct SpritePalette sSlotMachineSpritePalettes[]; static const u16 *const sDigitalDisplay_Pal; static const s16 sInitialReelPositions[NUM_REELS][2]; -static const u8 sLuckyFlagProbabilities_Top3[][6]; -static const u8 sLuckyFlagProbabilities_NotTop3[][6]; +static const u8 sLuckyFlagProbabilities_Top3[][NUM_SLOT_MACHINE_IDS]; +static const u8 sLuckyFlagProbabilities_NotTop3[][NUM_SLOT_MACHINE_IDS]; static const u8 sReeltimeProbabilities_UnluckyGame[][17]; static const u8 sReelTimeProbabilities_LuckyGame[][17]; static const u8 sSymToMatch[]; @@ -1651,22 +1651,18 @@ static void DrawLuckyFlags(void) if (IsThisRoundLucky()) { attempts = AttemptsAtLuckyFlags_Top3(); - if (attempts != 3) // if you found a lucky number + if (attempts != ARRAY_COUNT(sLuckyFlagSettings_Top3)) // if you found a lucky number { // attempts == 1: reelTime flag set sSlotMachine->luckyFlags |= sLuckyFlagSettings_Top3[attempts]; if (attempts != 1) - { return; - } } } // if it's not a lucky round or you got reel time, roll for the lower lucky flags attempts = AttemptsAtLuckyFlags_NotTop3(); - if (attempts != 5) // if you found a lucky number - { + if (attempts != ARRAY_COUNT(sLuckyFlagSettings_NotTop3)) // if you found a lucky number sSlotMachine->luckyFlags |= sLuckyFlagSettings_NotTop3[attempts]; - } } } } @@ -1704,7 +1700,7 @@ static u8 AttemptsAtLuckyFlags_Top3(void) { s16 count; - for (count = 0; count < 3; count++) + for (count = 0; count < (int)ARRAY_COUNT(sLuckyFlagSettings_Top3); count++) { s16 rval = Random() & 0xff; s16 value = sLuckyFlagProbabilities_Top3[count][sSlotMachine->machineId]; @@ -1718,7 +1714,7 @@ static u8 AttemptsAtLuckyFlags_NotTop3(void) { s16 count; - for (count = 0; count < 5; count++) + for (count = 0; count < (int)ARRAY_COUNT(sLuckyFlagSettings_NotTop3); count++) { s16 rval = Random() & 0xff; // random byte s16 value = sLuckyFlagProbabilities_NotTop3[count][sSlotMachine->machineId]; @@ -4807,27 +4803,83 @@ static const s16 sInitialReelPositions[NUM_REELS][2] = { [RIGHT_REEL] = {0, 2} }; -static const u8 sLuckyRoundProbabilities[][3] = { - {1, 1, 12}, - {1, 1, 14}, - {2, 2, 14}, - {2, 2, 14}, - {2, 3, 16}, - {3, 3, 16} +static const u8 sLuckyRoundProbabilities[NUM_SLOT_MACHINE_IDS][MAX_BET] = { + [SLOT_MACHINE_UNLUCKIEST] = {1, 1, 12}, + [SLOT_MACHINE_UNLUCKIER] = {1, 1, 14}, + [SLOT_MACHINE_UNLUCKY] = {2, 2, 14}, + [SLOT_MACHINE_LUCKY] = {2, 2, 14}, + [SLOT_MACHINE_LUCKIER] = {2, 3, 16}, + [SLOT_MACHINE_LUCKIEST] = {3, 3, 16} }; -static const u8 sLuckyFlagProbabilities_Top3[][6] = { - {25, 25, 30, 40, 40, 50}, - {25, 25, 30, 30, 35, 35}, - {25, 25, 30, 25, 25, 30} -}; - -static const u8 sLuckyFlagProbabilities_NotTop3[][6] = { - {20, 25, 25, 20, 25, 25}, - {12, 15, 15, 18, 19, 22}, - {25, 25, 25, 30, 30, 40}, - {25, 25, 20, 20, 15, 15}, - {40, 40, 35, 35, 40, 40} +static const u8 sLuckyFlagProbabilities_Top3[][NUM_SLOT_MACHINE_IDS] = { + { // Probabilities for LUCKY_BIAS_777 + [SLOT_MACHINE_UNLUCKIEST] = 25, + [SLOT_MACHINE_UNLUCKIER] = 25, + [SLOT_MACHINE_UNLUCKY] = 30, + [SLOT_MACHINE_LUCKY] = 40, + [SLOT_MACHINE_LUCKIER] = 40, + [SLOT_MACHINE_LUCKIEST] = 50 + }, + { // Probabilities for LUCKY_BIAS_REELTIME + [SLOT_MACHINE_UNLUCKIEST] = 25, + [SLOT_MACHINE_UNLUCKIER] = 25, + [SLOT_MACHINE_UNLUCKY] = 30, + [SLOT_MACHINE_LUCKY] = 30, + [SLOT_MACHINE_LUCKIER] = 35, + [SLOT_MACHINE_LUCKIEST] = 35 + }, + { // Probabilities for LUCKY_BIAS_MIXED_777 + [SLOT_MACHINE_UNLUCKIEST] = 25, + [SLOT_MACHINE_UNLUCKIER] = 25, + [SLOT_MACHINE_UNLUCKY] = 30, + [SLOT_MACHINE_LUCKY] = 25, + [SLOT_MACHINE_LUCKIER] = 25, + [SLOT_MACHINE_LUCKIEST] = 30 + } +}; + +static const u8 sLuckyFlagProbabilities_NotTop3[][NUM_SLOT_MACHINE_IDS] = { + { // Probabilities for LUCKY_BIAS_POWER + [SLOT_MACHINE_UNLUCKIEST] = 20, + [SLOT_MACHINE_UNLUCKIER] = 25, + [SLOT_MACHINE_UNLUCKY] = 25, + [SLOT_MACHINE_LUCKY] = 20, + [SLOT_MACHINE_LUCKIER] = 25, + [SLOT_MACHINE_LUCKIEST] = 25 + }, + { // Probabilities for LUCKY_BIAS_AZURILL + [SLOT_MACHINE_UNLUCKIEST] = 12, + [SLOT_MACHINE_UNLUCKIER] = 15, + [SLOT_MACHINE_UNLUCKY] = 15, + [SLOT_MACHINE_LUCKY] = 18, + [SLOT_MACHINE_LUCKIER] = 19, + [SLOT_MACHINE_LUCKIEST] = 22 + }, + { // Probabilities for LUCKY_BIAS_LOTAD + [SLOT_MACHINE_UNLUCKIEST] = 25, + [SLOT_MACHINE_UNLUCKIER] = 25, + [SLOT_MACHINE_UNLUCKY] = 25, + [SLOT_MACHINE_LUCKY] = 30, + [SLOT_MACHINE_LUCKIER] = 30, + [SLOT_MACHINE_LUCKIEST] = 40 + }, + { // Probabilities for LUCKY_BIAS_CHERRY + [SLOT_MACHINE_UNLUCKIEST] = 25, + [SLOT_MACHINE_UNLUCKIER] = 25, + [SLOT_MACHINE_UNLUCKY] = 20, + [SLOT_MACHINE_LUCKY] = 20, + [SLOT_MACHINE_LUCKIER] = 15, + [SLOT_MACHINE_LUCKIEST] = 15 + }, + { // Probabilities for LUCKY_BIAS_REPLAY + [SLOT_MACHINE_UNLUCKIEST] = 40, + [SLOT_MACHINE_UNLUCKIER] = 40, + [SLOT_MACHINE_UNLUCKY] = 35, + [SLOT_MACHINE_LUCKY] = 35, + [SLOT_MACHINE_LUCKIER] = 40, + [SLOT_MACHINE_LUCKIEST] = 40 + } }; static const u8 sReeltimeProbabilities_UnluckyGame[][17] = { @@ -5708,7 +5760,7 @@ static const struct SpriteTemplate sSpriteTemplate_DigitalDisplay_Insert = static const struct SpriteTemplate sSpriteTemplate_DigitalDisplay_Stop = { - .tileTag = 18, + .tileTag = GFXTAG_STOP, .paletteTag = PALTAG_DIG_DISPLAY, .oam = &sOam_8x8, .anims = sAnims_SingleFrame, @@ -5741,7 +5793,7 @@ static const struct SpriteTemplate sSpriteTemplate_DigitalDisplay_Lose = static const struct SpriteTemplate sSpriteTemplate_DigitalDisplay_Bonus = { - .tileTag = 19, + .tileTag = GFXTAG_BONUS, .paletteTag = PALTAG_DIG_DISPLAY, .oam = &sOam_8x8, .anims = sAnims_SingleFrame, @@ -5752,7 +5804,7 @@ static const struct SpriteTemplate sSpriteTemplate_DigitalDisplay_Bonus = static const struct SpriteTemplate sSpriteTemplate_DigitalDisplay_Big = { - .tileTag = 20, + .tileTag = GFXTAG_BIG, .paletteTag = PALTAG_DIG_DISPLAY, .oam = &sOam_8x8, .anims = sAnims_SingleFrame, @@ -5763,7 +5815,7 @@ static const struct SpriteTemplate sSpriteTemplate_DigitalDisplay_Big = static const struct SpriteTemplate sSpriteTemplate_DigitalDisplay_Reg = { - .tileTag = 21, + .tileTag = GFXTAG_REG, .paletteTag = PALTAG_DIG_DISPLAY, .oam = &sOam_8x8, .anims = sAnims_SingleFrame, diff --git a/src/trade.c b/src/trade.c index a1e4f7094e23..3e9f033b52ae 100644 --- a/src/trade.c +++ b/src/trade.c @@ -1880,7 +1880,7 @@ static u8 GetMonNicknameWidth(u8 *str, u8 whichParty, u8 monIdx) else GetMonData(&gEnemyParty[monIdx], MON_DATA_NICKNAME, nickname); - StringCopy10(str, nickname); + StringCopy_Nickname(str, nickname); return GetStringWidth(FONT_SMALL, str, GetFontAttribute(FONT_SMALL, FONTATTR_LETTER_SPACING)); } @@ -1942,7 +1942,7 @@ static void PrintPartyNicknamesForTradeMenu(u8 whichParty) for (i = 0; i < sTradeMenuData->partyCounts[whichParty]; i++) { GetMonData(&party[i], MON_DATA_NICKNAME, nickname); - StringCopy10(str, nickname); + StringCopy_Nickname(str, nickname); PrintMonNicknameForTradeMenu(whichParty, i, str); } } @@ -3266,17 +3266,17 @@ static void BufferTradeSceneStrings(void) mpId = GetMultiplayerId(); StringCopy(gStringVar1, gLinkPlayers[mpId ^ 1].name); GetMonData(&gEnemyParty[gSelectedTradeMonPositions[TRADE_PARTNER] % PARTY_SIZE], MON_DATA_NICKNAME, name); - StringCopy10(gStringVar3, name); + StringCopy_Nickname(gStringVar3, name); GetMonData(&gPlayerParty[gSelectedTradeMonPositions[TRADE_PLAYER]], MON_DATA_NICKNAME, name); - StringCopy10(gStringVar2, name); + StringCopy_Nickname(gStringVar2, name); } else { ingameTrade = &sIngameTrades[gSpecialVar_0x8004]; StringCopy(gStringVar1, ingameTrade->otName); - StringCopy10(gStringVar3, ingameTrade->nickname); + StringCopy_Nickname(gStringVar3, ingameTrade->nickname); GetMonData(&gPlayerParty[gSpecialVar_0x8005], MON_DATA_NICKNAME, name); - StringCopy10(gStringVar2, name); + StringCopy_Nickname(gStringVar2, name); } } @@ -4479,7 +4479,7 @@ static void BufferInGameTradeMonName(void) u8 nickname[32]; const struct InGameTrade *inGameTrade = &sIngameTrades[gSpecialVar_0x8004]; GetMonData(&gPlayerParty[gSpecialVar_0x8005], MON_DATA_NICKNAME, nickname); - StringCopy10(gStringVar1, nickname); + StringCopy_Nickname(gStringVar1, nickname); StringCopy(gStringVar2, gSpeciesNames[inGameTrade->species]); } diff --git a/src/trainer_hill.c b/src/trainer_hill.c index 2c34f196e5ad..04312a2dd146 100644 --- a/src/trainer_hill.c +++ b/src/trainer_hill.c @@ -28,7 +28,6 @@ #include "constants/items.h" #include "constants/layouts.h" #include "constants/moves.h" -#include "constants/maps.h" #include "constants/trainers.h" #include "constants/easy_chat.h" #include "constants/trainer_hill.h" diff --git a/src/tv.c b/src/tv.c index 310163e94ddb..710b9896810e 100644 --- a/src/tv.c +++ b/src/tv.c @@ -36,11 +36,11 @@ #include "data.h" #include "constants/battle_frontier.h" #include "constants/contest.h" +#include "constants/decorations.h" #include "constants/event_objects.h" #include "constants/items.h" #include "constants/layouts.h" #include "constants/lilycove_lady.h" -#include "constants/maps.h" #include "constants/metatile_behaviors.h" #include "constants/metatile_labels.h" #include "constants/moves.h" @@ -140,13 +140,13 @@ static void TryPutRandomPokeNewsOnAir(void); static void SortPurchasesByQuantity(void); static void UpdateMassOutbreakTimeLeft(u16); static void TryEndMassOutbreak(u16); -static void UpdatePokeNewsTimeLeft(u16); +static void UpdatePokeNewsCountdown(u16); static void ResolveWorldOfMastersShow(u16); static void ResolveNumberOneShow(u16); static void TryPutFishingAdviceOnAir(void); static u8 MonDataIdxToRibbon(u8); static void TryPutNumberOneOnAir(u8); -static bool8 IsPriceDiscounted(u8); +static bool8 ShouldApplyPokeNewsEffect(u8); static void TryPutWorldOfMastersOnAir(void); static void InterviewBefore_FanClubLetter(void); static void InterviewBefore_RecentHappenings(void); @@ -228,24 +228,24 @@ static const struct { } }; -static const u16 sGoldSymbolFlags[] = { - FLAG_SYS_TOWER_GOLD, - FLAG_SYS_DOME_GOLD, - FLAG_SYS_PALACE_GOLD, - FLAG_SYS_ARENA_GOLD, - FLAG_SYS_FACTORY_GOLD, - FLAG_SYS_PIKE_GOLD, - FLAG_SYS_PYRAMID_GOLD +static const u16 sGoldSymbolFlags[NUM_FRONTIER_FACILITIES] = { + [FRONTIER_FACILITY_TOWER] = FLAG_SYS_TOWER_GOLD, + [FRONTIER_FACILITY_DOME] = FLAG_SYS_DOME_GOLD, + [FRONTIER_FACILITY_PALACE] = FLAG_SYS_PALACE_GOLD, + [FRONTIER_FACILITY_ARENA] = FLAG_SYS_ARENA_GOLD, + [FRONTIER_FACILITY_FACTORY] = FLAG_SYS_FACTORY_GOLD, + [FRONTIER_FACILITY_PIKE] = FLAG_SYS_PIKE_GOLD, + [FRONTIER_FACILITY_PYRAMID] = FLAG_SYS_PYRAMID_GOLD }; -static const u16 sSilverSymbolFlags[] = { - FLAG_SYS_TOWER_SILVER, - FLAG_SYS_DOME_SILVER, - FLAG_SYS_PALACE_SILVER, - FLAG_SYS_ARENA_SILVER, - FLAG_SYS_FACTORY_SILVER, - FLAG_SYS_PIKE_SILVER, - FLAG_SYS_PYRAMID_SILVER +static const u16 sSilverSymbolFlags[NUM_FRONTIER_FACILITIES] = { + [FRONTIER_FACILITY_TOWER] = FLAG_SYS_TOWER_SILVER, + [FRONTIER_FACILITY_DOME] = FLAG_SYS_DOME_SILVER, + [FRONTIER_FACILITY_PALACE] = FLAG_SYS_PALACE_SILVER, + [FRONTIER_FACILITY_ARENA] = FLAG_SYS_ARENA_SILVER, + [FRONTIER_FACILITY_FACTORY] = FLAG_SYS_FACTORY_SILVER, + [FRONTIER_FACILITY_PIKE] = FLAG_SYS_PIKE_SILVER, + [FRONTIER_FACILITY_PYRAMID] = FLAG_SYS_PYRAMID_SILVER }; static const u16 sNumberOneVarsAndThresholds[][2] = { @@ -258,28 +258,28 @@ static const u16 sNumberOneVarsAndThresholds[][2] = { {VAR_DAILY_BP, 30} }; -static const u8 *const sPokeNewsTextGroup_Upcoming[] = { - NULL, - gPokeNewsTextSlateport_Upcoming, - gPokeNewsTextGameCorner_Upcoming, - gPokeNewsTextLilycove_Upcoming, - gPokeNewsTextBlendMaster_Upcoming +static const u8 *const sPokeNewsTextGroup_Upcoming[NUM_POKENEWS_TYPES + 1] = { + [POKENEWS_NONE] = NULL, + [POKENEWS_SLATEPORT] = gPokeNewsTextSlateport_Upcoming, + [POKENEWS_GAME_CORNER] = gPokeNewsTextGameCorner_Upcoming, + [POKENEWS_LILYCOVE] = gPokeNewsTextLilycove_Upcoming, + [POKENEWS_BLENDMASTER] = gPokeNewsTextBlendMaster_Upcoming }; -static const u8 *const sPokeNewsTextGroup_Ongoing[] = { - NULL, - gPokeNewsTextSlateport_Ongoing, - gPokeNewsTextGameCorner_Ongoing, - gPokeNewsTextLilycove_Ongoing, - gPokeNewsTextBlendMaster_Ongoing +static const u8 *const sPokeNewsTextGroup_Ongoing[NUM_POKENEWS_TYPES + 1] = { + [POKENEWS_NONE] = NULL, + [POKENEWS_SLATEPORT] = gPokeNewsTextSlateport_Ongoing, + [POKENEWS_GAME_CORNER] = gPokeNewsTextGameCorner_Ongoing, + [POKENEWS_LILYCOVE] = gPokeNewsTextLilycove_Ongoing, + [POKENEWS_BLENDMASTER] = gPokeNewsTextBlendMaster_Ongoing }; -static const u8 *const sPokeNewsTextGroup_Ending[] = { - NULL, - gPokeNewsTextSlateport_Ending, - gPokeNewsTextGameCorner_Ending, - gPokeNewsTextLilycove_Ending, - gPokeNewsTextBlendMaster_Ending +static const u8 *const sPokeNewsTextGroup_Ending[NUM_POKENEWS_TYPES + 1] = { + [POKENEWS_NONE] = NULL, + [POKENEWS_SLATEPORT] = gPokeNewsTextSlateport_Ending, + [POKENEWS_GAME_CORNER] = gPokeNewsTextGameCorner_Ending, + [POKENEWS_LILYCOVE] = gPokeNewsTextLilycove_Ending, + [POKENEWS_BLENDMASTER] = gPokeNewsTextBlendMaster_Ending }; u8 *const gTVStringVarPtrs[] = { @@ -1526,7 +1526,7 @@ void TryPutSmartShopperOnAir(void) show->smartshopperShow.itemIds[i] = gMartPurchaseHistory[i].itemId; show->smartshopperShow.itemAmounts[i] = gMartPurchaseHistory[i].quantity; } - show->smartshopperShow.priceReduced = GetPriceReduction(POKENEWS_SLATEPORT); + show->smartshopperShow.priceReduced = IsPokeNewsActive(POKENEWS_SLATEPORT); StringCopy(show->smartshopperShow.playerName, gSaveBlock2Ptr->playerName); StorePlayerIdInRecordMixShow(show); show->smartshopperShow.language = gGameLanguage; @@ -1569,13 +1569,13 @@ void StartMassOutbreak(void) gSaveBlock1Ptr->outbreakLocationMapNum = show->massOutbreak.locationMapNum; gSaveBlock1Ptr->outbreakLocationMapGroup = show->massOutbreak.locationMapGroup; gSaveBlock1Ptr->outbreakPokemonLevel = show->massOutbreak.level; - gSaveBlock1Ptr->outbreakUnk1 = show->massOutbreak.var02; - gSaveBlock1Ptr->outbreakUnk2 = show->massOutbreak.var0E; + gSaveBlock1Ptr->outbreakUnused1 = show->massOutbreak.unused1; + gSaveBlock1Ptr->outbreakUnused2 = show->massOutbreak.unused2; gSaveBlock1Ptr->outbreakPokemonMoves[0] = show->massOutbreak.moves[0]; gSaveBlock1Ptr->outbreakPokemonMoves[1] = show->massOutbreak.moves[1]; gSaveBlock1Ptr->outbreakPokemonMoves[2] = show->massOutbreak.moves[2]; gSaveBlock1Ptr->outbreakPokemonMoves[3] = show->massOutbreak.moves[3]; - gSaveBlock1Ptr->outbreakUnk4 = show->massOutbreak.var03; + gSaveBlock1Ptr->outbreakUnused3 = show->massOutbreak.unused3; gSaveBlock1Ptr->outbreakPokemonProbability = show->massOutbreak.probability; gSaveBlock1Ptr->outbreakDaysLeft = 2; } @@ -1668,19 +1668,19 @@ static void TryStartRandomMassOutbreak(void) show->massOutbreak.kind = TVSHOW_MASS_OUTBREAK; show->massOutbreak.active = TRUE; show->massOutbreak.level = sPokeOutbreakSpeciesList[outbreakIdx].level; - show->massOutbreak.var02 = 0; - show->massOutbreak.var03 = 0; + show->massOutbreak.unused1 = 0; + show->massOutbreak.unused3 = 0; show->massOutbreak.species = sPokeOutbreakSpeciesList[outbreakIdx].species; - show->massOutbreak.var0E = 0; + show->massOutbreak.unused2 = 0; show->massOutbreak.moves[0] = sPokeOutbreakSpeciesList[outbreakIdx].moves[0]; show->massOutbreak.moves[1] = sPokeOutbreakSpeciesList[outbreakIdx].moves[1]; show->massOutbreak.moves[2] = sPokeOutbreakSpeciesList[outbreakIdx].moves[2]; show->massOutbreak.moves[3] = sPokeOutbreakSpeciesList[outbreakIdx].moves[3]; show->massOutbreak.locationMapNum = sPokeOutbreakSpeciesList[outbreakIdx].location; show->massOutbreak.locationMapGroup = 0; - show->massOutbreak.var12 = 0; + show->massOutbreak.unused4 = 0; show->massOutbreak.probability = 50; - show->massOutbreak.var15 = 0; + show->massOutbreak.unused5 = 0; show->massOutbreak.daysLeft = 1; StorePlayerIdInNormalShow(show); show->massOutbreak.language = gGameLanguage; @@ -1695,13 +1695,13 @@ void EndMassOutbreak(void) gSaveBlock1Ptr->outbreakLocationMapNum = 0; gSaveBlock1Ptr->outbreakLocationMapGroup = 0; gSaveBlock1Ptr->outbreakPokemonLevel = 0; - gSaveBlock1Ptr->outbreakUnk1 = 0; - gSaveBlock1Ptr->outbreakUnk2 = 0; + gSaveBlock1Ptr->outbreakUnused1 = 0; + gSaveBlock1Ptr->outbreakUnused2 = 0; gSaveBlock1Ptr->outbreakPokemonMoves[0] = MOVE_NONE; gSaveBlock1Ptr->outbreakPokemonMoves[1] = MOVE_NONE; gSaveBlock1Ptr->outbreakPokemonMoves[2] = MOVE_NONE; gSaveBlock1Ptr->outbreakPokemonMoves[3] = MOVE_NONE; - gSaveBlock1Ptr->outbreakUnk4 = 0; + gSaveBlock1Ptr->outbreakUnused3 = 0; gSaveBlock1Ptr->outbreakPokemonProbability = 0; gSaveBlock1Ptr->outbreakDaysLeft = 0; } @@ -1710,7 +1710,7 @@ void UpdateTVShowsPerDay(u16 days) { UpdateMassOutbreakTimeLeft(days); TryEndMassOutbreak(days); - UpdatePokeNewsTimeLeft(days); + UpdatePokeNewsCountdown(days); ResolveWorldOfMastersShow(days); ResolveNumberOneShow(days); } @@ -1798,9 +1798,7 @@ void SetPokemonAnglerSpecies(u16 species) // Either way the temporary version of the show in the last slot is deleted. static void ResolveWorldOfMastersShow(u16 days) { - TVShow *show; - - show = &gSaveBlock1Ptr->tvShows[LAST_TVSHOW_IDX]; + TVShow *show = &gSaveBlock1Ptr->tvShows[LAST_TVSHOW_IDX]; if (show->worldOfMasters.kind == TVSHOW_WORLD_OF_MASTERS) { if (show->worldOfMasters.numPokeCaught >= 20) @@ -1864,7 +1862,7 @@ void TryPutTodaysRivalTrainerOnAir(void) show->rivalTrainer.mapLayoutId = gMapHeader.mapLayoutId; show->rivalTrainer.nSilverSymbols = 0; show->rivalTrainer.nGoldSymbols = 0; - for (i = 0; i < 7; i++) + for (i = 0; i < NUM_FRONTIER_FACILITIES; i++) { if (FlagGet(sSilverSymbolFlags[i]) == TRUE) show->rivalTrainer.nSilverSymbols++; @@ -1990,33 +1988,39 @@ static void SecretBaseVisit_CalculateDecorationData(TVShow *show) u8 decoration; for (i = 0; i < DECOR_MAX_SECRET_BASE; i++) - sTV_DecorationsBuffer[i] = 0; + sTV_DecorationsBuffer[i] = DECOR_NONE; + // Count (and save) the unique decorations in the base for (i = 0, n = 0; i < DECOR_MAX_SECRET_BASE; i++) { decoration = gSaveBlock1Ptr->secretBases[0].decorations[i]; - if (decoration) + if (decoration != DECOR_NONE) { + // Search for an empty spot to save decoration for (j = 0; j < DECOR_MAX_SECRET_BASE; j++) { - if (sTV_DecorationsBuffer[j] == 0) + if (sTV_DecorationsBuffer[j] == DECOR_NONE) { + // Save and count new unique decoration sTV_DecorationsBuffer[j] = decoration; n++; break; } + + // Decoration has already been saved, skip and move on to the next base decoration if (sTV_DecorationsBuffer[j] == decoration) break; } } } - if (n > 4) - show->secretBaseVisit.nDecorations = 4; + // Cap the number of unique decorations to the number the TV show will talk about + if (n > ARRAY_COUNT(show->secretBaseVisit.decorations)) + show->secretBaseVisit.numDecorations = ARRAY_COUNT(show->secretBaseVisit.decorations); else - show->secretBaseVisit.nDecorations = n; + show->secretBaseVisit.numDecorations = n; - switch (show->secretBaseVisit.nDecorations) + switch (show->secretBaseVisit.numDecorations) { case 0: break; @@ -2024,16 +2028,16 @@ static void SecretBaseVisit_CalculateDecorationData(TVShow *show) show->secretBaseVisit.decorations[0] = sTV_DecorationsBuffer[0]; break; default: + // More than 1 decoration, randomize the full list for (k = 0; k < n * n; k++) { decoration = Random() % n; j = Random() % n; - i = sTV_DecorationsBuffer[decoration]; - sTV_DecorationsBuffer[decoration] = sTV_DecorationsBuffer[j]; - sTV_DecorationsBuffer[j] = i; + SWAP(sTV_DecorationsBuffer[decoration], sTV_DecorationsBuffer[j], i); } - for (i = 0; i < show->secretBaseVisit.nDecorations; i++) + // Pick the first decorations in the randomized list to talk about on the show + for (i = 0; i < show->secretBaseVisit.numDecorations; i++) show->secretBaseVisit.decorations[i] = sTV_DecorationsBuffer[i]; break; } @@ -2044,50 +2048,55 @@ static void SecretBaseVisit_CalculatePartyData(TVShow *show) u8 i; u16 move; u16 j; - u8 nMoves; - u8 nPokemon; + u8 numMoves; + u8 numPokemon; u16 sum; - for (i = 0, nPokemon = 0; i < PARTY_SIZE; i++) + for (i = 0, numPokemon = 0; i < PARTY_SIZE; i++) { if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES) != SPECIES_NONE && !GetMonData(&gPlayerParty[i], MON_DATA_IS_EGG)) { - sTV_SecretBaseVisitMonsTemp[nPokemon].level = GetMonData(&gPlayerParty[i], MON_DATA_LEVEL); - sTV_SecretBaseVisitMonsTemp[nPokemon].species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES); - nMoves = 0; + sTV_SecretBaseVisitMonsTemp[numPokemon].level = GetMonData(&gPlayerParty[i], MON_DATA_LEVEL); + sTV_SecretBaseVisitMonsTemp[numPokemon].species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES); + + // Check all the Pokémon's moves, then randomly select one to save + numMoves = 0; move = GetMonData(&gPlayerParty[i], MON_DATA_MOVE1); if (move != MOVE_NONE) { - sTV_SecretBaseVisitMovesTemp[nMoves] = move; - nMoves++; + sTV_SecretBaseVisitMovesTemp[numMoves] = move; + numMoves++; } move = GetMonData(&gPlayerParty[i], MON_DATA_MOVE2); if (move != MOVE_NONE) { - sTV_SecretBaseVisitMovesTemp[nMoves] = move; - nMoves++; + sTV_SecretBaseVisitMovesTemp[numMoves] = move; + numMoves++; } move = GetMonData(&gPlayerParty[i], MON_DATA_MOVE3); if (move != MOVE_NONE) { - sTV_SecretBaseVisitMovesTemp[nMoves] = move; - nMoves++; + sTV_SecretBaseVisitMovesTemp[numMoves] = move; + numMoves++; } move = GetMonData(&gPlayerParty[i], MON_DATA_MOVE4); if (move != MOVE_NONE) { - sTV_SecretBaseVisitMovesTemp[nMoves] = move; - nMoves++; + sTV_SecretBaseVisitMovesTemp[numMoves] = move; + numMoves++; } - sTV_SecretBaseVisitMonsTemp[nPokemon].move = sTV_SecretBaseVisitMovesTemp[Random() % nMoves]; - nPokemon++; + sTV_SecretBaseVisitMonsTemp[numPokemon].move = sTV_SecretBaseVisitMovesTemp[Random() % numMoves]; + numPokemon++; } } - for (i = 0, sum = 0; i < nPokemon; i++) + + for (i = 0, sum = 0; i < numPokemon; i++) sum += sTV_SecretBaseVisitMonsTemp[i].level; - show->secretBaseVisit.avgLevel = sum / nPokemon; - j = Random() % nPokemon; + // Using the data calculated above, save the data to talk about on the show + // (average level, and one randomly selected species / move) + show->secretBaseVisit.avgLevel = sum / numPokemon; + j = Random() % numPokemon; show->secretBaseVisit.species = sTV_SecretBaseVisitMonsTemp[j].species; show->secretBaseVisit.move = sTV_SecretBaseVisitMonsTemp[j].move; } @@ -2225,7 +2234,7 @@ void TryPutBattleSeminarOnAir(u16 foeSpecies, u16 species, u8 moveIdx, const u16 } } -void TryPutSafariFanClubOnAir(u8 nMonsCaught, u8 nPkblkUsed) +void TryPutSafariFanClubOnAir(u8 monsCaught, u8 pokeblocksUsed) { TVShow *show; @@ -2236,8 +2245,8 @@ void TryPutSafariFanClubOnAir(u8 nMonsCaught, u8 nPkblkUsed) show->safariFanClub.kind = TVSHOW_SAFARI_FAN_CLUB; show->safariFanClub.active = FALSE; // NOTE: Show is not active until passed via Record Mix. StringCopy(show->safariFanClub.playerName, gSaveBlock2Ptr->playerName); - show->safariFanClub.nMonsCaught = nMonsCaught; - show->safariFanClub.nPkblkUsed = nPkblkUsed; + show->safariFanClub.monsCaught = monsCaught; + show->safariFanClub.pokeblocksUsed = pokeblocksUsed; StorePlayerIdInRecordMixShow(show); show->safariFanClub.language = gGameLanguage; } @@ -2537,12 +2546,12 @@ static void TryPutRandomPokeNewsOnAir(void) sCurTVShowSlot = GetFirstEmptyPokeNewsSlot(gSaveBlock1Ptr->pokeNews); if (sCurTVShowSlot != -1 && rbernoulli(1, 100) != TRUE) { - u8 newsKind = (Random() % NUM_POKENEWS_TYPES) + POKENEWS_SLATEPORT; + u8 newsKind = (Random() % NUM_POKENEWS_TYPES) + 1; // +1 to skip over POKENEWS_NONE if (IsAddingPokeNewsDisallowed(newsKind) != TRUE) { gSaveBlock1Ptr->pokeNews[sCurTVShowSlot].kind = newsKind; - gSaveBlock1Ptr->pokeNews[sCurTVShowSlot].days = 4; - gSaveBlock1Ptr->pokeNews[sCurTVShowSlot].state = 1; + gSaveBlock1Ptr->pokeNews[sCurTVShowSlot].dayCountdown = POKENEWS_COUNTDOWN; + gSaveBlock1Ptr->pokeNews[sCurTVShowSlot].state = POKENEWS_STATE_UPCOMING; } } } @@ -2571,8 +2580,8 @@ static void ClearPokeNews(void) static void ClearPokeNewsBySlot(u8 i) { gSaveBlock1Ptr->pokeNews[i].kind = POKENEWS_NONE; - gSaveBlock1Ptr->pokeNews[i].state = FALSE; - gSaveBlock1Ptr->pokeNews[i].days = 0; + gSaveBlock1Ptr->pokeNews[i].state = POKENEWS_STATE_INACTIVE; + gSaveBlock1Ptr->pokeNews[i].dayCountdown = 0; } static void CompactPokeNews(void) @@ -2604,8 +2613,8 @@ static u8 FindAnyPokeNewsOnTheAir(void) for (i = 0; i < POKE_NEWS_COUNT; i++) { if (gSaveBlock1Ptr->pokeNews[i].kind != POKENEWS_NONE - && gSaveBlock1Ptr->pokeNews[i].state == 1 - && gSaveBlock1Ptr->pokeNews[i].days < 3) + && gSaveBlock1Ptr->pokeNews[i].state == POKENEWS_STATE_UPCOMING + && gSaveBlock1Ptr->pokeNews[i].dayCountdown < POKENEWS_COUNTDOWN - 1) return i; } return 0xFF; @@ -2613,19 +2622,17 @@ static u8 FindAnyPokeNewsOnTheAir(void) void DoPokeNews(void) { - u8 i; - u16 n; - - i = FindAnyPokeNewsOnTheAir(); + u8 i = FindAnyPokeNewsOnTheAir(); if (i == 0xFF) { gSpecialVar_Result = FALSE; } else { - if (gSaveBlock1Ptr->pokeNews[i].days == 0) + if (gSaveBlock1Ptr->pokeNews[i].dayCountdown == 0) { - gSaveBlock1Ptr->pokeNews[i].state = 2; + // News event is occurring, make comment depending on how much time is left + gSaveBlock1Ptr->pokeNews[i].state = POKENEWS_STATE_ACTIVE; if (gLocalTime.hours < 20) ShowFieldMessage(sPokeNewsTextGroup_Ongoing[gSaveBlock1Ptr->pokeNews[i].kind]); else @@ -2633,16 +2640,20 @@ void DoPokeNews(void) } else { - n = gSaveBlock1Ptr->pokeNews[i].days; - ConvertIntToDecimalStringN(gStringVar1, n, STR_CONV_MODE_LEFT_ALIGN, 1); - gSaveBlock1Ptr->pokeNews[i].state = 0; + // News event is upcoming, make comment about countdown to event + u16 dayCountdown = gSaveBlock1Ptr->pokeNews[i].dayCountdown; + ConvertIntToDecimalStringN(gStringVar1, dayCountdown, STR_CONV_MODE_LEFT_ALIGN, 1); + + // Mark as inactive so the countdown TV airing doesn't repeat + // Will be flagged as "upcoming" again by UpdatePokeNewsCountdown + gSaveBlock1Ptr->pokeNews[i].state = POKENEWS_STATE_INACTIVE; ShowFieldMessage(sPokeNewsTextGroup_Upcoming[gSaveBlock1Ptr->pokeNews[i].kind]); } gSpecialVar_Result = TRUE; } } -bool8 GetPriceReduction(u8 newsKind) +bool8 IsPokeNewsActive(u8 newsKind) { u8 i; @@ -2653,7 +2664,7 @@ bool8 GetPriceReduction(u8 newsKind) { if (gSaveBlock1Ptr->pokeNews[i].kind == newsKind) { - if (gSaveBlock1Ptr->pokeNews[i].state == 2 && IsPriceDiscounted(newsKind)) + if (gSaveBlock1Ptr->pokeNews[i].state == POKENEWS_STATE_ACTIVE && ShouldApplyPokeNewsEffect(newsKind)) return TRUE; return FALSE; @@ -2662,16 +2673,23 @@ bool8 GetPriceReduction(u8 newsKind) return FALSE; } -static bool8 IsPriceDiscounted(u8 newsKind) +// Returns TRUE if the effects of the given PokeNews should be applied. +// For POKENEWS_SLATEPORT / POKENEWS_LILYCOVE, only apply the effect if +// the player is talking to the Energy Guru / at the Dept Store Rooftop. +// For any other type of PokeNews this is always TRUE. +static bool8 ShouldApplyPokeNewsEffect(u8 newsKind) { switch (newsKind) { case POKENEWS_SLATEPORT: - if (gSaveBlock1Ptr->location.mapGroup == MAP_GROUP(SLATEPORT_CITY) && gSaveBlock1Ptr->location.mapNum == MAP_NUM(SLATEPORT_CITY) && gSpecialVar_LastTalked == 25) + if (gSaveBlock1Ptr->location.mapGroup == MAP_GROUP(SLATEPORT_CITY) + && gSaveBlock1Ptr->location.mapNum == MAP_NUM(SLATEPORT_CITY) + && gSpecialVar_LastTalked == LOCALID_SLATEPORT_ENERGY_GURU) return TRUE; return FALSE; case POKENEWS_LILYCOVE: - if (gSaveBlock1Ptr->location.mapGroup == MAP_GROUP(LILYCOVE_CITY_DEPARTMENT_STORE_ROOFTOP) && gSaveBlock1Ptr->location.mapNum == MAP_NUM(LILYCOVE_CITY_DEPARTMENT_STORE_ROOFTOP)) + if (gSaveBlock1Ptr->location.mapGroup == MAP_GROUP(LILYCOVE_CITY_DEPARTMENT_STORE_ROOFTOP) + && gSaveBlock1Ptr->location.mapNum == MAP_NUM(LILYCOVE_CITY_DEPARTMENT_STORE_ROOFTOP)) return TRUE; return FALSE; } @@ -2693,7 +2711,7 @@ static bool8 IsAddingPokeNewsDisallowed(u8 newsKind) return FALSE; } -static void UpdatePokeNewsTimeLeft(u16 days) +static void UpdatePokeNewsCountdown(u16 days) { u8 i; @@ -2701,16 +2719,18 @@ static void UpdatePokeNewsTimeLeft(u16 days) { if (gSaveBlock1Ptr->pokeNews[i].kind != POKENEWS_NONE) { - if (gSaveBlock1Ptr->pokeNews[i].days < days) + if (gSaveBlock1Ptr->pokeNews[i].dayCountdown < days) { + // News event has elapsed, clear it from list ClearPokeNewsBySlot(i); } else { - if (gSaveBlock1Ptr->pokeNews[i].state == 0 && FlagGet(FLAG_SYS_GAME_CLEAR) == TRUE) - gSaveBlock1Ptr->pokeNews[i].state = 1; + // Progress countdown to news event + if (gSaveBlock1Ptr->pokeNews[i].state == POKENEWS_STATE_INACTIVE && FlagGet(FLAG_SYS_GAME_CLEAR) == TRUE) + gSaveBlock1Ptr->pokeNews[i].state = POKENEWS_STATE_UPCOMING; - gSaveBlock1Ptr->pokeNews[i].days -= days; + gSaveBlock1Ptr->pokeNews[i].dayCountdown -= days; } } } @@ -2760,9 +2780,7 @@ void CopyContestCategoryToStringVar(u8 varIdx, u8 category) void SetContestCategoryStringVarForInterview(void) { - TVShow *show; - - show = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004]; + TVShow *show = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004]; CopyContestCategoryToStringVar(1, show->bravoTrainer.contestCategory); } @@ -2789,9 +2807,7 @@ size_t CountDigits(int value) static void SmartShopper_BufferPurchaseTotal(u8 varIdx, TVShow *show) { u8 i; - int price; - - price = 0; + int price = 0; for (i = 0; i < SMARTSHOPPER_NUM_ITEMS; i++) { if (show->smartshopperShow.itemIds[i] != ITEM_NONE) @@ -2832,21 +2848,19 @@ static bool8 IsRecordMixShowAlreadySpawned(u8 kind, bool8 delete) static void SortPurchasesByQuantity(void) { u8 i, j; - u16 tmpId; - u16 tmpQn; - + for (i = 0; i < SMARTSHOPPER_NUM_ITEMS - 1; i++) { for (j = i + 1; j < SMARTSHOPPER_NUM_ITEMS; j++) { if (gMartPurchaseHistory[i].quantity < gMartPurchaseHistory[j].quantity) { - tmpId = gMartPurchaseHistory[i].itemId; - tmpQn = gMartPurchaseHistory[i].quantity; + u16 tempItemId = gMartPurchaseHistory[i].itemId; + u16 tempQuantity = gMartPurchaseHistory[i].quantity; gMartPurchaseHistory[i].itemId = gMartPurchaseHistory[j].itemId; gMartPurchaseHistory[i].quantity = gMartPurchaseHistory[j].quantity; - gMartPurchaseHistory[j].itemId = tmpId; - gMartPurchaseHistory[j].quantity = tmpQn; + gMartPurchaseHistory[j].itemId = tempItemId; + gMartPurchaseHistory[j].quantity = tempQuantity; } } } @@ -2923,7 +2937,8 @@ static void InterviewBefore_FanClubLetter(void) if (!gSpecialVar_Result) { StringCopy(gStringVar1, gSpeciesNames[GetMonData(&gPlayerParty[GetLeadMonIndex()], MON_DATA_SPECIES, NULL)]); - InitializeEasyChatWordArray(gSaveBlock1Ptr->tvShows[sCurTVShowSlot].fanclubLetter.words, 6); + InitializeEasyChatWordArray(gSaveBlock1Ptr->tvShows[sCurTVShowSlot].fanclubLetter.words, + ARRAY_COUNT(gSaveBlock1Ptr->tvShows[sCurTVShowSlot].fanclubLetter.words)); } } @@ -2932,7 +2947,8 @@ static void InterviewBefore_RecentHappenings(void) TryReplaceOldTVShowOfKind(TVSHOW_RECENT_HAPPENINGS); if (!gSpecialVar_Result) { - InitializeEasyChatWordArray(gSaveBlock1Ptr->tvShows[sCurTVShowSlot].recentHappenings.words, 6); + InitializeEasyChatWordArray(gSaveBlock1Ptr->tvShows[sCurTVShowSlot].recentHappenings.words, + ARRAY_COUNT(gSaveBlock1Ptr->tvShows[sCurTVShowSlot].recentHappenings.words)); } } @@ -2943,8 +2959,9 @@ static void InterviewBefore_PkmnFanClubOpinions(void) { StringCopy(gStringVar1, gSpeciesNames[GetMonData(&gPlayerParty[GetLeadMonIndex()], MON_DATA_SPECIES, NULL)]); GetMonData(&gPlayerParty[GetLeadMonIndex()], MON_DATA_NICKNAME, gStringVar2); - StringGetEnd10(gStringVar2); - InitializeEasyChatWordArray(gSaveBlock1Ptr->tvShows[sCurTVShowSlot].fanclubOpinions.words, 2); + StringGet_Nickname(gStringVar2); + InitializeEasyChatWordArray(gSaveBlock1Ptr->tvShows[sCurTVShowSlot].fanclubOpinions.words, + ARRAY_COUNT(gSaveBlock1Ptr->tvShows[sCurTVShowSlot].fanclubOpinions.words)); } } @@ -2962,7 +2979,8 @@ static void InterviewBefore_BravoTrainerPkmnProfile(void) { TryReplaceOldTVShowOfKind(TVSHOW_BRAVO_TRAINER_POKEMON_PROFILE); if (!gSpecialVar_Result) - InitializeEasyChatWordArray(gSaveBlock1Ptr->tvShows[sCurTVShowSlot].bravoTrainer.words, 2); + InitializeEasyChatWordArray(gSaveBlock1Ptr->tvShows[sCurTVShowSlot].bravoTrainer.words, + ARRAY_COUNT(gSaveBlock1Ptr->tvShows[sCurTVShowSlot].bravoTrainer.words)); } static void InterviewBefore_ContestLiveUpdates(void) @@ -2979,14 +2997,16 @@ static void InterviewBefore_BravoTrainerBTProfile(void) { TryReplaceOldTVShowOfKind(TVSHOW_BRAVO_TRAINER_BATTLE_TOWER_PROFILE); if (!gSpecialVar_Result) - InitializeEasyChatWordArray(gSaveBlock1Ptr->tvShows[sCurTVShowSlot].bravoTrainerTower.words, 1); + InitializeEasyChatWordArray(gSaveBlock1Ptr->tvShows[sCurTVShowSlot].bravoTrainerTower.words, + ARRAY_COUNT(gSaveBlock1Ptr->tvShows[sCurTVShowSlot].bravoTrainerTower.words)); } static void InterviewBefore_FanClubSpecial(void) { TryReplaceOldTVShowOfKind(TVSHOW_FAN_CLUB_SPECIAL); if (!gSpecialVar_Result) - InitializeEasyChatWordArray(gSaveBlock1Ptr->tvShows[sCurTVShowSlot].fanClubSpecial.words, 1); + InitializeEasyChatWordArray(gSaveBlock1Ptr->tvShows[sCurTVShowSlot].fanClubSpecial.words, + ARRAY_COUNT(gSaveBlock1Ptr->tvShows[sCurTVShowSlot].fanClubSpecial.words)); } static bool8 IsPartyMonNicknamedOrNotEnglish(u8 monIdx) @@ -3058,23 +3078,19 @@ static void CompactTVShowArray(TVShow *shows) } } -static u16 GetRandomDifferentSpeciesAndNameSeenByPlayer(u8 varIdx, u16 passedSpecies) +static u16 GetRandomDifferentSpeciesAndNameSeenByPlayer(u8 varIdx, u16 excludedSpecies) { - u16 species; - - species = GetRandomDifferentSpeciesSeenByPlayer(passedSpecies); + u16 species = GetRandomDifferentSpeciesSeenByPlayer(excludedSpecies); StringCopy(gTVStringVarPtrs[varIdx], gSpeciesNames[species]); return species; } -static u16 GetRandomDifferentSpeciesSeenByPlayer(u16 passedSpecies) +static u16 GetRandomDifferentSpeciesSeenByPlayer(u16 excludedSpecies) { - u16 species; - u16 initSpecies; + u16 species = Random() % (NUM_SPECIES - 1) + 1; + u16 initSpecies = species; - species = (Random() % (NUM_SPECIES - 1)) + 1; - initSpecies = species; - while (GetSetPokedexFlag(SpeciesToNationalPokedexNum(species), FLAG_GET_SEEN) != TRUE || species == passedSpecies) + while (GetSetPokedexFlag(SpeciesToNationalPokedexNum(species), FLAG_GET_SEEN) != TRUE || species == excludedSpecies) { if (species == SPECIES_NONE + 1) species = NUM_SPECIES - 1; @@ -3083,7 +3099,8 @@ static u16 GetRandomDifferentSpeciesSeenByPlayer(u16 passedSpecies) if (species == initSpecies) { - species = passedSpecies; + // Looped back to initial species (only Pokémon seen), must choose excluded species + species = excludedSpecies; return species; } }; @@ -3308,7 +3325,7 @@ static void ChangeBoxPokemonNickname_CB(void) void BufferMonNickname(void) { GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_NICKNAME, gStringVar1); - StringGetEnd10(gStringVar1); + StringGet_Nickname(gStringVar1); } void IsMonOTIDNotPlayers(void) @@ -3798,7 +3815,7 @@ void DeactivateAllNormalTVShows(void) } } -// Ensures a minimum of 5 empty mixed show slots +// Ensures a minimum of 5 empty record mixed show slots static void DeleteExcessMixedShows(void) { s8 i; @@ -3897,8 +3914,8 @@ static bool8 TryMixPokeNewsShow(PokeNews *dest, PokeNews *src, s8 slot) return FALSE; } dest[slot].kind = src->kind; - dest[slot].state = 1; - dest[slot].days = src->days; + dest[slot].state = POKENEWS_STATE_UPCOMING; + dest[slot].dayCountdown = src->dayCountdown; return TRUE; } @@ -3929,7 +3946,7 @@ static void ClearPokeNewsIfGameNotComplete(void) if (FlagGet(FLAG_SYS_GAME_CLEAR) != TRUE) { for (i = 0; i < POKE_NEWS_COUNT; i++) - gSaveBlock1Ptr->pokeNews[i].state = 0; + gSaveBlock1Ptr->pokeNews[i].state = POKENEWS_STATE_INACTIVE; } } @@ -5907,21 +5924,21 @@ static void DoTVShowSecretBaseVisit(void) { case 0: TVShowConvertInternationalString(gStringVar1, show->secretBaseVisit.playerName, show->secretBaseVisit.language); - if (show->secretBaseVisit.nDecorations == 0) + if (show->secretBaseVisit.numDecorations == 0) sTVShowState = 2; else sTVShowState = 1; break; case 1: StringCopy(gStringVar2, gDecorations[show->secretBaseVisit.decorations[0]].name); - if (show->secretBaseVisit.nDecorations == 1) + if (show->secretBaseVisit.numDecorations == 1) sTVShowState = 4; else sTVShowState = 3; break; case 3: StringCopy(gStringVar2, gDecorations[show->secretBaseVisit.decorations[1]].name); - switch (show->secretBaseVisit.nDecorations) + switch (show->secretBaseVisit.numDecorations) { case 2: sTVShowState = 7; @@ -5985,21 +6002,13 @@ static void DoTVShowPokemonLotteryWinnerFlashReport(void) state = sTVShowState; TVShowConvertInternationalString(gStringVar1, show->lottoWinner.playerName, show->lottoWinner.language); if (show->lottoWinner.whichPrize == 0) - { StringCopy(gStringVar2, gText_Jackpot); - } else if (show->lottoWinner.whichPrize == 1) - { StringCopy(gStringVar2, gText_First); - } else if (show->lottoWinner.whichPrize == 2) - { StringCopy(gStringVar2, gText_Second); - } else - { StringCopy(gStringVar2, gText_Third); - } StringCopy(gStringVar3, ItemId_GetName(show->lottoWinner.item)); TVShowDone(); ShowFieldMessage(sTVPokemonLotteryWinnerFlashReportTextGroup[state]); @@ -6712,23 +6721,23 @@ static void DoTVShowSafariFanClub(void) switch (state) { case 0: - if (show->safariFanClub.nMonsCaught == 0) + if (show->safariFanClub.monsCaught == 0) sTVShowState = 6; - else if (show->safariFanClub.nMonsCaught < 4) + else if (show->safariFanClub.monsCaught < 4) sTVShowState = 5; else sTVShowState = 1; break; case 1: TVShowConvertInternationalString(gStringVar1, show->safariFanClub.playerName, show->safariFanClub.language); - ConvertIntToDecimalString(1, show->safariFanClub.nMonsCaught); - if (show->safariFanClub.nPkblkUsed == 0) + ConvertIntToDecimalString(1, show->safariFanClub.monsCaught); + if (show->safariFanClub.pokeblocksUsed == 0) sTVShowState = 3; else sTVShowState = 2; break; case 2: - ConvertIntToDecimalString(1, show->safariFanClub.nPkblkUsed); + ConvertIntToDecimalString(1, show->safariFanClub.pokeblocksUsed); sTVShowState = 4; break; case 3: @@ -6740,21 +6749,21 @@ static void DoTVShowSafariFanClub(void) break; case 5: TVShowConvertInternationalString(gStringVar1, show->safariFanClub.playerName, show->safariFanClub.language); - ConvertIntToDecimalString(1, show->safariFanClub.nMonsCaught); - if (show->safariFanClub.nPkblkUsed == 0) + ConvertIntToDecimalString(1, show->safariFanClub.monsCaught); + if (show->safariFanClub.pokeblocksUsed == 0) sTVShowState = 8; else sTVShowState = 7; break; case 6: TVShowConvertInternationalString(gStringVar1, show->safariFanClub.playerName, show->safariFanClub.language); - if (show->safariFanClub.nPkblkUsed == 0) + if (show->safariFanClub.pokeblocksUsed == 0) sTVShowState = 8; else sTVShowState = 7; break; case 7: - ConvertIntToDecimalString(1, show->safariFanClub.nPkblkUsed); + ConvertIntToDecimalString(1, show->safariFanClub.pokeblocksUsed); sTVShowState = 9; break; case 8: diff --git a/src/union_room.c b/src/union_room.c index 1400a0b1d440..9a743dbab902 100644 --- a/src/union_room.c +++ b/src/union_room.c @@ -49,7 +49,6 @@ #include "constants/battle_frontier.h" #include "constants/cable_club.h" #include "constants/game_stat.h" -#include "constants/maps.h" #include "constants/party_menu.h" #include "constants/rgb.h" #include "constants/songs.h" @@ -1593,8 +1592,8 @@ void StartUnionRoomBattle(u16 battleFlags) static void WarpForWirelessMinigame(u16 linkService, u16 x, u16 y) { VarSet(VAR_CABLE_CLUB_STATE, linkService); - SetWarpDestination(gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, -1, x, y); - SetDynamicWarpWithCoords(0, gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, -1, x, y); + SetWarpDestination(gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, WARP_ID_NONE, x, y); + SetDynamicWarpWithCoords(0, gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, WARP_ID_NONE, x, y); WarpIntoMap(); } @@ -1605,7 +1604,7 @@ static void WarpForCableClubActivity(s8 mapGroup, s8 mapNum, s32 x, s32 y, u16 l gFieldLinkPlayerCount = GetLinkPlayerCount(); gLocalLinkPlayerId = GetMultiplayerId(); SetCableClubWarp(); - SetWarpDestination(mapGroup, mapNum, -1, x, y); + SetWarpDestination(mapGroup, mapNum, WARP_ID_NONE, x, y); WarpIntoMap(); } @@ -4503,6 +4502,6 @@ static void ViewURoomPartnerTrainerCard(u8 *unused, struct WirelessLink_URoom *d static void CopyAndTranslatePlayerName(u8 *dest, struct RfuPlayer *player) { - StringCopy7(dest, player->rfu.name); + StringCopy_PlayerName(dest, player->rfu.name); ConvertInternationalString(dest, player->rfu.data.compatibility.language); } diff --git a/src/union_room_player_avatar.c b/src/union_room_player_avatar.c index 225386165994..908eb8f21ff3 100644 --- a/src/union_room_player_avatar.c +++ b/src/union_room_player_avatar.c @@ -400,12 +400,12 @@ void CreateUnionRoomPlayerSprites(u8 * spriteIds, s32 leaderId) for (memberId = 0; memberId < MAX_RFU_PLAYERS; memberId++) { s32 id = UR_PLAYER_SPRITE_ID(leaderId, memberId); - spriteIds[id] = CreateObjectSprite(OBJ_EVENT_GFX_MAN_4, + spriteIds[id] = CreateVirtualObject(OBJ_EVENT_GFX_MAN_4, id - UR_SPRITE_START_ID, sUnionRoomPlayerCoords[leaderId][0] + sUnionRoomGroupOffsets[memberId][0], sUnionRoomPlayerCoords[leaderId][1] + sUnionRoomGroupOffsets[memberId][1], 3, 1); - SetObjectEventSpriteInvisibility(id - UR_SPRITE_START_ID, TRUE); + SetVirtualObjectInvisibility(id - UR_SPRITE_START_ID, TRUE); } } @@ -443,7 +443,7 @@ static u8 GetNewFacingDirectionForUnionRoomPlayer(u32 memberId, u32 leaderId, st static bool32 IsUnionRoomPlayerInvisible(u32 leaderId, u32 memberId) { - return IsObjectEventSpriteInvisible(UR_PLAYER_SPRITE_ID(leaderId, memberId) - UR_SPRITE_START_ID); + return IsVirtualObjectInvisible(UR_PLAYER_SPRITE_ID(leaderId, memberId) - UR_SPRITE_START_ID); } static void SpawnGroupMember(u32 leaderId, u32 memberId, u8 graphicsId, struct RfuGameData * gameData) @@ -452,10 +452,10 @@ static void SpawnGroupMember(u32 leaderId, u32 memberId, u8 graphicsId, struct R s32 id = UR_PLAYER_SPRITE_ID(leaderId, memberId); if (IsUnionRoomPlayerInvisible(leaderId, memberId) == TRUE) { - SetObjectEventSpriteInvisibility(id - UR_SPRITE_START_ID, FALSE); - SetObjectEventSpriteAnim(id - UR_SPRITE_START_ID, UNION_ROOM_SPAWN_IN); + SetVirtualObjectInvisibility(id - UR_SPRITE_START_ID, FALSE); + SetVirtualObjectSpriteAnim(id - UR_SPRITE_START_ID, UNION_ROOM_SPAWN_IN); } - SetObjectEventSpriteGraphics(id - UR_SPRITE_START_ID, graphicsId); + SetVirtualObjectGraphics(id - UR_SPRITE_START_ID, graphicsId); SetUnionRoomObjectFacingDirection(memberId, leaderId, GetNewFacingDirectionForUnionRoomPlayer(memberId, leaderId, gameData)); GetUnionRoomPlayerCoords(leaderId, memberId, &x, &y); MapGridSetMetatileImpassabilityAt(x, y, TRUE); @@ -464,7 +464,7 @@ static void SpawnGroupMember(u32 leaderId, u32 memberId, u8 graphicsId, struct R static void DespawnGroupMember(u32 leaderId, u32 memberId) { s32 x, y; - SetObjectEventSpriteAnim(UR_PLAYER_SPRITE_ID(leaderId, memberId) - UR_SPRITE_START_ID, UNION_ROOM_SPAWN_OUT); + SetVirtualObjectSpriteAnim(UR_PLAYER_SPRITE_ID(leaderId, memberId) - UR_SPRITE_START_ID, UNION_ROOM_SPAWN_OUT); GetUnionRoomPlayerCoords(leaderId, memberId, &x, &y); MapGridSetMetatileImpassabilityAt(x, y, FALSE); } @@ -476,7 +476,7 @@ static void AssembleGroup(u32 leaderId, struct RfuGameData * gameData) PlayerGetDestCoords(&x, &y); player_get_pos_including_state_based_drift(&x2, &y2); - if (IsObjectEventSpriteInvisible(UR_PLAYER_SPRITE_ID(leaderId, 0) - UR_SPRITE_START_ID) == TRUE) + if (IsVirtualObjectInvisible(UR_PLAYER_SPRITE_ID(leaderId, 0) - UR_SPRITE_START_ID) == TRUE) { if (IsUnionRoomPlayerAt(leaderId, 0, x, y) == TRUE || IsUnionRoomPlayerAt(leaderId, 0, x2, y2) == TRUE) return; @@ -576,9 +576,9 @@ bool32 TryInteractWithUnionRoomMember(struct RfuPlayerList *list, s16 *memberIdP continue; // Has a group member spawned at this position? - if (IsObjectEventSpriteInvisible(id - UR_SPRITE_START_ID)) + if (IsVirtualObjectInvisible(id - UR_SPRITE_START_ID)) continue; - if (IsObjectEventSpriteAnimating(id - UR_SPRITE_START_ID)) + if (IsVirtualObjectAnimating(id - UR_SPRITE_START_ID)) continue; if (leaders[i].groupScheduledAnim != UNION_ROOM_SPAWN_IN) continue; @@ -595,9 +595,9 @@ bool32 TryInteractWithUnionRoomMember(struct RfuPlayerList *list, s16 *memberIdP static void SetUnionRoomObjectFacingDirection(s32 memberId, s32 leaderId, u8 newDirection) { - TurnObjectEventSprite(MAX_RFU_PLAYERS * leaderId - UR_SPRITE_START_ID + memberId, newDirection); + TurnVirtualObject(MAX_RFU_PLAYERS * leaderId - UR_SPRITE_START_ID + memberId, newDirection); // should be line below, but order is swapped here - // TurnObjectEventSprite(UR_PLAYER_SPRITE_ID(leaderId, memberId) - UR_SPRITE_START_ID, newDirection); + // TurnVirtualObject(UR_PLAYER_SPRITE_ID(leaderId, memberId) - UR_SPRITE_START_ID, newDirection); } void UpdateUnionRoomMemberFacing(u32 memberId, u32 leaderId, struct RfuPlayerList *list) diff --git a/src/use_pokeblock.c b/src/use_pokeblock.c index 312e2107e811..8f041a6ff212 100644 --- a/src/use_pokeblock.c +++ b/src/use_pokeblock.c @@ -868,7 +868,7 @@ static void AskUsePokeblock(void) u8 stringBuffer[0x40]; GetMonData(&gPlayerParty[GetPartyIdFromSelectionId(sMenu->info.curSelection)], MON_DATA_NICKNAME, stringBuffer); - StringGetEnd10(stringBuffer); + StringGet_Nickname(stringBuffer); StringAppend(stringBuffer, gText_GetsAPokeBlockQuestion); StringCopy(gStringVar4, stringBuffer); FillWindowPixelBuffer(WIN_TEXT, 17); diff --git a/src/wild_encounter.c b/src/wild_encounter.c index 65d8c86d099c..5960692a2061 100644 --- a/src/wild_encounter.c +++ b/src/wild_encounter.c @@ -20,7 +20,6 @@ #include "constants/game_stat.h" #include "constants/items.h" #include "constants/layouts.h" -#include "constants/maps.h" #include "constants/weather.h" extern const u8 EventScript_RepelWoreOff[];