sub_80E8BF8

This commit is contained in:
PikalaxALT
2017-10-23 19:29:16 -04:00
parent eb2c2f0a3f
commit 7bf352944f
3 changed files with 40 additions and 89 deletions

View File

@@ -4,6 +4,8 @@
#include "list_menu.h"
#include "decoration.h"
#include "decoration_inventory.h"
#include "fieldmap.h"
#include "field_player_avatar.h"
#include "text.h"
#include "event_data.h"
#include "secret_base.h"
@@ -22,6 +24,10 @@ EWRAM_DATA struct SecretBaseListMenuBuffer *gUnknown_0203A020 = NULL;
// Static ROM declarations
// .rodata
// .text
void sub_80E8AF0(struct SecretBaseRecord *sbr)
{
u16 i;
@@ -77,6 +83,37 @@ void sub_80E8BC8(void)
}
}
// .rodata
u8 sub_80E8BF8(void)
{
s16 x;
s16 y;
s16 behavior;
// .text
GetXYCoordsOneStepInFrontOfPlayer(&x, &y);
behavior = MapGridGetMetatileBehaviorAt(x, y) & 0xFFF;
if (behavior == 0x90 || behavior == 0x91)
{
return 1;
}
if (behavior == 0x92 || behavior == 0x93)
{
return 2;
}
if (behavior == 0x9a || behavior == 0x9b)
{
return 3;
}
if (behavior == 0x94 || behavior == 0x95)
{
return 4;
}
if (behavior == 0x96 || behavior == 0x97 || behavior == 0x9c || behavior == 0x9d)
{
return 5;
}
if (behavior == 0x98 || behavior == 0x99)
{
return 6;
}
return 0;
}