sovereignx/src/fldeff_teleport.c
Diegoisawesome e3585d7d66 Review fixes
2018-01-01 19:21:30 -06:00

46 lines
1 KiB
C

#include "global.h"
#include "fldeff_teleport.h"
#include "field_effect.h"
#include "field_player_avatar.h"
#include "party_menu.h"
#include "overworld.h"
#include "rom6.h"
#include "task.h"
extern bool8 (*gUnknown_03005DB0)(void);
extern void (*gUnknown_0203CEEC)(void);
bool8 SetUpFieldMove_Teleport(void)
{
if (Overworld_MapTypeAllowsTeleportAndFly(gMapHeader.mapType) == TRUE)
{
gUnknown_03005DB0 = FieldCallback_Teleport;
gUnknown_0203CEEC = hm_teleport_run_dp02scr;
return TRUE;
}
return FALSE;
}
void hm_teleport_run_dp02scr(void)
{
Overworld_ResetStateAfterTeleport();
FieldEffectStart(FLDEFF_USE_TELEPORT);
gFieldEffectArguments[0] = (u32)GetCursorSelectionMonId();
}
bool8 FldEff_UseTeleport(void)
{
u8 taskId = oei_task_add();
gTasks[taskId].data[8] = (u32)sub_817C94C >> 16;
gTasks[taskId].data[9] = (u32)sub_817C94C;
SetPlayerAvatarTransitionFlags(1);
return FALSE;
}
void sub_817C94C(void)
{
FieldEffectActiveListRemove(FLDEFF_USE_TELEPORT);
sub_80B7FC8();
}