Document some warp/field screen effect

This commit is contained in:
GriffinR 2019-12-17 03:24:44 -05:00
parent fee36224ed
commit d1cf9006fb
43 changed files with 428 additions and 413 deletions

View File

@ -1539,7 +1539,7 @@
.4byte \pointer
.endm
.macro warp8 map:req, byte:req, word1:req, word2:req
.macro warpsootopolislegend map:req, byte:req, word1:req, word2:req
.byte 0xe0
map \map
.byte \byte

View File

@ -547,7 +547,7 @@ SootopolisCity_EventScript_RayquazaSceneFromPokeCenter:: @ 81E5C1E
fadenewbgm MUS_RUNECITY
delay 120
clearflag FLAG_HIDE_MAP_NAME_POPUP
warp8 MAP_SOOTOPOLIS_CITY, 255, 43, 32
warpsootopolislegend MAP_SOOTOPOLIS_CITY, 255, 43, 32
waitstate
end
@ -600,7 +600,7 @@ SootopolisCity_EventScript_RayquazaSceneFromDive:: @ 81E5CCE
fadenewbgm MUS_NAMINORI
delay 120
clearflag FLAG_HIDE_MAP_NAME_POPUP
warp8 MAP_SOOTOPOLIS_CITY, 255, 29, 53
warpsootopolislegend MAP_SOOTOPOLIS_CITY, 255, 29, 53
waitstate
end

View File

@ -224,7 +224,7 @@ gScriptCmdTable:: @ 81DB67C
.4byte ScrCmd_buffertrainerclassname
.4byte ScrCmd_buffertrainername
.4byte ScrCmd_pokenavcall
.4byte ScrCmd_warpE0
.4byte ScrCmd_warpsootopolislegend
.4byte ScrCmd_buffercontesttype
.4byte ScrCmd_bufferitemnameplural

View File

@ -391,7 +391,7 @@ CableClub_EventScript_EnterColosseum:: @ 8276FBD
goto_if_eq CableClub_EventScript_WarpTo4PColosseum
special SetCableClubWarp
warp MAP_BATTLE_COLOSSEUM_2P, 255, 6, 8
special sub_80AF948
special DoCableClubWarp
waitstate
end
@ -404,7 +404,7 @@ CableClub_EventScript_PlayerApproachLinkRoomRight:: @ 827702B
CableClub_EventScript_WarpTo4PColosseum:: @ 8277036
special SetCableClubWarp
warp MAP_BATTLE_COLOSSEUM_4P, 255, 5, 8
special sub_80AF948
special DoCableClubWarp
waitstate
end
@ -494,7 +494,7 @@ CableClub_EventScript_EnterTradeCenter:: @ 827713A
release
special SetCableClubWarp
setwarp MAP_TRADE_CENTER, 255, 5, 8
special sub_80AF948
special DoCableClubWarp
waitstate
end
@ -569,7 +569,7 @@ CableClub_EventScript_EnterRecordCorner:: @ 827724C
release
special SetCableClubWarp
setwarp MAP_RECORD_CORNER, 255, 8, 9
special sub_80AF948
special DoCableClubWarp
waitstate
end
@ -618,7 +618,7 @@ MossdeepCity_GameCorner_1F_EventScript_AbortMinigame:: @ 82772F9
@ Unused
CableClub_EventScript_CableClubWarp:: @ 8277306
special SetCableClubWarp
special sub_80AF948
special DoCableClubWarp
waitstate
end

View File

@ -10,7 +10,7 @@
gSpecials:: @ 81DBA64
def_special HealPlayerParty
def_special SetCableClubWarp
def_special sub_80AF948
def_special DoCableClubWarp
def_special ReturnFromLinkRoom
def_special CleanupLinkRoomState
def_special ExitLinkRoom

View File

Before

Width:  |  Height:  |  Size: 406 B

After

Width:  |  Height:  |  Size: 406 B

View File

@ -7,7 +7,7 @@
#define PC_LOCATION_MAYS_HOUSE 2
// SS Tidal Locations
#define SS_TIDAL_LOCATION_OTHER 0
#define SS_TIDAL_LOCATION_CURRENTS 0
#define SS_TIDAL_LOCATION_SLATEPORT 1
#define SS_TIDAL_LOCATION_LILYCOVE 2
#define SS_TIDAL_LOCATION_ROUTE124 3

View File

@ -34,17 +34,17 @@ bool8 FieldEffectCmd_end(u8 **script, u32 *val);
bool8 FieldEffectCmd_loadgfx_callnative(u8 **script, u32 *val);
bool8 FieldEffectCmd_loadtiles_callnative(u8 **script, u32 *val);
bool8 FieldEffectCmd_loadfadedpal_callnative(u8 **script, u32 *val);
void sub_80B6B68(void);
void sub_80B6E4C(u8 a0, u8 priority);
void sub_80B75D8(u8 priority);
void sub_80B7A74(u8 priority);
void FieldCB_FallWarpExit(void);
void StartEscalatorWarp(u8 metatileBehavior, u8 priority);
void StartLavaridgeGymB1FWarp(u8 priority);
void StartLavaridgeGym1FWarp(u8 priority);
void sub_80B9C28(s16*, u8);
void sub_80B9C54(s16*, u8);
void sub_80B9CDC(s16*, u8);
void sub_80B7CAC(struct Sprite*);
void sub_80B7A58(struct Sprite*);
void SpriteCB_PopOutOfAsh(struct Sprite*);
void SpriteCB_LavaridgeGymWarp(struct Sprite*);
void MultiplyPaletteRGBComponents(u16 i, u8 r, u8 g, u8 b);
void FreeResourcesAndDestroySprite(struct Sprite *sprite, u8 spriteId);

View File

@ -61,7 +61,7 @@ void sub_808D194(void);
void sub_808D1C8(void);
bool32 sub_808D1B4(void);
bool32 sub_808D1E8(void);
void sub_808C0A8(u8 a);
void SetPlayerInvisibility(bool8 invisible);
u8 player_get_pos_including_state_based_drift(s16 *x, s16 *y);
#endif // GUARD_FIELD_PLAYER_AVATAR_H

View File

@ -1,37 +1,35 @@
#ifndef GUARD_FIELD_SCREEN_EFFECT_H
#define GUARD_FIELD_SCREEN_EFFECT_H
void pal_fill_for_maplights(void);
void pal_fill_black(void);
void WarpFadeScreen(void);
void sub_80AF128(void);
void FieldCallback_ReturnToEventScript2(void);
void sub_80AF188(void);
void sub_80AF214(void);
void sub_80AF2B4(u8 taskId);
void sub_80AF314(void);
void mapldr_default(void);
void sub_80AF3B0(void);
void sub_80AF3C8(void);
void sub_80AF3E8(void);
void sub_80AF40C(void);
void sub_80AF688(void);
bool8 sub_80AF6A4(void);
void WarpFadeInScreen(void);
void WarpFadeOutScreen(void);
void FadeInFromBlack(void);
void FadeInFromWhite(void);
void FieldCB_ContinueScriptUnionRoom(void);
void FieldCB_ContinueScriptHandleMusic(void);
void FieldCB_ContinueScript(void);
void Task_ReturnToFieldRecordMixing(u8 taskId);
void FieldCB_ReturnToFieldCableLink(void);
void FieldCB_ReturnToFieldWirelessLink(void);
void FieldCB_DefaultWarpExit(void);
void FieldCB_WarpExitFadeFromBlack(void);
void FieldCB_WarpExitFadeFromWhite(void);
bool8 FieldCB_ReturnToFieldOpenStartMenu(void);
void ReturnToFieldOpenStartMenu(void);
void sub_80AF6D4(void);
void sub_80AF6F0(void);
void DoWarp(void);
void DoDiveWarp(void);
void sub_80AF79C(void);
void DoSootopolisLegendWarp(void);
void DoDoorWarp(void);
void DoFallWarp(void);
void sub_80AF80C(u8 metatileBehavior);
void sub_80AF828(void);
void sub_80AF838(void);
void sub_80AF848(void);
void DoEscalatorWarp(u8 metatileBehavior);
void DoLavaridgeGymB1FWarp(void);
void DoLavaridgeGym1FWarp(void);
void DoTeleportWarp(void);
void DoMossdeepGymWarp(void);
void sub_80AF8B8(void);
void sub_80AF948(void);
void sub_80AF9F8(void);
void DoPortholeWarp(void);
void DoCableClubWarp(void);
void DoContestHallWarp(void);
void AnimateFlash(u8 flashLevel);
void WriteBattlePyramidViewScanlineEffectBuffer(void);
@ -41,6 +39,6 @@ void DoOrbEffect(void);
void FadeOutOrbEffect(void);
void sub_80B05B4(void);
void WriteFlashScanlineEffectBuffer(u8 flashLevel);
bool8 walkrun_is_standing_still(void);
bool8 IsPlayerStandingStill(void);
#endif // GUARD_FIELD_SCREEN_EFFECT_H

View File

@ -10,6 +10,6 @@ void Task_HandleTruckSequence(u8 taskId);
void ExecuteTruckSequence(void);
void EndTruckSequence(u8);
void sub_80C791C(void);
void sub_80FB768(void);
void FieldCB_ShowPortholeView(void);
#endif // GUARD_FIELD_SPECIAL_SCENE_H

View File

@ -136,7 +136,7 @@ void CB2_NewGame(void);
void CB2_WhiteOut(void);
void CB2_LoadMap(void);
void sub_8086024(void);
void sub_8086074(void);
void CB2_ReturnToFieldCableClub(void);
void CB2_ReturnToField(void);
void CB2_ReturnToFieldLocal(void);
void CB2_ReturnToFieldLink(void);

View File

@ -3,7 +3,7 @@
extern bool8 (*gMenuCallback)(void);
void sub_809FA18(void);
void ShowReturnToFieldStartMenu(void);
void Task_ShowStartMenu(u8 taskId);
void ShowStartMenu(void);
void ShowBattlePyramidStartMenu(void);

View File

@ -653,7 +653,7 @@ $(EVENTOBJGFXDIR)/effects/unknown_20.4bpp: %.4bpp: %.png
$(EVENTOBJGFXDIR)/effects/unknown_29.4bpp: %.4bpp: %.png
$(GFX) $< $@ -mwidth 2 -mheight 1
$(EVENTOBJGFXDIR)/effects/unknown_33.4bpp: %.4bpp: %.png
$(EVENTOBJGFXDIR)/effects/lavaridge_gym_warp.4bpp: %.4bpp: %.png
$(GFX) $< $@ -mwidth 2 -mheight 2
$(EVENTOBJGFXDIR)/effects/unknown_35.4bpp: %.4bpp: %.png

View File

