Merge branch 'master' into doc-inc

This commit is contained in:
GriffinR
2019-10-07 17:37:04 -04:00
committed by GitHub
44 changed files with 313 additions and 320 deletions
+2 -2
View File
@@ -102,8 +102,8 @@
create_movement_action clear_fixed_priority create_movement_action clear_fixed_priority
create_movement_action init_affine_anim create_movement_action init_affine_anim
create_movement_action clear_affine_anim create_movement_action clear_affine_anim
create_movement_action unknown_movement_1 create_movement_action hide_reflection
create_movement_action unknown_movement_2 create_movement_action show_reflection
create_movement_action walk_down_start_affine create_movement_action walk_down_start_affine
create_movement_action walk_down_affine create_movement_action walk_down_affine
+2 -2
View File
@@ -1318,9 +1318,9 @@ BirthIsland_Harbor_EventScript_272250:: @ 8272250
FarawayIsland_Entrance_EventScript_272250:: @ 8272250 FarawayIsland_Entrance_EventScript_272250:: @ 8272250
NavelRock_Harbor_EventScript_272250:: @ 8272250 NavelRock_Harbor_EventScript_272250:: @ 8272250
SouthernIsland_Exterior_EventScript_272250:: @ 8272250 SouthernIsland_Exterior_EventScript_272250:: @ 8272250
compare VAR_FACING, 1 compare VAR_FACING, DIR_SOUTH
call_if_eq BattleFrontier_OutsideWest_EventScript_242A21 call_if_eq BattleFrontier_OutsideWest_EventScript_242A21
compare VAR_FACING, 3 compare VAR_FACING, DIR_WEST
call_if_eq BattleFrontier_OutsideWest_EventScript_242A2C call_if_eq BattleFrontier_OutsideWest_EventScript_242A2C
delay 30 delay 30
hideobjectat 255, MAP_PETALBURG_CITY hideobjectat 255, MAP_PETALBURG_CITY
@@ -190,9 +190,9 @@ BattleFrontier_BattleTowerMultiBattleRoom_EventScript_243F36:: @ 8243F36
waitmessage waitmessage
waitbuttonpress waitbuttonpress
closemessage closemessage
compare VAR_FACING, 1 compare VAR_FACING, DIR_SOUTH
call_if_ne BattleFrontier_BattleTowerMultiBattleRoom_EventScript_243FD4 call_if_ne BattleFrontier_BattleTowerMultiBattleRoom_EventScript_243FD4
compare VAR_FACING, 1 compare VAR_FACING, DIR_SOUTH
call_if_eq BattleFrontier_BattleTowerMultiBattleRoom_EventScript_243FDF call_if_eq BattleFrontier_BattleTowerMultiBattleRoom_EventScript_243FDF
removeobject VAR_LAST_TALKED removeobject VAR_LAST_TALKED
setflag FLAG_CHOSEN_MULTI_BATTLE_NPC_PARTNER setflag FLAG_CHOSEN_MULTI_BATTLE_NPC_PARTNER
@@ -144,13 +144,13 @@ BattleFrontier_OutsideWest_EventScript_23D57F:: @ 823D57F
lock lock
faceplayer faceplayer
delay 20 delay 20
compare VAR_FACING, 2 compare VAR_FACING, DIR_NORTH
call_if_eq BattleFrontier_OutsideWest_EventScript_23D5BA call_if_eq BattleFrontier_OutsideWest_EventScript_23D5BA
compare VAR_FACING, 1 compare VAR_FACING, DIR_SOUTH
call_if_eq BattleFrontier_OutsideWest_EventScript_23D5C5 call_if_eq BattleFrontier_OutsideWest_EventScript_23D5C5
compare VAR_FACING, 3 compare VAR_FACING, DIR_WEST
call_if_eq BattleFrontier_OutsideWest_EventScript_23D5BA call_if_eq BattleFrontier_OutsideWest_EventScript_23D5BA
compare VAR_FACING, 4 compare VAR_FACING, DIR_EAST
call_if_eq BattleFrontier_OutsideWest_EventScript_23D5BA call_if_eq BattleFrontier_OutsideWest_EventScript_23D5BA
msgbox BattleFrontier_OutsideWest_Text_23DC36, MSGBOX_DEFAULT msgbox BattleFrontier_OutsideWest_Text_23DC36, MSGBOX_DEFAULT
release release
@@ -169,13 +169,13 @@ BattleFrontier_OutsideWest_EventScript_23D5C6:: @ 823D5C6
faceplayer faceplayer
message BattleFrontier_OutsideWest_Text_23DCB0 message BattleFrontier_OutsideWest_Text_23DCB0
waitmessage waitmessage
compare VAR_FACING, 2 compare VAR_FACING, DIR_NORTH
call_if_eq BattleFrontier_OutsideWest_EventScript_23D5FD call_if_eq BattleFrontier_OutsideWest_EventScript_23D5FD
compare VAR_FACING, 1 compare VAR_FACING, DIR_SOUTH
call_if_eq BattleFrontier_OutsideWest_EventScript_23D608 call_if_eq BattleFrontier_OutsideWest_EventScript_23D608
compare VAR_FACING, 3 compare VAR_FACING, DIR_WEST
call_if_eq BattleFrontier_OutsideWest_EventScript_23D613 call_if_eq BattleFrontier_OutsideWest_EventScript_23D613
compare VAR_FACING, 4 compare VAR_FACING, DIR_EAST
call_if_eq BattleFrontier_OutsideWest_EventScript_23D61E call_if_eq BattleFrontier_OutsideWest_EventScript_23D61E
waitbuttonpress waitbuttonpress
release release
@@ -172,13 +172,13 @@ BattleFrontier_ScottsHouse_EventScript_263943:: @ 8263943
msgbox BattleFrontier_ScottsHouse_Text_263A3F, MSGBOX_DEFAULT msgbox BattleFrontier_ScottsHouse_Text_263A3F, MSGBOX_DEFAULT
closemessage closemessage
delay 30 delay 30
compare VAR_FACING, 2 compare VAR_FACING, DIR_NORTH
call_if_eq BattleFrontier_ScottsHouse_EventScript_263A13 call_if_eq BattleFrontier_ScottsHouse_EventScript_263A13
compare VAR_FACING, 1 compare VAR_FACING, DIR_SOUTH
call_if_eq BattleFrontier_ScottsHouse_EventScript_263A1E call_if_eq BattleFrontier_ScottsHouse_EventScript_263A1E
compare VAR_FACING, 4 compare VAR_FACING, DIR_EAST
call_if_eq BattleFrontier_ScottsHouse_EventScript_263A29 call_if_eq BattleFrontier_ScottsHouse_EventScript_263A29
compare VAR_FACING, 3 compare VAR_FACING, DIR_WEST
call_if_eq BattleFrontier_ScottsHouse_EventScript_263A34 call_if_eq BattleFrontier_ScottsHouse_EventScript_263A34
msgbox BattleFrontier_ScottsHouse_Text_263B29, MSGBOX_DEFAULT msgbox BattleFrontier_ScottsHouse_Text_263B29, MSGBOX_DEFAULT
applymovement 1, Common_Movement_FacePlayer applymovement 1, Common_Movement_FacePlayer
+4 -4
View File
@@ -198,7 +198,7 @@ DewfordTown_Hall_EventScript_1FD73A:: @ 81FD73A
end end
DewfordTown_Hall_EventScript_1FD75B:: @ 81FD75B DewfordTown_Hall_EventScript_1FD75B:: @ 81FD75B
compare VAR_FACING, 4 compare VAR_FACING, DIR_EAST
goto_if_eq DewfordTown_Hall_EventScript_1FD739 goto_if_eq DewfordTown_Hall_EventScript_1FD739
applymovement EVENT_OBJ_ID_PLAYER, Common_Movement_WalkInPlaceFastestRight applymovement EVENT_OBJ_ID_PLAYER, Common_Movement_WalkInPlaceFastestRight
waitmovement 0 waitmovement 0
@@ -217,9 +217,9 @@ DewfordTown_Hall_EventScript_1FD772:: @ 81FD772
end end
DewfordTown_Hall_EventScript_1FD793:: @ 81FD793 DewfordTown_Hall_EventScript_1FD793:: @ 81FD793
compare VAR_FACING, 2 compare VAR_FACING, DIR_NORTH
call_if_eq DewfordTown_Hall_EventScript_1FD7AA call_if_eq DewfordTown_Hall_EventScript_1FD7AA
compare VAR_FACING, 1 compare VAR_FACING, DIR_SOUTH
call_if_eq DewfordTown_Hall_EventScript_1FD7B5 call_if_eq DewfordTown_Hall_EventScript_1FD7B5
return return
@@ -234,7 +234,7 @@ DewfordTown_Hall_EventScript_1FD7B5:: @ 81FD7B5
return return
DewfordTown_Hall_EventScript_1FD7C0:: @ 81FD7C0 DewfordTown_Hall_EventScript_1FD7C0:: @ 81FD7C0
compare VAR_FACING, 3 compare VAR_FACING, DIR_WEST
goto_if_eq DewfordTown_Hall_EventScript_1FD739 goto_if_eq DewfordTown_Hall_EventScript_1FD739
applymovement EVENT_OBJ_ID_PLAYER, Common_Movement_WalkInPlaceFastestLeft applymovement EVENT_OBJ_ID_PLAYER, Common_Movement_WalkInPlaceFastestLeft
waitmovement 0 waitmovement 0
@@ -34,11 +34,11 @@ EverGrandeCity_PokemonCenter_1F_EventScript_229A79:: @ 8229A79
faceplayer faceplayer
msgbox EverGrandeCity_PokemonCenter_1F_Text_229BF1, MSGBOX_DEFAULT msgbox EverGrandeCity_PokemonCenter_1F_Text_229BF1, MSGBOX_DEFAULT
closemessage closemessage
compare VAR_FACING, 2 compare VAR_FACING, DIR_NORTH
call_if_eq EverGrandeCity_PokemonCenter_1F_EventScript_229AB6 call_if_eq EverGrandeCity_PokemonCenter_1F_EventScript_229AB6
compare VAR_FACING, 4 compare VAR_FACING, DIR_EAST
call_if_eq EverGrandeCity_PokemonCenter_1F_EventScript_229AC1 call_if_eq EverGrandeCity_PokemonCenter_1F_EventScript_229AC1
compare VAR_FACING, 3 compare VAR_FACING, DIR_WEST
call_if_eq EverGrandeCity_PokemonCenter_1F_EventScript_229AC1 call_if_eq EverGrandeCity_PokemonCenter_1F_EventScript_229AC1
addvar VAR_SCOTT_STATE, 1 addvar VAR_SCOTT_STATE, 1
setflag FLAG_MET_SCOTT_IN_EVERGRANDE setflag FLAG_MET_SCOTT_IN_EVERGRANDE
@@ -30,8 +30,8 @@ FallarborTown_PokemonCenter_1F_EventScript_200C01:: @ 8200C01
msgbox FallarborTown_PokemonCenter_1F_Text_200C6B, MSGBOX_DEFAULT msgbox FallarborTown_PokemonCenter_1F_Text_200C6B, MSGBOX_DEFAULT
closemessage closemessage
switch VAR_FACING switch VAR_FACING
case 2, FallarborTown_PokemonCenter_1F_EventScript_200C28 case DIR_NORTH, FallarborTown_PokemonCenter_1F_EventScript_200C28
case 3, FallarborTown_PokemonCenter_1F_EventScript_200C38 case DIR_WEST, FallarborTown_PokemonCenter_1F_EventScript_200C38
end end
FallarborTown_PokemonCenter_1F_EventScript_200C28:: @ 8200C28 FallarborTown_PokemonCenter_1F_EventScript_200C28:: @ 8200C28
+4 -4
View File
@@ -125,13 +125,13 @@ FarawayIsland_Interior_EventScript_267DF2:: @ 8267DF2
message FarawayIsland_Interior_Text_Mew message FarawayIsland_Interior_Text_Mew
waitse waitse
playmoncry SPECIES_MEW, 2 playmoncry SPECIES_MEW, 2
compare VAR_FACING, 2 compare VAR_FACING, DIR_NORTH
call_if_eq FarawayIsland_Interior_EventScript_267EAF call_if_eq FarawayIsland_Interior_EventScript_267EAF
compare VAR_FACING, 1 compare VAR_FACING, DIR_SOUTH
call_if_eq FarawayIsland_Interior_EventScript_267EBA call_if_eq FarawayIsland_Interior_EventScript_267EBA
compare VAR_FACING, 3 compare VAR_FACING, DIR_WEST
call_if_eq FarawayIsland_Interior_EventScript_267EC5 call_if_eq FarawayIsland_Interior_EventScript_267EC5
compare VAR_FACING, 4 compare VAR_FACING, DIR_EAST
call_if_eq FarawayIsland_Interior_EventScript_267ED0 call_if_eq FarawayIsland_Interior_EventScript_267ED0
special sub_81D4BEC special sub_81D4BEC
delay 40 delay 40
@@ -23,13 +23,13 @@ GraniteCave_StevensRoom_EventScript_22DC7B:: @ 822DC7B
setflag FLAG_REGISTERED_STEVEN_POKENAV setflag FLAG_REGISTERED_STEVEN_POKENAV
msgbox GraniteCave_StevensRoom_Text_22DF8C, MSGBOX_DEFAULT msgbox GraniteCave_StevensRoom_Text_22DF8C, MSGBOX_DEFAULT
closemessage closemessage
compare VAR_FACING, 2 compare VAR_FACING, DIR_NORTH
call_if_eq GraniteCave_StevensRoom_EventScript_22DD0D call_if_eq GraniteCave_StevensRoom_EventScript_22DD0D
compare VAR_FACING, 1 compare VAR_FACING, DIR_SOUTH
call_if_eq GraniteCave_StevensRoom_EventScript_22DD2A call_if_eq GraniteCave_StevensRoom_EventScript_22DD2A
compare VAR_FACING, 3 compare VAR_FACING, DIR_WEST
call_if_eq GraniteCave_StevensRoom_EventScript_22DD18 call_if_eq GraniteCave_StevensRoom_EventScript_22DD18
compare VAR_FACING, 4 compare VAR_FACING, DIR_EAST
call_if_eq GraniteCave_StevensRoom_EventScript_22DD18 call_if_eq GraniteCave_StevensRoom_EventScript_22DD18
playse SE_KAIDAN playse SE_KAIDAN
removeobject 1 removeobject 1
@@ -40,9 +40,9 @@ LilycoveCity_LilycoveMuseum_1F_EventScript_218D1E:: @ 8218D1E
waitmovement 0 waitmovement 0
removeobject 2 removeobject 2
switch VAR_FACING switch VAR_FACING
case 2, LilycoveCity_LilycoveMuseum_1F_EventScript_218D5A case DIR_NORTH, LilycoveCity_LilycoveMuseum_1F_EventScript_218D5A
case 3, LilycoveCity_LilycoveMuseum_1F_EventScript_218D6F case DIR_WEST, LilycoveCity_LilycoveMuseum_1F_EventScript_218D6F
case 4, LilycoveCity_LilycoveMuseum_1F_EventScript_218D84 case DIR_EAST, LilycoveCity_LilycoveMuseum_1F_EventScript_218D84
end end
LilycoveCity_LilycoveMuseum_1F_EventScript_218D5A:: @ 8218D5A LilycoveCity_LilycoveMuseum_1F_EventScript_218D5A:: @ 8218D5A
@@ -73,13 +73,13 @@ LittlerootTown_BrendansHouse_2F_EventScript_1F8497:: @ 81F8497
waitmovement 0 waitmovement 0
delay 10 delay 10
playbgm MUS_BOY_SUP, 1 playbgm MUS_BOY_SUP, 1
compare VAR_FACING, 2 compare VAR_FACING, DIR_NORTH
call_if_eq LittlerootTown_BrendansHouse_2F_EventScript_1F8507 call_if_eq LittlerootTown_BrendansHouse_2F_EventScript_1F8507
compare VAR_FACING, 1 compare VAR_FACING, DIR_SOUTH
call_if_eq LittlerootTown_BrendansHouse_2F_EventScript_1F8536 call_if_eq LittlerootTown_BrendansHouse_2F_EventScript_1F8536
compare VAR_FACING, 3 compare VAR_FACING, DIR_WEST
call_if_eq LittlerootTown_BrendansHouse_2F_EventScript_1F8565 call_if_eq LittlerootTown_BrendansHouse_2F_EventScript_1F8565
compare VAR_FACING, 4 compare VAR_FACING, DIR_EAST
call_if_eq LittlerootTown_BrendansHouse_2F_EventScript_1F8594 call_if_eq LittlerootTown_BrendansHouse_2F_EventScript_1F8594
setvar VAR_LITTLEROOT_RIVAL_STATE, 3 setvar VAR_LITTLEROOT_RIVAL_STATE, 3
setflag FLAG_HIDE_LITTLEROOT_TOWN_BRENDANS_HOUSE_2F_POKE_BALL setflag FLAG_HIDE_LITTLEROOT_TOWN_BRENDANS_HOUSE_2F_POKE_BALL
@@ -74,13 +74,13 @@ LittlerootTown_MaysHouse_2F_EventScript_1F934A:: @ 81F934A
waitmovement 0 waitmovement 0
delay 10 delay 10
playbgm MUS_GIRL_SUP, 1 playbgm MUS_GIRL_SUP, 1
compare VAR_FACING, 2 compare VAR_FACING, DIR_NORTH
call_if_eq LittlerootTown_MaysHouse_2F_EventScript_1F93BA call_if_eq LittlerootTown_MaysHouse_2F_EventScript_1F93BA
compare VAR_FACING, 1 compare VAR_FACING, DIR_SOUTH
call_if_eq LittlerootTown_MaysHouse_2F_EventScript_1F93E9 call_if_eq LittlerootTown_MaysHouse_2F_EventScript_1F93E9
compare VAR_FACING, 3 compare VAR_FACING, DIR_WEST
call_if_eq LittlerootTown_MaysHouse_2F_EventScript_1F9418 call_if_eq LittlerootTown_MaysHouse_2F_EventScript_1F9418
compare VAR_FACING, 4 compare VAR_FACING, DIR_EAST
call_if_eq LittlerootTown_MaysHouse_2F_EventScript_1F9440 call_if_eq LittlerootTown_MaysHouse_2F_EventScript_1F9440
setvar VAR_LITTLEROOT_RIVAL_STATE, 3 setvar VAR_LITTLEROOT_RIVAL_STATE, 3
setflag FLAG_HIDE_LITTLEROOT_TOWN_MAYS_HOUSE_2F_POKE_BALL setflag FLAG_HIDE_LITTLEROOT_TOWN_MAYS_HOUSE_2F_POKE_BALL
+6 -6
View File
@@ -109,8 +109,8 @@ MauvilleCity_EventScript_1DF4AD:: @ 81DF4AD
goto_if_eq MauvilleCity_EventScript_1DF683 goto_if_eq MauvilleCity_EventScript_1DF683
closemessage closemessage
switch VAR_FACING switch VAR_FACING
case 2, MauvilleCity_EventScript_1DF4E0 case DIR_NORTH, MauvilleCity_EventScript_1DF4E0
case 4, MauvilleCity_EventScript_1DF53D case DIR_EAST, MauvilleCity_EventScript_1DF53D
end end
MauvilleCity_EventScript_1DF4E0:: @ 81DF4E0 MauvilleCity_EventScript_1DF4E0:: @ 81DF4E0
@@ -160,18 +160,18 @@ MauvilleCity_EventScript_1DF593:: @ 81DF593
setflag FLAG_DEFEATED_WALLY_MAUVILLE setflag FLAG_DEFEATED_WALLY_MAUVILLE
setvar VAR_WALLY_CALL_STEP_COUNTER, 0 setvar VAR_WALLY_CALL_STEP_COUNTER, 0
setflag FLAG_ENABLE_FIRST_WALLY_POKENAV_CALL setflag FLAG_ENABLE_FIRST_WALLY_POKENAV_CALL
compare VAR_FACING, 2 compare VAR_FACING, DIR_NORTH
call_if_eq MauvilleCity_EventScript_1DF5F3 call_if_eq MauvilleCity_EventScript_1DF5F3
compare VAR_FACING, 4 compare VAR_FACING, DIR_EAST
call_if_eq MauvilleCity_EventScript_1DF601 call_if_eq MauvilleCity_EventScript_1DF601
applymovement EVENT_OBJ_ID_PLAYER, Common_Movement_WalkInPlaceFastestDown applymovement EVENT_OBJ_ID_PLAYER, Common_Movement_WalkInPlaceFastestDown
waitmovement 0 waitmovement 0
msgbox MauvilleCity_Text_1DFED5, MSGBOX_DEFAULT msgbox MauvilleCity_Text_1DFED5, MSGBOX_DEFAULT
closemessage closemessage
addvar VAR_SCOTT_STATE, 1 addvar VAR_SCOTT_STATE, 1
compare VAR_FACING, 2 compare VAR_FACING, DIR_NORTH
call_if_eq MauvilleCity_EventScript_1DF616 call_if_eq MauvilleCity_EventScript_1DF616
compare VAR_FACING, 4 compare VAR_FACING, DIR_EAST
call_if_eq MauvilleCity_EventScript_1DF628 call_if_eq MauvilleCity_EventScript_1DF628
removeobject 11 removeobject 11
releaseall releaseall
+2 -2
View File
@@ -255,9 +255,9 @@ MossdeepCity_EventScript_1E4C85:: @ 81E4C85
faceplayer faceplayer
msgbox MossdeepCity_Text_1E5453, MSGBOX_DEFAULT msgbox MossdeepCity_Text_1E5453, MSGBOX_DEFAULT
closemessage closemessage
compare VAR_FACING, 2 compare VAR_FACING, DIR_NORTH
call_if_eq MossdeepCity_EventScript_1E4CB0 call_if_eq MossdeepCity_EventScript_1E4CB0
compare VAR_FACING, 4 compare VAR_FACING, DIR_EAST
call_if_eq MossdeepCity_EventScript_1E4CC2 call_if_eq MossdeepCity_EventScript_1E4CC2
addvar VAR_SCOTT_STATE, 1 addvar VAR_SCOTT_STATE, 1
removeobject 16 removeobject 16
+2 -2
View File
@@ -19,9 +19,9 @@ MossdeepCity_House2_EventScript_2220F1:: @ 82220F1
closemessage closemessage
setflag FLAG_WINGULL_DELIVERED_MAIL setflag FLAG_WINGULL_DELIVERED_MAIL
clearflag FLAG_HIDE_FORTREE_CITY_HOUSE_4_WINGULL clearflag FLAG_HIDE_FORTREE_CITY_HOUSE_4_WINGULL
compare VAR_FACING, 2 compare VAR_FACING, DIR_NORTH
call_if_eq MossdeepCity_House2_EventScript_222124 call_if_eq MossdeepCity_House2_EventScript_222124
compare VAR_FACING, 3 compare VAR_FACING, DIR_WEST
call_if_eq MossdeepCity_House2_EventScript_22212F call_if_eq MossdeepCity_House2_EventScript_22212F
removeobject 3 removeobject 3
release release
@@ -238,8 +238,8 @@ MossdeepCity_SpaceCenter_1F_EventScript_22321F:: @ 822321F
setflag FLAG_DEFEATED_GRUNT_SPACE_CENTER_1F setflag FLAG_DEFEATED_GRUNT_SPACE_CENTER_1F
copyobjectxytoperm 9 copyobjectxytoperm 9
switch VAR_FACING switch VAR_FACING
case 3, MossdeepCity_SpaceCenter_1F_EventScript_223278 case DIR_WEST, MossdeepCity_SpaceCenter_1F_EventScript_223278
case 3, MossdeepCity_SpaceCenter_1F_EventScript_223289 case DIR_WEST, MossdeepCity_SpaceCenter_1F_EventScript_223289
applymovement 9, MossdeepCity_SpaceCenter_1F_Movement_2232A2 applymovement 9, MossdeepCity_SpaceCenter_1F_Movement_2232A2
waitmovement 0 waitmovement 0
setvar VAR_MOSSDEEP_SPACE_CENTER_STATE_1, 2 setvar VAR_MOSSDEEP_SPACE_CENTER_STATE_1, 2
@@ -194,7 +194,7 @@ MossdeepCity_SpaceCenter_2F_EventScript_223F7A:: @ 8223F7A
delay 30 delay 30
playse SE_KOUKA_L playse SE_KOUKA_L
switch VAR_FACING switch VAR_FACING
case 1, MossdeepCity_SpaceCenter_2F_EventScript_223FBA case DIR_SOUTH, MossdeepCity_SpaceCenter_2F_EventScript_223FBA
applymovement 4, MossdeepCity_SpaceCenter_2F_Movement_223FC6 applymovement 4, MossdeepCity_SpaceCenter_2F_Movement_223FC6
waitmovement 0 waitmovement 0
releaseall releaseall
@@ -326,8 +326,8 @@ MossdeepCity_SpaceCenter_2F_EventScript_224071:: @ 8224071
MossdeepCity_SpaceCenter_2F_EventScript_224131:: @ 8224131 MossdeepCity_SpaceCenter_2F_EventScript_224131:: @ 8224131
switch VAR_FACING switch VAR_FACING
case 1, MossdeepCity_SpaceCenter_2F_EventScript_22414D case DIR_SOUTH, MossdeepCity_SpaceCenter_2F_EventScript_22414D
case 3, MossdeepCity_SpaceCenter_2F_EventScript_224152 case DIR_WEST, MossdeepCity_SpaceCenter_2F_EventScript_224152
return return
MossdeepCity_SpaceCenter_2F_EventScript_22414D:: @ 822414D MossdeepCity_SpaceCenter_2F_EventScript_22414D:: @ 822414D
+4 -4
View File
@@ -56,17 +56,17 @@ MtChimney_EventScript_22EE0B:: @ 822EE0B
fadescreen 0 fadescreen 0
setobjectxyperm 1, 10, 12 setobjectxyperm 1, 10, 12
addobject 1 addobject 1
compare VAR_FACING, 4 compare VAR_FACING, DIR_EAST
call_if_eq MtChimney_EventScript_22EEC7 call_if_eq MtChimney_EventScript_22EEC7
compare VAR_FACING, 2 compare VAR_FACING, DIR_NORTH
call_if_eq MtChimney_EventScript_22EED2 call_if_eq MtChimney_EventScript_22EED2
applymovement EVENT_OBJ_ID_PLAYER, Common_Movement_WalkInPlaceFastestLeft applymovement EVENT_OBJ_ID_PLAYER, Common_Movement_WalkInPlaceFastestLeft
waitmovement 0 waitmovement 0
msgbox MtChimney_Text_22FC3D, MSGBOX_DEFAULT msgbox MtChimney_Text_22FC3D, MSGBOX_DEFAULT
closemessage closemessage
compare VAR_FACING, 4 compare VAR_FACING, DIR_EAST
call_if_eq MtChimney_EventScript_22EEDD call_if_eq MtChimney_EventScript_22EEDD
compare VAR_FACING, 2 compare VAR_FACING, DIR_NORTH
call_if_eq MtChimney_EventScript_22EEE8 call_if_eq MtChimney_EventScript_22EEE8
removeobject 1 removeobject 1
setflag FLAG_HIDE_MT_CHIMNEY_TEAM_AQUA setflag FLAG_HIDE_MT_CHIMNEY_TEAM_AQUA
+4 -4
View File
@@ -42,9 +42,9 @@ OldaleTown_EventScript_1E8EFC:: @ 81E8EFC
msgbox OldaleTown_Text_1E91C0, MSGBOX_DEFAULT msgbox OldaleTown_Text_1E91C0, MSGBOX_DEFAULT
closemessage closemessage
switch VAR_FACING switch VAR_FACING
case 1, OldaleTown_EventScript_1E8F47 case DIR_SOUTH, OldaleTown_EventScript_1E8F47
case 2, OldaleTown_EventScript_1E8F5E case DIR_NORTH, OldaleTown_EventScript_1E8F5E
case 4, OldaleTown_EventScript_1E8F75 case DIR_EAST, OldaleTown_EventScript_1E8F75
end end
OldaleTown_EventScript_1E8F47:: @ 81E8F47 OldaleTown_EventScript_1E8F47:: @ 81E8F47
@@ -286,7 +286,7 @@ OldaleTown_EventScript_1E911A:: @ 81E911A
end end
OldaleTown_EventScript_1E9148:: @ 81E9148 OldaleTown_EventScript_1E9148:: @ 81E9148
compare VAR_FACING, 1 compare VAR_FACING, DIR_SOUTH
goto_if_ne OldaleTown_EventScript_1E915E goto_if_ne OldaleTown_EventScript_1E915E
applymovement 4, OldaleTown_Movement_1E9177 applymovement 4, OldaleTown_Movement_1E9177
waitmovement 0 waitmovement 0
+7 -7
View File
@@ -125,10 +125,10 @@ PetalburgCity_Gym_EventScript_2049F1:: @ 82049F1
msgbox PetalburgCity_Gym_Text_2057A2, MSGBOX_DEFAULT msgbox PetalburgCity_Gym_Text_2057A2, MSGBOX_DEFAULT
closemessage closemessage
switch VAR_FACING switch VAR_FACING
case 1, PetalburgCity_Gym_EventScript_204A80 case DIR_SOUTH, PetalburgCity_Gym_EventScript_204A80
case 2, PetalburgCity_Gym_EventScript_204A8B case DIR_NORTH, PetalburgCity_Gym_EventScript_204A8B
case 3, PetalburgCity_Gym_EventScript_204A96 case DIR_WEST, PetalburgCity_Gym_EventScript_204A96
case 4, PetalburgCity_Gym_EventScript_204AA1 case DIR_EAST, PetalburgCity_Gym_EventScript_204AA1
end end
PetalburgCity_Gym_EventScript_204A80:: @ 8204A80 PetalburgCity_Gym_EventScript_204A80:: @ 8204A80
@@ -436,9 +436,9 @@ PetalburgCity_Gym_EventScript_204E3B:: @ 8204E3B
delay 10 delay 10
addobject 11 addobject 11
switch VAR_FACING switch VAR_FACING
case 2, PetalburgCity_Gym_EventScript_204EF5 case DIR_NORTH, PetalburgCity_Gym_EventScript_204EF5
case 3, PetalburgCity_Gym_EventScript_204F09 case DIR_WEST, PetalburgCity_Gym_EventScript_204F09
case 4, PetalburgCity_Gym_EventScript_204EFF case DIR_EAST, PetalburgCity_Gym_EventScript_204EFF
end end
PetalburgCity_Gym_EventScript_204ED2:: @ 8204ED2 PetalburgCity_Gym_EventScript_204ED2:: @ 8204ED2
+4 -4
View File
@@ -103,10 +103,10 @@ Route103_EventScript_1EC4FC:: @ 81EC4FC
Route103_EventScript_1EC50A:: @ 81EC50A Route103_EventScript_1EC50A:: @ 81EC50A
closemessage closemessage
switch VAR_FACING switch VAR_FACING
case 1, Route103_EventScript_1EC585 case DIR_SOUTH, Route103_EventScript_1EC585
case 2, Route103_EventScript_1EC53D case DIR_NORTH, Route103_EventScript_1EC53D
case 3, Route103_EventScript_1EC561 case DIR_WEST, Route103_EventScript_1EC561
case 4, Route103_EventScript_1EC561 case DIR_EAST, Route103_EventScript_1EC561
end end
Route103_EventScript_1EC53D:: @ 81EC53D Route103_EventScript_1EC53D:: @ 81EC53D
+3 -3
View File
@@ -9,9 +9,9 @@ Route109_EventScript_1EE760:: @ 81EE760
waitmovement 0 waitmovement 0
removeobject 2 removeobject 2
switch VAR_FACING switch VAR_FACING
case 1, Route109_EventScript_1EE7A5 case DIR_SOUTH, Route109_EventScript_1EE7A5
case 3, Route109_EventScript_1EE7C5 case DIR_WEST, Route109_EventScript_1EE7C5
case 4, Route109_EventScript_1EE7B5 case DIR_EAST, Route109_EventScript_1EE7B5
end end
Route109_EventScript_1EE7A5:: @ 81EE7A5 Route109_EventScript_1EE7A5:: @ 81EE7A5
+4 -4
View File
@@ -150,13 +150,13 @@ Route110_TrickHouseEnd_EventScript_26AEEC:: @ 826AEEC
Route110_TrickHouseEnd_EventScript_26AF28:: @ 826AF28 Route110_TrickHouseEnd_EventScript_26AF28:: @ 826AF28
msgbox Route110_TrickHouseEnd_Text_26B3AB, MSGBOX_DEFAULT msgbox Route110_TrickHouseEnd_Text_26B3AB, MSGBOX_DEFAULT
closemessage closemessage
compare VAR_FACING, 1 compare VAR_FACING, DIR_SOUTH
call_if_eq Route110_TrickHouseEnd_EventScript_26B015 call_if_eq Route110_TrickHouseEnd_EventScript_26B015
compare VAR_FACING, 2 compare VAR_FACING, DIR_NORTH
call_if_eq Route110_TrickHouseEnd_EventScript_26B020 call_if_eq Route110_TrickHouseEnd_EventScript_26B020
compare VAR_FACING, 3 compare VAR_FACING, DIR_WEST
call_if_eq Route110_TrickHouseEnd_EventScript_26B02B call_if_eq Route110_TrickHouseEnd_EventScript_26B02B
compare VAR_FACING, 4 compare VAR_FACING, DIR_EAST
call_if_eq Route110_TrickHouseEnd_EventScript_26B036 call_if_eq Route110_TrickHouseEnd_EventScript_26B036
delay 30 delay 30
msgbox Route110_TrickHouseEnd_Text_26B3FA, MSGBOX_DEFAULT msgbox Route110_TrickHouseEnd_Text_26B3FA, MSGBOX_DEFAULT
+8 -8
View File
@@ -63,13 +63,13 @@ Route116_EventScript_1F2CBB:: @ 81F2CBB
goto_if_eq Route116_EventScript_1F2D39 goto_if_eq Route116_EventScript_1F2D39
msgbox Route116_Text_1F3521, MSGBOX_DEFAULT msgbox Route116_Text_1F3521, MSGBOX_DEFAULT
closemessage closemessage
compare VAR_FACING, 2 compare VAR_FACING, DIR_NORTH
call_if_eq Route116_EventScript_1F2D15 call_if_eq Route116_EventScript_1F2D15
compare VAR_FACING, 1 compare VAR_FACING, DIR_SOUTH
call_if_eq Route116_EventScript_1F2D15 call_if_eq Route116_EventScript_1F2D15
compare VAR_FACING, 3 compare VAR_FACING, DIR_WEST
call_if_eq Route116_EventScript_1F2D15 call_if_eq Route116_EventScript_1F2D15
compare VAR_FACING, 4 compare VAR_FACING, DIR_EAST
call_if_eq Route116_EventScript_1F2D20 call_if_eq Route116_EventScript_1F2D20
removeobject VAR_LAST_TALKED removeobject VAR_LAST_TALKED
clearflag FLAG_HIDE_RUSTBORO_CITY_DEVON_CORP_3F_EMPLOYEE clearflag FLAG_HIDE_RUSTBORO_CITY_DEVON_CORP_3F_EMPLOYEE
@@ -196,13 +196,13 @@ Route116_EventScript_1F2E1B:: @ 81F2E1B
Route116_EventScript_1F2E2A:: @ 81F2E2A Route116_EventScript_1F2E2A:: @ 81F2E2A
delay 20 delay 20
compare VAR_FACING, 2 compare VAR_FACING, DIR_NORTH
call_if_eq Route116_EventScript_1F2E5E call_if_eq Route116_EventScript_1F2E5E
compare VAR_FACING, 1 compare VAR_FACING, DIR_SOUTH
call_if_eq Route116_EventScript_1F2E5E call_if_eq Route116_EventScript_1F2E5E
compare VAR_FACING, 3 compare VAR_FACING, DIR_WEST
call_if_eq Route116_EventScript_1F2E5E call_if_eq Route116_EventScript_1F2E5E
compare VAR_FACING, 4 compare VAR_FACING, DIR_EAST
call_if_eq Route116_EventScript_1F2E69 call_if_eq Route116_EventScript_1F2E69
removeobject VAR_LAST_TALKED removeobject VAR_LAST_TALKED
release release
@@ -78,9 +78,9 @@ RustboroCity_PokemonSchool_EventScript_213F95:: @ 8213F95
lock lock
faceplayer faceplayer
goto_if_set FLAG_RECEIVED_QUICK_CLAW, RustboroCity_PokemonSchool_EventScript_213FFB goto_if_set FLAG_RECEIVED_QUICK_CLAW, RustboroCity_PokemonSchool_EventScript_213FFB
compare VAR_FACING, 4 compare VAR_FACING, DIR_EAST
call_if_eq RustboroCity_PokemonSchool_EventScript_213FE5 call_if_eq RustboroCity_PokemonSchool_EventScript_213FE5
compare VAR_FACING, 3 compare VAR_FACING, DIR_WEST
call_if_eq RustboroCity_PokemonSchool_EventScript_213FF0 call_if_eq RustboroCity_PokemonSchool_EventScript_213FF0
msgbox RustboroCity_PokemonSchool_Text_214433, MSGBOX_DEFAULT msgbox RustboroCity_PokemonSchool_Text_214433, MSGBOX_DEFAULT
giveitem_std ITEM_QUICK_CLAW giveitem_std ITEM_QUICK_CLAW
+2 -2
View File
@@ -69,8 +69,8 @@ SafariZone_South_EventScript_23D31A:: @ 823D31A
msgbox SafariZone_South_Text_2A5248, MSGBOX_DEFAULT msgbox SafariZone_South_Text_2A5248, MSGBOX_DEFAULT
closemessage closemessage
switch VAR_FACING switch VAR_FACING
case 2, SafariZone_South_EventScript_23D33F case DIR_NORTH, SafariZone_South_EventScript_23D33F
case 4, SafariZone_South_EventScript_23D359 case DIR_EAST, SafariZone_South_EventScript_23D359
end end
SafariZone_South_EventScript_23D33F:: @ 823D33F SafariZone_South_EventScript_23D33F:: @ 823D33F
@@ -18,11 +18,11 @@ SeafloorCavern_Entrance_EventScript_234485:: @ 8234485
applymovement 1, Common_Movement_Delay48 applymovement 1, Common_Movement_Delay48
waitmovement 0 waitmovement 0
delay 20 delay 20
compare VAR_FACING, 3 compare VAR_FACING, DIR_WEST
call_if_eq SeafloorCavern_Entrance_EventScript_23452E call_if_eq SeafloorCavern_Entrance_EventScript_23452E
compare VAR_FACING, 4 compare VAR_FACING, DIR_EAST
call_if_eq SeafloorCavern_Entrance_EventScript_234523 call_if_eq SeafloorCavern_Entrance_EventScript_234523
compare VAR_FACING, 2 compare VAR_FACING, DIR_NORTH
call_if_eq SeafloorCavern_Entrance_EventScript_234539 call_if_eq SeafloorCavern_Entrance_EventScript_234539
delay 30 delay 30
setvar VAR_HAS_TALKED_TO_SEAFLOOR_CAVERN_ENTRANCE_GRUNT, 1 setvar VAR_HAS_TALKED_TO_SEAFLOOR_CAVERN_ENTRANCE_GRUNT, 1
@@ -35,11 +35,11 @@ SeafloorCavern_Entrance_EventScript_234485:: @ 8234485
end end
SeafloorCavern_Entrance_EventScript_2344ED:: @ 82344ED SeafloorCavern_Entrance_EventScript_2344ED:: @ 82344ED
compare VAR_FACING, 3 compare VAR_FACING, DIR_WEST
call_if_eq SeafloorCavern_Entrance_EventScript_23452E call_if_eq SeafloorCavern_Entrance_EventScript_23452E
compare VAR_FACING, 4 compare VAR_FACING, DIR_EAST
call_if_eq SeafloorCavern_Entrance_EventScript_234523 call_if_eq SeafloorCavern_Entrance_EventScript_234523
compare VAR_FACING, 2 compare VAR_FACING, DIR_NORTH
call_if_eq SeafloorCavern_Entrance_EventScript_234539 call_if_eq SeafloorCavern_Entrance_EventScript_234539
msgbox SeafloorCavern_Entrance_Text_2346C8, MSGBOX_DEFAULT msgbox SeafloorCavern_Entrance_Text_2346C8, MSGBOX_DEFAULT
closemessage closemessage
+2 -2
View File
@@ -230,9 +230,9 @@ SlateportCity_Harbor_EventScript_20CBE9:: @ 820CBE9
waitmovement 0 waitmovement 0
delay 30 delay 30
hideobjectat VAR_LAST_TALKED, MAP_SLATEPORT_CITY_HARBOR hideobjectat VAR_LAST_TALKED, MAP_SLATEPORT_CITY_HARBOR
compare VAR_FACING, 2 compare VAR_FACING, DIR_NORTH
call_if_eq SlateportCity_Harbor_EventScript_20CC42 call_if_eq SlateportCity_Harbor_EventScript_20CC42
compare VAR_FACING, 4 compare VAR_FACING, DIR_EAST
call_if_eq SlateportCity_Harbor_EventScript_20CC37 call_if_eq SlateportCity_Harbor_EventScript_20CC37
delay 30 delay 30
hideobjectat EVENT_OBJ_ID_PLAYER, MAP_PETALBURG_CITY hideobjectat EVENT_OBJ_ID_PLAYER, MAP_PETALBURG_CITY
@@ -165,13 +165,13 @@ SlateportCity_OceanicMuseum_1F_EventScript_20AEF8:: @ 820AEF8
setflag FLAG_RECEIVED_TM46 setflag FLAG_RECEIVED_TM46
msgbox SlateportCity_OceanicMuseum_1F_Text_20B449, MSGBOX_DEFAULT msgbox SlateportCity_OceanicMuseum_1F_Text_20B449, MSGBOX_DEFAULT
closemessage closemessage
compare VAR_FACING, 2 compare VAR_FACING, DIR_NORTH
goto_if_eq SlateportCity_OceanicMuseum_1F_EventScript_20AF6C goto_if_eq SlateportCity_OceanicMuseum_1F_EventScript_20AF6C
compare VAR_FACING, 1 compare VAR_FACING, DIR_SOUTH
goto_if_eq SlateportCity_OceanicMuseum_1F_EventScript_20AF83 goto_if_eq SlateportCity_OceanicMuseum_1F_EventScript_20AF83
compare VAR_FACING, 3 compare VAR_FACING, DIR_WEST
goto_if_eq SlateportCity_OceanicMuseum_1F_EventScript_20AF93 goto_if_eq SlateportCity_OceanicMuseum_1F_EventScript_20AF93
compare VAR_FACING, 4 compare VAR_FACING, DIR_EAST
goto_if_eq SlateportCity_OceanicMuseum_1F_EventScript_20AF93 goto_if_eq SlateportCity_OceanicMuseum_1F_EventScript_20AF93
end end
@@ -16,21 +16,21 @@ SlateportCity_OceanicMuseum_2F_EventScript_20BB00:: @ 820BB00
applymovement 3, SlateportCity_OceanicMuseum_2F_Movement_20BCE8 applymovement 3, SlateportCity_OceanicMuseum_2F_Movement_20BCE8
applymovement 4, SlateportCity_OceanicMuseum_2F_Movement_20BCF5 applymovement 4, SlateportCity_OceanicMuseum_2F_Movement_20BCF5
waitmovement 0 waitmovement 0
compare VAR_FACING, 1 compare VAR_FACING, DIR_SOUTH
call_if_eq SlateportCity_OceanicMuseum_2F_EventScript_20BC92 call_if_eq SlateportCity_OceanicMuseum_2F_EventScript_20BC92
compare VAR_FACING, 4 compare VAR_FACING, DIR_EAST
call_if_eq SlateportCity_OceanicMuseum_2F_EventScript_20BC92 call_if_eq SlateportCity_OceanicMuseum_2F_EventScript_20BC92
msgbox SlateportCity_OceanicMuseum_2F_Text_20BE40, MSGBOX_DEFAULT msgbox SlateportCity_OceanicMuseum_2F_Text_20BE40, MSGBOX_DEFAULT
compare VAR_FACING, 4 compare VAR_FACING, DIR_EAST
call_if_ne SlateportCity_OceanicMuseum_2F_EventScript_20BC9D call_if_ne SlateportCity_OceanicMuseum_2F_EventScript_20BC9D
msgbox SlateportCity_OceanicMuseum_2F_Text_20BE69, MSGBOX_DEFAULT msgbox SlateportCity_OceanicMuseum_2F_Text_20BE69, MSGBOX_DEFAULT
msgbox SlateportCity_OceanicMuseum_2F_Text_20BE93, MSGBOX_DEFAULT msgbox SlateportCity_OceanicMuseum_2F_Text_20BE93, MSGBOX_DEFAULT
closemessage closemessage
applymovement 4, SlateportCity_OceanicMuseum_2F_Movement_20BCE2 applymovement 4, SlateportCity_OceanicMuseum_2F_Movement_20BCE2
waitmovement 0 waitmovement 0
compare VAR_FACING, 1 compare VAR_FACING, DIR_SOUTH
call_if_eq SlateportCity_OceanicMuseum_2F_EventScript_20BCA8 call_if_eq SlateportCity_OceanicMuseum_2F_EventScript_20BCA8
compare VAR_FACING, 3 compare VAR_FACING, DIR_WEST
call_if_eq SlateportCity_OceanicMuseum_2F_EventScript_20BCB3 call_if_eq SlateportCity_OceanicMuseum_2F_EventScript_20BCB3
trainerbattle_no_intro TRAINER_GRUNT_14, SlateportCity_OceanicMuseum_2F_Text_20BEE2 trainerbattle_no_intro TRAINER_GRUNT_14, SlateportCity_OceanicMuseum_2F_Text_20BEE2
msgbox SlateportCity_OceanicMuseum_2F_Text_20BEFA, MSGBOX_DEFAULT msgbox SlateportCity_OceanicMuseum_2F_Text_20BEFA, MSGBOX_DEFAULT
+5 -5
View File
@@ -959,9 +959,9 @@ SootopolisCity_EventScript_1E61C2:: @ 81E61C2
SootopolisCity_EventScript_1E61CC:: @ 81E61CC SootopolisCity_EventScript_1E61CC:: @ 81E61CC
msgbox SootopolisCity_Text_1E75CB, MSGBOX_DEFAULT msgbox SootopolisCity_Text_1E75CB, MSGBOX_DEFAULT
closemessage closemessage
compare VAR_FACING, 3 compare VAR_FACING, DIR_WEST
call_if_eq SootopolisCity_EventScript_1E6243 call_if_eq SootopolisCity_EventScript_1E6243
compare VAR_FACING, 2 compare VAR_FACING, DIR_NORTH
call_if_eq SootopolisCity_EventScript_1E6255 call_if_eq SootopolisCity_EventScript_1E6255
msgbox SootopolisCity_Text_1E7737, MSGBOX_DEFAULT msgbox SootopolisCity_Text_1E7737, MSGBOX_DEFAULT
closemessage closemessage
@@ -1354,11 +1354,11 @@ SootopolisCity_EventScript_1E646F:: @ 81E646F
setflag FLAG_RECEIVED_HM07 setflag FLAG_RECEIVED_HM07
msgbox SootopolisCity_Text_1E7B86, MSGBOX_DEFAULT msgbox SootopolisCity_Text_1E7B86, MSGBOX_DEFAULT
closemessage closemessage
compare VAR_FACING, 2 compare VAR_FACING, DIR_NORTH
call_if_eq SootopolisCity_EventScript_1E64B2 call_if_eq SootopolisCity_EventScript_1E64B2
compare VAR_FACING, 4 compare VAR_FACING, DIR_EAST
call_if_eq SootopolisCity_EventScript_1E64B2 call_if_eq SootopolisCity_EventScript_1E64B2
compare VAR_FACING, 3 compare VAR_FACING, DIR_WEST
call_if_eq SootopolisCity_EventScript_1E64C5 call_if_eq SootopolisCity_EventScript_1E64C5
release release
end end
@@ -109,11 +109,11 @@ SootopolisCity_MysteryEventsHouse_1F_EventScript_227A58:: @ 8227A58
special ReducePlayerPartyToSelectedMons special ReducePlayerPartyToSelectedMons
msgbox SootopolisCity_MysteryEventsHouse_1F_Text_227D21, MSGBOX_DEFAULT msgbox SootopolisCity_MysteryEventsHouse_1F_Text_227D21, MSGBOX_DEFAULT
closemessage closemessage
compare VAR_FACING, 2 compare VAR_FACING, DIR_NORTH
call_if_eq SootopolisCity_MysteryEventsHouse_1F_EventScript_227AFE call_if_eq SootopolisCity_MysteryEventsHouse_1F_EventScript_227AFE
compare VAR_FACING, 4 compare VAR_FACING, DIR_EAST
call_if_eq SootopolisCity_MysteryEventsHouse_1F_EventScript_227B10 call_if_eq SootopolisCity_MysteryEventsHouse_1F_EventScript_227B10
compare VAR_FACING, 3 compare VAR_FACING, DIR_WEST
call_if_eq SootopolisCity_MysteryEventsHouse_1F_EventScript_227B22 call_if_eq SootopolisCity_MysteryEventsHouse_1F_EventScript_227B22
warp MAP_SOOTOPOLIS_CITY_MYSTERY_EVENTS_HOUSE_B1F, 255, 3, 1 warp MAP_SOOTOPOLIS_CITY_MYSTERY_EVENTS_HOUSE_B1F, 255, 3, 1
waitstate waitstate
+7 -7
View File
@@ -74,7 +74,7 @@ Script_Apprentice_FirstMeetingNag:
release release
releaseall releaseall
switch VAR_FACING switch VAR_FACING
case 2, Script_Apprentice_LeaveGoRight case DIR_NORTH, Script_Apprentice_LeaveGoRight
goto Script_Apprentice_Leave goto Script_Apprentice_Leave
end end
@@ -117,7 +117,7 @@ BattleFrontier_BattleTowerLobby_EventScript_2B69D3:
release release
releaseall releaseall
switch VAR_FACING switch VAR_FACING
case 2, Script_Apprentice_LeaveGoRight case DIR_NORTH, Script_Apprentice_LeaveGoRight
goto Script_Apprentice_Leave goto Script_Apprentice_Leave
end end
@@ -163,7 +163,7 @@ BattleFrontier_BattleTowerLobby_EventScript_2B6B09:
release release
releaseall releaseall
switch VAR_FACING switch VAR_FACING
case 2, Script_Apprentice_LeaveGoRight case DIR_NORTH, Script_Apprentice_LeaveGoRight
goto Script_Apprentice_Leave goto Script_Apprentice_Leave
end end
@@ -187,7 +187,7 @@ BattleFrontier_BattleTowerLobby_EventScript_2B6BD4:
release release
releaseall releaseall
switch VAR_FACING switch VAR_FACING
case 2, Script_Apprentice_LeaveGoRight case DIR_NORTH, Script_Apprentice_LeaveGoRight
goto Script_Apprentice_Leave goto Script_Apprentice_Leave
end end
@@ -235,7 +235,7 @@ BattleFrontier_BattleTowerLobby_EventScript_2B6C77:
release release
releaseall releaseall
switch VAR_FACING switch VAR_FACING
case 2, Script_Apprentice_LeaveGoRight case DIR_NORTH, Script_Apprentice_LeaveGoRight
goto Script_Apprentice_Leave goto Script_Apprentice_Leave
end end
@@ -261,7 +261,7 @@ BattleFrontier_BattleTowerLobby_EventScript_2B6D5C:
release release
releaseall releaseall
switch VAR_FACING switch VAR_FACING
case 2, Script_Apprentice_LeaveGoRight case DIR_NORTH, Script_Apprentice_LeaveGoRight
goto Script_Apprentice_Leave goto Script_Apprentice_Leave
end end
@@ -283,7 +283,7 @@ BattleFrontier_BattleTowerLobby_EventScript_2B6DD4:
release release
releaseall releaseall
switch VAR_FACING switch VAR_FACING
case 2, Script_Apprentice_LeaveGoRight case DIR_NORTH, Script_Apprentice_LeaveGoRight
goto Script_Apprentice_Leave goto Script_Apprentice_Leave
end end
+6 -6
View File
@@ -214,11 +214,11 @@ Route120_EventScript_28CF36:: @ 828CF36
Route111_EventScript_28CF56:: @ 828CF56 Route111_EventScript_28CF56:: @ 828CF56
special GabbyAndTyBeforeInterview special GabbyAndTyBeforeInterview
special GabbyAndTySetScriptVarsToEventObjectLocalIds special GabbyAndTySetScriptVarsToEventObjectLocalIds
compare VAR_FACING, 2 compare VAR_FACING, DIR_NORTH
call_if_eq Route111_EventScript_28CF94 call_if_eq Route111_EventScript_28CF94
compare VAR_FACING, 1 compare VAR_FACING, DIR_SOUTH
call_if_eq Route111_EventScript_28CF9F call_if_eq Route111_EventScript_28CF9F
compare VAR_FACING, 4 compare VAR_FACING, DIR_EAST
call_if_eq Route111_EventScript_28CFB1 call_if_eq Route111_EventScript_28CFB1
goto_if_set FLAG_TEMP_1, Route111_EventScript_28D0EE goto_if_set FLAG_TEMP_1, Route111_EventScript_28D0EE
msgbox Route111_Text_28B042, MSGBOX_YESNO msgbox Route111_Text_28B042, MSGBOX_YESNO
@@ -247,11 +247,11 @@ Route118_EventScript_28CFC3:: @ 828CFC3
Route120_EventScript_28CFC3:: @ 828CFC3 Route120_EventScript_28CFC3:: @ 828CFC3
special GabbyAndTyBeforeInterview special GabbyAndTyBeforeInterview
special GabbyAndTySetScriptVarsToEventObjectLocalIds special GabbyAndTySetScriptVarsToEventObjectLocalIds
compare VAR_FACING, 2 compare VAR_FACING, DIR_NORTH
call_if_eq Route111_EventScript_28CF94 call_if_eq Route111_EventScript_28CF94
compare VAR_FACING, 1 compare VAR_FACING, DIR_SOUTH
call_if_eq Route111_EventScript_28CF9F call_if_eq Route111_EventScript_28CF9F
compare VAR_FACING, 4 compare VAR_FACING, DIR_EAST
call_if_eq Route111_EventScript_28CFB1 call_if_eq Route111_EventScript_28CFB1
goto_if_set FLAG_TEMP_1, Route111_EventScript_28D0EE goto_if_set FLAG_TEMP_1, Route111_EventScript_28D0EE
specialvar VAR_RESULT, GabbyAndTyGetLastQuote specialvar VAR_RESULT, GabbyAndTyGetLastQuote
+3 -3
View File
@@ -51,11 +51,11 @@ Route111_EventScript_27661E:: @ 827661E
closemessage closemessage
setflag FLAG_RECEIVED_SECRET_POWER setflag FLAG_RECEIVED_SECRET_POWER
clearflag FLAG_HIDE_SLATEPORT_CITY_TM_SALESMAN clearflag FLAG_HIDE_SLATEPORT_CITY_TM_SALESMAN
compare VAR_FACING, 3 compare VAR_FACING, DIR_WEST
call_if_eq Route111_EventScript_27666A call_if_eq Route111_EventScript_27666A
compare VAR_FACING, 4 compare VAR_FACING, DIR_EAST
call_if_eq Route111_EventScript_27666A call_if_eq Route111_EventScript_27666A
compare VAR_FACING, 2 compare VAR_FACING, DIR_NORTH
call_if_eq Route111_EventScript_276675 call_if_eq Route111_EventScript_276675
removeobject VAR_LAST_TALKED removeobject VAR_LAST_TALKED
release release
@@ -179,8 +179,8 @@
#define MOVEMENT_ACTION_CLEAR_FIXED_PRIORITY 0x5D #define MOVEMENT_ACTION_CLEAR_FIXED_PRIORITY 0x5D
#define MOVEMENT_ACTION_INIT_AFFINE_ANIM 0x5E #define MOVEMENT_ACTION_INIT_AFFINE_ANIM 0x5E
#define MOVEMENT_ACTION_CLEAR_AFFINE_ANIM 0x5F #define MOVEMENT_ACTION_CLEAR_AFFINE_ANIM 0x5F
#define MOVEMENT_ACTION_UNKNOWN1 0x60 #define MOVEMENT_ACTION_HIDE_REFLECTION 0x60
#define MOVEMENT_ACTION_UNKNOWN2 0x61 #define MOVEMENT_ACTION_SHOW_REFLECTION 0x61
#define MOVEMENT_ACTION_WALK_DOWN_START_AFFINE 0x62 #define MOVEMENT_ACTION_WALK_DOWN_START_AFFINE 0x62
#define MOVEMENT_ACTION_WALK_DOWN_AFFINE 0x63 #define MOVEMENT_ACTION_WALK_DOWN_AFFINE 0x63
#define MOVEMENT_ACTION_ACRO_WHEELIE_FACE_DOWN 0x64 #define MOVEMENT_ACTION_ACRO_WHEELIE_FACE_DOWN 0x64
+23 -18
View File
@@ -65,7 +65,7 @@ struct EventObjectTemplate
/*0x0E*/ u16 trainerRange_berryTreeId; /*0x0E*/ u16 trainerRange_berryTreeId;
/*0x10*/ const u8 *script; /*0x10*/ const u8 *script;
/*0x14*/ u16 flagId; /*0x14*/ u16 flagId;
}; /*size = 0x18*/ };
struct WarpEvent struct WarpEvent
{ {
@@ -82,7 +82,6 @@ struct CoordEvent
u8 elevation; u8 elevation;
u16 trigger; u16 trigger;
u16 index; u16 index;
u8 filler_A[0x2];
u8 *script; u8 *script;
}; };
@@ -90,20 +89,14 @@ struct BgEvent
{ {
u16 x, y; u16 x, y;
u8 elevation; u8 elevation;
u8 kind; u8 kind; // The "kind" field determines how to access bgUnion union below.
union { // carried over from diego's FR/LG work, seems to be the same struct union {
// in gen 3, "kind" (0x3 in BgEvent struct) determines the method to read the union.
u8 *script; u8 *script;
// hidden item type
struct { struct {
u16 item; u16 item;
u16 hiddenItemId; // flag offset to determine flag lookup u16 hiddenItemId;
} hiddenItem; } hiddenItem;
// secret base type
u32 secretBaseId; u32 secretBaseId;
} bgUnion; } bgUnion;
}; };
@@ -113,7 +106,6 @@ struct MapEvents
u8 warpCount; u8 warpCount;
u8 coordEventCount; u8 coordEventCount;
u8 bgEventCount; u8 bgEventCount;
struct EventObjectTemplate *eventObjects; struct EventObjectTemplate *eventObjects;
struct WarpEvent *warps; struct WarpEvent *warps;
struct CoordEvent *coordEvents; struct CoordEvent *coordEvents;
@@ -122,10 +114,10 @@ struct MapEvents
struct MapConnection struct MapConnection
{ {
/*0x00*/ u8 direction; u8 direction;
/*0x01*/ u32 offset; u32 offset;
/*0x05*/ u8 mapGroup; u8 mapGroup;
/*0x06*/ u8 mapNum; u8 mapNum;
}; };
struct MapConnections struct MapConnections
@@ -180,7 +172,7 @@ struct EventObject
/*0x03*/ u32 spriteAffineAnimPausedBackup:1; /*0x03*/ u32 spriteAffineAnimPausedBackup:1;
u32 disableJumpLandingGroundEffect:1; u32 disableJumpLandingGroundEffect:1;
u32 fixedPriority:1; u32 fixedPriority:1;
u32 unk3_3:1; u32 hideReflection:1;
/*0x04*/ u8 spriteId; /*0x04*/ u8 spriteId;
/*0x05*/ u8 graphicsId; /*0x05*/ u8 graphicsId;
/*0x06*/ u8 movementType; /*0x06*/ u8 movementType;
@@ -267,7 +259,20 @@ enum
enum enum
{ {
COLLISION_LEDGE_JUMP = 6 COLLISION_NONE,
COLLISION_OUTSIDE_RANGE,
COLLISION_IMPASSABLE,
COLLISION_ELEVATION_MISMATCH,
COLLISION_EVENT_OBJECT,
COLLISION_STOP_SURFING,
COLLISION_LEDGE_JUMP,
COLLISION_PUSHED_BOULDER,
COLLISION_ROTATING_GATE,
COLLISION_WHEELIE_HOP,
COLLISION_ISOLATED_VERTICAL_RAIL,
COLLISION_ISOLATED_HORIZONTAL_RAIL,
COLLISION_VERTICAL_RAIL,
COLLISION_HORIZONTAL_RAIL,
}; };
// player running states // player running states
+47 -50
View File
@@ -45,8 +45,8 @@ static u8 AcroBike_GetJumpDirection(void);
static void Bike_UpdateDirTimerHistory(u8); static void Bike_UpdateDirTimerHistory(u8);
static void Bike_UpdateABStartSelectHistory(u8); static void Bike_UpdateABStartSelectHistory(u8);
static u8 Bike_DPadToDirection(u16); static u8 Bike_DPadToDirection(u16);
static u8 get_some_collision(u8); static u8 GetBikeCollision(u8);
static u8 Bike_CheckCollisionTryAdvanceCollisionCount(struct EventObject *, s16, s16, u8, u8); static u8 GetBikeCollisionAt(struct EventObject *, s16, s16, u8, u8);
static bool8 IsRunningDisallowedByMetatile(u8); static bool8 IsRunningDisallowedByMetatile(u8);
static void Bike_TryAdvanceCyclingRoadCollisions(); static void Bike_TryAdvanceCyclingRoadCollisions();
static u8 CanBikeFaceDirOnMetatile(u8, u8); static u8 CanBikeFaceDirOnMetatile(u8, u8);
@@ -214,8 +214,8 @@ static void MachBikeTransition_TrySpeedUp(u8 direction)
} }
else else
{ {
collision = get_some_collision(direction); collision = GetBikeCollision(direction);
if (collision > 0 && collision < 12) if (collision > 0 && collision < COLLISION_VERTICAL_RAIL)
{ {
// we hit a solid object, but check to see if its a ledge and then jump. // we hit a solid object, but check to see if its a ledge and then jump.
if (collision == COLLISION_LEDGE_JUMP) if (collision == COLLISION_LEDGE_JUMP)
@@ -226,9 +226,9 @@ static void MachBikeTransition_TrySpeedUp(u8 direction)
{ {
// we hit a solid object that is not a ledge, so perform the collision. // we hit a solid object that is not a ledge, so perform the collision.
Bike_SetBikeStill(); Bike_SetBikeStill();
if (collision == 4 && IsPlayerCollidingWithFarawayIslandMew(direction)) if (collision == COLLISION_EVENT_OBJECT && IsPlayerCollidingWithFarawayIslandMew(direction))
PlayerOnBikeCollideWithFarawayIslandMew(direction); PlayerOnBikeCollideWithFarawayIslandMew(direction);
else if (collision < 5 || collision > 8) else if (collision < COLLISION_STOP_SURFING || collision > COLLISION_ROTATING_GATE)
PlayerOnBikeCollide(direction); PlayerOnBikeCollide(direction);
} }
} }
@@ -250,9 +250,9 @@ static void MachBikeTransition_TrySlowDown(u8 direction)
if (gPlayerAvatar.bikeSpeed != SPEED_STANDING) if (gPlayerAvatar.bikeSpeed != SPEED_STANDING)
gPlayerAvatar.bikeFrameCounter = --gPlayerAvatar.bikeSpeed; gPlayerAvatar.bikeFrameCounter = --gPlayerAvatar.bikeSpeed;
collision = get_some_collision(direction); collision = GetBikeCollision(direction);
if (collision > 0 && collision < 12) if (collision > 0 && collision < COLLISION_VERTICAL_RAIL)
{ {
if (collision == COLLISION_LEDGE_JUMP) if (collision == COLLISION_LEDGE_JUMP)
{ {
@@ -261,9 +261,9 @@ static void MachBikeTransition_TrySlowDown(u8 direction)
else else
{ {
Bike_SetBikeStill(); Bike_SetBikeStill();
if (collision == 4 && IsPlayerCollidingWithFarawayIslandMew(direction)) if (collision == COLLISION_EVENT_OBJECT && IsPlayerCollidingWithFarawayIslandMew(direction))
PlayerOnBikeCollideWithFarawayIslandMew(direction); PlayerOnBikeCollideWithFarawayIslandMew(direction);
else if (collision < 5 || collision > 8) else if (collision < COLLISION_STOP_SURFING || collision > COLLISION_ROTATING_GATE)
PlayerOnBikeCollide(direction); PlayerOnBikeCollide(direction);
} }
} }
@@ -552,14 +552,14 @@ static void AcroBikeTransition_Moving(u8 direction)
AcroBikeTransition_FaceDirection(playerEventObj->movementDirection); AcroBikeTransition_FaceDirection(playerEventObj->movementDirection);
return; return;
} }
collision = get_some_collision(direction); collision = GetBikeCollision(direction);
if (collision > 0 && collision < 12) if (collision > 0 && collision < COLLISION_VERTICAL_RAIL)
{ {
if (collision == COLLISION_LEDGE_JUMP) if (collision == COLLISION_LEDGE_JUMP)
PlayerJumpLedge(direction); PlayerJumpLedge(direction);
else if (collision == 4 && IsPlayerCollidingWithFarawayIslandMew(direction)) else if (collision == COLLISION_EVENT_OBJECT && IsPlayerCollidingWithFarawayIslandMew(direction))
PlayerOnBikeCollideWithFarawayIslandMew(direction); PlayerOnBikeCollideWithFarawayIslandMew(direction);
else if (collision < 5 || collision > 8) else if (collision < COLLISION_STOP_SURFING || collision > COLLISION_ROTATING_GATE)
PlayerOnBikeCollide(direction); PlayerOnBikeCollide(direction);
} }
else else
@@ -614,19 +614,19 @@ static void AcroBikeTransition_WheelieHoppingMoving(u8 direction)
AcroBikeTransition_WheelieHoppingStanding(playerEventObj->movementDirection); AcroBikeTransition_WheelieHoppingStanding(playerEventObj->movementDirection);
return; return;
} }
collision = get_some_collision(direction); collision = GetBikeCollision(direction);
// TODO: Try to get rid of this goto // TODO: Try to get rid of this goto
if (collision == 0 || collision == 9) if (collision == 0 || collision == COLLISION_WHEELIE_HOP)
{ {
goto derp; goto derp;
} }
else if (collision == 6) else if (collision == COLLISION_LEDGE_JUMP)
{ {
PlayerLedgeHoppingWheelie(direction); PlayerLedgeHoppingWheelie(direction);
} }
else if (collision < 5 || collision > 8) else if (collision < COLLISION_STOP_SURFING || collision > COLLISION_ROTATING_GATE)
{ {
if (collision <= 11) if (collision < COLLISION_VERTICAL_RAIL)
{ {
AcroBikeTransition_WheelieHoppingStanding(direction); AcroBikeTransition_WheelieHoppingStanding(direction);
} }
@@ -643,12 +643,12 @@ static void AcroBikeTransition_SideJump(u8 direction)
u8 collision; u8 collision;
struct EventObject *playerEventObj; struct EventObject *playerEventObj;
collision = get_some_collision(direction); collision = GetBikeCollision(direction);
if (collision != 0) if (collision)
{ {
if (collision == 7) if (collision == COLLISION_PUSHED_BOULDER)
return; return;
if (collision < 10) if (collision < COLLISION_ISOLATED_VERTICAL_RAIL)
{ {
AcroBikeTransition_TurnDirection(direction); AcroBikeTransition_TurnDirection(direction);
return; return;
@@ -680,18 +680,18 @@ static void AcroBikeTransition_WheelieMoving(u8 direction)
PlayerIdleWheelie(playerEventObj->movementDirection); PlayerIdleWheelie(playerEventObj->movementDirection);
return; return;
} }
collision = get_some_collision(direction); collision = GetBikeCollision(direction);
if (collision > 0 && collision < 12) if (collision > 0 && collision < COLLISION_VERTICAL_RAIL)
{ {
if (collision == 6) if (collision == COLLISION_LEDGE_JUMP)
{ {
PlayerLedgeHoppingWheelie(direction); PlayerLedgeHoppingWheelie(direction);
} }
else if (collision == 9) else if (collision == COLLISION_WHEELIE_HOP)
{ {
PlayerIdleWheelie(direction); PlayerIdleWheelie(direction);
} }
else if (collision <= 4) else if (collision < COLLISION_STOP_SURFING)
{ {
if (MetatileBehavior_IsBumpySlope(playerEventObj->currentMetatileBehavior)) if (MetatileBehavior_IsBumpySlope(playerEventObj->currentMetatileBehavior))
PlayerIdleWheelie(direction); PlayerIdleWheelie(direction);
@@ -714,18 +714,18 @@ static void AcroBikeTransition_WheelieRisingMoving(u8 direction)
PlayerStartWheelie(playerEventObj->movementDirection); PlayerStartWheelie(playerEventObj->movementDirection);
return; return;
} }
collision = get_some_collision(direction); collision = GetBikeCollision(direction);
if (collision > 0 && collision < 12) if (collision > 0 && collision < COLLISION_VERTICAL_RAIL)
{ {
if (collision == 6) if (collision == COLLISION_LEDGE_JUMP)
{ {
PlayerLedgeHoppingWheelie(direction); PlayerLedgeHoppingWheelie(direction);
} }
else if (collision == 9) else if (collision == COLLISION_WHEELIE_HOP)
{ {
PlayerIdleWheelie(direction); PlayerIdleWheelie(direction);
} }
else if (collision <= 4) else if (collision < COLLISION_STOP_SURFING)
{ {
if (MetatileBehavior_IsBumpySlope(playerEventObj->currentMetatileBehavior)) if (MetatileBehavior_IsBumpySlope(playerEventObj->currentMetatileBehavior))
PlayerIdleWheelie(direction); PlayerIdleWheelie(direction);
@@ -748,12 +748,12 @@ static void AcroBikeTransition_WheelieLoweringMoving(u8 direction)
PlayerEndWheelie(playerEventObj->movementDirection); PlayerEndWheelie(playerEventObj->movementDirection);
return; return;
} }
collision = get_some_collision(direction); collision = GetBikeCollision(direction);
if (collision > 0 && collision < 12) if (collision > 0 && collision < COLLISION_VERTICAL_RAIL)
{ {
if (collision == 6) if (collision == COLLISION_LEDGE_JUMP)
PlayerJumpLedge(direction); PlayerJumpLedge(direction);
else if (collision < 5 || collision > 8) else if (collision < COLLISION_STOP_SURFING || collision > COLLISION_ROTATING_GATE)
PlayerEndWheelie(direction); PlayerEndWheelie(direction);
return; return;
} }
@@ -865,29 +865,26 @@ static u8 Bike_DPadToDirection(u16 heldKeys)
return DIR_NONE; return DIR_NONE;
} }
static u8 get_some_collision(u8 direction) static u8 GetBikeCollision(u8 direction)
{ {
s16 x;
s16 y;
u8 metatitleBehavior; u8 metatitleBehavior;
struct EventObject *playerEventObj = &gEventObjects[gPlayerAvatar.eventObjectId]; struct EventObject *playerEventObj = &gEventObjects[gPlayerAvatar.eventObjectId];
s16 x = playerEventObj->currentCoords.x;
x = playerEventObj->currentCoords.x; s16 y = playerEventObj->currentCoords.y;
y = playerEventObj->currentCoords.y;
MoveCoords(direction, &x, &y); MoveCoords(direction, &x, &y);
metatitleBehavior = MapGridGetMetatileBehaviorAt(x, y); metatitleBehavior = MapGridGetMetatileBehaviorAt(x, y);
return Bike_CheckCollisionTryAdvanceCollisionCount(playerEventObj, x, y, direction, metatitleBehavior); return GetBikeCollisionAt(playerEventObj, x, y, direction, metatitleBehavior);
} }
static u8 Bike_CheckCollisionTryAdvanceCollisionCount(struct EventObject *eventObject, s16 x, s16 y, u8 direction, u8 metatitleBehavior) static u8 GetBikeCollisionAt(struct EventObject *eventObject, s16 x, s16 y, u8 direction, u8 metatitleBehavior)
{ {
u8 collision = CheckForEventObjectCollision(eventObject, x, y, direction, metatitleBehavior); u8 collision = CheckForEventObjectCollision(eventObject, x, y, direction, metatitleBehavior);
if (collision > 4) if (collision > COLLISION_EVENT_OBJECT)
return collision; return collision;
if (collision == 0 && IsRunningDisallowedByMetatile(metatitleBehavior)) if (collision == COLLISION_NONE && IsRunningDisallowedByMetatile(metatitleBehavior))
collision = 2; collision = COLLISION_IMPASSABLE;
if (collision) if (collision)
Bike_TryAdvanceCyclingRoadCollisions(); Bike_TryAdvanceCyclingRoadCollisions();
@@ -941,10 +938,10 @@ static bool8 WillPlayerCollideWithCollision(u8 newTileCollision, u8 direction)
{ {
if (direction == DIR_NORTH || direction == DIR_SOUTH) if (direction == DIR_NORTH || direction == DIR_SOUTH)
{ {
if (newTileCollision == 10 || newTileCollision == 12) if (newTileCollision == COLLISION_ISOLATED_VERTICAL_RAIL || newTileCollision == COLLISION_VERTICAL_RAIL)
return FALSE; return FALSE;
} }
else if (newTileCollision == 11 || newTileCollision == 13) else if (newTileCollision == COLLISION_ISOLATED_HORIZONTAL_RAIL || newTileCollision == COLLISION_HORIZONTAL_RAIL)
{ {
return FALSE; return FALSE;
} }
@@ -170,8 +170,8 @@ u8 MovementAction_SetFixedPriority_Step0(struct EventObject *, struct Sprite *);
u8 MovementAction_ClearFixedPriority_Step0(struct EventObject *, struct Sprite *); u8 MovementAction_ClearFixedPriority_Step0(struct EventObject *, struct Sprite *);
u8 MovementAction_InitAffineAnim_Step0(struct EventObject *, struct Sprite *); u8 MovementAction_InitAffineAnim_Step0(struct EventObject *, struct Sprite *);
u8 MovementAction_ClearAffineAnim_Step0(struct EventObject *, struct Sprite *); u8 MovementAction_ClearAffineAnim_Step0(struct EventObject *, struct Sprite *);
u8 MovementAction_Unknown1_Step0(struct EventObject *, struct Sprite *); u8 MovementAction_HideReflection_Step0(struct EventObject *, struct Sprite *);
u8 MovementAction_Unknown2_Step0(struct EventObject *, struct Sprite *); u8 MovementAction_ShowReflection_Step0(struct EventObject *, struct Sprite *);
u8 MovementAction_WalkDownStartAffine_Step0(struct EventObject *, struct Sprite *); u8 MovementAction_WalkDownStartAffine_Step0(struct EventObject *, struct Sprite *);
u8 MovementAction_WalkDownStartAffine_Step1(struct EventObject *, struct Sprite *); u8 MovementAction_WalkDownStartAffine_Step1(struct EventObject *, struct Sprite *);
u8 MovementAction_WalkDownAffine_Step0(struct EventObject *, struct Sprite *); u8 MovementAction_WalkDownAffine_Step0(struct EventObject *, struct Sprite *);
@@ -358,8 +358,8 @@ u8 (*const gMovementActionFuncs_SetFixedPriority[])(struct EventObject *, struct
u8 (*const gMovementActionFuncs_ClearFixedPriority[])(struct EventObject *, struct Sprite *); u8 (*const gMovementActionFuncs_ClearFixedPriority[])(struct EventObject *, struct Sprite *);
u8 (*const gMovementActionFuncs_InitAffineAnim[])(struct EventObject *, struct Sprite *); u8 (*const gMovementActionFuncs_InitAffineAnim[])(struct EventObject *, struct Sprite *);
u8 (*const gMovementActionFuncs_ClearAffineAnim[])(struct EventObject *, struct Sprite *); u8 (*const gMovementActionFuncs_ClearAffineAnim[])(struct EventObject *, struct Sprite *);
u8 (*const gMovementActionFuncs_Unknown1[])(struct EventObject *, struct Sprite *); u8 (*const gMovementActionFuncs_HideReflection[])(struct EventObject *, struct Sprite *);
u8 (*const gMovementActionFuncs_Unknown2[])(struct EventObject *, struct Sprite *); u8 (*const gMovementActionFuncs_ShowReflection[])(struct EventObject *, struct Sprite *);
u8 (*const gMovementActionFuncs_WalkDownStartAffine[])(struct EventObject *, struct Sprite *); u8 (*const gMovementActionFuncs_WalkDownStartAffine[])(struct EventObject *, struct Sprite *);
u8 (*const gMovementActionFuncs_WalkDownAffine[])(struct EventObject *, struct Sprite *); u8 (*const gMovementActionFuncs_WalkDownAffine[])(struct EventObject *, struct Sprite *);
u8 (*const gMovementActionFuncs_AcroWheelieFaceDown[])(struct EventObject *, struct Sprite *); u8 (*const gMovementActionFuncs_AcroWheelieFaceDown[])(struct EventObject *, struct Sprite *);
@@ -518,8 +518,8 @@ u8 (*const *const gMovementActionFuncs[])(struct EventObject *, struct Sprite *)
[MOVEMENT_ACTION_CLEAR_FIXED_PRIORITY] = gMovementActionFuncs_ClearFixedPriority, [MOVEMENT_ACTION_CLEAR_FIXED_PRIORITY] = gMovementActionFuncs_ClearFixedPriority,
[MOVEMENT_ACTION_INIT_AFFINE_ANIM] = gMovementActionFuncs_InitAffineAnim, [MOVEMENT_ACTION_INIT_AFFINE_ANIM] = gMovementActionFuncs_InitAffineAnim,
[MOVEMENT_ACTION_CLEAR_AFFINE_ANIM] = gMovementActionFuncs_ClearAffineAnim, [MOVEMENT_ACTION_CLEAR_AFFINE_ANIM] = gMovementActionFuncs_ClearAffineAnim,
[MOVEMENT_ACTION_UNKNOWN1] = gMovementActionFuncs_Unknown1, [MOVEMENT_ACTION_HIDE_REFLECTION] = gMovementActionFuncs_HideReflection,
[MOVEMENT_ACTION_UNKNOWN2] = gMovementActionFuncs_Unknown2, [MOVEMENT_ACTION_SHOW_REFLECTION] = gMovementActionFuncs_ShowReflection,
[MOVEMENT_ACTION_WALK_DOWN_START_AFFINE] = gMovementActionFuncs_WalkDownStartAffine, [MOVEMENT_ACTION_WALK_DOWN_START_AFFINE] = gMovementActionFuncs_WalkDownStartAffine,
[MOVEMENT_ACTION_WALK_DOWN_AFFINE] = gMovementActionFuncs_WalkDownAffine, [MOVEMENT_ACTION_WALK_DOWN_AFFINE] = gMovementActionFuncs_WalkDownAffine,
[MOVEMENT_ACTION_ACRO_WHEELIE_FACE_DOWN] = gMovementActionFuncs_AcroWheelieFaceDown, [MOVEMENT_ACTION_ACRO_WHEELIE_FACE_DOWN] = gMovementActionFuncs_AcroWheelieFaceDown,
@@ -1197,13 +1197,13 @@ u8 (*const gMovementActionFuncs_ClearAffineAnim[])(struct EventObject *, struct
MovementAction_Finish, MovementAction_Finish,
}; };
u8 (*const gMovementActionFuncs_Unknown1[])(struct EventObject *, struct Sprite *) = { u8 (*const gMovementActionFuncs_HideReflection[])(struct EventObject *, struct Sprite *) = {
MovementAction_Unknown1_Step0, MovementAction_HideReflection_Step0,
MovementAction_Finish, MovementAction_Finish,
}; };
u8 (*const gMovementActionFuncs_Unknown2[])(struct EventObject *, struct Sprite *) = { u8 (*const gMovementActionFuncs_ShowReflection[])(struct EventObject *, struct Sprite *) = {
MovementAction_Unknown2_Step0, MovementAction_ShowReflection_Step0,
MovementAction_Finish, MovementAction_Finish,
}; };
+30 -36
View File
@@ -2723,9 +2723,8 @@ bool8 MovementType_WanderAround_Step4(struct EventObject *eventObject, struct Sp
SetEventObjectDirection(eventObject, chosenDirection); SetEventObjectDirection(eventObject, chosenDirection);
sprite->data[1] = 5; sprite->data[1] = 5;
if (GetCollisionInDirection(eventObject, chosenDirection)) if (GetCollisionInDirection(eventObject, chosenDirection))
{
sprite->data[1] = 1; sprite->data[1] = 1;
}
return TRUE; return TRUE;
} }
@@ -3093,9 +3092,8 @@ bool8 MovementType_WanderUpAndDown_Step4(struct EventObject *eventObject, struct
SetEventObjectDirection(eventObject, direction); SetEventObjectDirection(eventObject, direction);
sprite->data[1] = 5; sprite->data[1] = 5;
if (GetCollisionInDirection(eventObject, direction)) if (GetCollisionInDirection(eventObject, direction))
{
sprite->data[1] = 1; sprite->data[1] = 1;
}
return TRUE; return TRUE;
} }
@@ -3163,9 +3161,8 @@ bool8 MovementType_WanderLeftAndRight_Step4(struct EventObject *eventObject, str
SetEventObjectDirection(eventObject, direction); SetEventObjectDirection(eventObject, direction);
sprite->data[1] = 5; sprite->data[1] = 5;
if (GetCollisionInDirection(eventObject, direction)) if (GetCollisionInDirection(eventObject, direction))
{
sprite->data[1] = 1; sprite->data[1] = 1;
}
return TRUE; return TRUE;
} }
@@ -3952,7 +3949,7 @@ bool8 MovementType_WalkBackAndForth_Step1(struct EventObject *eventObject, struc
bool8 MovementType_WalkBackAndForth_Step2(struct EventObject *eventObject, struct Sprite *sprite) bool8 MovementType_WalkBackAndForth_Step2(struct EventObject *eventObject, struct Sprite *sprite)
{ {
bool8 collisionState; bool8 collision;
u8 movementActionId; u8 movementActionId;
if (eventObject->directionSequenceIndex && eventObject->initialCoords.x == eventObject->currentCoords.x && eventObject->initialCoords.y == eventObject->currentCoords.y) if (eventObject->directionSequenceIndex && eventObject->initialCoords.x == eventObject->currentCoords.x && eventObject->initialCoords.y == eventObject->currentCoords.y)
@@ -3960,19 +3957,19 @@ bool8 MovementType_WalkBackAndForth_Step2(struct EventObject *eventObject, struc
eventObject->directionSequenceIndex = 0; eventObject->directionSequenceIndex = 0;
SetEventObjectDirection(eventObject, GetOppositeDirection(eventObject->movementDirection)); SetEventObjectDirection(eventObject, GetOppositeDirection(eventObject->movementDirection));
} }
collisionState = GetCollisionInDirection(eventObject, eventObject->movementDirection); collision = GetCollisionInDirection(eventObject, eventObject->movementDirection);
movementActionId = GetWalkNormalMovementAction(eventObject->movementDirection); movementActionId = GetWalkNormalMovementAction(eventObject->movementDirection);
if (collisionState == TRUE) if (collision == COLLISION_OUTSIDE_RANGE)
{ {
eventObject->directionSequenceIndex++; eventObject->directionSequenceIndex++;
SetEventObjectDirection(eventObject, GetOppositeDirection(eventObject->movementDirection)); SetEventObjectDirection(eventObject, GetOppositeDirection(eventObject->movementDirection));
movementActionId = GetWalkNormalMovementAction(eventObject->movementDirection); movementActionId = GetWalkNormalMovementAction(eventObject->movementDirection);
collisionState = GetCollisionInDirection(eventObject, eventObject->movementDirection); collision = GetCollisionInDirection(eventObject, eventObject->movementDirection);
} }
if (collisionState)
{ if (collision)
movementActionId = GetWalkInPlaceNormalMovementAction(eventObject->facingDirection); movementActionId = GetWalkInPlaceNormalMovementAction(eventObject->facingDirection);
}
EventObjectSetSingleMovement(eventObject, sprite, movementActionId); EventObjectSetSingleMovement(eventObject, sprite, movementActionId);
eventObject->singleMovementActive = 1; eventObject->singleMovementActive = 1;
sprite->data[1] = 3; sprite->data[1] = 3;
@@ -3998,27 +3995,26 @@ bool8 MovementType_WalkSequence_Step0(struct EventObject *eventObject, struct Sp
bool8 MoveNextDirectionInSequence(struct EventObject *eventObject, struct Sprite *sprite, u8 *route) bool8 MoveNextDirectionInSequence(struct EventObject *eventObject, struct Sprite *sprite, u8 *route)
{ {
u8 collisionState; u8 collision;
u8 movementActionId; u8 movementActionId;
if (eventObject->directionSequenceIndex == 3 && eventObject->initialCoords.x == eventObject->currentCoords.x && eventObject->initialCoords.y == eventObject->currentCoords.y) if (eventObject->directionSequenceIndex == 3 && eventObject->initialCoords.x == eventObject->currentCoords.x && eventObject->initialCoords.y == eventObject->currentCoords.y)
{
eventObject->directionSequenceIndex = 0; eventObject->directionSequenceIndex = 0;
}
SetEventObjectDirection(eventObject, route[eventObject->directionSequenceIndex]); SetEventObjectDirection(eventObject, route[eventObject->directionSequenceIndex]);
movementActionId = GetWalkNormalMovementAction(eventObject->movementDirection); movementActionId = GetWalkNormalMovementAction(eventObject->movementDirection);
collisionState = GetCollisionInDirection(eventObject, eventObject->movementDirection); collision = GetCollisionInDirection(eventObject, eventObject->movementDirection);
if (collisionState == TRUE) if (collision == COLLISION_OUTSIDE_RANGE)
{ {
eventObject->directionSequenceIndex++; eventObject->directionSequenceIndex++;
SetEventObjectDirection(eventObject, route[eventObject->directionSequenceIndex]); SetEventObjectDirection(eventObject, route[eventObject->directionSequenceIndex]);
movementActionId = GetWalkNormalMovementAction(eventObject->movementDirection); movementActionId = GetWalkNormalMovementAction(eventObject->movementDirection);
collisionState = GetCollisionInDirection(eventObject, eventObject->movementDirection); collision = GetCollisionInDirection(eventObject, eventObject->movementDirection);
} }
if (collisionState)
{ if (collision)
movementActionId = GetWalkInPlaceNormalMovementAction(eventObject->facingDirection); movementActionId = GetWalkInPlaceNormalMovementAction(eventObject->facingDirection);
}
EventObjectSetSingleMovement(eventObject, sprite, movementActionId); EventObjectSetSingleMovement(eventObject, sprite, movementActionId);
eventObject->singleMovementActive = 1; eventObject->singleMovementActive = 1;
sprite->data[1] = 2; sprite->data[1] = 2;
@@ -4868,22 +4864,20 @@ static u8 GetCollisionInDirection(struct EventObject *eventObject, u8 direction)
return GetCollisionAtCoords(eventObject, x, y, direction); return GetCollisionAtCoords(eventObject, x, y, direction);
} }
u8 GetCollisionAtCoords(struct EventObject *eventObject, s16 x, s16 y, u32 dirn) u8 GetCollisionAtCoords(struct EventObject *eventObject, s16 x, s16 y, u32 dir)
{ {
u8 direction; u8 direction = dir;
direction = dirn;
if (IsCoordOutsideEventObjectMovementRange(eventObject, x, y)) if (IsCoordOutsideEventObjectMovementRange(eventObject, x, y))
return 1; return COLLISION_OUTSIDE_RANGE;
else if (MapGridIsImpassableAt(x, y) || GetMapBorderIdAt(x, y) == -1 || IsMetatileDirectionallyImpassable(eventObject, x, y, direction)) else if (MapGridIsImpassableAt(x, y) || GetMapBorderIdAt(x, y) == -1 || IsMetatileDirectionallyImpassable(eventObject, x, y, direction))
return 2; return COLLISION_IMPASSABLE;
else if (eventObject->trackedByCamera && !CanCameraMoveInDirection(direction)) else if (eventObject->trackedByCamera && !CanCameraMoveInDirection(direction))
return 2; return COLLISION_IMPASSABLE;
else if (IsZCoordMismatchAt(eventObject->currentElevation, x, y)) else if (IsZCoordMismatchAt(eventObject->currentElevation, x, y))
return 3; return COLLISION_ELEVATION_MISMATCH;
else if (DoesObjectCollideWithObjectAt(eventObject, x, y)) else if (DoesObjectCollideWithObjectAt(eventObject, x, y))
return 4; return COLLISION_EVENT_OBJECT;
return 0; return COLLISION_NONE;
} }
u8 GetCollisionFlagsAtCoords(struct EventObject *eventObject, s16 x, s16 y, u8 direction) u8 GetCollisionFlagsAtCoords(struct EventObject *eventObject, s16 x, s16 y, u8 direction)
@@ -6831,15 +6825,15 @@ bool8 MovementAction_ClearAffineAnim_Step0(struct EventObject *eventObject, stru
return TRUE; return TRUE;
} }
bool8 MovementAction_Unknown1_Step0(struct EventObject *eventObject, struct Sprite *sprite) bool8 MovementAction_HideReflection_Step0(struct EventObject *eventObject, struct Sprite *sprite)
{ {
eventObject->unk3_3 = TRUE; eventObject->hideReflection = TRUE;
return TRUE; return TRUE;
} }
bool8 MovementAction_Unknown2_Step0(struct EventObject *eventObject, struct Sprite *sprite) bool8 MovementAction_ShowReflection_Step0(struct EventObject *eventObject, struct Sprite *sprite)
{ {
eventObject->unk3_3 = FALSE; eventObject->hideReflection = FALSE;
return TRUE; return TRUE;
} }
+1 -1
View File
@@ -143,7 +143,7 @@ static void UpdateObjectReflectionSprite(struct Sprite *reflectionSprite)
reflectionSprite->pos2.y = -mainSprite->pos2.y; reflectionSprite->pos2.y = -mainSprite->pos2.y;
reflectionSprite->coordOffsetEnabled = mainSprite->coordOffsetEnabled; reflectionSprite->coordOffsetEnabled = mainSprite->coordOffsetEnabled;
if (eventObject->unk3_3 == TRUE) if (eventObject->hideReflection == TRUE)
reflectionSprite->invisible = TRUE; reflectionSprite->invisible = TRUE;
// Check if the reflection is not still. // Check if the reflection is not still.
+59 -62
View File
@@ -71,10 +71,10 @@ static void PlayerNotOnBikeMoving(u8, u16);
static u8 CheckForPlayerAvatarCollision(u8); static u8 CheckForPlayerAvatarCollision(u8);
static u8 sub_808B028(u8); static u8 sub_808B028(u8);
static u8 sub_808B164(struct EventObject *, s16, s16, u8, u8); static u8 sub_808B164(struct EventObject *, s16, s16, u8, u8);
static bool8 sub_808B1BC(s16, s16, u8); static bool8 CanStopSurfing(s16, s16, u8);
static bool8 ShouldJumpLedge(s16, s16, u8); static bool8 ShouldJumpLedge(s16, s16, u8);
static u8 sub_808B238(s16, s16, u8); static bool8 TryPushBoulder(s16, s16, u8);
static void check_acro_bike_metatile(s16, s16, u8, u8 *); static void CheckAcroBikeCollision(s16, s16, u8, u8 *);
static void DoPlayerAvatarTransition(void); static void DoPlayerAvatarTransition(void);
static void PlayerAvatarTransition_Dummy(struct EventObject *a); static void PlayerAvatarTransition_Dummy(struct EventObject *a);
@@ -115,9 +115,9 @@ static bool8 PlayerAvatar_SecretBaseMatSpinStep1(struct Task *task, struct Event
static bool8 PlayerAvatar_SecretBaseMatSpinStep2(struct Task *task, struct EventObject *eventObject); static bool8 PlayerAvatar_SecretBaseMatSpinStep2(struct Task *task, struct EventObject *eventObject);
static bool8 PlayerAvatar_SecretBaseMatSpinStep3(struct Task *task, struct EventObject *eventObject); static bool8 PlayerAvatar_SecretBaseMatSpinStep3(struct Task *task, struct EventObject *eventObject);
static void sub_808C750(u8); static void CreateStopSurfingTask(u8);
static void taskFF_0805D1D4(u8 taskId); static void Task_StopSurfingInit(u8 taskId);
static void sub_808C814(u8 taskId); static void Task_WaitStopSurfing(u8 taskId);
static void Task_Fishing(u8 taskId); static void Task_Fishing(u8 taskId);
static u8 Fishing1(struct Task *task); static u8 Fishing1(struct Task *task);
@@ -194,7 +194,7 @@ static void (*const gUnknown_08497490[])(u8, u16) =
PlayerNotOnBikeMoving, PlayerNotOnBikeMoving,
}; };
static bool8 (*const gUnknown_0849749C[])(u8) = static bool8 (*const sAcroBikeTrickMetatiles[])(u8) =
{ {
MetatileBehavior_IsBumpySlope, MetatileBehavior_IsBumpySlope,
MetatileBehavior_IsIsolatedVerticalRail, MetatileBehavior_IsIsolatedVerticalRail,
@@ -203,7 +203,13 @@ static bool8 (*const gUnknown_0849749C[])(u8) =
MetatileBehavior_IsHorizontalRail, MetatileBehavior_IsHorizontalRail,
}; };
static const u8 gUnknown_084974B0[] = {9, 10, 11, 12, 13, 0, 0, 0}; static const u8 sAcroBikeTrickCollisionTypes[] = {
COLLISION_WHEELIE_HOP,
COLLISION_ISOLATED_VERTICAL_RAIL,
COLLISION_ISOLATED_HORIZONTAL_RAIL,
COLLISION_VERTICAL_RAIL,
COLLISION_HORIZONTAL_RAIL,
};
static void (*const gUnknown_084974B8[])(struct EventObject *) = static void (*const gUnknown_084974B8[])(struct EventObject *) =
{ {
@@ -432,19 +438,19 @@ static bool8 ForcedMovement_None(void)
static u8 DoForcedMovement(u8 direction, void (*b)(u8)) static u8 DoForcedMovement(u8 direction, void (*b)(u8))
{ {
struct PlayerAvatar *playerAvatar = &gPlayerAvatar; struct PlayerAvatar *playerAvatar = &gPlayerAvatar;
u8 collisionType = CheckForPlayerAvatarCollision(direction); u8 collision = CheckForPlayerAvatarCollision(direction);
playerAvatar->flags |= PLAYER_AVATAR_FLAG_6; playerAvatar->flags |= PLAYER_AVATAR_FLAG_6;
if (collisionType != 0) if (collision)
{ {
ForcedMovement_None(); ForcedMovement_None();
if (collisionType <= 4) if (collision < COLLISION_STOP_SURFING)
{ {
return 0; return 0;
} }
else else
{ {
if (collisionType == COLLISION_LEDGE_JUMP) if (collision == COLLISION_LEDGE_JUMP)
PlayerJumpLedge(direction); PlayerJumpLedge(direction);
playerAvatar->flags |= PLAYER_AVATAR_FLAG_6; playerAvatar->flags |= PLAYER_AVATAR_FLAG_6;
playerAvatar->runningState = MOVING; playerAvatar->runningState = MOVING;
@@ -605,33 +611,26 @@ static void PlayerNotOnBikeTurningInPlace(u8 direction, u16 heldKeys)
static void PlayerNotOnBikeMoving(u8 direction, u16 heldKeys) static void PlayerNotOnBikeMoving(u8 direction, u16 heldKeys)
{ {
u8 r0 = CheckForPlayerAvatarCollision(direction); u8 collision = CheckForPlayerAvatarCollision(direction);
if (r0 != 0) if (collision)
{ {
if (r0 == 6) if (collision == COLLISION_LEDGE_JUMP)
{ {
PlayerJumpLedge(direction); PlayerJumpLedge(direction);
return; return;
} }
else if (r0 == 4 && IsPlayerCollidingWithFarawayIslandMew(direction) != 0) else if (collision == COLLISION_EVENT_OBJECT && IsPlayerCollidingWithFarawayIslandMew(direction))
{ {
PlayerNotOnBikeCollideWithFarawayIslandMew(direction); PlayerNotOnBikeCollideWithFarawayIslandMew(direction);
return; return;
} }
else else
{ {
u8 r4 = r0 - 5; u8 adjustedCollision = collision - COLLISION_STOP_SURFING;
if (adjustedCollision > 3)
if (r4 > 3)
{
PlayerNotOnBikeCollide(direction); PlayerNotOnBikeCollide(direction);
return; return;
}
else
{
return;
}
} }
} }
@@ -677,50 +676,49 @@ static u8 sub_808B028(u8 direction)
return sub_808B164(playerEventObj, x, y, direction, MapGridGetMetatileBehaviorAt(x, y)); return sub_808B164(playerEventObj, x, y, direction, MapGridGetMetatileBehaviorAt(x, y));
} }
u8 CheckForEventObjectCollision(struct EventObject *a, s16 x, s16 y, u8 direction, u8 e) u8 CheckForEventObjectCollision(struct EventObject *eventObject, s16 x, s16 y, u8 direction, u8 metatileBehavior)
{ {
u8 collision; u8 collision = GetCollisionAtCoords(eventObject, x, y, direction);
if (collision == COLLISION_ELEVATION_MISMATCH && CanStopSurfing(x, y, direction))
return COLLISION_STOP_SURFING;
collision = GetCollisionAtCoords(a, x, y, direction);
if (collision == 3 && sub_808B1BC(x, y, direction))
return 5;
if (ShouldJumpLedge(x, y, direction)) if (ShouldJumpLedge(x, y, direction))
{ {
IncrementGameStat(GAME_STAT_JUMPED_DOWN_LEDGES); IncrementGameStat(GAME_STAT_JUMPED_DOWN_LEDGES);
return COLLISION_LEDGE_JUMP; return COLLISION_LEDGE_JUMP;
} }
if (collision == 4 && sub_808B238(x, y, direction)) if (collision == COLLISION_EVENT_OBJECT && TryPushBoulder(x, y, direction))
return 7; return COLLISION_PUSHED_BOULDER;
if (collision == 0) if (collision == COLLISION_NONE)
{ {
if (CheckForRotatingGatePuzzleCollision(direction, x, y)) if (CheckForRotatingGatePuzzleCollision(direction, x, y))
return 8; return COLLISION_ROTATING_GATE;
check_acro_bike_metatile(x, y, e, &collision); CheckAcroBikeCollision(x, y, metatileBehavior, &collision);
} }
return collision; return collision;
} }
static u8 sub_808B164(struct EventObject *a, s16 x, s16 y, u8 direction, u8 e) static u8 sub_808B164(struct EventObject *eventObject, s16 x, s16 y, u8 direction, u8 metatileBehavior)
{ {
u8 collision = GetCollisionAtCoords(a, x, y, direction); u8 collision = GetCollisionAtCoords(eventObject, x, y, direction);
if (collision == 0) if (collision == COLLISION_NONE)
{ {
if (CheckForRotatingGatePuzzleCollisionWithoutAnimation(direction, x, y) != 0) if (CheckForRotatingGatePuzzleCollisionWithoutAnimation(direction, x, y))
return 8; return COLLISION_ROTATING_GATE;
check_acro_bike_metatile(x, y, e, &collision); CheckAcroBikeCollision(x, y, metatileBehavior, &collision);
} }
return collision; return collision;
} }
static bool8 sub_808B1BC(s16 x, s16 y, u8 direction) static bool8 CanStopSurfing(s16 x, s16 y, u8 direction)
{ {
if ((gPlayerAvatar.flags & PLAYER_AVATAR_FLAG_SURFING) if ((gPlayerAvatar.flags & PLAYER_AVATAR_FLAG_SURFING)
&& MapGridGetZCoordAt(x, y) == 3 && MapGridGetZCoordAt(x, y) == 3
&& GetEventObjectIdByXYZ(x, y, 3) == EVENT_OBJECTS_COUNT) && GetEventObjectIdByXYZ(x, y, 3) == EVENT_OBJECTS_COUNT)
{ {
sub_808C750(direction); CreateStopSurfingTask(direction);
return TRUE; return TRUE;
} }
else else
@@ -737,7 +735,7 @@ static bool8 ShouldJumpLedge(s16 x, s16 y, u8 z)
return FALSE; return FALSE;
} }
static u8 sub_808B238(s16 x, s16 y, u8 direction) static bool8 TryPushBoulder(s16 x, s16 y, u8 direction)
{ {
if (FlagGet(FLAG_SYS_USE_STRENGTH)) if (FlagGet(FLAG_SYS_USE_STRENGTH))
{ {
@@ -748,26 +746,26 @@ static u8 sub_808B238(s16 x, s16 y, u8 direction)
x = gEventObjects[eventObjectId].currentCoords.x; x = gEventObjects[eventObjectId].currentCoords.x;
y = gEventObjects[eventObjectId].currentCoords.y; y = gEventObjects[eventObjectId].currentCoords.y;
MoveCoords(direction, &x, &y); MoveCoords(direction, &x, &y);
if (GetCollisionAtCoords(&gEventObjects[eventObjectId], x, y, direction) == 0 if (GetCollisionAtCoords(&gEventObjects[eventObjectId], x, y, direction) == COLLISION_NONE
&& MetatileBehavior_IsNonAnimDoor(MapGridGetMetatileBehaviorAt(x, y)) == 0) && MetatileBehavior_IsNonAnimDoor(MapGridGetMetatileBehaviorAt(x, y)) == 0)
{ {
StartStrengthAnim(eventObjectId, direction); StartStrengthAnim(eventObjectId, direction);
return 1; return TRUE;
} }
} }
} }
return 0; return FALSE;
} }
static void check_acro_bike_metatile(s16 unused1, s16 unused2, u8 c, u8 *d) static void CheckAcroBikeCollision(s16 x, s16 y, u8 metatileBehavior, u8 *collision)
{ {
u8 i; u8 i;
for (i = 0; i < 5; i++) for (i = 0; i < ARRAY_COUNT(sAcroBikeTrickMetatiles); i++)
{ {
if (gUnknown_0849749C[i](c)) if (sAcroBikeTrickMetatiles[i](metatileBehavior))
{ {
*d = gUnknown_084974B0[i]; *collision = sAcroBikeTrickCollisionTypes[i];
return; return;
} }
} }
@@ -1314,7 +1312,8 @@ bool8 IsPlayerFacingSurfableFishableWater(void)
s16 y = playerEventObj->currentCoords.y; s16 y = playerEventObj->currentCoords.y;
MoveCoords(playerEventObj->facingDirection, &x, &y); MoveCoords(playerEventObj->facingDirection, &x, &y);
if (GetCollisionAtCoords(playerEventObj, x, y, playerEventObj->facingDirection) == 3 && PlayerGetZCoord() == 3 if (GetCollisionAtCoords(playerEventObj, x, y, playerEventObj->facingDirection) == COLLISION_ELEVATION_MISMATCH
&& PlayerGetZCoord() == 3
&& MetatileBehavior_IsSurfableFishableWater(MapGridGetMetatileBehaviorAt(x, y))) && MetatileBehavior_IsSurfableFishableWater(MapGridGetMetatileBehaviorAt(x, y)))
return TRUE; return TRUE;
else else
@@ -1626,9 +1625,7 @@ static bool8 PlayerAvatar_SecretBaseMatSpinStep3(struct Task *task, struct Event
return FALSE; return FALSE;
} }
/* Some Field effect */ static void CreateStopSurfingTask(u8 direction)
static void sub_808C750(u8 a)
{ {
u8 taskId; u8 taskId;
@@ -1638,12 +1635,12 @@ static void sub_808C750(u8 a)
gPlayerAvatar.flags &= ~PLAYER_AVATAR_FLAG_SURFING; gPlayerAvatar.flags &= ~PLAYER_AVATAR_FLAG_SURFING;
gPlayerAvatar.flags |= PLAYER_AVATAR_FLAG_ON_FOOT; gPlayerAvatar.flags |= PLAYER_AVATAR_FLAG_ON_FOOT;
gPlayerAvatar.preventStep = TRUE; gPlayerAvatar.preventStep = TRUE;
taskId = CreateTask(taskFF_0805D1D4, 0xFF); taskId = CreateTask(Task_StopSurfingInit, 0xFF);
gTasks[taskId].data[0] = a; gTasks[taskId].data[0] = direction;
taskFF_0805D1D4(taskId); Task_StopSurfingInit(taskId);
} }
static void taskFF_0805D1D4(u8 taskId) static void Task_StopSurfingInit(u8 taskId)
{ {
struct EventObject *playerEventObj = &gEventObjects[gPlayerAvatar.eventObjectId]; struct EventObject *playerEventObj = &gEventObjects[gPlayerAvatar.eventObjectId];
@@ -1654,10 +1651,10 @@ static void taskFF_0805D1D4(u8 taskId)
} }
sub_81555AC(playerEventObj->fieldEffectSpriteId, 2); sub_81555AC(playerEventObj->fieldEffectSpriteId, 2);
EventObjectSetHeldMovement(playerEventObj, GetJumpSpecialMovementAction((u8)gTasks[taskId].data[0])); EventObjectSetHeldMovement(playerEventObj, GetJumpSpecialMovementAction((u8)gTasks[taskId].data[0]));
gTasks[taskId].func = sub_808C814; gTasks[taskId].func = Task_WaitStopSurfing;
} }
static void sub_808C814(u8 taskId) static void Task_WaitStopSurfing(u8 taskId)
{ {
struct EventObject *playerEventObj = &gEventObjects[gPlayerAvatar.eventObjectId]; struct EventObject *playerEventObj = &gEventObjects[gPlayerAvatar.eventObjectId];
+1 -1
View File
@@ -2742,7 +2742,7 @@ static bool32 PlayerIsAtSouthExit(struct TradeRoomPlayer *player)
return FALSE; return FALSE;
else if (!MetatileBehavior_IsSouthArrowWarp(player->field_C)) else if (!MetatileBehavior_IsSouthArrowWarp(player->field_C))
return FALSE; return FALSE;
else if (player->facing != 1) else if (player->facing != DIR_SOUTH)
return FALSE; return FALSE;
else else
return TRUE; return TRUE;