summaryrefslogtreecommitdiff
path: root/src/enemy
diff options
context:
space:
mode:
authorTal Hayon <talhayon1@gmail.com>2022-01-30 02:11:16 +0200
committerTal Hayon <talhayon1@gmail.com>2022-01-30 02:11:16 +0200
commit64c56499f98b2dfa91a1da9b7ea49357bb3a1fd2 (patch)
tree710380c3b2ee411719a73540b67625297cf300a2 /src/enemy
parent40dd696e1df6670f753406748189c508be6afbd7 (diff)
Use projectile enum when possible
Diffstat (limited to 'src/enemy')
-rw-r--r--src/enemy/bowMoblin.c2
-rw-r--r--src/enemy/businessScrub.c2
-rw-r--r--src/enemy/darkNut.c10
-rw-r--r--src/enemy/enemy4D.c2
-rw-r--r--src/enemy/gyorgFemale.c2
-rw-r--r--src/enemy/gyorgMale.c6
-rw-r--r--src/enemy/keaton.c2
-rw-r--r--src/enemy/lakitu.c2
-rw-r--r--src/enemy/mazaalHead.c2
-rw-r--r--src/enemy/octorok.c2
-rw-r--r--src/enemy/octorokGolden.c2
-rw-r--r--src/enemy/pesto.c6
-rw-r--r--src/enemy/spearMoblin.c2
-rw-r--r--src/enemy/vaatiArm.c2
-rw-r--r--src/enemy/vaatiBall.c4
-rw-r--r--src/enemy/vaatiRebornEnemy.c5
-rw-r--r--src/enemy/vaatiTransfigured.c10
-rw-r--r--src/enemy/vaatiWrath.c2
-rw-r--r--src/enemy/vaatiWrathEye.c2
19 files changed, 34 insertions, 33 deletions
diff --git a/src/enemy/bowMoblin.c b/src/enemy/bowMoblin.c
index 19615fe9..d8737c42 100644
--- a/src/enemy/bowMoblin.c
+++ b/src/enemy/bowMoblin.c
@@ -216,7 +216,7 @@ void sub_0803C400(BowMoblinEntity* this) {
switch (++super->actionDelay) {
case 1:
super->direction = super->animationState << 2;
- projectile = CreateProjectileWithParent(super, 0xd, super->animationState >> 1);
+ projectile = CreateProjectileWithParent(super, ARROW_PROJECTILE, super->animationState >> 1);
if (projectile) {
super->child = projectile;
projectile->direction = (super->direction + 4) & 0x18;
diff --git a/src/enemy/businessScrub.c b/src/enemy/businessScrub.c
index 59868dd7..f4aa981b 100644
--- a/src/enemy/businessScrub.c
+++ b/src/enemy/businessScrub.c
@@ -139,7 +139,7 @@ void sub_08028A74(Entity* this) {
unk = 1;
sub_080290FC(this);
if (this->frame & 1) {
- Entity* ent = CreateProjectileWithParent(this, 4, 0);
+ Entity* ent = CreateProjectileWithParent(this, DEKU_SEED_PROJECTILE, 0);
if (ent != NULL) {
ent->parent = this;
ent->direction = this->direction;
diff --git a/src/enemy/darkNut.c b/src/enemy/darkNut.c
index ad692d3b..225365ff 100644
--- a/src/enemy/darkNut.c
+++ b/src/enemy/darkNut.c
@@ -229,7 +229,7 @@ void sub_08020F48(Entity* this) {
this->action = 14;
sub_08021218(this, 13, uVar2 >> 3);
- pEVar3 = CreateProjectileWithParent(this, 0, 1);
+ pEVar3 = CreateProjectileWithParent(this, DARK_NUT_SWORD_SLASH, 1);
if (pEVar3) {
pEVar3->parent = this;
this->child = pEVar3;
@@ -275,7 +275,7 @@ void sub_08021010(Entity* this) {
void sub_08021038(Entity* this) {
if (this->child == NULL && this->frame) {
- Entity* pEVar2 = (Entity*)CreateProjectileWithParent(this, 0, 0);
+ Entity* pEVar2 = (Entity*)CreateProjectileWithParent(this, DARK_NUT_SWORD_SLASH, 0);
if (pEVar2) {
pEVar2->parent = this;
this->child = pEVar2;
@@ -314,7 +314,7 @@ void sub_080210E4(Entity* this) {
Entity* ent;
this->frame &= ~1;
- ent = CreateProjectileWithParent(this, 0, 2);
+ ent = CreateProjectileWithParent(this, DARK_NUT_SWORD_SLASH, 2);
if (ent) {
ent->parent = this;
this->child = ent;
@@ -573,7 +573,7 @@ void sub_0802159C(Entity* this) {
this->frame = 0;
this->hitType = 0x51;
- ent = CreateProjectileWithParent(this, 0, 3);
+ ent = CreateProjectileWithParent(this, DARK_NUT_SWORD_SLASH, 3);
if (ent) {
ent->parent = this;
this->child = ent;
@@ -594,7 +594,7 @@ void sub_08021600(Entity* this) {
this->frame = 0;
this->hitType = 0x51;
- ent = CreateProjectileWithParent(this, 0, 4);
+ ent = CreateProjectileWithParent(this, DARK_NUT_SWORD_SLASH, 4);
if (ent) {
ent->parent = this;
this->child = ent;
diff --git a/src/enemy/enemy4D.c b/src/enemy/enemy4D.c
index b44585da..d06ec59c 100644
--- a/src/enemy/enemy4D.c
+++ b/src/enemy/enemy4D.c
@@ -43,7 +43,7 @@ void sub_0803EB44(Entity* this) {
Entity* pEVar1;
sub_0804A720(this);
- pEVar1 = CreateProjectileWithParent(this, 0x19, 0);
+ pEVar1 = CreateProjectileWithParent(this, BALL_AND_CHAIN, 0);
if (pEVar1 != NULL) {
pEVar1->parent = this;
this->child = pEVar1;
diff --git a/src/enemy/gyorgFemale.c b/src/enemy/gyorgFemale.c
index 3aa0c932..a411698e 100644
--- a/src/enemy/gyorgFemale.c
+++ b/src/enemy/gyorgFemale.c
@@ -56,7 +56,7 @@ void sub_0804614C(GyorgFemaleEntity* this) {
Entity* tmp;
if (gEntCount > 0x3d)
return;
- tmp = CreateProjectile(0x22);
+ tmp = CreateProjectile(GYORG_TAIL);
tmp->type = 0;
tmp->parent = super;
((GyorgHeap*)super->myHeap)->unk_14 = (GenericEntity*)tmp;
diff --git a/src/enemy/gyorgMale.c b/src/enemy/gyorgMale.c
index 357af79b..d50d44ab 100644
--- a/src/enemy/gyorgMale.c
+++ b/src/enemy/gyorgMale.c
@@ -119,7 +119,7 @@ void GyorgMale(GyorgMaleEntity* this) {
}
void sub_08046898(GyorgMaleEntity* this) {
- Entity* tmp = CreateProjectile(0x22);
+ Entity* tmp = CreateProjectile(GYORG_TAIL);
u32 tmp2;
if (!tmp)
return;
@@ -411,7 +411,7 @@ void sub_08046EF4(GyorgMaleEntity* this) {
if ((--super->field_0xf & 0xFF) == 0) {
Entity* tmp;
super->field_0xf = (Random() & 0x38) + 0x78;
- tmp = CreateProjectile(0x23);
+ tmp = CreateProjectile(GYORG_MALE_ENERGY_PROJECTILE);
if (tmp) {
tmp->collisionLayer = 2;
tmp->parent = super;
@@ -436,7 +436,7 @@ void sub_08046F64(GyorgMaleEntity* this) {
if (--this->unk_7e == 0) {
Entity* tmp;
this->unk_7e = 0x78;
- tmp = CreateProjectile(0x23);
+ tmp = CreateProjectile(GYORG_MALE_ENERGY_PROJECTILE);
if (tmp) {
tmp->collisionLayer = 2;
tmp->parent = super;
diff --git a/src/enemy/keaton.c b/src/enemy/keaton.c
index 78349fbb..df262f25 100644
--- a/src/enemy/keaton.c
+++ b/src/enemy/keaton.c
@@ -236,7 +236,7 @@ void sub_08032794(Entity* this) {
void sub_080327C8(Entity* this) {
Entity* child;
- child = CreateProjectileWithParent(this, 11, 0);
+ child = CreateProjectileWithParent(this, KEATON_DAGGER, 0);
if (child != NULL) {
child->parent = this;
this->child = child;
diff --git a/src/enemy/lakitu.c b/src/enemy/lakitu.c
index d201bf87..2978a8a0 100644
--- a/src/enemy/lakitu.c
+++ b/src/enemy/lakitu.c
@@ -306,7 +306,7 @@ void Lakitu_SpawnLightning(Entity* this) {
Entity* lightning;
const OffsetCoords* offset;
- lightning = CreateProjectileWithParent(this, 18, 0);
+ lightning = CreateProjectileWithParent(this, LAKITU_LIGHTNING, 0);
if (lightning == NULL) {
return;
diff --git a/src/enemy/mazaalHead.c b/src/enemy/mazaalHead.c
index 55e4923b..bf553ee5 100644
--- a/src/enemy/mazaalHead.c
+++ b/src/enemy/mazaalHead.c
@@ -773,7 +773,7 @@ void sub_08034B38(Entity* this) {
this->action = 3;
InitializeAnimation(this, this->type + 3);
} else {
- target = CreateProjectile(0xe);
+ target = CreateProjectile(MAZAAL_ENERGY_BEAM);
if (target != NULL) {
target->type = this->type - 2;
if (target->type == 0) {
diff --git a/src/enemy/octorok.c b/src/enemy/octorok.c
index f94b4743..6247a349 100644
--- a/src/enemy/octorok.c
+++ b/src/enemy/octorok.c
@@ -128,7 +128,7 @@ void Octorok_Move(Entity* this) {
void Octorok_ShootNut(Entity* this) {
GetNextFrame(this);
if (this->frame & 1) {
- Entity* ent = CreateProjectileWithParent(this, 1, 0);
+ Entity* ent = CreateProjectileWithParent(this, ROCK_PROJECTILE, 0);
if (ent) {
const s8* off;
ent->direction = this->direction;
diff --git a/src/enemy/octorokGolden.c b/src/enemy/octorokGolden.c
index 66d0eee6..bcad77be 100644
--- a/src/enemy/octorokGolden.c
+++ b/src/enemy/octorokGolden.c
@@ -80,7 +80,7 @@ void sub_08037D54(Entity* this) {
this->frame ^= 2;
if (this->frame & 0x2) {
- Entity* proj = CreateProjectileWithParent(this, 1, 0);
+ Entity* proj = CreateProjectileWithParent(this, ROCK_PROJECTILE, 0);
if (proj) {
const s8* ptr;
s32 dir;
diff --git a/src/enemy/pesto.c b/src/enemy/pesto.c
index 9533a963..be3decc2 100644
--- a/src/enemy/pesto.c
+++ b/src/enemy/pesto.c
@@ -168,7 +168,7 @@ void sub_080240B8(Entity* this) {
Entity* ent;
this->field_0x82.HALF.HI = 0;
- ent = CreateProjectileWithParent(this, 6, this->field_0x82.HALF.HI);
+ ent = CreateProjectileWithParent(this, DIRT_BALL_PROJECTILE, this->field_0x82.HALF.HI);
if (ent) {
this->child = ent;
ent->parent = this;
@@ -411,7 +411,7 @@ void sub_080244E8(Entity* this) {
this->z.HALF.HI -= 0xe;
this->field_0x78.HWORD -= 0xe;
- ent = CreateProjectileWithParent(this, 6, this->field_0x82.HALF.HI);
+ ent = CreateProjectileWithParent(this, DIRT_BALL_PROJECTILE, this->field_0x82.HALF.HI);
if (ent) {
ent->parent = this;
ent->z.HALF.HI += 0xe;
@@ -434,7 +434,7 @@ void sub_080244E8(Entity* this) {
this->z.HALF.HI -= 0xe;
this->field_0x78.HWORD -= 0xe;
- ent = CreateProjectileWithParent(this, 6, this->field_0x82.HALF.HI);
+ ent = CreateProjectileWithParent(this, DIRT_BALL_PROJECTILE, this->field_0x82.HALF.HI);
if (ent) {
ent->parent = this;
ent->z.HALF.HI += 0xe;
diff --git a/src/enemy/spearMoblin.c b/src/enemy/spearMoblin.c
index 8490f9d6..8902e7fc 100644
--- a/src/enemy/spearMoblin.c
+++ b/src/enemy/spearMoblin.c
@@ -96,7 +96,7 @@ void sub_08028314(Entity* this) {
sub_08028604(this);
}
- pEVar2 = CreateProjectile(3);
+ pEVar2 = CreateProjectile(MOBLIN_SPEAR);
if (pEVar2 != NULL) {
pEVar2->parent = this;
this->child = pEVar2;
diff --git a/src/enemy/vaatiArm.c b/src/enemy/vaatiArm.c
index 33dc556f..4840a01e 100644
--- a/src/enemy/vaatiArm.c
+++ b/src/enemy/vaatiArm.c
@@ -708,7 +708,7 @@ void sub_08042FD8(Entity* this) {
UpdateAnimationSingleFrame(this);
if (!sub_08043C98(this)) {
if ((this->frame & 1) != 0) {
- entity = CreateProjectile(0x20);
+ entity = CreateProjectile(V3_HAND_PROJECTILE);
if (entity != NULL) {
CopyPosition(this, entity);
entity->z.HALF.HI -= 0x18;
diff --git a/src/enemy/vaatiBall.c b/src/enemy/vaatiBall.c
index 7b9a57fb..222e1dd4 100644
--- a/src/enemy/vaatiBall.c
+++ b/src/enemy/vaatiBall.c
@@ -191,7 +191,7 @@ void sub_08044868(Entity* this) {
if (*(u8*)&vaati->field_0x86 > 1) {
u8 draw = this->spriteSettings.draw;
if (draw == 1 && this->cutsceneBeh.HALF.LO == 0) {
- vaati = CreateProjectileWithParent(this, 0x18, 0);
+ vaati = CreateProjectileWithParent(this, V1_DARK_MAGIC_PROJECTILE, 0);
if (vaati) {
vaati->type2 = 1;
vaati->parent = this;
@@ -281,7 +281,7 @@ void sub_080449F8(Entity* this) {
this->field_0x74.HALF.LO++;
draw = this->spriteSettings.draw;
if (draw) {
- vaati = CreateProjectileWithParent(this, 0x1c, 0);
+ vaati = CreateProjectileWithParent(this, V1_EYE_LASER, 0);
if (vaati) {
vaati->y.HALF.HI += 4;
vaati->parent = this;
diff --git a/src/enemy/vaatiRebornEnemy.c b/src/enemy/vaatiRebornEnemy.c
index 0d625249..d810aa25 100644
--- a/src/enemy/vaatiRebornEnemy.c
+++ b/src/enemy/vaatiRebornEnemy.c
@@ -353,7 +353,8 @@ void VaatiRebornEnemyType0Action4(Entity* this) {
this->field_0xf = 0;
}
if ((this->field_0xf < 0x10) &&
- (entity = CreateProjectileWithParent(this, 0x1a, this->cutsceneBeh.HALF.LO), entity != NULL)) {
+ (entity = CreateProjectileWithParent(this, V1_FIRE_PROJECTILE, this->cutsceneBeh.HALF.LO),
+ entity != NULL)) {
entity->field_0xf = this->field_0xf;
entity->parent = this;
entity->z.HALF.HI = this->z.HALF.HI;
@@ -440,7 +441,7 @@ void VaatiRebornEnemyType0Action6(Entity* this) {
if (--this->actionDelay == 0) {
this->field_0x74.HALF.LO++;
SoundReq(SFX_150);
- target = CreateProjectileWithParent(this, 0x18, 0);
+ target = CreateProjectileWithParent(this, V1_DARK_MAGIC_PROJECTILE, 0);
if (target != NULL) {
PositionRelative(this, target, 0, Q_16_16(-16.0));
target->parent = this;
diff --git a/src/enemy/vaatiTransfigured.c b/src/enemy/vaatiTransfigured.c
index 94732451..48664ea9 100644
--- a/src/enemy/vaatiTransfigured.c
+++ b/src/enemy/vaatiTransfigured.c
@@ -413,7 +413,7 @@ void VaatiTransfiguredType0Action4(Entity* this) {
this->actionDelay = gUnk_080D0ABF[((u32)this->animationState << 1 | 1)];
} else {
if ((this->actionDelay & 7) == 0) {
- CreateProjectileWithParent(this, 0x1f, this->field_0xf);
+ CreateProjectileWithParent(this, V2_PROJECTILE, this->field_0xf);
}
if (((this->field_0xf != 0) && (1 < this->animationState)) && (this->actionDelay < 6)) {
this->actionDelay = 0x80;
@@ -459,7 +459,7 @@ void VaatiTransfiguredType0Action5(Entity* this) {
} else {
if (this->field_0xf) {
if ((this->actionDelay & 7) == 0) {
- CreateProjectileWithParent(this, 0x1f, this->field_0xf);
+ CreateProjectileWithParent(this, V2_PROJECTILE, this->field_0xf);
}
if (this->actionDelay < 6) {
this->actionDelay = 0x40;
@@ -467,7 +467,7 @@ void VaatiTransfiguredType0Action5(Entity* this) {
}
} else {
if ((this->actionDelay & 0xf) == 0) {
- entity = CreateProjectileWithParent(this, 0x1f, 2);
+ entity = CreateProjectileWithParent(this, V2_PROJECTILE, 2);
if (entity != NULL) {
entity->type2 = 0;
if (this->field_0x80.HALF.HI != 0) {
@@ -511,7 +511,7 @@ void VaatiTransfiguredType0Action6(Entity* this) {
} else {
if (this->field_0xf) {
if ((this->actionDelay & 7) == 0) {
- CreateProjectileWithParent(this, 0x1f, this->field_0xf);
+ CreateProjectileWithParent(this, V2_PROJECTILE, this->field_0xf);
}
if (this->actionDelay < 6) {
this->actionDelay = 0x80;
@@ -519,7 +519,7 @@ void VaatiTransfiguredType0Action6(Entity* this) {
}
} else {
if ((this->actionDelay & 0x1f) == 0) {
- pEVar2 = CreateProjectileWithParent(this, 0x1f, 2);
+ pEVar2 = CreateProjectileWithParent(this, V2_PROJECTILE, 2);
if (pEVar2 != NULL) {
pEVar2->type2 = 1;
pEVar2->y.HALF.HI += -0x20;
diff --git a/src/enemy/vaatiWrath.c b/src/enemy/vaatiWrath.c
index e8e9ebad..32416913 100644
--- a/src/enemy/vaatiWrath.c
+++ b/src/enemy/vaatiWrath.c
@@ -953,7 +953,7 @@ u32 sub_080422C0(Entity* this, u32 unk1) {
type1 = ((VaatiWrathHeapStruct*)this->myHeap)->type1;
GetNextFrame(type1);
if (unk1 + 1 == (tmp = type1->frame)) {
- child = CreateProjectile(0x21);
+ child = CreateProjectile(V3_ELECTRIC_PROJECTILE);
if (child != NULL) {
child->type = unk1;
child->parent = this;
diff --git a/src/enemy/vaatiWrathEye.c b/src/enemy/vaatiWrathEye.c
index 360ba2eb..b9946331 100644
--- a/src/enemy/vaatiWrathEye.c
+++ b/src/enemy/vaatiWrathEye.c
@@ -144,7 +144,7 @@ void VaatiWrathEyeAction6(Entity* this) {
} else {
if (this->frame & 1) {
this->frame &= 0xfe;
- pEVar3 = CreateProjectile(0x24);
+ pEVar3 = CreateProjectile(V3_TENNIS_BALL_PROJECTILE);
if (pEVar3 != NULL) {
pEVar3->parent = this;
this->child = pEVar3;