@ -326,7 +326,7 @@ const u32 gFieldEffectObjectPic_SandDisguisePlaceholder[] = INCBIN_U32("graphics
const u32 gFieldEffectObjectPic_HotSpringsWater[] = INCBIN_U32("graphics/event_objects/pics/effects/hot_springs_water.4bpp");
const u16 gFieldEffectObjectPalette2[] = INCBIN_U16("graphics/event_objects/palettes/field_effect_object_palette_02.gbapal");
const u32 gFieldEffectObjectPic_JumpOutOfAsh[] = INCBIN_U32("graphics/event_objects/pics/effects/jump_out_of_ash.4bpp");
const u32 gFieldEffectObjectPic_Unknown33[] = INCBIN_U32("graphics/event_objects/pics/effects/unknown_33.4bpp");
const u32 gFieldEffectObjectPic_LavaridgeGymWarp[] = INCBIN_U32("graphics/event_objects/pics/effects/lavaridge_gym_warp.4bpp");
const u32 gFieldEffectObjectPic_Bubbles[] = INCBIN_U32("graphics/event_objects/pics/effects/bubbles.4bpp");
const u32 gFieldEffectObjectPic_Unknown35[] = INCBIN_U32("graphics/event_objects/pics/effects/unknown_35.4bpp");
const u16 gFieldEffectObjectPalette3[] = INCBIN_U16("graphics/event_objects/palettes/field_effect_object_palette_03.gbapal");

View File

@ -31,7 +31,7 @@ const struct SpriteTemplate gFieldEffectObjectTemplate_Unknown29;
const struct SpriteTemplate gFieldEffectObjectTemplate_ShortGrass;
const struct SpriteTemplate gFieldEffectObjectTemplate_HotSpringsWater;
const struct SpriteTemplate gFieldEffectObjectTemplate_JumpOutOfAsh;
const struct SpriteTemplate gFieldEffectObjectTemplate_Unknown33;
const struct SpriteTemplate gFieldEffectObjectTemplate_LavaridgeGymWarp;
const struct SpriteTemplate gFieldEffectObjectTemplate_Bubbles;
const struct SpriteTemplate gFieldEffectObjectTemplate_Unknown35;
const struct SpriteTemplate gFieldEffectObjectTemplate_Rayquaza;
@ -70,7 +70,7 @@ const struct SpriteTemplate *const gFieldEffectObjectTemplatePointers[] = {
&gFieldEffectObjectTemplate_ShortGrass,
&gFieldEffectObjectTemplate_HotSpringsWater,
&gFieldEffectObjectTemplate_JumpOutOfAsh,
&gFieldEffectObjectTemplate_Unknown33,
&gFieldEffectObjectTemplate_LavaridgeGymWarp,
&gFieldEffectObjectTemplate_Bubbles,
&gFieldEffectObjectTemplate_Unknown35,
&gFieldEffectObjectTemplate_Rayquaza,

View File

@ -892,19 +892,28 @@ const union AnimCmd *const gFieldEffectObjectImageAnimTable_JumpOutOfAsh[] =
gFieldEffectObjectImageAnim_850D54C,
};
const struct SpriteTemplate gFieldEffectObjectTemplate_JumpOutOfAsh = {0xFFFF, 0x100D, &gEventObjectBaseOam_16x16, gFieldEffectObjectImageAnimTable_JumpOutOfAsh, gFieldEffectObjectPicTable_JumpOutOfAsh, gDummySpriteAffineAnimTable, sub_80B7CAC};
const struct SpriteTemplate gFieldEffectObjectTemplate_JumpOutOfAsh =
{
.tileTag = 0xFFFF,
.paletteTag = 0x100D,
.oam = &gEventObjectBaseOam_16x16,
.anims = gFieldEffectObjectImageAnimTable_JumpOutOfAsh,
.images = gFieldEffectObjectPicTable_JumpOutOfAsh,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCB_PopOutOfAsh
};
const struct SpritePalette gFieldEffectObjectPaletteInfo2 = {gFieldEffectObjectPalette2, 0x100D};
const struct SpriteFrameImage gFieldEffectObjectPicTable_Unknown33[] = {
overworld_frame(gFieldEffectObjectPic_Unknown33, 2, 2, 0),
overworld_frame(gFieldEffectObjectPic_Unknown33, 2, 2, 1),
overworld_frame(gFieldEffectObjectPic_Unknown33, 2, 2, 2),
overworld_frame(gFieldEffectObjectPic_Unknown33, 2, 2, 3),
overworld_frame(gFieldEffectObjectPic_Unknown33, 2, 2, 4),
const struct SpriteFrameImage gFieldEffectObjectPicTable_LavaridgeGymWarp[] = {
overworld_frame(gFieldEffectObjectPic_LavaridgeGymWarp, 2, 2, 0),
overworld_frame(gFieldEffectObjectPic_LavaridgeGymWarp, 2, 2, 1),
overworld_frame(gFieldEffectObjectPic_LavaridgeGymWarp, 2, 2, 2),
overworld_frame(gFieldEffectObjectPic_LavaridgeGymWarp, 2, 2, 3),
overworld_frame(gFieldEffectObjectPic_LavaridgeGymWarp, 2, 2, 4),
};
const union AnimCmd gFieldEffectObjectImageAnim_850D5B0[] =
const union AnimCmd gFieldEffectObjectImageAnim_LavaridgeGymWarp[] =
{
ANIMCMD_FRAME(0, 6),
ANIMCMD_FRAME(1, 6),
@ -914,12 +923,21 @@ const union AnimCmd gFieldEffectObjectImageAnim_850D5B0[] =
ANIMCMD_END,
};
const union AnimCmd *const gFieldEffectObjectImageAnimTable_Unknown33[] =
const union AnimCmd *const gFieldEffectObjectImageAnimTable_LavaridgeGymWarp[] =
{
gFieldEffectObjectImageAnim_850D5B0,
gFieldEffectObjectImageAnim_LavaridgeGymWarp,
};
const struct SpriteTemplate gFieldEffectObjectTemplate_Unknown33 = {0xFFFF, 0x100D, &gEventObjectBaseOam_16x16, gFieldEffectObjectImageAnimTable_Unknown33, gFieldEffectObjectPicTable_Unknown33, gDummySpriteAffineAnimTable, sub_80B7A58};
const struct SpriteTemplate gFieldEffectObjectTemplate_LavaridgeGymWarp =
{
.tileTag = 0xFFFF,
.paletteTag = 0x100D,
.oam = &gEventObjectBaseOam_16x16,
.anims = gFieldEffectObjectImageAnimTable_LavaridgeGymWarp,
.images = gFieldEffectObjectPicTable_LavaridgeGymWarp,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCB_LavaridgeGymWarp
};
const struct SpriteFrameImage gFieldEffectObjectPicTable_Bubbles[] = {
overworld_frame(gFieldEffectObjectPic_Bubbles, 2, 4, 0),

View File

@ -1332,7 +1332,7 @@ void sub_8128060(u8 taskId)
ConfigureCameraObjectForPlacingDecoration(&sPlaceDecorationGraphicsDataBuffer, gCurDecorationItems[gCurDecorationIndex]);
sub_812826C(taskId);
SetUpPlacingDecorationPlayerAvatar(taskId, &sPlaceDecorationGraphicsDataBuffer);
pal_fill_black();
FadeInFromBlack();
gPaletteFade.bufferTransferDisabled = FALSE;
gTasks[taskId].data[2] = 2;
break;
@ -1738,7 +1738,7 @@ void sub_8128CD4(void)
u8 taskId;
ScriptContext2_Enable();
pal_fill_black();
FadeInFromBlack();
taskId = CreateTask(sub_8128C64, 8);
sub_8127580(taskId);
gTasks[taskId].data[2] = 0;
@ -2215,7 +2215,7 @@ void sub_81298EC(u8 taskId)
case 2:
ScriptContext2_Enable();
IdentifyOwnedDecorationsCurrentlyInUseInternal(taskId);
pal_fill_black();
FadeInFromBlack();
gTasks[taskId].data[2] = 3;
break;
case 3:
@ -2278,7 +2278,7 @@ void sub_8129ABC(u8 taskId)
break;
case 1:
SetUpPuttingAwayDecorationPlayerAvatar();
pal_fill_black();
FadeInFromBlack();
data[2] = 2;
break;
case 2:
@ -2623,7 +2623,7 @@ void sub_812A334(void)
{
u8 taskId;
pal_fill_black();
FadeInFromBlack();
DrawDialogueFrame(0, 1);
InitDecorationActionsWindow();
taskId = CreateTask(sub_812A2C4, 8);

View File

@ -470,7 +470,7 @@ static void Task_EggHatch(u8 taskID)
{
CleanupOverworldWindowsAndTilemaps();
SetMainCallback2(CB2_EggHatch_0);
gFieldCallback = FieldCallback_ReturnToEventScript2;
gFieldCallback = FieldCB_ContinueScriptHandleMusic;
DestroyTask(taskID);
}
}

View File

@ -8,7 +8,7 @@
#include "trainer_see.h"
#include "constants/event_objects.h"
bool8 walkrun_is_standing_still(void)
bool8 IsPlayerStandingStill(void)
{
if (gPlayerAvatar.tileTransitionState == T_TILE_TRANSITION)
return FALSE;
@ -18,7 +18,7 @@ bool8 walkrun_is_standing_still(void)
static void sub_80983A4(u8 taskId)
{
if (walkrun_is_standing_still())
if (IsPlayerStandingStill())
{
sub_808B864();
DestroyTask(taskId);
@ -49,7 +49,7 @@ static void sub_8098400(u8 taskId)
{
struct Task *task = &gTasks[taskId];
if (!task->data[0] && walkrun_is_standing_still() == TRUE)
if (!task->data[0] && IsPlayerStandingStill() == TRUE)
{
sub_808B864();
task->data[0] = 1;
@ -123,7 +123,7 @@ static void sub_80985BC(u8 taskId)
struct Task *task = &gTasks[taskId];
u8 eventObjectId = task->data[2];
if (!task->data[0] && walkrun_is_standing_still() == TRUE)
if (!task->data[0] && IsPlayerStandingStill() == TRUE)
{
sub_808B864();
task->data[0] = 1;

View File

@ -710,22 +710,22 @@ static bool8 TryStartWarpEventScript(struct MapPosition *position, u16 metatileB
SetupWarp(&gMapHeader, warpEventId, position);
if (MetatileBehavior_IsEscalator(metatileBehavior) == TRUE)
{
sub_80AF80C(metatileBehavior);
DoEscalatorWarp(metatileBehavior);
return TRUE;
}
if (MetatileBehavior_IsLavaridgeB1FWarp(metatileBehavior) == TRUE)
{
sub_80AF828();
DoLavaridgeGymB1FWarp();
return TRUE;
}
if (MetatileBehavior_IsLavaridge1FWarp(metatileBehavior) == TRUE)
{
sub_80AF838();
DoLavaridgeGym1FWarp();
return TRUE;
}
if (MetatileBehavior_IsAquaHideoutWarp(metatileBehavior) == TRUE)
{
sub_80AF848();
DoTeleportWarp();
return TRUE;
}
if (MetatileBehavior_IsWarpOrBridge(metatileBehavior) == TRUE)

View File

@ -28,6 +28,7 @@
#include "util.h"
#include "constants/field_effects.h"
#include "constants/event_object_movement_constants.h"
#include "constants/metatile_behaviors.h"
#include "constants/rgb.h"
#include "constants/songs.h"
@ -68,22 +69,22 @@ static void task00_8084310(u8);
static void mapldr_08084390(void);
static void c3_080843F8(u8);
static void sub_80B6B94(u8);
static bool8 sub_80B6BCC(struct Task *);
static bool8 sub_80B6C74(struct Task *);
static bool8 sub_80B6C90(struct Task *);
static bool8 sub_80B6D04(struct Task *);
static bool8 sub_80B6DBC(struct Task *);
static bool8 sub_80B6DD8(struct Task *);
static bool8 sub_80B6E18(struct Task *);
static void Task_FallWarpFieldEffect(u8);
static bool8 FallWarpEffect_1(struct Task *);
static bool8 FallWarpEffect_2(struct Task *);
static bool8 FallWarpEffect_3(struct Task *);
static bool8 FallWarpEffect_4(struct Task *);
static bool8 FallWarpEffect_5(struct Task *);
static bool8 FallWarpEffect_6(struct Task *);
static bool8 FallWarpEffect_7(struct Task *);
static void sub_80B6E88(u8);
static bool8 sub_80B6EC0(struct Task *);
static bool8 sub_80B6EE0(struct Task *);
static bool8 sub_80B6F50(struct Task *);
static bool8 sub_80B6F74(struct Task *);
static bool8 sub_80B6F84(struct Task *);
static bool8 sub_80B6FA8(struct Task *);
static void Task_EscalatorWarpFieldEffect(u8);
static bool8 EscalatorWarpEffect_1(struct Task *);
static bool8 EscalatorWarpEffect_2(struct Task *);
static bool8 EscalatorWarpEffect_3(struct Task *);
static bool8 EscalatorWarpEffect_4(struct Task *);
static bool8 EscalatorWarpEffect_5(struct Task *);
static bool8 EscalatorWarpEffect_6(struct Task *);
static void sub_80B6FB8(struct Task *);
static void sub_80B7004(struct Task *);
@ -112,29 +113,27 @@ static bool8 dive_1_lock(struct Task *);
static bool8 dive_2_unknown(struct Task *);
static bool8 dive_3_unknown(struct Task *);
static void sub_80B75F0(u8);
static bool8 sub_80B764C(struct Task *, struct EventObject *, struct Sprite *);
static bool8 sub_80B7684(struct Task *, struct EventObject *, struct Sprite *);
static bool8 sub_80B76B8(struct Task *, struct EventObject *, struct Sprite *);
static bool8 sub_80B7704(struct Task *, struct EventObject *, struct Sprite *);
static bool8 sub_80B77F8(struct Task *, struct EventObject *, struct Sprite *);
static bool8 sub_80B7814(struct Task *, struct EventObject *, struct Sprite *);
static void Task_LavaridgeGymB1FWarp(u8);
static bool8 LavaridgeGymB1FWarpEffect_1(struct Task *, struct EventObject *, struct Sprite *);
static bool8 LavaridgeGymB1FWarpEffect_2(struct Task *, struct EventObject *, struct Sprite *);
static bool8 LavaridgeGymB1FWarpEffect_3(struct Task *, struct EventObject *, struct Sprite *);
static bool8 LavaridgeGymB1FWarpEffect_4(struct Task *, struct EventObject *, struct Sprite *);
static bool8 LavaridgeGymB1FWarpEffect_5(struct Task *, struct EventObject *, struct Sprite *);
static bool8 LavaridgeGymB1FWarpEffect_6(struct Task *, struct EventObject *, struct Sprite *);
static void mapldr_080851BC(void);
static void sub_80B7890(u8);
static void FieldCB_LavaridgeGymB1FWarpExit(void);
static void Task_LavaridgeGymB1FWarpExit(u8);
static bool8 LavaridgeGymB1FWarpExitEffect_1(struct Task *, struct EventObject *, struct Sprite *);
static bool8 LavaridgeGymB1FWarpExitEffect_2(struct Task *, struct EventObject *, struct Sprite *);
static bool8 LavaridgeGymB1FWarpExitEffect_3(struct Task *, struct EventObject *, struct Sprite *);
static bool8 LavaridgeGymB1FWarpExitEffect_4(struct Task *, struct EventObject *, struct Sprite *);
static bool8 sub_80B78EC(struct Task *, struct EventObject *, struct Sprite *);
static bool8 sub_80B791C(struct Task *, struct EventObject *, struct Sprite *);
static bool8 sub_80B7968(struct Task *, struct EventObject *, struct Sprite *);
static bool8 sub_80B79BC(struct Task *, struct EventObject *, struct Sprite *);
static void sub_80B7A8C(u8);
static bool8 sub_80B7AE8(struct Task *, struct EventObject *, struct Sprite *);
static bool8 sub_80B7B18(struct Task *, struct EventObject *, struct Sprite *);
static bool8 sub_80B7B94(struct Task *, struct EventObject *, struct Sprite *);
static bool8 sub_80B7BCC(struct Task *, struct EventObject *, struct Sprite *);
static bool8 sub_80B7BF4(struct Task *, struct EventObject *, struct Sprite *);
static void Task_LavaridgeGym1FWarp(u8);
static bool8 LavaridgeGym1FWarpEffect_1(struct Task *, struct EventObject *, struct Sprite *);
static bool8 LavaridgeGym1FWarpEffect_2(struct Task *, struct EventObject *, struct Sprite *);
static bool8 LavaridgeGym1FWarpEffect_3(struct Task *, struct EventObject *, struct Sprite *);
static bool8 LavaridgeGym1FWarpEffect_4(struct Task *, struct EventObject *, struct Sprite *);
static bool8 LavaridgeGym1FWarpEffect_5(struct Task *, struct EventObject *, struct Sprite *);
static void DoEscapeRopeFieldEffect(u8);
static void EscapeRopeFieldEffect_Step0(struct Task *);
@ -596,25 +595,25 @@ const u8 gUnknown_0855C3BC[] = {16, 12, 8, 0};
const u8 gUnknown_0855C3C0[] = {16, 12, 8, 0};
const u8 gUnknown_0855C3C4[] = { 0, 0, 0, 0};
bool8 (*const gUnknown_0855C3C8[])(struct Task *) =
bool8 (*const sFallWarpFieldEffectFuncs[])(struct Task *) =
{
sub_80B6BCC,
sub_80B6C74,
sub_80B6C90,
sub_80B6D04,
sub_80B6DBC,
sub_80B6DD8,
sub_80B6E18,
FallWarpEffect_1,
FallWarpEffect_2,
FallWarpEffect_3,
FallWarpEffect_4,
FallWarpEffect_5,
FallWarpEffect_6,
FallWarpEffect_7,
};
bool8 (*const gUnknown_0855C3E4[])(struct Task *) =
bool8 (*const sEscalatorWarpFieldEffectFuncs[])(struct Task *) =
{
sub_80B6EC0,
sub_80B6EE0,
sub_80B6F50,
sub_80B6F74,
sub_80B6F84,
sub_80B6FA8,
EscalatorWarpEffect_1,
EscalatorWarpEffect_2,
EscalatorWarpEffect_3,
EscalatorWarpEffect_4,
EscalatorWarpEffect_5,
EscalatorWarpEffect_6,
};
bool8 (*const gUnknown_0855C3FC[])(struct Task *) =
@ -644,31 +643,31 @@ bool8 (*const gUnknown_0855C42C[])(struct Task *) =
dive_3_unknown,
};
bool8 (*const gUnknown_0855C438[])(struct Task *, struct EventObject *, struct Sprite *) =
bool8 (*const sLavaridgeGymB1FWarpEffectFuncs[])(struct Task *, struct EventObject *, struct Sprite *) =
{
sub_80B764C,
sub_80B7684,
sub_80B76B8,
sub_80B7704,
sub_80B77F8,
sub_80B7814,
LavaridgeGymB1FWarpEffect_1,
LavaridgeGymB1FWarpEffect_2,
LavaridgeGymB1FWarpEffect_3,
LavaridgeGymB1FWarpEffect_4,
LavaridgeGymB1FWarpEffect_5,
LavaridgeGymB1FWarpEffect_6,
};
bool8 (*const gUnknown_0855C450[])(struct Task *, struct EventObject *, struct Sprite *) =
bool8 (*const sLavaridgeGymB1FWarpExitEffectFuncs[])(struct Task *, struct EventObject *, struct Sprite *) =
{
sub_80B78EC,
sub_80B791C,
sub_80B7968,
sub_80B79BC,
LavaridgeGymB1FWarpExitEffect_1,
LavaridgeGymB1FWarpExitEffect_2,
LavaridgeGymB1FWarpExitEffect_3,
LavaridgeGymB1FWarpExitEffect_4,
};
bool8 (*const gUnknown_0855C460[])(struct Task *, struct EventObject *, struct Sprite *) =
bool8 (*const sLavaridgeGym1FWarpEffectFuncs[])(struct Task *, struct EventObject *, struct Sprite *) =
{
sub_80B7AE8,
sub_80B7B18,
sub_80B7B94,
sub_80B7BCC,
sub_80B7BF4,
LavaridgeGym1FWarpEffect_1,
LavaridgeGym1FWarpEffect_2,
LavaridgeGym1FWarpEffect_3,
LavaridgeGym1FWarpEffect_4,
LavaridgeGym1FWarpEffect_5,
};
void (*const gEscapeRopeFieldEffectFuncs[])(struct Task *) =
@ -1428,7 +1427,7 @@ void ReturnToFieldFromFlyMapSelect(void)
static void FieldCallback_Fly(void)
{
pal_fill_black();
FadeInFromBlack();
CreateTask(task00_8084310, 0);
ScriptContext2_Enable();
FreezeEventObjects();
@ -1466,7 +1465,7 @@ static void task00_8084310(u8 taskId)
static void mapldr_08084390(void)
{
Overworld_PlaySpecialMapMusic();
pal_fill_black();
FadeInFromBlack();
CreateTask(c3_080843F8, 0);
gEventObjects[gPlayerAvatar.eventObjectId].invisible = TRUE;
if (gPlayerAvatar.flags & 0x08)
@ -1499,24 +1498,24 @@ static void c3_080843F8(u8 taskId)
}
}
void sub_80B6B68(void)
void FieldCB_FallWarpExit(void)
{
Overworld_PlaySpecialMapMusic();
pal_fill_for_maplights();
WarpFadeInScreen();
ScriptContext2_Enable();
FreezeEventObjects();
CreateTask(sub_80B6B94, 0);
CreateTask(Task_FallWarpFieldEffect, 0);
gFieldCallback = NULL;
}
static void sub_80B6B94(u8 taskId)
static void Task_FallWarpFieldEffect(u8 taskId)
{
struct Task *task;
task = &gTasks[taskId];
while (gUnknown_0855C3C8[task->data[0]](task)); // return code signifies whether to continue blocking here
while (sFallWarpFieldEffectFuncs[task->data[0]](task)); // return code signifies whether to continue blocking here
}
static bool8 sub_80B6BCC(struct Task *task) // gUnknown_0855C3C8[0]
static bool8 FallWarpEffect_1(struct Task *task)
{
struct EventObject *playerObject;
struct Sprite *playerSprite;
@ -1534,7 +1533,7 @@ static bool8 sub_80B6BCC(struct Task *task) // gUnknown_0855C3C8[0]
return TRUE;
}
static bool8 sub_80B6C74(struct Task *task) // gUnknown_0855C3C8[1]
static bool8 FallWarpEffect_2(struct Task *task)
{
if (IsWeatherNotFadingIn())
{
@ -1543,7 +1542,7 @@ static bool8 sub_80B6C74(struct Task *task) // gUnknown_0855C3C8[1]
return FALSE;
}
static bool8 sub_80B6C90(struct Task *task) // gUnknown_0855C3C8[2]
static bool8 FallWarpEffect_3(struct Task *task)
{
struct Sprite *sprite;
s16 centerToCornerVecY;
@ -1558,7 +1557,7 @@ static bool8 sub_80B6C90(struct Task *task) // gUnknown_0855C3C8[2]
return FALSE;
}
static bool8 sub_80B6D04(struct Task *task)
static bool8 FallWarpEffect_4(struct Task *task)
{
struct EventObject *eventObject;
struct Sprite *sprite;
@ -1592,7 +1591,7 @@ static bool8 sub_80B6D04(struct Task *task)
return FALSE;
}
static bool8 sub_80B6DBC(struct Task *task)
static bool8 FallWarpEffect_5(struct Task *task)
{
task->data[0]++;
task->data[1] = 4;
@ -1601,7 +1600,7 @@ static bool8 sub_80B6DBC(struct Task *task)
return TRUE;
}
static bool8 sub_80B6DD8(struct Task *task)
static bool8 FallWarpEffect_6(struct Task *task)
{
SetCameraPanning(0, task->data[1]);
task->data[1] = -task->data[1];
@ -1617,36 +1616,36 @@ static bool8 sub_80B6DD8(struct Task *task)
return FALSE;
}
static bool8 sub_80B6E18(struct Task *task)
static bool8 FallWarpEffect_7(struct Task *task)
{
gPlayerAvatar.preventStep = FALSE;
ScriptContext2_Disable();
CameraObjectReset1();
UnfreezeEventObjects();
InstallCameraPanAheadCallback();
DestroyTask(FindTaskIdByFunc(sub_80B6B94));
DestroyTask(FindTaskIdByFunc(Task_FallWarpFieldEffect));
return FALSE;
}
void sub_80B6E4C(u8 a0, u8 priority)
void StartEscalatorWarp(u8 metatileBehavior, u8 priority)
{
u8 taskId;
taskId = CreateTask(sub_80B6E88, priority);
taskId = CreateTask(Task_EscalatorWarpFieldEffect, priority);
gTasks[taskId].data[1] = 0;
if (a0 == 0x6a)
if (metatileBehavior == MB_UP_ESCALATOR)
{
gTasks[taskId].data[1] = 1;
}
}
static void sub_80B6E88(u8 taskId)
static void Task_EscalatorWarpFieldEffect(u8 taskId)
{
struct Task *task;
task = &gTasks[taskId];
while (gUnknown_0855C3E4[task->data[0]](task));
while (sEscalatorWarpFieldEffectFuncs[task->data[0]](task));
}
static bool8 sub_80B6EC0(struct Task *task)
static bool8 EscalatorWarpEffect_1(struct Task *task)
{
FreezeEventObjects();
CameraObjectReset2();
@ -1655,7 +1654,7 @@ static bool8 sub_80B6EC0(struct Task *task)
return FALSE;
}
static bool8 sub_80B6EE0(struct Task *task)
static bool8 EscalatorWarpEffect_2(struct Task *task)
{
struct EventObject *eventObject;
eventObject = &gEventObjects[gPlayerAvatar.eventObjectId];
@ -1674,7 +1673,7 @@ static bool8 sub_80B6EE0(struct Task *task)
return FALSE;
}
static bool8 sub_80B6F50(struct Task *task)
static bool8 EscalatorWarpEffect_3(struct Task *task)
{
sub_80B6FB8(task);
if (task->data[2] > 3)
@ -1685,14 +1684,14 @@ static bool8 sub_80B6F50(struct Task *task)
return FALSE;
}
static bool8 sub_80B6F74(struct Task *task)
static bool8 EscalatorWarpEffect_4(struct Task *task)
{
sub_80B6FB8(task);
sub_80B7060();
return FALSE;
}
static bool8 sub_80B6F84(struct Task *task)
static bool8 EscalatorWarpEffect_5(struct Task *task)
{
sub_80B7004(task);
if (task->data[2] > 3)
@ -1703,7 +1702,7 @@ static bool8 sub_80B6F84(struct Task *task)
return FALSE;
}
static bool8 sub_80B6FA8(struct Task *task)
static bool8 EscalatorWarpEffect_6(struct Task *task)
{
sub_80B7004(task);
sub_80B7060();
@ -1739,7 +1738,7 @@ static void sub_80B7004(struct Task *task)
static void sub_80B7050(void)
{
TryFadeOutOldMapMusic();
WarpFadeScreen();
WarpFadeOutScreen();
}
static void sub_80B7060(void)
@ -1750,14 +1749,14 @@ static void sub_80B7060(void)
WarpIntoMap();
gFieldCallback = sub_80B70B4;
SetMainCallback2(CB2_LoadMap);
DestroyTask(FindTaskIdByFunc(sub_80B6E88));
DestroyTask(FindTaskIdByFunc(Task_EscalatorWarpFieldEffect));
}
}
static void sub_80B70B4(void)
{
Overworld_PlaySpecialMapMusic();
pal_fill_for_maplights();
WarpFadeInScreen();
ScriptContext2_Enable();
CreateTask(sub_80B70DC, 0);
gFieldCallback = NULL;
@ -1994,17 +1993,17 @@ static bool8 dive_3_unknown(struct Task *task)
return FALSE;
}
void sub_80B75D8(u8 priority)
void StartLavaridgeGymB1FWarp(u8 priority)
{
CreateTask(sub_80B75F0, priority);
CreateTask(Task_LavaridgeGymB1FWarp, priority);
}
static void sub_80B75F0(u8 taskId)
static void Task_LavaridgeGymB1FWarp(u8 taskId)
{
while (gUnknown_0855C438[gTasks[taskId].data[0]](&gTasks[taskId], &gEventObjects[gPlayerAvatar.eventObjectId], &gSprites[gPlayerAvatar.spriteId]));
while (sLavaridgeGymB1FWarpEffectFuncs[gTasks[taskId].data[0]](&gTasks[taskId], &gEventObjects[gPlayerAvatar.eventObjectId], &gSprites[gPlayerAvatar.spriteId]));
}
static bool8 sub_80B764C(struct Task *task, struct EventObject *eventObject, struct Sprite *sprite)
static bool8 LavaridgeGymB1FWarpEffect_1(struct Task *task, struct EventObject *eventObject, struct Sprite *sprite)
{
FreezeEventObjects();
CameraObjectReset2();
@ -2016,7 +2015,7 @@ static bool8 sub_80B764C(struct Task *task, struct EventObject *eventObject, str
return TRUE;
}
static bool8 sub_80B7684(struct Task *task, struct EventObject *eventObject, struct Sprite *sprite)
static bool8 LavaridgeGymB1FWarpEffect_2(struct Task *task, struct EventObject *eventObject, struct Sprite *sprite)
{
SetCameraPanning(0, task->data[1]);
task->data[1] = -task->data[1];
@ -2029,7 +2028,7 @@ static bool8 sub_80B7684(struct Task *task, struct EventObject *eventObject, str
return FALSE;
}
static bool8 sub_80B76B8(struct Task *task, struct EventObject *eventObject, struct Sprite *sprite)
static bool8 LavaridgeGymB1FWarpEffect_3(struct Task *task, struct EventObject *eventObject, struct Sprite *sprite)
{
sprite->pos2.y = 0;
task->data[3] = 1;
@ -2043,7 +2042,7 @@ static bool8 sub_80B76B8(struct Task *task, struct EventObject *eventObject, str
return TRUE;
}
static bool8 sub_80B7704(struct Task *task, struct EventObject *eventObject, struct Sprite *sprite)
static bool8 LavaridgeGymB1FWarpEffect_4(struct Task *task, struct EventObject *eventObject, struct Sprite *sprite)
{
s16 centerToCornerVecY;
SetCameraPanning(0, task->data[1]);
@ -2086,41 +2085,41 @@ static bool8 sub_80B7704(struct Task *task, struct EventObject *eventObject, str
return FALSE;
}
static bool8 sub_80B77F8(struct Task *task, struct EventObject *eventObject, struct Sprite *sprite)
static bool8 LavaridgeGymB1FWarpEffect_5(struct Task *task, struct EventObject *eventObject, struct Sprite *sprite)
{
TryFadeOutOldMapMusic();
WarpFadeScreen();
WarpFadeOutScreen();
task->data[0]++;
return FALSE;
}
static bool8 sub_80B7814(struct Task *task, struct EventObject *eventObject, struct Sprite *sprite)
static bool8 LavaridgeGymB1FWarpEffect_6(struct Task *task, struct EventObject *eventObject, struct Sprite *sprite)
{
if (!gPaletteFade.active && BGMusicStopped() == TRUE)
{
WarpIntoMap();
gFieldCallback = mapldr_080851BC;
gFieldCallback = FieldCB_LavaridgeGymB1FWarpExit;
SetMainCallback2(CB2_LoadMap);
DestroyTask(FindTaskIdByFunc(sub_80B75F0));
DestroyTask(FindTaskIdByFunc(Task_LavaridgeGymB1FWarp));
}
return FALSE;
}
static void mapldr_080851BC(void)
static void FieldCB_LavaridgeGymB1FWarpExit(void)
{
Overworld_PlaySpecialMapMusic();
pal_fill_for_maplights();
WarpFadeInScreen();
ScriptContext2_Enable();
gFieldCallback = NULL;
CreateTask(sub_80B7890, 0);
CreateTask(Task_LavaridgeGymB1FWarpExit, 0);
}
static void sub_80B7890(u8 taskId)
static void Task_LavaridgeGymB1FWarpExit(u8 taskId)
{
while (gUnknown_0855C450[gTasks[taskId].data[0]](&gTasks[taskId], &gEventObjects[gPlayerAvatar.eventObjectId], &gSprites[gPlayerAvatar.spriteId]));
while (sLavaridgeGymB1FWarpExitEffectFuncs[gTasks[taskId].data[0]](&gTasks[taskId], &gEventObjects[gPlayerAvatar.eventObjectId], &gSprites[gPlayerAvatar.spriteId]));
}
static bool8 sub_80B78EC(struct Task *task, struct EventObject *eventObject, struct Sprite *sprite)
static bool8 LavaridgeGymB1FWarpExitEffect_1(struct Task *task, struct EventObject *eventObject, struct Sprite *sprite)
{
CameraObjectReset2();
FreezeEventObjects();
@ -2130,7 +2129,7 @@ static bool8 sub_80B78EC(struct Task *task, struct EventObject *eventObject, str
return FALSE;
}
static bool8 sub_80B791C(struct Task *task, struct EventObject *eventObject, struct Sprite *sprite)
static bool8 LavaridgeGymB1FWarpExitEffect_2(struct Task *task, struct EventObject *eventObject, struct Sprite *sprite)
{
if (IsWeatherNotFadingIn())
{
@ -2144,7 +2143,7 @@ static bool8 sub_80B791C(struct Task *task, struct EventObject *eventObject, str
return FALSE;
}
static bool8 sub_80B7968(struct Task *task, struct EventObject *eventObject, struct Sprite *sprite)
static bool8 LavaridgeGymB1FWarpExitEffect_3(struct Task *task, struct EventObject *eventObject, struct Sprite *sprite)
{
sprite = &gSprites[task->data[1]];
if (sprite->animCmdIndex > 1)
@ -2158,18 +2157,19 @@ static bool8 sub_80B7968(struct Task *task, struct EventObject *eventObject, str
return FALSE;
}
static bool8 sub_80B79BC(struct Task *task, struct EventObject *eventObject, struct Sprite *sprite)
static bool8 LavaridgeGymB1FWarpExitEffect_4(struct Task *task, struct EventObject *eventObject, struct Sprite *sprite)
{
if (EventObjectClearHeldMovementIfFinished(eventObject))
{
gPlayerAvatar.preventStep = FALSE;
ScriptContext2_Disable();
UnfreezeEventObjects();
DestroyTask(FindTaskIdByFunc(sub_80B7890));
DestroyTask(FindTaskIdByFunc(Task_LavaridgeGymB1FWarpExit));
}
return FALSE;
}
// For the ash puff effect when warping off the B1F ash tiles
u8 FldEff_LavaridgeGymWarp(void)
{
u8 spriteId;
@ -2180,7 +2180,7 @@ u8 FldEff_LavaridgeGymWarp(void)
return spriteId;
}
void sub_80B7A58(struct Sprite *sprite)
void SpriteCB_LavaridgeGymWarp(struct Sprite *sprite)
{
if (sprite->animEnded)
{
@ -2188,17 +2188,17 @@ void sub_80B7A58(struct Sprite *sprite)
}
}
void sub_80B7A74(u8 priority)
void StartLavaridgeGym1FWarp(u8 priority)
{
CreateTask(sub_80B7A8C, priority);
CreateTask(Task_LavaridgeGym1FWarp, priority);
}
static void sub_80B7A8C(u8 taskId)
static void Task_LavaridgeGym1FWarp(u8 taskId)
{
while(gUnknown_0855C460[gTasks[taskId].data[0]](&gTasks[taskId], &gEventObjects[gPlayerAvatar.eventObjectId], &gSprites[gPlayerAvatar.spriteId]));
while(sLavaridgeGym1FWarpEffectFuncs[gTasks[taskId].data[0]](&gTasks[taskId], &gEventObjects[gPlayerAvatar.eventObjectId], &gSprites[gPlayerAvatar.spriteId]));
}
static bool8 sub_80B7AE8(struct Task *task, struct EventObject *eventObject, struct Sprite *sprite)
static bool8 LavaridgeGym1FWarpEffect_1(struct Task *task, struct EventObject *eventObject, struct Sprite *sprite)
{
FreezeEventObjects();
CameraObjectReset2();
@ -2208,7 +2208,7 @@ static bool8 sub_80B7AE8(struct Task *task, struct EventObject *eventObject, str
return FALSE;
}
static bool8 sub_80B7B18(struct Task *task, struct EventObject *eventObject, struct Sprite *sprite)
static bool8 LavaridgeGym1FWarpEffect_2(struct Task *task, struct EventObject *eventObject, struct Sprite *sprite)
{
if (EventObjectClearHeldMovementIfFinished(eventObject))
{
@ -2230,7 +2230,7 @@ static bool8 sub_80B7B18(struct Task *task, struct EventObject *eventObject, str
return FALSE;
}
static bool8 sub_80B7B94(struct Task *task, struct EventObject *eventObject, struct Sprite *sprite)
static bool8 LavaridgeGym1FWarpEffect_3(struct Task *task, struct EventObject *eventObject, struct Sprite *sprite)
{
if (gSprites[task->data[1]].animCmdIndex == 2)
{
@ -2240,25 +2240,25 @@ static bool8 sub_80B7B94(struct Task *task, struct EventObject *eventObject, str
return FALSE;
}
static bool8 sub_80B7BCC(struct Task *task, struct EventObject *eventObject, struct Sprite *sprite)
static bool8 LavaridgeGym1FWarpEffect_4(struct Task *task, struct EventObject *eventObject, struct Sprite *sprite)
{
if (!FieldEffectActiveListContains(FLDEFF_POP_OUT_OF_ASH))
{
TryFadeOutOldMapMusic();
WarpFadeScreen();
WarpFadeOutScreen();
task->data[0]++;
}
return FALSE;
}
static bool8 sub_80B7BF4(struct Task *task, struct EventObject *eventObject, struct Sprite *sprite)
static bool8 LavaridgeGym1FWarpEffect_5(struct Task *task, struct EventObject *eventObject, struct Sprite *sprite)
{
if (!gPaletteFade.active && BGMusicStopped() == TRUE)
{
WarpIntoMap();
gFieldCallback = sub_80B6B68;
gFieldCallback = FieldCB_FallWarpExit;
SetMainCallback2(CB2_LoadMap);
DestroyTask(FindTaskIdByFunc(sub_80B7A8C));
DestroyTask(FindTaskIdByFunc(Task_LavaridgeGym1FWarp));
}
return FALSE;
}
@ -2273,7 +2273,7 @@ u8 FldEff_PopOutOfAsh(void)
return spriteId;
}
void sub_80B7CAC(struct Sprite *sprite)
void SpriteCB_PopOutOfAsh(struct Sprite *sprite)
{
if (sprite->animEnded)
{
@ -2307,7 +2307,7 @@ static void EscapeRopeFieldEffect_Step1(struct Task *task)
if (task->data[14] != 0 && (--task->data[14]) == 0)
{
TryFadeOutOldMapMusic();
WarpFadeScreen();
WarpFadeOutScreen();
}
eventObject = &gEventObjects[gPlayerAvatar.eventObjectId];
if (!EventObjectIsMovementOverridden(eventObject) || EventObjectClearHeldMovementIfFinished(eventObject))
@ -2340,7 +2340,7 @@ void (*const gUnknown_0855C484[])(struct Task *) = {
static void mapldr_080859D4(void)
{
Overworld_PlaySpecialMapMusic();
pal_fill_for_maplights();
WarpFadeInScreen();
ScriptContext2_Enable();
FreezeEventObjects();
gFieldCallback = NULL;
@ -2460,7 +2460,7 @@ static void TeleportFieldEffectTask3(struct Task *task)
{
task->data[0]++;
TryFadeOutOldMapMusic();
WarpFadeScreen();
WarpFadeOutScreen();
}
}
@ -2488,7 +2488,7 @@ static void TeleportFieldEffectTask4(struct Task *task)
static void mapldr_08085D88(void)
{
Overworld_PlaySpecialMapMusic();
pal_fill_for_maplights();
WarpFadeInScreen();
ScriptContext2_Enable();
FreezeEventObjects();
gFieldCallback = NULL;
@ -3268,7 +3268,7 @@ static void sub_80B9474(struct Task *task)
{
if (sub_80B9508(task->data[1]))
{
WarpFadeScreen();
WarpFadeOutScreen();
task->data[0]++;
}
}

View File

@ -1396,11 +1396,11 @@ void InitPlayerAvatar(s16 x, s16 y, u8 direction, u8 gender)
SetPlayerAvatarStateMask(PLAYER_AVATAR_FLAG_5 | PLAYER_AVATAR_FLAG_ON_FOOT);
}
void sub_808C0A8(u8 a)
void SetPlayerInvisibility(bool8 invisible)
{
gEventObjects[gPlayerAvatar.eventObjectId].invisible = a;
gEventObjects[gPlayerAvatar.eventObjectId].invisible = invisible;
if (TestPlayerAvatarFlags(PLAYER_AVATAR_FLAG_SURFING))
gSprites[gEventObjects[gPlayerAvatar.eventObjectId].fieldEffectSpriteId].invisible = a;
gSprites[gEventObjects[gPlayerAvatar.eventObjectId].fieldEffectSpriteId].invisible = invisible;
}
void sub_808C114(void)

View File

@ -28,6 +28,7 @@
#include "task.h"
#include "text.h"
#include "constants/event_object_movement_constants.h"
#include "constants/event_objects.h"
#include "constants/songs.h"
#include "constants/rgb.h"
#include "trainer_hill.h"
@ -38,21 +39,21 @@ extern const u16 gOrbEffectBackgroundLayerFlags[];
// This file's functions.
static void sub_8080B9C(u8);
static void task_map_chg_seq_0807E20C(u8);
static void task_map_chg_seq_0807E2CC(u8);
static void Task_ExitNonAnimDoor(u8);
static void Task_ExitNonDoor(u8);
static void task0A_fade_n_map_maybe(u8);
static void sub_808115C(u8);
static void palette_bg_faded_fill_white(void);
static void sub_80AF438(u8);
static void FillPalBufferWhite(void);
static void Task_ExitDoor(u8);
static bool32 WaitForWeatherFadeIn(void);
static void task0A_mpl_807E31C(u8 taskId);
static void sub_80AFA0C(u8 taskId);
static void sub_80AFA88(u8 taskId);
static void Task_WarpAndLoadMap(u8 taskId);
static void Task_DoDoorWarp(u8 taskId);
static void Task_EnableScriptAfterMusicFade(u8 taskId);
// const
const u16 sFlashLevelPixelRadii[] = { 200, 72, 64, 56, 48, 40, 32, 24, 0 };
const s32 gMaxFlashLevel = 8;
static const u16 sFlashLevelPixelRadii[] = { 200, 72, 64, 56, 48, 40, 32, 24, 0 };
const s32 gMaxFlashLevel = ARRAY_COUNT(sFlashLevelPixelRadii) - 1;
const struct ScanlineEffectParams sFlashEffectParams =
{
@ -62,44 +63,44 @@ const struct ScanlineEffectParams sFlashEffectParams =
};
// code
static void palette_bg_faded_fill_white(void)
static void FillPalBufferWhite(void)
{
CpuFastFill16(RGB_WHITE, gPlttBufferFaded, PLTT_SIZE);
}
static void palette_bg_faded_fill_black(void)
static void FillPalBufferBlack(void)
{
CpuFastFill16(RGB_BLACK, gPlttBufferFaded, PLTT_SIZE);
}
void pal_fill_for_maplights(void)
void WarpFadeInScreen(void)
{
u8 previousMapType = GetLastUsedWarpMapType();
switch (GetMapPairFadeFromType(previousMapType, GetCurrentMapType()))
{
case 0:
palette_bg_faded_fill_black();
FillPalBufferBlack();
FadeScreen(FADE_FROM_BLACK, 0);
break;
case 1:
palette_bg_faded_fill_white();
FillPalBufferWhite();
FadeScreen(FADE_FROM_WHITE, 0);
}
}
static void sub_80AF08C(void)
void FadeInFromWhite(void)
{
palette_bg_faded_fill_white();
FillPalBufferWhite();
FadeScreen(FADE_FROM_WHITE, 8);
}
void pal_fill_black(void)
void FadeInFromBlack(void)
{
palette_bg_faded_fill_black();
FillPalBufferBlack();
FadeScreen(FADE_FROM_BLACK, 0);
}
void WarpFadeScreen(void)
void WarpFadeOutScreen(void)
{
u8 currentMapType = GetCurrentMapType();
switch (GetMapPairFadeToType(currentMapType, GetDestinationWarpMapHeader()->mapType))
@ -112,26 +113,26 @@ void WarpFadeScreen(void)
}
}
static void sub_80AF0F4(u8 arg)
static void SetPlayerVisibility(bool8 visible)
{
sub_808C0A8(!arg);
SetPlayerInvisibility(!visible);
}
static void task0A_nop_for_a_while(u8 taskId)
static void Task_WaitForUnionRoomFade(u8 taskId)
{
if (WaitForWeatherFadeIn() == TRUE)
DestroyTask(taskId);
}
void sub_80AF128(void)
void FieldCB_ContinueScriptUnionRoom(void)
{
ScriptContext2_Enable();
Overworld_PlaySpecialMapMusic();
pal_fill_black();
CreateTask(task0A_nop_for_a_while, 10);
FadeInFromBlack();
CreateTask(Task_WaitForUnionRoomFade, 10);
}
static void task0A_asap_script_env_2_enable_and_set_ctx_running(u8 taskID)
static void Task_WaitForFadeAndEnableScriptCtx(u8 taskID)
{
if (WaitForWeatherFadeIn() == TRUE)
{
@ -140,22 +141,22 @@ static void task0A_asap_script_env_2_enable_and_set_ctx_running(u8 taskID)
}
}
void FieldCallback_ReturnToEventScript2(void)
void FieldCB_ContinueScriptHandleMusic(void)
{
ScriptContext2_Enable();
Overworld_PlaySpecialMapMusic();
pal_fill_black();
CreateTask(task0A_asap_script_env_2_enable_and_set_ctx_running, 10);
FadeInFromBlack();
CreateTask(Task_WaitForFadeAndEnableScriptCtx, 10);
}
void sub_80AF188(void)
void FieldCB_ContinueScript(void)
{
ScriptContext2_Enable();
pal_fill_black();
CreateTask(task0A_asap_script_env_2_enable_and_set_ctx_running, 10);
FadeInFromBlack();
CreateTask(Task_WaitForFadeAndEnableScriptCtx, 10);
}
static void task_mpl_807DD60(u8 taskId)
static void Task_ReturnToFieldCableLink(u8 taskId)
{
struct Task *task = &gTasks[taskId];
@ -168,7 +169,7 @@ static void task_mpl_807DD60(u8 taskId)
case 1:
if (gTasks[task->data[1]].isActive != TRUE)
{
pal_fill_for_maplights();
WarpFadeInScreen();
task->data[0]++;
}
break;
@ -182,15 +183,15 @@ static void task_mpl_807DD60(u8 taskId)
}
}
void sub_80AF214(void)
void FieldCB_ReturnToFieldCableLink(void)
{
ScriptContext2_Enable();
Overworld_PlaySpecialMapMusic();
palette_bg_faded_fill_black();
CreateTask(task_mpl_807DD60, 10);
FillPalBufferBlack();
CreateTask(Task_ReturnToFieldCableLink, 10);
}
static void sub_80AF234(u8 taskId)
static void Task_ReturnToFieldWirelessLink(u8 taskId)
{
struct Task *task = &gTasks[taskId];
@ -208,7 +209,7 @@ static void sub_80AF234(u8 taskId)
}
else
{
pal_fill_for_maplights();
WarpFadeInScreen();
task->data[0]++;
}
break;
@ -223,7 +224,7 @@ static void sub_80AF234(u8 taskId)
}
}
void sub_80AF2B4(u8 taskId)
void Task_ReturnToFieldRecordMixing(u8 taskId)
{
struct Task *task = &gTasks[taskId];
@ -248,15 +249,15 @@ void sub_80AF2B4(u8 taskId)
}
}
void sub_80AF314(void)
void FieldCB_ReturnToFieldWirelessLink(void)
{
ScriptContext2_Enable();
Overworld_PlaySpecialMapMusic();
palette_bg_faded_fill_black();
CreateTask(sub_80AF234, 10);
FillPalBufferBlack();
CreateTask(Task_ReturnToFieldWirelessLink, 10);
}
static void sub_80AF334(void)
static void SetUpWarpExitTask(void)
{
s16 x, y;
u8 behavior;
@ -265,59 +266,59 @@ static void sub_80AF334(void)
PlayerGetDestCoords(&x, &y);
behavior = MapGridGetMetatileBehaviorAt(x, y);
if (MetatileBehavior_IsDoor(behavior) == TRUE)
func = sub_80AF438;
func = Task_ExitDoor;
else if (MetatileBehavior_IsNonAnimDoor(behavior) == TRUE)
func = task_map_chg_seq_0807E20C;
func = Task_ExitNonAnimDoor;
else
func = task_map_chg_seq_0807E2CC;
func = Task_ExitNonDoor;
CreateTask(func, 10);
}
void mapldr_default(void)
void FieldCB_DefaultWarpExit(void)
{
Overworld_PlaySpecialMapMusic();
pal_fill_for_maplights();
sub_80AF334();
WarpFadeInScreen();
SetUpWarpExitTask();
ScriptContext2_Enable();
}
void sub_80AF3B0(void)
void FieldCB_WarpExitFadeFromWhite(void)
{
Overworld_PlaySpecialMapMusic();
sub_80AF08C();
sub_80AF334();
FadeInFromWhite();
SetUpWarpExitTask();
ScriptContext2_Enable();
}
void sub_80AF3C8(void)
void FieldCB_WarpExitFadeFromBlack(void)
{
if (!sub_81D6534())
if (!sub_81D6534()) // sub_81D6534 always returns false
Overworld_PlaySpecialMapMusic();
pal_fill_black();
sub_80AF334();
FadeInFromBlack();
SetUpWarpExitTask();
ScriptContext2_Enable();
}
void sub_80AF3E8(void)
static void FieldCB_TeleportWarpExit(void)
{
Overworld_PlaySpecialMapMusic();
pal_fill_for_maplights();
WarpFadeInScreen();
PlaySE(SE_TK_WARPOUT);
CreateTask(task0A_mpl_807E31C, 10);
ScriptContext2_Enable();
}
void sub_80AF40C(void)
static void FieldCB_MossdeepGymWarpExit(void)
{
Overworld_PlaySpecialMapMusic();
pal_fill_for_maplights();
WarpFadeInScreen();
PlaySE(SE_TK_WARPOUT);
CreateTask(task_map_chg_seq_0807E2CC, 10);
CreateTask(Task_ExitNonDoor, 10);
ScriptContext2_Enable();
sub_8085540(0xE);
}
static void sub_80AF438(u8 taskId)
static void Task_ExitDoor(u8 taskId)
{
struct Task *task = &gTasks[taskId];
s16 *x = &task->data[2];
@ -326,7 +327,7 @@ static void sub_80AF438(u8 taskId)
switch (task->data[0])
{
case 0:
sub_80AF0F4(0);
SetPlayerVisibility(FALSE);
FreezeEventObjects();
PlayerGetDestCoords(x, y);
FieldSetDoorOpened(*x, *y);
@ -336,18 +337,18 @@ static void sub_80AF438(u8 taskId)
if (WaitForWeatherFadeIn())
{
u8 eventObjId;
sub_80AF0F4(1);
eventObjId = GetEventObjectIdByLocalIdAndMap(0xFF, 0, 0);
SetPlayerVisibility(TRUE);
eventObjId = GetEventObjectIdByLocalIdAndMap(EVENT_OBJ_ID_PLAYER, 0, 0);
EventObjectSetHeldMovement(&gEventObjects[eventObjId], MOVEMENT_ACTION_WALK_NORMAL_DOWN);
task->data[0] = 2;
}
break;
case 2:
if (walkrun_is_standing_still())
if (IsPlayerStandingStill())
{
u8 eventObjId;
task->data[1] = FieldAnimateDoorClose(*x, *y);
eventObjId = GetEventObjectIdByLocalIdAndMap(0xFF, 0, 0);
eventObjId = GetEventObjectIdByLocalIdAndMap(EVENT_OBJ_ID_PLAYER, 0, 0);
EventObjectClearHeldMovementIfFinished(&gEventObjects[eventObjId]);
task->data[0] = 3;
}
@ -366,7 +367,7 @@ static void sub_80AF438(u8 taskId)
}
}
static void task_map_chg_seq_0807E20C(u8 taskId)
static void Task_ExitNonAnimDoor(u8 taskId)
{
struct Task *task = &gTasks[taskId];
s16 *x = &task->data[2];
@ -375,7 +376,7 @@ static void task_map_chg_seq_0807E20C(u8 taskId)
switch (task->data[0])
{
case 0:
sub_80AF0F4(0);
SetPlayerVisibility(FALSE);
FreezeEventObjects();
PlayerGetDestCoords(x, y);
task->data[0] = 1;
@ -384,14 +385,14 @@ static void task_map_chg_seq_0807E20C(u8 taskId)
if (WaitForWeatherFadeIn())
{
u8 eventObjId;
sub_80AF0F4(1);
eventObjId = GetEventObjectIdByLocalIdAndMap(0xFF, 0, 0);
SetPlayerVisibility(TRUE);
eventObjId = GetEventObjectIdByLocalIdAndMap(EVENT_OBJ_ID_PLAYER, 0, 0);
EventObjectSetHeldMovement(&gEventObjects[eventObjId], GetWalkNormalMovementAction(GetPlayerFacingDirection()));
task->data[0] = 2;
}
break;
case 2:
if (walkrun_is_standing_still())
if (IsPlayerStandingStill())
{
UnfreezeEventObjects();
task->data[0] = 3;
@ -404,7 +405,7 @@ static void task_map_chg_seq_0807E20C(u8 taskId)
}
}
static void task_map_chg_seq_0807E2CC(u8 taskId)
static void Task_ExitNonDoor(u8 taskId)
{
switch (gTasks[taskId].data[0])
{
@ -424,7 +425,7 @@ static void task_map_chg_seq_0807E2CC(u8 taskId)
}
}
static void sub_80AF660(u8 taskId)
static void Task_WaitForFadeShowStartMenu(u8 taskId)
{
if (WaitForWeatherFadeIn() == TRUE)
{
@ -433,16 +434,16 @@ static void sub_80AF660(u8 taskId)
}
}
void sub_80AF688(void)
void ReturnToFieldOpenStartMenu(void)
{
pal_fill_black();
CreateTask(sub_80AF660, 0x50);
FadeInFromBlack();
CreateTask(Task_WaitForFadeShowStartMenu, 0x50);
ScriptContext2_Enable();
}
bool8 sub_80AF6A4(void)
bool8 FieldCB_ReturnToFieldOpenStartMenu(void)
{
sub_809FA18();
ShowReturnToFieldStartMenu();
return FALSE;
}
@ -459,7 +460,7 @@ static void task_mpl_807E3C8(u8 taskId)
void sub_80AF6D4(void)
{
ScriptContext2_Enable();
pal_fill_black();
FadeInFromBlack();
CreateTask(task_mpl_807E3C8, 10);
}
@ -467,7 +468,7 @@ void sub_80AF6F0(void)
{
ScriptContext2_Enable();
Overworld_PlaySpecialMapMusic();
pal_fill_black();
FadeInFromBlack();
CreateTask(task_mpl_807E3C8, 10);
}
@ -488,72 +489,72 @@ void DoWarp(void)
{
ScriptContext2_Enable();
TryFadeOutOldMapMusic();
WarpFadeScreen();
WarpFadeOutScreen();
PlayRainStoppingSoundEffect();
PlaySE(SE_KAIDAN);
gFieldCallback = mapldr_default;
CreateTask(sub_80AFA0C, 10);
gFieldCallback = FieldCB_DefaultWarpExit;
CreateTask(Task_WarpAndLoadMap, 10);
}
void DoDiveWarp(void)
{
ScriptContext2_Enable();
TryFadeOutOldMapMusic();
WarpFadeScreen();
WarpFadeOutScreen();
PlayRainStoppingSoundEffect();
gFieldCallback = mapldr_default;
CreateTask(sub_80AFA0C, 10);
gFieldCallback = FieldCB_DefaultWarpExit;
CreateTask(Task_WarpAndLoadMap, 10);
}
void sub_80AF79C(void)
void DoSootopolisLegendWarp(void)
{
ScriptContext2_Enable();
TryFadeOutOldMapMusic();
FadeScreen(FADE_TO_WHITE, 8);
PlayRainStoppingSoundEffect();
gFieldCallback = sub_80AF3B0;
CreateTask(sub_80AFA0C, 10);
gFieldCallback = FieldCB_WarpExitFadeFromWhite;
CreateTask(Task_WarpAndLoadMap, 10);
}
void DoDoorWarp(void)
{
ScriptContext2_Enable();
gFieldCallback = mapldr_default;
CreateTask(sub_80AFA88, 10);
gFieldCallback = FieldCB_DefaultWarpExit;
CreateTask(Task_DoDoorWarp, 10);
}
void DoFallWarp(void)
{
DoDiveWarp();
gFieldCallback = sub_80B6B68;
gFieldCallback = FieldCB_FallWarpExit;
}
void sub_80AF80C(u8 metatileBehavior)
void DoEscalatorWarp(u8 metatileBehavior)
{
ScriptContext2_Enable();
sub_80B6E4C(metatileBehavior, 10);
StartEscalatorWarp(metatileBehavior, 10);
}
void sub_80AF828(void)
void DoLavaridgeGymB1FWarp(void)
{
ScriptContext2_Enable();
sub_80B75D8(10);
StartLavaridgeGymB1FWarp(10);
}
void sub_80AF838(void)
void DoLavaridgeGym1FWarp(void)
{
ScriptContext2_Enable();
sub_80B7A74(10);
StartLavaridgeGym1FWarp(10);
}
void sub_80AF848(void)
void DoTeleportWarp(void)
{
ScriptContext2_Enable();
TryFadeOutOldMapMusic();
WarpFadeScreen();
WarpFadeOutScreen();
PlaySE(SE_TK_WARPIN);
CreateTask(sub_80AFA0C, 10);
gFieldCallback = sub_80AF3E8;
CreateTask(Task_WarpAndLoadMap, 10);
gFieldCallback = FieldCB_TeleportWarpExit;
}
void DoMossdeepGymWarp(void)
@ -562,18 +563,18 @@ void DoMossdeepGymWarp(void)
ScriptContext2_Enable();
SaveEventObjects();
TryFadeOutOldMapMusic();
WarpFadeScreen();
WarpFadeOutScreen();
PlaySE(SE_TK_WARPIN);
CreateTask(sub_80AFA0C, 10);
gFieldCallback = sub_80AF40C;
CreateTask(Task_WarpAndLoadMap, 10);
gFieldCallback = FieldCB_MossdeepGymWarpExit;
}
void sub_80AF8B8(void)
void DoPortholeWarp(void)
{
ScriptContext2_Enable();
WarpFadeScreen();
CreateTask(sub_80AFA0C, 10);
gFieldCallback = sub_80FB768;
WarpFadeOutScreen();
CreateTask(Task_WarpAndLoadMap, 10);
gFieldCallback = FieldCB_ShowPortholeView;
}
static void sub_80AF8E0(u8 taskId)
@ -592,17 +593,17 @@ static void sub_80AF8E0(u8 taskId)
break;
case 2:
WarpIntoMap();
SetMainCallback2(sub_8086074);
SetMainCallback2(CB2_ReturnToFieldCableClub);
DestroyTask(taskId);
break;
}
}
void sub_80AF948(void)
void DoCableClubWarp(void)
{
ScriptContext2_Enable();
TryFadeOutOldMapMusic();
WarpFadeScreen();
WarpFadeOutScreen();
PlaySE(SE_KAIDAN);
CreateTask(sub_80AF8E0, 10);
}
@ -643,7 +644,7 @@ void ReturnFromLinkRoom(void)
CreateTask(Task_ReturnToWorldFromLinkRoom, 10);
}
static void sub_80AFA0C(u8 taskId)
static void Task_WarpAndLoadMap(u8 taskId)
{
struct Task *task = &gTasks[taskId];
@ -674,7 +675,7 @@ static void sub_80AFA0C(u8 taskId)
}
}
static void sub_80AFA88(u8 taskId)
static void Task_DoDoorWarp(u8 taskId)
{
struct Task *task = &gTasks[taskId];
s16 *x = &task->data[2];
@ -693,21 +694,21 @@ static void sub_80AFA88(u8 taskId)
if (task->data[1] < 0 || gTasks[task->data[1]].isActive != TRUE)
{
u8 eventObjId;
eventObjId = GetEventObjectIdByLocalIdAndMap(0xFF, 0, 0);
eventObjId = GetEventObjectIdByLocalIdAndMap(EVENT_OBJ_ID_PLAYER, 0, 0);
EventObjectClearHeldMovementIfActive(&gEventObjects[eventObjId]);
eventObjId = GetEventObjectIdByLocalIdAndMap(0xFF, 0, 0);
eventObjId = GetEventObjectIdByLocalIdAndMap(EVENT_OBJ_ID_PLAYER, 0, 0);
EventObjectSetHeldMovement(&gEventObjects[eventObjId], MOVEMENT_ACTION_WALK_NORMAL_UP);
task->data[0] = 2;
}
break;
case 2:
if (walkrun_is_standing_still())
if (IsPlayerStandingStill())
{
u8 eventObjId;
task->data[1] = FieldAnimateDoorClose(*x, *y - 1);
eventObjId = GetEventObjectIdByLocalIdAndMap(0xFF, 0, 0);
eventObjId = GetEventObjectIdByLocalIdAndMap(EVENT_OBJ_ID_PLAYER, 0, 0);
EventObjectClearHeldMovementIfFinished(&gEventObjects[eventObjId]);
sub_80AF0F4(0);
SetPlayerVisibility(FALSE);
task->data[0] = 3;
}
break;
@ -719,10 +720,10 @@ static void sub_80AFA88(u8 taskId)
break;
case 4:
TryFadeOutOldMapMusic();
WarpFadeScreen();
WarpFadeOutScreen();
PlayRainStoppingSoundEffect();
task->data[0] = 0;
task->func = sub_80AFA0C;
task->func = Task_WarpAndLoadMap;
break;
}
}
@ -756,10 +757,10 @@ void DoContestHallWarp(void)
{
ScriptContext2_Enable();
TryFadeOutOldMapMusic();
WarpFadeScreen();
WarpFadeOutScreen();
PlayRainStoppingSoundEffect();
PlaySE(SE_KAIDAN);
gFieldCallback = sub_80AF3C8;
gFieldCallback = FieldCB_WarpExitFadeFromBlack;
CreateTask(task0A_fade_n_map_maybe, 10);
}
@ -1033,7 +1034,7 @@ static void sub_80B01BC(u8 taskId)
case 1:
if (!sub_808D1E8())
{
WarpFadeScreen();
WarpFadeOutScreen();
task->data[0]++;
}
break;
@ -1052,14 +1053,14 @@ static void sub_80B01BC(u8 taskId)
void sub_80B0244(void)
{
ScriptContext2_Enable();
CreateTask(sub_80AFA0C, 10);
gFieldCallback = sub_80AF3E8;
CreateTask(Task_WarpAndLoadMap, 10);
gFieldCallback = FieldCB_TeleportWarpExit;
}
void sub_80B0268(void)
{
ScriptContext2_Enable();
gFieldCallback = mapldr_default;
gFieldCallback = FieldCB_DefaultWarpExit;
CreateTask(sub_80B01BC, 10);
}

View File

@ -179,7 +179,7 @@ void Task_HandleTruckSequence(u8 taskId)
data[1]++;
if (data[1] == SECONDS(2.5))
{
pal_fill_black();
FadeInFromBlack();
data[1] = 0;
data[0] = 2;
}
@ -249,12 +249,12 @@ void EndTruckSequence(u8 taskId)
}
}
bool8 sub_80FB59C(void)
bool8 TrySetPortholeWarpDestination(void)
{
s8 mapGroup, mapNum;
s16 x, y;
if (GetSSTidalLocation(&mapGroup, &mapNum, &x, &y))
if (GetSSTidalLocation(&mapGroup, &mapNum, &x, &y) != SS_TIDAL_LOCATION_CURRENTS)
{
return FALSE;
}
@ -336,11 +336,11 @@ static void ShowSSTidalWhileSailing(void)
StartSpriteAnim(&gSprites[spriteId], GetFaceDirectionAnimNum(DIR_WEST));
}
void sub_80FB768(void)
void FieldCB_ShowPortholeView(void)
{
ShowSSTidalWhileSailing();
gEventObjects[gPlayerAvatar.eventObjectId].invisible = TRUE;
pal_fill_black();
FadeInFromBlack();
CreateTask(Task_HandlePorthole, 80);
ScriptContext2_Enable();
}
@ -351,6 +351,6 @@ void LookThroughPorthole(void)
FlagSet(FLAG_DONT_TRANSITION_MUSIC);
FlagSet(FLAG_HIDE_MAP_NAME_POPUP);
SetDynamicWarp(0, gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, -1);
sub_80FB59C();
sub_80AF8B8();
TrySetPortholeWarpDestination();
DoPortholeWarp();
}

View File

@ -366,7 +366,7 @@ u8 GetSSTidalLocation(s8 *mapGroup, s8 *mapNum, s16 *x, s16 *y)
}
*mapGroup = MAP_GROUP(ROUTE132);
*y = 20;
return SS_TIDAL_LOCATION_OTHER;
return SS_TIDAL_LOCATION_CURRENTS;
}
bool32 ShouldDoWallyCall(void)

View File

@ -138,7 +138,7 @@ void SetUpItemUseOnFieldCallback(u8 taskId)
void MapPostLoadHook_UseItem(void)
{
pal_fill_black();
FadeInFromBlack();
CreateTask(Task_CallItemUseOnFieldCallback, 8);
}

View File

@ -376,7 +376,7 @@ static void Task_WaitForFadeOut(u8 taskId)
if (!gPaletteFade.active)
{
SetMainCallback2(CB2_InitLearnMove);
gFieldCallback = FieldCallback_ReturnToEventScript2;
gFieldCallback = FieldCB_ContinueScriptHandleMusic;
DestroyTask(taskId);
}
}

View File

@ -1526,7 +1526,7 @@ static bool8 map_post_load_hook_exec(void)
if (gFieldCallback)
gFieldCallback();
else
mapldr_default();
FieldCB_DefaultWarpExit();
gFieldCallback = NULL;
}
@ -1565,7 +1565,7 @@ void CB2_WhiteOut(void)
ResetInitialPlayerAvatarState();
ScriptContext1_Init();
ScriptContext2_Disable();
gFieldCallback = sub_80AF3C8;
gFieldCallback = FieldCB_WarpExitFadeFromBlack;
val = 0;
do_load_map_stuff_loop(&val);
SetFieldVBlankCallback();
@ -1609,10 +1609,10 @@ void sub_8086024(void)
}
}
void sub_8086074(void)
void CB2_ReturnToFieldCableClub(void)
{
FieldClearVBlankHBlankCallbacks();
gFieldCallback = sub_80AF314;
gFieldCallback = FieldCB_ReturnToFieldWirelessLink;
SetMainCallback2(c2_80567AC);
}
@ -1663,9 +1663,9 @@ void CB2_ReturnToFieldFromMultiplayer(void)
ResetAllMultiplayerState();
if (gWirelessCommType != 0)
gFieldCallback = sub_80AF314;
gFieldCallback = FieldCB_ReturnToFieldWirelessLink;
else
gFieldCallback = sub_80AF214;
gFieldCallback = FieldCB_ReturnToFieldCableLink;
ScriptContext1_Init();
ScriptContext2_Disable();
@ -1675,28 +1675,28 @@ void CB2_ReturnToFieldFromMultiplayer(void)
void CB2_ReturnToFieldWithOpenMenu(void)
{
FieldClearVBlankHBlankCallbacks();
gFieldCallback2 = sub_80AF6A4;
gFieldCallback2 = FieldCB_ReturnToFieldOpenStartMenu;
CB2_ReturnToField();
}
void CB2_ReturnToFieldContinueScript(void)
{
FieldClearVBlankHBlankCallbacks();
gFieldCallback = sub_80AF188;
gFieldCallback = FieldCB_ContinueScript;
CB2_ReturnToField();
}
void CB2_ReturnToFieldContinueScriptPlayMapMusic(void)
{
FieldClearVBlankHBlankCallbacks();
gFieldCallback = FieldCallback_ReturnToEventScript2;
gFieldCallback = FieldCB_ContinueScriptHandleMusic;
CB2_ReturnToField();
}
void sub_80861E8(void)
{
FieldClearVBlankHBlankCallbacks();
gFieldCallback = sub_80AF3C8;
gFieldCallback = FieldCB_WarpExitFadeFromBlack;
CB2_ReturnToField();
}
@ -1704,7 +1704,7 @@ static void sub_8086204(void)
{
if ((gMapHeader.flags & 0xF8) == 8 && SecretBaseMapPopupEnabled() == TRUE)
ShowMapNamePopup();
sub_80AF3C8();
FieldCB_WarpExitFadeFromBlack();
}
void CB2_ContinueSavedGame(void)

View File

@ -3745,7 +3745,7 @@ static void Task_HandleFieldMoveExitAreaYesNoInput(u8 taskId)
bool8 FieldCallback_PrepareFadeInFromMenu(void)
{
pal_fill_black();
FadeInFromBlack();
CreateTask(Task_FieldMoveWaitForFade, 8);
return TRUE;
}
@ -6143,7 +6143,7 @@ static void BufferMonSelection(void)
bool8 CB2_FadeFromPartyMenu(void)
{
pal_fill_black();
FadeInFromBlack();
CreateTask(Task_PartyMenuWaitForFade, 10);
return TRUE;
}
@ -6268,7 +6268,7 @@ static void Task_BattlePyramidChooseMonHeldItems(u8 taskId)
void MoveDeleterChooseMoveToForget(void)
{
ShowPokemonSummaryScreen(PSS_MODE_SELECT_MOVE, gPlayerParty, gSpecialVar_0x8004, gPlayerPartyCount - 1, CB2_ReturnToField);
gFieldCallback = FieldCallback_ReturnToEventScript2;
gFieldCallback = FieldCB_ContinueScriptHandleMusic;
}
void GetNumMovesSelectedMonHas(void)

View File

@ -508,7 +508,7 @@ void Mailbox_DoRedrawMailboxMenuAfterReturn(void)
sub_81973A4();
DrawDialogueFrame(0, 1);
InitItemStorageMenu(CreateTask(ItemStorage_HandleReturnToProcessInput, 0), 1);
pal_fill_black();
FadeInFromBlack();
}
static void ItemStorage_HandleReturnToProcessInput(u8 taskId)
@ -745,7 +745,7 @@ static void pal_fill_for_maplights_or_black(void)
Mailbox_DrawMailboxMenu(taskId);
else
DestroyTask(taskId);
pal_fill_black();
FadeInFromBlack();
}
static void Mailbox_HandleReturnToProcessInput(u8 taskId)
@ -852,7 +852,7 @@ static void Mailbox_UpdateMailListAfterDeposit(void)
Mailbox_DrawMailboxMenu(taskId);
else
DestroyTask(taskId);
pal_fill_black();
FadeInFromBlack();
}
static void Mailbox_NoPokemonForMail(u8 taskId)

View File

@ -960,7 +960,7 @@ static void Task_FreeDataAndExitPokeblockCase(u8 taskId)
if (!gPaletteFade.active)
{
if (sPokeblockMenu->caseId == PBLOCK_CASE_FEEDER || sPokeblockMenu->caseId == PBLOCK_CASE_GIVE)
gFieldCallback = FieldCallback_ReturnToEventScript2;
gFieldCallback = FieldCB_ContinueScriptHandleMusic;
DestroyListMenuTask(data[0], &sSavedPokeblockData.lastItemPage, &sSavedPokeblockData.lastItemPos);
sub_8136418();

View File

@ -1855,7 +1855,7 @@ static void FieldCb_ReturnToPcMenu(void)
gTasks[taskId].data[1] = sPreviousBoxOption;
Task_PokemonStorageSystemPC(taskId);
SetVBlankCallback(vblankCb);
pal_fill_black();
FadeInFromBlack();
}
static void CreatePCMenu(u8 whichMenu, s16 *windowIdPtr)

View File

@ -369,7 +369,7 @@ static void Task_RecordMixing_Main(u8 taskId)
sub_808729C();
if (gWirelessCommType != 0)
{
CreateTask(sub_80AF2B4, 10);
CreateTask(Task_ReturnToFieldRecordMixing, 10);
}
ClearDialogWindowAndFrame(0, 1);
DestroyTask(taskId);

View File

@ -1158,7 +1158,7 @@ static void RegionMap_InitializeStateBasedOnSSTidalLocation(void)
gRegionMap->mapSecId = MAPSEC_ROUTE_131;
break;
default:
case SS_TIDAL_LOCATION_OTHER:
case SS_TIDAL_LOCATION_CURRENTS:
mapHeader = Overworld_GetMapHeaderByGroupAndId(mapGroup, mapNum);
gRegionMap->mapSecId = mapHeader->regionMapSectionId;

View File

@ -1727,7 +1727,7 @@ static void sub_8141E7C(u8 taskId) // end roulette ?
ResetPaletteFade();
ResetSpriteData();
sub_8140418();
gFieldCallback = FieldCallback_ReturnToEventScript2;
gFieldCallback = FieldCB_ContinueScriptHandleMusic;
SetMainCallback2(CB2_ReturnToField);
DestroyTask(taskId);
}

View File

@ -809,7 +809,7 @@ bool8 ScrCmd_warpteleport(struct ScriptContext *ctx)
u16 y = VarGet(ScriptReadHalfword(ctx));
SetWarpDestination(mapGroup, mapNum, warpId, x, y);
sub_80AF848();
DoTeleportWarp();
ResetInitialPlayerAvatarState();
return TRUE;
}
@ -2285,7 +2285,7 @@ void SetMovingNpcId(u16 npcId)
sMovingNpcId = npcId;
}
bool8 ScrCmd_warpE0(struct ScriptContext *ctx)
bool8 ScrCmd_warpsootopolislegend(struct ScriptContext *ctx)
{
u8 mapGroup = ScriptReadByte(ctx);
u8 mapNum = ScriptReadByte(ctx);
@ -2294,7 +2294,7 @@ bool8 ScrCmd_warpE0(struct ScriptContext *ctx)
u16 y = VarGet(ScriptReadHalfword(ctx));
SetWarpDestination(mapGroup, mapNum, warpId, x, y);
sub_80AF79C();
DoSootopolisLegendWarp();
ResetInitialPlayerAvatarState();
return TRUE;
}

