sovereignx/src/fldeff_teleport.c

47 lines
1 KiB
C
Raw Normal View History

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