summaryrefslogtreecommitdiff
path: root/src/object/treeThorns.c
diff options
context:
space:
mode:
authortheo3 <arisstephenson2@gmail.com>2021-12-17 11:26:16 -0800
committertheo3 <arisstephenson2@gmail.com>2021-12-17 11:26:16 -0800
commitc2ba47d796dfdbd091d534ee70456fd47d2ef4b6 (patch)
treec95af2d90d4d83b59c3dee53fe29ca6c303af118 /src/object/treeThorns.c
parent929f6000a634910fd89f54c646d05e6a168e2a18 (diff)
identify more objects
Diffstat (limited to 'src/object/treeThorns.c')
-rw-r--r--src/object/treeThorns.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/object/treeThorns.c b/src/object/treeThorns.c
new file mode 100644
index 00000000..5a52b9a5
--- /dev/null
+++ b/src/object/treeThorns.c
@@ -0,0 +1,43 @@
+#include "global.h"
+#include "entity.h"
+#include "coord.h"
+#include "room.h"
+#include "object.h"
+#include "functions.h"
+
+extern Hitbox gHitbox_1;
+
+void TreeThorns(Entity* this) {
+ Entity* ent;
+ u32 tilePos;
+ u8* layer;
+
+ if (this->action == 0) {
+ this->action = 1;
+ this->spritePriority.b0 = 6;
+ if (this->type == 0) {
+ COLLISION_ON(this);
+ this->frameIndex = 1;
+ layer = &this->collisionLayer;
+ *layer = 1;
+ this->field_0x3c = 7;
+ this->hurtType = 0x48;
+ this->hitType = 0x7a;
+ this->flags2 = 1;
+ this->hitbox = &gHitbox_1;
+ tilePos = COORD_TO_TILE(this);
+ SetTile(0x4066, tilePos - 1, *layer);
+ SetTile(0x4065, tilePos, *layer);
+ UpdateSpriteForCollisionLayer(this);
+ ent = CreateObject(TREE_THORNS, 1, 0);
+ if (ent != NULL) {
+ this->child = ent;
+ CopyPosition(this, ent);
+ }
+ } else {
+ this->frameIndex = 0;
+ this->collisionLayer = 2;
+ UpdateSpriteForCollisionLayer(this);
+ }
+ }
+}