View File

@ -413,7 +413,7 @@ static void Task_EnterSecretBase(u8 taskId)
SetSecretBaseWarpDestination();
WarpIntoMap();
gFieldCallback = FieldCallback_ReturnToEventScript2;
gFieldCallback = FieldCB_ContinueScriptHandleMusic;
SetMainCallback2(CB2_LoadMap);
DestroyTask(taskId);
break;
@ -456,7 +456,7 @@ static void EnterNewlyCreatedSecretBase_StartFadeIn(void)
y += 7;
MapGridSetMetatileIdAt(x, y, 0x220 | METATILE_COLLISION_MASK);
CurrentMapDrawMetatileAt(x, y);
pal_fill_black();
FadeInFromBlack();
CreateTask(EnterNewlyCreatedSecretBase_WaitFadeIn, 0);
}
@ -678,7 +678,7 @@ static void Task_WarpOutOfSecretBase(u8 taskId)
case 2:
SetWarpDestinationToDynamicWarp(0x7e);
WarpIntoMap();
gFieldCallback = mapldr_default;
gFieldCallback = FieldCB_DefaultWarpExit;
SetMainCallback2(CB2_LoadMap);
ScriptContext2_Disable();
DestroyTask(taskId);

View File

@ -390,7 +390,7 @@ static void Task_GoToBuyOrSellMenu(u8 taskId)
static void MapPostLoadHook_ReturnToShopMenu(void)
{
pal_fill_black();
FadeInFromBlack();
CreateTask(Task_ReturnToShopMenu, 8);
}

