pokeemerald/src/fldeff_teleport.c

47 lines
1.0 KiB
C
Raw Normal View History

2017-12-04 02:46:56 +01:00
#include "global.h"
2018-01-02 02:21:30 +01:00
#include "fldeff_teleport.h"
2017-12-04 02:46:56 +01:00
#include "field_effect.h"
2018-01-02 02:21:30 +01:00
#include "field_player_avatar.h"
#include "party_menu.h"
#include "overworld.h"
#include "rom6.h"
2017-12-04 02:46:56 +01:00
#include "task.h"
2018-01-02 02:21:30 +01:00
extern bool8 (*gUnknown_03005DB0)(void);
extern void (*gUnknown_0203CEEC)(void);
2017-12-04 02:48:08 +01:00
2017-12-04 23:12:05 +01:00
bool8 SetUpFieldMove_Teleport(void)
2017-12-04 02:46:56 +01:00
{
2018-01-02 02:21:30 +01:00
if (Overworld_MapTypeAllowsTeleportAndFly(gMapHeader.mapType) == TRUE)
2017-12-04 02:46:56 +01:00
{
2018-01-02 02:21:30 +01:00
gUnknown_03005DB0 = FieldCallback_Teleport;
2017-12-04 02:46:56 +01:00
gUnknown_0203CEEC = hm_teleport_run_dp02scr;
return TRUE;
}
return FALSE;
}
2017-12-04 23:12:05 +01:00
void hm_teleport_run_dp02scr(void)
2017-12-04 02:46:56 +01:00
{
2018-01-02 02:21:30 +01:00
Overworld_ResetStateAfterTeleport();
FieldEffectStart(FLDEFF_USE_TELEPORT);
2017-12-04 02:46:56 +01:00
gFieldEffectArguments[0] = (u32)GetCursorSelectionMonId();
}
2018-01-02 02:21:30 +01:00
bool8 FldEff_UseTeleport(void)
2017-12-04 02:46:56 +01:00
{
2018-01-02 02:21:30 +01:00
u8 taskId = oei_task_add();
gTasks[taskId].data[8] = (u32)sub_817C94C >> 16;
gTasks[taskId].data[9] = (u32)sub_817C94C;
2017-12-04 02:46:56 +01:00
SetPlayerAvatarTransitionFlags(1);
2018-01-02 02:21:30 +01:00
return FALSE;
2017-12-04 02:46:56 +01:00
}
2017-12-04 23:12:05 +01:00
void sub_817C94C(void)
2017-12-04 02:46:56 +01:00
{
2018-01-02 02:21:30 +01:00
FieldEffectActiveListRemove(FLDEFF_USE_TELEPORT);
2017-12-04 02:46:56 +01:00
sub_80B7FC8();
}