blob: 4e5577a5a0de535d8abbf5431306c4ccb9c2c75a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
/**
* @file fireballChain.c
* @ingroup Objects
*
* @brief Fireball Chain object
*/
#define NENT_DEPRECATED
#include "entity.h"
#include "functions.h"
#include "global.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();
}
|