mirror of
https://github.com/zeldaret/tmc
synced 2026-07-28 23:27:44 -04:00
Use projectile enum when possible
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
+5
-5
@@ -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;
|
||||
|
||||
+1
-1
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
+1
-1
@@ -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;
|
||||
|
||||
+1
-1
@@ -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;
|
||||
|
||||
@@ -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) {
|
||||
|
||||
+1
-1
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
+3
-3
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user