summaryrefslogtreecommitdiff
path: root/src/projectile
diff options
context:
space:
mode:
authoroctorock <79596758+octorock@users.noreply.github.com>2021-11-12 12:13:13 +0100
committeroctorock <79596758+octorock@users.noreply.github.com>2021-11-12 12:13:13 +0100
commit9396484df6c05886b38fd29bc67b4d247f15015f (patch)
tree23191aa4cccdfb0889ae935f96231be70a0f1bda /src/projectile
parentb1e2175ffb7f4b65dffb5480e08c86135c66c109 (diff)
Merge branch 'master' into asset-extraction
Diffstat (limited to 'src/projectile')
-rw-r--r--src/projectile/arrowProjectile.c20
-rw-r--r--src/projectile/ballAndChain.c2
-rw-r--r--src/projectile/boneProjectile.c12
-rw-r--r--src/projectile/cannonballProjectile.c6
-rw-r--r--src/projectile/darkNutSwordSlash.c12
-rw-r--r--src/projectile/dekuSeedProjectile.c24
-rw-r--r--src/projectile/dirtBallProjectile.c28
-rw-r--r--src/projectile/fireProjectile.c6
-rw-r--r--src/projectile/gleerokProjectile.c22
-rw-r--r--src/projectile/guardLineOfSight.c4
-rw-r--r--src/projectile/gyorgMaleEnergyProjectile.c6
-rw-r--r--src/projectile/gyorgTail.c42
-rw-r--r--src/projectile/iceProjectile.c6
-rw-r--r--src/projectile/keatonDagger.c2
-rw-r--r--src/projectile/lakituCloudProjectile.c4
-rw-r--r--src/projectile/lakituLightning.c4
-rw-r--r--src/projectile/mandiblesProjectile.c43
-rw-r--r--src/projectile/mazaalEnergyBeam.c10
-rw-r--r--src/projectile/moblinSpear.c10
-rw-r--r--src/projectile/octorokBossProjectile.c26
-rw-r--r--src/projectile/projectile5.c2
-rw-r--r--src/projectile/rockProjectile.c12
-rw-r--r--src/projectile/spiderWeb.c17
-rw-r--r--src/projectile/stalfosProjectile.c18
-rw-r--r--src/projectile/v1DarkMagicProjectile.c42
-rw-r--r--src/projectile/v1EyeLaser.c6
-rw-r--r--src/projectile/v1FireProjectile.c14
-rw-r--r--src/projectile/v2Projectile.c6
-rw-r--r--src/projectile/v3ElectricProjectile.c10
-rw-r--r--src/projectile/v3HandProjectile.c4
-rw-r--r--src/projectile/v3TennisBallProjectile.c4
-rw-r--r--src/projectile/windProjectile.c6
-rw-r--r--src/projectile/winder.c4
33 files changed, 216 insertions, 218 deletions
diff --git a/src/projectile/arrowProjectile.c b/src/projectile/arrowProjectile.c
index fc6d3305..51a49e34 100644
--- a/src/projectile/arrowProjectile.c
+++ b/src/projectile/arrowProjectile.c
@@ -44,11 +44,11 @@ void sub_080A9334(Entity* this) {
void ArrowProjectile_Init(Entity* this) {
this->action = 1;
- this->spriteSettings.b.draw = 1;
- this->flags &= 0x7f;
+ this->spriteSettings.draw = 1;
+ COLLISION_OFF(this);
this->actionDelay = 0x6a;
this->field_0xf = 0;
- this->hVelocity = 0xa00;
+ this->zVelocity = 0xa00;
sub_080A94C0(this, this->type);
}
@@ -62,8 +62,8 @@ void ArrowProjectile_Action1(Entity* this) {
}
if (parent->field_0xf != 0) {
this->action = 2;
- this->flags = this->flags | 0x80;
- parent->attachedEntity = NULL;
+ COLLISION_ON(this);
+ parent->child = NULL;
SoundReq(SFX_FC);
}
}
@@ -71,7 +71,7 @@ void ArrowProjectile_Action1(Entity* this) {
void ArrowProjectile_Action2(Entity* this) {
if (this->collisions != 0) {
this->action = 3;
- this->flags &= 0x7f;
+ COLLISION_OFF(this);
this->actionDelay = 0x20;
InitializeAnimation(this, this->animIndex + 2);
EnqueueSFX(0x18a);
@@ -104,9 +104,9 @@ void ArrowProjectile_Action4(Entity* this) {
void sub_080A9488(Entity* this) {
this->action = 4;
- this->flags &= 0x7f;
+ COLLISION_OFF(this);
this->actionDelay = 2;
- this->hVelocity = 0x18000;
+ this->zVelocity = 0x18000;
this->animationState = (this->knockbackDirection & 0x18) >> 3;
EnqueueSFX(SFX_METAL_CLINK);
sub_080A94C0(this, this->animationState);
@@ -114,8 +114,8 @@ void sub_080A9488(Entity* this) {
void sub_080A94C0(Entity* this, u32 animationState) {
const struct_081299F8* entry = &gUnk_081299F8[animationState];
- this->spriteSettings.b.flipX = entry->flipX;
- this->spriteSettings.b.flipY = entry->flipY;
+ this->spriteSettings.flipX = entry->flipX;
+ this->spriteSettings.flipY = entry->flipY;
this->animIndex = entry->animIndex;
this->hitbox = (Hitbox*)entry->hitbox;
InitializeAnimation(this, this->animIndex);
diff --git a/src/projectile/ballAndChain.c b/src/projectile/ballAndChain.c
index 065c9e8a..bee0f066 100644
--- a/src/projectile/ballAndChain.c
+++ b/src/projectile/ballAndChain.c
@@ -33,7 +33,7 @@ void sub_080AB074(Entity* this) {
this->x.WORD += gSineTable[parent->field_0x7c.BYTES.byte0] * (parent->field_0x7c.BYTES.byte2 << 8);
this->y.WORD -= gSineTable[parent->field_0x7c.BYTES.byte0 + 0x40] * (parent->field_0x7c.BYTES.byte2 << 8);
- this->height.HALF.HI += (s8)parent->field_0x7c.BYTES.byte3;
+ this->z.HALF.HI += (s8)parent->field_0x7c.BYTES.byte3;
if (parent->field_0x7a.HALF.HI != 0) {
parent = CreateProjectile(0x19);
if (parent != NULL) {
diff --git a/src/projectile/boneProjectile.c b/src/projectile/boneProjectile.c
index a1a4d4c7..1bececa0 100644
--- a/src/projectile/boneProjectile.c
+++ b/src/projectile/boneProjectile.c
@@ -30,7 +30,7 @@ void sub_080A81C4(Entity* this) {
void BoneProjectile_Init(Entity* this) {
this->action = 1;
this->actionDelay = 0x3c;
- this->height.HALF.HI = 0xfffe;
+ this->z.HALF.HI = 0xfffe;
InitializeAnimation(this, 0);
}
@@ -57,14 +57,14 @@ void BoneProjectile_Action2(Entity* this) {
sub_080AF090(this);
if (sub_08003FC4(this, 0x1800) == 0) {
this->action = 3;
- this->flags = this->flags & 0x7f;
+ COLLISION_OFF(this);
this->speed = 0xe0;
- this->hVelocity = 0xe000;
+ this->zVelocity = 0xe000;
}
}
void BoneProjectile_Action3(Entity* this) {
- this->spriteSettings.b.draw ^= 1;
+ this->spriteSettings.draw ^= 1;
sub_0806F69C(this);
GetNextFrame(this);
if (sub_080044EC(this, 0x1800) == 0) {
@@ -82,8 +82,8 @@ void BoneProjectile_Action4(Entity* this) {
void sub_080A82D8(Entity* this) {
this->action = 4;
- this->flags &= 0x7f;
- this->hVelocity = 0x10000;
+ COLLISION_OFF(this);
+ this->zVelocity = 0x10000;
this->direction ^= 0x10;
this->speed = 0x80;
}
diff --git a/src/projectile/cannonballProjectile.c b/src/projectile/cannonballProjectile.c
index 2f4c8339..25d79adf 100644
--- a/src/projectile/cannonballProjectile.c
+++ b/src/projectile/cannonballProjectile.c
@@ -40,7 +40,7 @@ void sub_080AB544(Entity* this) {
void CannonballProjectile_Init(Entity* this) {
this->action = 1;
this->direction = this->type << 3;
- this->height.HALF.HI = 0xfffc;
+ this->z.HALF.HI = 0xfffc;
InitializeAnimation(this, this->type);
}
@@ -78,14 +78,14 @@ bool32 sub_080AB5F4(Entity* this) {
}
bool32 sub_080AB634(Entity* this) {
- Entity** entities = ((Entity**)&this->parent->hVelocity);
+ Entity** entities = ((Entity**)&this->parent->zVelocity);
u32 i;
for (i = 0; i <= 3; ++i) {
if (entities[i] != NULL && (sub_080177A0(this, entities[i]) != 0)) {
if (entities[i]->action < 3) {
entities[i]->action = 3;
entities[i]->actionDelay = 0x1e;
- entities[i]->spriteSettings.b.draw = 0;
+ entities[i]->spriteSettings.draw = 0;
CreateFx(entities[i], FX_WHITE_ROCK, 0);
}
DeleteEntity(this);
diff --git a/src/projectile/darkNutSwordSlash.c b/src/projectile/darkNutSwordSlash.c
index 51123fc7..20b968db 100644
--- a/src/projectile/darkNutSwordSlash.c
+++ b/src/projectile/darkNutSwordSlash.c
@@ -2,7 +2,7 @@
#include "player.h"
#include "coord.h"
-extern const u8 DarkNutSwordSlash_DamageTypes[];
+extern const u8 DarkNutSwordSlash_hitTypes[];
extern void (*const DarkNutSwordSlash_UpdatesForType[])(Entity*);
extern Hitbox const* const* const gUnk_081293E0[];
extern const Hitbox* const gUnk_081293F0[];
@@ -21,7 +21,7 @@ void DarkNutSwordSlash(Entity* this) {
InitAnimationForceUpdate(this, this->parent->animationState + 0x18);
}
}
- if ((this->parent == NULL) || (this->parent->currentHealth == 0)) {
+ if ((this->parent == NULL) || (this->parent->health == 0)) {
DeleteThisEntity();
}
if (((this->bitfield & 0x80) != 0) && (this->field_0x4c == &gPlayerEntity)) {
@@ -37,7 +37,7 @@ void DarkNutSwordSlash(Entity* this) {
}
void DarkNutSwordSlash_Init(Entity* this) {
- this->damageType = DarkNutSwordSlash_DamageTypes[this->parent->type + this->type * 4];
+ this->hitType = DarkNutSwordSlash_hitTypes[this->parent->type + this->type * 4];
}
void DarkNutSwordSlash_OnTick(Entity* this) {
@@ -46,7 +46,7 @@ void DarkNutSwordSlash_OnTick(Entity* this) {
void DarkNutSwordSlash_UpdateType0(Entity* this) {
Entity* parent = this->parent;
- this->hitbox = (Hitbox*)gUnk_081293E0[parent->animationState][(parent->frames.all & 0xf) - 1];
+ this->hitbox = (Hitbox*)gUnk_081293E0[parent->animationState][(parent->frame & 0xf) - 1];
}
void DarkNutSwordSlash_UpdateType2(Entity* this) {
@@ -55,7 +55,7 @@ void DarkNutSwordSlash_UpdateType2(Entity* this) {
}
void DarkNutSwordSlash_UpdateType34(Entity* this) {
- if ((this->parent->frames.all & 0x10) != 0) {
+ if ((this->parent->frame & 0x10) != 0) {
this->hitbox = (Hitbox*)gUnk_08129410[this->parent->animationState];
} else {
this->hitbox = (Hitbox*)gUnk_08129400[this->parent->animationState];
@@ -67,7 +67,7 @@ void DarkNutSwordSlash_UpdateType1(Entity* this) {
this->hitbox = (Hitbox*)gUnk_08129420[parent->animationState];
}
-const u8 DarkNutSwordSlash_DamageTypes[] = {
+const u8 DarkNutSwordSlash_hitTypes[] = {
76, 76, 78, 77, 83, 83, 83, 83, 79, 79, 76, 80, 84, 84, 84, 85, 79, 79, 76, 80,
};
void (*const DarkNutSwordSlash_UpdatesForType[])(Entity*) = {
diff --git a/src/projectile/dekuSeedProjectile.c b/src/projectile/dekuSeedProjectile.c
index 3438c057..120f2009 100644
--- a/src/projectile/dekuSeedProjectile.c
+++ b/src/projectile/dekuSeedProjectile.c
@@ -25,7 +25,7 @@ void DekuSeedProjectile_OnTick(Entity* this) {
void sub_080A8470(Entity* this) {
if (this->bitfield == 0x80) {
- if (this->damageType == 0x68) {
+ if (this->hitType == 0x68) {
EnqueueSFX(SFX_86);
}
DeleteEntity(this);
@@ -44,9 +44,9 @@ void DekuSeedProjectile_Init(Entity* this) {
this->action = 1;
this->actionDelay = 0x30;
this->field_0xf = 0;
- this->height.HALF.HI -= 4;
+ this->z.HALF.HI -= 4;
if (CheckGlobalFlag(TABIDACHI) == 0) {
- this->damageType = 0x68;
+ this->hitType = 0x68;
}
EnqueueSFX(SFX_18D);
InitializeAnimation(this, 0x18);
@@ -75,12 +75,12 @@ void DekuSeedProjectile_Action1(Entity* this) {
if ((parent->next != NULL) && (sub_080177A0(this, parent) != 0)) {
this->iframes = 0x10;
this->knockbackDirection = -this->direction;
- this->bitfield = -0x80;
+ this->bitfield = 0x80;
this->knockbackDuration = 0xc;
this->field_0x46 = 0;
parent->iframes = 0x10;
parent->knockbackDirection = this->direction;
- parent->bitfield = -0x3e;
+ parent->bitfield = 0xc2;
parent->knockbackDuration = 0xc;
parent->field_0x46 = 0;
}
@@ -95,7 +95,7 @@ void DekuSeedProjectile_Action2(Entity* this) {
}
if (--this->actionDelay == 0) {
this->action = 1;
- this->flags |= 0x80;
+ COLLISION_ON(this);
}
} else {
sub_0800417E(this, (u32)this->collisions);
@@ -107,7 +107,7 @@ void DekuSeedProjectile_Action2(Entity* this) {
void DekuSeedProjectile_Action3(Entity* this) {
GetNextFrame(this);
- if ((this->frames.all & 0x80) != 0) {
+ if ((this->frame & 0x80) != 0) {
DeleteThisEntity();
}
}
@@ -120,19 +120,19 @@ void DekuSeedProjectile_Action4(Entity* this) {
DeleteThisEntity();
return;
case 1:
- this->flags &= 0x7f;
+ COLLISION_OFF(this);
this->speed = 0x120;
break;
}
- if ((this->flags & 0x80) == 0) {
- this->spriteSettings.b.draw ^= 1;
+ if ((this->flags & ENT_COLLIDE) == 0) {
+ this->spriteSettings.draw ^= 1;
}
}
void sub_080A8680(Entity* this) {
this->action = 2;
- this->flags &= 0x7f;
+ COLLISION_OFF(this);
this->actionDelay = 3;
this->field_0xf = 1;
EnqueueSFX(SFX_ITEM_SHIELD_BOUNCE);
@@ -140,7 +140,7 @@ void sub_080A8680(Entity* this) {
void sub_080A86A0(Entity* this) {
this->action = 3;
- this->flags &= 0x7f;
+ COLLISION_OFF(this);
this->speed = 0;
EnqueueSFX(SFX_18E);
}
diff --git a/src/projectile/dirtBallProjectile.c b/src/projectile/dirtBallProjectile.c
index fd5909b8..9d4d7187 100644
--- a/src/projectile/dirtBallProjectile.c
+++ b/src/projectile/dirtBallProjectile.c
@@ -17,10 +17,10 @@ void DirtBallProjectile(Entity* this) {
void DirtBallProjectile_OnTick(Entity* this) {
if (this->type == 1) {
- if (this->attachedEntity == NULL) {
+ if (this->child == NULL) {
DeleteThisEntity();
}
- if (this->attachedEntity->next == NULL) {
+ if (this->child->next == NULL) {
DeleteThisEntity();
}
}
@@ -30,7 +30,7 @@ void DirtBallProjectile_OnTick(Entity* this) {
void sub_080A881C(Entity* this) {
this->field_0x46 = 0;
if (this->type == 0) {
- this->parent->attachedEntity = NULL;
+ this->parent->child = NULL;
if (this->bitfield == 0x80) {
gPlayerState.hurtBlinkSpeed = 0xf0;
ModHealth(-2);
@@ -47,8 +47,8 @@ void sub_080A881C(Entity* this) {
void DirtBallProjectile_Init(Entity* this) {
this->action = 1;
this->subAction = 0;
- this->spriteSettings.b.shadow = 1;
- this->hVelocity = 0x8000;
+ this->spriteSettings.shadow = 1;
+ this->zVelocity = 0x8000;
this->hitbox = (Hitbox*)&gUnk_08129764;
this->field_0x3c |= 0x10;
switch (this->type) {
@@ -79,24 +79,24 @@ void DirtBallProjectile_Action1(Entity* this) {
PositionRelative(parent, this, 0, -0x10000);
switch (this->type) {
case 0:
- this->height.HALF.HI += 0x10;
+ this->z.HALF.HI += 0x10;
break;
case 1:
- this->height.HALF.HI += 0xe;
- sub_08078954(this->attachedEntity);
- CopyPosition(this, this->attachedEntity);
- if ((0xf < (u8)(this->actionDelay++ + 1)) && (entity = this->attachedEntity, entity->actionDelay == 0)) {
+ this->z.HALF.HI += 0xe;
+ sub_08078954(this->child);
+ CopyPosition(this, this->child);
+ if ((0xf < (u8)(this->actionDelay++ + 1)) && (entity = this->child, entity->actionDelay == 0)) {
if ((this->actionDelay & 2) != 0) {
entity->field_0xf += 1;
}
- if ((this->attachedEntity->field_0xf < 0x20) && ((this->attachedEntity->field_0xf & 3) == 3)) {
+ if ((this->child->field_0xf < 0x20) && ((this->child->field_0xf & 3) == 3)) {
parent->field_0x82.HALF.HI = 0xc0;
this->action = 2;
}
}
break;
case 2:
- this->height.HALF.HI += 0xe;
+ this->z.HALF.HI += 0xe;
if (sub_080041A0(this, &gPlayerEntity, 0xe, 0xe) != 0) {
this->action = 2;
parent->field_0x82.HALF.HI = 0xc0;
@@ -112,7 +112,7 @@ void DirtBallProjectile_Action2(Entity* this) {
Entity* entity;
if (this->type == 1) {
- entity = this->attachedEntity;
+ entity = this->child;
if (entity == NULL) {
DeleteThisEntity();
}
@@ -161,7 +161,7 @@ void DirtBallProjectile_Action2(Entity* this) {
void DirtBallProjectile_Action3(Entity* this) {
GetNextFrame(this);
- if ((this->frames.all & 0x80) != 0) {
+ if ((this->frame & 0x80) != 0) {
DeleteEntity(this);
}
}
diff --git a/src/projectile/fireProjectile.c b/src/projectile/fireProjectile.c
index 3ef308bd..8526b91a 100644
--- a/src/projectile/fireProjectile.c
+++ b/src/projectile/fireProjectile.c
@@ -37,7 +37,7 @@ void FireProjectile_Action1(Entity* this) {
if (parent->next == NULL) {
DeleteEntity(this);
} else {
- if (this->spriteSettings.b.draw == 1) {
+ if (this->spriteSettings.draw == 1) {
CopyPosition(parent, this);
if (this->actionDelay != 0) {
direction = parent->direction & 0x18;
@@ -61,14 +61,14 @@ void FireProjectile_Action2(Entity* this) {
}
} else {
this->action = 3;
- this->flags &= 0x7f;
+ COLLISION_OFF(this);
this->speed = 0;
}
}
void FireProjectile_Action3(Entity* this) {
GetNextFrame(this);
- if ((this->frames.all & 0x80) != 0) {
+ if ((this->frame & 0x80) != 0) {
DeleteEntity(this);
}
}
diff --git a/src/projectile/gleerokProjectile.c b/src/projectile/gleerokProjectile.c
index d48820b0..3c59c8f2 100644
--- a/src/projectile/gleerokProjectile.c
+++ b/src/projectile/gleerokProjectile.c
@@ -25,7 +25,7 @@ void GleerokProjectile(Entity* this) {
void GleerokProjectile_OnTick(Entity* this) {
if (((this->type != 3) && ((this->bitfield & 0x80) != 0)) && ((this->bitfield & 0x7f) != 0x1e)) {
this->action = 3;
- this->flags &= 0x7f;
+ COLLISION_OFF(this);
InitializeAnimation(this, 0x53);
}
GleerokProjectile_Actions[this->action](this);
@@ -36,12 +36,12 @@ void GleerokProjectile_Init(Entity* this) {
s32 iVar2;
this->action = 1;
- this->hVelocity = -0x10000;
+ this->zVelocity = -0x10000;
if (this->type != 3) {
CopyPosition(this->parent, this);
sub_0806F5BC(this, 0x1000, this->direction);
- this->height.WORD = this->parent->y.WORD - this->attachedEntity->y.WORD;
- this->y.WORD -= this->height.WORD;
+ this->z.WORD = this->parent->y.WORD - this->child->y.WORD;
+ this->y.WORD -= this->z.WORD;
InitializeAnimation(this, 0x51);
SoundReq(SFX_1B5);
}
@@ -63,14 +63,14 @@ void GleerokProjectile_Init(Entity* this) {
} else if (0x400 < iVar2) {
iVar2 = 0x400;
}
- this->hVelocity = this->height.WORD / (iVar2 << 8) << 0xd;
+ this->zVelocity = this->z.WORD / (iVar2 << 8) << 0xd;
this->field_0xf = 0x1e;
break;
case 2:
- this->hVelocity = (this->height.WORD / 0x18000) << 0xc;
+ this->zVelocity = (this->z.WORD / 0x18000) << 0xc;
break;
case 3:
- this->height.WORD = 0xff600000;
+ this->z.WORD = 0xff600000;
uVar1 = (Random() & 3) * 2;
this->x.HALF.HI = gUnk_08129978[uVar1] + this->x.HALF.HI;
this->y.HALF.HI = gUnk_08129978[uVar1 + 1] + this->y.HALF.HI;
@@ -118,7 +118,7 @@ void GleerokProjectile_Action2(Entity* this) {
GetNextFrame(this);
if (this->type == 2) {
if (--this->actionDelay == 0xff) {
- this->flags &= 0x7f;
+ COLLISION_OFF(this);
this->action = 3;
InitializeAnimation(this, 0x55);
} else {
@@ -126,9 +126,9 @@ void GleerokProjectile_Action2(Entity* this) {
sub_080A90D8(this);
}
} else {
- if ((this->frames.all & 0x80) != 0) {
+ if ((this->frame & 0x80) != 0) {
this->action = 3;
- this->flags &= 0x7f;
+ COLLISION_OFF(this);
InitializeAnimation(this, 0x53);
}
}
@@ -136,7 +136,7 @@ void GleerokProjectile_Action2(Entity* this) {
void GleerokProjectile_Action3(Entity* this) {
GetNextFrame(this);
- if ((this->frames.all & 0x80) != 0) {
+ if ((this->frame & 0x80) != 0) {
DeleteThisEntity();
}
}
diff --git a/src/projectile/guardLineOfSight.c b/src/projectile/guardLineOfSight.c
index 2fff5c06..cf0510e4 100644
--- a/src/projectile/guardLineOfSight.c
+++ b/src/projectile/guardLineOfSight.c
@@ -18,7 +18,7 @@ void GuardLineOfSight(Entity* this) {
if (this->action == 0) {
this->action = 1;
this->actionDelay = Random();
- this->spriteSettings.b.draw = 0;
+ this->spriteSettings.draw = 0;
}
if (this->bitfield == 0x80) {
if (this->parent != NULL) {
@@ -47,7 +47,7 @@ void GuardLineOfSight(Entity* this) {
if (this->action == 0) {
this->action = 1;
this->actionDelay = 0x12;
- this->spriteSettings.b.draw = 0;
+ this->spriteSettings.draw = 0;
this->speed = 0x800;
this->hitbox = (Hitbox*)&gUnk_080FD1E4;
InitializeAnimation(this, 0);
diff --git a/src/projectile/gyorgMaleEnergyProjectile.c b/src/projectile/gyorgMaleEnergyProjectile.c
index f3244122..65c67ba1 100644
--- a/src/projectile/gyorgMaleEnergyProjectile.c
+++ b/src/projectile/gyorgMaleEnergyProjectile.c
@@ -43,7 +43,7 @@ void GyorgMaleEnergyProjectile_Action1(Entity* this) {
GetNextFrame(this);
if (--this->actionDelay == 0) {
this->action = 2;
- this->flags |= 0x80;
+ COLLISION_ON(this);
this->direction = GetFacingDirection(this, &gPlayerEntity);
SoundReq(SFX_12E);
}
@@ -57,7 +57,7 @@ void GyorgMaleEnergyProjectile_Action2(Entity* this) {
}
if (--this->actionDelay == 0) {
this->action = 3;
- this->flags &= 0x7f;
+ COLLISION_OFF(this);
this->speed = this->speed >> 1;
InitializeAnimation(this, 1);
}
@@ -66,7 +66,7 @@ void GyorgMaleEnergyProjectile_Action2(Entity* this) {
void GyorgMaleEnergyProjectile_Action3(Entity* this) {
sub_080AF090(this);
GetNextFrame(this);
- if ((this->frames.all & 0x80) != 0) {
+ if ((this->frame & 0x80) != 0) {
DeleteThisEntity();
}
}
diff --git a/src/projectile/gyorgTail.c b/src/projectile/gyorgTail.c
index ce9d6d6c..684ace6b 100644
--- a/src/projectile/gyorgTail.c
+++ b/src/projectile/gyorgTail.c
@@ -40,9 +40,9 @@ void GyorgTail(Entity* this) {
this->spritePriority.b0 = parent->spritePriority.b0 - 2;
if ((parent->spriteRendering.b3 == 3) && (parent->field_0x7c.BYTES.byte0 == 0)) {
- this->flags &= 0x7f;
+ COLLISION_OFF(this);
} else {
- this->flags |= 0x80;
+ COLLISION_ON(this);
}
}
}
@@ -55,7 +55,7 @@ void GyorgTail_Init(Entity* this) {
if (sub_080AC5E4(this) != 0) {
this->action = 1;
this->frameIndex = 0xc;
- this->spriteSettings.b.draw = 1;
+ this->spriteSettings.draw = 1;
this->field_0x7a.HWORD = gUnk_0812A9B4[Random() & 1];
this->collisionLayer = 2;
sub_080AC388(this);
@@ -66,19 +66,19 @@ ASM_FUNC("asm/non_matching/gyorgTail/sub_080AC388.inc", void sub_080AC388(Entity
void sub_080AC480(Entity* this) {
if (this->actionDelay != 0) {
- if (this->parent->currentHealth == 0) {
+ if (this->parent->health == 0) {
this->action = 1;
- this->damageType = 0x1d;
+ this->hitType = 0x1d;
} else {
if (--this->actionDelay == 0) {
- this->damageType = 0x1c;
+ this->hitType = 0x1c;
SoundReq(SFX_116);
}
}
} else {
if (--this->field_0xf == 0) {
this->action = 1;
- this->damageType = 0x1d;
+ this->hitType = 0x1d;
}
this->field_0x7c.HALF_U.LO += ((s16)this->field_0x7a.HWORD >= 1) ? 0x300 : -0x300;
this->direction = this->field_0x7c.HALF.LO >> 8;
@@ -92,7 +92,7 @@ void sub_080AC510(Entity* this) {
if (this->action == 0) {
this->action = 1;
this->frameIndex = gUnk_0812A9BA[this->type * 3 + this->type2 - 1];
- this->spriteSettings.b.draw = 1;
+ this->spriteSettings.draw = 1;
this->collisionLayer = 2;
if (*(u16*)&this->type == 0x300) {
this->hitbox = &gHitbox_21;
@@ -104,7 +104,7 @@ void sub_080AC560(Entity* this) {
s32 factor;
Entity* entity;
- entity = this->attachedEntity;
+ entity = this->child;
if (entity->next == NULL) {
DeleteThisEntity();
}
@@ -117,7 +117,7 @@ void sub_080AC560(Entity* this) {
this->hitbox = &gHitbox_20;
}
this->frameIndex = 0xff;
- this->spriteSettings.b.draw = 1;
+ this->spriteSettings.draw = 1;
}
factor = this->field_0x78.HALF.HI << 8;
this->x.WORD = entity->x.WORD + gSineTable[entity->direction] * factor;
@@ -142,21 +142,21 @@ NONMATCH("asm/non_matching/gyorgTail/sub_080AC5E4.inc", bool32 sub_080AC5E4(Enti
entity->type2 = 1;
entity->parent = this->parent;
entity->field_0x78.HALF.HI = 0x12;
- this->attachedEntity = entity;
+ this->child = entity;
entity2 = CreateProjectile(0x22);
entity2->type = this->type;
entity2->type2 = 2;
entity2->parent = this->parent;
entity2->field_0x78.HALF.HI = 0x14;
uVar3 = entity2->field_0x78.HALF.HI;
- entity->attachedEntity = entity2;
+ entity->child = entity2;
entity3 = CreateProjectile(0x22);
entity3->type = this->type;
entity3->type2 = 3;
entity3->parent = this->parent;
- entity3->attachedEntity = NULL;
+ entity3->child = NULL;
entity3->field_0x78.HALF.HI = 0;
- entity2->attachedEntity = entity3;
+ entity2->child = entity3;
} else {
if (0x44 < gEntCount) {
return 0;
@@ -168,20 +168,20 @@ NONMATCH("asm/non_matching/gyorgTail/sub_080AC5E4.inc", bool32 sub_080AC5E4(Enti
entity->parent = this->parent;
entity->field_0x78.HALF.HI = 0x10;
uVar3 = entity->field_0x78.HALF.HI;
- this->attachedEntity = entity;
+ this->child = entity;
entity2 = CreateProjectile(0x22);
entity2->type = this->type;
entity2->type2 = 2;
entity2->parent = this->parent;
- entity2->attachedEntity = NULL;
+ entity2->child = NULL;
entity2->field_0x78.HALF.HI = 0x20;
- entity->attachedEntity = entity2;
+ entity->child = entity2;
}
entity4 = CreateProjectile(0x22);
entity4->type = this->type;
entity4->type2 = 4;
entity4->parent = this->parent;
- entity4->attachedEntity = this;
+ entity4->child = this;
entity4->field_0x78.HALF.HI = uVar3;
return 1;
}
@@ -200,9 +200,9 @@ NONMATCH("asm/non_matching/gyorgTail/sub_080AC7C4.inc", void sub_080AC7C4(Entity
s32 iVar2;
s32 iVar3;
- entity1 = this->attachedEntity;
- entity2 = entity1->attachedEntity;
- entity3 = entity2->attachedEntity;
+ entity1 = this->child;
+ entity2 = entity1->child;
+ entity3 = entity2->child;
if (entity3 != NULL) {
CopyPosition(this->parent, entity3);
} else {
diff --git a/src/projectile/iceProjectile.c b/src/projectile/iceProjectile.c
index da4d7c21..6e9a4ef7 100644
--- a/src/projectile/iceProjectile.c
+++ b/src/projectile/iceProjectile.c
@@ -39,7 +39,7 @@ void IceProjectile_Action1(Entity* this) {
if (parent->next == NULL) {
DeleteEntity(this);
} else {
- if (this->spriteSettings.b.draw == 1) {
+ if (this->spriteSettings.draw == 1) {
CopyPosition(parent, this);
if (this->actionDelay != 0) {
direction = parent->direction & 0x18;
@@ -63,14 +63,14 @@ void IceProjectile_Action2(Entity* this) {
}
} else {
this->action = 3;
- this->flags &= 0x7f;
+ COLLISION_OFF(this);
this->speed = 0;
}
}
void IceProjectile_Action3(Entity* this) {
GetNextFrame(this);
- if ((this->frames.all & 0x80) != 0) {
+ if ((this->frame & 0x80) != 0) {
DeleteEntity(this);
}
}
diff --git a/src/projectile/keatonDagger.c b/src/projectile/keatonDagger.c
index b7a876e0..8c9bc2f1 100644
--- a/src/projectile/keatonDagger.c
+++ b/src/projectile/keatonDagger.c
@@ -13,7 +13,7 @@ void KeatonDagger(Entity* this) {
this->action = 1;
}
parent = this->parent;
- if (((parent == NULL) || (parent->currentHealth == 0)) || (parent->next == NULL)) {
+ if (((parent == NULL) || (parent->health == 0)) || (parent->next == NULL)) {
if (((this->bitfield & 0x80) != 0) && (this->field_0x4c == &gPlayerEntity)) {
sub_0803C0AC(this);
}
diff --git a/src/projectile/lakituCloudProjectile.c b/src/projectile/lakituCloudProjectile.c
index 25599826..39c6f65f 100644
--- a/src/projectile/lakituCloudProjectile.c
+++ b/src/projectile/lakituCloudProjectile.c
@@ -42,7 +42,7 @@ void LakituCloudProjectile_SubAction1(Entity* this) {
void LakituCloudProjectile_SubAction2(Entity* this) {
if (sub_0806F3E4(this) != 0) {
- if (this->damageType == 0xa6) {
+ if (this->hitType == 0xa6) {
ModHealth(-2);
sub_0800449C(&gPlayerEntity, 0x7a);
sub_08079D84();
@@ -60,7 +60,7 @@ void LakituCloudProjectile_Init(Entity* this) {
void LakituCloudProjectile_Action1(Entity* this) {
PositionRelative(this->parent, this, 0, -0x10000);
- this->height.HALF.HI = 0xfffe;
+ this->z.HALF.HI = 0xfffe;
UpdateAnimationSingleFrame(this);
}
diff --git a/src/projectile/lakituLightning.c b/src/projectile/lakituLightning.c
index 1dbcf1fb..755d7bba 100644
--- a/src/projectile/lakituLightning.c
+++ b/src/projectile/lakituLightning.c
@@ -19,7 +19,7 @@ void LakituLightning_OnTick(Entity* this) {
}
void sub_080A9DD8(Entity* this) {
- if ((this->currentHealth == 0) || (this->bitfield == 0x80)) {
+ if ((this->health == 0) || (this->bitfield == 0x80)) {
DeleteThisEntity();
}
LakituLightning_OnTick(this);
@@ -28,7 +28,7 @@ void sub_080A9DD8(Entity* this) {
void LakituLightning_Init(Entity* this) {
this->action = 1;
this->actionDelay = 0xb4;
- this->currentHealth = 1;
+ this->health = 1;
InitializeAnimation(this, 0);
}
diff --git a/src/projectile/mandiblesProjectile.c b/src/projectile/mandiblesProjectile.c
index 54f08371..3162f7ae 100644
--- a/src/projectile/mandiblesProjectile.c
+++ b/src/projectile/mandiblesProjectile.c
@@ -27,12 +27,12 @@ void sub_080AA3E0(Entity*, u32);
bool32 sub_080AA374(Entity*);
void MandiblesProjectile(Entity* this) {
- Entity* entity = this->attachedEntity;
+ Entity* entity = this->child;
if (entity == NULL) {
entity = this->parent;
}
- if ((entity->field_0x43 == 0) && ((this->flags & 0x80) == 0)) {
- this->flags |= 0x80;
+ if ((entity->field_0x43 == 0) && ((this->flags & ENT_COLLIDE) == 0)) {
+ COLLISION_ON(this);
}
MandiblesProjectile_Functions[GetNextFunction(this)](this);
}
@@ -104,8 +104,8 @@ void MandiblesProjectile_Action1(Entity* this) {
void MandiblesProjectile_Action2(Entity* this) {
UpdateAnimationSingleFrame(this);
- if ((this->frames.all & 0x40) != 0) {
- this->frames.all &= 0xbf;
+ if ((this->frame & 0x40) != 0) {
+ this->frame &= 0xbf;
EnqueueSFX(SFX_15D);
}
this->field_0x78.HWORD = TILE(this->x.HALF.HI, this->y.HALF.HI);
@@ -122,7 +122,7 @@ void MandiblesProjectile_Action3(Entity* this) {
s8* tmp;
Entity* entity;
- entity = this->attachedEntity;
+ entity = this->child;
if (entity == NULL) {
DeleteThisEntity();
}
@@ -141,7 +141,7 @@ void MandiblesProjectile_Action3(Entity* this) {
this->field_0xf -= 1;
} else {
UpdateAnimationSingleFrame(this);
- if ((this->frames.all & 0x80) != 0) {
+ if ((this->frame & 0x80) != 0) {
this->action = 4;
this->field_0x82.HALF.LO = 3;
this->field_0xf = 0x40;
@@ -164,16 +164,16 @@ void MandiblesProjectile_Action4(Entity* this) {
u32 uVar2;
Entity* entity;
- entity = this->attachedEntity;
+ entity = this->child;
if (entity != NULL) {
if (entity->next == NULL) {
- this->attachedEntity = NULL;
+ this->child = NULL;
}
if (this->field_0xf != 0) {
this->field_0xf -= 1;
} else {
if (sub_080AA374(this) != 0) {
- if (entity->currentHealth == 0) {
+ if (entity->health == 0) {
DeleteThisEntity();
}
EnqueueSFX(0xf2);
@@ -183,8 +183,8 @@ void MandiblesProjectile_Action4(Entity* this) {
this->actionDelay = 0;
this->field_0x80.HWORD = 0x20;
this->spriteOrientation.flipY = 2;
- this->parent = this->attachedEntity;
- this->attachedEntity = NULL;
+ this->parent = this->child;
+ this->child = NULL;
sub_080AA270(this);
entity = this->parent;
entity->action = 1;
@@ -223,12 +223,12 @@ void sub_080AA1D8(Entity* this) {
PositionRelative(parent, this, tmp[0] << 0x10, tmp[1] << 0x10);
}
if (parent->field_0x43 != 0) {
- if ((this->flags & 0x80) != 0) {
- this->flags &= 0x7f;
+ if ((this->flags & ENT_COLLIDE) != 0) {
+ COLLISION_OFF(this);
}
} else {
- if ((this->flags & 0x80) == 0) {
- this->flags |= 0x80;
+ if ((this->flags & ENT_COLLIDE) == 0) {
+ COLLISION_ON(this);
}
}
}
@@ -306,13 +306,12 @@ NONMATCH("asm/non_matching/mandiblesProjectile/sub_080AA374.inc", bool32 sub_080
bool32 result;
result = FALSE;
- if ((this->attachedEntity != NULL) && (this->attachedEntity->next != NULL)) {
+ if ((this->child != NULL) && (this->child->next != NULL)) {
// TODO regalloc
- animationState = this->attachedEntity->animationState;
- uVar1 =
- sub_0806F824(this, this->attachedEntity, gUnk_08129D14[animationState], gUnk_08129D14[animationState + 1]);
- if (sub_0806FCB8(this, this->attachedEntity->x.HALF.HI + gUnk_08129D14[animationState],
- this->attachedEntity->y.HALF.HI + gUnk_08129D14[animationState + 1], 8) != 0) {
+ animationState = this->child->animationState;
+ uVar1 = sub_0806F824(this, this->child, gUnk_08129D14[animationState], gUnk_08129D14[animationState + 1]);
+ if (sub_0806FCB8(this, this->child->x.HALF.HI + gUnk_08129D14[animationState],
+ this->child->y.HALF.HI + gUnk_08129D14[animationState + 1], 8) != 0) {
result = TRUE;
} else {
sub_08004596(this, uVar1);
diff --git a/src/projectile/mazaalEnergyBeam.c b/src/projectile/mazaalEnergyBeam.c
index 4fe557b0..8d617ba3 100644
--- a/src/projectile/mazaalEnergyBeam.c
+++ b/src/projectile/mazaalEnergyBeam.c
@@ -11,7 +11,7 @@ void MazaalEnergyBeam(Entity* this) {
void MazaalEnergyBeam_Init(Entity* this) {
this->action = 1;
this->actionDelay = 10;
- this->height.HALF.HI -= 2;
+ this->z.HALF.HI -= 2;
this->y.HALF.HI += 2;
InitializeAnimation(this, 0);
SoundReq(SFX_149);
@@ -22,13 +22,13 @@ void MazaalEnergyBeam_Action1(Entity* this) {
if (--this->actionDelay == 0) {
this->action = 2;
- this->flags &= 0x7f;
+ COLLISION_OFF(this);
this->spritePriority.b0 = 7;
this->y.HALF.HI += 6;
InitializeAnimation(this, 1);
} else {
- if (this->height.HALF.HI != 0) {
- this->height.HALF.HI += 1;
+ if (this->z.HALF.HI != 0) {
+ this->z.HALF.HI += 1;
}
tmp = &gSineTable[this->direction];
@@ -40,7 +40,7 @@ void MazaalEnergyBeam_Action1(Entity* this) {
void MazaalEnergyBeam_Action2(Entity* this) {
GetNextFrame(this);
- if ((this->frames.all & 0x80) != 0) {
+ if ((this->frame & 0x80) != 0) {
DeleteEntity(this);
}
}
diff --git a/src/projectile/moblinSpear.c b/src/projectile/moblinSpear.c
index c24e3480..f31459cc 100644
--- a/src/projectile/moblinSpear.c
+++ b/src/projectile/moblinSpear.c
@@ -62,7 +62,7 @@ NONMATCH("asm/non_matching/moblinSpear/MoblinSpear_Action1.inc", void MoblinSpea
if (parent->next == NULL) {
DeleteThisEntity();
}
- frames = parent->frames.all * 4;
+ frames = parent->frame * 4;
a = &gUnk_0812966C[frames / 4];
this->hitbox->offset_x = a->offsetX;
// TODO offset used to increase a pointer is already increated here?
@@ -73,12 +73,12 @@ NONMATCH("asm/non_matching/moblinSpear/MoblinSpear_Action1.inc", void MoblinSpea
this->hitbox->width = a->width;
this->hitbox->height = a->height;
if (parent->field_0x43 != 0) {
- if ((this->flags & 0x80) != 0) {
- this->flags &= 0x7f;
+ if ((this->flags & ENT_COLLIDE) != 0) {
+ COLLISION_OFF(this);
}
} else {
- if ((this->flags & 0x80) == 0) {
- this->flags |= 0x80;
+ if ((this->flags & ENT_COLLIDE) == 0) {
+ COLLISION_ON(this);
}
}
}
diff --git a/src/projectile/octorokBossProjectile.c b/src/projectile/octorokBossProjectile.c
index 5b1f8e44..048b9661 100644
--- a/src/projectile/octorokBossProjectile.c
+++ b/src/projectile/octorokBossProjectile.c
@@ -40,7 +40,7 @@ void OctorokBossProjectile_Init(Entity* this) {
this->spriteRendering.b3 = 3;
this->spritePriority.b0 = 6;
this->speed = (Random() & 0x1ff) + 0x200;
- this->hVelocity = (Random() & 0x1fff) + 0x18000;
+ this->zVelocity = (Random() & 0x1fff) + 0x18000;
uVar1 = (((u8)Random() & 7) - 4);
this->direction -= uVar1;
*(u32*)&this->field_0x78 = 600;
@@ -60,7 +60,7 @@ void OctorokBossProjectile_Init(Entity* this) {
break;
case 3:
CopyPosition(&gPlayerEntity, this);
- this->height.WORD = 0xff600000;
+ this->z.WORD = 0xff600000;
this->x.HALF.HI += 0x60;
this->y.HALF.HI += 0x40;
this->x.HALF.HI -= (s32)Random() % 0xc0;
@@ -89,14 +89,14 @@ void OctorokBossProjectile_Action1(Entity* this) {
this->speed = 0x400;
this->type2 = 1;
this->actionDelay = 0;
- this->flags &= 0x7f;
+ COLLISION_OFF(this);
}
if (sub_0806FC80(this, this->parent, 0x40) != 0) {
if (this->type2 == 0) {
this->direction ^= 0x80;
this->speed = 0x400;
} else {
- this->parent->currentHealth -= 1;
+ this->parent->health -= 1;
this->parent->iframes = 0x1e;
if (this->parent->field_0x7c.BYTES.byte0 != 0) {
this->parent->knockbackDuration = 0x18;
@@ -132,11 +132,11 @@ void OctorokBossProjectile_Action1(Entity* this) {
return;
}
for (index = 0; index < 3; ++index) {
- this->attachedEntity = CreateProjectileWithParent(this, 0xf, 1);
- if (this->attachedEntity != NULL) {
- this->attachedEntity->parent = this->parent;
- this->attachedEntity->direction = this->direction + gUnk_08129ADC[index];
- CopyPosition(this, this->attachedEntity);
+ this->child = CreateProjectileWithParent(this, 0xf, 1);
+ if (this->child != NULL) {
+ this->child->parent = this->parent;
+ this->child->direction = this->direction + gUnk_08129ADC[index];
+ CopyPosition(this, this->child);
}
}
OctorokBossProjectile_Action2(this);
@@ -156,9 +156,9 @@ void OctorokBossProjectile_Action1(Entity* this) {
}
if (*(u32*)&this->field_0x78 < 0x1e) {
if ((*(u32*)&this->field_0x78 & 7) != 0) {
- this->spriteSettings.b.draw = 1;
+ this->spriteSettings.draw = 1;
} else {
- this->spriteSettings.b.draw = 0;
+ this->spriteSettings.draw = 0;
}
}
if (--*(u32*)&this->field_0x78 == -1) {
@@ -175,8 +175,8 @@ void OctorokBossProjectile_Action1(Entity* this) {
sub_0806F62C(this, this->speed, this->direction);
return;
}
- if (this->attachedEntity != NULL) {
- this->attachedEntity->actionDelay = 1;
+ if (this->child != NULL) {
+ this->child->actionDelay = 1;
}
DeleteThisEntity();
break;
diff --git a/src/projectile/projectile5.c b/src/projectile/projectile5.c
index 1010eb45..5d99e015 100644
--- a/src/projectile/projectile5.c
+++ b/src/projectile/projectile5.c
@@ -59,7 +59,7 @@ void Projectile5_Action1(Entity* this) {
DeleteThisEntity();
}
CopyPosition(parent, this);
- this->height.HALF.HI += 2;
+ this->z.HALF.HI += 2;
}
void (*const Projectile5_Functions[])(Entity*) = {
diff --git a/src/projectile/rockProjectile.c b/src/projectile/rockProjectile.c
index 04a689c2..02fea8ba 100644
--- a/src/projectile/rockProjectile.c
+++ b/src/projectile/rockProjectile.c
@@ -31,7 +31,7 @@ void sub_080A8064(Entity* this) {
void RockProjectile_Init(Entity* this) {
this->action = 1;
this->actionDelay = 0x30;
- this->hVelocity = 0xa000;
+ this->zVelocity = 0xa000;
InitializeAnimation(this, 0);
}
@@ -69,7 +69,7 @@ void RockProjectile_Action3(Entity* this) {
DeleteEntity(this);
return;
case 1:
- this->flags &= 0x7f;
+ COLLISION_OFF(this);
this->speed = 0x120;
if (sub_0800442E(this) != 0) {
return;
@@ -77,16 +77,16 @@ void RockProjectile_Action3(Entity* this) {
break;
}
- if ((this->flags & 0x80) == 0) {
- this->spriteSettings.b.draw ^= 1;
+ if ((this->flags & ENT_COLLIDE) == 0) {
+ this->spriteSettings.draw ^= 1;
}
}
void sub_080A8178(Entity* this) {
this->action = 2;
- this->flags &= 0x7f;
+ COLLISION_OFF(this);
this->speed = 0x40;
- this->hVelocity = 0x14000;
+ this->zVelocity = 0x14000;
}
void (*const RockProjectile_Functions[])(Entity*) = {
diff --git a/src/projectile/spiderWeb.c b/src/projectile/spiderWeb.c
index 68d6e868..fe98e9fb 100644
--- a/src/projectile/spiderWeb.c
+++ b/src/projectile/spiderWeb.c
@@ -37,7 +37,7 @@ void sub_080AA6C0(Entity* this) {
if (this->bitfield == 0x87) {
this->action = 3;
this->actionDelay = 0x5a;
- this->flags &= 0x7f;
+ COLLISION_OFF(this);
InitAnimationForceUpdate(this, this->type + 0x10);
object = CreateObject(OBJECT_2A, 3, 0);
if (object != NULL) {
@@ -80,15 +80,15 @@ void sub_080AA78C(Entity* this) {
}
if (sub_0806F520(this) != 0) {
UpdateAnimationSingleFrame(this);
- if ((this->frames.all & 0x10) != 0) {
- this->frames.all &= 0xef;
+ if ((this->frame & 0x10) != 0) {
+ this->frame &= 0xef;
EnqueueSFX(SFX_100);
}
- if ((this->frames.all & 0x80) != 0) {
+ if ((this->frame & 0x80) != 0) {
sub_080AAAA8(this);
}
} else {
- if ((this->frames.all & 1) != 0) {
+ if ((this->frame & 1) != 0) {
sub_080AAAA8(this);
} else {
InitAnimationForceUpdate(this, this->type + 0x10);
@@ -110,7 +110,7 @@ void SpiderWeb_Init(Entity* this) {
}
void SpiderWeb_Action1(Entity* this) {
- if ((this->frames.all & 0x80) == 0) {
+ if ((this->frame & 0x80) == 0) {
UpdateAnimationSingleFrame(this);
}
sub_080AA9E0(this);
@@ -144,10 +144,9 @@ void SpiderWeb_SubAction0(Entity* this) {
InitAnimationForceUpdate(this, this->type + 4);
}
if ((entity->animationState >> 1 == this->type) && (gPlayerState.field_0xa8 == 0x1a) &&
- ((gPlayerState.heldObject & 2) != 0) && ((gPlayerEntity.frames.all & 2) != 0) &&
- ((this->frames.all & 0x80) == 0)) {
+ ((gPlayerState.heldObject & 2) != 0) && ((gPlayerEntity.frame & 2) != 0) && ((this->frame & 0x80) == 0)) {
UpdateAnimationSingleFrame(this);
- if ((this->frames.all & 1) != 0) {
+ if ((this->frame & 1) != 0) {
entity->x.HALF.HI = gUnk_0812A06C[entity->animationState] + entity->x.HALF.HI;
entity->y.HALF.HI = gUnk_0812A06C[entity->animationState + 1] + entity->y.HALF.HI;
EnqueueSFX(0x100);
diff --git a/src/projectile/stalfosProjectile.c b/src/projectile/stalfosProjectile.c
index fb75691e..0f3bfec5 100644
--- a/src/projectile/stalfosProjectile.c
+++ b/src/projectile/stalfosProjectile.c
@@ -32,8 +32,8 @@ void StalfosProjectile_OnTick(Entity* this) {
void sub_080A9A34(Entity* this) {
if (this->bitfield == 0x9d) {
this->action = 3;
- this->flags &= 0x7f;
- this->hVelocity = 0x2a000;
+ COLLISION_OFF(this);
+ this->zVelocity = 0x2a000;
this->spritePriority.b1 = 1;
}
}
@@ -47,7 +47,7 @@ void sub_080A9A64(Entity* this) {
void StalfosProjectile_SubAction0(Entity* this) {
this->subAction = 2;
- this->height.HALF.HI = 0xfffe;
+ this->z.HALF.HI = 0xfffe;
}
void StalfosProjectile_SubAction1(Entity* this) {
@@ -59,7 +59,7 @@ void StalfosProjectile_SubAction2(Entity* this) {
}
void StalfosProjectile_SubAction3(Entity* this) {
- this->flags &= 0x7f;
+ COLLISION_OFF(this);
}
void StalfosProjectile_SubAction4(Entity* this) {
@@ -73,11 +73,11 @@ void StalfosProjectile_Init(Entity* this) {
switch (this->type2) {
case 1:
this->action = 2;
- this->flags |= 0x80;
+ COLLISION_ON(this);
break;
case 2:
this->action = 3;
- this->hVelocity = 0x2a000;
+ this->zVelocity = 0x2a000;
this->spritePriority.b1 = 1;
break;
default:
@@ -117,8 +117,8 @@ void StalfosProjectile_Action2(Entity* this) {
}
void StalfosProjectile_Action3(Entity* this) {
- if (this->hVelocity < 0) {
- this->spriteSettings.b.flipY = 1;
+ if (this->zVelocity < 0) {
+ this->spriteSettings.flipY = 1;
}
if (sub_08003FC4(this, 0x2000) == 0) {
sub_080A9BA8(this);
@@ -155,7 +155,7 @@ void sub_080A9BD0(Entity* this) {
}
entry = &gUnk_08129B20[tmp + parent->animationState * 4];
sub_0806FA90(parent, this, entry->unk_0, entry->unk_1);
- this->height.HALF.HI = entry->unk_2 + this->height.HALF.HI;
+ this->z.HALF.HI = entry->unk_2 + this->z.HALF.HI;
}
void sub_080A9C34(Entity* this) {
diff --git a/src/projectile/v1DarkMagicProjectile.c b/src/projectile/v1DarkMagicProjectile.c
index dc9c97c3..dbce3794 100644
--- a/src/projectile/v1DarkMagicProjectile.c
+++ b/src/projectile/v1DarkMagicProjectile.c
@@ -22,7 +22,7 @@ void V1DarkMagicProjectile(Entity* this) {
void V1DarkMagicProjectile_OnTick(Entity* this) {
V1DarkMagicProjectile_Actions[this->action](this);
if ((this->type2 == 0) && (--this->cutsceneBeh.HWORD == 0)) {
- this->currentHealth = 0;
+ this->health = 0;
}
}
@@ -31,7 +31,7 @@ void sub_080AAC44(Entity* this) {
if (this->type2 == 0) {
if ((this->bitfield & 0x3f) == 0) {
this->action = 2;
- this->flags &= 0x7f;
+ COLLISION_OFF(this);
if (this->type == 0) {
ResolveEntityOnTop(&gPlayerEntity, this);
} else {
@@ -41,8 +41,8 @@ void sub_080AAC44(Entity* this) {
gPlayerState.field_0x1a[0] |= 0x80;
gPlayerState.field_0xa |= 0x80;
}
- if (gPlayerEntity.currentHealth == 0) {
- this->currentHealth = 0;
+ if (gPlayerEntity.health == 0) {
+ this->health = 0;
}
} else {
SoundReq(SFX_ITEM_GLOVES_KNOCKBACK);
@@ -58,7 +58,7 @@ ASM_FUNC("asm/non_matching/v1DarkMagicProjectile/sub_080AACE0.inc", void sub_080
void sub_080AAD70(Entity* this) {
if (sub_0806F520() == 0) {
- this->currentHealth = 0;
+ this->health = 0;
}
V1DarkMagicProjectile_SubActions[this->subAction](this);
}
@@ -72,7 +72,7 @@ void V1DarkMagicProjectile_SubAction1(Entity* this) {
void V1DarkMagicProjectile_SubAction2(Entity* this) {
if (sub_0806F3E4(this) != 0) {
- this->currentHealth = 0;
+ this->health = 0;
}
}
@@ -83,7 +83,7 @@ void V1DarkMagicProjectile_Init(Entity* this) {
this->action = 1;
} else {
this->action = 3;
- this->damageType = 0x2c;
+ this->hitType = 0x2c;
ResolveEntityOnTop(this->parent, this);
}
if (this->type == 0) {
@@ -91,8 +91,8 @@ void V1DarkMagicProjectile_Init(Entity* this) {
this->field_0xf = 4;
this->field_0x80.HALF.LO = 0;
this->field_0x80.HALF.HI = 0;
- this->currentHealth = 0x10;
- this->height.HALF.HI += 4;
+ this->health = 0x10;
+ this->z.HALF.HI += 4;
this->spriteOrientation.flipY = 1;
this->spriteRendering.b3 = 1;
this->spritePriority.b0 = 4;
@@ -107,7 +107,7 @@ void V1DarkMagicProjectile_Init(Entity* this) {
}
} else {
ResolveEntityOnTop(this->parent, this);
- this->flags &= 0x7f;
+ COLLISION_OFF(this);
CopyPosition(this->parent, this);
}
InitializeAnimation(this, this->type);
@@ -131,7 +131,7 @@ void V1DarkMagicProjectile_Action1(Entity* this) {
DeleteThisEntity();
}
case 2:
- if (this->parent->spriteSettings.b.draw == 0) {
+ if (this->parent->spriteSettings.draw == 0) {
DeleteThisEntity();
}
CopyPosition(this->parent, this);
@@ -148,18 +148,18 @@ void V1DarkMagicProjectile_Action2(Entity* this) {
void V1DarkMagicProjectile_Action3(Entity* this) {
CopyPosition(this->parent, this);
sub_080AB034(this);
- this->spriteSettings.b.draw = this->parent->spriteSettings.b.draw;
+ this->spriteSettings.draw = this->parent->spriteSettings.draw;
if (this->type != 0) {
- this->currentHealth = this->parent->currentHealth;
+ this->health = this->parent->health;
}
#ifndef EU
if (this->parent->action == 2) {
- if ((this->flags & 0x80) != 0) {
- this->flags &= 0x7f;
+ if ((this->flags & ENT_COLLIDE) != 0) {
+ COLLISION_OFF(this);
}
} else {
- if ((this->flags & 0x80) == 0) {
- this->flags |= 0x80;
+ if ((this->flags & ENT_COLLIDE) == 0) {
+ COLLISION_ON(this);
}
}
#endif
@@ -174,8 +174,8 @@ void sub_080AAF74(Entity* this) {
gPlayerEntity.iframes = 8;
ModHealth(-4);
sub_0800449C(&gPlayerEntity, 0x7a);
- if (gPlayerEntity.currentHealth == 0) {
- this->currentHealth = 0;
+ if (gPlayerEntity.health == 0) {
+ this->health = 0;
}
}
if (!((this->field_0x80.HALF.LO < 0x31) && (this->field_0x80.HALF.HI != 0x10))) {
@@ -183,13 +183,13 @@ void sub_080AAF74(Entity* this) {
this->field_0x80.HALF.LO = 0;
gPlayerEntity.iframes = 0xf0;
gPlayerState.field_0x1a[0] = 0;
- this->currentHealth = 0;
+ this->health = 0;
} else {
ResetPlayer();
gPlayerState.field_0x1a[0] |= 0x80;
gPlayerState.field_0xa |= 0x80;
CopyPosition(&gPlayerEntity, this);
- this->height.HALF.HI = gPlayerEntity.height.HALF.HI - 4;
+ this->z.HALF.HI = gPlayerEntity.z.HALF.HI - 4;
}
}
diff --git a/src/projectile/v1EyeLaser.c b/src/projectile/v1EyeLaser.c
index 2af3ae08..500cee96 100644
--- a/src/projectile/v1EyeLaser.c
+++ b/src/projectile/v1EyeLaser.c
@@ -10,7 +10,7 @@ void sub_080AB758(Entity*);
void sub_080AB888(Entity*);
void V1EyeLaser(Entity* this) {
- if (this->parent->spriteSettings.b.draw == 0) {
+ if (this->parent->spriteSettings.draw == 0) {
DeleteThisEntity();
}
V1EyeLaser_Actions[this->action](this);
@@ -20,7 +20,7 @@ void V1EyeLaser_Init(Entity* this) {
*(u32*)&this->field_0x74 = this->parent->x.WORD;
if (this->type == 0) {
this->action = 1;
- this->flags &= 0x7f;
+ COLLISION_OFF(this);
this->hitbox = (Hitbox*)&gUnk_0812A614;
InitializeAnimation(this, 0);
} else {
@@ -32,7 +32,7 @@ void V1EyeLaser_Init(Entity* this) {
void V1EyeLaser_Action1(Entity* this) {
GetNextFrame(this);
- if ((this->frames.all & 0x80) != 0) {
+ if ((this->frame & 0x80) != 0) {
this->action = 2;
InitializeAnimation(this, 1);
sub_080AB758(this);
diff --git a/src/projectile/v1FireProjectile.c b/src/projectile/v1FireProjectile.c
index 00dff22b..3379c344 100644
--- a/src/projectile/v1FireProjectile.c
+++ b/src/projectile/v1FireProjectile.c
@@ -26,7 +26,7 @@ void V1FireProjectile_OnTick(Entity* this) {
void sub_080AB2DC(Entity* this) {
if ((this->bitfield & 0x80) != 0) {
this->action = 3;
- this->flags &= 0x7f;
+ COLLISION_OFF(this);
InitializeAnimation(this, 0x53);
if ((this->bitfield & 0x7f) == 0) {
ModHealth(-4);
@@ -42,12 +42,12 @@ void V1FireProjectile_Init(Entity* this) {
s8* data;
this->action = 1;
- this->hVelocity = -0x10000;
+ this->zVelocity = -0x10000;
this->field_0x76.HWORD = TILE(this->x.HALF.HI, this->y.HALF.HI);
CopyPosition(this->parent, this);
sub_0806F5BC(this, 0x1000, this->direction);
this->spritePriority.b0 = 1;
- this->height = this->parent->height;
+ this->z = this->parent->z;
InitializeAnimation(this, 0x51);
SoundReq(SFX_1B5);
data = sub_080AB4F8(this);
@@ -68,7 +68,7 @@ void V1FireProjectile_Init(Entity* this) {
iVar2 = 0x20;
}
}
- this->hVelocity = (this->height.WORD / (iVar2 << 8)) << 0xd;
+ this->zVelocity = (this->z.WORD / (iVar2 << 8)) << 0xd;
this->direction = sub_080045B4(this, x, y);
}
@@ -90,16 +90,16 @@ void V1FireProjectile_Action1(Entity* this) {
void V1FireProjectile_Action2(Entity* this) {
GetNextFrame(this);
- if ((this->frames.all & 0x80) != 0) {
+ if ((this->frame & 0x80) != 0) {
this->action = 3;
- this->flags &= 0x7f;
+ COLLISION_OFF(this);
InitializeAnimation(this, 0x53);
}
}
void V1FireProjectile_Action3(Entity* this) {
GetNextFrame(this);
- if ((this->frames.all & 0x80) != 0) {
+ if ((this->frame & 0x80) != 0) {
DeleteThisEntity();
}
}
diff --git a/src/projectile/v2Projectile.c b/src/projectile/v2Projectile.c
index ffb558a1..d15834af 100644
--- a/src/projectile/v2Projectile.c
+++ b/src/projectile/v2Projectile.c
@@ -74,8 +74,8 @@ void sub_080ABD44(Entity* this) {
void sub_080ABD70(Entity* this) {
u32 tmp;
GetNextFrame(this);
- if ((this->frames.all & 0x10) != 0) {
- this->frames.all &= 0xef;
+ if ((this->frame & 0x10) != 0) {
+ this->frame &= 0xef;
this->speed = 0;
this->field_0x74.HWORD = TILE(this->x.HALF.HI, this->y.HALF.HI);
this->field_0x76.HWORD = GetTileType(this->field_0x74.HWORD, 2);
@@ -88,7 +88,7 @@ void sub_080ABD70(Entity* this) {
SetTileType(0x6d, this->field_0x74.HWORD, 2);
}
}
- if ((this->frames.all & 0x80) != 0) {
+ if ((this->frame & 0x80) != 0) {
DeleteThisEntity();
}
}
diff --git a/src/projectile/v3ElectricProjectile.c b/src/projectile/v3ElectricProjectile.c
index a987c6b4..5dd25ca4 100644
--- a/src/projectile/v3ElectricProjectile.c
+++ b/src/projectile/v3ElectricProjectile.c
@@ -33,14 +33,14 @@ void V3ElectricProjectile_Action1(Entity* this) {
DeleteThisEntity();
}
CopyPositionAndSpriteOffset(this->parent, this);
- this->height.HALF.HI -= 0x14;
+ this->z.HALF.HI -= 0x14;
if (this->cutsceneBeh.HALF.HI != 0) {
if (((--this->cutsceneBeh.HALF.HI) & 7) == 0) {
SoundReq(SFX_149);
}
}
GetNextFrame(this);
- if ((this->frames.all & 1) != 0) {
+ if ((this->frame & 1) != 0) {
if (this->type == 0) {
this->action = 2;
this->direction = GetFacingDirection(this, &gPlayerEntity);
@@ -50,7 +50,7 @@ void V3ElectricProjectile_Action1(Entity* this) {
this->action = 3;
this->actionDelay = 0x10;
}
- this->height.HALF.HI -= 0x28;
+ this->z.HALF.HI -= 0x28;
}
}
@@ -59,8 +59,8 @@ void V3ElectricProjectile_Action2(Entity* this) {
s32 iVar2;
u32 uVar3;
- if (this->height.HALF.HI < -6) {
- this->height.HALF.HI += 3;
+ if (this->z.HALF.HI < -6) {
+ this->z.HALF.HI += 3;
}
sub_080AF090(this);
if (this->collisions != 0) {
diff --git a/src/projectile/v3HandProjectile.c b/src/projectile/v3HandProjectile.c
index ad30ce23..b965161c 100644
--- a/src/projectile/v3HandProjectile.c
+++ b/src/projectile/v3HandProjectile.c
@@ -19,8 +19,8 @@ void V3HandProjectile_OnTick(Entity* this) {
InitializeAnimation(this, 0);
SoundReq(SFX_199);
}
- if (this->height.HALF.HI < -6) {
- this->height.HALF.HI += 2;
+ if (this->z.HALF.HI < -6) {
+ this->z.HALF.HI += 2;
}
sub_080AF090(this);
if (this->collisions != 0) {
diff --git a/src/projectile/v3TennisBallProjectile.c b/src/projectile/v3TennisBallProjectile.c
index e9c1e7f2..7affd779 100644
--- a/src/projectile/v3TennisBallProjectile.c
+++ b/src/projectile/v3TennisBallProjectile.c
@@ -25,8 +25,8 @@ ASM_FUNC("asm/non_matching/v3TennisBallProjectile/sub_080ACA68.inc", void sub_08
void V3TennisBallProjectile_Init(Entity* this) {
this->action = 1;
this->direction = 0x10;
- this->height.HALF.HI = 0xfffc;
- this->attachedEntity = NULL;
+ this->z.HALF.HI = 0xfffc;
+ this->child = NULL;
InitializeAnimation(this, 7);
SoundReq(SFX_199);
}
diff --git a/src/projectile/windProjectile.c b/src/projectile/windProjectile.c
index db9ff9b6..ff77862f 100644
--- a/src/projectile/windProjectile.c
+++ b/src/projectile/windProjectile.c
@@ -36,7 +36,7 @@ void WindProjectile_Action1(Entity* this) {
if (parent->next == NULL) {
DeleteEntity(this);
} else {
- if (this->spriteSettings.b.draw == 1) {
+ if (this->spriteSettings.draw == 1) {
CopyPosition(parent, this);
direction = (parent->direction + 4) & 0x18;
if (this->actionDelay != 0) {
@@ -67,14 +67,14 @@ void WindProjectile_Action2(Entity* this) {
}
} else {
this->action = 3;
- this->flags &= 0x7f;
+ COLLISION_OFF(this);
this->speed = 0;
}
}
void WindProjectile_Action3(Entity* this) {
GetNextFrame(this);
- if ((this->frames.all & 0x80) != 0) {
+ if ((this->frame & 0x80) != 0) {
DeleteEntity(this);
}
}
diff --git a/src/projectile/winder.c b/src/projectile/winder.c
index 19e35248..640038e2 100644
--- a/src/projectile/winder.c
+++ b/src/projectile/winder.c
@@ -21,7 +21,7 @@ void Winder_Init(Entity* this) {
this->action += 1;
this->speed = 0x140;
- this->height.WORD = 0;
+ this->z.WORD = 0;
if (this->type == 0) {
this->direction = Random() & 0x18;
this->parent = this;
@@ -31,7 +31,7 @@ void Winder_Init(Entity* this) {
entity = CreateProjectile(0x1d);
entity->type = this->type + 1;
entity->parent = this->parent;
- entity->attachedEntity = this;
+ entity->child = this;
CopyPosition(this, entity);
}