View File

@ -83,7 +83,7 @@ EWRAM_DATA static u8 sBattlePyramidFloorWindowId = 0;
EWRAM_DATA static u8 sStartMenuCursorPos = 0;
EWRAM_DATA static u8 sNumStartMenuActions = 0;
EWRAM_DATA static u8 sCurrentStartMenuActions[9] = {0};
EWRAM_DATA static u8 sUnknown_02037619[2] = {0};
EWRAM_DATA static u8 sInitStartMenuData[2] = {0};
EWRAM_DATA static u8 (*sSaveDialogCallback)(void) = NULL;
EWRAM_DATA static u8 sSaveDialogTimer = 0;
@ -135,9 +135,7 @@ static void StartMenuTask(u8 taskId);
static void SaveGameTask(u8 taskId);
static void sub_80A0550(u8 taskId);
static void sub_80A08A4(u8 taskId);
// Some other callback
static bool8 sub_809FA00(void);
static bool8 FieldCB_ReturnToFieldStartMenu(void);
static const struct WindowTemplate sSafariBallsWindowTemplate = {0, 1, 1, 9, 4, 0xF, 8};
@ -440,33 +438,33 @@ static bool32 PrintStartMenuActions(s8 *pIndex, u32 count)
static bool32 InitStartMenuStep(void)
{
s8 value = sUnknown_02037619[0];
s8 state = sInitStartMenuData[0];
switch (value)
switch (state)
{
case 0:
sUnknown_02037619[0]++;
sInitStartMenuData[0]++;
break;
case 1:
BuildStartMenuActions();
sUnknown_02037619[0]++;
sInitStartMenuData[0]++;
break;
case 2:
sub_81973A4();
DrawStdWindowFrame(sub_81979C4(sNumStartMenuActions), FALSE);
sUnknown_02037619[1] = 0;
sUnknown_02037619[0]++;
sInitStartMenuData[1] = 0;
sInitStartMenuData[0]++;
break;
case 3:
if (GetSafariZoneFlag())
ShowSafariBallsWindow();
if (InBattlePyramid())
ShowPyramidFloorWindow();
sUnknown_02037619[0]++;
sInitStartMenuData[0]++;
break;
case 4:
if (PrintStartMenuActions(&sUnknown_02037619[1], 2))
sUnknown_02037619[0]++;
if (PrintStartMenuActions(&sInitStartMenuData[1], 2))
sInitStartMenuData[0]++;
break;
case 5:
sStartMenuCursorPos = sub_81983AC(GetStartMenuWindowId(), 1, 0, 9, 16, sNumStartMenuActions, sStartMenuCursorPos);
@ -479,8 +477,8 @@ static bool32 InitStartMenuStep(void)
static void InitStartMenu(void)
{
sUnknown_02037619[0] = 0;
sUnknown_02037619[1] = 0;
sInitStartMenuData[0] = 0;
sInitStartMenuData[1] = 0;
while (!InitStartMenuStep())
;
}
@ -495,28 +493,28 @@ static void CreateStartMenuTask(TaskFunc followupFunc)
{
u8 taskId;
sUnknown_02037619[0] = 0;
sUnknown_02037619[1] = 0;
sInitStartMenuData[0] = 0;
sInitStartMenuData[1] = 0;
taskId = CreateTask(StartMenuTask, 0x50);
SetTaskFuncWithFollowupFunc(taskId, StartMenuTask, followupFunc);
}
static bool8 sub_809FA00(void)
static bool8 FieldCB_ReturnToFieldStartMenu(void)
{
if (InitStartMenuStep() == FALSE)
{
return FALSE;
}
sub_80AF688();
ReturnToFieldOpenStartMenu();
return TRUE;
}
void sub_809FA18(void)
void ShowReturnToFieldStartMenu(void)
{
sUnknown_02037619[0] = 0;
sUnknown_02037619[1] = 0;
gFieldCallback2 = sub_809FA00;
sInitStartMenuData[0] = 0;
sInitStartMenuData[1] = 0;
gFieldCallback2 = FieldCB_ReturnToFieldStartMenu;
}
void Task_ShowStartMenu(u8 taskId)

View File

@ -4942,7 +4942,7 @@ static void Task_InGameTrade(u8 taskId)
if (!gPaletteFade.active)
{
SetMainCallback2(CB2_InGameTrade);
gFieldCallback = FieldCallback_ReturnToEventScript2;
gFieldCallback = FieldCB_ContinueScriptHandleMusic;
DestroyTask(taskId);
}
}

View File

@ -1424,7 +1424,7 @@ void sub_8014384(void)
break;
case 1:
if (!FuncIsActiveTask(sub_80140E0))
SetMainCallback2(sub_8086074);
SetMainCallback2(CB2_ReturnToFieldCableClub);
break;
}
@ -2880,7 +2880,7 @@ void sub_80156E0(u8 taskId)
if (!gPaletteFade.active)
{
sUnionRoomTrade.field_0 = 1;
gFieldCallback = sub_80AF128;
gFieldCallback = FieldCB_ContinueScriptUnionRoom;
ChooseMonForTradingBoard(PARTY_MENU_TYPE_UNION_ROOM_REGISTER, CB2_ReturnToField);
}
break;
@ -2992,7 +2992,7 @@ void sub_80156E0(u8 taskId)
memcpy(&gUnknown_02022C38, &data->field_0->arr[taskData[1]].unk.field_0.unk_00, sizeof(gUnknown_02022C38));
gUnionRoomRequestedMonType = data->field_0->arr[taskData[1]].unk.field_0.type;
gUnionRoomOfferedSpecies = data->field_0->arr[taskData[1]].unk.field_0.species;
gFieldCallback = sub_80AF128;
gFieldCallback = FieldCB_ContinueScriptUnionRoom;
ChooseMonForTradingBoard(PARTY_MENU_TYPE_UNION_ROOM_TRADE, CB2_ReturnToField);
sub_80156B0(data);
sUnionRoomTrade.field_8 = taskData[1];

View File

@ -70,7 +70,7 @@ static void CB2_HandleGivenWaldaPhrase(void)
}
StringCopy(gStringVar1, GetWaldaPhrasePtr());
gFieldCallback = FieldCallback_ReturnToEventScript2;
gFieldCallback = FieldCB_ContinueScriptHandleMusic;
SetMainCallback2(CB2_ReturnToField);
}