2017-12-04 02:46:56 +01:00
|
|
|
#include "global.h"
|
|
|
|
#include "field_effect.h"
|
|
|
|
#include "task.h"
|
|
|
|
|
|
|
|
extern bool8 is_light_level_1_2_3_or_6(u8 mapType);
|
|
|
|
extern void* hm_add_c3_launch_phase_2(void);
|
|
|
|
extern void sub_808469C(void);
|
|
|
|
extern u8 GetCursorSelectionMonId(void);
|
|
|
|
extern u8 oei_task_add(void);
|
|
|
|
extern void FieldEffectActiveListRemove(u8 id);
|
|
|
|
extern void sub_80B7FC8(void);
|
2017-12-04 02:48:08 +01:00
|
|
|
extern void SetPlayerAvatarTransitionFlags(u8);
|
|
|
|
|
2018-01-01 20:36:27 +01:00
|
|
|
extern void* gUnknown_0203CEEC;
|
|
|
|
extern void* gUnknown_03005DB0;
|
|
|
|
|
|
|
|
void hm_teleport_run_dp02scr(void);
|
|
|
|
void sub_817C94C(void);
|
2017-12-04 02:46:56 +01:00
|
|
|
|
|
|
|
// 817C8BC
|
2017-12-04 23:12:05 +01:00
|
|
|
bool8 SetUpFieldMove_Teleport(void)
|
2017-12-04 02:46:56 +01:00
|
|
|
{
|
|
|
|
if (is_light_level_1_2_3_or_6(gMapHeader.mapType) == TRUE)
|
|
|
|
{
|
|
|
|
gUnknown_03005DB0 = hm_add_c3_launch_phase_2;
|
|
|
|
gUnknown_0203CEEC = hm_teleport_run_dp02scr;
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
// 817C8FC
|
2017-12-04 23:12:05 +01:00
|
|
|
void hm_teleport_run_dp02scr(void)
|
2017-12-04 02:46:56 +01:00
|
|
|
{
|
|
|
|
sub_808469C();
|
|
|
|
FieldEffectStart(0x3F);
|
|
|
|
gFieldEffectArguments[0] = (u32)GetCursorSelectionMonId();
|
|
|
|
}
|
|
|
|
|
|
|
|
// 817C91C
|
2017-12-04 23:12:05 +01:00
|
|
|
u8 FldEff_UseTeleport(void)
|
2017-12-04 02:46:56 +01:00
|
|
|
{
|
|
|
|
u8 taskID = oei_task_add();
|
|
|
|
gTasks[taskID].data[8] = (u32)sub_817C94C >> 16;
|
|
|
|
gTasks[taskID].data[9] = (u32)sub_817C94C;
|
|
|
|
SetPlayerAvatarTransitionFlags(1);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2017-12-04 23:12:05 +01:00
|
|
|
void sub_817C94C(void)
|
2017-12-04 02:46:56 +01:00
|
|
|
{
|
|
|
|
FieldEffectActiveListRemove(0x3F);
|
|
|
|
sub_80B7FC8();
|
|
|
|
}
|
|
|
|
|
|
|
|
|