summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authornotyouraveragehooman <65437533+notyouraveragehooman@users.noreply.github.com>2020-06-12 02:52:59 -0700
committerGitHub <noreply@github.com>2020-06-12 02:52:59 -0700
commit4dbaee3bb4a7b1874192ba7bfdb4e8bd6e4c53d2 (patch)
tree3989728d32497b21ff0b0c8a39e8c6c3cedb37e1 /src
parent27d389e50adc502b6259bad07a9684a02da0a13c (diff)
parentfb42854fa73906b18ce16bae348533fad22708c0 (diff)
Merge pull request #3 from gamestabled/giantLeaf
giantLeaf matching
Diffstat (limited to 'src')
-rw-r--r--src/giantLeaf.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/giantLeaf.c b/src/giantLeaf.c
new file mode 100644
index 00000000..6c6b4d47
--- /dev/null
+++ b/src/giantLeaf.c
@@ -0,0 +1,38 @@
+#include "global.h"
+#include "entity.h"
+#include "room.h"
+
+void SetTile(u32 tileIndex, s32 tilePosition, s32 layerIndex);
+void sub_0808D618(Entity* ent);
+
+extern RoomControls gRoomControls;
+extern s16 gUnk_08121750[];
+extern s16 gUnk_0812176A[];
+
+void sub_0808D5DC(Entity* ent)
+{
+ if (ent->action == 0)
+ {
+ ent->action = 1;
+ ent->spriteSettings.b.ss0 = 1;
+ ent->spriteOrder.b3 = 3;
+ ent->ticks.b0 = 7;
+ ent->animationList = ent->entityType.parameter1;
+ sub_0808D618(ent);
+ }
+}
+
+void sub_0808D618(Entity *ent)
+{
+ u32 tilePos;
+ s16 *arr;
+ u32 i;
+
+ arr = (ent->entityType.parameter1 != 0) ? gUnk_0812176A : gUnk_08121750;
+ tilePos = (((ent->x.HALF.HI - gRoomControls.roomOriginX) >> 4) & 0x3F) | ((((ent->y.HALF.HI - gRoomControls.roomOriginY) >> 4) & 0x3F) * 64);
+
+ for (i = 0; i < 13; i++)
+ {
+ SetTile(16500, tilePos + arr[i], 1);
+ }
+}