diff options
| author | theo3 <arisstephenson2@gmail.com> | 2021-11-12 01:34:34 -0800 |
|---|---|---|
| committer | theo3 <arisstephenson2@gmail.com> | 2021-11-12 01:34:34 -0800 |
| commit | ecc8a1439ddeedd458af5427711e07e146ed4612 (patch) | |
| tree | efe4f755b15c985ecba9c4a0ad7e3759cd510e3d /src/enemy | |
| parent | f70c95f0373d659683840682d327da3db774659c (diff) | |
remove redundant unions
Diffstat (limited to 'src/enemy')
66 files changed, 1014 insertions, 1016 deletions
diff --git a/src/enemy/acroBandits.c b/src/enemy/acroBandits.c index dc8fdf95..368606f2 100644 --- a/src/enemy/acroBandits.c +++ b/src/enemy/acroBandits.c @@ -53,7 +53,7 @@ void sub_080318DC(Entity* this) { if (this->bitfield != 0x80 && this->bitfield != 0x81) { if (this->type == 1) { if (this->action < 7 && this->knockbackDuration != 0) { - brother = this->attachedEntity; + brother = this->child; if (brother) { brother->parent = this->parent; do { @@ -61,42 +61,42 @@ void sub_080318DC(Entity* this) { brother->spritePriority.b1 = 1; if (brother->iframes == 0) brother->iframes = -12; - } while (brother = brother->attachedEntity, brother != NULL); + } while (brother = brother->child, brother != NULL); } if (this->parent) { - this->parent->attachedEntity = this->attachedEntity; + this->parent->child = this->child; } else { - if (this->attachedEntity) + if (this->child) this->parent = this; } this->action = 9; this->spritePriority.b1 = 1; if (this->knockbackDirection < 0x10) { - this->spriteSettings.b.flipX = 0; + this->spriteSettings.flipX = 0; } else { - this->spriteSettings.b.flipX = 1; + this->spriteSettings.flipX = 1; } InitializeAnimation(this, 14); } - if (this->currentHealth == 0) { + if (this->health == 0) { this->knockbackDirection = ((this->knockbackDirection + (7 & Random())) - 4) & 0x1f; this->knockbackDuration += this->type2 * 3; sub_08032338(this); } } - if (this->knockbackDuration != 0 && this->frames.all & 0x10) { + if (this->knockbackDuration != 0 && this->frame & 0x10) { if (this->type == 0) { this->action = 8; } else { this->action = 9; } if (this->knockbackDirection < 0x10) { - this->spriteSettings.b.flipX = 0; + this->spriteSettings.flipX = 0; } else { - this->spriteSettings.b.flipX = 1; + this->spriteSettings.flipX = 1; } this->spritePriority.b1 = 1; InitializeAnimation(this, 14); @@ -147,7 +147,7 @@ void sub_08031AC8(Entity* this) y = this->field_0x76.HWORD + ((s32)(rand >> 4) % 5) * 0x10 - 0x20; if (sub_080002D4(x, y, this->collisionLayer) == 0) { this->action = 2; - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; this->x.HALF.HI = x; this->y.HALF.HI = y; InitializeAnimation(this, 0); @@ -158,11 +158,11 @@ void sub_08031AC8(Entity* this) void sub_08031B48(Entity* this) { GetNextFrame(this); - if (this->frames.b.f0) { - this->frames.all = 0; + if (this->frame & 1) { + this->frame = 0; COLLISION_ON(this); } else { - if (this->frames.b.f3) { + if (this->frame & 0x80) { this->action = 0x3; this->actionDelay = gUnk_080CE5B0[Random() & 7]; InitializeAnimation(this, 1); @@ -174,15 +174,14 @@ void sub_08031B98(Entity* this) { if (sub_08031E04(this)) { this->action = 5; if (this->x.HALF.HI > gUnk_020000B0->x.HALF.HI) { - this->spriteSettings.b.flipX = 0; + this->spriteSettings.flipX = 0; } else { - this->spriteSettings.b.flipX = 1; + this->spriteSettings.flipX = 1; } InitializeAnimation(this, 3); } else { - if (this->frames.b.f0 && this->actionDelay) { - // this->frames.b.f0 = 0; - this->frames.all &= 0xfe; + if ((this->frame & 1) && this->actionDelay) { + this->frame &= 0xfe; this->actionDelay--; } GetNextFrame(this); @@ -196,10 +195,10 @@ void sub_08031B98(Entity* this) { void sub_08031C1C(Entity* this) { GetNextFrame(this); - if (this->frames.b.f3) { + if (this->frame & 0x80) { this->action = '\x01'; this->actionDelay = gUnk_080CE5B8[Random() & 7]; - this->spriteSettings.b.draw = 0; + this->spriteSettings.draw = 0; } } @@ -207,7 +206,7 @@ void sub_08031C58(Entity* this) { Entity *a, *b; GetNextFrame(this); - if (this->frames.b.f3) { + if (this->frame & 0x80) { if (gEntCount < 0x43) { u32 tmp = Random(); tmp &= 3; @@ -217,33 +216,33 @@ void sub_08031C58(Entity* this) { a->parent = NULL; a->field_0x74.HALF.LO = tmp; sub_08031E48(this, a); - a->attachedEntity = CreateEnemy(ACRO_BANDIT, 1); + a->child = CreateEnemy(ACRO_BANDIT, 1); - b = a->attachedEntity; + b = a->child; b->type2 = 1; b->parent = a; b->field_0x74.HALF.LO = tmp; sub_08031E48(this, b); - b->attachedEntity = CreateEnemy(ACRO_BANDIT, 1); + b->child = CreateEnemy(ACRO_BANDIT, 1); - a = b->attachedEntity; + a = b->child; a->type2 = 2; a->parent = b; a->field_0x74.HALF.LO = tmp; sub_08031E48(this, a); - a->attachedEntity = CreateEnemy(ACRO_BANDIT, 1); + a->child = CreateEnemy(ACRO_BANDIT, 1); - b = a->attachedEntity; + b = a->child; b->type2 = 3; b->parent = a; b->field_0x74.HALF.LO = tmp; sub_08031E48(this, b); - b->attachedEntity = CreateEnemy(ACRO_BANDIT, 1); + b->child = CreateEnemy(ACRO_BANDIT, 1); - a = b->attachedEntity; + a = b->child; a->type2 = 4; a->parent = b; - a->attachedEntity = NULL; + a->child = NULL; a->field_0x74.HALF.LO = tmp; sub_08031E48(this, a); @@ -253,8 +252,8 @@ void sub_08031C58(Entity* this) { InitializeAnimation(this, 7); } } else { - if (this->frames.b.f0) { - this->frames.all = 0; + if (this->frame & 1) { + this->frame = 0; COLLISION_OFF(this); } } @@ -266,7 +265,7 @@ void sub_08031D70(Entity* this) { this->action = 7; COLLISION_OFF(this); this->actionDelay = 5; - this->spriteSettings.b.draw = 0; + this->spriteSettings.draw = 0; } } @@ -282,13 +281,13 @@ void sub_08031DA0(Entity* this) { } void sub_08031DC4(Entity* this) { - if (this->frames.b.f3) { + if (this->frame & 0x80) { this->action = 1; this->actionDelay = 0xb4; - this->spriteSettings.b.draw = 0; + this->spriteSettings.draw = 0; } else { GetNextFrame(this); - if ((this->frames.all & 0xf) == 2) { + if ((this->frame & 0xf) == 2) { COLLISION_OFF(this); } } @@ -302,7 +301,7 @@ u32 sub_08031E04(Entity* this) { if (ent == NULL) return 0; - tmp = &gUnk_080CE5C0[this->frames.all & 6]; + tmp = &gUnk_080CE5C0[this->frame & 6]; return sub_0806FCB8(this, ent->x.HALF.HI + tmp[0], ent->y.HALF.HI + tmp[1], 0x50); } @@ -323,8 +322,8 @@ void sub_08031E90(Entity* this) { void sub_08031EA8(Entity* this) { this->action = 1; this->spritePriority.b1 = 1; - this->hVelocity = 0x40000; - this->height.HALF.HI = (4 - this->type2) * 0xe; + this->zVelocity = 0x40000; + this->z.HALF.HI = (4 - this->type2) * 0xe; this->field_0x78.HALF.HI = Random(); InitializeAnimation(this, 4); } @@ -332,22 +331,22 @@ void sub_08031EA8(Entity* this) { void sub_08031EE8(Entity* this) { int draw; - this->height.WORD -= this->hVelocity; - this->hVelocity -= 0x1800; + this->z.WORD -= this->zVelocity; + this->zVelocity -= 0x1800; - if (this->height.HALF.HI < 1) { - draw = this->spriteSettings.b.draw; + if (this->z.HALF.HI < 1) { + draw = this->spriteSettings.draw; if (!draw) EnqueueSFX(299); - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; } - draw = this->spriteSettings.b.draw; + draw = this->spriteSettings.draw; if (draw == 1) GetNextFrame(this); - if (this->hVelocity < 1) { + if (this->zVelocity < 1) { this->action = 2; COLLISION_ON(this); InitializeAnimation(this, 5); @@ -356,10 +355,10 @@ void sub_08031EE8(Entity* this) { void sub_08031F54(Entity* this) { sub_08003FC4(this, gUnk_080CE5F0[this->type2]); - if (this->type2 * -0xe <= this->height.HALF.HI) { + if (this->type2 * -0xe <= this->z.HALF.HI) { this->action = 3; this->actionDelay = 20; - this->height.HALF.HI = this->type2 * -0xe; + this->z.HALF.HI = this->type2 * -0xe; if (this->parent != NULL) this->spritePriority.b1 = 0; InitializeAnimation(this, 6); @@ -368,11 +367,11 @@ void sub_08031F54(Entity* this) { void sub_08031FB0(Entity* this) { GetNextFrame(this); - if (this->frames.b.f3 && (this->parent || --this->actionDelay == 0)) { + if ((this->frame & 0x80) && (this->parent || --this->actionDelay == 0)) { this->action = 4; this->direction = sub_08049F84(this, 1); *(u8*)&this->field_0x76 = 0; - if (this->attachedEntity) { + if (this->child) { InitializeAnimation(this, 9); } else { InitializeAnimation(this, 8); @@ -406,7 +405,7 @@ void sub_08032008(Entity* this) { } if (this->direction & 0xf) - this->spriteSettings.b.flipX = (this->direction >> 4 ^ 1); + this->spriteSettings.flipX = (this->direction >> 4 ^ 1); ProcessMovement(this); } else { @@ -445,19 +444,19 @@ void sub_08032160(Entity* this) { dir = gUnk_080CE5FA[this->field_0x74.HALF.LO * 5 + this->type2]; this->direction = dir; if (dir >= 0x10) { - this->spriteSettings.b.flipX = 1; + this->spriteSettings.flipX = 1; } else { - this->spriteSettings.b.flipX = 0; + this->spriteSettings.flipX = 0; } this->speed = 0xf0; - this->hVelocity = 0x12000; + this->zVelocity = 0x12000; this->spritePriority.b1 = 1; InitializeAnimation(this, 12); } - if (this->attachedEntity == NULL) { + if (this->child == NULL) { for (tmp = this->parent; tmp != NULL; tmp = tmp->parent) { - if (tmp->currentHealth != 0) + if (tmp->health != 0) tmp->actionDelay = 0; } this->actionDelay = 0; @@ -473,11 +472,11 @@ void sub_080321E8(Entity* this) { void sub_08032204(Entity* this) { GetNextFrame(this); - if (this->frames.all & 1) { - this->frames.all = 0; + if (this->frame & 1) { + this->frame = 0; this->frameDuration = (Random() & 0x30) + 30; } else { - if (this->frames.all & 0x80) { + if (this->frame & 0x80) { this->action = 9; InitializeAnimation(this, 13); } @@ -486,14 +485,14 @@ void sub_08032204(Entity* this) { void sub_08032248(Entity* this) { if (sub_08003FC4(this, 0x1800) == 0) { - if (this->frames.all & 0x80) { + if (this->frame & 0x80) { ((Entity*)this->field_0x7c.WORD)->actionDelay--; DeleteEntity(this); } else { GetNextFrame(this); - if ((this->frames.all & 0xf) == 2) + if ((this->frame & 0xf) == 2) COLLISION_OFF(this); } } @@ -506,10 +505,10 @@ void sub_08032290(Entity* this) { } u32 sub_080322A4(Entity* this) { - if (this->attachedEntity != NULL && (this->attachedEntity->height.HALF.HI + 8) >= this->height.HALF.HI) { - if (this->height.HALF.HI) { + if (this->child != NULL && (this->child->z.HALF.HI + 8) >= this->z.HALF.HI) { + if (this->z.HALF.HI) { this->action = 5; - this->height.HALF.HI = this->attachedEntity->height.HALF.HI + 8; + this->z.HALF.HI = this->child->z.HALF.HI + 8; InitializeAnimation(this, 11); return 1; } else { @@ -524,15 +523,15 @@ void sub_080322E8(Entity* this) { u8 tmp; if (this->field_0x78.HALF.LO) { if (--this->field_0x78.HALF.LO == 0) { - u32 flipX = this->spriteSettings.b.flipX; - this->spriteSettings.b.flipX = flipX ^ 1; + u32 flipX = this->spriteSettings.flipX; + this->spriteSettings.flipX = flipX ^ 1; } } else { tmp = this->direction; if (tmp & 0xF) { tmp >>= 4; tmp ^= 1; - if (tmp != this->spriteSettings.b.flipX) { + if (tmp != this->spriteSettings.flipX) { this->field_0x78.HALF.LO = 6; } } diff --git a/src/enemy/beetle.c b/src/enemy/beetle.c index 4b1d8429..c1b560d1 100644 --- a/src/enemy/beetle.c +++ b/src/enemy/beetle.c @@ -37,7 +37,7 @@ void sub_08021780(Entity* this) { COLLISION_OFF(this); this->spritePriority.b0 = 3; CopyPositionAndSpriteOffset(&gPlayerEntity, this); - this->height.HALF.HI = -1; + this->z.HALF.HI = -1; ((u8*)&this->field_0x86)[1] = 1; InitializeAnimation(this, 6); } @@ -47,7 +47,7 @@ void sub_08021780(Entity* this) { break; } - if (this->currentHealth == 0) + if (this->health == 0) this->knockbackDuration = 0; sub_0804AA30(this, gUnk_080CB590); @@ -71,7 +71,7 @@ void sub_08021848(Entity* this) { gUnk_080CB5C8[this->subAction](this); } else { this->action = 3; - this->height.HALF.HI = 0; + this->z.HALF.HI = 0; InitializeAnimation(this, 2); } } @@ -102,20 +102,20 @@ void sub_080218B4(Entity* this) { void sub_080218CC(Entity* this) { if (this->subAction == 0) { this->subAction = 1; - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; this->direction = ((sub_08049F84(this, 1) ^ 0x10) + gUnk_080CB5DC[Random() & 7]) & 0x1f; this->speed = 0x100; - this->hVelocity = 0x12000; + this->zVelocity = 0x12000; } GetNextFrame(this); - if (this->frames.all & 1) { + if (this->frame & 1) { sub_080AEFE0(this); if (sub_080044EC(this, 0x1c00) == 0) this->frameDuration = 1; } - if (this->frames.all & 0x80) { + if (this->frame & 0x80) { this->action = 2; this->actionDelay = (Random() & 0x38) + 8; this->field_0xf = 1; @@ -129,8 +129,8 @@ void sub_08021984(Entity* this) { if (this->subAction == 0) { this->subAction = 1; COLLISION_ON(this); - this->spriteSettings.b.draw = 3; - this->height.HALF.HI = -0x80; + this->spriteSettings.draw = 3; + this->z.HALF.HI = -0x80; this->spriteRendering.b3 = 1; this->spriteOrientation.flipY = 1; EnqueueSFX(0x12d); @@ -140,7 +140,7 @@ void sub_08021984(Entity* this) { this->action = 2; this->actionDelay = 16; this->field_0xf = 1; - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; this->speed = 0x180; ((u8*)&this->field_0x86)[0] = 60; InitializeAnimation(this, 0); @@ -187,7 +187,7 @@ void sub_08021A64(Entity* this) { void sub_08021AD8(Entity* this) { GetNextFrame(this); - if (this->frames.all & 1) { + if (this->frame & 1) { if (this->actionDelay) { u32 tmp; @@ -207,7 +207,7 @@ void sub_08021AD8(Entity* this) { this->frameDuration = 1; } - if (this->frames.all & 0x80) { + if (this->frame & 0x80) { this->action = 2; this->actionDelay = 20; ((u8*)&this->field_0x86)[0] = 60; @@ -218,7 +218,7 @@ void sub_08021AD8(Entity* this) { void sub_08021B64(Entity* this) { if (gPlayerState.flags & 4) { this->action = 3; - this->height.WORD = 0; + this->z.WORD = 0; InitializeAnimation(this, 2); } else { int iVar4 = 1; @@ -238,7 +238,7 @@ void sub_08021B64(Entity* this) { if (iVar4 == 0) { this->action = 6; - this->hVelocity = 0x10000; + this->zVelocity = 0x10000; ((u8*)&this->field_0x86)[1] = 0; if (gPlayerEntity.direction != 0xff) { this->direction = 0x10 ^ gPlayerEntity.direction; @@ -252,7 +252,7 @@ void sub_08021B64(Entity* this) { gPlayerState.field_0xaa++; CopyPositionAndSpriteOffset(&gPlayerEntity, this); this->x.HALF.HI += gUnk_080CB5E4[(this->field_0xf++ & 0xe) >> 1]; - this->height.HALF.HI--; + this->z.HALF.HI--; GetNextFrame(this); } } @@ -260,13 +260,13 @@ void sub_08021B64(Entity* this) { void sub_08021C58(Entity* this) { GetNextFrame(this); - if (this->frames.all & 1) { + if (this->frame & 1) { sub_080AEFE0(this); if (sub_08003FC4(this, 0x1800) == 0) this->frameDuration = 1; } - if (this->frames.all & 0x80) { + if (this->frame & 0x80) { this->action = 2; this->actionDelay = 60; this->field_0xf = 1; @@ -278,7 +278,7 @@ void sub_08021C58(Entity* this) { } void sub_08021CD0(Entity* this) { - if ((this->frames.all & 0x80) == 0) + if ((this->frame & 0x80) == 0) GetNextFrame(this); if (sub_08049F84(this, 1) == 0xff) @@ -299,7 +299,7 @@ u32 sub_08021D00(Entity* this) { } else { this->action = 4; this->actionDelay = 1; - this->hVelocity = 0x18000; + this->zVelocity = 0x18000; InitializeAnimation(this, 4); ret = 1; } diff --git a/src/enemy/bladeTrap.c b/src/enemy/bladeTrap.c index 9f89f8f0..66729fce 100644 --- a/src/enemy/bladeTrap.c +++ b/src/enemy/bladeTrap.c @@ -8,8 +8,8 @@ extern void sub_080A2CC0(); void BladeTrap(Entity* this) { if (this->action == 0) { this->action = 1; - this->attachedEntity = GetCurrentRoomProperty(this->type); - sub_080A2CC0(this, &this->attachedEntity, &this->field_0x74); + this->child = GetCurrentRoomProperty(this->type); + sub_080A2CC0(this, &this->child, &this->field_0x74); } if (!(this->direction & 0x80)) { sub_0806F69C(this); @@ -19,6 +19,6 @@ void BladeTrap(Entity* this) { if (!(this->direction & 0x80)) { EnqueueSFX(0x74); } - sub_080A2CC0(this, &this->attachedEntity, &this->field_0x74.HWORD); + sub_080A2CC0(this, &this->child, &this->field_0x74.HWORD); } } diff --git a/src/enemy/bobomb.c b/src/enemy/bobomb.c index 579a5c4c..b9976950 100644 --- a/src/enemy/bobomb.c +++ b/src/enemy/bobomb.c @@ -54,7 +54,7 @@ void sub_0802C688(Entity* this) { this->action = 3; this->hitType = 0x6e; this->field_0xf = 1; - this->hVelocity = 0x18000; + this->zVelocity = 0x18000; this->speed = 0; this->field_0x80.HALF.HI = 1; InitializeAnimation(this, this->direction >> 4 | 6); @@ -68,15 +68,15 @@ void sub_0802C7AC(Entity* this) { if (this->subAction < 3 && !sub_0806F520(this)) { this->subAction = 0; this->field_0xf = 1; - this->height.HALF.HI = 0; + this->z.HALF.HI = 0; if (this->field_0x82.HALF.LO != 2) { this->speed = this->field_0x82.HALF.LO ? 0x200 : 0x80; } - this->hVelocity = 0x18000; + this->zVelocity = 0x18000; this->field_0x82.HALF.HI = 0; this->field_0x80.HALF.HI = 0; } else { - this->height.HALF.HI = -1; + this->z.HALF.HI = -1; gUnk_080CD600[this->subAction](this); if (this->actionDelay != 0) { GetNextFrame(this); @@ -135,7 +135,7 @@ void sub_0802C8B8(Entity* this) { void sub_0802C8C4(Entity* this) { sub_0804A7D4(this); - this->spriteSettings.b.draw = 0; + this->spriteSettings.draw = 0; } void sub_0802C8D8(Entity* this) { @@ -225,7 +225,7 @@ void sub_0802CA94(Entity* this) { COLLISION_OFF(this); this->field_0xf = 1; this->spritePriority.b1 = 1; - this->hVelocity = 0x18000; + this->zVelocity = 0x18000; this->speed = 0; this->field_0x82.HALF.HI = 0; this->field_0x80.HALF.HI = 0; @@ -242,7 +242,7 @@ void sub_0802CAF8(Entity* this) { } sub_0802CC18(this); sub_08078930(this); - if (this->field_0xf && this->height.HALF.HI == 0) { + if (this->field_0xf && this->z.HALF.HI == 0) { this->field_0xf = 0; COLLISION_ON(this); this->hitType = 0x6e; @@ -276,9 +276,9 @@ void sub_0802CBC4(Entity* this) { Entity* ent; this->action = 4; - this->spriteSettings.b.draw = 0; + this->spriteSettings.draw = 0; COLLISION_OFF(this); - this->currentHealth = 0; + this->health = 0; if (this->field_0x82.HALF.HI) { sub_08079184(); } diff --git a/src/enemy/bombPeahat.c b/src/enemy/bombPeahat.c index 9b2b5547..187670e9 100644 --- a/src/enemy/bombPeahat.c +++ b/src/enemy/bombPeahat.c @@ -87,7 +87,7 @@ void sub_0802A8F4(Entity* this) { void sub_0802A8FC(Entity* this) { if ((gPlayerState.field_0x1c & 0xf) == 0) { - this->currentHealth = gPlayerState.field_0x1c & 0xf; + this->health = gPlayerState.field_0x1c & 0xf; } } @@ -96,7 +96,7 @@ void nullsub_143(Entity* this) { } void sub_0802A91C(Entity* this) { - this->currentHealth = 0; + this->health = 0; } void sub_0802A924(Entity* this) { @@ -108,7 +108,7 @@ void sub_0802A924(Entity* this) { #ifdef EU this->field_0x3c |= 0x10; #endif - this->height.HALF.HI = -0x30; + this->z.HALF.HI = -0x30; this->field_0x80.HALF.LO = Random() & 1; this->field_0x82.HWORD = 0; this->field_0x7a.HALF.HI = 0; @@ -140,7 +140,7 @@ void sub_0802A9A8(Entity* this) { if (gRoomControls.unk2 != 0) { return; } - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; this->field_0x82.HWORD = 1; if (this->field_0x80.HALF.LO) { this->x.HALF.HI = gRoomControls.roomScrollX - 0x10; @@ -166,10 +166,10 @@ void sub_0802AA40(Entity* this) { if (this->actionDelay) { this->actionDelay--; } else { - Entity* ent = this->attachedEntity; + Entity* ent = this->child; if (ent) { if (ent->next == NULL) { - this->attachedEntity = NULL; + this->child = NULL; } else { u32 direction = DirectionRound(this->field_0x80.HALF.LO * 0x10 + 0x18); @@ -198,12 +198,12 @@ void sub_0802AAC0(Entity* this) { } if (this->field_0x80.HALF.HI) { - Entity* ent = this->attachedEntity; + Entity* ent = this->child; if (ent == NULL) { this->field_0x80.HALF.HI = 0; } else if (ent->next == NULL) { this->field_0x80.HALF.HI = 0; - this->attachedEntity = NULL; + this->child = NULL; } else if (ent->actionDelay == 0 && ent->field_0xf < 0x51) { this->field_0x80.HALF.HI = 0; } @@ -227,10 +227,10 @@ void sub_0802AB40(Entity* this) { sub_0802AC40(this); switch (this->field_0x78.HALF.LO) { case 0: - if (this->height.HALF.HI) { + if (this->z.HALF.HI) { if (--this->field_0x78.HALF.HI == 0) { this->field_0x78.HALF.HI = 4; - this->height.HALF.HI++; + this->z.HALF.HI++; } } else { this->field_0x78.HALF.LO = 1; @@ -247,10 +247,10 @@ void sub_0802AB40(Entity* this) { } break; case 2: - if (-0x30 < this->height.HALF.HI) { + if (-0x30 < this->z.HALF.HI) { if (--this->field_0x78.HALF.HI == 0) { this->field_0x78.HALF.HI = 4; - this->height.HALF.HI--; + this->z.HALF.HI--; sub_0802ACDC(this, 4); } } else { @@ -264,7 +264,7 @@ void sub_0802AB40(Entity* this) { #endif void sub_0802AC08(Entity* this) { - if (this->frames.all & 0x80) { + if (this->frame & 0x80) { this->action = 2; this->subAction = 0; this->actionDelay = 0x40; @@ -286,7 +286,7 @@ void sub_0802AC40(Entity* this) { this->field_0x7a.HALF.LO = 0; this->spritePriority.b1 = 0; } else { - if (this->height.HALF.HI == 0) { + if (this->z.HALF.HI == 0) { if (this->spritePriority.b1 != 1) { this->spritePriority.b1 = 1; } @@ -299,7 +299,7 @@ void sub_0802AC40(Entity* this) { } else { if (sub_0802B234(this)) { this->field_0x7a.HALF.LO = 1; - if (this->height.HALF.HI == 0) { + if (this->z.HALF.HI == 0) { this->spritePriority.b1 = 1; } else { this->spritePriority.b1 = 3; @@ -335,19 +335,19 @@ void sub_0802AD1C(Entity* this, u32 param_2) { void sub_0802AD54(Entity* this) { if (this->field_0x82.HWORD != 0) { if (gRoomControls.unk2 != 0) { - this->spriteSettings.b.draw = 0; + this->spriteSettings.draw = 0; DeleteEntity(this); return; } if (gRoomControls.roomOriginY > this->y.HALF.HI || (gRoomControls.roomOriginY + gRoomControls.height + 0x20) < this->y.HALF.HI) { - this->spriteSettings.b.draw = 0; + this->spriteSettings.draw = 0; } else { - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; } } if (this->field_0x80.HALF.HI) { - if (this->attachedEntity == NULL || this->attachedEntity->next == NULL) { + if (this->child == NULL || this->child->next == NULL) { this->action = 4; this->actionDelay = 0xc0; this->field_0xf = 4; @@ -365,10 +365,10 @@ void sub_0802ADDC(Entity* this) { if (ent != NULL) { ent->type2 = !!sub_0802B234(this); ent->parent = this; - this->attachedEntity = ent; + this->child = ent; CopyPosition(this, ent); /*#ifdef EU - this->height.HALF.HI += 8; + this->z.HALF.HI += 8; #endif*/ this->field_0x80.HALF.HI = 1; if (this->type == 0) { @@ -381,7 +381,7 @@ void sub_0802ADDC(Entity* this) { void sub_0802AE24(Entity* this) { this->action = 1; this->actionDelay = 0xf0; - this->hVelocity = 0x8000; + this->zVelocity = 0x8000; this->hitbox = (Hitbox*)&gUnk_080CD174; this->field_0x3c = 3; this->field_0x16 = 0; @@ -403,7 +403,7 @@ void sub_0802AE68(Entity* this) { } else { if (ent->field_0x80.HALF.HI) { CopyPosition(ent, this); - this->spriteSettings.b.draw = 0; + this->spriteSettings.draw = 0; } else { this->action = 3; this->field_0x80.HALF.LO = 1; @@ -539,7 +539,7 @@ void sub_0802B048(Entity* this) { this->action = 4; this->hitbox = (Hitbox*)&gUnk_080CD17C; this->actionDelay = 0xf; - this->spriteSettings.b.draw = 0; + this->spriteSettings.draw = 0; COLLISION_ON(this); this->field_0x7a.HALF.HI = 0; sub_08078954(this); @@ -621,7 +621,7 @@ Entity* sub_0802B250(Entity* this) { } void sub_0802B264(Entity* this) { - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; if (sub_0802B234(this)) { this->spritePriority.b1 = 3; } else { diff --git a/src/enemy/bowMoblin.c b/src/enemy/bowMoblin.c index 893d7618..c9605ce2 100644 --- a/src/enemy/bowMoblin.c +++ b/src/enemy/bowMoblin.c @@ -26,7 +26,7 @@ void sub_0803C198(Entity* this) { sub_0804AA30(this, gUnk_080CFF78); if ((this->bitfield & 0x80) != 0) { sub_0803C5F0(this); - pEVar1 = this->attachedEntity; + pEVar1 = this->child; if (pEVar1 != NULL) { pEVar1->field_0xf++; } diff --git a/src/enemy/businessScrub.c b/src/enemy/businessScrub.c index 275b1775..8ade7efb 100644 --- a/src/enemy/businessScrub.c +++ b/src/enemy/businessScrub.c @@ -63,7 +63,7 @@ void sub_08028934(Entity* this) { sub_080290E0(this, 4); pEVar1 = CreateFx(this, FX_BUSH, 0); if (pEVar1 != NULL) { - pEVar1->height.HALF.HI -= 8; + pEVar1->z.HALF.HI -= 8; } EnqueueSFX(0x1bb); } @@ -112,7 +112,7 @@ void sub_08028A74(Entity* this) { switch (this->subAction) { case 0: unk = 1; - if (this->frames.all & 0x80) { + if (this->frame & 0x80) { this->subAction = 1; this->actionDelay = 0x3c; this->field_0xf = 0x10; @@ -138,19 +138,19 @@ void sub_08028A74(Entity* this) { case 2: unk = 1; sub_080290FC(this); - if (this->frames.all & 1) { + if (this->frame & 1) { Entity* ent = CreateProjectileWithParent(this, 4, 0); if (ent != NULL) { ent->parent = this; ent->direction = this->direction; - this->frames.all &= ~1; + this->frame &= ~1; this->subAction = 3; } } break; case 3: unk = 2; - if (this->frames.all & 0x80) { + if (this->frame & 0x80) { this->subAction = 4; this->actionDelay = 0x50; sub_080290E0(this, 1); @@ -189,7 +189,7 @@ void sub_08028BC4(Entity* this) { switch (this->subAction) { case 0: if (this->actionDelay == 0) { - if (this->frames.all & 0x80) { + if (this->frame & 0x80) { this->subAction = 1; sub_08028FDC(this); sub_080290E0(this, 5); @@ -200,7 +200,7 @@ void sub_08028BC4(Entity* this) { } break; case 1: - if (this->frames.all & 0x80) { + if (this->frame & 0x80) { this->action = 4; this->subAction = 0; this->actionDelay = 0x1e; @@ -209,7 +209,7 @@ void sub_08028BC4(Entity* this) { iVar1 = sub_0804A9FC(this, 0x1c); if (iVar1 != NULL) { iVar1->spritePriority.b0 = 3; - iVar1->height.HALF.HI -= 12; + iVar1->z.HALF.HI -= 12; sub_0805E3A0(iVar1, 2); } SetFlag(this->field_0x86.HWORD); @@ -549,7 +549,7 @@ void sub_0802925C(Entity* this) { void sub_08029270(Entity* this) { if (this->action == 0) { this->action++; - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; InitializeAnimation(this, 0xe); } else { GetNextFrame(this); diff --git a/src/enemy/chaser.c b/src/enemy/chaser.c index 7e0ac960..869fbfc0 100644 --- a/src/enemy/chaser.c +++ b/src/enemy/chaser.c @@ -63,7 +63,7 @@ void sub_0802B56C(Entity* this) { void sub_0802B5C8(Entity* this) { GetNextFrame(this); - if (this->frames.all & 0x80) { + if (this->frame & 0x80) { this->action = 1; this->actionDelay = 30; InitializeAnimation(this, 0); diff --git a/src/enemy/chuchu.c b/src/enemy/chuchu.c index 32f1a1b1..c6c83615 100644 --- a/src/enemy/chuchu.c +++ b/src/enemy/chuchu.c @@ -101,11 +101,11 @@ void sub_0801EF40(Entity* this) { if (this->type == 2) { if (this->bitfield == 0x8e || this->bitfield == 0x95) { COLLISION_OFF(this); - this->currentHealth = 0; + this->health = 0; } } - health = this->currentHealth; + health = this->health; if (health) { if (this->bitfield == 0x94) { sub_0801FB68(this); @@ -117,10 +117,10 @@ void sub_0801EF40(Entity* this) { } } else { sub_0804AA1C(this); - this->hVelocity = 0; + this->zVelocity = 0; InitializeAnimation(this, 9); } - this->field_0x80.HALF.LO = this->currentHealth; + this->field_0x80.HALF.LO = this->health; sub_0804AA30(this, gUnk_080CA21C); } @@ -157,7 +157,7 @@ void sub_0801F048(Entity* this) { } void sub_0801F084(Entity* this) { - if ((this->frames.all & 0x80) == 0) + if ((this->frame & 0x80) == 0) GetNextFrame(this); sub_08001242(this); } @@ -165,7 +165,7 @@ void sub_0801F084(Entity* this) { void sub_0801F0A4(Entity* this) { sub_0804A720(this); this->action = 1; - this->field_0x80.HALF.LO = this->currentHealth; + this->field_0x80.HALF.LO = this->health; this->field_0x82.HALF.LO = 0; } @@ -175,7 +175,7 @@ void nullsub_4(Entity* this) { void sub_0801F0C8(Entity* this) { GetNextFrame(this); - if (this->frames.all & 0x80) { + if (this->frame & 0x80) { this->action = 3; this->actionDelay = (Random() & 3) + 0xc; this->field_0xf = Random(); @@ -210,9 +210,9 @@ void sub_0801F12C(Entity* this) { } void sub_0801F1B0(Entity* this) { - if (this->frames.all & 0x10) { - if (this->frames.all & 1) { - this->frames.all ^= 1; + if (this->frame & 0x10) { + if (this->frame & 1) { + this->frame ^= 1; this->hitType = 90; EnqueueSFX(299); } @@ -223,7 +223,7 @@ void sub_0801F1B0(Entity* this) { GetNextFrame(this); } - if (this->frames.all & 0x80) { + if (this->frame & 0x80) { if (sub_0801FBD0(this)) { sub_0801F328(this); } else { @@ -242,7 +242,7 @@ void sub_0801F228(Entity* this) { void sub_0801F250(Entity* this) { GetNextFrame(this); - if (this->frames.all & 0x80) + if (this->frame & 0x80) sub_0801F360(this); } @@ -269,9 +269,9 @@ void sub_0801F270(Entity* this) { void sub_0801F2CC(Entity* this) { GetNextFrame(this); - if (this->frames.all & 0x80) { + if (this->frame & 0x80) { this->action = 1; - this->spriteSettings.b.draw = 0; + this->spriteSettings.draw = 0; InitializeAnimation(this, 4); } } @@ -279,7 +279,7 @@ void sub_0801F2CC(Entity* this) { void sub_0801F2F8(Entity* this) { sub_08003FC4(this, 0x1800); GetNextFrame(this); - if (this->frames.all & 0x80) { + if (this->frame & 0x80) { sub_0801F340(this); sub_0804AA1C(this); } @@ -317,7 +317,7 @@ void sub_0801F3AC(Entity* this) { if (this->field_0x82.HALF.LO || PlayerInRange(this, 1, 0x48)) { if (this->action == 1) { this->action = 2; - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; this->field_0x82.HALF.LO = 1; InitializeAnimation(this, 0); } @@ -339,7 +339,7 @@ void sub_0801F428(Entity* this) { sub_0804A720(this); this->action = 1; this->actionDelay = Random(); - this->field_0x80.HALF.LO = this->currentHealth; + this->field_0x80.HALF.LO = this->health; this->field_0x82.HALF.LO = 0; if (this->type2 == 0) return; @@ -348,7 +348,7 @@ void sub_0801F428(Entity* this) { this->field_0xf = 30; COLLISION_ON(this); this->spritePriority.b1 = 3; - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; InitializeAnimation(this, 2); } #endif @@ -359,7 +359,7 @@ void sub_0801F48C(Entity* this) { void sub_0801F494(Entity* this) { GetNextFrame(this); - if (this->frames.all & 0x80) { + if (this->frame & 0x80) { this->action = 3; this->field_0xf = 30; this->direction = sub_08049F84(this, 1); @@ -401,9 +401,9 @@ void sub_0801F508(Entity* this) { } void sub_0801F584(Entity* this) { - if (this->frames.all & 0x10) { - if (this->frames.all & 0x1) { - this->frames.all ^= 1; + if (this->frame & 0x10) { + if (this->frame & 0x1) { + this->frame ^= 1; this->hitType = 91; EnqueueSFX(299); } @@ -415,7 +415,7 @@ void sub_0801F584(Entity* this) { GetNextFrame(this); } - if (this->frames.all & 0x80) { + if (this->frame & 0x80) { if (sub_0801FBD0(this)) { this->field_0x82.HALF.HI = 0; sub_0801F730(this); @@ -437,7 +437,7 @@ void sub_0801F61C(Entity* this) { void sub_0801F638(Entity* this) { GetNextFrame(this); - if (this->frames.all & 0x80) { + if (this->frame & 0x80) { this->action = 8; this->field_0xf = 30; this->direction = sub_08049F84(this, 1); @@ -462,9 +462,9 @@ void sub_0801F688(Entity* this) { void sub_0801F6CC(Entity* this) { GetNextFrame(this); - if (this->frames.all & 0x80) { + if (this->frame & 0x80) { this->action = 1; - this->spriteSettings.b.draw = 0; + this->spriteSettings.draw = 0; InitializeAnimation(this, 4); } } @@ -472,7 +472,7 @@ void sub_0801F6CC(Entity* this) { void sub_0801F6F8(Entity* this) { sub_08003FC4(this, 0x1800); GetNextFrame(this); - if (this->frames.all & 0x80) { + if (this->frame & 0x80) { this->action = 4; this->speed = 0x20; sub_0804AA1C(this); @@ -488,7 +488,7 @@ void sub_0801F730(Entity* this) { void sub_0801F748(Entity* this) { this->action = 2; - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; InitializeAnimation(this, 4); } @@ -500,7 +500,7 @@ void sub_0801F764(Entity* this) { if (this->action == 1) { if (this->field_0x82.HALF.LO || PlayerInRange(this, 1, 0x48)) { this->action = 2; - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; this->field_0x82.HALF.LO = 1; InitializeAnimation(this, 0); } @@ -517,7 +517,7 @@ void sub_0801F7D8(Entity* this) { sub_0804A720(this); this->action = 1; this->actionDelay = Random(); - this->field_0x80.HALF.LO = this->currentHealth; + this->field_0x80.HALF.LO = this->health; this->field_0x82.HALF.LO = 0; } @@ -527,7 +527,7 @@ void sub_0801F7FC(Entity* this) { if (this->field_0x82.HALF.LO || PlayerInRange(this, 1, 0x48)) { this->action = 2; - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; this->field_0x82.HALF.LO = 1; InitializeAnimation(this, 0); } @@ -535,7 +535,7 @@ void sub_0801F7FC(Entity* this) { void sub_0801F840(Entity* this) { GetNextFrame(this); - if (this->frames.all & 0x80) { + if (this->frame & 0x80) { sub_0801FB14(this); COLLISION_ON(this); this->spritePriority.b0 = 4; @@ -579,9 +579,9 @@ void sub_0801F8C0(Entity* this) { } void sub_0801F940(Entity* this) { - if (this->frames.all & 0x10) { - if (this->frames.all & 1) { - this->frames.all ^= 1; + if (this->frame & 0x10) { + if (this->frame & 1) { + this->frame ^= 1; EnqueueSFX(299); } sub_080AEFE0(this); @@ -591,7 +591,7 @@ void sub_0801F940(Entity* this) { GetNextFrame(this); } - if (this->frames.all & 0x80) { + if (this->frame & 0x80) { if (sub_0801FBD0(this)) { sub_0801FAE0(this); } else { @@ -611,7 +611,7 @@ void sub_0801F9C4(Entity* this) { void sub_0801F9E0(Entity* this) { GetNextFrame(this); - if (this->frames.all & 0x80) { + if (this->frame & 0x80) { this->action = 8; this->field_0xf = 30; this->direction = sub_08049F84(this, 1); @@ -636,9 +636,9 @@ void sub_0801FA30(Entity* this) { void sub_0801FA78(Entity* this) { GetNextFrame(this); - if (this->frames.all & 0x80) { + if (this->frame & 0x80) { this->action = 1; - this->spriteSettings.b.draw = 0; + this->spriteSettings.draw = 0; InitializeAnimation(this, 4); sub_0804AA1C(this); } @@ -647,7 +647,7 @@ void sub_0801FA78(Entity* this) { void sub_0801FAAC(Entity* this) { sub_08003FC4(this, 0x1800); GetNextFrame(this); - if (this->frames.all & 0x80) { + if (this->frame & 0x80) { sub_0801FB14(this); this->speed = 0x20; sub_0804AA1C(this); @@ -662,7 +662,7 @@ void sub_0801FAE0(Entity* this) { void sub_0801FAF8(Entity* this) { this->action = 2; - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; InitializeAnimation(this, 4); } @@ -675,7 +675,7 @@ void sub_0801FB14(Entity* this) { void sub_0801FB34(Entity* this) { if (*(Entity**)&this->field_0x68) { - sub_0806FA90(this, *(Entity**)&this->field_0x68, gUnk_080CA2B4[this->frames.all & 0xf], 1); + sub_0806FA90(this, *(Entity**)&this->field_0x68, gUnk_080CA2B4[this->frame & 0xf], 1); (*(Entity**)&this->field_0x68)->spriteOffsetY--; } } @@ -688,7 +688,7 @@ void sub_0801FB68(Entity* this) { case 1: this->action = 10; COLLISION_ON(this); - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; this->spritePriority.b1 = 3; break; case 2: @@ -698,7 +698,7 @@ void sub_0801FB68(Entity* this) { break; } - this->hVelocity = 0; + this->zVelocity = 0; } u32 sub_0801FBD0(Entity* this) { @@ -711,7 +711,7 @@ u32 sub_0801FBD0(Entity* this) { void Chuchu_JumpAtPlayer(Entity* this) { this->speed = 0x180; - this->hVelocity = 0x20000; + this->zVelocity = 0x20000; this->direction = sub_08049F84(this, 1); InitializeAnimation(this, 3); } diff --git a/src/enemy/cuccoChickAggr.c b/src/enemy/cuccoChickAggr.c index 2ae41b08..fa2fb63a 100644 --- a/src/enemy/cuccoChickAggr.c +++ b/src/enemy/cuccoChickAggr.c @@ -41,7 +41,7 @@ void sub_08022970(Entity* this) { } void sub_08022988(Entity* this) { - if (this->height.HALF.HI == 0 && sub_08022B20(this)) { + if (this->z.HALF.HI == 0 && sub_08022B20(this)) { sub_08022B0C(this); } else { if (this->field_0xf) { @@ -49,7 +49,7 @@ void sub_08022988(Entity* this) { return; this->frameIndex = 1; - this->hVelocity = 0x10000; + this->zVelocity = 0x10000; EnqueueSFX(0xd6); } @@ -75,7 +75,7 @@ void sub_080229F8(Entity* this) { this->speed = 0xc0; sub_08022B44(this); } else { - this->hVelocity = 0x10000; + this->zVelocity = 0x10000; EnqueueSFX(0xd6); } } @@ -120,7 +120,7 @@ void sub_08022AA4(Entity* this) { } if (this->direction & 0xf) - this->spriteSettings.b.flipX = (this->direction >> 4) ^ 1; + this->spriteSettings.flipX = (this->direction >> 4) ^ 1; } void sub_08022B0C(Entity* this) { @@ -138,11 +138,11 @@ u32 sub_08022B20(Entity* this) { } void sub_08022B44(Entity* this) { - this->hVelocity = 0xc000; + this->zVelocity = 0xc000; this->direction = GetFacingDirection(this, &gPlayerEntity); if (this->direction & 0xf) - this->spriteSettings.b.flipX = (this->direction >> 4) ^ 1; + this->spriteSettings.flipX = (this->direction >> 4) ^ 1; EnqueueSFX(0xd6); } diff --git a/src/enemy/darkNut.c b/src/enemy/darkNut.c index 09648a8f..aa7d5993 100644 --- a/src/enemy/darkNut.c +++ b/src/enemy/darkNut.c @@ -98,8 +98,8 @@ void sub_08020BB8(Entity* this) { case 0x4c: if (this->action == 15) { u8 bVar3 = 0xff; - if (this->attachedEntity != NULL) { - bVar3 = this->attachedEntity->bitfield & 0x7f; + if (this->child != NULL) { + bVar3 = this->child->bitfield & 0x7f; } if (bVar3 == 2) { sub_080213D0(this, gUnk_080CAB08[this->type]); @@ -109,14 +109,14 @@ void sub_08020BB8(Entity* this) { } break; default: - if (this->currentHealth != this->field_0x78.HALF.LO) { + if (this->health != this->field_0x78.HALF.LO) { sub_08021588(this); sub_08021390(this); sub_0804AA1C(this); } break; } - this->field_0x78.HALF.LO = this->currentHealth; + this->field_0x78.HALF.LO = this->health; sub_0804AA30(this, gUnk_080CAA98); } @@ -127,7 +127,7 @@ void sub_08020D70(Entity* this) { sub_0804A720(this); this->action = 1; this->field_0x74.HALF.HI = 0; - this->field_0x78.HALF.LO = this->currentHealth; + this->field_0x78.HALF.LO = this->health; this->animationState = -1; sub_08021218(this, 0, 2); } @@ -139,7 +139,7 @@ void sub_08020D9C(Entity* this) { void sub_08020DB4(Entity* this) { UpdateAnimationSingleFrame(this); - if (this->frames.all & 0x80) + if (this->frame & 0x80) sub_08021390(this); } @@ -159,7 +159,7 @@ void sub_08020DD4(Entity* this) { void sub_08020E28(Entity* this) { UpdateAnimationSingleFrame(this); - if (this->frames.all & 0x80) + if (this->frame & 0x80) sub_080213B0(this); } @@ -168,14 +168,14 @@ void sub_08020E48(Entity* this) { sub_080213F0(this); } else { UpdateAnimationSingleFrame(this); - if (this->frames.all & 0x80) + if (this->frame & 0x80) sub_080213B0(this); } } void sub_08020E78(Entity* this) { UpdateAnimationSingleFrame(this); - if (this->frames.all & 0x80) + if (this->frame & 0x80) sub_08021390(this); } @@ -209,7 +209,7 @@ void sub_08020E98(Entity* this) { void sub_08020F28(Entity* this) { UpdateAnimationSingleFrame(this); - if (this->frames.all & 0x80) + if (this->frame & 0x80) sub_08021400(this); } @@ -227,7 +227,7 @@ void sub_08020F48(Entity* this) { pEVar3 = CreateProjectileWithParent(this, 0, 1); if (pEVar3) { pEVar3->parent = this; - this->attachedEntity = pEVar3; + this->child = pEVar3; } } } else { @@ -239,7 +239,7 @@ void sub_08020F48(Entity* this) { } void sub_08020FAC(Entity* this) { - if (this->frames.all & 0x80) { + if (this->frame & 0x80) { if (this->field_0x7a.HALF.LO) { this->field_0x7a.HALF.LO--; } else { @@ -262,23 +262,23 @@ void sub_08020FE4(Entity* this) { void sub_08021010(Entity* this) { UpdateAnimationSingleFrame(this); - if (this->frames.all & 0x80) { + if (this->frame & 0x80) { this->hitType = 0x56; sub_080213F0(this); } } void sub_08021038(Entity* this) { - if (this->attachedEntity == NULL && this->frames.all) { + if (this->child == NULL && this->frame) { Entity* pEVar2 = (Entity*)CreateProjectileWithParent(this, 0, 0); if (pEVar2) { pEVar2->parent = this; - this->attachedEntity = pEVar2; + this->child = pEVar2; } EnqueueSFX(270); } - if (this->frames.all & 0x80) { + if (this->frame & 0x80) { sub_08021588(this); if (this->field_0x7c.BYTES.byte0) { this->field_0x7c.BYTES.byte0--; @@ -287,40 +287,39 @@ void sub_08021038(Entity* this) { } } else { UpdateAnimationSingleFrame(this); - if (this->frames.all == 4) + if (this->frame == 4) this->hitType = 81; } } void sub_080210A8(Entity* this) { UpdateAnimationSingleFrame(this); - if (this->frames.all & 1) { - this->frames.all = 0; + if (this->frame & 1) { + this->frame = 0; sub_08021588(this); EnqueueSFX(349); - } else if (this->frames.all & 0x80) { + } else if (this->frame & 0x80) { sub_08021390(this); } } void sub_080210E4(Entity* this) { UpdateAnimationSingleFrame(this); - if (this->frames.all & 1) { + if (this->frame & 1) { Entity* ent; - this->frames.all &= ~1; + this->frame &= ~1; ent = CreateProjectileWithParent(this, 0, 2); if (ent) { ent->parent = this; - this->attachedEntity = ent; + this->child = ent; } EnqueueSFX(270); } sub_08021644(this); - if ((this->frames.all & 0x10) && - (!ProcessMovement(this) || (this->attachedEntity && (this->attachedEntity->bitfield & 0x80)))) { + if ((this->frame & 0x10) && (!ProcessMovement(this) || (this->child && (this->child->bitfield & 0x80)))) { sub_080213D0(this, 0); } else { if (--this->field_0x76.HWORD == 0) @@ -329,7 +328,7 @@ void sub_080210E4(Entity* this) { } void sub_08021170(Entity* this) { - if (this->frames.all & 0x80) { + if (this->frame & 0x80) { if (this->field_0x7a.HALF.HI) { this->field_0x7a.HALF.HI--; } else { @@ -345,7 +344,7 @@ void sub_080211A0(Entity* this) { sub_08021390(this); } else { UpdateAnimationSingleFrame(this); - if (this->frames.all & 0x80) + if (this->frame & 0x80) sub_080213B0(this); } } @@ -356,7 +355,7 @@ void sub_080211D0(Entity* this) UpdateAnimationSingleFrame(this); sub_0802159C(this); - if (this->frames.all & 0x80) + if (this->frame & 0x80) sub_08021390(this); } @@ -364,7 +363,7 @@ void sub_080211F4(Entity* this) { UpdateAnimationSingleFrame(this); sub_08021600(this); - if (this->frames.all & 0x80) + if (this->frame & 0x80) sub_08021390(this); } @@ -414,7 +413,7 @@ void sub_080212B0(Entity* this) { if (this->type < 2 && tmp == 2) tmp = gUnk_080CAB52[Random() & 3]; - this->attachedEntity = NULL; + this->child = NULL; gUnk_080CAB58[tmp](this); } @@ -530,7 +529,7 @@ u32 sub_080214FC(Entity* this) { return 0; direction = GetFacingDirection(this, gUnk_020000B0); - if (4 < (direction - (this->frames.all & 0x1f)) - 2) + if (4 < (direction - (this->frame & 0x1f)) - 2) return 0; this->animationState = DirectionToAnimationState(direction); @@ -557,54 +556,54 @@ void sub_08021540(Entity* this) { } void sub_08021588(Entity* this) { - if (this->attachedEntity) { - this->attachedEntity->parent = NULL; - this->attachedEntity = NULL; + if (this->child) { + this->child->parent = NULL; + this->child = NULL; } } void sub_0802159C(Entity* this) { - if (this->frames.all == 1) { + if (this->frame == 1) { Entity* ent; - this->frames.all = 0; + this->frame = 0; this->hitType = 0x51; ent = CreateProjectileWithParent(this, 0, 3); if (ent) { ent->parent = this; - this->attachedEntity = ent; + this->child = ent; } EnqueueSFX(0x116); - } else if (this->frames.all == 2) { - this->frames.all = 0; + } else if (this->frame == 2) { + this->frame = 0; sub_08021588(this); - } else if (this->frames.all & 0x20) { - this->frames.all &= ~0x20; + } else if (this->frame & 0x20) { + this->frame &= ~0x20; EnqueueSFX(0x115); } } void sub_08021600(Entity* this) { - if (this->frames.all == 1) { + if (this->frame == 1) { Entity* ent; - this->frames.all = 0; + this->frame = 0; this->hitType = 0x51; ent = CreateProjectileWithParent(this, 0, 4); if (ent) { ent->parent = this; - this->attachedEntity = ent; + this->child = ent; } EnqueueSFX(0x10e); - } else if (this->frames.all == 2) { - this->frames.all = 0; + } else if (this->frame == 2) { + this->frame = 0; sub_08021588(this); } } void sub_08021644(Entity* this) { - if (this->frames.all & 0x20) { - this->frames.all &= ~0x20; + if (this->frame & 0x20) { + this->frame &= ~0x20; EnqueueSFX(0x7d); } } diff --git a/src/enemy/doorMimic.c b/src/enemy/doorMimic.c index 301efced..713ace16 100644 --- a/src/enemy/doorMimic.c +++ b/src/enemy/doorMimic.c @@ -71,7 +71,7 @@ void sub_080220D8(Entity* this) { void sub_080220F0(Entity* this) { GetNextFrame(this); - if (this->frames.all & 0x80) { + if (this->frame & 0x80) { const PosOffset* off; u32 i; @@ -87,7 +87,7 @@ void sub_080220F0(Entity* this) { } } EnqueueSFX(260); - } else if (this->frames.all & 1) { + } else if (this->frame & 1) { this->damage = 4; } } @@ -103,7 +103,7 @@ void sub_08022174(Entity* this) { void sub_08022198(Entity* this) { sub_0800445C(this); GetNextFrame(this); - if (this->frames.all & 0x80) { + if (this->frame & 0x80) { this->action = 1; this->actionDelay = 0x5a; } diff --git a/src/enemy/enemy4D.c b/src/enemy/enemy4D.c index f1b16cc7..75c28eb1 100644 --- a/src/enemy/enemy4D.c +++ b/src/enemy/enemy4D.c @@ -39,9 +39,9 @@ void sub_0803EB44(Entity* this) { pEVar1 = CreateProjectileWithParent(this, 0x19, 0); if (pEVar1 != NULL) { pEVar1->parent = this; - this->attachedEntity = pEVar1; + this->child = pEVar1; COLLISION_ON(this); - this->spriteSettings.b.draw = TRUE; + this->spriteSettings.draw = TRUE; this->animationState = 2; *((u8*)&this->field_0x7a + 1) = 0; *(u8*)&this->field_0x7c = 0; diff --git a/src/enemy/enemyE.c b/src/enemy/enemyE.c index 9f6a0b6d..6835be88 100644 --- a/src/enemy/enemyE.c +++ b/src/enemy/enemyE.c @@ -20,7 +20,7 @@ void nullsub_133(Entity* this) { void sub_08022FD0(Entity* this) { this->action = 1; - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; sub_08023000(this, 0); } diff --git a/src/enemy/fallingBoulder.c b/src/enemy/fallingBoulder.c index 039c817f..6084d868 100644 --- a/src/enemy/fallingBoulder.c +++ b/src/enemy/fallingBoulder.c @@ -32,7 +32,7 @@ void sub_0802C254(Entity* this) { void sub_0802C258(Entity* this) { sub_0804A720(this); - this->hVelocity = 0x20000; + this->zVelocity = 0x20000; this->actionDelay = 2; this->field_0x7a.HWORD = Random() & 0x70; switch (this->type) { @@ -45,7 +45,7 @@ void sub_0802C258(Entity* this) { } this->field_0x80.HWORD = this->x.HALF.HI; this->field_0x82.HWORD = this->y.HALF.HI; - this->height.HALF.HI = -0x10; + this->z.HALF.HI = -0x10; this->collisionLayer = 3; this->spriteRendering.b3 = 1; this->spritePriority.b0 = 2; @@ -70,7 +70,7 @@ NONMATCH("asm/non_matching/fallingBoulder/sub_0802C334.inc", void sub_0802C334(E return; } this->field_0x7c.HALF.LO = 1; - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; } GetNextFrame(this); this->field_0x7c.HALF.HI = COORD_TO_TILE(this); @@ -113,7 +113,7 @@ NONMATCH("asm/non_matching/fallingBoulder/sub_0802C334.inc", void sub_0802C334(E sub_080AEFB4(this); } else { sub_0806F69C(this); - if (this->height.HALF.HI - y > 0x38) { + if (this->z.HALF.HI - y > 0x38) { sub_0802C62C(this); this->field_0x7a.HWORD = (Random() & 0x7f) | 0x80; if (this->type == 3) { @@ -190,7 +190,7 @@ void sub_0802C4B0(Entity* this) { } rand = Random() & 7; - this->hVelocity = 0x20000; + this->zVelocity = 0x20000; if (rand & 4) { if (rand & 3) { *(u32*)&this->cutsceneBeh = gUnk_080CD58C[offset | 1]; @@ -210,7 +210,7 @@ void sub_0802C62C(Entity* this) { this->action = 1; this->y.HALF.HI = this->field_0x82.HWORD; this->x.HALF.HI = this->field_0x80.HWORD; - this->spriteSettings.b.draw = 0; + this->spriteSettings.draw = 0; COLLISION_OFF(this); this->field_0x7c.HALF.LO = 0; } diff --git a/src/enemy/fireballGuy.c b/src/enemy/fireballGuy.c index 2103e19f..3ec57bc7 100644 --- a/src/enemy/fireballGuy.c +++ b/src/enemy/fireballGuy.c @@ -28,7 +28,7 @@ void sub_080453A4(Entity* this) { } void sub_080453BC(Entity* this) { - if (this->currentHealth && this->cutsceneBeh.HALF.LO != this->currentHealth) { + if (this->health && this->cutsceneBeh.HALF.LO != this->health) { this->action = 2; } else { sub_0804AA30(this, gUnk_080D17E8); @@ -41,9 +41,9 @@ void nullsub_172(void) { void sub_080453E8(Entity* this) { this->action = 1; this->actionDelay = 0; - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; this->speed = 0x80; - this->cutsceneBeh.HALF.LO = this->currentHealth; + this->cutsceneBeh.HALF.LO = this->health; this->field_0x3c |= 0x10; sub_0804A720(this); InitializeAnimation(this, 0); @@ -77,11 +77,11 @@ void sub_08045454(Entity* this) { off = gUnk_080D1810; for (i = 0; i < count; i++) { ent = entities[i]; - ent->attachedEntity = entities[(i + 1) % count]; + ent->child = entities[(i + 1) % count]; ent->parent = entities[(i + count - 1) % count]; tmp = 0; ent->type2 = 1; - ent->height.HALF.HI = tmp; + ent->z.HALF.HI = tmp; ent->iframes = -0x10; /* Set MiniFireballGuy offset relative to killed slime. */ @@ -101,7 +101,7 @@ u32 sub_0804A024(Entity*, u32, u32); void sub_08045524(Entity* this) { u32 tmp, tmp1, tmp2; - this->hVelocity = 0x1c000; + this->zVelocity = 0x1c000; tmp = sub_0804A024(this, 1, 8); if (tmp != 0xff && (Random() & 3) == 0) { this->actionDelay = Random() & 3; diff --git a/src/enemy/gibdo.c b/src/enemy/gibdo.c index 6fc3a27f..59e03862 100644 --- a/src/enemy/gibdo.c +++ b/src/enemy/gibdo.c @@ -148,11 +148,11 @@ void sub_08037624(Entity* this) { void sub_08037690(Entity* this) { UpdateAnimationSingleFrame(this); - if ((this->frames.all & 0x80) != 0) { + if ((this->frame & 0x80) != 0) { this->field_0x76.HALF.HI = 0x14; sub_08037794(this); } else { - if ((this->frames.all & 1) != 0) { + if ((this->frame & 1) != 0) { this->hitType = 0x27; ProcessMovement(this); } @@ -167,7 +167,7 @@ NONMATCH("asm/non_matching/gibdo/sub_080376D0.inc", void sub_080376D0(Entity* th gPlayerState.field_0xa = gPlayerState.field_0xa | 0x80; CopyPositionAndSpriteOffset(&gPlayerEntity, this); UpdateAnimationSingleFrame(this); - x = &this->frames.all; + x = &this->frame; if ((*x & 0x1) != 0) { if (!(--this->field_0x7c.BYTES.byte0)) { sub_08037A58(this); @@ -182,7 +182,7 @@ END_NONMATCH void sub_0803773C(Entity* this) { UpdateAnimationSingleFrame(this); - if ((this->frames.all & 0x80) != 0) { + if ((this->frame & 0x80) != 0) { sub_08037794(this); } } @@ -396,7 +396,7 @@ NONMATCH("asm/non_matching/gibdo/sub_08037B48.inc", void sub_08037B48(Entity* th E->spriteOffsetY = 0xf5; E->parent = this; } - this->attachedEntity = E; + this->child = E; } END_NONMATCH @@ -409,7 +409,7 @@ NONMATCH("asm/non_matching/gibdo/sub_08037C0C.inc", void sub_08037C0C(Entity* th this->actionDelay = 0xf; this->parent = that; } - if (this->attachedEntity != 0) { + if (this->child != 0) { this->actionDelay = 0xf; this->parent = that; } diff --git a/src/enemy/gyorgMale.c b/src/enemy/gyorgMale.c index 6c0fb567..855a66dc 100644 --- a/src/enemy/gyorgMale.c +++ b/src/enemy/gyorgMale.c @@ -93,7 +93,7 @@ void (*const gUnk_080D1AFC[8])(Entity*) = { sub_08046898, sub_08046910, sub_0804 void GyorgMale(Entity* this) { if (this->action) { - this->spriteSettings.b.draw = this->field_0x7c.BYTES.byte1; + this->spriteSettings.draw = this->field_0x7c.BYTES.byte1; } gUnk_080D1AFC[this->action](this); if (this->action != 7) { @@ -101,9 +101,9 @@ void GyorgMale(Entity* this) { } this->animationState = -(this->field_0x78.HWORD >> 8); sub_08048004(this); - this->field_0x7c.BYTES.byte1 = this->spriteSettings.b.draw; - if (this->spriteSettings.b.draw == 1 && (this->y.HALF.HI - gRoomControls.roomScrollY + 0x30) > 0x100u) { - this->spriteSettings.b.draw = 0; + this->field_0x7c.BYTES.byte1 = this->spriteSettings.draw; + if (this->spriteSettings.draw == 1 && (this->y.HALF.HI - gRoomControls.roomScrollY + 0x30) > 0x100u) { + this->spriteSettings.draw = 0; } this->cutsceneBeh.HWORD = gPlayerEntity.x.HALF.HI; this->field_0x86.HWORD = gPlayerEntity.y.HALF.HI; @@ -116,11 +116,11 @@ void sub_08046898(Entity* this) { return; tmp->type = 1; tmp->parent = this; - this->attachedEntity = tmp; + this->child = tmp; this->action = 1; this->subAction = 0; this->spriteRendering.b0 = 3; - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; this->spriteOrientation.flipY = 2; this->spriteRendering.b3 = 2; this->field_0x3c |= 0x10; @@ -232,7 +232,7 @@ void (*const gUnk_080D1B38[5])(Entity*) = { sub_08046AE8, sub_08046B18, sub_0804 void sub_08046A9C(Entity* this) { if (this->animIndex == 1) { - if (this->frames.all == 1) { + if (this->frame == 1) { InitAnimationForceUpdate(this, 0); } } @@ -315,7 +315,7 @@ void (*const gUnk_080D1B4C[5])(Entity*) = { sub_08046D44, sub_08046D98, sub_0804 void sub_08046CEC(Entity* this) { if (this->animIndex == 0) { - if (this->frames.all == 1) { + if (this->frame == 1) { InitAnimationForceUpdate(this, 1); } } @@ -418,7 +418,7 @@ void (*const gUnk_080D1B94[0xA])(Entity*) = { sub_08046FE8, sub_0804702C, sub_08 void sub_08046F64(Entity* this) { if (this->animIndex == 0) { - if (this->frames.all == 1) { + if (this->frame == 1) { InitAnimationForceUpdate(this, 1); } } @@ -580,13 +580,13 @@ void (*const gUnk_080D1BC0[7])(Entity*) = { sub_080473B8, sub_080473F0, sub_0804 void sub_0804736C(Entity* this) { if (this->animIndex == 1) { - if (this->frames.all == 1) { + if (this->frame == 1) { InitAnimationForceUpdate(this, 0); } } gUnk_080D1BC0[this->subAction](this); UpdateAnimationSingleFrame(this); - if (this->currentHealth == 0) { + if (this->health == 0) { this->action = 7; this->subAction = 0; } @@ -827,7 +827,7 @@ void sub_08047914(Entity* this) { void sub_08047978(Entity* this) { sub_08047D88(this); - if (this->currentHealth != 0) { + if (this->health != 0) { if (--this->field_0x70.HALF_U.LO == 0) { this->field_0x70.HALF.HI = 1; if (this->type == 0) { @@ -858,9 +858,9 @@ void sub_08047978(Entity* this) { this->spriteRendering.b3 = 2; this->direction = this->animationState; } - if (this->currentHealth != 0) + if (this->health != 0) return; - if (this->attachedEntity->action != 1) + if (this->child->action != 1) return; this->subAction = 4; if (this->type == 0) { @@ -959,18 +959,18 @@ void sub_08047BF0(Entity* this) { } else { this->actionDelay--; if (this->actionDelay == 0x5A) { - tmp = this->attachedEntity; - tmp->spriteSettings.b.draw = 0; + tmp = this->child; + tmp->spriteSettings.draw = 0; CreateFx(tmp, FX_GIANT_EXPLOSION4, 0); } else { if (this->actionDelay == 0x3C) { - tmp = this->attachedEntity->attachedEntity; - tmp->spriteSettings.b.draw = 0; + tmp = this->child->child; + tmp->spriteSettings.draw = 0; CreateFx(tmp, FX_GIANT_EXPLOSION4, 0); } else { if (this->actionDelay == 0x1E) { - tmp = this->attachedEntity->attachedEntity->attachedEntity; - tmp->spriteSettings.b.draw = 0; + tmp = this->child->child->child; + tmp->spriteSettings.draw = 0; CreateFx(tmp, FX_GIANT_EXPLOSION4, 0); } } @@ -1012,7 +1012,7 @@ void sub_08047D88(Entity* this) { if (!sub_0806FCB8(this, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x20)) return; gPlayerState.field_0x14 = 1; - if (gPlayerEntity.height.HALF.HI != 0) + if (gPlayerEntity.z.HALF.HI != 0) return; this->field_0x7c.BYTES.byte0 |= 1; } @@ -1114,7 +1114,7 @@ void sub_08048004(Entity* this) { return; if (this->animIndex == 0) { COLLISION_OFF(this); - if (gPlayerEntity.height.HALF.HI != 0) + if (gPlayerEntity.z.HALF.HI != 0) return; if (!sub_08079F8C()) return; diff --git a/src/enemy/hangingSeed.c b/src/enemy/hangingSeed.c index 95593f7b..2b582b57 100644 --- a/src/enemy/hangingSeed.c +++ b/src/enemy/hangingSeed.c @@ -27,7 +27,7 @@ void nullsub_7(Entity* this) { void HangingSeed_Initialize(Entity* this) { this->action = 1; - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; this->frameIndex = this->type; this->spriteRendering.b3 = 1; this->spritePriority.b0 = 3; diff --git a/src/enemy/helmasaur.c b/src/enemy/helmasaur.c index 870831bc..0bb1c1c4 100644 --- a/src/enemy/helmasaur.c +++ b/src/enemy/helmasaur.c @@ -89,7 +89,7 @@ void sub_0802BCA8(Entity* this) { this->action = 7; this->actionDelay = 0x5a; - this->hVelocity = 0x18000; + this->zVelocity = 0x18000; this->hitType = 0x19; this->field_0x3a = this->field_0x3a & 0xfb; this->field_0x1c = 0x12; @@ -125,7 +125,7 @@ void sub_0802BD28(Entity* this) { COLLISION_ON(this); this->field_0x3a &= ~0x4; } else { - this->currentHealth = 0; + this->health = 0; } } @@ -284,7 +284,7 @@ void sub_0802BFE0(Entity* this) { } void sub_0802BFF4(Entity* this) { - this->spriteSettings.b.draw ^= 1; + this->spriteSettings.draw ^= 1; if (--this->actionDelay == 0) { DeleteEntity(this); } @@ -369,7 +369,7 @@ void sub_0802C1CC(Entity* this) { void sub_0802C218(Entity* this) { this->action = 6; this->speed = 0xe0; - this->hVelocity = 0x18000; + this->zVelocity = 0x18000; } // clang-format off diff --git a/src/enemy/keaton.c b/src/enemy/keaton.c index d1a41424..0c9adb33 100644 --- a/src/enemy/keaton.c +++ b/src/enemy/keaton.c @@ -82,7 +82,7 @@ void sub_0803248C(Entity* this) { void sub_080324CC(Entity* this) { if (sub_080325E8(this) == 0) { UpdateAnimationSingleFrame(this); - if (this->frames.all & 0x80) { + if (this->frame & 0x80) { sub_080326FC(this); sub_08032740(this); } @@ -118,7 +118,7 @@ void sub_080324FC(Entity* this) { } void sub_08032574(Entity* this) { - if (this->attachedEntity && (this->attachedEntity->bitfield & 0x80)) { + if (this->child && (this->child->bitfield & 0x80)) { sub_0803275C(this); return; } @@ -144,10 +144,10 @@ void sub_080325C4(Entity* this) { u32 sub_080325E8(Entity* this) { if (((sub_08049FA0(this) != 0) && (sub_08049FDC(this, 1) != 0)) && (sub_080041A0(this, gUnk_020000B0, 0x68, 0x40) != 0)) { - if (((GetFacingDirection(this, gUnk_020000B0) - (DirectionRound(this->frames.all)) + 2) & 0x1F) < 5) { + if (((GetFacingDirection(this, gUnk_020000B0) - (DirectionRound(this->frame)) + 2) & 0x1F) < 5) { this->action = 3; this->actionDelay = 0xC; - this->direction = DirectionRound(this->frames.all); + this->direction = DirectionRound(this->frame); return 1; } } @@ -236,13 +236,13 @@ void sub_080327C8(Entity* this) { child = CreateProjectileWithParent(this, 11, 0); if (child != NULL) { child->parent = this; - this->attachedEntity = child; + this->child = child; } } void sub_080327E0(Entity* this) { - if (this->attachedEntity != NULL) { - this->attachedEntity->parent = NULL; - this->attachedEntity = NULL; + if (this->child != NULL) { + this->child->parent = NULL; + this->child = NULL; } } diff --git a/src/enemy/keese.c b/src/enemy/keese.c index 26c1a938..92d3ff86 100644 --- a/src/enemy/keese.c +++ b/src/enemy/keese.c @@ -59,7 +59,7 @@ void Keese_Initialize(Entity* this) { sub_0804A720(this); if (this->type != 0) { this->spritePriority.b1 = 1; - this->height.HALF.HI = -0x10; + this->z.HALF.HI = -0x10; } this->direction = Random() & 0x1f; this->field_0x1c = 1; @@ -77,12 +77,12 @@ void Keese_Fly(Entity* this) { this->field_0x7a.HWORD--; } GetNextFrame(this); - if ((this->frames.b.f3) != 0) { + if (this->frame & 0x80) { sub_08021F24(this); } else { sub_080AEFB4(this); } - this->spriteOffsetY = gKeeseSpriteOffsets[this->frames.all]; + this->spriteOffsetY = gKeeseSpriteOffsets[this->frame]; } void Keese_Rest(Entity* this) { diff --git a/src/enemy/lakitu.c b/src/enemy/lakitu.c index 91798d2e..d96950d7 100644 --- a/src/enemy/lakitu.c +++ b/src/enemy/lakitu.c @@ -57,7 +57,7 @@ void Lakitu_DoAction(Entity* this) { void sub_0803C784(Entity* this) { if ((this->bitfield & 0x7f) == 0x1d) { - this->hVelocity = 0x20000; + this->zVelocity = 0x20000; sub_0803CBAC(this); } else { @@ -104,7 +104,7 @@ void sub_0803C844(Entity* this) { } void sub_0803C850(Entity* this) { - Entity* cloud = this->attachedEntity; + Entity* cloud = this->child; if (cloud != NULL) { cloud->spriteOffsetX = this->spriteOffsetX; } @@ -114,7 +114,7 @@ void sub_0803C850(Entity* this) { void sub_0803C86C(Entity* this) { sub_0803CBAC(this); - this->attachedEntity = NULL; + this->child = NULL; } void Lakitu_Initialize(Entity* this) { @@ -124,13 +124,13 @@ void Lakitu_Initialize(Entity* this) { } cloud->parent = this; - this->attachedEntity = cloud; + this->child = cloud; sub_0804A720(this); this->action = HIDDEN; - this->height.HALF.HI = -2; + this->z.HALF.HI = -2; this->spriteOffsetY = 0xff; @@ -143,14 +143,14 @@ void Lakitu_Hide(Entity* this) { if (sub_0803CA4C(this)) { this->action = 2; - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; } } void Lakitu_EndHide(Entity* this) { UpdateAnimationSingleFrame(this); - if (this->frames.b.f3) { + if (this->frame & 0x80) { this->action = IDLE; this->actionDelay = 0x3c; @@ -178,9 +178,9 @@ void Lakitu_Idle(Entity* this) { void Lakitu_BeginHide(Entity* this) { UpdateAnimationSingleFrame(this); - if (this->frames.b.f3 != 0) { + if (this->frame & 0x80) { this->action = 1; - this->spriteSettings.b.draw = 0; + this->spriteSettings.draw = 0; InitAnimationForceUpdate(this, this->animationState); } @@ -189,7 +189,7 @@ void Lakitu_BeginHide(Entity* this) { void Lakitu_Lightning(Entity* this) { UpdateAnimationSingleFrame(this); - if (this->frames.b.f3 == 0) { + if (!(this->frame & 0x80)) { return; } @@ -207,7 +207,7 @@ void Lakitu_Lightning(Entity* this) { this->field_0x78.HALF.HI = FALSE; - InitAnimationForceUpdate(this->attachedEntity, this->animationState); + InitAnimationForceUpdate(this->child, this->animationState); } } @@ -259,7 +259,7 @@ void sub_0803CA84(Entity* this, u32 unkParameter) { this->animationState = altAnimState; InitAnimationForceUpdate(this, altAnimState + unkParameter); - InitAnimationForceUpdate(this->attachedEntity, altAnimState); + InitAnimationForceUpdate(this->child, altAnimState); } } } @@ -284,7 +284,7 @@ bool32 sub_0803CB04(Entity* this) { sub_0803CB34(this); this->field_0x78.HALF.HI = delay; - InitAnimationForceUpdate(this->attachedEntity, this->animationState + 4); + InitAnimationForceUpdate(this->child, this->animationState + 4); returnValue = 1; } @@ -322,14 +322,14 @@ void Lakitu_SpawnLightning(Entity* this) { void sub_0803CBAC(Entity* this) { Entity* cloud; - cloud = this->attachedEntity; + cloud = this->child; if (cloud != NULL) { cloud->flags |= 0x80; cloud->hitType = 0x43; } this->action = CLOUDLESS; - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; this->spritePriority.b1 = 1; @@ -344,16 +344,16 @@ void sub_0803CC08(Entity* this) { Entity* cloud; Entity* fx; - cloud = this->attachedEntity; + cloud = this->child; if (cloud == NULL) { return; } - if ((u32)(cloud->height.HALF.HI - this->height.HALF.HI) > 2) { + if ((u32)(cloud->z.HALF.HI - this->z.HALF.HI) > 2) { return; } - if (this->hVelocity >= 0) { + if (this->zVelocity >= 0) { return; } @@ -385,7 +385,7 @@ void sub_0803CC08(Entity* this) { fx->y.HALF.HI -= 6; } - this->attachedEntity = NULL; + this->child = NULL; DeleteEntity(cloud); } diff --git a/src/enemy/lakituCloud.c b/src/enemy/lakituCloud.c index 4ace44e2..f847b0bd 100644 --- a/src/enemy/lakituCloud.c +++ b/src/enemy/lakituCloud.c @@ -65,11 +65,11 @@ void sub_0803CD6C(Entity* this) { Entity* lakitu; this->action = 1; - this->height.HALF.HI = -2; + this->z.HALF.HI = -2; // Set parent to lakitu lakitu = GetCurrentRoomProperty(this->type); - this->attachedEntity = lakitu; + this->child = lakitu; this->parent = lakitu; this->field_0x78.HWORD = this->x.HALF.HI; @@ -96,9 +96,9 @@ void sub_0803CDD8(Entity* this) { u8 one; u8 draw; - draw = this->spriteSettings.b.draw; + draw = this->spriteSettings.draw; one = 1; - this->spriteSettings.b.draw = draw ^ one; + this->spriteSettings.draw = draw ^ one; this->actionDelay--; @@ -107,14 +107,14 @@ void sub_0803CDD8(Entity* this) { COLLISION_ON(this); - this->spriteSettings.b.draw = one; + this->spriteSettings.draw = one; } } void sub_0803CE14(Entity* this) { u8 direction; - sub_080A2CC0(this, &this->attachedEntity, &this->field_0x74.HWORD); + sub_080A2CC0(this, &this->child, &this->field_0x74.HWORD); direction = this->direction; if (direction & 0x80) { @@ -139,7 +139,7 @@ void sub_0803CE3C(Entity* this) { this->x.HALF.HI = this->field_0x78.HWORD; this->y.HALF.HI = this->field_0x7a.HWORD; - this->attachedEntity = this->parent; + this->child = this->parent; sub_0803CE14(this); } diff --git a/src/enemy/leever.c b/src/enemy/leever.c index 4bdb53c8..d5b8e3de 100644 --- a/src/enemy/leever.c +++ b/src/enemy/leever.c @@ -69,7 +69,7 @@ void Leever_Idle(Entity* this) { if (--this->actionDelay == 0) { if (Leever_PlayerInRange(this, Random() & 0x1f)) { this->action = 2; - this->spriteSettings.b.draw = TRUE; + this->spriteSettings.draw = TRUE; this->direction = (GetFacingDirection(this, gUnk_020000B0) + gLeeverDrift[Random() & 1]) & 0x1f; InitializeAnimation(this, LeeverAnimation_DigUp); UpdateSpriteForCollisionLayer(this); @@ -82,7 +82,7 @@ void Leever_Idle(Entity* this) { void Leever_DigUp(Entity* this) { GetNextFrame(this); - if (this->frames.b.f3 != 0) { + if (this->frame & 0x80) { this->action = 3; if (this->type == LeeverForm_Red) { this->field_0x74.HWORD = 180; @@ -90,8 +90,8 @@ void Leever_DigUp(Entity* this) { this->field_0x74.HWORD = 110; } InitializeAnimation(this, LeeverAnimation_Attack); - } else if (this->frames.b.f0 != 0) { - this->frames.all &= 0xfe; + } else if ((this->frame & 1) != 0) { + this->frame &= 0xfe; COLLISION_ON(this); } } @@ -110,10 +110,10 @@ void Leever_Attack(Entity* this) { void Leever_DigDown(Entity* this) { Leever_Move(this); GetNextFrame(this); - if ((this->frames.b.f3) != 0) { + if (this->frame & 0x80) { this->action = 1; this->actionDelay = 0xf0; - this->spriteSettings.b.draw = FALSE; + this->spriteSettings.draw = FALSE; } } @@ -167,7 +167,7 @@ void Leever_Move(Entity* this) { this->field_0x74.HWORD = 1; } - this->speed = (this->frames.all & 0xf) * 0x20; + this->speed = (this->frame & 0xf) * 0x20; if (this->type == LeeverForm_Red) { if ((this->field_0xf++ & 0xf) == 0) { sub_08004596(this, sub_0800132C(this, gUnk_020000B0)); diff --git a/src/enemy/likeLike.c b/src/enemy/likeLike.c index 54d0852f..0eadf657 100644 --- a/src/enemy/likeLike.c +++ b/src/enemy/likeLike.c @@ -45,7 +45,7 @@ void sub_08027DA4(Entity* this) { } } - if (this->currentHealth == 0) { + if (this->health == 0) { this->actionDelay = 0x20; } @@ -74,19 +74,19 @@ void sub_08027E70(Entity* this) { switch (this->type) { case 0: this->action = 3; - this->spriteSettings.b.draw = 0; + this->spriteSettings.draw = 0; COLLISION_OFF(this); this->actionDelay = 0; break; case 1: this->action = 1; - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; this->actionDelay = 8; InitializeAnimation(this, 1); break; case 2: this->action = 1; - this->spriteSettings.b.draw = 0; + this->spriteSettings.draw = 0; this->actionDelay = 0; this->hitType = 1; InitializeAnimation(this, 0); @@ -132,7 +132,7 @@ void nullsub_12(Entity* this) { void sub_08027F84(Entity* this) { if (sub_08049FDC(this, 1)) { this->action = 5; - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; InitializeAnimation(this, 0); CreateDust(this); } @@ -149,7 +149,7 @@ void sub_08027FB4(Entity* this) { void sub_08027FE0(Entity* this) { GetNextFrame(this); - if (this->frames.all & 1) { + if (this->frame & 1) { this->action = 1; COLLISION_ON(this); this->direction = sub_08049F84(this, 1); @@ -161,9 +161,9 @@ void sub_08027FE0(Entity* this) { void sub_0802802C(Entity* this) { GetNextFrame(this); - if (this->frames.all & 1) { + if (this->frame & 1) { this->action = 3; - this->spriteSettings.b.draw = 0; + this->spriteSettings.draw = 0; this->direction = 0; this->actionDelay = 0; CreateDust(this); @@ -209,11 +209,11 @@ NONMATCH("asm/non_matching/likeLike/sub_0802810C.inc", void sub_0802810C(Entity* gPlayerState.field_0xa = 0; gPlayerState.flags &= 0xffffffef; gPlayerEntity.flags |= 0x80; - gPlayerEntity.hVelocity = 0x18000; + gPlayerEntity.zVelocity = 0x18000; gPlayerEntity.iframes = -60; gPlayerEntity.direction = gPlayerEntity.animationState << 2; gPlayerEntity.spritePriority.b1 = this->field_0x82.HALF.HI; - gPlayerEntity.height.HALF.HI = gPlayerEntity.spriteOffsetY; + gPlayerEntity.z.HALF.HI = gPlayerEntity.spriteOffsetY; gPlayerEntity.spriteOffsetY = 0; this->action = 4; this->actionDelay = 0x50; diff --git a/src/enemy/madderpillar.c b/src/enemy/madderpillar.c index 314b28fc..fd8d170a 100644 --- a/src/enemy/madderpillar.c +++ b/src/enemy/madderpillar.c @@ -59,7 +59,7 @@ void sub_080298A4(Entity* this) { this->field_0x76.HALF.HI = 0; sub_0801D2B4(this, 0x7f); EnqueueSFX(0xfe); - this->attachedEntity->action = 2; + this->child->action = 2; break; } } @@ -86,33 +86,33 @@ void sub_0802999C(Entity* this) { ent1 = CreateEnemy(MADDERPILLAR, 1); ent1->parent = this; PositionRelative(this, ent1, 0, 5); - this->attachedEntity = ent1; + this->child = ent1; ent2 = CreateEnemy(MADDERPILLAR, 2); ent2->parent = this; PositionRelative(this, ent2, 0, 4); - ent1->attachedEntity = ent2; + ent1->child = ent2; ent3 = CreateEnemy(MADDERPILLAR, 3); ent3->parent = this; PositionRelative(this, ent3, 0, 3); - ent2->attachedEntity = ent3; + ent2->child = ent3; ent4 = CreateEnemy(MADDERPILLAR, 4); ent4->parent = this; PositionRelative(this, ent4, 0, 2); - ent3->attachedEntity = ent4; + ent3->child = ent4; ent5 = CreateEnemy(MADDERPILLAR, 5); ent5->parent = this; PositionRelative(this, ent5, 0, 1); - ent4->attachedEntity = ent5; + ent4->child = ent5; ent6 = CreateEnemy(MADDERPILLAR, 6); - ent6->attachedEntity = this; + ent6->child = this; ent6->parent = this; PositionRelative(this, ent6, 0, 0); - ent5->attachedEntity = ent6; + ent5->child = ent6; this->action = 1; COLLISION_ON(this); @@ -179,7 +179,7 @@ void sub_08029B2C(Entity* this) { void sub_08029B90(Entity* this) { this->action = 1; - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; sub_0802A058(this); if (this->type < 2) { InitializeAnimation(this, 0); @@ -211,7 +211,7 @@ void sub_08029C08(Entity* this) { this->action = 3; this->actionDelay = gUnk_080CCDA0[this->type]; this->hitType = 0x6b; - this->attachedEntity->action = 2; + this->child->action = 2; } void sub_08029C2C(Entity* this) { @@ -251,7 +251,7 @@ void sub_08029C98(Entity* this) { void sub_08029CCC(Entity* this) { this->action = 1; - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; sub_0802A058(this); InitializeAnimation(this, 8); } @@ -276,7 +276,7 @@ void sub_08029D14(Entity* this) { } } else { GetNextFrame(this); - if (this->frames.all & 0x80) { + if (this->frame & 0x80) { this->action = 4; this->actionDelay = 0x78; this->hitType = 0x6c; @@ -298,7 +298,7 @@ void sub_08029D78(Entity* this) { void sub_08029DAC(Entity* this) { GetNextFrame(this); - if (this->frames.all & 0x80) { + if (this->frame & 0x80) { this->action = 6; this->parent->field_0x76.HALF.HI = 1; InitializeAnimation(this, this->animationState + 8); @@ -378,7 +378,7 @@ bool32 sub_08029F48(Entity* this) { } void sub_08029FB4(Entity* this, u32 x, u32 y) { - u8* dst = (u8*)&this->attachedEntity->field_0x78; + u8* dst = (u8*)&this->child->field_0x78; s32 unk = this->parent->field_0x7c.BYTES.byte2; u8 idx = unk % 0xe; dst[idx] = ((x + 8) & 0xf) | (((y + 8) & 0xf) << 4); @@ -458,18 +458,18 @@ void sub_0802A098(Entity* this) { } void sub_0802A0F8(Entity* this) { - if (this->currentHealth != 0) { + if (this->health != 0) { if ((this->bitfield & 0x80) && this->iframes != 0) { Entity* ent = this; u32 i; for (i = 0; i < 6; i++) { - ent = ent->attachedEntity; + ent = ent->child; ent->iframes = this->iframes; } } } else { this->parent->flags &= ~0x80; - this->parent->currentHealth = 0; + this->parent->health = 0; this->parent->field_0xf = 0x69; } } @@ -477,7 +477,7 @@ void sub_0802A0F8(Entity* this) { bool32 sub_0802A14C(Entity* this) { u32 ret = FALSE; - if (this->parent->currentHealth == 0 || this->field_0x86.HALF.LO) { + if (this->parent->health == 0 || this->field_0x86.HALF.LO) { ret = TRUE; } else { ret = FALSE; diff --git a/src/enemy/mazaalBracelet.c b/src/enemy/mazaalBracelet.c index 0437d6f2..acccbab0 100644 --- a/src/enemy/mazaalBracelet.c +++ b/src/enemy/mazaalBracelet.c @@ -147,17 +147,17 @@ NONMATCH("asm/non_matching/mazaal/sub_0803A188.inc", void sub_0803A188(Entity* t pEVar3 = this->parent; pEVar3->field_0x7c.BYTES.byte1 = pEVar3->field_0x7c.BYTES.byte1 | (this->type == 0 ? 1 : 2); pEVar3->field_0x80.HALF.LO = (this->type == 0 ? 1 : 2) | pEVar3->field_0x80.HALF.LO; - this->attachedEntity->iframes = this->iframes; + this->child->iframes = this->iframes; entity74 = *(Entity**)&this->field_0x74; entity74->iframes = this->iframes; SoundReq(SFX_BOSS_HIT); } } else { - this->attachedEntity->iframes = this->iframes; + this->child->iframes = this->iframes; entity74 = *(Entity**)&this->field_0x74; entity74->iframes = this->iframes; InitializeAnimation(this, 0x18); - InitAnimationForceUpdate(this->attachedEntity, 9); + InitAnimationForceUpdate(this->child, 9); SoundReq(SFX_BOSS_HIT); } } @@ -180,32 +180,32 @@ void sub_0803A274(Entity* this) { if (this->type == 0) { pEVar1 = CreateEnemy(MAZAAL_HAND, 0); pEVar1->parent = this; - this->attachedEntity = pEVar1; + this->child = pEVar1; pEVar1 = CreateEnemy(MAZAAL_BRACELET, 2); pEVar1->parent = this; *(Entity**)&this->field_0x74 = pEVar1; pEVar1 = CreateObject(OBJECT_7E, 1, 0); pEVar1->parent = this; - pEVar1->attachedEntity = this->attachedEntity; + pEVar1->child = this->child; PositionRelative(this->parent, this, 0x100000, 0x200000); } else { pEVar1 = CreateEnemy(MAZAAL_HAND, 1); pEVar1->parent = this; - this->attachedEntity = pEVar1; + this->child = pEVar1; pEVar1 = CreateEnemy(MAZAAL_BRACELET, 3); pEVar1->parent = this; *(Entity**)&this->field_0x74 = pEVar1; pEVar1 = CreateObject(OBJECT_7E, 2, 0); pEVar1->parent = this; - pEVar1->attachedEntity = this->attachedEntity; - this->spriteSettings.b.flipX = 1; + pEVar1->child = this->child; + this->spriteSettings.flipX = 1; PositionRelative(this->parent, this, -0x100000, 0x200000); } if (gScreenTransition.field_0x38 != 0) { this->action = 3; COLLISION_ON(this); - this->spriteSettings.b.draw = 1; - this->attachedEntity->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; + this->child->spriteSettings.draw = 1; InitializeAnimation(this, 0x10); } else { this->action = 1; @@ -222,25 +222,25 @@ void sub_0803A364(Entity* this) { ptr = gUnk_080CED6C; index = ((this->parent->field_0xf >> 4) + 3); - this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; + this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; switch (this->subAction & 0x7f) { case 0: case 2: break; case 1: this->subAction = 2; - pEVar3 = this->attachedEntity; - pEVar3->spriteSettings.b.draw = 1; + pEVar3 = this->child; + pEVar3->spriteSettings.draw = 1; pEVar3->spriteRendering.alphaBlend = 1; break; case 3: this->subAction = 4; - this->spriteSettings.b.draw = 1; - this->attachedEntity->spriteRendering.alphaBlend = 0; + this->spriteSettings.draw = 1; + this->child->spriteRendering.alphaBlend = 0; break; case 4: GetNextFrame(this); - if ((this->frames.all & 0x80) != 0) { + if ((this->frame & 0x80) != 0) { this->subAction = 5; } break; @@ -263,16 +263,16 @@ void sub_0803A364(Entity* this) { break; case 7: GetNextFrame(this); - if ((this->frames.all & 0x80) != 0) { + if ((this->frame & 0x80) != 0) { this->subAction = 8; - this->spriteSettings.b.draw = 0; - InitAnimationForceUpdate(this->attachedEntity, 8); + this->spriteSettings.draw = 0; + InitAnimationForceUpdate(this->child, 8); SoundReq(SFX_16E); } break; case 8: sub_0803B55C(this); - if ((this->attachedEntity->frames.all & 0x80) == 0) { + if ((this->child->frame & 0x80) == 0) { return; } uVar1 = 9; @@ -283,20 +283,20 @@ void sub_0803A364(Entity* this) { this->actionDelay--; if (this->actionDelay == 0) { this->subAction = 10; - InitAnimationForceUpdate(this->attachedEntity, 6); + InitAnimationForceUpdate(this->child, 6); } break; case 10: sub_0803B55C(this); - if ((this->attachedEntity->frames.all & 0x80) != 0) { + if ((this->child->frame & 0x80) != 0) { this->subAction = 0xb; - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; InitializeAnimation(this, 4); } break; case 0xb: GetNextFrame(this); - if ((this->frames.all & 0x80) == 0) { + if ((this->frame & 0x80) == 0) { return; } if (this->type2 != 0) { @@ -327,7 +327,7 @@ void sub_0803A548(Entity* this) { UpdateAnimationSingleFrame(this); ptr = gUnk_080CED6C; index = ((this->parent->field_0xf >> 4) + 3); - this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; + this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; if (sub_0803B4E4(this) == 0) { sub_0806F69C(this); } @@ -339,7 +339,7 @@ void sub_0803A58C(Entity* this) { ptr = gUnk_080CED6C; index = ((this->parent->field_0xf >> 4) + 3); - this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; + this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; if (sub_0803B4E4(this) != 0) { sub_0803B59C(this); } else { @@ -355,7 +355,7 @@ void sub_0803A5D0(Entity* this) { COLLISION_OFF(this); ptr = gUnk_080CED6C; index = ((this->parent->field_0xf >> 4) + 3); - this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; + this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; InitializeAnimation(this, 5); } @@ -365,12 +365,12 @@ void sub_0803A60C(Entity* this) { ptr = gUnk_080CED6C; index = ((this->parent->field_0xf >> 4) + 3); - this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; + this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; GetNextFrame(this); - if ((this->frames.all & 0x80) != 0) { + if ((this->frame & 0x80) != 0) { this->action = 6; - this->spriteSettings.b.draw = 0; - InitAnimationForceUpdate(this->attachedEntity, 8); + this->spriteSettings.draw = 0; + InitAnimationForceUpdate(this->child, 8); } } @@ -381,10 +381,10 @@ void sub_0803A660(Entity* this) { s8* ptr; u32 index; - pbVar3 = &this->attachedEntity->frames.all; + pbVar3 = &this->child->frame; if ((*pbVar3 & 0x80) != 0) { - if (this->height.HALF.HI > -0x50) { - this->height.HALF.HI = this->height.HALF.HI - 2; + if (this->z.HALF.HI > -0x50) { + this->z.HALF.HI = this->z.HALF.HI - 2; } else { this->action = 7; this->actionDelay = 0; @@ -400,7 +400,7 @@ void sub_0803A660(Entity* this) { } ptr = gUnk_080CED6C; index = ((this->parent->field_0xf >> 4) + 3); - this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; + this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; } } @@ -430,10 +430,10 @@ void sub_0803A720(Entity* this) { void sub_0803A740(Entity* this) { u16 height; - height = this->height.HALF.HI + 4; - this->height.HALF.HI += 4; + height = this->z.HALF.HI + 4; + this->z.HALF.HI += 4; if (-1 < height * 0x10000) { - this->height.HALF.HI = 0; + this->z.HALF.HI = 0; this->action = 10; this->actionDelay = 10; this->parent->field_0x7c.BYTES.byte1 |= 0x40; @@ -454,8 +454,8 @@ void sub_0803A780(Entity* this) { } void sub_0803A7AC(Entity* this) { - if (this->height.HALF.HI > -6) { - this->height.HALF.HI--; + if (this->z.HALF.HI > -6) { + this->z.HALF.HI--; } else { this->action = 0xc; } @@ -467,10 +467,10 @@ void sub_0803A7CC(Entity* this) { ptr = gUnk_080CED6C; index = ((this->parent->field_0xf >> 4) + 3); - this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; + this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; if (sub_0803B4E4(this)) { this->action = 0xd; - InitAnimationForceUpdate(this->attachedEntity, 6); + InitAnimationForceUpdate(this->child, 6); } else { sub_0806F69C(this); } @@ -482,11 +482,11 @@ void sub_0803A814(Entity* this) { ptr = gUnk_080CED6C; index = ((this->parent->field_0xf >> 4) + 3); - this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; + this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; sub_0803B55C(this); - if ((this->attachedEntity->frames.all & 0x80) != 0) { + if ((this->child->frame & 0x80) != 0) { this->action = 0xe; - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; InitializeAnimation(this, 4); } } @@ -497,9 +497,9 @@ void sub_0803A86C(Entity* this) { ptr = gUnk_080CED6C; index = ((this->parent->field_0xf >> 4) + 3); - this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; + this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; GetNextFrame(this); - if ((this->frames.all & 0x80) != 0) { + if ((this->frame & 0x80) != 0) { COLLISION_ON(this); sub_0803B59C(this); } @@ -516,9 +516,9 @@ void sub_0803A8B8(Entity* this) { ptr = gUnk_080CED6C; index = ((this->parent->field_0xf >> 4) + 3); - this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; + this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; InitializeAnimation(this, 6); - InitAnimationForceUpdate(this->attachedEntity, 1); + InitAnimationForceUpdate(this->child, 1); SoundReq(SFX_153); } @@ -528,7 +528,7 @@ void sub_0803A90C(Entity* this) { ptr = gUnk_080CED6C; index = ((this->parent->field_0xf >> 4) + 3); - this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; + this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; GetNextFrame(this); sub_0803B55C(this); sub_0806F69C(this); @@ -538,7 +538,7 @@ void sub_0803A90C(Entity* this) { this->direction = this->type * 0x10 + 8; this->speed = 0x200; InitializeAnimation(this, 7); - InitAnimationForceUpdate(this->attachedEntity, 2); + InitAnimationForceUpdate(this->child, 2); } } @@ -548,7 +548,7 @@ void sub_0803A978(Entity* this) { ptr = gUnk_080CED6C; index = ((this->parent->field_0xf >> 4) + 3); - this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; + this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; GetNextFrame(this); sub_0803B55C(this); if ((++this->actionDelay & 3) == 0) { @@ -561,7 +561,7 @@ void sub_0803A978(Entity* this) { COLLISION_OFF(this); *(u8*)(*(int*)&this->field_0x74 + 0x10) &= 0x7f; InitializeAnimation(this, 8); - InitAnimationForceUpdate(this->attachedEntity, 3); + InitAnimationForceUpdate(this->child, 3); } } @@ -572,7 +572,7 @@ void sub_0803AA00(Entity* this) { ptr = gUnk_080CED6C; index = ((this->parent->field_0xf >> 4) + 3); - this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; + this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; if (sub_0803B870(this) == 0) { direction = (this->type ^ 1) * 0x10 + 8; if ((++this->actionDelay & 3) == 0) { @@ -581,10 +581,10 @@ void sub_0803AA00(Entity* this) { sub_0806F69C(this); if ((this->direction == direction) || (this->y.HALF.HI >= gPlayerEntity.y.HALF.HI)) { this->action = 0x13; - this->spriteSettings.b.draw = 0; + this->spriteSettings.draw = 0; this->direction = direction; this->field_0x80.HWORD = gPlayerEntity.x.HALF.HI; - InitAnimationForceUpdate(this->attachedEntity, 4); + InitAnimationForceUpdate(this->child, 4); } } } @@ -596,7 +596,7 @@ NONMATCH("asm/non_matching/mazaal/sub_0803AA98.inc", void sub_0803AA98(Entity* t ptr = gUnk_080CED6C; index = ((this->parent->field_0xf >> 4) + 3); - this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; + this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; if (sub_0803B870(this) == 0) { sub_0806F69C(this); if (sub_0803B6F4(this) != 0) { @@ -604,7 +604,7 @@ NONMATCH("asm/non_matching/mazaal/sub_0803AA98.inc", void sub_0803AA98(Entity* t this->speed = 0x40; InitializeAnimation(this, 10); (*(Entity**)&this->field_0x74)->flags |= 0x80; - temp = this->attachedEntity; + temp = this->child; temp->hitType = 0x13; InitAnimationForceUpdate(temp, 5); SoundReq(SFX_16E); @@ -619,10 +619,10 @@ void sub_0803AB10(Entity* this) { ptr = gUnk_080CED6C; index = ((this->parent->field_0xf >> 4) + 3); - this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; + this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; sub_0806F69C(this); sub_0803B55C(this); - if ((this->attachedEntity->frames.all & 0x80) != 0) { + if ((this->child->frame & 0x80) != 0) { this->action = 0x15; this->actionDelay = 0xf; } @@ -634,12 +634,12 @@ void sub_0803AB5C(Entity* this) { ptr = gUnk_080CED6C; index = ((this->parent->field_0xf >> 4) + 3); - this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; + this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; if (--this->actionDelay == 0) { this->action = 0x16; - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; InitializeAnimation(this, 0xb); - InitAnimationForceUpdate(this->attachedEntity, 6); + InitAnimationForceUpdate(this->child, 6); } } @@ -649,15 +649,15 @@ void sub_0803ABB4(Entity* this) { ptr = gUnk_080CED6C; index = ((this->parent->field_0xf >> 4) + 3); - this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; + this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; GetNextFrame(this); sub_0803B55C(this); - if ((this->attachedEntity->frames.all & 0x80) != 0) { + if ((this->child->frame & 0x80) != 0) { this->action = 0x17; COLLISION_ON(this); this->speed = 0x180; InitializeAnimation(this, 0x10); - InitAnimationForceUpdate(this->attachedEntity, 0); + InitAnimationForceUpdate(this->child, 0); } } @@ -667,7 +667,7 @@ void sub_0803AC1C(Entity* this) { ptr = gUnk_080CED6C; index = ((this->parent->field_0xf >> 4) + 3); - this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; + this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; if (sub_0803B4E4(this)) { sub_0803B59C(this); } else { @@ -681,7 +681,7 @@ void sub_0803AC60(Entity* this) { ptr = gUnk_080CED6C; index = ((this->parent->field_0xf >> 4) + 3); - this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; + this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; GetNextFrame(this); if (!this->actionDelay) { if (sub_0803B4E4(this) != 0) { @@ -707,14 +707,14 @@ void sub_0803ACC0(Entity* this) { } break; case 1: - if (--this->height.HALF.HI * 0x10000 >> 0x10 < -0x20) { + if (--this->z.HALF.HI * 0x10000 >> 0x10 < -0x20) { this->subAction = 2; } break; case 2: - uVar2 = this->height.HALF.HI += 4; + uVar2 = this->z.HALF.HI += 4; if (-1 < (uVar2 * 0x10000)) { - this->height.HALF.HI = 0; + this->z.HALF.HI = 0; this->actionDelay = 0xc; this->subAction = 3; sub_08080964(8, 0); @@ -728,15 +728,15 @@ void sub_0803ACC0(Entity* this) { } break; case 4: - uVar2 = this->height.HALF.HI -= 2; + uVar2 = this->z.HALF.HI -= 2; if (uVar2 * 0x10000 >> 0x10 < -0x28) { this->subAction = 5; } break; case 5: - uVar2 = this->height.HALF.HI += 4; + uVar2 = this->z.HALF.HI += 4; if (-1 < (uVar2 * 0x10000)) { - this->height.HALF.HI = 0; + this->z.HALF.HI = 0; this->action = 0x1a; this->actionDelay = 0x3c; sub_08080964(0x1e, 0); @@ -752,10 +752,10 @@ void sub_0803ACC0(Entity* this) { void sub_0803ADAC(Entity* this) { if (--this->actionDelay == 0) { this->action = 0x16; - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; (*(Entity**)&this->field_0x74)->flags |= 0x80; InitializeAnimation(this, 0xb); - InitAnimationForceUpdate(this->attachedEntity, 6); + InitAnimationForceUpdate(this->child, 6); sub_0803B798(); } else { sub_0803B824(this); @@ -768,13 +768,13 @@ void sub_0803ADF4(Entity* this) { ptr = gUnk_080CED6C; index = ((this->parent->field_0xf >> 4) + 3); - this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; + this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; UpdateAnimationSingleFrame(this); GetNextFrame(this); - if ((this->frames.all & 0x80) != 0) { + if ((this->frame & 0x80) != 0) { this->action = 0x1c; this->actionDelay = 0x1e; - this->spriteSettings.b.draw = 0; + this->spriteSettings.draw = 0; } } @@ -784,11 +784,11 @@ void sub_0803AE48(Entity* this) { ptr = gUnk_080CED6C; index = ((this->parent->field_0xf >> 4) + 3); - this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; + this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; UpdateAnimationSingleFrame(this); if (((this->actionDelay == 0) || (--this->actionDelay == 0)) && ((this->parent->field_0x7c.BYTES.byte1 & 3) != 0)) { this->action = 0x1d; - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; InitializeAnimation(this, 4); } else { if (sub_0803B4E4(this) == 0) { @@ -803,10 +803,10 @@ void sub_0803AEC4(Entity* this) { ptr = gUnk_080CED6C; index = ((this->parent->field_0xf >> 4) + 3); - this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; + this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; UpdateAnimationSingleFrame(this); GetNextFrame(this); - if ((this->frames.all & 0x80) != 0) { + if ((this->frame & 0x80) != 0) { COLLISION_ON(this); sub_0803B59C(this); } @@ -816,21 +816,21 @@ void sub_0803AF18(Entity* this) { this->action = 0x1f; COLLISION_OFF(this); InitializeAnimation(this, 5); - this->height.HALF.HI = gUnk_080CED6C[(this->parent->field_0xf >> 4) & 7] + 4; + this->z.HALF.HI = gUnk_080CED6C[(this->parent->field_0xf >> 4) & 7] + 4; } void sub_0803AF50(Entity* this) { GetNextFrame(this); - if ((this->frames.all & 0x80) != 0) { + if ((this->frame & 0x80) != 0) { this->action = 0x20; - this->spriteSettings.b.draw = 0; - InitAnimationForceUpdate(this->attachedEntity, 8); + this->spriteSettings.draw = 0; + InitAnimationForceUpdate(this->child, 8); } } void sub_0803AF7C(Entity* this) { sub_0803B55C(this); - if ((this->attachedEntity->frames.all & 0x80) != 0) { + if ((this->child->frame & 0x80) != 0) { this->action = 0x21; this->actionDelay = 0xf; } @@ -840,8 +840,8 @@ void sub_0803AF9C(Entity* this) { if (this->actionDelay != 0) { this->actionDelay--; } else { - if (-0x20 < this->height.HALF.HI) { - this->height.HALF.HI -= 2; + if (-0x20 < this->z.HALF.HI) { + this->z.HALF.HI -= 2; } else { this->action = 0x22; this->actionDelay = 10; @@ -856,13 +856,13 @@ void sub_0803AFC8(Entity* this) { } void sub_0803AFE0(Entity* this) { - if (this->height.HALF.HI < 0) { - this->height.HALF.HI += 4; + if (this->z.HALF.HI < 0) { + this->z.HALF.HI += 4; } else { this->action = 0x24; this->actionDelay = 0xf0; *(u8*)&this->cutsceneBeh = 3; - this->height.HALF.HI = 0; + this->z.HALF.HI = 0; sub_08080964(0xa0, 0); SoundReq(SFX_158); } @@ -879,11 +879,11 @@ void sub_0803B01C(Entity* this) { } void sub_0803B04C(Entity* this) { - if (this->height.HALF.HI > -6) { - this->height.HALF.HI--; + if (this->z.HALF.HI > -6) { + this->z.HALF.HI--; } else { this->action = 0x26; - InitAnimationForceUpdate(this->attachedEntity, 6); + InitAnimationForceUpdate(this->child, 6); } } @@ -893,20 +893,20 @@ void sub_0803B074(Entity* this) { ptr = gUnk_080CED6C; index = ((this->parent->field_0xf >> 4) + 3); - this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; + this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; sub_0803B55C(this); - if ((this->attachedEntity->frames.all & 0x80) != 0) { + if ((this->child->frame & 0x80) != 0) { this->action = 0x27; - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; InitializeAnimation(this, 4); - InitAnimationForceUpdate(this->attachedEntity, 0); + InitAnimationForceUpdate(this->child, 0); } } void sub_0803B0D4(Entity* this) { UpdateAnimationSingleFrame(this); GetNextFrame(this); - if ((this->frames.all & 0x80) != 0) { + if ((this->frame & 0x80) != 0) { COLLISION_ON(this); sub_0803B59C(this); } @@ -916,7 +916,7 @@ void sub_0803B100(Entity* this) { Entity* temp; this->action = 0x29; - this->hVelocity = 0x14000; + this->zVelocity = 0x14000; if (this->type == 0) { this->hitbox = &gUnk_080FD364; } else { @@ -925,12 +925,12 @@ void sub_0803B100(Entity* this) { temp = *(Entity**)&this->field_0x74; temp->action = 3; temp->field_0x74.HALF.LO = 0x20; - InitAnimationForceUpdate(this->attachedEntity, 9); + InitAnimationForceUpdate(this->child, 9); SoundReq(SFX_14F); } void sub_0803B144(Entity* this) { - UpdateAnimationSingleFrame(this->attachedEntity); + UpdateAnimationSingleFrame(this->child); if (sub_08003FC4(this, 0x2000) == 0) { this->action = 0x2a; InitializeAnimation(this, 0x16); @@ -941,11 +941,11 @@ void sub_0803B144(Entity* this) { void sub_0803B17C(Entity* this) { GetNextFrame(this); - if ((this->frames.all & 0x80) != 0) { + if ((this->frame & 0x80) != 0) { this->action = 0x2b; COLLISION_ON(this); this->hitType = 0x18; - this->currentHealth = 0xff; + this->health = 0xff; this->field_0x7c.HALF.HI = 600; } } @@ -954,14 +954,14 @@ void sub_0803B1B8(Entity* this) { Entity* temp; u16 val; - if ((this->frames.all & 0x80) == 0) { + if ((this->frame & 0x80) == 0) { GetNextFrame(this); - UpdateAnimationSingleFrame(this->attachedEntity); + UpdateAnimationSingleFrame(this->child); } - if (this->currentHealth < 0xf5) { + if (this->health < 0xf5) { this->action = 0x32; this->field_0x7c.HALF.HI = 0x5dc; - this->spriteSettings.b.draw = 0; + this->spriteSettings.draw = 0; this->hitType = 0x14; temp = CreateFx(this, FX_GIANT_EXPLOSION4, 0); if (temp != (Entity*)0x0) { @@ -982,7 +982,7 @@ void sub_0803B1B8(Entity* this) { if ((temp->field_0x80.HALF.LO & 0xc) == 0xc) { temp->action = 0xb; temp->actionDelay = 0x78; - temp->hVelocity = 0; + temp->zVelocity = 0; (*(Entity**)&temp->field_0x74)->field_0x7c.HALF_U.HI = 0x708; (*(Entity**)&temp->field_0x78)->field_0x7c.HALF_U.HI = 0x708; } @@ -997,9 +997,9 @@ void sub_0803B2D0(Entity* this) { Entity* entity; GetNextFrame(this); - if ((this->frames.all & 0x80) != 0) { + if ((this->frame & 0x80) != 0) { this->action = 0x2d; - this->spriteSettings.b.draw = 0; + this->spriteSettings.draw = 0; entity = *(Entity**)&this->field_0x74; entity->action = 2; entity->field_0x74.HALF.LO = 0; @@ -1012,7 +1012,7 @@ void sub_0803B30C(Entity* this) { Entity* entity; entity = *(Entity**)&this->field_0x74; - if ((entity->frames.all & 0x80) != 0) { + if ((entity->frame & 0x80) != 0) { this->action = 0x2e; sub_0803B8E8(this, 0x13); InitializeAnimation(entity, 0); @@ -1020,8 +1020,8 @@ void sub_0803B30C(Entity* this) { } void sub_0803B338(Entity* this) { - if (this->height.HALF.HI > -10) { - this->height.HALF.HI--; + if (this->z.HALF.HI > -10) { + this->z.HALF.HI--; } else { this->action = 0x2f; this->actionDelay = 0xf; @@ -1034,7 +1034,7 @@ void sub_0803B35C(Entity* this) { ptr = gUnk_080CED6C; index = ((this->parent->field_0xf >> 4) + 3); - this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; + this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; if (--this->actionDelay == 0) { this->action = 0x30; } @@ -1046,12 +1046,12 @@ void sub_0803B398(Entity* this) { ptr = gUnk_080CED6C; index = ((this->parent->field_0xf >> 4) + 3); - this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; + this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; if (sub_0803B4E4(this) != 0) { this->action = 0x31; - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; InitializeAnimation(this, 4); - InitAnimationForceUpdate(this->attachedEntity, 0); + InitAnimationForceUpdate(this->child, 0); } else { sub_0806F69C(this); } @@ -1065,9 +1065,9 @@ void sub_0803B3F4(Entity* this) { ptr = gUnk_080CED6C; index = ((this->parent->field_0xf >> 4) + 3); - this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; + this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; GetNextFrame(this); - if ((this->frames.all & 0x80) != 0) { + if ((this->frame & 0x80) != 0) { this->hitType = 0x17; if (this->type == 0) { this->hitbox = (Hitbox*)&gUnk_080FD35C; @@ -1114,7 +1114,7 @@ u32 sub_0803B4E4(Entity* this) { } void sub_0803B538(Entity* this) { - PositionRelative(this, this->attachedEntity, 0, -0x10000); + PositionRelative(this, this->child, 0, -0x10000); PositionRelative(this, *(Entity**)&this->field_0x74, 0, -0x20000); } @@ -1123,9 +1123,9 @@ void sub_0803B55C(Entity* this) { Entity* pEVar1; pEVar1 = *(Entity**)&this->field_0x74; - entity = this->attachedEntity; + entity = this->child; UpdateAnimationSingleFrame(entity); - if ((entity->frames.all & 0x10) != 0) { + if ((entity->frame & 0x10) != 0) { if (pEVar1->animIndex != 1) { InitializeAnimation(pEVar1, 1); } @@ -1157,7 +1157,7 @@ void sub_0803B5C0(Entity* this) { } else { temp = gUnk_080CFD0C[0x16 - direction]; } - if (this->frames.all != temp) { + if (this->frame != temp) { InitializeAnimation(this, temp); } } @@ -1229,8 +1229,8 @@ void sub_0803B798(void) { gPlayerState.field_0xa = 0; gPlayerState.flags &= 0xffef; gPlayerEntity.flags |= 0x80; - gPlayerEntity.hVelocity = 0x18000; - gPlayerEntity.height.HALF.HI = -10; + gPlayerEntity.zVelocity = 0x18000; + gPlayerEntity.z.HALF.HI = -10; gPlayerEntity.direction = 0x10; gPlayerEntity.animationState = 4; gPlayerEntity.spritePriority.b1 = 1; @@ -1256,11 +1256,11 @@ void sub_0803B824(Entity* this) { u32 sub_0803B870(Entity* this) { Entity* entity; - entity = this->attachedEntity; + entity = this->child; if ((entity->bitfield & 0x80) != 0 && (gPlayerState.flags & 0x10) != 0) { this->action = 0x18; this->actionDelay = 0x44; - this->spriteSettings.b.draw = 0; + this->spriteSettings.draw = 0; gPlayerEntity.flags = gPlayerEntity.flags & 0x7f; gPlayerEntity.iframes = -0x10; sub_0803B824(this); @@ -1276,7 +1276,7 @@ u32 sub_0803B870(Entity* this) { void sub_0803B8E8(Entity* this, u32 unk) { Entity* entity; - entity = this->attachedEntity; + entity = this->child; entity->hitType = unk; entity = (*(Entity**)&this->field_0x74); entity->hitType = unk; @@ -1289,14 +1289,14 @@ void sub_0803B8F8(Entity* this) { void sub_0803B910(Entity* this) { if (gScreenTransition.field_0x38 != 0) { this->action = 2; - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; *(u8*)&this->field_0x74 = 0; sub_0803BA8C(this, 10); } else { this->action = 1; *(u8*)&this->field_0x74 = 0x80; } - this->spriteSettings.b.flipX = (this->type - 2); + this->spriteSettings.flipX = (this->type - 2); InitializeAnimation(this, 0); CopyPositionAndSpriteOffset(this->parent, this); } @@ -1334,7 +1334,7 @@ void sub_0803B978(Entity* this) { break; case 4: this->subAction = 5; - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; this->spriteRendering.alphaBlend = 1; break; default: @@ -1393,7 +1393,7 @@ void sub_0803BA8C(Entity* this, u32 unk) { sub_0801D2B4(this, sVar2); (*(Entity**)&this->parent->field_0x78)->palette.b.b0 = this->palette.raw << 0x1c >> 0x1c; (*(Entity**)&this->parent->field_0x78)->palette.b.b4 = this->palette.b.b0; - this->parent->attachedEntity->palette.b.b0 = this->palette.raw << 0x1c >> 0x1c; - this->parent->attachedEntity->palette.b.b4 = this->palette.b.b0; + this->parent->child->palette.b.b0 = this->palette.raw << 0x1c >> 0x1c; + this->parent->child->palette.b.b4 = this->palette.b.b0; } } diff --git a/src/enemy/mazaalHand.c b/src/enemy/mazaalHand.c index 49c19820..c429e428 100644 --- a/src/enemy/mazaalHand.c +++ b/src/enemy/mazaalHand.c @@ -23,7 +23,7 @@ const Hitbox* const gUnk_080CEF58[] = { void MazaalHand(Entity* this) { if (this->action == 0) { this->action = 1; - this->spriteSettings.b.flipX = this->type; + this->spriteSettings.flipX = this->type; InitAnimationForceUpdate(this, 0); } sub_08035194(this); diff --git a/src/enemy/mazaalHead.c b/src/enemy/mazaalHead.c index 55199ec2..5de9aa38 100644 --- a/src/enemy/mazaalHead.c +++ b/src/enemy/mazaalHead.c @@ -132,7 +132,7 @@ void sub_08033F3C(Entity* this) { } else { this->action = 1; } - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; this->field_0x6c.HALF.HI |= 1; this->field_0x80.HALF.LO = 0; InitializeAnimation(this, 0); @@ -183,8 +183,8 @@ void sub_08033FFC(Entity* this) { } break; case 4: - this->height.WORD += -0x8000; - if (this->height.HALF.HI == -10) { + this->z.WORD += -0x8000; + if (this->z.HALF.HI == -10) { this->subAction = 5; this->field_0x80.HALF.HI = 1; } @@ -335,8 +335,8 @@ void sub_08034348(Entity* this) { if (this->field_0x7c.HALF_U.HI != 0) { this->field_0x7c.HALF.HI--; } else { - if (this->height.HALF.HI > -10) { - this->height.HALF.HI--; + if (this->z.HALF.HI > -10) { + this->z.HALF.HI--; } else { if (sub_080349D8(this) != 0) { this->field_0x80.HALF.HI = 1; @@ -351,7 +351,7 @@ void sub_0803438C(Entity* this) { const s8* pVar; if (this->actionDelay == 0) { - this->currentHealth = 0; + this->health = 0; } else { this->actionDelay--; if (this->actionDelay > 0xc0) { @@ -686,7 +686,7 @@ END_NONMATCH void sub_0803499C(Entity* this) { if (((this->field_0x80.HALF.LO & 0xc) != 0xc) && (this->field_0x80.HALF.HI != 0)) { - this->height.HALF.HI = gUnk_080CED6C[(++this->field_0xf >> 4) & 7]; + this->z.HALF.HI = gUnk_080CED6C[(++this->field_0xf >> 4) & 7]; } } @@ -739,8 +739,8 @@ void sub_08034A84(Entity* this) { } else { if (this->action == 0) { this->action = 1; - this->spriteSettings.b.draw = 1; - this->spriteSettings.b.flipX = 1; + this->spriteSettings.draw = 1; + this->spriteSettings.flipX = 1; InitializeAnimation(this, 0); } CopyPositionAndSpriteOffset(this->parent, this); @@ -764,7 +764,7 @@ void sub_08034B0C(Entity* this) { this->actionDelay--; } else { GetNextFrame(this); - if ((this->frames.all & 0x80) == 0) { + if ((this->frame & 0x80) == 0) { return; } this->action = 2; @@ -797,7 +797,7 @@ END_NONMATCH void sub_08034BA0(Entity* this) { GetNextFrame(this); - if ((this->frames.all & 0x80) != 0) { + if ((this->frame & 0x80) != 0) { this->parent->field_0x7c.HALF.HI = 0xff; DeleteEntity(this); } @@ -810,7 +810,7 @@ void sub_08034BC8(Entity* this) { } sub_0806FA90(this->parent, this, 0, 1); sub_0800445C(this); - if (this->height.HALF.HI == 0) { + if (this->z.HALF.HI == 0) { sub_08034C00(this); } } diff --git a/src/enemy/mazaalMacro.c b/src/enemy/mazaalMacro.c index 2edf3d96..fbb030b8 100644 --- a/src/enemy/mazaalMacro.c +++ b/src/enemy/mazaalMacro.c @@ -85,7 +85,7 @@ void sub_08034CC4(Entity* this) { SetTile(0x4022, COORD_TO_TILE(this), this->collisionLayer); entity = CreateEnemy(MAZAAL_MACRO, 2); if (entity != NULL) { - this->attachedEntity = entity; + this->child = entity; entity->parent = this; CopyPosition(this, entity); } @@ -137,8 +137,8 @@ void sub_08034E68(Entity* this) { ScriptExecutionContext* scriptExecutionContext; if (this->parent->next == NULL) { - if (this->spriteSettings.b.draw != 0) { - this->spriteSettings.b.draw = 0; + if (this->spriteSettings.draw != 0) { + this->spriteSettings.draw = 0; sub_08035120(this); } if (gScreenTransition.field_0x39 == 0) { @@ -187,7 +187,7 @@ void sub_08034F58(Entity* this) { } void sub_08034F70(Entity* this) { - this->currentHealth = gScreenTransition.field_0x39; + this->health = gScreenTransition.field_0x39; if (gScreenTransition.field_0x39 >= 0x3d) { this->type2 = 0; } else if (gScreenTransition.field_0x39 >= 0x1f) { @@ -199,38 +199,38 @@ void sub_08034F70(Entity* this) { void sub_08034FA0(Entity* this) { if (0 < this->iframes) { - this->attachedEntity->iframes = this->iframes; + this->child->iframes = this->iframes; sub_08080964(0xc, 1); } switch (this->type2) { case 0: - if (this->currentHealth < 0x3c) { + if (this->health < 0x3c) { gScreenTransition.field_0x39 = 0x3c; sub_08035050(this); return; } break; case 1: - if (this->currentHealth < 0x1e) { + if (this->health < 0x1e) { gScreenTransition.field_0x39 = 0x1e; sub_08035050(this); return; } break; default: - if (this->currentHealth == 0) { + if (this->health == 0) { sub_0807BA8C(COORD_TO_TILE(this), this->collisionLayer); } break; } - gScreenTransition.field_0x39 = this->currentHealth; + gScreenTransition.field_0x39 = this->health; } void sub_08035050(Entity* this) { Entity* entity; COLLISION_OFF(this); - this->currentHealth = 0; + this->health = 0; entity = CreateEnemy(VAATI_PROJECTILE, 0); if (entity != NULL) { entity->type2 = 1; diff --git a/src/enemy/miniFireballGuy.c b/src/enemy/miniFireballGuy.c index 930ed8f0..7f538b1b 100644 --- a/src/enemy/miniFireballGuy.c +++ b/src/enemy/miniFireballGuy.c @@ -24,8 +24,8 @@ void sub_080455D4(Entity* this) { void sub_080455E4(Entity* this) { if ((this != this->parent) && (this->parent != NULL)) { this->field_0x6c.HALF.LO &= 0x7f; - this->parent->attachedEntity = this->attachedEntity; - this->attachedEntity->parent = this->parent; + this->parent->child = this->child; + this->child->parent = this->parent; } sub_0804A7D4(this); } @@ -35,7 +35,7 @@ void nullsub_23(Entity* this) { void sub_08045618(Entity* this) { this->action = 1; - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; this->speed = 0x80; this->field_0x3c = this->field_0x3c | 0x10; sub_0804A720(this); @@ -53,7 +53,7 @@ void sub_08045654(Entity* this) { void sub_08045678(Entity* this) { - this->hVelocity = 0x1c000; + this->zVelocity = 0x1c000; if (this->actionDelay != 0) { this->actionDelay--; } else { diff --git a/src/enemy/miniSlime.c b/src/enemy/miniSlime.c index 68c1303a..521b52a8 100644 --- a/src/enemy/miniSlime.c +++ b/src/enemy/miniSlime.c @@ -32,8 +32,8 @@ void sub_0804525C(Entity* this) { Entity* parent = this->parent; if (this != parent && parent) { this->field_0x6c.HALF.LO &= 0x7f; - this->parent->attachedEntity = this->attachedEntity; - this->attachedEntity->parent = this->parent; + this->parent->child = this->child; + this->child->parent = this->parent; if (this->field_0x6c.HALF.HI & 0x40) ReplaceMonitoredEntity(this, parent); } @@ -45,7 +45,7 @@ void nullsub_22(void) { void sub_080452A4(Entity* this) { this->action = 1; - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; this->speed = 0x100; sub_0804A720(this); InitializeAnimation(this, 6); diff --git a/src/enemy/moldorm.c b/src/enemy/moldorm.c index 909f3792..25ae0111 100644 --- a/src/enemy/moldorm.c +++ b/src/enemy/moldorm.c @@ -31,17 +31,17 @@ void sub_08022BD4(Entity* this) { } void sub_08022BEC(Entity* this) { - if (this->field_0x7a.HALF.LO != this->currentHealth) + if (this->field_0x7a.HALF.LO != this->health) this->field_0x7a.HALF.HI = 30; - this->field_0x7a.HALF.LO = this->currentHealth; + this->field_0x7a.HALF.LO = this->health; this->actionDelay = 1; this->direction = this->knockbackDirection; this->animationState = ((this->direction + 2) & 0x1c) >> 2; this->frameIndex = this->animationState; - this->attachedEntity->iframes = this->iframes; + this->child->iframes = this->iframes; (*(Entity**)&this->field_0x7c)->iframes = this->iframes; (*(Entity**)&this->field_0x80)->iframes = this->iframes; sub_0804AA30(this, gUnk_080CBBA0); @@ -56,19 +56,19 @@ void sub_08022C58(Entity* this) { return; tail0 = CreateEnemy(MOLDORM, 1); - this->attachedEntity = tail0; + this->child = tail0; tail0->spritePriority.b0 = 5; tail0->parent = this; CopyPosition(this, tail0); tail1 = CreateEnemy(MOLDORM, 2); - tail0->attachedEntity = tail1; + tail0->child = tail1; tail1->spritePriority.b0 = 5; tail1->parent = this; CopyPosition(this, tail1); tail2 = CreateEnemy(MOLDORM, 3); - tail1->attachedEntity = tail2; + tail1->child = tail2; tail2->spritePriority.b0 = 5; tail2->parent = this; CopyPosition(this, tail2); @@ -79,14 +79,14 @@ void sub_08022C58(Entity* this) { this->field_0xf = 1; COLLISION_ON(this); this->parent = this; - this->attachedEntity = tail0; + this->child = tail0; *(Entity**)&this->field_0x7c = tail1; *(Entity**)&this->field_0x80 = tail2; this->direction = Random() & 0x1f; this->animationState = ((this->direction + 2) & 0x1c) >> 2; this->frameIndex = this->animationState; - this->field_0x7a.HALF.LO = this->currentHealth; + this->field_0x7a.HALF.LO = this->health; } void sub_08022D40(Entity* this) { diff --git a/src/enemy/moldworm.c b/src/enemy/moldworm.c index 9b53911f..7fb15f46 100644 --- a/src/enemy/moldworm.c +++ b/src/enemy/moldworm.c @@ -51,8 +51,8 @@ NONMATCH("asm/non_matching/moldworm/Moldworm.inc", void Moldworm(Entity* this)) } } - if (this->parent->field_0x7c.BYTES.byte0 != this->parent->field_0x7c.BYTES.byte1 && this->attachedEntity) { - ((u8*)&this->attachedEntity->field_0x78)[(this->parent->field_0x7c.BYTES.byte0 - 1) & 0xf] = + if (this->parent->field_0x7c.BYTES.byte0 != this->parent->field_0x7c.BYTES.byte1 && this->child) { + ((u8*)&this->child->field_0x78)[(this->parent->field_0x7c.BYTES.byte0 - 1) & 0xf] = (((this->x.HALF.HI - prevX + 8) & 0xf) << 4) | ((this->y.HALF.HI - prevY + 8U) & 0xf); } } @@ -80,11 +80,11 @@ void sub_080230E4(Entity* this) { } } - if (this->currentHealth == 0 && this->field_0x7c.BYTES.byte3 == 0 && this->action == 7) { + if (this->health == 0 && this->field_0x7c.BYTES.byte3 == 0 && this->action == 7) { CopyPosition(this, &gPlayerEntity); gPlayerEntity.flags = gPlayerEntity.flags | 0x80; - gPlayerEntity.spriteSettings.b.draw = 1; - gPlayerEntity.hVelocity = 0x18000; + gPlayerEntity.spriteSettings.draw = 1; + gPlayerEntity.zVelocity = 0x18000; gPlayerEntity.direction = 0xff; gPlayerEntity.iframes = -0x14; gPlayerState.jumpStatus = 0x41; @@ -106,32 +106,32 @@ void sub_080231BC(Entity* this) { if (gEntCount < 0x40) { Entity* ent; - ent = this->attachedEntity = CreateEnemy(MOLDWORM, 1); + ent = this->child = CreateEnemy(MOLDWORM, 1); ent->parent = this; - ent = ent->attachedEntity = CreateEnemy(MOLDWORM, 2); + ent = ent->child = CreateEnemy(MOLDWORM, 2); ent->parent = this; - ent = ent->attachedEntity = CreateEnemy(MOLDWORM, 3); + ent = ent->child = CreateEnemy(MOLDWORM, 3); ent->parent = this; - ent = ent->attachedEntity = CreateEnemy(MOLDWORM, 4); + ent = ent->child = CreateEnemy(MOLDWORM, 4); ent->parent = this; - ent = ent->attachedEntity = CreateEnemy(MOLDWORM, 5); + ent = ent->child = CreateEnemy(MOLDWORM, 5); ent->parent = this; - ent = ent->attachedEntity = CreateEnemy(MOLDWORM, 6); + ent = ent->child = CreateEnemy(MOLDWORM, 6); ent->parent = this; - ent = ent->attachedEntity = CreateEnemy(MOLDWORM, 7); + ent = ent->child = CreateEnemy(MOLDWORM, 7); ent->parent = this; - ent->attachedEntity = CreateEnemy(MOLDWORM, 8); - *(Entity**)&ent->attachedEntity->field_0x74 = ent; - ent = ent->attachedEntity; + ent->child = CreateEnemy(MOLDWORM, 8); + *(Entity**)&ent->child->field_0x74 = ent; + ent = ent->child; ent->parent = this; - ent->attachedEntity = NULL; + ent->child = NULL; sub_0804A720(this); this->action = 6; this->actionDelay = 0x1e; @@ -167,7 +167,7 @@ void sub_08023288(Entity* this) { void sub_08023330(Entity* this) { GetNextFrame(this); - if (this->frames.all & 0x80) { + if (this->frame & 0x80) { this->action = 4; this->actionDelay = 0x19; COLLISION_ON(this); @@ -177,7 +177,7 @@ void sub_08023330(Entity* this) { this->field_0x7a.HALF.HI = 0; this->field_0x7c.BYTES.byte3 = 0; sub_08023A88(this, this->animationState); - CopyPosition(this, this->attachedEntity); + CopyPosition(this, this->child); CreateFx(this, FX_ROCK, 0); } } @@ -198,7 +198,7 @@ void sub_08023398(Entity* this) { this->field_0x7c.BYTES.byte3 = 0; COLLISION_OFF(this); this->hitType = 0x85; - this->attachedEntity->actionDelay = 1; + this->child->actionDelay = 1; sub_08023A68(this); CreateFx(this, FX_ROCK, 0); return; @@ -239,7 +239,7 @@ void sub_080234A4(Entity* this) { GetNextFrame(this); if (this->field_0x7c.BYTES.byte3) { this->action = 6; - this->spriteSettings.b.draw = 0; + this->spriteSettings.draw = 0; this->field_0x78.HWORD = 300; } } @@ -257,9 +257,9 @@ void sub_080234D8(Entity* this) { void sub_0802351C(Entity* this) { if (this->actionDelay != 0 && (this->type2 == 1 || gPlayerEntity.frameIndex == 0xff)) { this->actionDelay = 0; - this->attachedEntity->action = 3; - this->attachedEntity->field_0xf = this->field_0x80.HALF.LO; - InitializeAnimation(this->attachedEntity, this->attachedEntity->animationState + 1); + this->child->action = 3; + this->child->field_0xf = this->field_0x80.HALF.LO; + InitializeAnimation(this->child, this->child->animationState + 1); InitializeAnimation(this, this->animationState); } @@ -300,7 +300,7 @@ void sub_08023604(Entity* this) { this->action = 2; this->actionDelay = 0; COLLISION_ON(this); - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; sub_08023644(this); } } @@ -312,8 +312,8 @@ void sub_08023644(Entity* this) { this->y.HALF.HI == parent->y.HALF.HI) { this->action = 1; COLLISION_OFF(this); - this->spriteSettings.b.draw = 0; - this->attachedEntity->actionDelay = 1; + this->spriteSettings.draw = 0; + this->child->actionDelay = 1; sub_080239F0(this); } @@ -330,9 +330,9 @@ void sub_08023644(Entity* this) { void sub_080236F8(Entity* parent) { if (--parent->field_0xf == 0) { parent->action = 2; - parent->attachedEntity->action = 3; - parent->attachedEntity->field_0xf = parent->parent->field_0x80.HALF.LO; - InitializeAnimation(parent->attachedEntity, parent->attachedEntity->animationState + 1); + parent->child->action = 3; + parent->child->field_0xf = parent->parent->field_0x80.HALF.LO; + InitializeAnimation(parent->child, parent->child->animationState + 1); InitializeAnimation(parent, parent->animationState); } } @@ -356,8 +356,8 @@ void sub_08023748(Entity* this) { void sub_0802376C(Entity* this) { Entity* parent = this->parent; - if (parent->spriteSettings.b.draw == 1 && parent->animIndex < 0x10) { - this->spriteSettings.b.draw = 1; + if (parent->spriteSettings.draw == 1 && parent->animIndex < 0x10) { + this->spriteSettings.draw = 1; GetNextFrame(this); } @@ -378,7 +378,7 @@ void sub_080237D8(Entity* this) { this->y.HALF.HI == parent->y.HALF.HI) { this->action = 1; COLLISION_OFF(this); - this->spriteSettings.b.draw = 0; + this->spriteSettings.draw = 0; parent->field_0x7c.BYTES.byte3 = 1; sub_080239F0(this); sub_08023A68(this); @@ -415,33 +415,33 @@ void sub_08023894(Entity* this) { void sub_0802390C(Entity* this) { if (this->bitfield & 0x80) { - Entity* ent = this->attachedEntity; + Entity* ent = this->child; do { ent->iframes = this->iframes; - } while (ent = ent->attachedEntity, ent != NULL); + } while (ent = ent->child, ent != NULL); } else { - Entity* ent = this->attachedEntity; + Entity* ent = this->child; do { if (ent->bitfield & 0x80) { - u8 bVar2 = 0xff - ent->currentHealth; + u8 bVar2 = 0xff - ent->health; if (bVar2 != 0) { u32 tmp; - ent->currentHealth = 0xff; + ent->health = 0xff; tmp = (u8)ent->iframes; - if (this->currentHealth >= bVar2) { - this->currentHealth -= bVar2; + if (this->health >= bVar2) { + this->health -= bVar2; } else { - this->currentHealth = 0; + this->health = 0; } ent = this; do { ent->iframes = tmp; - } while (ent = ent->attachedEntity, ent != NULL); + } while (ent = ent->child, ent != NULL); break; } } - } while (ent = ent->attachedEntity, ent != NULL); + } while (ent = ent->child, ent != NULL); } } @@ -449,7 +449,7 @@ void sub_08023990(Entity* this, u32 param_2, u32 param_3) { Entity* ent; this->action = 3; - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; this->palette.b.b0 = 0x5; this->palette.b.b4 = 0x5; this->spritePriority.b0 = 7; @@ -459,11 +459,11 @@ void sub_08023990(Entity* this, u32 param_2, u32 param_3) { UpdateSpriteForCollisionLayer(this); InitializeAnimation(this, 0x16); - ent = this->attachedEntity; + ent = this->child; do { sub_080239F0(ent); CopyPosition(this, ent); - } while (ent = ent->attachedEntity, ent != NULL); + } while (ent = ent->child, ent != NULL); } /* TODO: fix struct */ diff --git a/src/enemy/octorok.c b/src/enemy/octorok.c index 53794388..9ca40e32 100644 --- a/src/enemy/octorok.c +++ b/src/enemy/octorok.c @@ -84,7 +84,7 @@ void sub_0801EB9C(Entity* this) { COLLISION_ON(this); this->field_0x3a &= 0xfb; } else { - this->currentHealth = 0; + this->health = 0; } } @@ -125,7 +125,7 @@ void Octorok_Move(Entity* this) { void Octorok_ShootNut(Entity* this) { GetNextFrame(this); - if (this->frames.all & 1) { + if (this->frame & 1) { Entity* ent = CreateProjectileWithParent(this, 1, 0); if (ent) { const s8* off; @@ -133,13 +133,13 @@ void Octorok_ShootNut(Entity* this) { off = &gOctorokNutOffset[this->direction / 4]; ent->x.HALF.HI += off[0]; ent->y.HALF.HI += off[1]; - ent->height.HALF.HI = -3; - this->frames.all &= 0xfe; + ent->z.HALF.HI = -3; + this->frame &= 0xfe; EnqueueSFX(0x18d); } } - if (this->frames.all & 0x80) + if (this->frame & 0x80) Octorok_Pause(this); } diff --git a/src/enemy/peahat.c b/src/enemy/peahat.c index 6ac631b5..de45a52a 100644 --- a/src/enemy/peahat.c +++ b/src/enemy/peahat.c @@ -45,7 +45,7 @@ void Peahat(Entity* this) { void Peahat_OnTick(Entity* this) { gPeahatActions[this->action](this); if (this->field_0x80.HALF.HI) - this->height.HALF.HI = gPeahatFlightHeights[(this->field_0xf++ & 0x30) >> 4]; + this->z.HALF.HI = gPeahatFlightHeights[(this->field_0xf++ & 0x30) >> 4]; } void sub_0801FFDC(Entity* this) { @@ -54,7 +54,7 @@ void sub_0801FFDC(Entity* this) { Entity* ent = CreateEnemy(PEAHAT, PeahatForm_Propeller); if (ent) { CopyPosition(this, ent); - ent->height.HALF.HI -= 8; + ent->z.HALF.HI -= 8; } this->field_0x82.HALF.LO = 0; this->animationState = PeahatAnimation_SlicedPropeller; @@ -127,7 +127,7 @@ void sub_08020104(Entity* this) { COLLISION_ON(this); this->field_0x3a &= 0xfb; } else { - this->currentHealth = 0; + this->health = 0; } } @@ -241,7 +241,7 @@ void Peahat_Stunned(Entity* this) { break; case PeahatAnimation_SlicedPropeller: sub_08003FC4(this, 0x1c00); - if (this->height.HALF.HI == 0) { + if (this->z.HALF.HI == 0) { this->action = 7; this->actionDelay = 150; this->field_0xf = 10; @@ -260,7 +260,7 @@ void Peahat_RepairPropeller(Entity* this) { return; this->action = 9; - this->hVelocity = 0x18000; + this->zVelocity = 0x18000; this->direction = Random() & 0x1f; sub_0804AA1C(this); this->animationState = PeahatAnimation_RepairPropeller; @@ -284,9 +284,9 @@ void Peahat_Recover(Entity* this) { void Peahat_Hop(Entity* this) { GetNextFrame(this); if (--this->actionDelay == 0) { - if (this->frames.all & 0x80) { + if (this->frame & 0x80) { this->action = 9; - this->hVelocity = 0x18000; + this->zVelocity = 0x18000; this->animationState = PeahatAnimation_NewPropeller; InitializeAnimation(this, this->animationState); } else { @@ -294,12 +294,12 @@ void Peahat_Hop(Entity* this) { } } - if (this->frames.all & 2) { - this->frames.all &= ~2; + if (this->frame & 2) { + this->frame &= ~2; this->direction = Random() & 0x1f; } - if (this->frames.all & 1) { + if (this->frame & 1) { sub_0800442E(this); } else { ProcessMovement(this); @@ -308,14 +308,14 @@ void Peahat_Hop(Entity* this) { void Peahat_Takeoff(Entity* this) { GetNextFrame(this); - if (this->frames.all & 0x80) { + if (this->frame & 0x80) { this->action = 1; this->hitType = 0x70; this->field_0x82.HALF.LO = 1; this->field_0x80.HALF.HI = 1; this->animationState = PeahatAnimation_Flying; InitializeAnimation(this, this->animationState); - } else if (this->frames.all & 1) { + } else if (this->frame & 1) { sub_0800442E(this); } else { sub_08003FC4(this, 0x1c00); @@ -327,10 +327,10 @@ void PeahatPropeller_Initialize(Entity* this) { this->action = 1; this->actionDelay = 240; this->field_0xf = 40; - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; this->spriteRendering.b3 = 1; this->spriteOrientation.flipY = 1; - this->spriteSettings.b.shadow = 0; + this->spriteSettings.shadow = 0; this->speed = 0x20; this->direction = (Random() & 0x10) + 8; InitializeAnimation(this, PeahatAnimation_Propeller); @@ -342,9 +342,9 @@ void PeahatPropeller_Fly(Entity* this) { DeleteEntity(this); } else { if (this->actionDelay < 60) - this->spriteSettings.b.draw ^= 1; + this->spriteSettings.draw ^= 1; - this->height.WORD -= 0xc000; + this->z.WORD -= 0xc000; sub_0806F69C(this); if (--this->field_0xf == 0) { this->field_0xf = 40; diff --git a/src/enemy/pesto.c b/src/enemy/pesto.c index 6ee4a4da..3f0e0c51 100644 --- a/src/enemy/pesto.c +++ b/src/enemy/pesto.c @@ -56,7 +56,7 @@ void sub_08023F5C(Entity* this) { if ((this->field_0x82.HALF.HI & 0xf) == 3 && this->action == 6) { switch (this->field_0x80.HALF.LO) { case 1: - this->height.HALF.HI = -0x10; + this->z.HALF.HI = -0x10; this->field_0x82.HALF.LO = 0; this->field_0x78.HWORD = -0x10; this->field_0x80.HALF.LO += 1; @@ -68,7 +68,7 @@ void sub_08023F5C(Entity* this) { } } } else { - this->currentHealth = 0; + this->health = 0; } sub_0804AA30(this, gUnk_080CBEC4); @@ -122,7 +122,7 @@ void nullsub_138(Entity* this) { } void sub_0802409C(Entity* this) { - this->currentHealth = 0; + this->health = 0; InitializeAnimation(this, this->animationState); CreateDust(this); } @@ -142,11 +142,11 @@ void sub_080240B8(Entity* this) { switch (this->type) { case 0: this->field_0x78.HWORD = -0x10; - this->height.HALF.HI = -0x10; + this->z.HALF.HI = -0x10; break; case 1: this->field_0x78.HWORD = -0x30; - this->height.HALF.HI = -0x30; + this->z.HALF.HI = -0x30; break; } @@ -172,7 +172,7 @@ void sub_080240B8(Entity* this) { this->field_0x82.HALF.HI = 0; ent = CreateProjectileWithParent(this, 6, this->field_0x82.HALF.HI); if (ent) { - this->attachedEntity = ent; + this->child = ent; ent->parent = this; ent->y.HALF.HI += 0x10; } @@ -274,7 +274,7 @@ void sub_080243B8(Entity* this) { switch (this->field_0x80.HALF.LO) { case 0: if (sub_08024C48(this, TRUE)) { - if (this->attachedEntity == NULL || this->attachedEntity->next == NULL) { + if (this->child == NULL || this->child->next == NULL) { this->field_0x80.HALF.LO = 2; this->actionDelay = 0x20; this->speed = 0x80; @@ -284,7 +284,7 @@ void sub_080243B8(Entity* this) { this->actionDelay = 0x1e; this->speed = 0x100; this->field_0x82.HALF.HI = 0x80; - this->attachedEntity->action = 2; + this->child->action = 2; } else if (--this->actionDelay) { if (--this->field_0xf == 0) { sub_08024A14(this, 2, (this->actionDelay >> 6) + 1); @@ -354,7 +354,7 @@ void sub_080244E8(Entity* this) { } break; case 1: - if (++this->height.HALF.HI >= -0x10) { + if (++this->z.HALF.HI >= -0x10) { this->field_0x82.HALF.LO = 0; this->field_0x78.HWORD = 0xfff0; if (sub_08024AD8(this)) { @@ -375,7 +375,7 @@ void sub_080244E8(Entity* this) { } else { sub_08024E1C(this); } - this->direction = GetFacingDirection(this, this->attachedEntity); + this->direction = GetFacingDirection(this, this->child); sub_08024E00(this, 0); sub_080249DC(this); } else if (--this->field_0xf == 0) { @@ -403,44 +403,44 @@ void sub_080244E8(Entity* this) { } break; case 1: - if (sub_080041A0(this, this->attachedEntity, 6, 6)) { + if (sub_080041A0(this, this->child, 6, 6)) { Entity* ent; this->field_0x80.HALF.LO += 1; this->actionDelay = 0xc; this->field_0x82.HALF.HI &= ~0x80; - CopyPosition(this->attachedEntity, this); - this->height.HALF.HI -= 0xe; + CopyPosition(this->child, this); + this->z.HALF.HI -= 0xe; this->field_0x78.HWORD -= 0xe; ent = CreateProjectileWithParent(this, 6, this->field_0x82.HALF.HI); if (ent) { ent->parent = this; - ent->height.HALF.HI += 0xe; - ent->attachedEntity = this->attachedEntity; - CopyPosition(ent, ent->attachedEntity); - this->attachedEntity = ent; + ent->z.HALF.HI += 0xe; + ent->child = this->child; + CopyPosition(ent, ent->child); + this->child = ent; } } break; case 2: - if (sub_080041A0(this, this->attachedEntity, 6, 6)) { + if (sub_080041A0(this, this->child, 6, 6)) { Entity* ent; this->field_0x80.HALF.LO += 1; this->actionDelay = 0xc; this->field_0x82.HALF.HI &= ~0x80; - ent = this->attachedEntity; + ent = this->child; SetTile((u16)ent->field_0x70.HALF.LO, COORD_TO_TILE(ent), ent->collisionLayer); DeleteEntity(ent); - this->height.HALF.HI -= 0xe; + this->z.HALF.HI -= 0xe; this->field_0x78.HWORD -= 0xe; ent = CreateProjectileWithParent(this, 6, this->field_0x82.HALF.HI); if (ent) { ent->parent = this; - ent->height.HALF.HI += 0xe; - this->attachedEntity = ent; + ent->z.HALF.HI += 0xe; + this->child = ent; } } break; @@ -460,14 +460,14 @@ void sub_080244E8(Entity* this) { } break; case 4: - this->height.HALF.HI -= 2; - if (-60 > this->height.HALF.HI) { + this->z.HALF.HI -= 2; + if (-60 > this->z.HALF.HI) { this->field_0x80.HALF.LO++; } break; case 5: - if (this->height.HALF.HI < -0x30) { - this->height.HALF.HI++; + if (this->z.HALF.HI < -0x30) { + this->z.HALF.HI++; } else { if (this->field_0x82.HALF.LO != 0) { this->field_0x82.HALF.LO = 0; @@ -511,7 +511,7 @@ void sub_080244E8(Entity* this) { } break; case 7: - if (gPlayerEntity.height.HALF.HI == 0) { + if (gPlayerEntity.z.HALF.HI == 0) { this->field_0x80.HALF.LO = 0; this->speed = 0x80; sub_08024B38(this); @@ -532,9 +532,9 @@ void sub_08024940(Entity* this) { } if (this->field_0x82.HALF.LO == 0) { - this->height.HALF.HI = this->field_0x78.HWORD; + this->z.HALF.HI = this->field_0x78.HWORD; if (random) - this->height.HALF.HI += 2; + this->z.HALF.HI += 2; } if (this->type2 != 0 || CheckIsDungeon()) { @@ -543,7 +543,7 @@ void sub_08024940(Entity* this) { sub_080249F4(this); } - if (this->height.HALF.HI < -0x20) { + if (this->z.HALF.HI < -0x20) { this->spritePriority.b0 = 0; } else { this->spritePriority.b0 = 1; @@ -579,7 +579,7 @@ void sub_08024A14(Entity* this, u32 param_2, u32 param_3) { break; case 1: if (sub_08024C48(this, FALSE)) { - sub_08004596(this, GetFacingDirection(this, this->attachedEntity)); + sub_08004596(this, GetFacingDirection(this, this->child)); unk = TRUE; } break; @@ -614,8 +614,8 @@ bool32 sub_08024AD8(Entity* this) { u8 unk = FALSE; if ((this->field_0x82.HALF.HI & 0x3f) == 3) { if (gPlayerState.hurtBlinkSpeed == 0) { - this->attachedEntity->parent = NULL; - this->attachedEntity = NULL; + this->child->parent = NULL; + this->child = NULL; this->field_0x82.HALF.HI = 0xc0; return FALSE; } @@ -623,7 +623,7 @@ bool32 sub_08024AD8(Entity* this) { } if (sub_08024C48(this, unk) == 0) { - this->attachedEntity = NULL; + this->child = NULL; this->field_0x82.HALF.HI = 0xc0; return FALSE; } @@ -649,13 +649,13 @@ bool32 sub_08024B38(Entity* this) { if (gPlayerState.hurtBlinkSpeed != 0) { if (sub_08024C48(this, 1) && sub_08049F1C(this, gUnk_020000B0, 0xa0)) { iVar4 = 1; - this->attachedEntity = gUnk_020000B0; + this->child = gUnk_020000B0; this->field_0x82.HALF.HI |= 3; this->field_0x82.HALF.HI &= ~0x40; } if (iVar4 == 0) { - this->attachedEntity = NULL; + this->child = NULL; } return iVar4; } @@ -664,9 +664,9 @@ bool32 sub_08024B38(Entity* this) { ent = FindEntityByID(8, 2, 2); if (ent) { do { - if (ent->action != 2 && ent->height.HALF.HI == 0 && sub_08049F1C(this, ent, 0xa0)) { + if (ent->action != 2 && ent->z.HALF.HI == 0 && sub_08049F1C(this, ent, 0xa0)) { iVar4 = 1; - this->attachedEntity = ent; + this->child = ent; this->field_0x82.HALF.HI |= 1; this->field_0x82.HALF.HI &= ~0x40; break; @@ -683,7 +683,7 @@ bool32 sub_08024B38(Entity* this) { do { if (ent->action == 1 && sub_08049F1C(this, ent, 0xa0)) { iVar4 = 1; - this->attachedEntity = ent; + this->child = ent; this->field_0x82.HALF.HI |= 2; this->field_0x82.HALF.HI &= ~0x40; break; @@ -692,7 +692,7 @@ bool32 sub_08024B38(Entity* this) { } if (iVar4 == 0) { - this->attachedEntity = NULL; + this->child = NULL; } return iVar4; @@ -840,7 +840,7 @@ void sub_08024F50(Entity* this) { gPlayerEntity.direction = gPlayerEntity.animationState << 2; gPlayerEntity.speed = 0; gPlayerEntity.spritePriority.b1 = this->cutsceneBeh.HALF.HI; - gPlayerEntity.height.HALF.HI = gPlayerEntity.spriteOffsetY; + gPlayerEntity.z.HALF.HI = gPlayerEntity.spriteOffsetY; gPlayerEntity.spriteOffsetY = 0; this->flags2 |= 3; this->field_0x82.HALF.HI = 0xc0; diff --git a/src/enemy/puffstool.c b/src/enemy/puffstool.c index 4688d174..1d326ef1 100644 --- a/src/enemy/puffstool.c +++ b/src/enemy/puffstool.c @@ -72,8 +72,8 @@ void sub_08025020(Entity* this) { } this->action = 7; this->actionDelay = 0x3c; - if (0 < this->hVelocity) { - this->hVelocity = 0; + if (0 < this->zVelocity) { + this->zVelocity = 0; } this->iframes = -0xc; this->knockbackDuration = 0; @@ -200,7 +200,7 @@ void sub_080252E0(Entity* this) { this->action = 3; this->actionDelay = 0x1e; this->field_0xf = 0; - this->hVelocity = 0x18000; + this->zVelocity = 0x18000; InitializeAnimation(this, 1); } } @@ -209,11 +209,11 @@ void sub_0802538C(Entity* this) { if (this->actionDelay) { this->actionDelay--; } else { - if (this->frames.all == 0) { + if (this->frame == 0) { GetNextFrame(this); } else { sub_08003FC4(this, 0x2000); - if (this->hVelocity < 0x2000) { + if (this->zVelocity < 0x2000) { this->action = 4; InitializeAnimation(this, 2); } @@ -239,16 +239,16 @@ void sub_080253D4(Entity* this) { void sub_0802541C(Entity* this) { GetNextFrame(this); - if (this->frames.all & 0x80) { + if (this->frame & 0x80) { this->action = 3; this->field_0xf = 1; - this->hVelocity = 0x20000; + this->zVelocity = 0x20000; InitializeAnimation(this, 1); } } void sub_0802544C(Entity* this) { - if (this->frames.all == 0) { + if (this->frame == 0) { GetNextFrame(this); } else { if (--this->actionDelay == 0) { @@ -272,8 +272,8 @@ void sub_0802547C(Entity* this) { void sub_080254B4(Entity* this) { sub_08003FC4(this, 0x2000); - if (this->frames.all & 0x80) { - if (this->height.HALF.HI == 0) { + if (this->frame & 0x80) { + if (this->z.HALF.HI == 0) { if (this->cutsceneBeh.HWORD == 0) { this->hitType = 0x82; this->field_0x82.HALF.LO = -0x10; @@ -552,18 +552,18 @@ void sub_08025B18(Entity* this) { ent->x.HALF.HI += 8; ent->y.HALF.HI &= -0x10; ent->y.HALF.HI += 8; - ent->height.HALF.HI = -1; + ent->z.HALF.HI = -1; } } } void sub_08025BD4(Entity* this) { - if (this->field_0x82.HALF.LO && (this->frames.all & 1) == 0) { + if (this->field_0x82.HALF.LO && (this->frame & 1) == 0) { Entity* ent = CreateObject(OBJECT_21, 0, 0); if (ent) { PositionRelative(this, ent, gUnk_080CC0BA[this->animationState * 2 + 0] * 0x10000, gUnk_080CC0BA[this->animationState * 2 + 1] * 0x10000); - ent->height.HALF.HI = -10; + ent->z.HALF.HI = -10; } } } @@ -575,7 +575,7 @@ void sub_08025C2C(Entity* this) { } bool32 sub_08025C44(Entity* this) { - if ((this->frames.all & 1) == 0) { + if ((this->frame & 1) == 0) { return ProcessMovement(this); } else { return FALSE; diff --git a/src/enemy/rockChuchu.c b/src/enemy/rockChuchu.c index 3248714f..95e0a9c1 100644 --- a/src/enemy/rockChuchu.c +++ b/src/enemy/rockChuchu.c @@ -20,7 +20,7 @@ void sub_0802223C(Entity* this) { void sub_08022254(Entity* this) { Entity* ent; - if (this->currentHealth) { + if (this->health) { switch (this->bitfield & 0x7f) { case 4: case 5: @@ -51,9 +51,9 @@ void sub_08022254(Entity* this) { sub_0804A4E4(this, ent); this->action = 2; COLLISION_OFF(this); - this->spriteSettings.b.draw = 0; + this->spriteSettings.draw = 0; this->direction = this->knockbackDirection; - this->attachedEntity = ent; + this->child = ent; } } } else { @@ -97,7 +97,7 @@ void sub_08022390(Entity* this) { void sub_080223E4(Entity* this) { Entity* ent; - ent = this->attachedEntity; + ent = this->child; if (ent) { ent->bitfield = 0x94; ent->iframes = 0x10; diff --git a/src/enemy/rollobite.c b/src/enemy/rollobite.c index 3316e6e5..9815510f 100644 --- a/src/enemy/rollobite.c +++ b/src/enemy/rollobite.c @@ -30,11 +30,11 @@ void Rollobite_OnTick(Entity* this) { } void sub_08020668(Entity* this) { - if (this->hitType == 34 && this->currentHealth != 0xff) { + if (this->hitType == 34 && this->health != 0xff) { this->action = 4; - this->hVelocity = 0x20000; + this->zVelocity = 0x20000; this->direction = 0xff; - this->currentHealth = 0xff; + this->health = 0xff; this->hitType = 35; InitializeAnimation(this, this->animationState + 8); } @@ -102,7 +102,7 @@ void sub_080207A8(Entity* this) { this->spritePriority.b0 = 4; this->field_0x3a &= 0xfb; this->direction ^= 0x10; - this->hVelocity = 0x18000; + this->zVelocity = 0x18000; this->speed = 0x80; InitializeAnimation(this, this->animationState + 0x10); } @@ -118,14 +118,14 @@ void Rollobite_Initialize(Entity* this) { void Rollobite_Walk(Entity* this) { GetNextFrame(this); - if (this->frames.all & 0x1) { - this->frames.all &= ~0x1; + if (this->frame & 0x1) { + this->frame &= ~0x1; if (!ProcessMovement(this)) this->actionDelay = 1; } - if (this->frames.all & 0x10) { - this->frames.all &= ~0x10; + if (this->frame & 0x10) { + this->frame &= ~0x10; if (--this->actionDelay == 0) { this->action = 3; this->actionDelay = 60; @@ -172,7 +172,7 @@ void Rollobite_Turn(Entity* this) { void Rollobite_RolledUp(Entity* this) { u32 unk; - if ((this->frames.all & 0x80) == 0) + if ((this->frame & 0x80) == 0) GetNextFrame(this); unk = sub_080044EC(this, 0x2800); @@ -194,7 +194,7 @@ void Rollobite_RolledUp(Entity* this) { void Rollobite_Unroll(Entity* this) { GetNextFrame(this); - if (this->frames.all & 0x80) { + if (this->frame & 0x80) { COLLISION_ON(this); this->speed = 0x100; this->hitType = 34; @@ -202,7 +202,7 @@ void Rollobite_Unroll(Entity* this) { this->direction = DirectionFromAnimationState(this->animationState); InitializeAnimation(this, this->animationState); } else { - if ((this->frames.all & 1) == 0) + if ((this->frame & 1) == 0) sub_08078930(this); } } @@ -213,7 +213,7 @@ void Rollobite_LinedUp(Entity* this) { this->spritePriority.b0 = 7; } - if (this->frames.all == 0) + if (this->frame == 0) GetNextFrame(this); } @@ -252,7 +252,7 @@ void sub_08020A7C(Entity* this) { } bool32 Rollobite_TryToHoleUp(Entity* this) { - if (Rollobite_IsRolledUp(this) && this->height.HALF.HI == 0) { + if (Rollobite_IsRolledUp(this) && this->z.HALF.HI == 0) { int tile = COORD_TO_TILE(this); int iVar1 = GetTileType(tile, this->collisionLayer); if ((iVar1 * 0x10000 - 0x710000U) >> 0x10 < 2) { @@ -262,7 +262,7 @@ bool32 Rollobite_TryToHoleUp(Entity* this) { this->x.HALF.HI += 8; this->y.HALF.HI &= 0xfff0; this->y.HALF.HI += 13; - this->hVelocity = 0x20000; + this->zVelocity = 0x20000; InitializeAnimation(this, this->animationState + 0x14); SetTile(0x4034, tile, this->collisionLayer); return TRUE; diff --git a/src/enemy/rope.c b/src/enemy/rope.c index 1b196527..2c61fb03 100644 --- a/src/enemy/rope.c +++ b/src/enemy/rope.c @@ -67,8 +67,8 @@ void sub_08031434(Entity* this) { } else { this->action = 1; this->subAction = 0; - this->spriteSettings.b.draw = (this->spriteSettings.b.draw & 0xfc); - this->height.HALF.HI = -0x80; + this->spriteSettings.draw = (this->spriteSettings.draw & 0xfc); + this->z.HALF.HI = -0x80; this->frameIndex = 0xff; } } @@ -81,7 +81,7 @@ void sub_08031480(Entity* this) { sub_08031600(this); this->action = 1; this->subAction = 1; - this->spriteSettings.b.draw = 3; + this->spriteSettings.draw = 3; this->spriteRendering.b3 = 1; this->spriteOrientation.flipY = 1; SoundReq(SFX_12D); @@ -90,7 +90,7 @@ void sub_08031480(Entity* this) { if (sub_08003FC4(this, 0x1800) == 0) { this->action = 2; this->field_0xf = 0xf; - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; UpdateSpriteForCollisionLayer(this); EnqueueSFX(0x84); } diff --git a/src/enemy/rupeeLike.c b/src/enemy/rupeeLike.c index 04c87bba..05334d65 100644 --- a/src/enemy/rupeeLike.c +++ b/src/enemy/rupeeLike.c @@ -56,7 +56,7 @@ void sub_08029318(Entity* this) { if (*(u8*)(*(u32*)&this->field_0x4c + 8) == 1) { if (this->action == 2) { InitializeAnimation(this, 0); - InitializeAnimation(this->attachedEntity, 4); + InitializeAnimation(this->child, 4); } this->action = 4; this->actionDelay = 0x3c; @@ -84,7 +84,7 @@ void nullsub_141() { void sub_080293DC(Entity* this) { CopyPositionAndSpriteOffset(this->parent, this); this->y.HALF.HI++; - this->height.HALF.HI--; + this->z.HALF.HI--; gUnk_080CCC3C[this->action](this); } @@ -96,7 +96,7 @@ void sub_0802940C(Entity* this) { sub_0804A720(this); ent->parent = this; ent->type2 = 1; - this->attachedEntity = ent; + this->child = ent; this->field_0x80.HALF.HI = 0; this->cutsceneBeh.HALF.LO = 0; this->field_0x82.HALF.LO = this->palette.b.b0; @@ -115,17 +115,17 @@ void sub_08029474(Entity* this) { u32 bVar1; sub_080296C8(this); - if (this->frames.b.f3) { + if (this->frame & 0x80) { this->action = 3; this->actionDelay = 8; bVar1 = GetFacingDirection(this, &gPlayerEntity); this->direction = bVar1; this->animationState = (bVar1 << 0x18) >> 0x1c; InitializeAnimation(this, this->animationState); - InitializeAnimation(this->attachedEntity, this->animationState + 4); + InitializeAnimation(this->child, this->animationState + 4); } else { - if (this->frames.all == 1) { - this->frames.all = 0; + if (this->frame == 1) { + this->frame = 0; COLLISION_ON(this); } } @@ -144,7 +144,7 @@ void sub_080294D4(Entity* this) { this->action = 6; COLLISION_OFF(this); InitializeAnimation(this, 3); - InitializeAnimation(this->attachedEntity, 7); + InitializeAnimation(this->child, 7); } } @@ -189,9 +189,9 @@ void sub_08029610(Entity* this) { void sub_08029630(Entity* this) { sub_080296C8(this); - if ((this->frames.b.f3) != 0) { + if (this->frame & 0x80) { this->field_0x80.HALF.HI = 1; - this->attachedEntity->spriteSettings.b.draw = FALSE; + this->child->spriteSettings.draw = FALSE; sub_080297F0(this); } } @@ -219,23 +219,23 @@ void sub_0802969C(Entity* this) { if (bVar1 != this->animationState) { this->animationState = bVar1; InitializeAnimation(this, bVar1); - InitializeAnimation(this->attachedEntity, bVar1 + 4); + InitializeAnimation(this->child, bVar1 + 4); } } } void sub_080296C8(Entity* this) { GetNextFrame(this); - GetNextFrame(this->attachedEntity); + GetNextFrame(this->child); } void sub_080296D8(Entity* this) { gPlayerState.jumpStatus = 0x41; gPlayerState.flags &= 0xffffffef; gPlayerEntity.flags |= 0x80; - gPlayerEntity.hVelocity = 0x18000; + gPlayerEntity.zVelocity = 0x18000; gPlayerEntity.iframes = 0xa6; - gPlayerEntity.height.HALF.HI = -2; + gPlayerEntity.z.HALF.HI = -2; gPlayerEntity.direction = gPlayerEntity.animationState << 2; gPlayerEntity.spritePriority.b1 = this->field_0x80.HALF.LO; gPlayerEntity.spriteOffsetY = 0; @@ -260,8 +260,8 @@ void sub_08029770(Entity* this) { this->hitType = 0x8d; this->hitbox = &gUnk_080FD260; InitializeAnimation(this, 2); - this->attachedEntity->spriteSettings.b.draw = TRUE; - InitializeAnimation(this->attachedEntity, 6); + this->child->spriteSettings.draw = TRUE; + InitializeAnimation(this->child, 6); CreateDust(this); } } @@ -271,7 +271,7 @@ void sub_080297F0(Entity* this) { this->action = 1; this->actionDelay = 0x78; COLLISION_ON(this); - this->spriteSettings.b.draw = TRUE; + this->spriteSettings.draw = TRUE; this->hitType = 0x8e; sub_080AE068(this); #ifdef EU diff --git a/src/enemy/slime.c b/src/enemy/slime.c index 34f9cb55..92de7a7f 100644 --- a/src/enemy/slime.c +++ b/src/enemy/slime.c @@ -33,7 +33,7 @@ void sub_08044F70(Entity* this) { } void sub_08044F88(Entity* this) { - if ((this->currentHealth != 0) && (this->cutsceneBeh.HALF.LO != this->currentHealth)) { + if ((this->health != 0) && (this->cutsceneBeh.HALF.LO != this->health)) { this->action = 4; } else { sub_0804AA30(this, gUnk_080D16A4); @@ -49,7 +49,7 @@ void nullsub_171() { void sub_08044FC8(Entity* this) { this->action = 1; - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; this->speed = 128; sub_0804A720(this); InitializeAnimation(this, 0); @@ -59,7 +59,7 @@ void sub_08044FC8(Entity* this) { void sub_08044FF8(Entity* this) { this->action = 2; this->actionDelay = (Random() & 31) + 30; - this->cutsceneBeh.HALF.LO = this->currentHealth; + this->cutsceneBeh.HALF.LO = this->health; } void sub_08045018(Entity* this) { @@ -105,10 +105,10 @@ void sub_080450A8(Entity* this) { off = gUnk_080D16D4; for (i = 0; i < count; i++) { ent = entities[i]; - ent->attachedEntity = entities[(i + 1) % count]; + ent->child = entities[(i + 1) % count]; ent->parent = entities[(i + count - 1) % count]; ent->type2 = 1; - ent->height.HALF.HI = 0; + ent->z.HALF.HI = 0; ent->iframes = -0x10; /* Set MiniSlime offset relative to killed slime. */ diff --git a/src/enemy/sluggula.c b/src/enemy/sluggula.c index 21a9b985..d6361507 100644 --- a/src/enemy/sluggula.c +++ b/src/enemy/sluggula.c @@ -27,7 +27,7 @@ void Sluggula(Entity* this) { SetChildOffset(this, 0, 1, -0x10); } else if (this->type == 0) { - if (this->height.HALF.HI == 0) { + if (this->z.HALF.HI == 0) { u32 idx = sub_080012DC(this); if (idx != 0) { gUnk_080012C8[idx](this); @@ -75,7 +75,7 @@ void sub_08023C8C(Entity* this) { GetNextFrame(this); sub_08023E54(this); if (--this->actionDelay == 0) { - if (this->frames.all != 1) { + if (this->frame != 1) { this->actionDelay = 8; } else { this->actionDelay = (Random() & 0x30) + 0xb4; @@ -95,11 +95,11 @@ void sub_08023CE0(Entity* this) { if (this->actionDelay == 0) { this->actionDelay = 1; } - this->spriteSettings.b.draw = 3; + this->spriteSettings.draw = 3; } else { this->action = 1; } - this->height.HALF.HI = -0x80; + this->z.HALF.HI = -0x80; this->spriteRendering.b3 = 1; this->spriteOrientation.flipY = 1; InitializeAnimation(this, 6); @@ -110,7 +110,7 @@ void sub_08023CE0(Entity* this) { if (this->actionDelay == 0) { this->actionDelay = 8; } - this->spriteSettings.b.draw = 3; + this->spriteSettings.draw = 3; } break; case 2: @@ -121,23 +121,23 @@ void sub_08023CE0(Entity* this) { } } else if (!sub_08003FC4(this, 0x1800)) { this->action = 3; - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; EnqueueSFX(0x84); UpdateSpriteForCollisionLayer(this); } break; default: GetNextFrame(this); - if (this->frames.all) { - if (this->frames.all & 0x80) { + if (this->frame) { + if (this->frame & 0x80) { Entity* ent = CreateEnemy(SLUGGULA, 1); if (ent) { sub_0804A4E4(this, ent); DeleteThisEntity(); } } else { - this->y.HALF.HI += gUnk_080CBDF4[this->frames.all - 1]; - this->frames.all = 0; + this->y.HALF.HI += gUnk_080CBDF4[this->frame - 1]; + this->frame = 0; } } break; @@ -152,7 +152,7 @@ void sub_08023E10(Entity* this) { } GetNextFrame(this); - if (this->frames.all & 0x80) + if (this->frame & 0x80) DeleteEntity(this); } diff --git a/src/enemy/smallPesto.c b/src/enemy/smallPesto.c index 660a3110..3be1f047 100644 --- a/src/enemy/smallPesto.c +++ b/src/enemy/smallPesto.c @@ -87,17 +87,17 @@ void sub_08031770(Entity* this) { if (--this->field_0x80.HWORD == 0) { sub_08031840(this); } - } else if (this->attachedEntity == NULL) { + } else if (this->child == NULL) { this->field_0x80.HWORD = (Random() & 0x7f) | (0x80 << 2); } else { - if (this->attachedEntity->next == NULL) { - this->attachedEntity = NULL; + if (this->child->next == NULL) { + this->child = NULL; } } } void sub_080317B4(Entity* this) { - this->height.HALF.HI = ((Random() & 0x30) != 0) ? -0xc : -0xd; + this->z.HALF.HI = ((Random() & 0x30) != 0) ? -0xc : -0xd; sub_0806F69C(this); GetNextFrame(this); } @@ -110,7 +110,7 @@ void sub_080317E0(Entity* this) { void sub_080317F8(Entity* this) { u8 newDirection = Random() & 0x18; this->action = 1; - this->height.HALF.HI = 0x0000FFF4; + this->z.HALF.HI = 0x0000FFF4; this->collisionLayer = 1; this->field_0x3c |= 0x10; this->field_0x1c = 1; @@ -126,7 +126,7 @@ void sub_08031840(Entity* this) { if (enemy != NULL) { CopyPosition(this, enemy); enemy->parent = this; - this->attachedEntity = enemy; + this->child = enemy; enemy->type2 = 1; } } diff --git a/src/enemy/spark.c b/src/enemy/spark.c index 811bea88..cbbdb587 100644 --- a/src/enemy/spark.c +++ b/src/enemy/spark.c @@ -22,11 +22,11 @@ void sub_0802B2E0(Entity* this) { if ((this->bitfield & 0x7f) == 0x14) { COLLISION_OFF(this); this->iframes = 0; - this->spriteSettings.b.draw = 0; + this->spriteSettings.draw = 0; this->action = 2; ent = CreateFx(this, FX_DEATH, 0); if (ent) { - this->attachedEntity = ent; + this->child = ent; this->actionDelay = 14; CopyPosition(this, ent); } diff --git a/src/enemy/spearMoblin.c b/src/enemy/spearMoblin.c index 34beba3a..fa90d4f8 100644 --- a/src/enemy/spearMoblin.c +++ b/src/enemy/spearMoblin.c @@ -31,8 +31,8 @@ extern const Hitbox* const gUnk_080CC944[]; void SpearMoblin(Entity* this) { EnemyFunctionHandler(this, gUnk_080CC790); SetChildOffset(this, 0, 1, -0x20); - if (this->attachedEntity && this->attachedEntity->next) { - CopyPosition(this, this->attachedEntity); + if (this->child && this->child->next) { + CopyPosition(this, this->child); } } @@ -57,13 +57,13 @@ void sub_08028284(Entity* this) { } } - this->attachedEntity->iframes = this->iframes; - if (this->currentHealth == 0) { + this->child->iframes = this->iframes; + if (this->health == 0) { this->speed = 0; this->field_0x82.HALF.LO = 0; sub_080287E0(this); - DeleteEntity(this->attachedEntity); - this->attachedEntity = NULL; + DeleteEntity(this->child); + this->child = NULL; } } @@ -98,7 +98,7 @@ void sub_08028314(Entity* this) { pEVar2 = CreateProjectile(3); if (pEVar2 != NULL) { pEVar2->parent = this; - this->attachedEntity = pEVar2; + this->child = pEVar2; } } @@ -378,7 +378,7 @@ bool32 sub_080288A4(Entity* this) { } void sub_080288C0(Entity* this) { - Entity* ent = this->attachedEntity; + Entity* ent = this->child; if (ent && (ent->bitfield & 0x80)) { this->knockbackDirection = ent->knockbackDirection; this->iframes = -ent->iframes; diff --git a/src/enemy/spikedBeetle.c b/src/enemy/spikedBeetle.c index 9f3aa75f..89d9e031 100644 --- a/src/enemy/spikedBeetle.c +++ b/src/enemy/spikedBeetle.c @@ -49,7 +49,7 @@ void sub_0802B628(Entity* this) { case 0x1d: if (this->action < 6) { this->action = 6; - this->hVelocity = 0x18000; + this->zVelocity = 0x18000; this->speed = 0xc0; this->direction = this->knockbackDirection; this->knockbackDuration = 0; @@ -166,7 +166,7 @@ void sub_0802B8E0(Entity* this) { } } else { this->action = 8; - this->hVelocity = 0x10000; + this->zVelocity = 0x10000; this->speed = 0x60; this->hitType = 99; InitializeAnimation(this, this->animationState); diff --git a/src/enemy/spinyChuchu.c b/src/enemy/spinyChuchu.c index 56872a16..53ad12b3 100644 --- a/src/enemy/spinyChuchu.c +++ b/src/enemy/spinyChuchu.c @@ -32,7 +32,7 @@ void sub_08022434(Entity* this) { } void sub_0802244C(Entity* this) { - if (this->currentHealth) { + if (this->health) { if (this->hitType == 0x65) { switch (this->bitfield & 0x7f) { case 2: @@ -63,7 +63,7 @@ void sub_0802244C(Entity* this) { InitializeAnimation(this, 1); } - if (this->field_0x80.HALF.LO != this->currentHealth) { + if (this->field_0x80.HALF.LO != this->health) { this->action = 5; this->hitType = 0x5c; InitializeAnimation(this, 1); @@ -78,7 +78,7 @@ void sub_0802244C(Entity* this) { InitializeAnimation(this, 1); } - this->field_0x80.HALF.LO = this->currentHealth; + this->field_0x80.HALF.LO = this->health; sub_0804AA30(this, gUnk_080CBA28); } @@ -90,7 +90,7 @@ void sub_080225A0(Entity* this) { void sub_080225BC(Entity* this) { sub_08003FC4(this, 0x1800); - if (this->frames.all & 1) { + if (this->frame & 1) { sub_0804A7D4(this); } else { GetNextFrame(this); @@ -102,7 +102,7 @@ void nullsub_9(Entity* this) { void sub_080225EC(Entity* this) { sub_0804A720(this); - this->field_0x80.HALF.LO = this->currentHealth; + this->field_0x80.HALF.LO = this->health; this->field_0x80.HALF.HI = 0x5a; if (this->actionDelay == 0) { this->action = 2; @@ -110,10 +110,10 @@ void sub_080225EC(Entity* this) { } else { this->action = 1; this->field_0xf = 0x3c; - this->spriteSettings.b.draw = 3; + this->spriteSettings.draw = 3; this->spriteRendering.b3 = 1; this->spriteOrientation.flipY = 1; - this->height.HALF.HI = -0x80; + this->z.HALF.HI = -0x80; InitializeAnimation(this, 6); } } @@ -132,7 +132,7 @@ void sub_08022654(Entity* this) { return; this->subAction = 2; - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; InitializeAnimation(this, 5); EnqueueSFX(0x7d); UpdateSpriteForCollisionLayer(this); @@ -159,7 +159,7 @@ void sub_080226EC(Entity* this) { if (sub_080228F0(this)) { this->action = 6; - this->hVelocity = 0x12000; + this->zVelocity = 0x12000; this->speed = 0x140; this->direction = GetFacingDirection(this, gUnk_020000B0); this->hitType = 0x5a; @@ -179,7 +179,7 @@ void sub_080226EC(Entity* this) { void sub_08022780(Entity* this) { GetNextFrame(this); - if (this->frames.all & 0x80) { + if (this->frame & 0x80) { this->action = 4; InitializeAnimation(this, 3); EnqueueSFX(0x194); @@ -188,18 +188,18 @@ void sub_08022780(Entity* this) { void sub_080227AC(Entity* this) { GetNextFrame(this); - if (this->frames.all & 1) { + if (this->frame & 1) { this->hitbox = &gUnk_080FD470; } else { this->hitbox = &gUnk_080FD468; } - if (this->frames.all & 2) { - this->frames.all &= ~2; + if (this->frame & 2) { + this->frame &= ~2; this->hitType = 0x5c; } - if (this->frames.all & 0x80) { + if (this->frame & 0x80) { this->action = 2; this->field_0xf = gUnk_080CBA60[Random() & 3]; InitializeAnimation(this, 0); @@ -209,7 +209,7 @@ void sub_080227AC(Entity* this) { void sub_0802281C(Entity* this) { sub_08003FC4(this, 0x1800); GetNextFrame(this); - if (this->frames.all & 0x80) { + if (this->frame & 0x80) { this->action = 2; this->speed = 0x20; InitializeAnimation(this, 0); @@ -219,7 +219,7 @@ void sub_0802281C(Entity* this) { void sub_08022854(Entity* this) { GetNextFrame(this); - if (this->frames.all & 1) { + if (this->frame & 1) { sub_080AEFE0(this); if (sub_08003FC4(this, 0x1800) == 0) { this->action = 7; @@ -232,7 +232,7 @@ void sub_08022854(Entity* this) { void sub_0802289C(Entity* this) { GetNextFrame(this); - if (this->frames.all & 0x80) { + if (this->frame & 0x80) { this->action = 2; this->speed = 0x20; this->field_0x80.HALF.HI = 0x78; diff --git a/src/enemy/tektite.c b/src/enemy/tektite.c index 0a2367bd..a4f78704 100644 --- a/src/enemy/tektite.c +++ b/src/enemy/tektite.c @@ -38,16 +38,16 @@ void sub_0802F150(Entity* this) { } this->field_0xf = 0; *(u8*)&this->field_0x7c = 0; - if (this->height.HALF.HI != 0) { - this->hVelocity >>= 2; + if (this->z.HALF.HI != 0) { + this->zVelocity >>= 2; } else { - this->hVelocity = 0; + this->zVelocity = 0; } InitializeAnimation(this, 0); break; case 0xe: case 0x15: - this->currentHealth = 0; + this->health = 0; break; } } @@ -58,7 +58,7 @@ void nullsub_16(Entity* this) { void sub_0802F1F0(Entity* this) { sub_08001242(this); - if (this->height.HALF.HI != 0) { + if (this->z.HALF.HI != 0) { sub_08003FC4(this, this->field_0x80.HWORD); } } @@ -91,15 +91,15 @@ void sub_0802F284(Entity* this) { if (this->actionDelay != 0) { this->actionDelay--; } else if (this->field_0xf != 0) { - if ((this->frames.b.f3) != 0) { + if (this->frame & 0x80) { this->action = 2; this->actionDelay = 0x10; this->field_0xf = this->type; - this->hVelocity = this->field_0x82.HWORD << 4; + this->zVelocity = this->field_0x82.HWORD << 4; sub_0802F45C(this); InitializeAnimation(this, 2); } - } else if ((this->frames.b.f3) != 0) { + } else if (this->frame & 0x80) { this->field_0xf = 0x40; InitializeAnimation(this, 1); } @@ -111,7 +111,7 @@ void sub_0802F300(Entity* this) { GetNextFrame(this); ProcessMovement(this); - temp = this->height.HALF.HI; + temp = this->z.HALF.HI; rand = Random() & 0xf; if (sub_080044EC(this, this->field_0x80.HWORD) == 1) { @@ -143,7 +143,7 @@ void sub_0802F300(Entity* this) { } } - if ((this->subAction == 0) && (temp < this->height.HALF.HI)) { + if ((this->subAction == 0) && (temp < this->z.HALF.HI)) { InitializeAnimation(this, 4); this->subAction = 1; } @@ -161,12 +161,12 @@ void sub_0802F3F4(Entity* this) { GetNextFrame(this); - if ((this->frames.b.f3) != 0) { + if (this->frame & 0x80) { if ((*(u8*)&this->field_0x7c.HALF.LO < 2) && ((this->type % 2) != 0)) { this->action = 2; this->actionDelay = 0x10; this->field_0xf = this->type; - this->hVelocity = this->field_0x82.HWORD << 4; + this->zVelocity = this->field_0x82.HWORD << 4; (*(u8*)&this->field_0x7c.HALF.LO)++; sub_0802F45C(this); InitializeAnimation(this, 2); diff --git a/src/enemy/tektiteGolden.c b/src/enemy/tektiteGolden.c index f5b7103a..12287902 100644 --- a/src/enemy/tektiteGolden.c +++ b/src/enemy/tektiteGolden.c @@ -32,10 +32,10 @@ void sub_08037F00(Entity* this) { this->actionDelay = 0x14; this->field_0xf = 0; this->field_0x80.HALF.LO = 0; - if (this->height.HALF.HI != 0) { - this->hVelocity >>= 2; + if (this->z.HALF.HI != 0) { + this->zVelocity >>= 2; } else { - this->hVelocity = 0; + this->zVelocity = 0; } InitializeAnimation(this, 0); @@ -58,7 +58,7 @@ void sub_08037F58(Entity* this) { void sub_08037F84(Entity* this) { sub_08001242(this); - if (this->height.HALF.HI != 0) { + if (this->z.HALF.HI != 0) { sub_08003FC4(this, 0x3000); } } @@ -82,15 +82,15 @@ void sub_08037Fe0(Entity* this) { if (this->actionDelay != 0) { this->actionDelay--; } else if (this->field_0xf != 0) { - if ((this->frames.b.f3) != 0) { + if (this->frame & 0x80) { this->action = 2; this->actionDelay = 6; this->field_0xf = 0; - this->hVelocity = 0x38000; + this->zVelocity = 0x38000; sub_08038168(this); InitializeAnimation(this, 2); } - } else if ((this->frames.b.f3) != 0) { + } else if (this->frame & 0x80) { this->field_0xf = 0x40; InitializeAnimation(this, 1); } @@ -102,7 +102,7 @@ void sub_08038048(Entity* this) { UpdateAnimationVariableFrames(this, 2); ProcessMovement(this); - temp = this->height.HALF.HI; + temp = this->z.HALF.HI; rand = Random() & 0xf; if (sub_080044EC(this, 0x3000) == 1) { @@ -122,7 +122,7 @@ void sub_08038048(Entity* this) { sub_08038168(this); } - if ((this->subAction == 0) && (temp < this->height.HALF.HI)) { + if ((this->subAction == 0) && (temp < this->z.HALF.HI)) { InitializeAnimation(this, 4); this->subAction = 1; } @@ -138,11 +138,11 @@ void sub_08038048(Entity* this) { void sub_08038110(Entity* this) { UpdateAnimationVariableFrames(this, 2); - if ((this->frames.b.f3) != 0) { + if (this->frame & 0x80) { if (this->field_0x80.HALF.LO < 5) { this->action = 2; this->actionDelay = 8; - this->hVelocity = 0x38000; + this->zVelocity = 0x38000; sub_08038168(this); InitializeAnimation(this, 2); } else { diff --git a/src/enemy/treeItem.c b/src/enemy/treeItem.c index 0b2103fd..acacb7a3 100644 --- a/src/enemy/treeItem.c +++ b/src/enemy/treeItem.c @@ -47,7 +47,7 @@ void TreeItem(Entity* this) { if (itemEntity) { CopyPosition(this, itemEntity); itemEntity->y.HALF.HI += 16; - itemEntity->height.HALF.HI = -32; + itemEntity->z.HALF.HI = -32; } } } diff --git a/src/enemy/vaatiArm.c b/src/enemy/vaatiArm.c index d001699a..6dbacb7f 100644 --- a/src/enemy/vaatiArm.c +++ b/src/enemy/vaatiArm.c @@ -425,7 +425,7 @@ void sub_08042A3C(Entity* this) { gUnk_080D12B8[this->subAction](this); sub_08043A10(this); entity = ((VaatiArm_HeapStruct*)this->myHeap)->entities[4]; - entity->height.HALF.HI += this->field_0x78.HALF.LO; + entity->z.HALF.HI += this->field_0x78.HALF.LO; } void sub_08042A6C(Entity* this) { @@ -481,11 +481,11 @@ void sub_08042B20(Entity* this) { if (0x30 < ptr->unk04.HALF.HI) { ptr->unk00.HWORD += ptr->unk08; } - if (((VaatiArm_HeapStruct*)this->myHeap)->entities[3]->spriteSettings.b.draw) { + if (((VaatiArm_HeapStruct*)this->myHeap)->entities[3]->spriteSettings.draw) { sub_08043C40(this, ptr); for (i = 0; i < 4; i++) { entity = ((VaatiArm_HeapStruct*)this->myHeap)->entities[i]; - if ((-0xa <= entity->height.HALF.HI) && ((entity->spriteSettings.b.draw) == 1)) { + if ((-0xa <= entity->z.HALF.HI) && ((entity->spriteSettings.draw) == 1)) { if (i == 0) { object = CreateObject(OBJECT_AF, 0, 0); if (object != NULL) { @@ -498,7 +498,7 @@ void sub_08042B20(Entity* this) { } } entity->flags &= 0x7f; - entity->spriteSettings.b.draw = 0; + entity->spriteSettings.draw = 0; SoundReq(SFX_161); } } @@ -564,7 +564,7 @@ void sub_08042C34(Entity* this) { entity = ((VaatiArm_HeapStruct*)this->myHeap)->entities[i]; entity->x.HALF.HI = x; entity->y.HALF.HI = y; - entity->height.HALF.HI = 0x32; + entity->z.HALF.HI = 0x32; entity->hitType = 0x39; ptr = &((VaatiArm_HeapStruct*)this->myHeap)->s1[i]; ptr->unk00.HWORD = 0x80; @@ -600,20 +600,20 @@ void sub_08042D6C(Entity* this) { for (i = 0; i < 4; i++) { entity = ((VaatiArm_HeapStruct*)this->myHeap)->entities[i]; - if (entity->height.HALF.HI < 4) { + if (entity->z.HALF.HI < 4) { if (i != 2) { entity->flags = entity->flags | 0x80; } - if ((entity->spriteSettings.b.draw == 0u) && (object = CreateObject(OBJECT_AF, 2, 0), object != NULL)) { + if ((entity->spriteSettings.draw == 0u) && (object = CreateObject(OBJECT_AF, 2, 0), object != NULL)) { CopyPosition(entity, object); SoundReq(SFX_166); } - entity->spriteSettings.b.draw = 1; + entity->spriteSettings.draw = 1; } } entity = ((VaatiArm_HeapStruct*)this->myHeap)->entities[3]; - if (entity->height.HALF.HI <= -3) { - entity->height.HALF.HI = -5; + if (entity->z.HALF.HI <= -3) { + entity->z.HALF.HI = -5; ((VaatiArm_HeapStruct*)this->myHeap)->s1[0].unk08 = gUnk_080D1300[this->type2]; ((VaatiArm_HeapStruct*)this->myHeap)->s1[0].unk0a = 0xc0; this->subAction = 3; @@ -623,7 +623,7 @@ void sub_08042D6C(Entity* this) { InitAnimationForceUpdate(this, 0); ((VaatiArm_HeapStruct*)this->myHeap)->entities[1]->hitType = 0x39; } else { - entity->height.HALF.HI -= 2; + entity->z.HALF.HI -= 2; } } @@ -710,15 +710,15 @@ void sub_08042FD8(Entity* this) { UpdateAnimationSingleFrame(this); if (!sub_08043C98(this)) { - if ((this->frames.all & 1) != 0) { + if ((this->frame & 1) != 0) { entity = CreateProjectile(0x20); if (entity != NULL) { CopyPosition(this, entity); - entity->height.HALF.HI -= 0x18; - this->frames.all = 0; + entity->z.HALF.HI -= 0x18; + this->frame = 0; } } else { - if (this->frames.all & 0x80) { + if (this->frame & 0x80) { if (--this->field_0xf == 0) { this->subAction = 8; this->actionDelay = 0x3c; @@ -802,18 +802,18 @@ void sub_08043130(Entity* this) { } } } else { - ((VaatiArm_HeapStruct*)this->myHeap)->entities[3]->height.HALF.HI += 3; + ((VaatiArm_HeapStruct*)this->myHeap)->entities[3]->z.HALF.HI += 3; for (i = 0; i < 4; i++) { entity = ((VaatiArm_HeapStruct*)this->myHeap)->entities[i]; - if (entity->height.HALF.HI > -4) { + if (entity->z.HALF.HI > -4) { entity->flags = entity->flags & 0x7f; - if (entity->spriteSettings.b.draw == 1) { + if (entity->spriteSettings.draw == 1) { SoundReq(SFX_161); } - entity->spriteSettings.b.draw = 0; + entity->spriteSettings.draw = 0; } } - if (this->spriteSettings.b.draw == 0) { + if (this->spriteSettings.draw == 0) { this->subAction = 9; this->actionDelay = 0x3c; sub_0804AA1C(this); @@ -853,7 +853,7 @@ void sub_0804325C(Entity* this) { if (this->field_0x78.HALF.LO >= 3) { this->field_0x78.HALF.LO -= 2; entity = ((VaatiArm_HeapStruct*)this->myHeap)->entities[4]; - entity->height.HALF.HI += this->field_0x78.HALF.LO; + entity->z.HALF.HI += this->field_0x78.HALF.LO; } else { this->field_0x78.HALF.LO = 0; } @@ -876,7 +876,7 @@ NONMATCH("asm/non_matching/vaati/sub_0804334C.inc", void sub_0804334C(Entity* th for (i = 0; i < 5; i++) { entity = ((VaatiArm_HeapStruct*)this->myHeap)->entities[i]; entity->flags = entity->flags | 0x80; - entity->spriteSettings.b.draw = 1; + entity->spriteSettings.draw = 1; } } s = &((VaatiArm_HeapStruct*)this->myHeap)->s1[0]; @@ -951,16 +951,16 @@ NONMATCH("asm/non_matching/vaati/sub_08043490.inc", void sub_08043490(Entity* th Entity* entity; entity = ((VaatiArm_HeapStruct*)this->myHeap)->entities[4]; - if (entity->height.HALF.HI < -4) { - entity->hVelocity = 0x18000; + if (entity->z.HALF.HI < -4) { + entity->zVelocity = 0x18000; this->subAction = 2; this->field_0x7c.BYTES.byte2 = 0; ((VaatiArm_HeapStruct*)this->myHeap)->parent->subAction = 2; } else { - entity->height.HALF.HI -= 2; - if (entity->height.HALF.HI < 0) { + entity->z.HALF.HI -= 2; + if (entity->z.HALF.HI < 0) { entity->flags = entity->flags | 0x80; - entity->spriteSettings.b.draw = 1; + entity->spriteSettings.draw = 1; entity->field_0x3c = entity->field_0x3c & 0xef; entity->hitType = 0x3a; entity->hitbox = (Hitbox*)&gUnk_080FD450; @@ -979,8 +979,8 @@ void sub_08043520(Entity* this) { entity = ((VaatiArm_HeapStruct*)this->myHeap)->entities[4]; sub_08003FC4(entity, 0x1a00); - if ((entity->hVelocity < 0) && (-6 < entity->height.HALF.HI)) { - entity->height.HALF.HI = -6; + if ((entity->zVelocity < 0) && (-6 < entity->z.HALF.HI)) { + entity->z.HALF.HI = -6; this->subAction = 3; this->field_0x7a.HWORD = 900; } @@ -998,15 +998,15 @@ void sub_08043580(Entity* this) { Entity* entity; u32 i; - ((VaatiArm_HeapStruct*)this->myHeap)->entities[4]->height.HALF.HI += 3; + ((VaatiArm_HeapStruct*)this->myHeap)->entities[4]->z.HALF.HI += 3; for (i = 0; i < 5; i++) { entity = ((VaatiArm_HeapStruct*)this->myHeap)->entities[i]; - if (-4 < entity->height.HALF.HI) { + if (-4 < entity->z.HALF.HI) { entity->flags = entity->flags & 0x7f; - entity->spriteSettings.b.draw = 0; + entity->spriteSettings.draw = 0; } } - if ((this->spriteSettings.b.draw & 3) == 0) { + if ((this->spriteSettings.draw & 3) == 0) { this->subAction = 5; this->actionDelay = 0x3c; entity = ((VaatiArm_HeapStruct*)this->myHeap)->entities[4]; @@ -1063,7 +1063,7 @@ static inline void deleteThing(Entity* this, const u32 index) { this->actionDelay = 0x14; this->subAction = index + 1; if (index == 1) { - this->spriteSettings.b.draw = 0; + this->spriteSettings.draw = 0; } CreateFx(((VaatiArm_HeapStruct*)this->myHeap)->entities[index], FX_GIANT_EXPLOSION4, 0); ((VaatiArm_HeapStruct*)this->myHeap)->entities[index]->myHeap = NULL; @@ -1099,7 +1099,7 @@ NONMATCH("asm/non_matching/vaati/sub_08043770.inc", void sub_08043770(Entity* th gScreenTransition.field_0x39 &= 0xfd; } ((VaatiArm_HeapStruct*)this->myHeap)->entities[4]->myHeap = NULL; - ((VaatiArm_HeapStruct*)this->myHeap)->entities[4]->currentHealth = 0; + ((VaatiArm_HeapStruct*)this->myHeap)->entities[4]->health = 0; (*(Entity**)&this->field_0x68)->parent = ((VaatiArm_HeapStruct*)this->myHeap)->entities[4]; DeleteThisEntity(); } @@ -1170,7 +1170,7 @@ void sub_08043A10(Entity* this) { sub_08043B7C(this); sub_0804393C(((VaatiArm_HeapStruct*)this->myHeap)->entities[4]); ((VaatiArm_HeapStruct*)this->myHeap)->entities[4]->y.HALF.HI -= 8; - ((VaatiArm_HeapStruct*)this->myHeap)->entities[4]->height.HALF.HI -= 8; + ((VaatiArm_HeapStruct*)this->myHeap)->entities[4]->z.HALF.HI -= 8; sub_0804393C(((VaatiArm_HeapStruct*)this->myHeap)->entities[3]); sub_0804393C(((VaatiArm_HeapStruct*)this->myHeap)->entities[2]); sub_0804393C(((VaatiArm_HeapStruct*)this->myHeap)->entities[1]); @@ -1329,7 +1329,7 @@ void sub_08043D08(Entity* this) { InitAnimationForceUpdate(this, 0xd); entity = ((VaatiArm_HeapStruct*)this->myHeap)->entities[4]; entity->flags &= 0x7f; - entity->spriteSettings.b.draw = 0; + entity->spriteSettings.draw = 0; InitializeAnimation(entity, 0x13); sub_0804AA1C(entity); fx = CreateFx(entity, FX_GIANT_EXPLOSION4, 0); @@ -1339,7 +1339,7 @@ void sub_08043D08(Entity* this) { fx->spritePriority.b0 = 3; } CopyPosition(((VaatiArm_HeapStruct*)this->myHeap)->entities[3], entity); - entity->height.HALF.HI += ((VaatiArm_HeapStruct*)this->myHeap)->s1[3].unk0c; + entity->z.HALF.HI += ((VaatiArm_HeapStruct*)this->myHeap)->s1[3].unk0c; for (i = 0; i < 5; i++) { ((VaatiArm_HeapStruct*)this->myHeap)->entities[i]->hitType = 0x39; } @@ -1402,15 +1402,15 @@ void sub_08043EB8(Entity* this) { pEVar4->spritePriority.b0 = 4; pEVar4 = ((VaatiArm_HeapStruct*)this->myHeap)->entities[3]; pEVar4->flags = pEVar4->flags & 0x7f; - pEVar4->spriteSettings.b.draw = 1; + pEVar4->spriteSettings.draw = 1; pEVar4->spritePriority.b0 = 4; pEVar4 = ((VaatiArm_HeapStruct*)this->myHeap)->entities[4]; pEVar4->flags = pEVar4->flags | 0x80; - pEVar4->spriteSettings.b.draw = 1; + pEVar4->spriteSettings.draw = 1; pEVar4->spritePriority.b0 = 4; pEVar4->x.HALF.HI = (this->type2 == 0) ? gScreenTransition.field_0x44 : gScreenTransition.field_0x48; pEVar4->y.HALF.HI = (this->type2 == 0) ? gScreenTransition.field_0x46 : gScreenTransition.field_0x4a; - pEVar4->height.HALF.HI = 0; + pEVar4->z.HALF.HI = 0; pEVar4->field_0x3c = pEVar4->field_0x3c & 0xef; pEVar4->hitType = 0x3a; pEVar4->hitbox = (Hitbox*)&gUnk_080FD450; diff --git a/src/enemy/vaatiBall.c b/src/enemy/vaatiBall.c index dca843d9..778af1a7 100644 --- a/src/enemy/vaatiBall.c +++ b/src/enemy/vaatiBall.c @@ -26,7 +26,7 @@ void VaatiBall(Entity* this) { gUnk_080D1604[this->action](this); if (this->cutsceneBeh.HALF.LO) { - this->currentHealth = -1; + this->health = -1; } if (this->bitfield & 0x80) { @@ -35,13 +35,13 @@ void VaatiBall(Entity* this) { } #ifdef EU - if (this->currentHealth < 0xfa) { + if (this->health < 0xfa) { #else - if (this->currentHealth < 0xfd) { + if (this->health < 0xfd) { #endif - this->spriteSettings.b.draw = 0; + this->spriteSettings.draw = 0; COLLISION_OFF(this); - this->currentHealth = -1; + this->health = -1; parent->field_0x80.HALF.LO--; CreateDust(this); SoundReq(SFX_1C3); @@ -63,17 +63,17 @@ void sub_0804468C(Entity* this) { this->direction = (this->field_0x78.HALF.HI * 8) & 0x1f; this->field_0x78.HALF.LO = 0; this->field_0x82.HALF.HI = 0; - this->spriteSettings.b.draw = 0; + this->spriteSettings.draw = 0; off = &gUnk_080D1620[this->field_0x78.HALF.HI & 3]; PositionRelative(this->parent, this, off->h << 0x10, (off->v - 0x10) * 0x10000); - this->height.HALF.HI = this->parent->height.HALF.HI; + this->z.HALF.HI = this->parent->z.HALF.HI; InitAnimationForceUpdate(this, 0); break; case 1: this->action = 3; this->field_0x74.HALF.LO = 0; this->field_0x82.HALF.HI = 1; - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; InitAnimationForceUpdate(this, 1); break; } @@ -124,15 +124,15 @@ void sub_080447E0(Entity* this) { this->hitType = 43; sub_08044E74(this, 0); if (this->flags & ENT_COLLIDE) - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; } else { this->field_0x76.HALF.HI++; this->field_0x76.HALF.HI &= 7; if (this->flags & ENT_COLLIDE) { if (this->field_0x76.HALF.HI & 1) { - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; } else { - this->spriteSettings.b.draw = 0; + this->spriteSettings.draw = 0; } } @@ -156,7 +156,7 @@ void sub_08044868(Entity* this) { if (this->field_0x82.HALF.HI) { switch (this->field_0x74.HALF.LO) { case 0: - if (this->frames.all & 0x80) { + if (this->frame & 0x80) { this->field_0x74.HALF.LO = 1; this->direction = sub_080045B4(this, vaati->x.HALF.HI, vaati->y.HALF.HI - 0x10); this->speed = 0x180; @@ -179,11 +179,11 @@ void sub_08044868(Entity* this) { case 1: if (this->field_0x82.HALF.HI == 0) { this->field_0x82.HALF.HI++; - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; } sub_08044DEC(this); if (*(u8*)&vaati->field_0x86 > 1) { - u8 draw = this->spriteSettings.b.draw; + u8 draw = this->spriteSettings.draw; if (draw == 1 && this->cutsceneBeh.HALF.LO == 0) { vaati = CreateProjectileWithParent(this, 0x18, 0); if (vaati) { @@ -205,7 +205,7 @@ void sub_08044868(Entity* this) { u8 draw; sub_08044E74(this, 1); - draw = this->spriteSettings.b.draw; + draw = this->spriteSettings.draw; if (draw == 1) { COLLISION_ON(this); } else { @@ -273,13 +273,13 @@ void sub_080449F8(Entity* this) { u8 draw; this->field_0x74.HALF.LO++; - draw = this->spriteSettings.b.draw; + draw = this->spriteSettings.draw; if (draw) { vaati = CreateProjectileWithParent(this, 0x1c, 0); if (vaati) { vaati->y.HALF.HI += 4; vaati->parent = this; - this->attachedEntity = vaati; + this->child = vaati; } } } @@ -393,7 +393,7 @@ void sub_08044B04(Entity* this) { COLLISION_OFF(this); PositionRelative(vaati, this, 0, -0x100000); if (this->field_0xf) - this->spriteSettings.b.draw = 0; + this->spriteSettings.draw = 0; break; case 1: if (--this->actionDelay == 0) { @@ -427,7 +427,7 @@ void sub_08044B04(Entity* this) { u8 draw; sub_08044E74(this, 1); - draw = this->spriteSettings.b.draw; + draw = this->spriteSettings.draw; if (draw == 1) { COLLISION_ON(this); } else { @@ -447,10 +447,10 @@ void sub_08044DEC(Entity* this) { u32 off; if (this->parent->field_0x80.HALF.LO > this->field_0x78.HALF.HI) { - this->spriteSettings.b.draw = 1; - this->currentHealth = -1; + this->spriteSettings.draw = 1; + this->health = -1; } else { - this->spriteSettings.b.draw = 0; + this->spriteSettings.draw = 0; } COLLISION_OFF(this); this->field_0x78.HALF.LO = 0; diff --git a/src/enemy/vaatiEyesMacro.c b/src/enemy/vaatiEyesMacro.c index 86b5a739..5bc955dc 100644 --- a/src/enemy/vaatiEyesMacro.c +++ b/src/enemy/vaatiEyesMacro.c @@ -62,27 +62,27 @@ void VaatiEyesMacroFunction0(Entity* this) { void VaatiEyesMacroFunction1(Entity* this) { if (this->type == 0) { - if (this->currentHealth == 0) { + if (this->health == 0) { gScreenTransition.field_0x39 &= ~(1 << (gScreenTransition.field_0x3c + 2)); } if (gRoomControls.roomID == 0) { - gScreenTransition.field_0x3a = this->currentHealth; + gScreenTransition.field_0x3a = this->health; } else { - gScreenTransition.field_0x3b = this->currentHealth; + gScreenTransition.field_0x3b = this->health; } - if (this->field_0x78.HALF.HI != this->currentHealth) { + if (this->field_0x78.HALF.HI != this->health) { EnqueueSFX(SFX_17A); } - this->field_0x78.HALF.HI = this->currentHealth; + this->field_0x78.HALF.HI = this->health; } else { if (this->type == 1) { if (0 < this->iframes) { this->iframes *= -1; } - if (this->currentHealth != 0xff) { + if (this->health != 0xff) { EnqueueSFX(SFX_BUTTON_DEPRESS); } - this->currentHealth = 0xff; + this->health = 0xff; } } if (this->field_0x43 != 0) { @@ -108,9 +108,9 @@ void VaatiEyesMacroFunction0Type0Action0(Entity* this) { enemy->parent = this; this->action = 1; if (gRoomControls.roomID == 0) { - this->field_0x78.HALF.HI = this->currentHealth = gScreenTransition.field_0x3a; + this->field_0x78.HALF.HI = this->health = gScreenTransition.field_0x3a; } else { - this->field_0x78.HALF.HI = this->currentHealth = gScreenTransition.field_0x3b; + this->field_0x78.HALF.HI = this->health = gScreenTransition.field_0x3b; } this->field_0x78.HALF.LO = Random(); sub_0802EFB8(this); @@ -147,7 +147,7 @@ void VaatiEyesMacroFunction0Type1Action0(Entity* this) { void VaatiEyesMacroFunction0Type1Action1(Entity* this) { if (this->parent->next == NULL) { COLLISION_OFF(this); - this->currentHealth = 0; + this->health = 0; } else { sub_0802F04C(this); GetNextFrame(this); @@ -192,7 +192,7 @@ void VaatiEyesMacroFunction0Type3(Entity* this) { this->spritePriority.b0 = 6; } CopyPositionAndSpriteOffset(this->parent, this); - this->height.HALF.HI = 0; + this->z.HALF.HI = 0; } void sub_0802EF58(Entity* this) { @@ -212,7 +212,7 @@ void sub_0802EF58(Entity* this) { } void sub_0802EF90(Entity* this) { - this->height.HALF.HI = gUnk_080CDE90[this->field_0x78.HALF.LO++ >> 3 & 7]; + this->z.HALF.HI = gUnk_080CDE90[this->field_0x78.HALF.LO++ >> 3 & 7]; } void sub_0802EFB8(Entity* this) { diff --git a/src/enemy/vaatiProjectile.c b/src/enemy/vaatiProjectile.c index f86fb5ab..c1cf9435 100644 --- a/src/enemy/vaatiProjectile.c +++ b/src/enemy/vaatiProjectile.c @@ -43,7 +43,7 @@ void (*const vaatiProjectileFunction0Actions[])(Entity*) = { void VaatiProjectile(Entity* this) { if (sub_0803E4A0(this)) { COLLISION_OFF(this); - this->currentHealth = 0; + this->health = 0; this->parent = NULL; } vaatiProjectileFunctions[GetNextFunction(this)](this); @@ -58,7 +58,7 @@ void VaatiProjectileFunction1(Entity* this) { if (this->bitfield == 0x80) { #ifndef EU - if (this->currentHealth != 0) { + if (this->health != 0) { #endif this->action = 5; COLLISION_OFF(this); @@ -101,13 +101,13 @@ void VaatiProjectileFunction0Action0(Entity* this) { entity = CreateEnemy(VAATI_PROJECTILE, 1); if (entity != NULL) { entity->parent = this; - this->attachedEntity = entity; + this->child = entity; if (this->type2 == 0) { this->action = 1; - this->height.HALF.HI = -0x18; + this->z.HALF.HI = -0x18; } else { this->action = 9; - this->height.HALF.HI = -0x80; + this->z.HALF.HI = -0x80; this->flags2 = 1; } InitializeAnimation(this, 0); @@ -129,7 +129,7 @@ void VaatiProjectileFunction0Action1(Entity* this) { if (PlayerInRange(this, 0, 8) != 0) { this->action = 2; this->actionDelay = 10; - InitializeAnimation(this->attachedEntity, 2); + InitializeAnimation(this->child, 2); } else { if (gUnk_020000B0 != NULL) { sub_08004596(this, GetFacingDirection(this, gUnk_020000B0)); @@ -143,7 +143,7 @@ void VaatiProjectileFunction0Action2(Entity* this) { if (this->actionDelay != 0) { this->actionDelay--; } else { - if (++this->height.HALF.HI == 0) { + if (++this->z.HALF.HI == 0) { this->action = 3; } } @@ -151,11 +151,11 @@ void VaatiProjectileFunction0Action2(Entity* this) { } void VaatiProjectileFunction0Action3(Entity* this) { - if ((this->attachedEntity->frames.b.f3) != 0) { - if (--this->height.HALF.HI <= -0x18) { + if (this->child->frame & 0x80) { + if (--this->z.HALF.HI <= -0x18) { this->action = 4; this->actionDelay = (Random() & 0xf) + 0xf; - InitializeAnimation(this->attachedEntity, 1); + InitializeAnimation(this->child, 1); } GetNextFrame(this); } @@ -174,7 +174,7 @@ void VaatiProjectileFunction0Action5(Entity* this) { if (this->actionDelay != 0) { this->actionDelay--; } else { - if (-0x18 < --this->height.HALF.HI) { + if (-0x18 < --this->z.HALF.HI) { return; } this->action = 6; @@ -212,14 +212,14 @@ void VaatiProjectileFunction0Action8(Entity* this) { void VaatiProjectileFunction0Action9(Entity* this) { this->x.HALF.HI = gPlayerEntity.x.HALF.HI; this->y.HALF.HI = gPlayerEntity.y.HALF.HI; - if (this->height.HALF.HI < -8) { + if (this->z.HALF.HI < -8) { if (this->animIndex != 2) { this->actionDelay = 0; - InitializeAnimation(this->attachedEntity, 2); + InitializeAnimation(this->child, 2); } VaatiProjectileFunction0Action2(this); } else { - this->height.HALF.HI += 8; + this->z.HALF.HI += 8; } } @@ -257,7 +257,7 @@ bool32 sub_0803E4A0(Entity* this) { if (this->parent == NULL) { return FALSE; } - if (this->parent->currentHealth == 0) { + if (this->parent->health == 0) { return TRUE; } else { ret = this->parent->next == NULL; diff --git a/src/enemy/vaatiRebornEnemy.c b/src/enemy/vaatiRebornEnemy.c index 85c39122..d1a2e4c8 100644 --- a/src/enemy/vaatiRebornEnemy.c +++ b/src/enemy/vaatiRebornEnemy.c @@ -104,10 +104,10 @@ void VaatiRebornEnemyType0Action0(Entity* this) { this->field_0x74.HALF.LO = -1; this->actionDelay = 0; this->field_0x76.HALF.LO = 0; - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; this->direction = 0xff; this->spritePriority.b0 = 4; - this->height.WORD = 0; + this->z.WORD = 0; this->field_0x80.HALF.LO = 2; this->field_0x86.HALF.LO = 0; this->cutsceneBeh.HALF.HI = 0x30; @@ -119,7 +119,7 @@ void VaatiRebornEnemyType0Action0(Entity* this) { this->field_0x7c = this->y; entity = CreateEnemy(VAATI_REBORN_ENEMY, 1); entity->parent = this; - this->attachedEntity = entity; + this->child = entity; for (i = 0; i < 6; i++) { entity = CreateEnemy(VAATI_BALL, 0); entity->parent = this; @@ -133,7 +133,7 @@ void VaatiRebornEnemyType0Action0(Entity* this) { for (i = 0; i < 2; i++) { entity = CreateEnemy(VAATI_BALL, 1); entity->parent = this; - entity->spriteSettings.b.flipX = i; + entity->spriteSettings.flipX = i; ptr = &gUnk_080D04A8[i]; PositionRelative(this, entity, ptr->x << 0x10, ptr->y << 0x10); } @@ -145,7 +145,7 @@ void VaatiRebornEnemyType0Action1(Entity* this) { if (this->actionDelay != 0) { if (--this->actionDelay == 0) { if ((this->field_0x74.HALF.LO & 0x70) == 0) { - if (this->attachedEntity->actionDelay == 0) { + if (this->child->actionDelay == 0) { sub_0803DD78(this); if (this->field_0x74.HALF.HI != 0) { this->action = 2; @@ -168,7 +168,7 @@ void VaatiRebornEnemyType0Action1(Entity* this) { this->field_0x74.HALF.LO = 0; this->actionDelay = 0xc0; this->direction = 0xff; - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; InitAnimationForceUpdate(this, 0); } } @@ -205,7 +205,7 @@ void VaatiRebornEnemyType0Action1(Entity* this) { break; } } - if (this->attachedEntity->actionDelay == 0) { + if (this->child->actionDelay == 0) { this->cutsceneBeh.HALF.HI++; if ((this->cutsceneBeh.HALF.HI & 3) == 0) { switch (this->cutsceneBeh.HALF.HI & 0x30) { @@ -237,9 +237,9 @@ void VaatiRebornEnemyType0Action2(Entity* this) { } break; case 1: - if ((this->frames.all & 0x80) != 0) { + if ((this->frame & 0x80) != 0) { this->field_0x74.HALF.LO = 2; - this->spriteSettings.b.draw = 0; + this->spriteSettings.draw = 0; this->actionDelay = 0x10; } break; @@ -255,15 +255,15 @@ void VaatiRebornEnemyType0Action2(Entity* this) { this->x.HALF.HI = gRoomControls.roomOriginX + ptr->HALF.x + 0x10; this->y.HALF.HI = gRoomControls.roomOriginY + ptr->HALF.y + 0x10; } - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; this->actionDelay = 0x20; InitAnimationForceUpdate(this, 4); SoundReq(SFX_F5); } break; case 3: - if ((this->frames.all & 0x80) != 0) { - this->spriteSettings.b.draw = 1; + if ((this->frame & 0x80) != 0) { + this->spriteSettings.draw = 1; if (4 < this->field_0x80.HALF.HI) { this->x.HALF.HI = gPlayerEntity.x.HALF.HI; this->y.HALF.HI = gPlayerEntity.y.HALF.HI - 0x18; @@ -291,8 +291,8 @@ void VaatiRebornEnemyType0Action3(Entity* this) { this->actionDelay = 1; break; case 0xff: - if (this->height.HALF.HI != -4) { - this->height.WORD -= 0x2000; + if (this->z.HALF.HI != -4) { + this->z.WORD -= 0x2000; } if (this->actionDelay == 2) { this->field_0x74.HALF.LO = 0xfe; @@ -320,7 +320,7 @@ void VaatiRebornEnemyType0Action3(Entity* this) { } break; case 2: - if ((this->frames.all & 0x80) != 0) { + if ((this->frame & 0x80) != 0) { this->field_0x74.HALF.LO = 3; InitAnimationForceUpdate(this, 0); } @@ -345,8 +345,8 @@ void VaatiRebornEnemyType0Action4(Entity* this) { this->direction = (this->direction + 0x10) & 0x1f; InitAnimationForceUpdate(this, 0); } else { - if ((this->frames.all & 0x10) != 0) { - this->frames.all &= 0xef; + if ((this->frame & 0x10) != 0) { + this->frame &= 0xef; if (this->cutsceneBeh.HALF.LO == 0xff) { index = Direction8RoundUp(GetFacingDirection(this, &gPlayerEntity)); this->cutsceneBeh.HALF.LO = gUnk_080D04C0[index >> 2]; @@ -356,7 +356,7 @@ void VaatiRebornEnemyType0Action4(Entity* this) { (entity = CreateProjectileWithParent(this, 0x1a, this->cutsceneBeh.HALF.LO), entity != NULL)) { entity->field_0xf = this->field_0xf; entity->parent = this; - entity->height.HALF.HI = this->height.HALF.HI; + entity->z.HALF.HI = this->z.HALF.HI; this->field_0xf = this->field_0xf + 1; } } @@ -383,7 +383,7 @@ void VaatiRebornEnemyType0Action5(Entity* this) { } break; case 1: - if ((this->frames.all & 0x10) != 0) { + if ((this->frame & 0x10) != 0) { this->field_0x74.HALF.LO = 2; this->field_0xf = (Random() & 0x3f) + 0x40; SoundReq(SFX_SUMMON); @@ -503,7 +503,7 @@ void VaatiRebornEnemyType1Action0(Entity* this) { PositionRelative(this->parent, this, 0, 0x10000); enemy = CreateEnemy(VAATI_REBORN_ENEMY, 2); enemy->parent = this; - enemy->attachedEntity = this->parent; + enemy->child = this->parent; InitAnimationForceUpdate(this, this->field_0x74.HALF.LO); } @@ -527,7 +527,7 @@ void VaatiRebornEnemyType1Action1(Entity* this) { parent->iframes = this->iframes; parent->bitfield = this->bitfield; } - if ((this->frames.all & 0x40) != 0) { + if ((this->frame & 0x40) != 0) { InitAnimationForceUpdate(this, 2); } } @@ -544,7 +544,7 @@ void VaatiRebornEnemyType1Action1(Entity* this) { COLLISION_OFF(this); } } - this->spriteSettings.b.draw = parent->spriteSettings.b.draw; + this->spriteSettings.draw = parent->spriteSettings.draw; this->spriteOffsetX = parent->spriteOffsetX; PositionRelative(this->parent, this, 0, 0x10000); UpdateAnimationSingleFrame(this); @@ -593,7 +593,7 @@ void VaatiRebornEnemyType2Action1(Entity* this) { InitAnimationForceUpdate(this, 2); } } - this->spriteSettings.b.draw = parent->spriteSettings.b.draw; + this->spriteSettings.draw = parent->spriteSettings.draw; this->spriteOffsetX = parent->spriteOffsetX; PositionRelative(parent->parent, this, 0, 0x20000); UpdateAnimationSingleFrame(this); @@ -635,7 +635,7 @@ void sub_0803DC0C(Entity* this) { parent = this->parent; tmp = &gUnk_080D04C8[this->actionDelay]; - this->spriteSettings.b.draw = parent->spriteSettings.b.draw; + this->spriteSettings.draw = parent->spriteSettings.draw; this->spriteOffsetX = parent->spriteOffsetX; PositionRelative(parent, this, tmp->x << 0x10, (tmp->y + 1) * 0x10000); UpdateAnimationSingleFrame(this); @@ -650,7 +650,7 @@ void VaatiRebornEnemyType1PreAction(Entity* this) { parent = this->parent; this->field_0x76.HALF.HI = 0; if ((this->bitfield & 0x80) != 0) { - if (gUnk_080D04D0[parent->field_0x86.HALF.LO] > this->currentHealth) { + if (gUnk_080D04D0[parent->field_0x86.HALF.LO] > this->health) { if (2 < ++parent->field_0x86.HALF.LO) { COLLISION_OFF(this); parent->action = 7; @@ -681,7 +681,7 @@ void VaatiRebornEnemyType1PreAction(Entity* this) { parent->field_0x74.HALF.LO = 0xf0; } else { parent->field_0x74.HALF.LO = 0x70; - this->currentHealth = 0xff; + this->health = 0xff; } parent->action = 1; parent->actionDelay = 1; diff --git a/src/enemy/vaatiTransfigured.c b/src/enemy/vaatiTransfigured.c index 0933b1eb..c00649a5 100644 --- a/src/enemy/vaatiTransfigured.c +++ b/src/enemy/vaatiTransfigured.c @@ -136,7 +136,7 @@ void VaatiTransfiguredType0Action0(Entity* this) { sub_0804A720(this); if ((CheckRoomFlag(0) != 0) && (gEntCount < 0x51)) { this->action = 1; - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; this->spritePriority.b0 = 5; this->field_0x6c.HALF.HI |= 1; this->direction = (Random() & 0x17) + 4; @@ -210,7 +210,7 @@ void VaatiTransfiguredType0Action1(Entity* this) { break; case 3: if (--this->actionDelay == 0) { - this->height.HALF.HI = 0; + this->z.HALF.HI = 0; this->field_0x80.HALF.LO = 0; this->actionDelay = gUnk_080D0ABF[(u32)this->animationState * 2]; switch (sub_08040934(this)) { @@ -279,7 +279,7 @@ void VaatiTransfiguredType0Action3(Entity* this) { this->hitType = 0x35; this->spriteOffsetX = 0; } - if (this->currentHealth < gUnk_080D0ABC[this->animationState]) { + if (this->health < gUnk_080D0ABC[this->animationState]) { tmp = 1; this->actionDelay = 1; } else { @@ -300,7 +300,7 @@ void VaatiTransfiguredType0Action3(Entity* this) { } break; case 2: - this->attachedEntity->field_0x74.HALF.LO = 0x10; + this->child->field_0x74.HALF.LO = 0x10; if (this->actionDelay) { this->field_0x80.HALF.LO = 3; this->actionDelay = 0x40; @@ -313,7 +313,7 @@ void VaatiTransfiguredType0Action3(Entity* this) { if (this->actionDelay != 0) { if (--this->actionDelay == 0) { COLLISION_OFF(this); - this->hVelocity = 0x38000; + this->zVelocity = 0x38000; this->field_0xf = 0x10; } break; @@ -322,7 +322,7 @@ void VaatiTransfiguredType0Action3(Entity* this) { this->field_0x80.HALF.LO = 5; this->actionDelay = 0x10; COLLISION_ON(this); - this->currentHealth = 0xff; + this->health = 0xff; this->field_0x86.HALF.LO = 0; sub_080408EC(this); SoundReq(SFX_14C); @@ -379,7 +379,7 @@ void VaatiTransfiguredType0Action4(Entity* this) { this->field_0x74.HALF.LO = 0; this->actionDelay = 0x80; this->field_0xf = 0; - this->hVelocity = 0x24000; + this->zVelocity = 0x24000; SoundReq(SFX_12B); } break; @@ -424,7 +424,7 @@ void VaatiTransfiguredType0Action4(Entity* this) { if (--this->actionDelay == 0) { this->action = 1; this->field_0x80.HALF.LO = 0; - this->height.HALF.HI = 0; + this->z.HALF.HI = 0; sub_08040670(this); } else { sub_08040AD4(this); @@ -557,8 +557,8 @@ void VaatiTransfiguredType0Action7(Entity* this) { } else { if (this->field_0xf != 0) { if (--this->field_0xf == 0) { - this->currentHealth = 0; - this->spriteSettings.b.draw = 0; + this->health = 0; + this->spriteSettings.draw = 0; } } else { sub_0804A7D4(this); @@ -594,7 +594,7 @@ void VaatiTransfiguredType1Action1(Entity* this) { Entity* parent; parent = this->parent; - if (parent->currentHealth == 0) { + if (parent->health == 0) { this->field_0x6c.HALF.HI |= 2; DeleteThisEntity(); } @@ -617,7 +617,7 @@ void VaatiTransfiguredType1Action1(Entity* this) { } } if (parent->action != 3) { - this->height.HALF.HI = parent->height.HALF.HI; + this->z.HALF.HI = parent->z.HALF.HI; } } @@ -645,7 +645,7 @@ void VaatiTransfiguredType2Action1(Entity* this) { const xy* t; - if (this->parent->currentHealth == 0) { + if (this->parent->health == 0) { this->field_0x6c.HALF.HI |= 2; DeleteThisEntity(); } @@ -659,7 +659,7 @@ void VaatiTransfiguredType2Action1(Entity* this) { case 1: if (this->parent->frameIndex != 2) { this->action = 2; - this->spriteSettings.b.draw = 0; + this->spriteSettings.draw = 0; } break; case 0: @@ -674,7 +674,7 @@ void VaatiTransfiguredType2Action1(Entity* this) { } break; case 1: - if ((this->frames.all & 0x80) != 0) { + if ((this->frame & 0x80) != 0) { this->field_0x74.HALF.LO = 0; this->field_0xf = (Random() & 0x7f) + 0x17; InitAnimationForceUpdate(this, 0); @@ -698,14 +698,14 @@ void VaatiTransfiguredType2Action1(Entity* this) { } void VaatiTransfiguredType2Action2(Entity* this) { - if (this->parent->currentHealth == 0) { + if (this->parent->health == 0) { this->field_0x6c.HALF.HI |= 2; DeleteThisEntity(); } CopyPosition(this->parent, this); if (this->parent->frameIndex == 2) { this->action = 1; - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; } } @@ -716,7 +716,7 @@ void VaatiTransfiguredType3Action0(Entity* this) { } void VaatiTransfiguredType3Action1(Entity* this) { - if (this->parent->currentHealth == 0) { + if (this->parent->health == 0) { this->field_0x6c.HALF.HI |= 2; DeleteThisEntity(); } @@ -728,25 +728,25 @@ void VaatiTransfiguredType4Action0(Entity* this) { this->action = 1; this->field_0x80.HALF.LO = 0; this->actionDelay = 10; - this->spriteSettings.b.draw = 0; + this->spriteSettings.draw = 0; this->spritePriority.b0 = 7; InitializeAnimation(this, 0); } void VaatiTransfiguredType4Action1(Entity* this) { - if (this->parent->currentHealth == 0) { + if (this->parent->health == 0) { this->field_0x6c.HALF.HI |= 2; DeleteThisEntity(); } if (this->parent->action != 5) { if (this->field_0x80.HALF.LO != 0) { this->field_0x80.HALF.LO = 0; - this->spriteSettings.b.draw = 0; + this->spriteSettings.draw = 0; } } else { if (this->field_0x80.HALF.LO == 0) { this->field_0x80.HALF.LO += 1; - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; } if (--this->actionDelay == 0) { this->actionDelay = 10; @@ -765,13 +765,13 @@ void VaatiTransfiguredType5Action0(Entity* this) { InitializeAnimation(this, 2); } else { this->action = 1; - this->spriteSettings.b.draw = 0; + this->spriteSettings.draw = 0; this->spritePriority.b0 = 4; } } void VaatiTransfiguredType5Action1(Entity* this) { - if (this->parent->currentHealth == 0) { + if (this->parent->health == 0) { this->field_0x6c.HALF.HI |= 2; DeleteThisEntity(); } @@ -781,16 +781,16 @@ void VaatiTransfiguredType5Action1(Entity* this) { return; } this->field_0x80.HALF.LO += 1; - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; InitializeAnimation(this, 1); break; case 1: if (this->parent->action != 6) { this->field_0x80.HALF.LO = 0; - this->spriteSettings.b.draw = 0; + this->spriteSettings.draw = 0; } else { - if (this->frames.b.f3 != 0) { - this->frames.b.f3 = 0; + if (this->frame & 0x80) { + this->frame &= ~0x80; if (gEntCount < 0x47) { sub_08040648(this, this->type, 1); } @@ -807,19 +807,19 @@ void VaatiTransfiguredType5Action1(Entity* this) { } void VaatiTransfiguredType5Action2(Entity* this) { - if (this->parent->currentHealth == 0) { + if (this->parent->health == 0) { this->field_0x6c.HALF.HI |= 2; DeleteThisEntity(); } if (this->field_0x80.HALF.LO == 0) { if (this->parent->parent->action != 6) { - if ((this->frames.all & 0x80) != 0) { + if ((this->frame & 0x80) != 0) { this->field_0x80.HALF.LO += 1; InitializeAnimation(this, 3); } } } else { - if ((this->frames.all & 0x80) != 0) { + if ((this->frame & 0x80) != 0) { DeleteThisEntity(); } } @@ -835,7 +835,7 @@ void sub_08040648(Entity* this, u32 type, u32 type2) { enemy->parent = this; CopyPosition(this, enemy); if ((type == 2) && (type2 == 0)) { - this->attachedEntity = enemy; + this->child = enemy; } } @@ -1061,7 +1061,7 @@ void sub_080409B0(Entity* this) { this->field_0x80.HALF.HI = 3; COLLISION_OFF(this); this->hitType = 0x36; - this->hVelocity = 0x18000; + this->zVelocity = 0x18000; SoundReq(SFX_164); } } @@ -1078,7 +1078,7 @@ void sub_080409B0(Entity* this) { SoundReq(SFX_BOSS_HIT); } if ((this->bitfield == 0x8a) && (gPlayerState.field_0xa0[0] == 5)) { - this->currentHealth = 0xc0; + this->health = 0xc0; } } } diff --git a/src/enemy/vaatiTransfiguredEye.c b/src/enemy/vaatiTransfiguredEye.c index a6777666..05132764 100644 --- a/src/enemy/vaatiTransfiguredEye.c +++ b/src/enemy/vaatiTransfiguredEye.c @@ -69,8 +69,8 @@ void VaatiTransfiguredEyeFunction1(Entity* this) { SoundReq(SFX_ITEM_GLOVES_KNOCKBACK); } } else { - if (this->currentHealth != 0xff) { - this->currentHealth = 0xff; + if (this->health != 0xff) { + this->health = 0xff; if (this->actionDelay != 0 && (pEVar4->field_0x80.HALF.HI != 0)) { pEVar4->field_0x76.HALF.LO |= (1 << this->type2); if (this->cutsceneBeh.HALF.HI == 0) { @@ -96,7 +96,7 @@ void VaatiTransfiguredEyeFunction0Action0(Entity* this) { bVar2 = gMessage.doTextBox & 0x7f; if ((gMessage.doTextBox & 0x7f) == 0) { this->action = 1; - this->spriteSettings.b.draw = 0; + this->spriteSettings.draw = 0; this->field_0x80.HALF.LO = bVar2; this->field_0x80.HALF.HI = bVar2; this->cutsceneBeh.HALF.HI = bVar2; @@ -108,7 +108,7 @@ void VaatiTransfiguredEyeFunction0Action0(Entity* this) { child = CreateEnemy(VAATI_TRANSFIGURED_EYE, 1); if (child != NULL) { child->parent = this; - this->attachedEntity = child; + this->child = child; child->actionDelay = this->actionDelay; child->type2 = this->type2; CopyPosition(this, child); @@ -123,7 +123,7 @@ void VaatiTransfiguredEyeFunction0Action0(Entity* this) { void VaatiTransfiguredEyeFunction0Action1(Entity* this) { sub_08045A28(this); if (this->field_0x82.HALF.LO == 0) { - if ((this->frames.all & 0x80) != 0) { + if ((this->frame & 0x80) != 0) { if (this->type != 0) { COLLISION_ON(this); } @@ -132,7 +132,7 @@ void VaatiTransfiguredEyeFunction0Action1(Entity* this) { } } else { if (--this->field_0x82.HALF.LO == 0) { - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; } } } @@ -163,7 +163,7 @@ void VaatiTransfiguredEyeFunction0Action2(Entity* this) { void VaatiTransfiguredEyeFunction0Action3(Entity* this) { sub_08045A28(this); - if ((this->frames.all & 0x80) != 0) { + if ((this->frame & 0x80) != 0) { this->action = 2; if (this->type != 0) { if (this->actionDelay == 0) { @@ -181,7 +181,7 @@ void VaatiTransfiguredEyeFunction0Action4(Entity* this) { sub_08045A28(this); if (this->field_0xf == 0) { - if ((this->frames.all & 0x80) != 0) { + if ((this->frame & 0x80) != 0) { this->field_0xf = 0x20; } } else { @@ -219,7 +219,7 @@ void sub_08045A28(Entity* this) { if (this->field_0x82.HALF.LO == 0) { GetNextFrame(this); } - frames = this->frames.all & 0x70; + frames = this->frame & 0x70; type = this->type; if (type == 0) { sub_08045A00(this); @@ -288,7 +288,7 @@ void sub_08045A28(Entity* this) { PositionRelative(this->parent, this, 0, -0x10000); switch (this->field_0x82.HALF.HI) { case 0: - switch (this->frames.all & 0x70) { + switch (this->frame & 0x70) { case 0x10: this->field_0x82.HALF.HI = 2; sub_0801D2B4(this, 0x13b); @@ -302,7 +302,7 @@ void sub_08045A28(Entity* this) { } break; case 1: { - u32 temp = this->frames.all & 0x70; + u32 temp = this->frame & 0x70; switch (temp) { case 0: this->field_0x82.HALF.HI = temp; @@ -317,9 +317,9 @@ void sub_08045A28(Entity* this) { } } break; case 2: - switch (this->frames.all & 0x70) { + switch (this->frame & 0x70) { case 0: - this->field_0x82.HALF.HI = this->frames.all & 0x70; + this->field_0x82.HALF.HI = this->frame & 0x70; sub_0801D2B4(this, 0x13f); break; default: diff --git a/src/enemy/vaatiWrath.c b/src/enemy/vaatiWrath.c index 23063fc3..87acecc2 100644 --- a/src/enemy/vaatiWrath.c +++ b/src/enemy/vaatiWrath.c @@ -103,9 +103,9 @@ const s8 gUnk_080D0EB0[] = { 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x0 0xfd, 0xfd, 0xfd, 0xfd, 0xfd, 0xfd, 0xfd, 0xfd, 0xfd, 0xfd }; void VaatiWrath(Entity* this) { - if (((this->type == 0) && ((this->bitfield & 0x80) != 0)) && (this->currentHealth == 0)) { + if (((this->type == 0) && ((this->bitfield & 0x80) != 0)) && (this->health == 0)) { COLLISION_ON(this); - this->currentHealth = 0xff; + this->health = 0xff; if (--this->cutsceneBeh.HALF.LO == 0) { this->action = 0xd; this->subAction = 0; @@ -149,11 +149,11 @@ void VaatiWrathType0Action0(Entity* this) { this->subAction = bVar1; this->actionDelay = 120; this->spritePriority.b1 = 0; - this->height.HALF.HI = 0xffb0; + this->z.HALF.HI = 0xffb0; gRoomControls.cameraTarget = this; sub_080809D4(); } - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; this->field_0x6c.HALF.HI |= 1; this->field_0x78.HALF.HI = 0; this->field_0x7c.HALF.LO = 0x3c; @@ -169,11 +169,11 @@ void VaatiWrathType0Action1(Entity* this) { break; case 1: this->spritePriority.b1 = 1; - this->height.WORD += 0x8000; - if ((this->height.HALF.HI & 0x3f) == 0) { + this->z.WORD += 0x8000; + if ((this->z.HALF.HI & 0x3f) == 0) { SoundReq(SFX_1A9); } - if (-6 < this->height.HALF.HI) { + if (-6 < this->z.HALF.HI) { this->subAction = 2; SoundReq(SFX_1A9); } @@ -354,20 +354,20 @@ void VaatiWrathType0Action6(Entity* this) { if (this->actionDelay == 0) { type1 = ((VaatiWrathHeapStruct*)this->myHeap)->type1; GetNextFrame(type1); - if (type1->frames.all == 1) { - type1->frames.all &= 0xfe; + if (type1->frame == 1) { + type1->frame &= 0xfe; InitAnimationForceUpdate(this, 4); } else { - if (type1->frames.all == 2) { + if (type1->frame == 2) { Entity* type3 = CreateEnemy(VAATI_WRATH, 3); if (type3 != NULL) { type3->myHeap = this->myHeap; ((VaatiWrathHeapStruct*)this->myHeap)->type3 = type3; InitializeAnimation(((VaatiWrathHeapStruct*)this->myHeap)->type2, 0x14); - type1->frames.all &= 0xfd; + type1->frame &= 0xfd; } } else { - if ((type1->frames.all & 0x80) != 0) { + if ((type1->frame & 0x80) != 0) { sub_0804235C(this); } } @@ -456,7 +456,7 @@ void VaatiWrathType0ActionA(Entity* this) { this->subAction = 0; this->direction = 0; this->speed = 0x100; - this->hVelocity = 0x12000; + this->zVelocity = 0x12000; sub_0801D2B4(this, 0x16b); InitAnimationForceUpdate(this, 5); type1 = ((VaatiWrathHeapStruct*)this->myHeap)->type1; @@ -479,7 +479,7 @@ void VaatiWrathType0ActionB(Entity* this) { if (sub_08003FC4(this, 0x2000) == 0) { this->subAction = 1; this->actionDelay = 0xf0; - this->currentHealth = 8; + this->health = 8; this->hitType = 0x38; sub_08080964(0x14, 0); InitAnimationForceUpdate(this, 6); @@ -493,7 +493,7 @@ void VaatiWrathType0ActionB(Entity* this) { this->subAction = 2; this->actionDelay = 0x3c; this->hitType = 0x39; - this->currentHealth = 0xff; + this->health = 0xff; } break; default: @@ -520,8 +520,8 @@ void VaatiWrathType0ActionC(Entity* this) { } switch (this->subAction) { case 0: - this->height.WORD -= 0x8000; - if (this->height.HALF.HI < -4) { + this->z.WORD -= 0x8000; + if (this->z.HALF.HI < -4) { this->subAction = 1; this->actionDelay = 120; this->direction = 0x10; @@ -545,11 +545,11 @@ void VaatiWrathType0ActionC(Entity* this) { default: sub_08042004(this); entity = ((VaatiWrathHeapStruct*)this->myHeap)->type1; - if (entity->frames.b.f0) { - entity->frames.all &= 0xfe; + if (entity->frame & 1) { + entity->frame &= 0xfe; InitAnimationForceUpdate(this, 9); } else { - if (entity->frames.b.f3 != 0) { + if (entity->frame & 0x80) { sub_0804235C(this); } } @@ -620,7 +620,7 @@ void sub_08041BE8(Entity* this) { void sub_08041CD0(Entity* this) { GetNextFrame(((VaatiWrathHeapStruct*)this->myHeap)->type2); - if (this->frames.b.f3) { + if (this->frame & 0x80) { if (this->actionDelay != 0) { this->actionDelay--; } else { @@ -644,13 +644,13 @@ void sub_08041D14(Entity* this) { if (gEntCount < 0x46) { pEVar1 = CreateObject(OBJECT_B6, 0, 0); pEVar1->parent = this; - this->attachedEntity = pEVar1; + this->child = pEVar1; pEVar1 = CreateObject(OBJECT_B6, 1, 0); pEVar1->parent = this; this->subAction = 3; this->actionDelay = 0x96; this->field_0xf = 0; - this->spriteSettings.b.draw = 0; + this->spriteSettings.draw = 0; SoundReq(SFX_1C4); } } @@ -666,14 +666,14 @@ void sub_08041D84(Entity* this) { if ((0xb7 < this->field_0xf) && ((this->field_0xf & 7) == 0)) { sub_0801D2B4(((VaatiWrathHeapStruct*)this->myHeap)->type2, gUnk_080D0E80[(this->field_0xf - 0xb8) >> 3]); - sub_0801D2B4(this->attachedEntity, gUnk_080D0E80[(this->field_0xf - 0xb8) >> 3]); + sub_0801D2B4(this->child, gUnk_080D0E80[(this->field_0xf - 0xb8) >> 3]); } if (this->field_0xf == 0xe6) { DoFade(7, 4); } } else { this->subAction = 4; - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; sub_0801D2B4(this, 0x173); InitAnimationForceUpdate(this, 0xb); } @@ -802,7 +802,7 @@ u32 sub_08041FCC(Entity* this) { } void sub_08042004(Entity* this) { - this->height.HALF.HI = gUnk_080D0EA0[(++this->field_0x78.HALF.LO >> 4) & 7]; + this->z.HALF.HI = gUnk_080D0EA0[(++this->field_0x78.HALF.LO >> 4) & 7]; } void sub_08042028(Entity* this) { @@ -955,19 +955,19 @@ u32 sub_080422C0(Entity* this, u32 unk1) { GetNextFrame(((VaatiWrathHeapStruct*)this->myHeap)->type2); type1 = ((VaatiWrathHeapStruct*)this->myHeap)->type1; GetNextFrame(type1); - if (unk1 + 1 == (tmp = type1->frames.all)) { + if (unk1 + 1 == (tmp = type1->frame)) { child = CreateProjectile(0x21); if (child != NULL) { child->type = unk1; child->parent = this; - type1->frames.all &= ~tmp; + type1->frame &= ~tmp; } } else { - if (type1->frames.all == 4) { - type1->frames.all &= 0xfb; + if (type1->frame == 4) { + type1->frame &= 0xfb; InitAnimationForceUpdate(this, 3); } else { - if ((type1->frames.b.f3) != 0) { + if (type1->frame & 0x80) { InitAnimationForceUpdate(this, 0); type1->subAction = 0; InitializeAnimation(type1, 0xc); @@ -1009,7 +1009,7 @@ void VaatiWrathType0PreAction(Entity* this) { if (temp >= 0) { if (gPlayerState.field_0x2c == NULL) { if (gPlayerEntity.field_0x7a.HWORD == 0) { - if ((gPlayerEntity.height.HALF.HI & 0x8000U) == 0 || (gPlayerState.field_0xa != 0)) { + if ((gPlayerEntity.z.HALF.HI & 0x8000U) == 0 || (gPlayerState.field_0xa != 0)) { sub_08078AA8(0xb70, 0); gScreenTransition.field_0x38 |= 2; } diff --git a/src/enemy/vaatiWrathEye.c b/src/enemy/vaatiWrathEye.c index f33e4009..d476ca6c 100644 --- a/src/enemy/vaatiWrathEye.c +++ b/src/enemy/vaatiWrathEye.c @@ -52,7 +52,7 @@ void VaatiWrathEyeAction0(Entity* this) { void VaatiWrathEyeAction1(Entity* this) { sub_080485D8(this); GetNextFrame(this); - if ((this->frames.all & 0x80) != 0) { + if ((this->frame & 0x80) != 0) { this->action = 2; InitializeAnimation(this, 1); } @@ -85,7 +85,7 @@ void VaatiWrathEyeAction3(Entity* this) { direction = sub_080045D4(this->x.HALF.HI, this->y.HALF.HI, x, y); this->direction = direction; sub_0806F69C(this); - this->height.HALF.HI = this->parent->height.HALF.HI; + this->z.HALF.HI = this->parent->z.HALF.HI; if ((this->x.HALF.HI == x) && (this->y.HALF.HI == y)) { this->action = 4; this->actionDelay = 0x3c; @@ -101,7 +101,7 @@ void VaatiWrathEyeAction4(Entity* this) { } } else { GetNextFrame(this); - if ((this->frames.all & 0x80) != 0) { + if ((this->frame & 0x80) != 0) { this->action = 5; this->actionDelay = 0; } @@ -111,12 +111,12 @@ void VaatiWrathEyeAction4(Entity* this) { void VaatiWrathEyeAction5(Entity* this) { if (this->actionDelay != 0) { this->action = 6; - if (this->parent->currentHealth >= 0x15) { + if (this->parent->health >= 0x15) { this->actionDelay = 120; } else { this->actionDelay = 0x3c; } - this->attachedEntity = NULL; + this->child = NULL; InitializeAnimation(this, 5); SoundReq(SFX_19B); } @@ -133,17 +133,17 @@ void VaatiWrathEyeAction6(Entity* this) { InitializeAnimation(this, 6); } } else { - if (this->frames.b.f3) { + if (this->frame & 0x80) { this->action = 7; this->actionDelay = 120; this->field_0xf = 0; } else { - if (this->frames.b.f0 != 0) { - this->frames.all &= 0xfe; + if (this->frame & 1) { + this->frame &= 0xfe; pEVar3 = CreateProjectile(0x24); if (pEVar3 != NULL) { pEVar3->parent = this; - this->attachedEntity = pEVar3; + this->child = pEVar3; PositionRelative(this, pEVar3, 0, 0xc0000); } } @@ -158,7 +158,7 @@ void VaatiWrathEyeAction7(Entity* this) { this->action = 8; this->actionDelay = 0x3c; COLLISION_OFF(this); - this->spriteSettings.b.draw = 0; + this->spriteSettings.draw = 0; CreateFx(this, FX_REFLECT2, 0x40); this->parent->field_0x7a.HALF.HI |= 0x10 << this->type; } else { @@ -178,7 +178,7 @@ void VaatiWrathEyeAction8(Entity* this) { if (--this->actionDelay == 0) { this->action = 9; COLLISION_ON(this); - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; InitializeAnimation(this, 0); sub_080485FC(this); SoundReq(SFX_166); @@ -189,7 +189,7 @@ void VaatiWrathEyeAction8(Entity* this) { void VaatiWrathEyeAction9(Entity* this) { sub_080485FC(this); GetNextFrame(this); - if ((this->frames.all & 0x80) != 0) { + if ((this->frame & 0x80) != 0) { this->action = 4; this->actionDelay = 1; this->parent->field_0x7a.HALF.HI = (this->parent->field_0x7a.HALF.HI & 0xf) | (1 << this->type); @@ -208,5 +208,5 @@ void sub_080485FC(Entity* this) { ptr = &gUnk_080D1D98[this->type * 2]; sub_0806FA90(this->parent, this, ptr[0], ptr[1]); - this->height.HALF.HI = gUnk_080D1D78[this->type * 8 + (this->parent->field_0x78.HALF.LO >> 4 & 7)]; + this->z.HALF.HI = gUnk_080D1D78[this->type * 8 + (this->parent->field_0x78.HALF.LO >> 4 & 7)]; } diff --git a/src/enemy/wallMaster.c b/src/enemy/wallMaster.c index 7107cf9c..fdc73c5b 100644 --- a/src/enemy/wallMaster.c +++ b/src/enemy/wallMaster.c @@ -31,7 +31,7 @@ void sub_0802A454(Entity* this) { COLLISION_OFF(this); this->field_0x7c.HALF.HI = gPlayerEntity.x.HALF.HI; this->field_0x80.HWORD = gPlayerEntity.y.HALF.HI; - this->field_0x82.HWORD = gPlayerEntity.height.HALF.HI; + this->field_0x82.HWORD = gPlayerEntity.z.HALF.HI; if (this->action != 3) { InitializeAnimation(this, 1); } @@ -73,12 +73,12 @@ void sub_0802A534(Entity* this) { this->action = 2; this->actionDelay = 0x5a; COLLISION_ON(this); - this->spriteSettings.b.draw = 3; + this->spriteSettings.draw = 3; this->x.HALF.HI = ent->x.HALF.HI; this->y.HALF.HI = ent->y.HALF.HI; - this->height.HALF.HI = -0x80; + this->z.HALF.HI = -0x80; this->spritePriority.b1 = 1; - this->spriteSettings.b.shadow = 2; + this->spriteSettings.shadow = 2; InitializeAnimation(this, 2); sub_0802A7D0(this); } @@ -93,11 +93,11 @@ void sub_0802A5B8(Entity* this) { InitializeAnimation(this, 0); } } else { - this->height.HALF.HI += 3; - if (-1 < this->height.HALF.HI) { + this->z.HALF.HI += 3; + if (-1 < this->z.HALF.HI) { this->action = 3; - this->spriteSettings.b.draw = 1; - this->height.HALF.HI = 0; + this->spriteSettings.draw = 1; + this->z.HALF.HI = 0; InitializeAnimation(this, 1); } } @@ -109,23 +109,23 @@ void sub_0802A610(Entity* this) { GetNextFrame(this); sub_0802A7D0(this); - flags = this->frames.all & 0x80; + flags = this->frame & 0x80; if (flags) { this->action = 4; this->actionDelay = 0x1e; - } else if (this->frames.all & 1) { - this->frames.all = flags; + } else if (this->frame & 1) { + this->frame = flags; this->hitType = 0x75; } } void sub_0802A650(Entity* this) { sub_0802A7D0(this); - this->height.HALF.HI -= 2; - if (-0xa0 > this->height.HALF.HI) { + this->z.HALF.HI -= 2; + if (-0xa0 > this->z.HALF.HI) { this->action = 1; COLLISION_OFF(this); - this->spriteSettings.b.draw = 0; + this->spriteSettings.draw = 0; this->hitType = 0x74; this->field_0x78.HWORD = this->field_0x7c.BYTES.byte0 * 0x3c; } @@ -139,26 +139,26 @@ void sub_0802A69C(Entity* this) { gPlayerState.field_0x1a[0] |= 0x80; gPlayerEntity.x.HALF.HI = this->field_0x7c.HALF.HI; gPlayerEntity.y.HALF.HI = this->field_0x80.HWORD; - gPlayerEntity.height.HALF.HI = this->field_0x82.HWORD; + gPlayerEntity.z.HALF.HI = this->field_0x82.HWORD; - if (gPlayerEntity.height.HALF.HI != this->height.HALF.HI) { - if (gPlayerEntity.height.HALF.HI < this->height.HALF.HI) { - this->height.HALF.HI--; + if (gPlayerEntity.z.HALF.HI != this->z.HALF.HI) { + if (gPlayerEntity.z.HALF.HI < this->z.HALF.HI) { + this->z.HALF.HI--; } else { - this->height.HALF.HI++; + this->z.HALF.HI++; } } /* sigh... */ GetNextFrame(this); - flags = this->frames.all & 0x80; + flags = this->frame & 0x80; if (flags) { this->action = 6; this->actionDelay = 0x1e; - } else if (this->frames.all & 0x1) { - this->frames.all = flags; + } else if (this->frame & 0x1) { + this->frame = flags; this->spriteOffsetY = 3; - gPlayerEntity.spriteSettings.b.draw = 0; + gPlayerEntity.spriteSettings.draw = 0; } } @@ -168,7 +168,7 @@ void sub_0802A734(Entity* this) { sub_0805E5A8(); DoExitTransition(gUnk_0813AB1C[gArea.regret]); } else { - this->height.WORD -= 0x20000; + this->z.WORD -= 0x20000; gPlayerState.field_0xa |= 0x80; gPlayerState.field_0x1a[0] |= 0x80; } diff --git a/src/enemy/wallMaster2.c b/src/enemy/wallMaster2.c index d21ca8a2..cde62fa1 100644 --- a/src/enemy/wallMaster2.c +++ b/src/enemy/wallMaster2.c @@ -55,9 +55,9 @@ void sub_0802CCE0(Entity* this) { this->action = 1; this->actionDelay = 60; this->field_0xf = Random(); - this->spriteSettings.b.shadow = 2; + this->spriteSettings.shadow = 2; this->animationState = 0xff; - this->height.HALF.HI = -2; + this->z.HALF.HI = -2; this->collisionLayer = 3; tmp = Random(); this->field_0x7a.HALF.LO = tmp; @@ -125,13 +125,13 @@ void sub_0802CE68(Entity* this) { } sub_0802CFD8(this); GetNextFrame(this); - frames = this->frames.all & 0x80; + frames = this->frame & 0x80; if (frames) { this->action = 4; this->actionDelay = 30; - } else if (this->frames.all & 1) { - this->frames.all = frames; - gPlayerEntity.spriteSettings.b.draw = 0; + } else if (this->frame & 1) { + this->frame = frames; + gPlayerEntity.spriteSettings.draw = 0; } } @@ -141,9 +141,9 @@ void sub_0802CEF4(Entity* this) { sub_0805E5A8(); DoExitTransition(gUnk_0813AB1C[gArea.regret]); } else { - this->height.WORD -= 0x20000; - if (this->height.HALF.HI < -0x30) { - this->spriteSettings.b.shadow = 1; + this->z.WORD -= 0x20000; + if (this->z.HALF.HI < -0x30) { + this->spriteSettings.shadow = 1; } gPlayerState.field_0xa |= 0x80; gPlayerState.field_0x1a[0] |= 0x80; diff --git a/src/enemy/waterDrop.c b/src/enemy/waterDrop.c index d32ae94e..96ff44c2 100644 --- a/src/enemy/waterDrop.c +++ b/src/enemy/waterDrop.c @@ -22,7 +22,7 @@ void sub_0802A250(Entity* this) { this->action = 1; this->actionDelay = 0; - this->hVelocity = -0x30000; + this->zVelocity = -0x30000; this->speed = gUnk_080CD03C[Random() & 3]; this->direction = gUnk_080CD040[Random() & 3] + 0x18; this->collisionLayer = 2; @@ -45,16 +45,16 @@ void sub_0802A2B4(Entity* this) { } sub_0802A39C(this); - if (-8 < this->height.HALF.HI) { + if (-8 < this->z.HALF.HI) { sub_0802A334(this); } } void sub_0802A2FC(Entity* this) { GetNextFrame(this); - if (this->frames.all & 0x80) { + if (this->frame & 0x80) { DeleteEntity(this); - } else if (this->frames.all & 1) { + } else if (this->frame & 1) { COLLISION_OFF(this); } else { sub_0802A39C(this); diff --git a/src/enemy/wisp.c b/src/enemy/wisp.c index 734b47df..beb1ec43 100644 --- a/src/enemy/wisp.c +++ b/src/enemy/wisp.c @@ -34,7 +34,7 @@ void sub_08033564(Entity* this) { switch ((s32)bits & 0x3f) { case 0: this->action = 2; - this->spriteSettings.b.draw = FALSE; + this->spriteSettings.draw = FALSE; COLLISION_OFF(this); this->field_0x7c.HALF.LO = 0x27c; gPlayerState.flags |= 0x4000; @@ -47,15 +47,15 @@ void sub_08033564(Entity* this) { break; case 0xe: case 0x15: - this->currentHealth = 0; + this->health = 0; break; case 0x14: COLLISION_OFF(this); this->iframes = 0; - this->spriteSettings.b.draw = FALSE; + this->spriteSettings.draw = FALSE; ent = CreateFx(this, FX_DEATH, 0); if (ent != NULL) { - this->attachedEntity = ent; + this->child = ent; this->actionDelay = 0xe; CopyPosition(this, ent); } @@ -115,7 +115,7 @@ void sub_080336DC(Entity* this) { CreateDust(this); break; case 0xc: - this->spriteSettings.b.draw = TRUE; + this->spriteSettings.draw = TRUE; break; case 0x0: this->action = 1; |
