summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPikalaxALT <pikalaxalt@gmail.com>2017-10-23 19:29:16 -0400
committerPikalaxALT <pikalaxalt@gmail.com>2017-10-23 19:29:16 -0400
commit7bf352944f3ebab63d9e5018c9c6d60c25b26942 (patch)
tree8643b34208d6fb293309f181d4e6c85317efeea7 /src
parenteb2c2f0a3f073276ca1a0fb790e63af1db2e2ef2 (diff)
sub_80E8BF8
Diffstat (limited to 'src')
-rw-r--r--src/secret_base.c41
1 files changed, 39 insertions, 2 deletions
diff --git a/src/secret_base.c b/src/secret_base.c
index 9398e9428..d92a035be 100644
--- a/src/secret_base.c
+++ b/src/secret_base.c
@@ -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;
+}