summaryrefslogtreecommitdiff
path: root/src/object/mulldozerSpawnPoint.c
diff options
context:
space:
mode:
authoroctorock <79596758+octorock@users.noreply.github.com>2022-07-23 12:43:43 +0200
committeroctorock <79596758+octorock@users.noreply.github.com>2022-07-25 22:45:55 +0200
commit852effa474c159398014da736ade6f0fea454de7 (patch)
tree97da22c4758ca4156dc9fb7ac123c7a3b0a9e9f5 /src/object/mulldozerSpawnPoint.c
parentccba86d292a0e4c8a0e07325ac4fb25e5a58dc89 (diff)
Rename objects
Diffstat (limited to 'src/object/mulldozerSpawnPoint.c')
-rw-r--r--src/object/mulldozerSpawnPoint.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/object/mulldozerSpawnPoint.c b/src/object/mulldozerSpawnPoint.c
new file mode 100644
index 00000000..17a33331
--- /dev/null
+++ b/src/object/mulldozerSpawnPoint.c
@@ -0,0 +1,43 @@
+/**
+ * @file mulldozerSpawnPoint.c
+ * @ingroup Objects
+ *
+ * @brief Mulldozer Spawn Point object
+ */
+#define NENT_DEPRECATED
+#include "entity.h"
+#include "sound.h"
+
+void MulldozerSpawnPoint_Init(Entity*);
+void MulldozerSpawnPoint_Action1(Entity*);
+
+void MulldozerSpawnPoint(Entity* this) {
+ static void (*const MulldozerSpawnPoint_Actions[])(Entity*) = {
+ MulldozerSpawnPoint_Init,
+ MulldozerSpawnPoint_Action1,
+ DeleteEntity,
+ };
+
+ MulldozerSpawnPoint_Actions[this->action]((Entity*)this);
+}
+
+void MulldozerSpawnPoint_Init(Entity* this) {
+ static const u8 typeAnimationStates[] = { 0x2, 0x0, 0x43, 0x0 };
+ static const u16 typeSounds[] = { SFX_124, SFX_197, SFX_11D, SFX_NONE };
+ this->action = 1;
+ InitializeAnimation(this, typeAnimationStates[this->type]);
+ SoundReq(typeSounds[this->type]);
+}
+
+void MulldozerSpawnPoint_Action1(Entity* this) {
+ Entity* parent;
+
+ GetNextFrame(this);
+ if (this->frame & 0x80) {
+ this->action = 2;
+ parent = this->parent;
+ parent->flags = this->timer;
+ parent->spriteSettings.draw = this->subtimer;
+ ((GenericEntity*)parent)->field_0x6c.HALF.HI &= 0xef;
+ }
+}