summaryrefslogtreecommitdiff
path: root/src/object
diff options
context:
space:
mode:
authorElliptic Ellipsis <elliptic.ellipsis@gmail.com>2022-03-24 12:49:45 +0000
committerElliptic Ellipsis <elliptic.ellipsis@gmail.com>2022-03-24 12:49:45 +0000
commit13e7c6a5eef1029a98106b0b2c8cf853ff9fe36c (patch)
tree20951b6718006456dd8913df75eebe59a5c56b38 /src/object
parent946bb8095b4d6d3c41d164691c21c576c55a73f2 (diff)
FireballChain OK, start documenting
Diffstat (limited to 'src/object')
-rw-r--r--src/object/fireballChain.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/object/fireballChain.c b/src/object/fireballChain.c
new file mode 100644
index 00000000..ac5322b7
--- /dev/null
+++ b/src/object/fireballChain.c
@@ -0,0 +1,41 @@
+#define NENT_DEPRECATED
+#include "global.h"
+#include "entity.h"
+#include "functions.h"
+#include "projectile.h"
+#include "projectile/winder.h"
+
+void FireballChain(Entity* thisx) {
+ WinderEntity* newSegment;
+ Entity* parent;
+ Entity* child;
+ s32 i;
+ s32 j;
+
+ if (gEntCount > 0x42) {
+ return;
+ }
+
+ for (i = 0; i < 5; i++) {
+ u16* tmp;
+
+ newSegment = (WinderEntity*)CreateProjectile(WINDER);
+ if (i == 0) {
+ child = parent = &newSegment->base;
+ }
+
+ newSegment->base.type = i;
+ newSegment->base.parent = parent;
+ newSegment->base.child = child;
+ CopyPosition(thisx, &newSegment->base);
+
+ for (j = 0, tmp = newSegment->positions; j < WINDER_NUM_SEGMENTS; j++) {
+ *tmp++ = thisx->x.HALF.HI;
+ *tmp++ = thisx->y.HALF.HI;
+ }
+
+ child = &newSegment->base;
+ }
+
+ DeleteThisEntity();
+}