diff options
| author | notyourav <65437533+notyourav@users.noreply.github.com> | 2022-03-28 20:15:08 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-03-28 20:15:08 -0700 |
| commit | 6000b4f2d3bc4ef482496560e3a47b3ca2b7e2b8 (patch) | |
| tree | 78a3119e1cd63d4f3333a3cade6cc622cdcb6db1 /src/enemy | |
| parent | 52439a0fc8cf34aeb4612b43cb7a0894add0ae57 (diff) | |
| parent | 92240d43147dd36ed879ce1084f7ca6e35f1db96 (diff) | |
Merge pull request #477 from notyourav/mas
Name rest of entity fields
Diffstat (limited to 'src/enemy')
94 files changed, 1912 insertions, 1912 deletions
diff --git a/src/enemy/acroBandits.c b/src/enemy/acroBandits.c index d240ecab..0fd0c667 100644 --- a/src/enemy/acroBandits.c +++ b/src/enemy/acroBandits.c @@ -50,7 +50,7 @@ void AcroBandit(Entity* this) { index = sub_080012DC(this); if (index) { - if ((this->field_0x3a & 1) == 0) + if ((this->gustJarState & 1) == 0) sub_08032338(this); gUnk_080012C8[index](this); @@ -71,7 +71,7 @@ void AcroBandit_OnTick(Entity* this) { void AcroBandit_OnCollision(Entity* this) { Entity* brother; - if (this->bitfield != 0x80 && this->bitfield != 0x81) { + if (this->contactFlags != 0x80 && this->contactFlags != 0x81) { if (this->type == 1) { if (this->action < 7 && this->knockbackDuration != 0) { brother = this->child; @@ -161,8 +161,8 @@ void AcroBandit_Type0Action1(Entity* this) { u32 rand; s32 x, y; - if (this->actionDelay) { - this->actionDelay--; + if (this->timer) { + this->timer--; } else { if (sub_08049FDC(this, 1)) { rand = Random(); @@ -180,7 +180,7 @@ void AcroBandit_Type0Action1(Entity* this) { } void AcroBandit_Type0Action2(Entity* this) { - static const u8 actionDelays[] = { 2, 2, 2, 3, 3, 3, 3, 4 }; + static const u8 timers[] = { 2, 2, 2, 3, 3, 3, 3, 4 }; GetNextFrame(this); if (this->frame & 1) { @@ -189,7 +189,7 @@ void AcroBandit_Type0Action2(Entity* this) { } else { if (this->frame & ANIM_DONE) { this->action = 0x3; - this->actionDelay = actionDelays[Random() & 7]; + this->timer = timers[Random() & 7]; InitializeAnimation(this, 1); } } @@ -205,12 +205,12 @@ void AcroBandit_Type0Action3(Entity* this) { } InitializeAnimation(this, 3); } else { - if ((this->frame & 1) && this->actionDelay) { + if ((this->frame & 1) && this->timer) { this->frame &= 0xfe; - this->actionDelay--; + this->timer--; } GetNextFrame(this); - if (this->actionDelay == 0) { + if (this->timer == 0) { this->action = 4; COLLISION_OFF(this); InitializeAnimation(this, 2); @@ -219,11 +219,11 @@ void AcroBandit_Type0Action3(Entity* this) { } void AcroBandit_Type0Action4(Entity* this) { - static const u8 actionDelays[] = { 60, 60, 90, 120, 120, 120, 120, 150 }; + static const u8 timers[] = { 60, 60, 90, 120, 120, 120, 120, 150 }; GetNextFrame(this); if (this->frame & ANIM_DONE) { this->action = 1; - this->actionDelay = actionDelays[Random() & 7]; + this->timer = timers[Random() & 7]; this->spriteSettings.draw = 0; } } @@ -273,7 +273,7 @@ void AcroBandit_Type0Action5(Entity* this) { sub_08031E48(this, a); this->action = 6; - this->actionDelay = 20; + this->timer = 20; this->spritePriority.b0 = 7; InitializeAnimation(this, 7); } @@ -287,21 +287,21 @@ void AcroBandit_Type0Action5(Entity* this) { void AcroBandit_Type0Action6(Entity* this) { GetNextFrame(this); - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 7; COLLISION_OFF(this); - this->actionDelay = 5; + this->timer = 5; this->spriteSettings.draw = 0; } } void AcroBandit_Type0Action7(Entity* this) { - if ((this->actionDelay & 0xf) == 0) { - if (this->actionDelay == 0x50) { + if ((this->timer & 0xf) == 0) { + if (this->timer == 0x50) { DeleteEntity(this); } else { this->action = 1; - this->actionDelay = 0xb4; + this->timer = 0xb4; } } } @@ -309,7 +309,7 @@ void AcroBandit_Type0Action7(Entity* this) { void AcroBandit_Type0Action8(Entity* this) { if (this->frame & ANIM_DONE) { this->action = 1; - this->actionDelay = 0xb4; + this->timer = 0xb4; this->spriteSettings.draw = 0; } else { GetNextFrame(this); @@ -391,7 +391,7 @@ void AcroBandit_Type1Action2(Entity* this) { GravityUpdate(this, banditGravity[this->type2]); if (this->type2 * -0xe <= this->z.HALF.HI) { this->action = 3; - this->actionDelay = 20; + this->timer = 20; this->z.HALF.HI = this->type2 * -0xe; if (this->parent != NULL) this->spritePriority.b1 = 0; @@ -401,7 +401,7 @@ void AcroBandit_Type1Action2(Entity* this) { void AcroBandit_Type1Action3(Entity* this) { GetNextFrame(this); - if ((this->frame & ANIM_DONE) && ((this->parent != NULL) || (--this->actionDelay == 0))) { + if ((this->frame & ANIM_DONE) && ((this->parent != NULL) || (--this->timer == 0))) { this->action = 4; this->direction = sub_08049F84(this, 1); *(u8*)&this->field_0x76 = 0; @@ -475,7 +475,7 @@ void AcroBandit_Type1Action6(Entity* this) { Entity* tmp; u32 dir; - if (this->actionDelay == 0) { + if (this->timer == 0) { this->action = 7; dir = fallDirections[this->field_0x74.HALF.LO * 5 + this->type2]; this->direction = dir; @@ -493,9 +493,9 @@ void AcroBandit_Type1Action6(Entity* this) { if (this->child == NULL) { for (tmp = this->parent; tmp != NULL; tmp = tmp->parent) { if (tmp->health != 0) - tmp->actionDelay = 0; + tmp->timer = 0; } - this->actionDelay = 0; + this->timer = 0; } } @@ -522,7 +522,7 @@ void AcroBandit_Type1Action8(Entity* this) { void AcroBandit_Type1Action9(Entity* this) { if (GravityUpdate(this, Q_8_8(24.0)) == 0) { if (this->frame & ANIM_DONE) { - ((Entity*)this->field_0x7c.WORD)->actionDelay--; + ((Entity*)this->field_0x7c.WORD)->timer--; DeleteEntity(this); } else { @@ -536,7 +536,7 @@ void AcroBandit_Type1Action9(Entity* this) { void sub_08032290(Entity* this) { this->action = 6; - this->actionDelay = 12; + this->timer = 12; InitializeAnimation(this, 11); } @@ -574,6 +574,6 @@ void sub_080322E8(Entity* this) { } void sub_08032338(Entity* this) { - if ((((Entity*)this->field_0x7c.WORD)->actionDelay += 15) != 80) + if ((((Entity*)this->field_0x7c.WORD)->timer += 15) != 80) this->field_0x6c.HALF.LO = 0; } diff --git a/src/enemy/armos.c b/src/enemy/armos.c index 09c732e7..228c12bf 100644 --- a/src/enemy/armos.c +++ b/src/enemy/armos.c @@ -96,7 +96,7 @@ void sub_080301BC(ArmosEntity* this) { } void sub_080301D4(ArmosEntity* this) { - if ((super->action == 1) && (super->field_0x4c == &gPlayerEntity)) { + if ((super->action == 1) && (super->contactedEntity == &gPlayerEntity)) { super->iframes = -0x1e; } if ((super->health != 0) && (super->health != this->unk_81)) { @@ -126,7 +126,7 @@ void nullsub_17(ArmosEntity* this) { void sub_0803026C(ArmosEntity* this) { u16* ptr; sub_0804A720(super); - this->unk_80 = super->actionDelay; + this->unk_80 = super->timer; ptr = &gRoomTransition.armos_data.data[this->unk_80 * 2]; if (ptr[0] != 0) { super->x.HALF.HI = ptr[0]; @@ -170,8 +170,8 @@ void sub_08030338(ArmosEntity* this) { if (super->subAction == 0) { super->subAction = 1; } - uVar3 = super->actionDelay + 1; - super->actionDelay = (u8)uVar3; + uVar3 = super->timer + 1; + super->timer = (u8)uVar3; if ((uVar3 & 1) == 0) { return; } @@ -200,7 +200,7 @@ void sub_08030338(ArmosEntity* this) { return; } super->action = 6; - super->actionDelay = 0x1a; + super->timer = 0x1a; super->speed = 0x300; super->direction = 0x10; return; @@ -219,15 +219,15 @@ void sub_08030430(ArmosEntity* this) { if (this->unk_7a != 0) { this->unk_7a--; } - if (--super->actionDelay == 0) { + if (--super->timer == 0) { sub_080306C4(this); } } void sub_08030474(ArmosEntity* this) { - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = 3; - super->actionDelay = 1; + super->timer = 1; this->unk_7a = 0x3c; sub_080309E8(this); } else { @@ -259,7 +259,7 @@ END_NONMATCH void sub_080304F4(ArmosEntity* this) { LinearMoveUpdate(super); sub_080309A8(this); - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = 7; sub_080309C8(this, 5); sub_080307EC(this); @@ -302,7 +302,7 @@ ASM_FUNC("asm/non_matching/armos/sub_080305BC.inc", bool32 sub_080305BC(ArmosEnt bool32 sub_08030650(ArmosEntity* this) { if (super->type == 0) { - if (super->bitfield == 0x80) { + if (super->contactFlags == 0x80) { return 1; } } else if (this->unk_80 != 2) { diff --git a/src/enemy/ballChainSoldier.c b/src/enemy/ballChainSoldier.c index 9e1ef699..cd5e1600 100644 --- a/src/enemy/ballChainSoldier.c +++ b/src/enemy/ballChainSoldier.c @@ -133,15 +133,15 @@ void sub_0803E6E0(BallChainSoldierEntity* this) { if ((s8)this->unk_7e <= 0) { this->unk_7e = 0; super->action = 6; - super->actionDelay = 0x1e; + super->timer = 0x1e; InitAnimationForceUpdate(super, super->animationState + 0x20); } } void sub_0803E71C(BallChainSoldierEntity* this) { - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = 7; - super->actionDelay = 1; + super->timer = 1; this->unk_7c = gUnk_080D0724[super->animationState]; this->unk_7b = 0; this->unk_7f = 0xf6; @@ -153,8 +153,8 @@ void sub_0803E75C(BallChainSoldierEntity* this) { if ((super->frame & ANIM_DONE) == 0) { UpdateAnimationSingleFrame(super); } else { - if (--super->actionDelay == 0) { - super->actionDelay = 2; + if (--super->timer == 0) { + super->timer = 2; this->unk_7f++; } @@ -162,14 +162,14 @@ void sub_0803E75C(BallChainSoldierEntity* this) { this->unk_7e += 5; } else { super->action = 8; - super->actionDelay = 0x1e; + super->timer = 0x1e; InitScreenShake(8, 0); } } } void sub_0803E7B4(BallChainSoldierEntity* this) { - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = 9; } } @@ -178,7 +178,7 @@ void sub_0803E7CC(BallChainSoldierEntity* this) { this->unk_7e -= 2; if (this->unk_7e <= 0xa) { super->action = 0xa; - super->actionDelay = 0x5a; + super->timer = 0x5a; super->direction = DirectionFromAnimationState(super->animationState); this->unk_7c = 0; this->unk_7f = 0xfe; @@ -189,8 +189,8 @@ void sub_0803E7CC(BallChainSoldierEntity* this) { } void sub_0803E818(BallChainSoldierEntity* this) { - if (super->actionDelay) { - if (--super->actionDelay == 0) { + if (super->timer) { + if (--super->timer == 0) { COLLISION_ON(super->child); sub_0803E94C(this, 0); } diff --git a/src/enemy/beetle.c b/src/enemy/beetle.c index dc15be53..0abdeeeb 100644 --- a/src/enemy/beetle.c +++ b/src/enemy/beetle.c @@ -28,14 +28,14 @@ void Beetle_OnTick(Entity* this) { } void Beetle_OnCollision(Entity* this) { - switch (this->bitfield) { + switch (this->contactFlags) { case 0x80: if (gPlayerState.framestate == PL_STATE_CLIMB) { Beetle_OnTick(this); } else { this->action = 5; - this->actionDelay = 0xb4; - this->field_0xf = 0; + this->timer = 0xb4; + this->subtimer = 0; COLLISION_OFF(this); this->spritePriority.b0 = 3; CopyPositionAndSpriteOffset(&gPlayerEntity, this); @@ -61,7 +61,7 @@ void Beetle_OnDeath(Entity* this) { } else { Entity* ent = this->parent; if (ent != NULL) { - ent->field_0xf--; + ent->subtimer--; this->parent = NULL; } CreateDeathFx(this, 0xf0, 0); @@ -93,7 +93,7 @@ void sub_08021888(Entity* this) { void Beetle_Initialize(Entity* this) { sub_0804A720(this); this->action = 1; - this->field_0x1c = 1; + this->gustJarFlags = 1; InitializeAnimation(this, 3); } @@ -119,8 +119,8 @@ void sub_080218CC(Entity* this) { if (this->frame & ANIM_DONE) { this->action = 2; - this->actionDelay = (Random() & 0x38) + 8; - this->field_0xf = 1; + this->timer = (Random() & 0x38) + 8; + this->subtimer = 1; COLLISION_ON(this); this->speed = 0x180; InitializeAnimation(this, 0); @@ -140,8 +140,8 @@ void sub_08021984(Entity* this) { if (GravityUpdate(this, 0x1800) == 0) { this->action = 2; - this->actionDelay = 16; - this->field_0xf = 1; + this->timer = 16; + this->subtimer = 1; this->spriteSettings.draw = 1; this->speed = 0x180; ((u8*)&this->field_0x86)[0] = 60; @@ -153,9 +153,9 @@ void sub_08021984(Entity* this) { void sub_08021A10(Entity* this) { GetNextFrame(this); if (EntityInRectRadius(this, &gPlayerEntity, 120, 80) && sub_08021D00(this) == 0) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 3; - this->actionDelay = (Random() & 0x3f) + 30; + this->timer = (Random() & 0x3f) + 30; sub_08021D44(this, this->direction); InitializeAnimation(this, 2); } @@ -164,16 +164,16 @@ void sub_08021A10(Entity* this) { void sub_08021A64(Entity* this) { if (!sub_08021D00(this)) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 2; - this->actionDelay = (Random() & 0x1f) + 0x1e; + this->timer = (Random() & 0x1f) + 0x1e; InitializeAnimation(this, 0); } - if (--this->field_0xf == 0) { + if (--this->subtimer == 0) { u32 tmp; - this->field_0xf = 8; + this->subtimer = 8; tmp = sub_08049F84(this, 1); if (tmp == 0xff) { this->action = 7; @@ -190,14 +190,14 @@ void sub_08021A64(Entity* this) { void sub_08021AD8(Entity* this) { GetNextFrame(this); if (this->frame & 1) { - if (this->actionDelay) { + if (this->timer) { u32 tmp; - this->actionDelay = 0; + this->timer = 0; tmp = sub_08049F84(this, 1); if (tmp == 0xff) { this->action = 2; - this->actionDelay = '\b'; + this->timer = '\b'; InitializeAnimation(this, 0); return; } @@ -211,7 +211,7 @@ void sub_08021AD8(Entity* this) { if (this->frame & ANIM_DONE) { this->action = 2; - this->actionDelay = 20; + this->timer = 20; ((u8*)&this->field_0x86)[0] = 60; InitializeAnimation(this, 0); } @@ -228,11 +228,11 @@ void sub_08021B64(Entity* this) { if (sub_0807953C()) iVar4 = this->type * 3 + 8; - iVar4 = this->actionDelay - iVar4; + iVar4 = this->timer - iVar4; if (iVar4 < 0) iVar4 = 0; - this->actionDelay = (u8)iVar4; + this->timer = (u8)iVar4; } if (gPlayerState.flags & (PL_DISABLE_ITEMS | PL_CAPTURED)) @@ -253,7 +253,7 @@ void sub_08021B64(Entity* this) { gPlayerState.speed_modifier -= 0x50; gPlayerState.field_0xaa++; CopyPositionAndSpriteOffset(&gPlayerEntity, this); - this->x.HALF.HI += gUnk_080CB5E4[(this->field_0xf++ & 0xe) >> 1]; + this->x.HALF.HI += gUnk_080CB5E4[(this->subtimer++ & 0xe) >> 1]; this->z.HALF.HI--; GetNextFrame(this); } @@ -270,8 +270,8 @@ void sub_08021C58(Entity* this) { if (this->frame & ANIM_DONE) { this->action = 2; - this->actionDelay = 60; - this->field_0xf = 1; + this->timer = 60; + this->subtimer = 1; COLLISION_ON(this); this->spritePriority.b0 = 4; ((u8*)&this->field_0x86)[0] = 60; @@ -300,7 +300,7 @@ u32 sub_08021D00(Entity* this) { ret = 0; } else { this->action = 4; - this->actionDelay = 1; + this->timer = 1; this->zVelocity = Q_16_16(1.5); InitializeAnimation(this, 4); ret = 1; diff --git a/src/enemy/bobomb.c b/src/enemy/bobomb.c index 8e2a03a9..5bc0c6c8 100644 --- a/src/enemy/bobomb.c +++ b/src/enemy/bobomb.c @@ -30,8 +30,8 @@ void Bobomb_OnTick(Entity* this) { } void Bobomb_OnCollision(Entity* this) { - if (this->bitfield & 0x80) { - switch (this->bitfield & 0x7f) { + if (this->contactFlags & 0x80) { + switch (this->contactFlags & 0x7f) { case 0: case 1: if (this->field_0x82.HALF.LO) { @@ -58,7 +58,7 @@ void Bobomb_OnCollision(Entity* this) { case 2: this->action = 3; this->hitType = 0x6e; - this->field_0xf = 1; + this->subtimer = 1; this->zVelocity = Q_16_16(1.5); this->speed = 0; this->field_0x80.HALF.HI = 1; @@ -72,7 +72,7 @@ void Bobomb_OnCollision(Entity* this) { void Bobomb_OnGrabbed(Entity* this) { if (this->subAction < 3 && !sub_0806F520(this)) { this->subAction = 0; - this->field_0xf = 1; + this->subtimer = 1; this->z.HALF.HI = 0; if (this->field_0x82.HALF.LO != 2) { this->speed = this->field_0x82.HALF.LO ? 0x200 : 0x80; @@ -83,7 +83,7 @@ void Bobomb_OnGrabbed(Entity* this) { } else { this->z.HALF.HI = -1; gUnk_080CD600[this->subAction](this); - if (this->actionDelay != 0) { + if (this->timer != 0) { GetNextFrame(this); } } @@ -91,7 +91,7 @@ void Bobomb_OnGrabbed(Entity* this) { void sub_0802C820(Entity* this) { this->subAction = 1; - this->field_0x1d = 60; + this->gustJarTolerance = 60; } void sub_0802C82C(Entity* this) { @@ -104,7 +104,7 @@ void sub_0802C834(Entity* this) { void sub_0802C83C(Entity* this) { if (this->field_0x82.HALF.LO) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 3; switch (gPlayerEntity.animationState & 6) { case 2: @@ -122,7 +122,7 @@ void sub_0802C83C(Entity* this) { } } else { this->field_0x82.HALF.LO = 2; - this->actionDelay = 120; + this->timer = 120; InitializeAnimation(this, (this->direction >> 4) | 6); COLLISION_OFF(this); this->hitType = 0x6e; @@ -145,11 +145,11 @@ void Bobomb_OnDeath(Entity* this) { void sub_0802C8D8(Entity* this) { this->action = 1; - this->actionDelay = 0x3c; - this->field_0xf = 0; + this->timer = 0x3c; + this->subtimer = 0; this->direction = (Random() & 0x18) | 4; - this->field_0x16 = 0; - this->field_0x1c = 0x12; + this->carryFlags = 0; + this->gustJarFlags = 0x12; this->field_0x82.HALF.LO = 0; this->field_0x82.HALF.HI = 0; this->field_0x80.HALF.LO = 0; @@ -165,10 +165,10 @@ void sub_0802C91C(Entity* this) { sub_0800417E(this, this->collisions); InitializeAnimation(this, (this->direction >> 4) | 2); } - if (--this->actionDelay == 0) { + if (--this->timer == 0) { sub_0802CBC4(this); } else { - if ((this->actionDelay & 0xf) == 8) { + if ((this->timer & 0xf) == 8) { CreateDustSmall(this); } sub_0802CC18(this); @@ -178,8 +178,8 @@ void sub_0802C91C(Entity* this) { sub_0800417E(this, this->collisions); InitializeAnimation(this, this->direction >> 4); } - if (--this->actionDelay == 0) { - this->actionDelay = 60; + if (--this->timer == 0) { + this->timer = 60; this->direction = (this->direction + 8) & 0x1c; InitializeAnimation(this, this->direction >> 4); } @@ -202,7 +202,7 @@ void sub_0802C9D0(Entity* this) { void sub_0802CA10(Entity* this) { if (gPlayerState.heldObject != 5) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { sub_0802CBC4(this); } else { sub_0802CC18(this); @@ -217,7 +217,7 @@ void sub_0802CA10(Entity* this) { } void sub_0802CA6C(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { sub_0802CBC4(this); } else { sub_0802CC18(this); @@ -228,7 +228,7 @@ void sub_0802CA6C(Entity* this) { void sub_0802CA94(Entity* this) { this->action = 3; COLLISION_OFF(this); - this->field_0xf = 1; + this->subtimer = 1; this->spritePriority.b1 = 1; this->zVelocity = Q_16_16(1.5); this->speed = 0; @@ -239,7 +239,7 @@ void sub_0802CA94(Entity* this) { } void sub_0802CAF8(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { sub_0802CBC4(this); } else { if (this->field_0x80.HALF.HI && sub_080044EC(this, 0x2800) == 1) { @@ -247,8 +247,8 @@ void sub_0802CAF8(Entity* this) { } sub_0802CC18(this); RegisterCarryEntity(this); - if (this->field_0xf && this->z.HALF.HI == 0) { - this->field_0xf = 0; + if (this->subtimer && this->z.HALF.HI == 0) { + this->subtimer = 0; COLLISION_ON(this); this->hitType = 0x6e; } @@ -267,11 +267,11 @@ void sub_0802CB68(Entity* this) { this->direction |= 4; COLLISION_ON(this); if (this->field_0x82.HALF.LO) { - this->actionDelay = 200; + this->timer = 200; this->speed = 0x200; InitializeAnimation(this, (this->direction >> 4) | 2); } else { - this->actionDelay = 0x3c; + this->timer = 0x3c; this->speed = 0x80; InitializeAnimation(this, this->direction >> 4); } diff --git a/src/enemy/bombPeahat.c b/src/enemy/bombPeahat.c index f49316d5..8829ad3e 100644 --- a/src/enemy/bombPeahat.c +++ b/src/enemy/bombPeahat.c @@ -74,7 +74,7 @@ void BombPeahat_OnGrabbed(Entity* this) { void sub_0802A8E0(Entity* this) { this->subAction = 1; - this->field_0x1d = 60; + this->gustJarTolerance = 60; } void sub_0802A8EC(Entity* this) { @@ -101,11 +101,11 @@ void sub_0802A91C(Entity* this) { void sub_0802A924(Entity* this) { this->action = 1; this->subAction = 0; - this->actionDelay = 0; - this->field_0xf = 0; + this->timer = 0; + this->subtimer = 0; this->hitbox = (Hitbox*)&gUnk_080CD16C; #ifdef EU - this->field_0x3c |= 0x10; + this->collisionFlags |= 0x10; #endif this->z.HALF.HI = -0x30; this->field_0x80.HALF.LO = Random() & 1; @@ -125,14 +125,14 @@ void sub_0802A924(Entity* this) { } void sub_0802A9A8(Entity* this) { - if (this->field_0xf) { - this->field_0xf--; + if (this->subtimer) { + this->subtimer--; } else { - if (this->actionDelay) { - if (--this->actionDelay == 0) { + if (this->timer) { + if (--this->timer == 0) { this->action = 2; this->subAction = 0; - this->actionDelay = 0x40; + this->timer = 0x40; sub_0802ACDC(this, 8); } } else { @@ -149,7 +149,7 @@ void sub_0802A9A8(Entity* this) { this->direction = 0x18; } this->y.HALF.HI = gRoomControls.scroll_y + 0x40; - this->actionDelay = 0x80; + this->timer = 0x80; sub_0802ADDC(this); } sub_0802AC40(this); @@ -158,12 +158,12 @@ void sub_0802A9A8(Entity* this) { void sub_0802AA40(Entity* this) { sub_0802AC40(this); - if (--this->field_0xf == 0) { + if (--this->subtimer == 0) { sub_0802ACDC(this, 8); this->field_0x7a.HALF.HI++; } - if (this->actionDelay) { - this->actionDelay--; + if (this->timer) { + this->timer--; } else { Entity* ent = this->child; if (ent != NULL) { @@ -180,7 +180,7 @@ void sub_0802AA40(Entity* this) { this->speed = 0x180; this->field_0x7a.HALF.HI = 0; ent->field_0x80.HALF.LO = 1; - ent->actionDelay = 0x96; + ent->timer = 0x96; } } } @@ -189,7 +189,7 @@ void sub_0802AA40(Entity* this) { void sub_0802AAC0(Entity* this) { sub_0802AC40(this); - if (--this->field_0xf == 0) { + if (--this->subtimer == 0) { sub_0802AD1C(this, 4); } @@ -201,24 +201,24 @@ void sub_0802AAC0(Entity* this) { this->field_0x80.HALF.HI = 0; this->child = NULL; #ifdef EU - } else if (ent->actionDelay == 0) { + } else if (ent->timer == 0) { if (sub_080B1B44(COORD_TO_TILE(this), 1) == 0) { - if (EntityInRectRadius(this, &gPlayerEntity, 0x10, 0x10) && ent->field_0xf <= 0x50) { + if (EntityInRectRadius(this, &gPlayerEntity, 0x10, 0x10) && ent->subtimer <= 0x50) { this->field_0x80.HALF.HI = 0; } - } else if (ent->field_0xf <= 0x13) { + } else if (ent->subtimer <= 0x13) { this->field_0x80.HALF.HI = 0; } } #else - } else if ((ent->actionDelay == 0) && (ent->field_0xf <= 0x50)) { + } else if ((ent->timer == 0) && (ent->subtimer <= 0x50)) { this->field_0x80.HALF.HI = 0; } #endif } else { this->action = 4; - this->actionDelay = 0xc0; - this->field_0xf = 4; + this->timer = 0xc0; + this->subtimer = 4; this->field_0x80.HALF.LO ^= 1; #ifndef EU this->field_0x78.HALF.LO = 0; @@ -232,17 +232,17 @@ void sub_0802AAC0(Entity* this) { #ifdef EU void sub_0802AB40(Entity* this) { sub_0802AC40(this); - if (--this->actionDelay == 0) { + if (--this->timer == 0) { if (this->field_0x7a.HALF.LO <= 4) { this->action = 5; this->speed = 0; InitializeAnimation(this, this->type + 1); } else { - this->actionDelay = 0xc0; - this->field_0xf = 0x4; + this->timer = 0xc0; + this->subtimer = 0x4; this->field_0x80.HALF.LO ^= 1; } - } else if (--this->field_0xf == 0) { + } else if (--this->subtimer == 0) { sub_0802ACDC(this, 4); } } @@ -291,7 +291,7 @@ void sub_0802AC08(Entity* this) { if (this->frame & ANIM_DONE) { this->action = 2; this->subAction = 0; - this->actionDelay = 0x40; + this->timer = 0x40; this->speed = 0xc0; sub_0802ACDC(this, 8); sub_0802ADDC(this); @@ -343,7 +343,7 @@ void sub_0802ACDC(Entity* this, u32 param_2) { x = sub_080045B4(this, gRoomControls.scroll_x + 0xd0, gRoomControls.scroll_y + 0x60); } sub_08004596(this, x); - this->field_0xf = param_2; + this->subtimer = param_2; } void sub_0802AD1C(Entity* this, u32 param_2) { @@ -352,7 +352,7 @@ void sub_0802AD1C(Entity* this, u32 param_2) { u32 y = ent->y.HALF.HI - 0x18; u32 x = ent->x.HALF.HI; sub_08004596(this, sub_080045B4(this, x, y)); - this->field_0xf = param_2; + this->subtimer = param_2; } else { sub_0802ACDC(this, param_2); } @@ -375,8 +375,8 @@ void sub_0802AD54(Entity* this) { if (this->field_0x80.HALF.HI) { if (this->child == NULL || this->child->next == NULL) { this->action = 4; - this->actionDelay = 0xc0; - this->field_0xf = 4; + this->timer = 0xc0; + this->subtimer = 4; this->field_0x80.HALF.LO ^= 1; } } @@ -401,12 +401,12 @@ void sub_0802ADDC(Entity* this) { void sub_0802AE24(Entity* this) { this->action = 1; - this->actionDelay = 0xf0; + this->timer = 0xf0; this->zVelocity = Q_16_16(0.5); this->hitbox = (Hitbox*)&gUnk_080CD174; - this->field_0x3c = 3; - this->field_0x16 = 0; - this->field_0x1c = 2; + this->collisionFlags = 3; + this->carryFlags = 0; + this->gustJarFlags = 2; this->field_0x80.HALF.HI = 0; this->field_0x7a.HALF.HI = 1; InitializeAnimation(this, 3); @@ -473,8 +473,8 @@ void sub_0802AED4(Entity* this) { } } if (this->type2 != 0 && this->field_0x80.HALF.HI) { - this->actionDelay = 0; - this->field_0xf = 1; + this->timer = 0; + this->subtimer = 1; } } @@ -497,8 +497,8 @@ void sub_0802AF58(Entity* this) { void sub_0802AF74(Entity* this) { this->action = 3; this->subAction = 0; - if (this->actionDelay > 60) { - this->actionDelay = 60; + if (this->timer > 60) { + this->timer = 60; } GetNextFrame(this); } @@ -509,7 +509,7 @@ void sub_0802AF94(Entity* this) { void sub_0802AF9C(Entity* this) { GetNextFrame(this); - if (--this->actionDelay == 0) { + if (--this->timer == 0) { if (this->parent->field_0x7a.HALF.LO) { this->parent->field_0x7a.HALF.LO--; } @@ -518,9 +518,9 @@ void sub_0802AF9C(Entity* this) { } NONMATCH("asm/non_matching/bombPeahat/sub_0802AFC8.inc", void sub_0802AFC8(Entity* this)) { - u32 field_0xf = this->field_0xf; + u32 subtimer = this->subtimer; u32 flag = 8; - if (field_0xf < 0x29) { + if (subtimer < 0x29) { u32 tmp, tmp2; flag = 4; if (this->field_0x82.HWORD & 0x8000) { @@ -536,7 +536,7 @@ NONMATCH("asm/non_matching/bombPeahat/sub_0802AFC8.inc", void sub_0802AFC8(Entit tmp = 0x130 - (this->field_0x82.HWORD & 0xf0); SetAffineInfo(this, tmp, tmp, 0); } - if (this->field_0xf & flag) { + if (this->subtimer & flag) { this->palette.b.b0 = this->palette.b.b4; } else { this->palette.b.b0 = 0; @@ -566,23 +566,23 @@ void sub_0802B048(Entity* this) { action = this->action; if (action != 4 && this->field_0x80.HALF.LO) { - if (this->actionDelay) { - if (--this->actionDelay == 0) { - this->field_0xf = 0x50; + if (this->timer) { + if (--this->timer == 0) { + this->subtimer = 0x50; this->field_0x82.HWORD = 0; this->spriteRendering.b0 = 3; SetAffineInfo(this, 0x100, 0x100, 0); } } else { - if (this->field_0xf) { - if (--this->field_0xf == 0) { + if (this->subtimer) { + if (--this->subtimer == 0) { if (action == 2 && this->subAction == 1) { gPlayerState.heldObject = 0; } sub_0805EC60(this); this->action = 4; this->hitbox = (Hitbox*)&gUnk_080CD17C; - this->actionDelay = 0xf; + this->timer = 0xf; this->spriteSettings.draw = 0; COLLISION_ON(this); this->field_0x7a.HALF.HI = 0; @@ -606,8 +606,8 @@ void sub_0802B048(Entity* this) { void sub_0802B1A0(Entity* this) { this->action = 1; - this->actionDelay = 0; - this->field_0xf = 0x4f; + this->timer = 0; + this->subtimer = 0x4f; this->field_0x80.HALF.HI = 1; InitializeAnimation(this, 0); } @@ -616,8 +616,8 @@ void sub_0802B1A0(Entity* this) { void sub_0802B1BC(Entity* this) { Entity* ent; - if (this->actionDelay) { - this->actionDelay--; + if (this->timer) { + this->timer--; } ent = this->parent; @@ -645,8 +645,8 @@ void sub_0802B1BC(Entity* this) { void sub_0802B1BC(Entity* this) { Entity* ent; - if (this->actionDelay) { - this->actionDelay--; + if (this->timer) { + this->timer--; } ent = sub_0802B250(this); diff --git a/src/enemy/bombarossa.c b/src/enemy/bombarossa.c index 2119c5e0..f873f5c4 100644 --- a/src/enemy/bombarossa.c +++ b/src/enemy/bombarossa.c @@ -23,7 +23,7 @@ void Bombarossa(Entity* this) { void Bombarossa_OnTick(BombarossaEntity* this) { if (super->action == 0) { super->action = 1; - super->actionDelay = Random() & 0xf; + super->timer = Random() & 0xf; InitializeAnimation(super, 0); if (super->type != 0) { super->child = GetCurrentRoomProperty(super->type); @@ -31,7 +31,7 @@ void Bombarossa_OnTick(BombarossaEntity* this) { } } - super->z.HALF.HI = gUnk_080CEB50[(((++super->actionDelay) >> 4) & 0x7) + (super->type2 << 3)]; + super->z.HALF.HI = gUnk_080CEB50[(((++super->timer) >> 4) & 0x7) + (super->type2 << 3)]; GetNextFrame(super); if (super->type != 0) { @@ -41,7 +41,7 @@ void Bombarossa_OnTick(BombarossaEntity* this) { void Bombarossa_OnCollision(BombarossaEntity* this) { Entity* ent; - switch (super->bitfield & 0x7f) { + switch (super->contactFlags & 0x7f) { default: ent = CreateObject(OBJECT_20, 0, 0); if (ent != NULL) { diff --git a/src/enemy/bowMoblin.c b/src/enemy/bowMoblin.c index 35d3b011..88017722 100644 --- a/src/enemy/bowMoblin.c +++ b/src/enemy/bowMoblin.c @@ -59,11 +59,11 @@ void BowMoblin_OnCollision(BowMoblinEntity* this) { Create0x68FX(super, FX_STARS); } EnemyFunctionHandlerAfterCollision(super, (EntityActionArray)BowMoblin_Functions); - if ((super->bitfield & 0x80) != 0) { + if ((super->contactFlags & 0x80) != 0) { sub_0803C5F0(this); pEVar1 = super->child; if (pEVar1 != NULL) { - pEVar1->field_0xf++; + pEVar1->subtimer++; } } } @@ -82,9 +82,9 @@ void sub_0803C1E0(BowMoblinEntity* this) { this->unk_0x7a = 0; this->unk_0x82 = 1; - if (super->actionDelay) { + if (super->timer) { super->animationState = super->type2 << 1; - super->actionDelay = 0x1e; + super->timer = 0x1e; super->speed = 0x80; super->direction = super->type2 << 3; sub_0803C690(this); @@ -100,7 +100,7 @@ void sub_0803C234(BowMoblinEntity* this) { this->unk_0x81--; } mask = 0xff; - if (((--super->actionDelay) & mask) == 0) { + if (((--super->timer) & mask) == 0) { u8 tmp = ++this->unk_0x80; if ((tmp) > 0xf) { @@ -125,30 +125,30 @@ void sub_0803C234(BowMoblinEntity* this) { void sub_0803C2DC(BowMoblinEntity* this) { u32 res; - u32 actionDelay = --super->actionDelay; - if (actionDelay == 0) { + u32 timer = --super->timer; + if (timer == 0) { super->action = 3; - this->unk_0x82 = actionDelay; - this->unk_0x80 = actionDelay; + this->unk_0x82 = timer; + this->unk_0x80 = timer; super->animationState = 0x10; sub_0803C4B0(this); } else if (res = sub_0803C568(this), res) { this->unk_0x7b |= 0x1; } - if (super->field_0xf > 0xb) { + if (super->subtimer > 0xb) { if (this->unk_0x7b != 0) { sub_0803C5F0(this); } } else { - super->field_0xf++; + super->subtimer++; } sub_0803C6DC(this); } void sub_0803C344(BowMoblinEntity* this) { - if (--super->actionDelay == 0) { + if (--super->timer == 0) { switch (this->unk_0x82) { case 3: { super->action = 4; @@ -166,7 +166,7 @@ void sub_0803C344(BowMoblinEntity* this) { super->action = 2; super->speed = 0; tmp = Random() & 0x7; - super->actionDelay = (tmp << 1) + tmp + 0x40; + super->timer = (tmp << 1) + tmp + 0x40; break; } case 4: { @@ -180,12 +180,12 @@ void sub_0803C344(BowMoblinEntity* this) { this->unk_0x82 = 1; super->speed = 0x80; tmp = (Random() & 0x7); - super->actionDelay = (tmp << 1) + tmp + 0x22; + super->timer = (tmp << 1) + tmp + 0x22; break; } } - super->field_0xf = 0; + super->subtimer = 0; super->animationState = ((super->direction + 4) & 0x18) >> 2; sub_0803C690(this); } @@ -193,16 +193,16 @@ void sub_0803C344(BowMoblinEntity* this) { } void sub_0803C400(BowMoblinEntity* this) { - if (super->field_0xf) { + if (super->subtimer) { u8 mask; - super->field_0xf--; + super->subtimer--; mask = 0xff; - if ((super->field_0xf & mask) == 0) { + if ((super->subtimer & mask) == 0) { if (this->unk_0x82 == 3) { this->unk_0x7a++; if ((this->unk_0x7a & mask) <= 2) { if (Random() & 0xc0) { - super->actionDelay = 0; + super->timer = 0; sub_0803C690(this); sub_0803C6DC(this); return; @@ -213,7 +213,7 @@ void sub_0803C400(BowMoblinEntity* this) { } } else { Entity* projectile; - switch (++super->actionDelay) { + switch (++super->timer) { case 1: super->direction = super->animationState << 2; projectile = CreateProjectileWithParent(super, ARROW_PROJECTILE, super->animationState >> 1); @@ -224,8 +224,8 @@ void sub_0803C400(BowMoblinEntity* this) { } break; case 24: - super->actionDelay = 0; - super->field_0xf = 0x20; + super->timer = 0; + super->subtimer = 0x20; break; } @@ -238,9 +238,9 @@ void sub_0803C400(BowMoblinEntity* this) { void sub_0803C4B0(BowMoblinEntity* this) { u32 dir; - super->field_0xf = 0; + super->subtimer = 0; if (this->unk_0x82 == 1) { - super->actionDelay = gUnk_080CFFA4[Random() & 7]; + super->timer = gUnk_080CFFA4[Random() & 7]; super->speed = 0x80; if (sub_08049FA0(super)) { dir = Random(); @@ -252,14 +252,14 @@ void sub_0803C4B0(BowMoblinEntity* this) { dir += gUnk_080CFFAC[Random() & 0xf]; } else { dir += gUnk_080CFFAC[Random() & 0x7]; - super->actionDelay += 0x10; + super->timer += 0x10; this->unk_0x83--; } dir = (super->direction = (dir + 4) & 0x18) >> 2; } } else { - super->actionDelay = 0xc; - super->speed = super->field_0xf; + super->timer = 0xc; + super->speed = super->subtimer; dir = super->direction >> 2; } if (dir != super->animationState) { @@ -319,14 +319,14 @@ void sub_0803C634(BowMoblinEntity* this) { super->direction = super->animationState << 2; this->unk_0x83 = 0; sub_0803C664(this); - super->actionDelay <<= 1; + super->timer <<= 1; this->unk_0x82 = 4; } void sub_0803C664(BowMoblinEntity* this) { super->action = 3; - super->actionDelay = 0x20; - super->field_0xf = 0; + super->timer = 0x20; + super->subtimer = 0; this->unk_0x80 = 0; this->unk_0x7b = 0; super->speed = 0; diff --git a/src/enemy/businessScrub.c b/src/enemy/businessScrub.c index 2e84061e..2f311941 100644 --- a/src/enemy/businessScrub.c +++ b/src/enemy/businessScrub.c @@ -55,10 +55,10 @@ void BusinessScrub_OnTick(Entity* this) { void BusinessScrub_OnCollision(Entity* this) { Entity* pEVar1; - if (this->hitType == 1 && (this->bitfield & 0x7f) == 0x42) { + if (this->hitType == 1 && (this->contactFlags & 0x7f) == 0x42) { this->action = 3; this->subAction = 0; - this->actionDelay = 0x28; + this->timer = 0x28; COLLISION_OFF(this); sub_080290E0(this, 4); pEVar1 = CreateFx(this, FX_BUSH, 0); @@ -74,7 +74,7 @@ void BusinessScrub_OnGrabbed(Entity* this) { } void sub_08028994(Entity* this) { - this->field_0xf = 0; + this->subtimer = 0; this->field_0x78.HWORD = this->x.HALF.HI; this->field_0x7a.HWORD = this->y.HALF.HI; this->animationState = 0; @@ -82,12 +82,12 @@ void sub_08028994(Entity* this) { sub_08028E9C(this); if ((*(u8*)this->field_0x7c.WORD & 1) || CheckFlags(this->field_0x86.HWORD)) { this->action = 4; - this->actionDelay = 0x78; + this->timer = 0x78; this->spritePriority.b1 = 1; sub_0802925C(this); sub_080290E0(this, 0); } else { - this->actionDelay = 0; + this->timer = 0; this->field_0x76.HWORD = COORD_TO_TILE(this); this->field_0x74.HWORD = GetTileIndex(this->field_0x76.HWORD, this->collisionLayer); this->hurtType = 0x41; @@ -96,12 +96,12 @@ void sub_08028994(Entity* this) { } void sub_08028A48(Entity* this) { - if (this->actionDelay) { - this->actionDelay--; + if (this->timer) { + this->timer--; } else if (sub_08028F98(this, 0)) { sub_08029078(this); this->subAction = 0; - this->field_0xf = 1; + this->subtimer = 1; } } @@ -114,25 +114,25 @@ void sub_08028A74(Entity* this) { unk = 1; if (this->frame & ANIM_DONE) { this->subAction = 1; - this->actionDelay = 0x3c; - this->field_0xf = 0x10; + this->timer = 0x3c; + this->subtimer = 0x10; sub_08028FDC(this); sub_080290E0(this, 1); } break; case 1: unk = 1; - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->subAction = 2; - this->actionDelay = 0x20; - this->field_0xf = 0; + this->timer = 0x20; + this->subtimer = 0; sub_08028FDC(this); sub_080290E0(this, 2); - } else if (--this->field_0xf == 0) { + } else if (--this->subtimer == 0) { if (sub_08028FDC(this)) { sub_080290E0(this, 1); } - this->field_0xf = 0x10; + this->subtimer = 0x10; } break; case 2: @@ -152,23 +152,23 @@ void sub_08028A74(Entity* this) { unk = 2; if (this->frame & ANIM_DONE) { this->subAction = 4; - this->actionDelay = 0x50; + this->timer = 0x50; sub_080290E0(this, 1); } break; case 4: unk = 2; - if (--this->actionDelay == 0) { + if (--this->timer == 0) { if (sub_08028F98(this, 0)) { this->subAction = 1; - this->actionDelay = 0x3c; - this->field_0xf = 0x10; + this->timer = 0x3c; + this->subtimer = 0x10; sub_08028FDC(this); } else { sub_08028FFC(this); this->subAction = 0; - this->actionDelay = 0x50; - this->field_0xf = 0; + this->timer = 0x50; + this->subtimer = 0; } return; } @@ -178,8 +178,8 @@ void sub_08028A74(Entity* this) { if (!sub_08028F98(this, unk)) { sub_08028FFC(this); this->subAction = 0; - this->actionDelay = 0x50; - this->field_0xf = 0; + this->timer = 0x50; + this->subtimer = 0; } } @@ -188,7 +188,7 @@ void sub_08028BC4(Entity* this) { switch (this->subAction) { case 0: - if (this->actionDelay == 0) { + if (this->timer == 0) { if (this->frame & ANIM_DONE) { this->subAction = 1; sub_08028FDC(this); @@ -196,15 +196,15 @@ void sub_08028BC4(Entity* this) { this->spritePriority.b1 = 1; } } else { - this->actionDelay--; + this->timer--; } break; case 1: if (this->frame & ANIM_DONE) { this->action = 4; this->subAction = 0; - this->actionDelay = 0x1e; - this->field_0xf = 5; + this->timer = 0x1e; + this->subtimer = 5; sub_080290E0(this, 0); iVar1 = Create0x68FX(this, FX_STARS); if (iVar1 != NULL) { @@ -226,10 +226,10 @@ extern void sub_0804AA1C(Entity*); void sub_08028F0C(Entity*); void sub_08028C84(Entity* this) { - if (--this->actionDelay == 0) { - this->actionDelay = 0x30; - if (this->field_0xf) { - if (--this->field_0xf == 0) { + if (--this->timer == 0) { + this->timer = 0x30; + if (this->subtimer) { + if (--this->subtimer == 0) { sub_0804AA1C(this); } } else if (sub_08028FDC(this) || this->field_0x80.HALF.LO) { @@ -264,7 +264,7 @@ void sub_08028CE8(Entity* this) { CreateItemEntity(offer->offeredItem, subtype, 0); this->action = 6; - this->actionDelay = 4; + this->timer = 4; this->field_0x80.HALF.HI = 0; sub_080290E0(this, 3); #if defined(USA) || defined(DEMO_USA) @@ -273,12 +273,12 @@ void sub_08028CE8(Entity* this) { return; case 1: CreateItemEntity(offer->offeredItem, offer->field_0x9, 0); - this->actionDelay = 4; + this->timer = 4; sub_0802922C(this); return; case 2: CreateItemEntity(offer->offeredItem, offer->field_0x9, 0); - this->actionDelay = 8; + this->timer = 8; sub_0802922C(this); return; } @@ -292,7 +292,7 @@ void sub_08028CE8(Entity* this) { sub_0800445C(this); this->action = 4; - this->actionDelay = 0x30; + this->timer = 0x30; sub_080290E0(this, 0); } @@ -306,7 +306,7 @@ void sub_08028DE8(Entity* this) { MessageFromTarget(0x2902); this->action = 4; this->field_0x80.HALF.HI = 0; - this->actionDelay = 1; + this->timer = 1; sub_08028EDC(this); SetPlayerControl(0); sub_0800445C(this); @@ -320,7 +320,7 @@ void sub_08028E40(Entity* this) { this->action = 4; this->subAction = gMessage.doTextBox & 0x7f; - this->actionDelay = 1; + this->timer = 1; if (CheckLocalFlag(offer->field_0xa) == 0) { SetLocalFlag(offer->field_0xa); } @@ -333,7 +333,7 @@ void sub_08028E40(Entity* this) { void sub_08028E84(Entity* this) { if (UpdateFuseInteraction(this)) { this->action = 4; - this->actionDelay = 1; + this->timer = 1; } } @@ -370,8 +370,8 @@ void sub_08028F0C(Entity* this) { this->direction = (GetAnimationState(this) << 3); sub_080290E0(this, 3); this->field_0x80.HALF.LO = 1; - this->actionDelay = 0x20; - this->field_0xf = 0; + this->timer = 0x20; + this->subtimer = 0; if (sub_08029198(offer)) { dialog = offer->field_0x6; } else { @@ -451,13 +451,13 @@ void sub_080290E0(Entity* this, u32 param_2) { } void sub_080290FC(Entity* this) { - if (this->actionDelay != 0) { - if (--this->actionDelay < 0x10 && (this->actionDelay & 1) == 0) { + if (this->timer != 0) { + if (--this->timer < 0x10 && (this->timer & 1) == 0) { s32 sVar3 = (this->direction & 0x10) ? -1 : 1; if ((this->direction & 8)) { - this->x.HALF.HI += (this->actionDelay & 8) ? -sVar3 : sVar3; + this->x.HALF.HI += (this->timer & 8) ? -sVar3 : sVar3; } else { - this->y.HALF.HI += (this->actionDelay & 8) ? sVar3 : -sVar3; + this->y.HALF.HI += (this->timer & 8) ? sVar3 : -sVar3; } } } diff --git a/src/enemy/businessScrubPrologue.c b/src/enemy/businessScrubPrologue.c index 4366c0ab..52c2f05c 100644 --- a/src/enemy/businessScrubPrologue.c +++ b/src/enemy/businessScrubPrologue.c @@ -41,10 +41,10 @@ void BusinessScrubPrologue_OnTick(BusinessScrubPrologueEntity* this) { void BusinessScrubPrologue_OnCollision(BusinessScrubPrologueEntity* this) { Entity* ent; if (super->hitType == 1) { - if ((super->bitfield & 0x7f) == 0x42) { + if ((super->contactFlags & 0x7f) == 0x42) { super->action = 4; super->subAction = 0; - super->actionDelay = 0x28; + super->timer = 0x28; super->flags &= ~ENT_COLLIDE; sub_08046030(this, 4); ent = CreateFx(super, FX_BUSH, 0); @@ -63,13 +63,13 @@ void BusinessScrubPrologue_OnGrabbed(BusinessScrubPrologueEntity* this) { } void sub_08045C3C(BusinessScrubPrologueEntity* this) { - super->field_0xf = 0; + super->subtimer = 0; this->unk_78 = super->x.HALF.HI; this->unk_7a = super->y.HALF.HI; super->animationState = 0; super->direction = 0x10; super->action = 5; - super->actionDelay = 0x78; + super->timer = 0x78; super->spritePriority.b1 = 1; super->spriteSettings.draw = 1; sub_08046030(this, 0); @@ -80,12 +80,12 @@ void sub_08045C3C(BusinessScrubPrologueEntity* this) { void sub_08045CA4(BusinessScrubPrologueEntity* this) { super->spriteSettings.draw = 0; - if (super->actionDelay) { - super->actionDelay--; + if (super->timer) { + super->timer--; } else if (sub_08045F54(this, 0)) { sub_08045FF0(this); super->subAction = 0; - super->field_0xf = 1; + super->subtimer = 1; } } @@ -102,18 +102,18 @@ void sub_08045CE0(BusinessScrubPrologueEntity* this) { r6 = 1; if (super->frame & ANIM_DONE) { super->subAction = 1; - super->actionDelay = 0x3c; - super->field_0xf = 0x10; + super->timer = 0x3c; + super->subtimer = 0x10; sub_08045F98(this); sub_08046030(this, 1); } break; case 1: r6 = 1; - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->subAction = 2; - super->actionDelay = 0x20; - super->field_0xf = 0; + super->timer = 0x20; + super->subtimer = 0; sub_08045F98(this); sub_08046030(this, 2); } @@ -135,22 +135,22 @@ void sub_08045CE0(BusinessScrubPrologueEntity* this) { r6 = 2; if (super->frame & ANIM_DONE) { super->subAction = 4; - super->actionDelay = 0x50; + super->timer = 0x50; sub_08046030(this, 1); } break; case 4: r6 = 2; - if (--super->actionDelay == 0) { + if (--super->timer == 0) { if (sub_08045F54(this, 0)) { super->subAction = 1; - super->actionDelay = 0x3c; - super->field_0xf = 0x10; + super->timer = 0x3c; + super->subtimer = 0x10; sub_08045F98(this); } else { sub_08045FA0(this); - super->actionDelay = 0x50; - super->field_0xf = 0; + super->timer = 0x50; + super->subtimer = 0; } } break; @@ -159,8 +159,8 @@ void sub_08045CE0(BusinessScrubPrologueEntity* this) { if (sub_08045F54(this, r6) == 0) { sub_08045FA0(this); super->subAction = 0; - super->actionDelay = 0; - super->field_0xf = 0; + super->timer = 0; + super->subtimer = 0; } } @@ -169,7 +169,7 @@ void sub_08045E14(BusinessScrubPrologueEntity* this) { gPlayerState.field_0x27[0] = 0xff; switch (super->subAction) { case 0: - if (super->actionDelay == 0) { + if (super->timer == 0) { if (super->frame & ANIM_DONE) { super->subAction = 1; sub_08045F98(this); @@ -177,7 +177,7 @@ void sub_08045E14(BusinessScrubPrologueEntity* this) { super->spritePriority.b1 = 1; } } else { - super->actionDelay--; + super->timer--; } break; case 1: @@ -210,8 +210,8 @@ void sub_08045ED4(BusinessScrubPrologueEntity* this) { void sub_08045EDC(BusinessScrubPrologueEntity* this) { if (super->subAction == 0) { super->subAction++; - super->actionDelay = 0x20; - super->field_0xf = 0; + super->timer = 0x20; + super->subtimer = 0; sub_08045F98(this); sub_08046030(this, 2); } @@ -283,9 +283,9 @@ void sub_08046030(BusinessScrubPrologueEntity* this, u32 arg2) { } void sub_0804604C(BusinessScrubPrologueEntity* this) { - if (super->actionDelay) { - if (--super->actionDelay <= 0xf) { - super->spriteOffsetY = gUnk_080D1A3E[super->actionDelay]; + if (super->timer) { + if (--super->timer <= 0xf) { + super->spriteOffsetY = gUnk_080D1A3E[super->timer]; } } } diff --git a/src/enemy/chaser.c b/src/enemy/chaser.c index 24dca7cf..ad5f00d2 100644 --- a/src/enemy/chaser.c +++ b/src/enemy/chaser.c @@ -31,8 +31,8 @@ void sub_0802B530(Entity* this) { } void sub_0802B540(Entity* this) { - if (this->actionDelay) { - this->actionDelay--; + if (this->timer) { + this->timer--; } else { u32 direction = sub_0804A024(this, 1, 0xc); if (direction != 0xff) { @@ -45,7 +45,7 @@ void sub_0802B540(Entity* this) { void sub_0802B56C(Entity* this) { GetNextFrame(this); - if (this->bitfield & 0x80) { + if (this->contactFlags & 0x80) { this->speed = 0x40; } @@ -66,7 +66,7 @@ void sub_0802B5C8(Entity* this) { GetNextFrame(this); if (this->frame & ANIM_DONE) { this->action = 1; - this->actionDelay = 30; + this->timer = 30; InitializeAnimation(this, 0); } } diff --git a/src/enemy/chuchu.c b/src/enemy/chuchu.c index 856acda5..a162e302 100644 --- a/src/enemy/chuchu.c +++ b/src/enemy/chuchu.c @@ -46,7 +46,7 @@ void Chuchu(Entity* this) { /* ... */ break; case 2: - this->field_0x3a &= 0xfe; + this->gustJarState &= 0xfe; if (index != this->field_0x80.HALF.HI) { switch (this->type) { case 0: @@ -97,7 +97,7 @@ void Chuchu_OnCollision(Entity* this) { u8 health; if (this->type == 2) { - if (this->bitfield == 0x8e || this->bitfield == 0x95) { + if (this->contactFlags == 0x8e || this->contactFlags == 0x95) { COLLISION_OFF(this); this->health = 0; } @@ -105,7 +105,7 @@ void Chuchu_OnCollision(Entity* this) { health = this->health; if (health) { - if (this->bitfield == 0x94) { + if (this->contactFlags == 0x94) { sub_0801FB68(this); Create0x68FX(this, FX_STARS); InitializeAnimation(this, 6); @@ -175,8 +175,8 @@ void sub_0801F0C8(Entity* this) { GetNextFrame(this); if (this->frame & ANIM_DONE) { this->action = 3; - this->actionDelay = (Random() & 3) + 0xc; - this->field_0xf = Random(); + this->timer = (Random() & 3) + 0xc; + this->subtimer = Random(); this->direction = sub_08049F84(this, 1); COLLISION_ON(this); this->spritePriority.b0 = 4; @@ -189,17 +189,17 @@ void sub_0801F12C(Entity* this) { if (sub_0801FBD0(this)) { sub_0801F328(this); } else { - if ((this->field_0xf++ & 7) == 0) { + if ((this->subtimer++ & 7) == 0) { this->direction = sub_08049F84(this, 1); } ProcessMovement0(this); GetNextFrame(this); - if (--this->actionDelay == 0) { + if (--this->timer == 0) { if (PlayerInRange(this, 1, 0x38)) { this->action = 4; Chuchu_JumpAtPlayer(this); } else if (PlayerInRange(this, 1, 0x48)) { - this->actionDelay = (Random() & 3) + 0xc; + this->timer = (Random() & 3) + 0xc; } else { sub_0801F328(this); } @@ -231,7 +231,7 @@ void sub_0801F1B0(Entity* this) { } void sub_0801F228(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 3; this->direction = sub_08049F84(this, 1); } @@ -245,7 +245,7 @@ void sub_0801F250(Entity* this) { } void sub_0801F270(Entity* this) { - if ((this->field_0xf++ & 7) == 0) { + if ((this->subtimer++ & 7) == 0) { this->direction = sub_08049F84(this, 1); } @@ -254,14 +254,14 @@ void sub_0801F270(Entity* this) { if (sub_0801FBD0(this)) return; - if (--this->actionDelay) + if (--this->timer) return; if (this->field_0x80.HALF.HI == 0) { this->action = 2; InitializeAnimation(this, 4); } else { - this->actionDelay = 8; + this->timer = 8; } } @@ -291,7 +291,7 @@ void sub_0801F328(Entity* this) { void sub_0801F340(Entity* this) { this->action = 5; - this->actionDelay = 60; + this->timer = 60; this->speed = 0x20; this->hitType = 92; InitializeAnimation(this, 2); @@ -299,8 +299,8 @@ void sub_0801F340(Entity* this) { void sub_0801F360(Entity* this) { this->action = 7; - this->actionDelay = (Random() & 0x38) + 0xb4; - this->field_0xf = Random(); + this->timer = (Random() & 0x38) + 0xb4; + this->subtimer = Random(); this->direction = sub_08049F84(this, 1); this->spritePriority.b1 = 2; this->spritePriority.b0 = 6; @@ -333,14 +333,14 @@ void sub_0801F3AC(Entity* this) { void sub_0801F428(Entity* this) { sub_0804A720(this); this->action = 1; - this->actionDelay = Random(); + this->timer = Random(); this->field_0x80.HALF.LO = this->health; this->field_0x82.HALF.LO = 0; if (this->type2 == 0) return; this->action = 3; - this->field_0xf = 30; + this->subtimer = 30; #ifdef EU this->direction = sub_08049F84(this, 1); @@ -364,7 +364,7 @@ void sub_0801F494(Entity* this) { GetNextFrame(this); if (this->frame & ANIM_DONE) { this->action = 3; - this->field_0xf = 30; + this->subtimer = 30; this->direction = sub_08049F84(this, 1); COLLISION_ON(this); this->spritePriority.b0 = 4; @@ -375,7 +375,7 @@ void sub_0801F494(Entity* this) { void sub_0801F4EC(Entity* this) { GetNextFrame(this); - if (--this->field_0xf == 0) + if (--this->subtimer == 0) this->action = 4; } @@ -384,7 +384,7 @@ void sub_0801F508(Entity* this) { this->field_0x82.HALF.HI = 0; sub_0801F730(this); } else { - u8 tmp = ++this->actionDelay & 7; + u8 tmp = ++this->timer & 7; if (tmp == 0 && PlayerInRange(this, 1, 0x38)) { if (Random() & 1) { this->action = 5; @@ -424,7 +424,7 @@ void sub_0801F584(Entity* this) { sub_0801F730(this); } else { this->action = 6; - this->field_0xf = 60; + this->subtimer = 60; this->speed = 0x20; this->hitType = 92; InitializeAnimation(this, 2); @@ -433,7 +433,7 @@ void sub_0801F584(Entity* this) { } void sub_0801F61C(Entity* this) { - if (--this->field_0xf == 0) + if (--this->subtimer == 0) this->action = 4; GetNextFrame(this); } @@ -442,7 +442,7 @@ void sub_0801F638(Entity* this) { GetNextFrame(this); if (this->frame & ANIM_DONE) { this->action = 8; - this->field_0xf = 30; + this->subtimer = 30; this->direction = sub_08049F84(this, 1); this->spritePriority.b1 = 2; this->spritePriority.b0 = 6; @@ -519,7 +519,7 @@ void sub_0801F764(Entity* this) { void sub_0801F7D8(Entity* this) { sub_0804A720(this); this->action = 1; - this->actionDelay = Random(); + this->timer = Random(); this->field_0x80.HALF.LO = this->health; this->field_0x82.HALF.LO = 0; } @@ -548,8 +548,8 @@ void sub_0801F840(Entity* this) { void sub_0801F884(Entity* this) { GetNextFrame(this); - if (this->field_0xf) { - this->field_0xf--; + if (this->subtimer) { + this->subtimer--; } else { Entity* ent = Create0x68FX(this, FX_LIGHTNING_STRIKE); if (ent != NULL) { @@ -567,7 +567,7 @@ void sub_0801F8C0(Entity* this) { } else if (sub_08049FDC(this, 1) == 0) { sub_0801F730(this); } else { - u8 tmp = ++this->actionDelay & 7; + u8 tmp = ++this->timer & 7; if (tmp == 0 && sub_08049F1C(this, gUnk_020000B0, 0x38)) { this->action = 5; Chuchu_JumpAtPlayer(this); @@ -599,7 +599,7 @@ void sub_0801F940(Entity* this) { sub_0801FAE0(this); } else { this->action = 6; - this->field_0xf = 60; + this->subtimer = 60; this->speed = 0x20; InitializeAnimation(this, 2); } @@ -607,7 +607,7 @@ void sub_0801F940(Entity* this) { } void sub_0801F9C4(Entity* this) { - if (--this->field_0xf == 0) + if (--this->subtimer == 0) this->action = 4; GetNextFrame(this); } @@ -616,7 +616,7 @@ void sub_0801F9E0(Entity* this) { GetNextFrame(this); if (this->frame & ANIM_DONE) { this->action = 8; - this->field_0xf = 30; + this->subtimer = 30; this->direction = sub_08049F84(this, 1); this->spritePriority.b1 = 2; this->spritePriority.b0 = 6; @@ -671,7 +671,7 @@ void sub_0801FAF8(Entity* this) { void sub_0801FB14(Entity* this) { this->action = 3; - this->field_0xf = 30; + this->subtimer = 30; this->direction = sub_08049F84(this, 1); InitializeAnimation(this, 2); } diff --git a/src/enemy/cloudPiranha.c b/src/enemy/cloudPiranha.c index e1075af3..5f4eb371 100644 --- a/src/enemy/cloudPiranha.c +++ b/src/enemy/cloudPiranha.c @@ -10,7 +10,7 @@ #include "collision.h" #include "enemy.h" #include "functions.h" -#include "coord.h" +#include "physics.h" typedef struct { /*0x00*/ Entity base; @@ -61,9 +61,9 @@ void CloudPiranha_OnCollision(CloudPiranhaEntity* this) { Create0x68FX(super, FX_STARS); } EnemyFunctionHandlerAfterCollision(super, gUnk_080CF4F0); - if ((super->bitfield & 0x80) != 0) { + if ((super->contactFlags & 0x80) != 0) { if (super->hitType == 0x5a) { - switch (super->bitfield & 0x3f) { + switch (super->contactFlags & 0x3f) { case 0x14: super->action = 5; break; @@ -73,7 +73,7 @@ void CloudPiranha_OnCollision(CloudPiranhaEntity* this) { break; } #ifndef EU - } else if ((super->bitfield & 0x3f) == 0x1d) { + } else if ((super->contactFlags & 0x3f) == 0x1d) { sub_08038754(this); #endif } @@ -89,8 +89,8 @@ void CloudPiranha_Init(CloudPiranhaEntity* this) { super->direction = (Random() & 0x1c); super->animationState = super->direction >> 2; super->flags |= ENT_COLLIDE; - super->actionDelay = 0; - super->field_0xf = 0x20; + super->timer = 0; + super->subtimer = 0x20; this->unk_82 = 0; this->unk_80 = Random() & 1; this->unk_81 = 0; @@ -101,9 +101,9 @@ void CloudPiranha_Init(CloudPiranhaEntity* this) { void CloudPiranha_Action1(CloudPiranhaEntity* this) { u32 tmp; sub_080387F0(this); - if (--super->field_0xf == 0) { - super->actionDelay = 0; - super->field_0xf = 0x20; + if (--super->subtimer == 0) { + super->timer = 0; + super->subtimer = 0x20; if (sub_08049FA0(super)) { u32 tmp = super->animationState; if (this->unk_80 != 0) { @@ -118,9 +118,9 @@ void CloudPiranha_Action1(CloudPiranhaEntity* this) { super->animationState = super->direction >> 2; } InitializeAnimation(super, (u32)super->animationState); - } else if ((super->actionDelay == 0) && sub_0803872C(this, 0x80)) { + } else if ((super->timer == 0) && sub_0803872C(this, 0x80)) { super->action = 2; - super->field_0xf = 0x10; + super->subtimer = 0x10; super->speed = 0x40; super->animationState = sub_0806FCAC(super, super->child); super->direction = super->animationState << 2; @@ -133,14 +133,14 @@ NONMATCH("asm/non_matching/cloudPiranha/sub_080385CC.inc", void sub_080385CC(Clo sub_080387F0(this); if (sub_0803872C(this, 0x60)) { super->action = 3; - super->field_0xf = 0xc; + super->subtimer = 0xc; super->speed = 0x80; super->animationState = sub_0806FCAC(super, super->child); super->direction = super->animationState << 2; InitializeAnimation(super, super->animationState); } else { - if (--super->field_0xf == 0) { - super->field_0xf = 0x10; + if (--super->subtimer == 0) { + super->subtimer = 0x10; if (super->child != NULL) { super->animationState = sub_0806FCAC(super, super->child); } else { @@ -164,8 +164,8 @@ void CloudPiranha_Action3(CloudPiranhaEntity* this) { if (sub_0803872C(this, 0x14)) { sub_08038754(this); } else { - if (--super->field_0xf == 0) { - super->field_0xf = 0xa; + if (--super->subtimer == 0) { + super->subtimer = 0xa; if (this->unk_81 == 0) { tmp = super->speed += 0x40; if (0x2000000 < (tmp * 0x10000)) { @@ -186,8 +186,8 @@ void CloudPiranha_Action4(CloudPiranhaEntity* this) { if (sub_080044EC(super, 0x1800) == 1) { super->action = 1; super->hitType = 0x72; - super->actionDelay = 1; - super->field_0xf = 0x80; + super->timer = 1; + super->subtimer = 0x80; super->speed = 0x80; super->spritePriority.b1 = 2; EnqueueSFX(SFX_124); diff --git a/src/enemy/crow.c b/src/enemy/crow.c index efe2b3e5..55954cae 100644 --- a/src/enemy/crow.c +++ b/src/enemy/crow.c @@ -31,18 +31,18 @@ void Crow(Entity* this) { void Crow_OnTick(CrowEntity* this) { gUnk_080CE990[super->action](this); - if (super->field_0xf) { - if (--super->field_0xf == 0) { + if (super->subtimer) { + if (--super->subtimer == 0) { COLLISION_ON(super); } } } void Crow_OnCollision(CrowEntity* this) { - if (super->bitfield & 0x80) { - if ((super->bitfield & 0x3f) == 0) { + if (super->contactFlags & 0x80) { + if ((super->contactFlags & 0x3f) == 0) { COLLISION_OFF(super); - super->field_0xf = 0x10; + super->subtimer = 0x10; if (DirectionIsHorizontal(DirectionRoundUp(super->direction)) == 0) { if (DirectionIsVertical(super->direction)) { super->direction += 2; @@ -74,14 +74,14 @@ void Crow_OnGrabbed(CrowEntity* this) { super->action = 2; super->subAction = 0; this->unk_84 = 2; - super->actionDelay = 8; + super->timer = 8; super->speed = 0x1c0; sub_08032AF4(this); } void sub_08032900(CrowEntity* this) { super->subAction = 1; - super->field_0x1d = 0x3c; + super->gustJarTolerance = 0x3c; } void sub_0803290C(CrowEntity* this) { @@ -98,12 +98,12 @@ void sub_08032928(CrowEntity* this) { sub_0804A720(super); super->action = 1; - super->field_0xf = 0; + super->subtimer = 0; super->direction = sub_08049F84(super, 1); this->unk_80 = 0; this->unk_81 = 0; - super->field_0x1c = 1; - super->field_0x3c |= 0x10; + super->gustJarFlags = 1; + super->collisionFlags |= 0x10; super->collisionLayer = 3; super->spriteOrientation.flipY = 1; this->unk_78 = super->x.HALF.HI; @@ -125,7 +125,7 @@ void sub_0803298C(CrowEntity* this) { super->action = 2; this->unk_84 = 0; - super->actionDelay = 0x10; + super->timer = 0x10; this->unk_81 = 2; sub_08032AF4(this); } @@ -156,7 +156,7 @@ void sub_08032A48(CrowEntity* this) { super->action = 1; super->spriteSettings.draw = 1; COLLISION_OFF(super); - super->actionDelay = 8; + super->timer = 8; super->direction = sub_08049F84(super, 1); this->unk_80 = 0; super->spritePriority.b1 = 3; @@ -168,7 +168,7 @@ void sub_08032A48(CrowEntity* this) { void sub_08032AB0(CrowEntity* this) { u32 dir; - if (--super->actionDelay) + if (--super->timer) return; this->unk_80 = super->direction; @@ -177,7 +177,7 @@ void sub_08032AB0(CrowEntity* this) { super->direction = dir; } - super->actionDelay = 8; + super->timer = 8; if (DirectionIsVertical(this->unk_80) != DirectionIsVertical(super->direction)) { sub_08032AF4(this); } @@ -200,22 +200,22 @@ void sub_08032B38(CrowEntity* this) { u32 temp; switch (this->unk_84) { case 0: - if (super->actionDelay & 1) { + if (super->timer & 1) { super->z.HALF.HI--; } - if (--super->actionDelay == 0) { + if (--super->timer == 0) { this->unk_84 = 1; - super->actionDelay = 0x18; + super->timer = 0x18; COLLISION_ON(super); this->unk_81 = 2; sub_08032AF4(this); } break; case 1: - if (--super->actionDelay == 0) { + if (--super->timer == 0) { this->unk_84 = 2; - super->actionDelay = 8; + super->timer = 8; super->speed = 0x1c0; this->unk_81 = 4; sub_08032AF4(this); @@ -225,15 +225,15 @@ void sub_08032B38(CrowEntity* this) { if (--this->unk_82 == 0) { super->action = 3; this->unk_84 = 0; - super->actionDelay = 0; + super->timer = 0; super->speed = 0x180; if ((super->direction + 0x18) & 0x10) { super->direction = (0x10 - super->direction) & 0x1f; } sub_08032AF4(this); - } else if (--super->actionDelay == 0) { - super->actionDelay = 8; + } else if (--super->timer == 0) { + super->timer = 8; this->unk_80 = super->direction; sub_08004596(super, sub_08049F84(super, 1)); diff --git a/src/enemy/cuccoAggr.c b/src/enemy/cuccoAggr.c index c9993651..da22f6a2 100644 --- a/src/enemy/cuccoAggr.c +++ b/src/enemy/cuccoAggr.c @@ -84,7 +84,7 @@ void sub_08038D78(CuccoAggrEntity* this) { sub_0804A720(super); if (super->type != 2) { super->type2 = 0; - super->field_0x16 = 0x30; + super->carryFlags = 0x30; sub_08039120(this); } else { sub_08039140(this); @@ -92,7 +92,7 @@ void sub_08038D78(CuccoAggrEntity* this) { } void sub_08038DA0(CuccoAggrEntity* this) { - if (--super->actionDelay == 0) { + if (--super->timer == 0) { sub_0803901C(this); } @@ -105,8 +105,8 @@ void sub_08038DC0(CuccoAggrEntity* this) { void sub_08038DD8(CuccoAggrEntity* this) { super->subAction = 1; - super->actionDelay = 0x10; - super->field_0xf = gUnk_080CF7BC[super->type]; + super->timer = 0x10; + super->subtimer = gUnk_080CF7BC[super->type]; COLLISION_OFF(super); super->spritePriority.b1 = 0; InitializeAnimation(super, 4); @@ -114,8 +114,8 @@ void sub_08038DD8(CuccoAggrEntity* this) { } void sub_08038E18(CuccoAggrEntity* this) { - if (super->field_0xf) { - if (--super->field_0xf == 0) { + if (super->subtimer) { + if (--super->subtimer == 0) { PlayerDropHeldObject(); sub_08039218(this); COLLISION_ON(super); @@ -127,8 +127,8 @@ void sub_08038E18(CuccoAggrEntity* this) { } } - if (--super->actionDelay == 0) { - super->actionDelay = 0x10; + if (--super->timer == 0) { + super->timer = 0x10; super->spriteSettings.flipX ^= (Random() & 1); CuccoAggr_CreateFx(this); } @@ -152,7 +152,7 @@ void sub_08038EE0(CuccoAggrEntity* this) { GetNextFrame(super); sub_08039298(this); if (GravityUpdate(super, 0x1C00) == 0) { - if (--super->actionDelay == 0) { + if (--super->timer == 0) { sub_0803901C(this); } else { super->zVelocity = 0x8000; @@ -184,7 +184,7 @@ void sub_08038F44(CuccoAggrEntity* this) { } void sub_08038FA0(CuccoAggrEntity* this) { - if ((super->actionDelay++ & 0x1f) == 0) { + if ((super->timer++ & 0x1f) == 0) { CuccoAggr_CreateFx(this); } @@ -228,12 +228,12 @@ void sub_0803901C(CuccoAggrEntity* this) { switch (r5) { default: super->action = 1; - super->actionDelay = gUnk_080CF7BE[(r3 >> 0x10) & 3]; + super->timer = gUnk_080CF7BE[(r3 >> 0x10) & 3]; InitializeAnimation(super, 0); break; case 1: super->action = 3; - super->actionDelay = ((r3 >> 8) & 3) + 2; + super->timer = ((r3 >> 8) & 3) + 2; super->zVelocity = 0x8000; sub_080390C0(this); InitializeAnimation(super, 1); @@ -274,7 +274,7 @@ void sub_08039120(CuccoAggrEntity* this) { void sub_08039140(CuccoAggrEntity* this) { super->action = 6; - super->actionDelay = Random(); + super->timer = Random(); super->direction = GetFacingDirection(super, &gPlayerEntity); super->z.HALF.HI = 0xfffc; this->unk_78 = 0xb4; diff --git a/src/enemy/cuccoChickAggr.c b/src/enemy/cuccoChickAggr.c index 2099cd13..004283b5 100644 --- a/src/enemy/cuccoChickAggr.c +++ b/src/enemy/cuccoChickAggr.c @@ -38,7 +38,7 @@ void sub_08022960(Entity* this) { } void sub_08022970(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { sub_08022AA4(this); } } @@ -47,8 +47,8 @@ void sub_08022988(Entity* this) { if (this->z.HALF.HI == 0 && sub_08022B20(this)) { sub_08022B0C(this); } else { - if (this->field_0xf) { - if (--this->field_0xf) + if (this->subtimer) { + if (--this->subtimer) return; this->frameIndex = 1; @@ -58,10 +58,10 @@ void sub_08022988(Entity* this) { ProcessMovement0(this); if (GravityUpdate(this, 0x2000) == 0) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { sub_08022A88(this); } else { - this->field_0xf = 4; + this->subtimer = 4; this->frameIndex = 0; } } @@ -70,10 +70,10 @@ void sub_08022988(Entity* this) { void sub_080229F8(Entity* this) { if (GravityUpdate(this, 0x2800) == 0) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 4; - this->actionDelay = 6; - this->field_0xf = 8; + this->timer = 6; + this->subtimer = 8; this->frameIndex = 0; this->speed = 0xc0; sub_08022B44(this); @@ -85,8 +85,8 @@ void sub_080229F8(Entity* this) { } void sub_08022A40(Entity* this) { - if (this->field_0xf) { - if (--this->field_0xf) + if (this->subtimer) { + if (--this->subtimer) return; this->frameIndex = 1; @@ -94,7 +94,7 @@ void sub_08022A40(Entity* this) { ProcessMovement0(this); if (GravityUpdate(this, 0x2000) == 0) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { sub_08022A88(this); } else { sub_08022B44(this); @@ -104,7 +104,7 @@ void sub_08022A40(Entity* this) { void sub_08022A88(Entity* this) { this->action = 1; - this->actionDelay = (Random() & 0xf) + 8; + this->timer = (Random() & 0xf) + 8; this->frameIndex = 0; } @@ -112,8 +112,8 @@ void sub_08022AA4(Entity* this) { u32 rand = Random(); this->action = 2; - this->actionDelay = (rand & 3) + 1; - this->field_0xf = 1; + this->timer = (rand & 3) + 1; + this->subtimer = 1; this->speed = 0x80; if (!sub_08049FA0(this) && (rand >> 8) & 3) { @@ -128,8 +128,8 @@ void sub_08022AA4(Entity* this) { void sub_08022B0C(Entity* this) { this->action = 3; - this->actionDelay = 3; - this->field_0xf = 8; + this->timer = 3; + this->subtimer = 8; sub_08022B44(this); } diff --git a/src/enemy/curtain.c b/src/enemy/curtain.c index 0a0d342c..77af09ea 100644 --- a/src/enemy/curtain.c +++ b/src/enemy/curtain.c @@ -17,12 +17,12 @@ void Curtain_OnCollision(Entity* this) { this->action = 2; this->flags &= ~ENT_COLLIDE; this->spritePriority.b0 = 7; - this->actionDelay = 3; + this->timer = 3; } else { - this->actionDelay = 2; + this->timer = 2; } - InitializeAnimation(this, this->actionDelay); + InitializeAnimation(this, this->timer); } void Curtain_OnGrabbed() { @@ -33,24 +33,24 @@ void sub_08048224(Entity* this) { if (CheckLocalFlag(0x72) == 0) { this->action = 1; - this->actionDelay = 0; + this->timer = 0; } else { this->action = 3; this->flags &= ~ENT_COLLIDE; - this->actionDelay = 1; + this->timer = 1; } - InitializeAnimation(this, this->actionDelay); + InitializeAnimation(this, this->timer); } void sub_08048268(Entity* this) { - if (this->actionDelay == 0) { + if (this->timer == 0) { return; } GetNextFrame(this); if (this->frame & ANIM_DONE) { - this->actionDelay = 0; + this->timer = 0; InitializeAnimation(this, 0); } } diff --git a/src/enemy/darkNut.c b/src/enemy/darkNut.c index 3d91e7f4..4f948162 100644 --- a/src/enemy/darkNut.c +++ b/src/enemy/darkNut.c @@ -61,10 +61,10 @@ void DarkNut_OnTick(Entity* this) { } void DarkNut_OnCollision(Entity* this) { - switch (this->bitfield & 0x7f) { + switch (this->contactFlags & 0x7f) { case 0x1c: this->action = 11; - this->actionDelay = gUnk_080CAB0C[this->type]; + this->timer = gUnk_080CAB0C[this->type]; this->hitType = 81; sub_08021218(this, 8, DirectionToAnimationState(this->knockbackDirection ^ 0x10)); sub_08021588(this); @@ -72,7 +72,7 @@ void DarkNut_OnCollision(Entity* this) { break; case 0x16: this->action = 11; - this->actionDelay = gUnk_080CAB10[this->type]; + this->timer = gUnk_080CAB10[this->type]; this->hitType = 81; sub_08021218(this, 8, DirectionToAnimationState(this->knockbackDirection ^ 0x10)); sub_08021588(this); @@ -101,7 +101,7 @@ void DarkNut_OnCollision(Entity* this) { if (this->action == 15) { u8 bVar3 = 0xff; if (this->child != NULL) { - bVar3 = this->child->bitfield & 0x7f; + bVar3 = this->child->contactFlags & 0x7f; } if (bVar3 == 2) { sub_080213D0(this, gUnk_080CAB08[this->type]); @@ -152,7 +152,7 @@ void sub_08020DD4(Entity* this) { this->action = 5; sub_08021218(this, 5, this->animationState); } else { - if (--this->actionDelay == 0) + if (--this->timer == 0) sub_08021540(this); ProcessMovement0(this); UpdateAnimationSingleFrame(this); @@ -255,7 +255,7 @@ void sub_08020FAC(Entity* this) { void sub_08020FE4(Entity* this) { UpdateAnimationSingleFrame(this); - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 12; sub_08021218(this, 9, this->animationState); sub_0804AA1C(this); @@ -321,7 +321,7 @@ void sub_080210E4(Entity* this) { } sub_08021644(this); - if ((this->frame & 0x10) && (!ProcessMovement0(this) || (this->child && (this->child->bitfield & 0x80)))) { + if ((this->frame & 0x10) && (!ProcessMovement0(this) || (this->child && (this->child->contactFlags & 0x80)))) { sub_080213D0(this, 0); } else { if (--this->field_0x76.HWORD == 0) @@ -452,7 +452,7 @@ void sub_08021390(Entity* this) { void sub_080213B0(Entity* this) { this->action = 3; - this->actionDelay = 1; + this->timer = 1; this->speed = 0xc0; this->field_0x76.HWORD = 0xf0; sub_08021218(this, 3, this->animationState); @@ -554,7 +554,7 @@ void sub_08021540(Entity* this) { if (tmp != 0xff) sub_08021218(this, 3, tmp); - this->actionDelay = 30; + this->timer = 30; } void sub_08021588(Entity* this) { diff --git a/src/enemy/doorMimic.c b/src/enemy/doorMimic.c index 1f4d6b4a..9061ddb3 100644 --- a/src/enemy/doorMimic.c +++ b/src/enemy/doorMimic.c @@ -57,19 +57,19 @@ void sub_08022034(Entity* this) { } void sub_0802209C(Entity* this) { - if (this->actionDelay == 0) { + if (this->timer == 0) { if (CheckPlayerProximity(this->field_0x78.HWORD, this->field_0x7a.HWORD, 0x10, 0x10)) { this->action = 2; - this->actionDelay = 0x12; + this->timer = 0x12; InitializeAnimation(this, this->type2 + 4); } } else { - this->actionDelay = this->actionDelay - 1; + this->timer = this->timer - 1; } } void sub_080220D8(Entity* this) { - if (--this->actionDelay == 0) + if (--this->timer == 0) this->action = 3; } @@ -80,7 +80,7 @@ void sub_080220F0(Entity* this) { u32 i; this->action = 4; - this->actionDelay = 0x78; + this->timer = 0x78; this->damage = 0; off = gUnk_080CB76C[this->type2]; for (i = 0; i < 6; i++, off++) { @@ -98,7 +98,7 @@ void sub_080220F0(Entity* this) { void sub_08022174(Entity* this) { sub_0800445C(this); - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 5; InitializeAnimation(this, this->type2 + 8); } @@ -109,7 +109,7 @@ void sub_08022198(Entity* this) { GetNextFrame(this); if (this->frame & ANIM_DONE) { this->action = 1; - this->actionDelay = 0x5a; + this->timer = 0x5a; } } diff --git a/src/enemy/enemy4D.c b/src/enemy/enemy4D.c index 9c13ceaf..0fc6ab78 100644 --- a/src/enemy/enemy4D.c +++ b/src/enemy/enemy4D.c @@ -184,7 +184,7 @@ void Enemy4D_Action5(Enemy4DEntity* this) { if ((tmp * 0x1000000) < 1) { this->unk_7e = 0; super->action = 6; - super->actionDelay = 0x0f; + super->timer = 0x0f; InitAnimationForceUpdate(super, super->animationState + 0x20); } } @@ -197,9 +197,9 @@ void Enemy4D_Action6(Enemy4DEntity* this) { 128, 188, }; - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = 7; - super->actionDelay = 1; + super->timer = 1; this->unk_7c = gUnk_080D08C4[super->animationState]; this->unk_7f = 0xf6; EnqueueSFX(SFX_15B); @@ -210,22 +210,22 @@ void Enemy4D_Action7(Enemy4DEntity* this) { if ((super->frame & ANIM_DONE) == 0) { UpdateAnimationSingleFrame(super); } else { - if (--super->actionDelay == 0) { - super->actionDelay = 2; + if (--super->timer == 0) { + super->timer = 2; this->unk_7f++; } if (this->unk_7f != 0) { this->unk_7e += 5; } else { super->action = 8; - super->actionDelay = 0x1e; + super->timer = 0x1e; InitScreenShake(8, 0); } } } void Enemy4D_Action8(Enemy4DEntity* this) { - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = 9; } } @@ -235,7 +235,7 @@ void Enemy4D_Action9(Enemy4DEntity* this) { tmp = this->unk_7e = this->unk_7e - 2; if (tmp < 0xb) { super->action = 0xa; - super->actionDelay = 0x3c; + super->timer = 0x3c; super->direction = super->animationState << 3; this->unk_7c = 0; this->unk_7f = 0xfe; @@ -246,8 +246,8 @@ void Enemy4D_Action9(Enemy4DEntity* this) { } void Enemy4D_Action10(Enemy4DEntity* this) { - if (super->actionDelay != 0) { - if (--super->actionDelay == 0) { + if (super->timer != 0) { + if (--super->timer == 0) { super->child->flags |= ENT_COLLIDE; sub_0803E94C(super, 0); } diff --git a/src/enemy/enemy50.c b/src/enemy/enemy50.c index 40bd1fde..8842b97f 100644 --- a/src/enemy/enemy50.c +++ b/src/enemy/enemy50.c @@ -83,16 +83,16 @@ void sub_08040B9C(Enemy50Entity* this) { sub_0803F6EC(this); } if (super->hitType == 0x25) { - if (super->bitfield == 0x80) { + if (super->contactFlags == 0x80) { super->action = 8; InitializeAnimation(super, 3); goto _08040C9C; } - } else if (super->bitfield == 0x80) { + } else if (super->contactFlags == 0x80) { this->unk_7c = 0x78; sub_08041128(this); } - if (super->bitfield == 0x9d) { + if (super->contactFlags == 0x9d) { super->zVelocity = 0x18000; } if (super->confusedTime != 0) { @@ -111,7 +111,7 @@ void sub_08040B9C(Enemy50Entity* this) { super->flags |= 0x80; super->health = 0xff; super->action = 0xa; - super->actionDelay = 0x3c; + super->timer = 0x3c; } this->unk_7a = super->health; } @@ -164,7 +164,7 @@ void sub_08040D90(Enemy50Entity* this) { void Enemy50_SubAction0(Enemy50Entity* this) { super->subAction = 1; - super->field_0x1d = 0x3c; + super->gustJarTolerance = 0x3c; InitializeAnimation(super, (gPlayerEntity.animationState >> 2) + 5); } @@ -195,13 +195,13 @@ void Enemy50_Init(Enemy50Entity* this) { rand = Random(); super->direction = rand & 0x1e; super->animationState = 0xff; - super->field_0x1c = 1; + super->gustJarFlags = 1; this->unk_7a = super->health; this->unk_7b = rand >> 4; this->unk_7c = 0; if (super->type == 0) { super->action = 1; - super->child = (Entity*)GetCurrentRoomProperty(super->actionDelay); + super->child = (Entity*)GetCurrentRoomProperty(super->timer); } else { sub_080411CC(this); } @@ -210,12 +210,12 @@ void Enemy50_Init(Enemy50Entity* this) { void Enemy50_Action1(Enemy50Entity* this) { if (sub_080411E8(this)) { super->action = 2; - super->actionDelay = 0x0f; + super->timer = 0x0f; } } void Enemy50_Action2(Enemy50Entity* this) { - if (--super->actionDelay == 0) { + if (--super->timer == 0) { sub_080411CC(this); sub_0804122C(this); } @@ -234,7 +234,7 @@ void Enemy50_Action4(Enemy50Entity* this) { if (sub_08041170(this) == 0) { sub_0803F58C(this); GetNextFrame(super); - if (--super->actionDelay == 0) { + if (--super->timer == 0) { sub_08041128(this); } } @@ -250,7 +250,7 @@ void Enemy50_Action5(Enemy50Entity* this) { if (--this->unk_78 == 0) { super->action = 6; rand = Random(); - super->actionDelay = rand & 0xe0; + super->timer = rand & 0xe0; super->speed = 0x100; this->unk_7e = ((rand >> 8) & 0x78) + 0x3c; } @@ -267,8 +267,8 @@ void Enemy50_Action6(Enemy50Entity* this) { sub_08041128(this); } else { if (!((sub_08049DF4(1) == 0) || (--this->unk_7e == 0))) { - tmp = super->actionDelay + 1; - super->actionDelay = tmp; + tmp = super->timer + 1; + super->timer = tmp; if ((tmp & gUnk_080D0E14[tmp * 0x1000000 >> 0x1e]) == 0) { sub_08004596(super, GetFacingDirection(super, gUnk_020000B0)); } @@ -276,14 +276,14 @@ void Enemy50_Action6(Enemy50Entity* this) { ProcessMovement1(super); } else { super->action = 7; - super->actionDelay = 0x1e; + super->timer = 0x1e; } } } void Enemy50_Action7(Enemy50Entity* this) { GetNextFrame(super); - if (--super->actionDelay == 0) { + if (--super->timer == 0) { this->unk_7c = (Random() & 0xf8) + 0xb4; sub_08041128(this); } @@ -327,7 +327,7 @@ void Enemy50_Action9(Enemy50Entity* this) { void Enemy50_Action10(Enemy50Entity* this) { GetNextFrame(super); - if (--super->actionDelay == 0) { + if (--super->timer == 0) { sub_08041128(this); } } @@ -427,7 +427,7 @@ void sub_0804122C(Enemy50Entity* this) { #ifndef EU bool32 sub_08041300(Enemy50Entity* this) { - if ((super->hitType == 0x25) && (super->bitfield == 0x80)) { + if ((super->hitType == 0x25) && (super->contactFlags == 0x80)) { return TRUE; } else { return super->action == 8 || super->action == 9; diff --git a/src/enemy/enemy64.c b/src/enemy/enemy64.c index 919a569b..9f3f242d 100644 --- a/src/enemy/enemy64.c +++ b/src/enemy/enemy64.c @@ -85,7 +85,7 @@ void Enemy64_Init(Enemy64Entity* this) { super->child = tail; super->action = 1; super->subAction = 0; - super->actionDelay = 0x3c; + super->timer = 0x3c; super->direction = 0xc0; super->animationState = 0xc0; super->speed = 0x300; @@ -107,8 +107,8 @@ void Enemy64_Action1(Enemy64Entity* this) { } void Enemy64_Action1_SubAction0(Enemy64Entity* this) { - if (super->actionDelay != 0) { - super->actionDelay--; + if (super->timer != 0) { + super->timer--; } else { sub_08049998(this, ((0x100 - super->direction) & 0xff) << 8); if ((gRoomControls.origin_x - 0x100) > super->x.HALF.HI) { @@ -193,8 +193,8 @@ void Enemy64_Action2_SubAction2(Enemy64Entity* this) { gRoomControls.origin_y + 0x80), ((((uVar3 + 2) & 0x1c) - (super->direction >> 3)) & 0xf) == 8)) { super->subAction = 4; - super->actionDelay = 0x3c; - super->field_0xf = 7; + super->timer = 0x3c; + super->subtimer = 7; } sub_08049944(this); sub_08047EA4(super, ((0x100 - super->direction) & 0xff) << 8); @@ -207,10 +207,10 @@ void Enemy64_Action2_SubAction3(Enemy64Entity* this) { iVar1 = this->unk_76 += this->unk_74; uVar2 = iVar1 * 0x10000; super->direction = (uVar2 >> 0x18); - if (super->actionDelay == 0) { + if (super->timer == 0) { if ((uVar2 >> 0x18 & 0x1f) == 0) { super->subAction = 4; - super->actionDelay = 0x5a; + super->timer = 0x5a; } } else { if (sub_08049A8C(this)) { @@ -228,15 +228,15 @@ void Enemy64_Action2_SubAction3(Enemy64Entity* this) { void Enemy64_Action2_SubAction4(Enemy64Entity* this) { sub_08049998(this, ((0x100 - super->direction) & 0xff) << 8); - if (--super->actionDelay == 0) { - if (--super->field_0xf == 0) { + if (--super->timer == 0) { + if (--super->subtimer == 0) { super->subAction = 5; super->speed += 0x40; } else { super->subAction = 3; - super->actionDelay = 0xa; + super->timer = 0xa; } - } else if (super->actionDelay == 0x50) { + } else if (super->timer == 0x50) { Entity* enemy = CreateEnemy(GYORG_MALE_EYE, Random() & 3); if (enemy != NULL) { enemy->parent = super; @@ -277,7 +277,7 @@ void Enemy64_Action3_SubAction0(Enemy64Entity* this) { void Enemy64_Action3_SubAction1(Enemy64Entity* this) { if (EntityWithinDistance(super, gRoomControls.origin_x + 0xa8, gRoomControls.origin_y + 0x80, 0x28)) { super->subAction = 2; - super->actionDelay = 0x2d; + super->timer = 0x2d; this->unk_74 = gUnk_080D29B8[Random() & 7] << 0x18 >> 0x18; this->unk_76 = super->direction << 8; } @@ -288,15 +288,15 @@ void Enemy64_Action3_SubAction2(Enemy64Entity* this) { this->unk_76 += this->unk_74; super->direction = this->unk_76 >> 8; sub_08049998(this, ((0x100 - super->direction) & 0xff) << 8); - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->subAction = 3; - super->actionDelay = 0x1e; + super->timer = 0x1e; } } void Enemy64_Action3_SubAction3(Enemy64Entity* this) { sub_08049998(this, ((0x100 - super->direction) & 0xff) << 8); - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = 2; super->subAction = 0; } @@ -312,7 +312,7 @@ void Enemy64_Action4_SubAction0(Enemy64Entity* this) { if (sub_08079F8C() && gPlayerEntity.z.HALF.HI == 0) { SetPlayerControl(CONTROL_2); super->subAction = 2; - super->actionDelay = 0x1e; + super->timer = 0x1e; } else { super->subAction = 1; } @@ -323,15 +323,15 @@ void Enemy64_Action4_SubAction1(Enemy64Entity* this) { if (sub_08079F8C() && gPlayerEntity.z.HALF.HI == 0) { SetPlayerControl(CONTROL_2); super->subAction = 2; - super->actionDelay = 1; + super->timer = 1; } sub_08049944(this); } void Enemy64_Action4_SubAction2(Enemy64Entity* this) { - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->subAction = 3; - super->actionDelay = 0xb4; + super->timer = 0xb4; super->speed = 0x100; super->direction -= 0x40; } @@ -340,8 +340,8 @@ void Enemy64_Action4_SubAction2(Enemy64Entity* this) { void Enemy64_Action4_SubAction3(Enemy64Entity* this) { sub_08049AB0(this); - if (--super->actionDelay == 0) { - super->actionDelay = 0x1e; + if (--super->timer == 0) { + super->timer = 0x1e; super->subAction = 4; super->speed = 0x400; super->direction = super->animationState; @@ -356,7 +356,7 @@ void Enemy64_Action4_SubAction3(Enemy64Entity* this) { void Enemy64_Action4_SubAction4(Enemy64Entity* this) { sub_08049AB0(this); sub_08049998(this, ((0x100 - super->direction) & 0xff) << 8); - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->subAction = 5; SetFade(5, 0x10); } @@ -389,7 +389,7 @@ void Enemy64_Action4_SubAction5(Enemy64Entity* this) { void Enemy64_Action4_SubAction6(Enemy64Entity* this) { if (gFadeControl.active == 0) { super->subAction = 7; - super->actionDelay = 0xa0; + super->timer = 0xa0; SoundReq(SFX_SECRET); SetFlag(0x7c); SetPlayerControl(CONTROL_1); @@ -397,21 +397,21 @@ void Enemy64_Action4_SubAction6(Enemy64Entity* this) { } void Enemy64_Action4_SubAction7(Enemy64Entity* this) { - if (--super->actionDelay == 0) { + if (--super->timer == 0) { DeleteThisEntity(); - } else if (super->actionDelay == 0x10) { + } else if (super->timer == 0x10) { sub_0807B7D8(0x36, 0xca, 1); SetTile(0x4081, 0xca, 2); SoundReq(SFX_HEART_GET); - } else if (super->actionDelay == 0x18) { + } else if (super->timer == 0x18) { sub_0807B7D8(0x36, 0x8a, 1); SetTile(0x4081, 0x8a, 2); SoundReq(SFX_HEART_GET); - } else if (super->actionDelay == 0x20) { + } else if (super->timer == 0x20) { sub_0807B7D8(0x36, 0x4a, 1); SetTile(0x4081, 0x4a, 2); SoundReq(SFX_HEART_GET); - } else if (super->actionDelay == 0x28) { + } else if (super->timer == 0x28) { sub_0807B7D8(0x36, 10, 1); SetTile(0x4081, 10, 2); SoundReq(SFX_HEART_GET); @@ -460,7 +460,7 @@ void sub_080499F0(Enemy64Entity* this) { } bool32 sub_08049A8C(Enemy64Entity* this) { - if (--super->actionDelay == 0 && (Random() & 0xf) != 0) { + if (--super->timer == 0 && (Random() & 0xf) != 0) { return TRUE; } else { return FALSE; @@ -470,7 +470,7 @@ bool32 sub_08049A8C(Enemy64Entity* this) { void sub_08049AB0(Enemy64Entity* this) { u32 rand; - if ((++super->field_0xf & 0xf) == 0) { + if ((++super->subtimer & 0xf) == 0) { Entity* effect = CreateFx(super, FX_GIANT_EXPLOSION3, 0); if (effect != NULL) { rand = Random(); diff --git a/src/enemy/enemy66.c b/src/enemy/enemy66.c index 6975e5e8..859bc556 100644 --- a/src/enemy/enemy66.c +++ b/src/enemy/enemy66.c @@ -4,8 +4,8 @@ void (*const gUnk_080D2ABC[])(Entity*); extern void sub_08029270(Entity* this); void Enemy66(Entity* this) { - if (gUnk_080D2ABC[this->field_0xf]) { - gUnk_080D2ABC[this->field_0xf](this); + if (gUnk_080D2ABC[this->subtimer]) { + gUnk_080D2ABC[this->subtimer](this); } else { DeleteThisEntity(); } diff --git a/src/enemy/eyegore.c b/src/enemy/eyegore.c index aae204a2..d23978ea 100644 --- a/src/enemy/eyegore.c +++ b/src/enemy/eyegore.c @@ -85,14 +85,14 @@ void Eyegore_OnTick(EyegoreEntity* this) { void Eyegore_OnCollision(EyegoreEntity* this) { u32 tmp; - if ((super->bitfield == 0x95) || (super->bitfield == 0x8e)) { - Entity* entity = super->field_0x4c; + if ((super->contactFlags == 0x95) || (super->contactFlags == 0x8e)) { + Entity* entity = super->contactedEntity; tmp = (((entity->direction + 4) & 0x18) ^ 0x10) >> 3; if (tmp == super->animationState) { if ((tmp & 1) != 0) { if (0x10 < ((entity->y.HALF.HI + entity->z.HALF.HI) - (super->y.HALF.HI + super->z.HALF.HI)) + 0x14U) { } else { - if (super->bitfield == 0x8e) { + if (super->contactFlags == 0x8e) { super->health = 0; } else { super->health--; @@ -108,7 +108,7 @@ void Eyegore_OnCollision(EyegoreEntity* this) { EnqueueSFX(SFX_BUTTON_PRESS); sub_08031344(this); } else { - if (super->bitfield == 0x8e) { + if (super->contactFlags == 0x8e) { super->health = 0; } else { super->health--; @@ -133,7 +133,7 @@ void Eyegore_OnDeath(EyegoreEntity* this) { this->unk_7e--; GravityUpdate(super, 0x1c00); } else { - if ((super->field_0x3a & 2) == 0) { + if ((super->gustJarState & 2) == 0) { CreateFx(super, FX_GIANT_EXPLOSION4, 0); } GenericDeath(super); @@ -169,12 +169,12 @@ void Eyegore_Action1(EyegoreEntity* this) { } void Eyegore_Action2(EyegoreEntity* this) { - if (super->actionDelay != 0) { - super->actionDelay--; + if (super->timer != 0) { + super->timer--; } else { if (sub_08049FDC(super, 1)) { super->action = 3; - super->actionDelay = 0x3c; + super->timer = 0x3c; super->direction = (CalculateDirectionTo(super->x.HALF.HI + super->hitbox->offset_x, super->y.HALF.HI + super->hitbox->offset_y, gUnk_020000B0->x.HALF.HI, gUnk_020000B0->y.HALF.HI) + @@ -192,8 +192,8 @@ void Eyegore_Action3(EyegoreEntity* this) { 0, 1, }; - if (super->actionDelay != 0) { - super->spriteOffsetX = gUnk_080CE2BC[--super->actionDelay & 3]; + if (super->timer != 0) { + super->spriteOffsetX = gUnk_080CE2BC[--super->timer & 3]; } else { GetNextFrame(super); if ((super->frame & ANIM_DONE) != 0) { @@ -469,7 +469,7 @@ void sub_08031250(EyegoreEntity* this) { void sub_08031320(EyegoreEntity* this) { super->action = 2; super->flags &= ~ENT_COLLIDE; - super->actionDelay = 0x1e; + super->timer = 0x1e; super->hitbox = (Hitbox*)&gUnk_080FD308; InitializeAnimation(super, 10); } @@ -478,7 +478,7 @@ void sub_08031344(EyegoreEntity* this) { static const s8 gUnk_080CE304[] = { 0, -6, -14, -14, 0, -28, 14, -14, }; - Entity* entity = sub_08017A90(super->field_0x4c, super); + Entity* entity = sub_08017A90(super->contactedEntity, super); if (entity != NULL) { const s8* ptr = &gUnk_080CE304[entity->animationState * 2]; entity->spriteOffsetX = ptr[0]; diff --git a/src/enemy/fallingBoulder.c b/src/enemy/fallingBoulder.c index 828b3670..b8395ee5 100644 --- a/src/enemy/fallingBoulder.c +++ b/src/enemy/fallingBoulder.c @@ -36,7 +36,7 @@ void FallingBoulder_OnGrabbed(Entity* this) { void sub_0802C258(Entity* this) { sub_0804A720(this); this->zVelocity = Q_16_16(2.0); - this->actionDelay = 2; + this->timer = 2; this->field_0x7a.HWORD = Random() & 0x70; switch (this->type) { case 1: @@ -169,8 +169,8 @@ void sub_0802C4B0(Entity* this) { rand = Random() & 7; if (rand & 4) { - if (this->actionDelay != 0) { - this->actionDelay = 0; + if (this->timer != 0) { + this->timer = 0; InitializeAnimation(this, 0); } if (rand & 3) { @@ -179,8 +179,8 @@ void sub_0802C4B0(Entity* this) { this->direction = gUnk_080CD580[offset | 0]; } } else { - if (this->actionDelay != 1) { - this->actionDelay = 1; + if (this->timer != 1) { + this->timer = 1; InitializeAnimation(this, 1); } if (rand & 3) { diff --git a/src/enemy/fireballGuy.c b/src/enemy/fireballGuy.c index 6e140df5..73c0771a 100644 --- a/src/enemy/fireballGuy.c +++ b/src/enemy/fireballGuy.c @@ -41,11 +41,11 @@ void FireballGuy_OnGrabbed(void) { void sub_080453E8(Entity* this) { this->action = 1; - this->actionDelay = 0; + this->timer = 0; this->spriteSettings.draw = 1; this->speed = 0x80; this->cutsceneBeh.HALF.LO = this->health; - this->field_0x3c |= 0x10; + this->collisionFlags |= 0x10; sub_0804A720(this); InitializeAnimation(this, 0); sub_08045524(this); @@ -105,14 +105,14 @@ void sub_08045524(Entity* this) { this->zVelocity = Q_16_16(1.75); tmp = sub_0804A024(this, 1, 8); if (tmp != 0xff && (Random() & 3) == 0) { - this->actionDelay = Random() & 3; + this->timer = Random() & 3; this->direction = DirectionRound(tmp); } else { - if (this->actionDelay) { - this->actionDelay--; + if (this->timer) { + this->timer--; return; } - this->actionDelay = Random() & 3; + this->timer = Random() & 3; if (sub_08049FA0(this) == 0 && (Random() & 3)) { tmp1 = sub_08049EE4(this); tmp2 = Random() & 8; diff --git a/src/enemy/flyingPot.c b/src/enemy/flyingPot.c index 1736979d..c38a24b9 100644 --- a/src/enemy/flyingPot.c +++ b/src/enemy/flyingPot.c @@ -95,7 +95,7 @@ void FlyingPot_OnTick(FlyingPotEntity* this) { void FlyingPot_OnCollision(FlyingPotEntity* this) { sub_08037418(this); - if (super->bitfield == 0x9D) { + if (super->contactFlags == 0x9D) { super->action = FLYING_POT_ACTION_6; COLLISION_OFF(super); super->zVelocity = 0x2A000; @@ -122,8 +122,8 @@ void FlyingPot_SubAction0(FlyingPotEntity* this) { sub_08037418(this); super->subAction = FLYING_POT_SUBACTION_1; - super->actionDelay = 0; - super->field_0x1d = 0x30; + super->timer = 0; + super->gustJarTolerance = 0x30; } void FlyingPot_SubAction1(FlyingPotEntity* this) { @@ -141,9 +141,9 @@ void FlyingPot_SubAction1(FlyingPotEntity* this) { } void FlyingPot_SubAction2(FlyingPotEntity* this) { - if (super->actionDelay == 0) { + if (super->timer == 0) { sub_08037418(this); - super->actionDelay = 1; + super->timer = 1; COLLISION_OFF(super); super->spriteOffsetX = 0; @@ -174,7 +174,7 @@ void FlyingPot_Init(FlyingPotEntity* this) { u32 tile; super->action = FLYING_POT_ACTION_1; - super->field_0x1c = 2; + super->gustJarFlags = 2; super->y.HALF.HI += 3; tile = TILE(super->x.HALF.HI, super->y.HALF.HI); @@ -193,7 +193,7 @@ void FlyingPot_Action1(FlyingPotEntity* this) { if (PlayerInRange(super, 1, 0x40)) { super->action = FLYING_POT_ACTION_2; - super->actionDelay = 30; + super->timer = 30; } } @@ -202,9 +202,9 @@ void FlyingPot_Action2(FlyingPotEntity* this) { sub_08037418(this); - super->spriteOffsetX += offsets[super->actionDelay & 3]; + super->spriteOffsetX += offsets[super->timer & 3]; - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = FLYING_POT_ACTION_3; super->spritePriority.b1 = 1; super->spriteOffsetX = 0; @@ -221,13 +221,13 @@ void FlyingPot_Action3(FlyingPotEntity* this) { if (super->z.HALF.HI <= -6) { super->action = FLYING_POT_ACTION_4; - super->actionDelay = 10; + super->timer = 10; super->direction = GetFacingDirection(super, &gPlayerEntity); } } void FlyingPot_Action4(FlyingPotEntity* this) { - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = FLYING_POT_ACTION_5; } } diff --git a/src/enemy/flyingSkull.c b/src/enemy/flyingSkull.c index 0374b579..944094a3 100644 --- a/src/enemy/flyingSkull.c +++ b/src/enemy/flyingSkull.c @@ -42,7 +42,7 @@ void FlyingSkull_OnTick(FlyingSkullEntity* this) { void FlyingSkull_OnCollision(FlyingSkullEntity* this) { sub_0803A100(this); - if (super->bitfield == 0x9d) { + if (super->contactFlags == 0x9d) { super->action = 7; COLLISION_OFF(super); super->zVelocity = Q_16_16(2.625); @@ -62,8 +62,8 @@ void FlyingSkull_OnGrabbed(FlyingSkullEntity* this) { void sub_08039C98(FlyingSkullEntity* this) { sub_0803A100(this); super->subAction = 1; - super->actionDelay = 0; - super->field_0x1d = 0x30; + super->timer = 0; + super->gustJarTolerance = 0x30; } void sub_08039CB0(FlyingSkullEntity* this) { @@ -81,9 +81,9 @@ void sub_08039CB0(FlyingSkullEntity* this) { } void sub_08039CE0(FlyingSkullEntity* this) { - if (super->actionDelay == 0) { + if (super->timer == 0) { sub_0803A100(this); - super->actionDelay = 1; + super->timer = 1; super->z.HALF.HI = 0xffff; super->spriteOffsetX = 0; SetTile(this->unk_0x74, COORD_TO_TILE(super), super->collisionLayer); @@ -112,8 +112,8 @@ void sub_08039D6C(FlyingSkullEntity* this) { void sub_08039D74(FlyingSkullEntity* this) { u32 tmp; super->action = 1; - super->field_0x1c = 2; - super->field_0x16 = 0; + super->gustJarFlags = 2; + super->carryFlags = 0; super->y.HALF.HI += 3; tmp = COORD_TO_TILE(super); @@ -138,7 +138,7 @@ void sub_08039DD8(FlyingSkullEntity* this) { if (EntityWithinDistance(super, ent->x.HALF.HI, ent->y.HALF.HI, 0x30)) { if (super->type == 1) { super->action = 3; - super->actionDelay = 0x1e; + super->timer = 0x1e; } else { ent = CreateEnemy(STALFOS, super->type - 2); if (ent != NULL) { @@ -187,9 +187,9 @@ void sub_08039FA4(FlyingSkullEntity* this) { void sub_08039FAC(FlyingSkullEntity* this) { sub_0803A100(this); - super->spriteOffsetX += gUnk_080CFBE4[super->actionDelay & 3]; + super->spriteOffsetX += gUnk_080CFBE4[super->timer & 3]; - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = 4; COLLISION_ON(super); super->spritePriority.b1 = 1; @@ -206,7 +206,7 @@ void sub_0803A048(FlyingSkullEntity* this) { super->z.WORD += 0xFFFF0000; if (super->z.HALF.HI <= -6) { super->action = 5; - super->actionDelay = 10; + super->timer = 10; super->direction = GetFacingDirection(super, &gPlayerEntity); } } @@ -214,7 +214,7 @@ void sub_0803A048(FlyingSkullEntity* this) { void sub_0803A080(FlyingSkullEntity* this) { GetNextFrame(super); - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = 6; } } diff --git a/src/enemy/ghini.c b/src/enemy/ghini.c index 5ffab6bf..1fb426b7 100644 --- a/src/enemy/ghini.c +++ b/src/enemy/ghini.c @@ -10,7 +10,7 @@ #include "enemy.h" #include "functions.h" #include "area.h" -#include "coord.h" +#include "physics.h" typedef struct { /*0x00*/ Entity base; @@ -62,11 +62,11 @@ void Ghini_OnCollision(GhiniEntity* this) { sub_0803F630(this); sub_0803F6EC(this); } - if ((super->hitType == 0x25) && (super->bitfield == 0x80)) { + if ((super->hitType == 0x25) && (super->contactFlags == 0x80)) { super->action = 8; InitializeAnimation(super, 3); } else { - if (super->bitfield == 0x9d) { + if (super->contactFlags == 0x9d) { super->zVelocity = 0x18000; } if (super->confusedTime != 0) { @@ -123,7 +123,7 @@ void Ghini_OnGrabbed(GhiniEntity* this) { void Ghini_SubAction0(GhiniEntity* this) { super->subAction = 1; - super->field_0x1d = 0x3c; + super->gustJarTolerance = 0x3c; InitializeAnimation(super, (gPlayerEntity.animationState >> 2) + 5); } @@ -150,7 +150,7 @@ void Ghini_Init(GhiniEntity* this) { rand = Random(); super->direction = rand & 0x1e; super->animationState = 0xff; - super->field_0x1c = 1; + super->gustJarFlags = 1; this->unk_7a = super->health; this->unk_7b = (rand >> 4); this->unk_7c = 0; @@ -165,7 +165,7 @@ void Ghini_Init(GhiniEntity* this) { void Ghini_Action1(GhiniEntity* this) { if (sub_0803F5A8(this)) { super->action = 2; - super->actionDelay = (Random() & 0x60) + 10; + super->timer = (Random() & 0x60) + 10; } } @@ -173,9 +173,9 @@ void Ghini_Action2(GhiniEntity* this) { if (sub_0803F5A8(this) == 0) { sub_0803F50C(this); } else { - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = 3; - super->actionDelay = 0x1e; + super->timer = 0x1e; if (sub_08049DF4(1) != NULL) { super->direction = GetFacingDirection(super, gUnk_020000B0); } else { @@ -189,7 +189,7 @@ void Ghini_Action2(GhiniEntity* this) { void Ghini_Action3(GhiniEntity* this) { GetNextFrame(super); - if (--super->actionDelay == 0) { + if (--super->timer == 0) { sub_0803F51C(this); } } @@ -198,7 +198,7 @@ void Ghini_Action4(GhiniEntity* this) { if (sub_0803F5D4(this) == FALSE) { sub_0803F58C(this); GetNextFrame(super); - if (--super->actionDelay == 0) { + if (--super->timer == 0) { sub_0803F51C(this); } } @@ -225,8 +225,8 @@ void Ghini_Action6(GhiniEntity* this) { sub_0803F51C(this); } else { if (sub_08049DF4(1) != NULL) { - tmp = super->actionDelay + 1; - super->actionDelay = tmp; + tmp = super->timer + 1; + super->timer = tmp; if ((tmp & gUnk_080D0970[tmp * 0x1000000 >> 0x1e]) == 0) { sub_08004596(super, GetFacingDirection(super, gUnk_020000B0)); } @@ -235,14 +235,14 @@ void Ghini_Action6(GhiniEntity* this) { GetNextFrame(super); } else { super->action = 7; - super->actionDelay = 0x1e; + super->timer = 0x1e; } } } void Ghini_Action7(GhiniEntity* this) { GetNextFrame(super); - if (--super->actionDelay == 0) { + if (--super->timer == 0) { sub_0803F51C(this); } } @@ -295,7 +295,7 @@ void sub_0803F51C(GhiniEntity* this) { void sub_0803F528(GhiniEntity* this) { u32 rand = Random(); - super->actionDelay = (rand & 8) + 8; + super->timer = (rand & 8) + 8; if (sub_08049FA0(super)) { super->direction = (super->direction + gUnk_080D0978[rand & 7]) & 0x1e; } else { diff --git a/src/enemy/gibdo.c b/src/enemy/gibdo.c index dd2ec640..ac59891c 100644 --- a/src/enemy/gibdo.c +++ b/src/enemy/gibdo.c @@ -57,17 +57,17 @@ void Gibdo_OnTick(GibdoEntity* this) { void Gibdo_OnCollision(GibdoEntity* this) { u8 x; - if (super->bitfield == 0x87) { + if (super->contactFlags == 0x87) { if (super->action == 0x6) { sub_08037ACC(this); } super->action = 0x8; - super->actionDelay = 0x3c; + super->timer = 0x3c; COLLISION_OFF(super); Gibdo_CreateObjects(this); } else { if (super->action != 0x6) { - if (super->hitType == 0x27 && super->bitfield == 0x80) { + if (super->hitType == 0x27 && super->contactFlags == 0x80) { sub_08037A14(this); } else { if ((u8)(super->action - 1) < 2) { @@ -77,7 +77,7 @@ void Gibdo_OnCollision(GibdoEntity* this) { super->animationState = x >> 3; InitAnimationForceUpdate(super, super->animationState); if (sub_08037810(this) != 0) { - super->actionDelay = 4; + super->timer = 4; } } } @@ -118,7 +118,7 @@ void sub_080375A4(GibdoEntity* this) { } else { UpdateAnimationSingleFrame(super); if (ProcessMovement0(super) == 0) { - if (!(--super->field_0xf)) { + if (!(--super->subtimer)) { sub_080379BC(this); } } @@ -129,9 +129,9 @@ void sub_080375A4(GibdoEntity* this) { void sub_080375F8(GibdoEntity* this) { if (sub_080378B0(this) == 0) { - if (!(--super->actionDelay)) { + if (!(--super->timer)) { super->action = 4; - super->actionDelay = 0x18; + super->timer = 0x18; InitAnimationForceUpdate(super, super->animationState + 4); } } @@ -146,11 +146,11 @@ void sub_08037624(GibdoEntity* this) { UpdateAnimationSingleFrame(super); UpdateAnimationSingleFrame(super); if (ProcessMovement0(super) == 0) { - if (!(--super->field_0xf)) { + if (!(--super->subtimer)) { sub_080379BC(this); } } else { - if (!(--super->actionDelay)) { + if (!(--super->timer)) { sub_0803797C(this); } } @@ -201,7 +201,7 @@ void sub_0803773C(GibdoEntity* this) { // Turn into Stalfos void sub_0803775C(GibdoEntity* this) { Entity* x; - if (!(--super->actionDelay)) { + if (!(--super->timer)) { x = CreateEnemy(STALFOS, 0); if (x != 0) { sub_0804A4E4(super, x); @@ -222,7 +222,7 @@ void sub_080377B0(GibdoEntity* this) { u32 r1; u32 r2; super->action = 2; - super->field_0xf = 8; + super->subtimer = 8; r1 = Random(); this->field_0x74 = (r1 & 0x38) + 0x78; super->speed = 0x40; @@ -245,8 +245,8 @@ u32 sub_08037810(GibdoEntity* this) { x = GetFacingDirection(super, gUnk_020000B0); if (((x - super->direction + 6) & 0x1f) <= 0xc) { super->action = 3; - super->actionDelay = 0x18; - super->field_0xf = 0x8; + super->timer = 0x18; + super->subtimer = 0x8; super->speed = 0xc0; super->direction = DirectionRoundUp(GetFacingDirection(super, gUnk_020000B0)); super->animationState = super->direction >> 3; @@ -300,8 +300,8 @@ u32 sub_08037914(GibdoEntity* this) { void sub_0803797C(GibdoEntity* this) { u32 m; - super->actionDelay = 0x18; - super->field_0xf = 8; + super->timer = 0x18; + super->subtimer = 8; m = super->direction = (CalculateDirectionTo(super->x.HALF.HI, super->y.HALF.HI, this->field_0x78, this->field_0x7a) + 4) & 0x18; ; @@ -314,8 +314,8 @@ void sub_0803797C(GibdoEntity* this) { void sub_080379BC(GibdoEntity* this) { u32 r; - super->actionDelay = 0x18; - super->field_0xf = 0x8; + super->timer = 0x18; + super->subtimer = 0x8; r = Random(); super->animationState = ((super->animationState + (r & 2)) - 1) & 3; super->direction = DirectionFromAnimationState(super->animationState); @@ -324,7 +324,7 @@ void sub_080379BC(GibdoEntity* this) { u32 sub_080379EC(GibdoEntity* this) { if (sub_0807953C() != 0) { - if (!(--super->actionDelay)) { + if (!(--super->timer)) { sub_08037A58(this); return 1; } @@ -334,12 +334,12 @@ u32 sub_080379EC(GibdoEntity* this) { void sub_08037A14(GibdoEntity* this) { super->action = 6; - super->actionDelay = 0x18; - super->spritePriority.b0 = (super->spritePriority.b0 & (super->actionDelay - 0x20)); + super->timer = 0x18; + super->spritePriority.b0 = (super->spritePriority.b0 & (super->timer - 0x20)); super->spritePriority.b0 |= 3; super->flags2 &= 0xfe; this->field_0x7c = 5; - CopyPosition(super, super->field_0x4c); + CopyPosition(super, super->contactedEntity); InitAnimationForceUpdate(super, super->animationState + 0xc); } @@ -386,7 +386,7 @@ void Gibdo_CreateObjects(GibdoEntity* this) { Entity* E; E = CreateObject(OBJECT_2A, 3, 0); if (E != 0) { - E->type2 = super->actionDelay; + E->type2 = super->timer; E->spritePriority.b0 = 3; E->spriteOffsetX = 0; E->spriteOffsetY = 0xfc; @@ -395,7 +395,7 @@ void Gibdo_CreateObjects(GibdoEntity* this) { this->field_0x80 = E; E = CreateObject(OBJECT_2A, 3, 0); if (E != 0) { - E->type2 = super->actionDelay; + E->type2 = super->timer; E->spritePriority.b0 = 3; E->spriteOffsetX = 0xfd; E->spriteOffsetY = 0xf8; @@ -404,7 +404,7 @@ void Gibdo_CreateObjects(GibdoEntity* this) { this->field_0x84 = E; E = CreateObject(OBJECT_2A, 3, 0); if (E != 0) { - E->type2 = super->actionDelay; + E->type2 = super->timer; E->spritePriority.b0 = 3; E->spriteOffsetX = 0x5; E->spriteOffsetY = 0xf5; @@ -416,19 +416,19 @@ void Gibdo_CreateObjects(GibdoEntity* this) { void Gibdo_MoveObjectsToStalfos(GibdoEntity* this, Entity* that) { Entity* ent = this->field_0x80; if (ent != NULL) { - ent->actionDelay = 0xf; + ent->timer = 0xf; ent->parent = that; } ent = this->field_0x84; if (ent != NULL) { - ent->actionDelay = 0xf; + ent->timer = 0xf; ent->parent = that; } ent = super->child; if (ent != NULL) { - ent->actionDelay = 0xf; + ent->timer = 0xf; ent->parent = that; } } diff --git a/src/enemy/gleerok.c b/src/enemy/gleerok.c index d257fcea..67127b77 100644 --- a/src/enemy/gleerok.c +++ b/src/enemy/gleerok.c @@ -79,16 +79,16 @@ void Gleerok_OnDeath(GleerokEntity* this) { case 2: if (super->type2 == 0) { super->type2 = 1; - super->actionDelay = 0; - super->field_0xf = 0x3c; + super->timer = 0; + super->subtimer = 0x3c; this->unk_74 = 0x10; this->unk_75 = 0; gScreen.controls.alphaBlend = this->unk_74; gScreen.controls.layerFXControl = 0x1442; SoundReq(SFX_EVAPORATE); } else { - ++super->actionDelay; - if ((super->actionDelay & 0xf) == 0) { + ++super->timer; + if ((super->timer & 0xf) == 0) { this->unk_75++; this->unk_74--; gScreen.controls.alphaBlend = this->unk_74 | (this->unk_75 << 8); @@ -98,8 +98,8 @@ void Gleerok_OnDeath(GleerokEntity* this) { } } - if (super->field_0xf) { - if (--super->field_0xf == 0) { + if (super->subtimer) { + if (--super->subtimer == 0) { SoundReq(SFX_APPARATE); } } @@ -148,7 +148,7 @@ void sub_0802D170(GleerokEntity* this) { } else { super->action = 3; this->unk_80 = 0; - ((Entity*)this->unk_84)->parent->actionDelay = 0x18; + ((Entity*)this->unk_84)->parent->timer = 0x18; this->unk_84->filler[0x19] = 0; } } @@ -158,10 +158,10 @@ void sub_0802D218(GleerokEntity* this) { return; super->action = 4; - super->actionDelay = 0; - super->field_0xf = 0; + super->timer = 0; + super->subtimer = 0; this->unk_7c.HALF_U.LO = 0xb4; - ((Entity*)(this->unk_84))->parent->actionDelay = 0xc; + ((Entity*)(this->unk_84))->parent->timer = 0xc; CreateObjectWithParent(super, 0x67, 0x2, this->unk_7c.HALF_U.LO); } @@ -178,12 +178,12 @@ void sub_0802D258(GleerokEntity* this) { } } - if (super->actionDelay == 0) { - super->actionDelay = gUnk_080CD774[super->field_0xf]; - super->direction = gUnk_080CD774[super->field_0xf + 1]; - super->field_0xf = (super->field_0xf & 0x3f) + 2; + if (super->timer == 0) { + super->timer = gUnk_080CD774[super->subtimer]; + super->direction = gUnk_080CD774[super->subtimer + 1]; + super->subtimer = (super->subtimer & 0x3f) + 2; } else { - super->actionDelay--; + super->timer--; } if (super->direction <= 1) { @@ -325,12 +325,12 @@ NONMATCH("asm/non_matching/gleerok/sub_0802D3B8.inc", void sub_0802D3B8(GleerokE ptr = gUnk_080CD7C4; ptr += super->type2 * 4; super->spritePriority.b0 = *(ptr + 1); - super->field_0xf = 0; + super->subtimer = 0; InitializeAnimation(super, 0x24); break; case 2: super->spritePriority.b0 = 0; - super->field_0xf = 0; + super->subtimer = 0; InitAnimationForceUpdate(super, 0); break; case 3: @@ -434,7 +434,7 @@ void sub_0802D714(GleerokEntity* this) { ((GleerokEntity*)(super->child))->unk_84 = heap; } - heap->ent2->actionDelay = 0x18; + heap->ent2->timer = 0x18; } void sub_0802D77C(GleerokEntity* this) { @@ -446,20 +446,20 @@ void sub_0802D77C(GleerokEntity* this) { if (super->type2 != 2) return; - super->field_0xf = 0; - super->actionDelay = 0; + super->subtimer = 0; + super->timer = 0; super->subAction = 4; - this->unk_84->ent2->actionDelay = 0xc; + this->unk_84->ent2->timer = 0xc; } void sub_0802D7B4(GleerokEntity* this) { - if (super->actionDelay == 0) { - if (gUnk_080CD7F8[super->field_0xf] == 0xff) { - super->field_0xf = 0; - super->actionDelay = 0; + if (super->timer == 0) { + if (gUnk_080CD7F8[super->subtimer] == 0xff) { + super->subtimer = 0; + super->timer = 0; super->action = 1; super->subAction = 0; - this->unk_84->ent2->actionDelay = 0x18; + this->unk_84->ent2->timer = 0x18; gRoomControls.camera_target = &gPlayerEntity; #ifndef EU gPlayerState.controlMode = CONTROL_1; @@ -468,13 +468,13 @@ void sub_0802D7B4(GleerokEntity* this) { SoundReq(BGM_BOSS_THEME); return; } else { - super->actionDelay = gUnk_080CD7F8[super->field_0xf]; - super->direction = gUnk_080CD7F8[super->field_0xf + 1]; - super->field_0xf += 2; + super->timer = gUnk_080CD7F8[super->subtimer]; + super->direction = gUnk_080CD7F8[super->subtimer + 1]; + super->subtimer += 2; SoundReq(SFX_BOSS_HIT); } } else { - super->actionDelay--; + super->timer--; } if (super->direction <= 1) { @@ -505,11 +505,11 @@ NONMATCH("asm/non_matching/gleerok/sub_0802D86C.inc", void sub_0802D86C(GleerokE super->iframes = super->parent->iframes; if (super->iframes == 0) { - if (super->field_0xf == 0) { + if (super->subtimer == 0) { UnloadOBJPalette(super); LoadObjPalette(super, 0xc9); } else { - super->field_0xf--; + super->subtimer--; UnloadOBJPalette(super); LoadObjPalette(super, 0xca); } @@ -534,11 +534,11 @@ NONMATCH("asm/non_matching/gleerok/sub_0802D86C.inc", void sub_0802D86C(GleerokE return; ((GleerokEntity*)(super->parent))->unk_7b = 1; - super->actionDelay = 0; + super->timer = 0; do { - CreateObjectWithParent(super, OBJECT_67, 0, super->actionDelay); - } while (++super->actionDelay < 8); + CreateObjectWithParent(super, OBJECT_67, 0, super->timer); + } while (++super->timer < 8); SoundReq(SFX_150); DeleteThisEntity(); @@ -577,7 +577,7 @@ NONMATCH("asm/non_matching/gleerok/sub_0802D86C.inc", void sub_0802D86C(GleerokE super->child = enemy; if (enemy) { enemy->parent = super->parent; - super->actionDelay = this->unk_84->filler[1]; + super->timer = this->unk_84->filler[1]; this->unk_84->ent = super->child; ((GleerokEntity*)super->child)->unk_84 = this->unk_84; } @@ -599,8 +599,8 @@ NONMATCH("asm/non_matching/gleerok/sub_0802D86C.inc", void sub_0802D86C(GleerokE } } - if ((super->bitfield & 0x80) && this->unk_74 == 0) { - if ((super->bitfield & 0x7f) == 0x1d) { + if ((super->contactFlags & 0x80) && this->unk_74 == 0) { + if ((super->contactFlags & 0x7f) == 0x1d) { super->zVelocity = 0x30000; super->parent->subAction = 4; super->parent->type2 = 0; @@ -608,8 +608,8 @@ NONMATCH("asm/non_matching/gleerok/sub_0802D86C.inc", void sub_0802D86C(GleerokE SoundReq(SFX_BUTTON_PRESS); } } else { - if (super->actionDelay != this->unk_84->filler[1]) { - if (((super->actionDelay - this->unk_84->filler[1]) & 0x1f) > 0x10) { + if (super->timer != this->unk_84->filler[1]) { + if (((super->timer - this->unk_84->filler[1]) & 0x1f) > 0x10) { if (++super->frameIndex >= 0x31) { super->frameIndex = 0x28; } @@ -619,7 +619,7 @@ NONMATCH("asm/non_matching/gleerok/sub_0802D86C.inc", void sub_0802D86C(GleerokE } } - super->actionDelay = this->unk_84->filler[1]; + super->timer = this->unk_84->filler[1]; } } @@ -652,7 +652,7 @@ NONMATCH("asm/non_matching/gleerok/sub_0802D86C.inc", void sub_0802D86C(GleerokE END_NONMATCH void sub_0802DB84(GleerokEntity* this) { - u32 actionDelay; + u32 timer; super->direction = GetFacingDirection(super, &gPlayerEntity); if (this->unk_84->filler[0x1] == super->direction) { super->subAction = 1; @@ -661,11 +661,11 @@ void sub_0802DB84(GleerokEntity* this) { } if (((this->unk_84->filler[0x1] - super->direction) & 0x1f) > 0x10) { - actionDelay = 0; - super->actionDelay &= 0xfe; + timer = 0; + super->timer &= 0xfe; } else { - actionDelay = 1; - super->actionDelay = actionDelay; + timer = 1; + super->timer = timer; } switch (this->unk_79) { @@ -680,7 +680,7 @@ void sub_0802DB84(GleerokEntity* this) { break; } - sub_0802EA48(this->unk_84, 5, super->speed, actionDelay); + sub_0802EA48(this->unk_84, 5, super->speed, timer); sub_0802E768(this->unk_84); sub_0802E518(this); sub_0802EBC4(this); @@ -693,32 +693,32 @@ void sub_0802DC1C(GleerokEntity* this) { if (diff > 0x10) { if (diff <= 0x1d) { super->subAction = 0; - this->unk_84->ent2->actionDelay = 0; + this->unk_84->ent2->timer = 0; return; } } else if (diff >= 3) { super->subAction = 0; - this->unk_84->ent2->actionDelay = 0; + this->unk_84->ent2->timer = 0; return; } if (this->unk_78) { this->unk_78--; } else { - u8 actionDelay = super->actionDelay; + u8 timer = super->timer; diff = 0; - if (actionDelay == 1) { + if (timer == 1) { diff = 1; } sub_0802EA48(this->unk_84, 5, 0x20, diff); if (sub_0802EA18(*(u16*)&this->unk_84->filler[0], *(u16*)&this->unk_84->filler[0x14], 4)) { - if (super->actionDelay == 1) { + if (super->timer == 1) { *(u16*)&this->unk_84->filler[0x14] = (((this->unk_84->filler[0x1] - 4) & 0x1f) << 8) | 0xff; } else { *(u16*)&this->unk_84->filler[0x14] = (((this->unk_84->filler[0x1] + 4) & 0x1f) << 8); } - super->actionDelay ^= 1; + super->timer ^= 1; this->unk_78 = 0xc; } } @@ -730,12 +730,12 @@ void sub_0802DC1C(GleerokEntity* this) { } void sub_0802DCE0(GleerokEntity* this) { - if (this->unk_84->ent2->actionDelay != 0xc) { + if (this->unk_84->ent2->timer != 0xc) { super->direction = GetFacingDirection(super, &gPlayerEntity); if (this->unk_84->filler[0x15] == super->direction) { - this->unk_84->ent2->actionDelay = 0xc; + this->unk_84->ent2->timer = 0xc; this->unk_82 = 4; - super->field_0xf = 0; + super->subtimer = 0; } else { s32 svar1, diff; diff = ((this->unk_84->filler[0x15] - super->direction) & 0x1f); @@ -748,16 +748,16 @@ void sub_0802DCE0(GleerokEntity* this) { sub_0802E768(this->unk_84); } } else { - if (super->field_0xf < 6) { + if (super->subtimer < 6) { if (this->unk_82 == 0) { this->unk_82 = 4; - this->unk_84->entities[super->field_0xf]->field_0xf = 4; - super->field_0xf++; + this->unk_84->entities[super->subtimer]->subtimer = 4; + super->subtimer++; } else { this->unk_82--; } } else { - if (this->unk_84->ent2->field_0xf == 0) { + if (this->unk_84->ent2->subtimer == 0) { super->child = CreateProjectileWithParent(super, GLEEROK_PROJECTILE, 0); if (super->child != NULL) { @@ -767,7 +767,7 @@ void sub_0802DCE0(GleerokEntity* this) { super->child->child = this->unk_84->entities[0]; } - this->unk_84->ent2->actionDelay = 0; + this->unk_84->ent2->timer = 0; if (this->unk_74 == 0) { this->unk_74 = 1; } else { @@ -801,7 +801,7 @@ void sub_0802DDD8(GleerokEntity* this) { break; super->type2 = 1; - super->field_0xf = 0; + super->subtimer = 0; if ((Random() & 1) == 0) { super->direction = 0; @@ -825,7 +825,7 @@ void sub_0802DDD8(GleerokEntity* this) { r4 = 0; } - if (this->unk_84->ent2->field_0xf == 1) { + if (this->unk_84->ent2->subtimer == 1) { super->child = CreateProjectileWithParent(super, GLEEROK_PROJECTILE, r2); if (super->child != NULL) { super->child->direction = this->unk_84->filler[0x15]; @@ -837,10 +837,10 @@ void sub_0802DDD8(GleerokEntity* this) { if (this->unk_74 == 0) { this->unk_74 = r4; - this->unk_84->entities[super->field_0xf]->field_0xf = r8; + this->unk_84->entities[super->subtimer]->subtimer = r8; - if (++super->field_0xf > 5) { - super->field_0xf = 0; + if (++super->subtimer > 5) { + super->subtimer = 0; } } else { this->unk_74--; @@ -864,16 +864,16 @@ void sub_0802DDD8(GleerokEntity* this) { super->direction ^= 1; if (super->direction == 1) { this->unk_7a = (this->unk_7a - (uvar1 * 2)) & 0x1f; - super->actionDelay = 1; + super->timer = 1; } else { this->unk_7a = (this->unk_7a + (uvar1 * 2)) & 0x1f; - super->actionDelay &= 0xfe; + super->timer &= 0xfe; } - this->unk_84->ent2->actionDelay = 0xc; + this->unk_84->ent2->timer = 0xc; } else { super->subAction = 0; - this->unk_84->ent2->actionDelay = 0; + this->unk_84->ent2->timer = 0; sub_0802EB9C(this); } } @@ -903,7 +903,7 @@ void sub_0802DFC0(GleerokEntity* this) { if (this->unk_7b) { COLLISION_ON(super); super->type2 = 1; - this->unk_84->ent2->actionDelay = 0x18; + this->unk_84->ent2->timer = 0x18; SoundReq(SFX_BOSS_HIT); } } @@ -932,7 +932,7 @@ void sub_0802E034(GleerokEntity* this) { if (super->type2 == 2) { this->unk_7c.HALF.LO = 0x168; this->unk_80 = 1; - heap->ent2->actionDelay = 0; + heap->ent2->timer = 0; } super->type2++; @@ -982,7 +982,7 @@ void sub_0802E0B8(GleerokEntity* this) { super->type2 = 4; InitializeAnimation(super, 0x4e); } else { - if (super->bitfield & 0x80) { + if (super->contactFlags & 0x80) { if (super->iframes > 0) { SoundReq(SFX_BOSS_HIT); } @@ -1100,7 +1100,7 @@ void sub_0802E300(GleerokEntity* this) { ((GleerokEntity*)super->child)->unk_84 = heap; } - heap->ent2->actionDelay = 0x18; + heap->ent2->timer = 0x18; } else { if ((gRoomTransition.frameCount & 0xf) == 0) { CreateProjectileWithParent(super, GLEEROK_PROJECTILE, 0x3); @@ -1202,7 +1202,7 @@ NONMATCH("asm/non_matching/gleerok/sub_0802E518.inc", void sub_0802E518(GleerokE heap->entities[index]->y.WORD -= result << 8; } - if (heap->ent2->actionDelay == 0x18) { + if (heap->ent2->timer == 0x18) { r7 = (heap->filler[0x15] >> 3) << 2; if (heap->filler[0x2d] > 0xc) { r7 += 3; @@ -1217,7 +1217,7 @@ NONMATCH("asm/non_matching/gleerok/sub_0802E518.inc", void sub_0802E518(GleerokE if (this->unk_80 == 0) { sub_0802E7CC(heap, 5, 0, 0); r7 = (heap->ent2->animationState / 2 + heap->ent2->animationState) / 4; - r7 += heap->ent2->actionDelay; + r7 += heap->ent2->timer; } else { if (super->iframes == 0) { if ((super->animIndex != (heap->filler[0x15] >> 3) + 0x2f) || (super->frame & ANIM_DONE) != 0) { diff --git a/src/enemy/gyorgChild.c b/src/enemy/gyorgChild.c index 84bd4e6e..348e7aca 100644 --- a/src/enemy/gyorgChild.c +++ b/src/enemy/gyorgChild.c @@ -80,7 +80,7 @@ void GyorgChild_Action0(GyorgChildEntity* this) { 0x50, 0x1, 0x40, 0x1, 0x30, 0x1, 0x20, 0x1, 0x10, 0x1, 0, 0, 0x10, -0x1, 0x20, -0x1, 0x30, -0x1, 0x40, -0x1, 0x50, -0x1, }; - super->field_0x1c = 1; + super->gustJarFlags = 1; super->spriteOrientation.flipY = 3; super->spriteRendering.b3 = 3; super->spritePriority.b0 = 7; @@ -95,20 +95,20 @@ void GyorgChild_Action0(GyorgChildEntity* this) { super->direction -= 5; super->direction &= 0x1F; r *= 2; - super->actionDelay = gUnk_080D1EA0[r]; + super->timer = gUnk_080D1EA0[r]; this->unk_7b = gUnk_080D1EA0[r + 1]; super->speed = 0x200; } else { super->action = 2; - super->actionDelay = 1; + super->timer = 1; super->spriteSettings.draw = 0; } } void GyorgChild_Action1(GyorgChildEntity* this) { LinearMoveUpdate(super); - if (super->actionDelay != 0) { - if ((--super->actionDelay & 0xF) == 0) { + if (super->timer != 0) { + if ((--super->timer & 0xF) == 0) { super->direction += this->unk_7b; super->direction &= 0x1F; } @@ -136,12 +136,12 @@ void GyorgChild_Action1(GyorgChildEntity* this) { break; } super->action = 2; - super->actionDelay = 90; + super->timer = 90; super->spriteSettings.draw = 0; } void GyorgChild_Action2(GyorgChildEntity* this) { - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = 3; super->flags |= ENT_COLLIDE; Random(); diff --git a/src/enemy/gyorgFemale.c b/src/enemy/gyorgFemale.c index ac1bcb00..a5f35588 100644 --- a/src/enemy/gyorgFemale.c +++ b/src/enemy/gyorgFemale.c @@ -113,7 +113,7 @@ void GyorgFemale_Action1(GyorgFemaleEntity* this) { sub_080465C8(); if (((GyorgHeap*)super->myHeap)->boss->unk_6c & 0x38) { super->action = 2; - super->actionDelay = 0; + super->timer = 0; this->eyeTimer = 0; this->eyesHitFrame = 0; this->eyesHit = 0; @@ -124,7 +124,7 @@ void GyorgFemale_Action1(GyorgFemaleEntity* this) { if (((GyorgHeap*)super->myHeap)->boss->unk_6c & 0x40) { super->action = 3; this->childrenSpawnTimer = 0x3c; - super->actionDelay = 0; + super->timer = 0; this->eyeTimer = 0; this->eyesHitFrame = 0; this->eyesHit = 0; @@ -394,15 +394,15 @@ void GyorgFemale_ChooseEyePattern(GyorgFemaleEntity* this) { void GyorgFemale_ProcessEyeHit(GyorgFemaleEntity* this) { if (this->eyesHitFrame != 0) { this->eyesHit |= this->eyesHitFrame; - if (super->actionDelay == 0 && this->eyesVulnerable != 0xFF) { + if (super->timer == 0 && this->eyesVulnerable != 0xFF) { #ifndef EU - super->actionDelay = 4; + super->timer = 4; #else - super->actionDelay = 3; + super->timer = 3; #endif } if (sub_08000E62(this->eyesHit) > 2) { - super->actionDelay = 0; + super->timer = 0; this->eyesHit = 0; this->eyesVulnerable = 0xFF; SoundReq(SFX_BOSS_HIT); @@ -424,7 +424,7 @@ void GyorgFemale_ProcessEyeHit(GyorgFemaleEntity* this) { sub_080467DC(this); } } - if (super->actionDelay != 0 && this->eyesVulnerable != 0xFF && --super->actionDelay == 0) { + if (super->timer != 0 && this->eyesVulnerable != 0xFF && --super->timer == 0) { Entity* tmp; this->unk_80 |= this->eyesHit; this->eyesHit = 0; diff --git a/src/enemy/gyorgFemaleEye.c b/src/enemy/gyorgFemaleEye.c index 6ddb4f65..5033fdff 100644 --- a/src/enemy/gyorgFemaleEye.c +++ b/src/enemy/gyorgFemaleEye.c @@ -71,13 +71,13 @@ void GyorgFemaleEye_OnCollision(GyorgFemaleEyeEntity* this) { #endif parent->eyesHitFrame |= (1 << super->type); #ifndef EU - switch (super->bitfield & 0x7F) { + switch (super->contactFlags & 0x7F) { case 4 ... 6: case 8 ... 13: case 16 ... 18: case 24 ... 26: #endif - (*(((GyorgHeap**)&parent->base.myHeap)))->unk_18[super->type] = super->field_0x4c; + (*(((GyorgHeap**)&parent->base.myHeap)))->unk_18[super->type] = super->contactedEntity; (*(((GyorgHeap**)&parent->base.myHeap)))->reflectFxPos.HALF.x = (gPlayerEntity.x.HALF.HI + super->x.HALF.HI) / 2; (*(((GyorgHeap**)&parent->base.myHeap)))->reflectFxPos.HALF.y = diff --git a/src/enemy/gyorgMale.c b/src/enemy/gyorgMale.c index 8e6365da..975424f7 100644 --- a/src/enemy/gyorgMale.c +++ b/src/enemy/gyorgMale.c @@ -132,7 +132,7 @@ void sub_08046898(GyorgMaleEntity* this) { super->spriteSettings.draw = 1; super->spriteOrientation.flipY = 2; super->spriteRendering.b3 = 2; - super->field_0x3c |= 0x10; + super->collisionFlags |= 0x10; super->collisionLayer = 2; this->unk_7c = 0; this->unk_78 = 0; @@ -163,7 +163,7 @@ void sub_08046930(GyorgMaleEntity* this) { if (this->unk_7c == 0) return; super->subAction = 1; - super->actionDelay = 1; + super->timer = 1; super->animationState = 0; super->direction = 0; #ifdef EU @@ -185,13 +185,13 @@ void sub_0804696C(GyorgMaleEntity* this) { SoundReq(BGM_BOSS_THEME); #endif } - if (super->actionDelay) { + if (super->timer) { #ifdef EU if (gRoomControls.origin_y + 0x210 > super->y.HALF.HI) { #else if (gRoomControls.origin_y + 0x258 > super->y.HALF.HI) { #endif - super->actionDelay = 0; + super->timer = 0; SoundReq(SFX_APPARATE); } } @@ -392,8 +392,8 @@ void sub_08046E68(GyorgMaleEntity* this) { sub_08047EA4(this, ((0x100 - super->direction) & 0xFF) << 8); } else { super->subAction = 4; - super->actionDelay = 0x3F; - super->field_0xf = 1; + super->timer = 0x3F; + super->subtimer = 1; super->direction = (gUnk_080D1B70[Random() & 1] + tmp) & 0xC0; sub_08047D88(this); } @@ -403,14 +403,14 @@ const u16 gUnk_080D1B74[0x10] = { 0x20, 0x40, 0x60, 0x80, 0xA0, 0xC0, 0xE0, 0x1 0x100, 0xE0, 0xC0, 0xA0, 0x80, 0x60, 0x40, 0x20 }; void sub_08046EF4(GyorgMaleEntity* this) { - if (--super->actionDelay == 0) { - super->actionDelay = 0x7F; + if (--super->timer == 0) { + super->timer = 0x7F; super->direction ^= 0x80; } - super->speed = gUnk_080D1B74[(super->actionDelay >> 3) & 0xF]; - if (--super->field_0xf == 0) { + super->speed = gUnk_080D1B74[(super->timer >> 3) & 0xF]; + if (--super->subtimer == 0) { Entity* tmp; - super->field_0xf = (Random() & 0x38) + 0x78; + super->subtimer = (Random() & 0x38) + 0x78; tmp = CreateProjectile(GYORG_MALE_ENERGY_PROJECTILE); if (tmp) { tmp->collisionLayer = 2; @@ -926,8 +926,8 @@ void sub_08047B84(GyorgMaleEntity* this) { void sub_08047BA4(GyorgMaleEntity* this) { super->subAction = 1; - super->actionDelay = 0x78; - super->field_0xf = 0; + super->timer = 0x78; + super->subtimer = 0; if (gRoomControls.origin_x + 0x200 < super->x.HALF.HI) { this->unk_76 = 0x78; } else { @@ -941,11 +941,11 @@ const s8 gUnk_080D1C00[4] = { 0x40, -0x40, -0x40, 0x40 }; void sub_08047BF0(GyorgMaleEntity* this) { Entity* tmp; - super->direction = gUnk_080D1C00[super->actionDelay & 3]; + super->direction = gUnk_080D1C00[super->timer & 3]; super->speed = 0x100; sub_08047E48(this); - if (super->actionDelay == 0) { - if ((super->field_0xf++ & 0xF) == 0) { + if (super->timer == 0) { + if ((super->subtimer++ & 0xF) == 0) { tmp = CreateFx(super, FX_GIANT_EXPLOSION4, 0); if (tmp) { u32 rand = Random(); @@ -967,18 +967,18 @@ void sub_08047BF0(GyorgMaleEntity* this) { InitAnimationForceUpdate(super, 1); } } else { - super->actionDelay--; - if (super->actionDelay == 0x5A) { + super->timer--; + if (super->timer == 0x5A) { tmp = super->child; tmp->spriteSettings.draw = 0; CreateFx(tmp, FX_GIANT_EXPLOSION4, 0); } else { - if (super->actionDelay == 0x3C) { + if (super->timer == 0x3C) { tmp = super->child->child; tmp->spriteSettings.draw = 0; CreateFx(tmp, FX_GIANT_EXPLOSION4, 0); } else { - if (super->actionDelay == 0x1E) { + if (super->timer == 0x1E) { tmp = super->child->child->child; tmp->spriteSettings.draw = 0; CreateFx(tmp, FX_GIANT_EXPLOSION4, 0); diff --git a/src/enemy/gyorgMaleEye.c b/src/enemy/gyorgMaleEye.c index 4e9128f3..b4bd94a7 100644 --- a/src/enemy/gyorgMaleEye.c +++ b/src/enemy/gyorgMaleEye.c @@ -82,13 +82,13 @@ void GyorgMaleEye_Action1(GyorgMaleEyeEntity* this) { if ((super->frame & ANIM_DONE) != 0) { super->action = 2; super->flags |= 0x80; - super->actionDelay = 0x2d; + super->timer = 0x2d; } } void GyorgMaleEye_Action2(GyorgMaleEyeEntity* this) { sub_08048F50(this); - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = 3; super->flags &= 0x7f; InitializeAnimation(super, super->animIndex + 4); diff --git a/src/enemy/hangingSeed.c b/src/enemy/hangingSeed.c index 51b119c7..3c6dbdab 100644 --- a/src/enemy/hangingSeed.c +++ b/src/enemy/hangingSeed.c @@ -21,7 +21,7 @@ void HangingSeed_OnTick(Entity* this) { } void HangingSeed_OnCollision(Entity* this) { - if (this->bitfield & 0x80) { + if (this->contactFlags & 0x80) { CreateFx(this, FX_BUSH, 0x80); DeleteThisEntity(); } diff --git a/src/enemy/helmasaur.c b/src/enemy/helmasaur.c index 731e24bb..609a4b07 100644 --- a/src/enemy/helmasaur.c +++ b/src/enemy/helmasaur.c @@ -47,7 +47,7 @@ void Helmasaur_OnTick(Entity* this) { void Helmasaur_OnCollision(Entity* this) { if (this->hitType != 0x19) { - switch (this->bitfield & 0x7f) { + switch (this->contactFlags & 0x7f) { case 0: case 2: case 3: @@ -78,7 +78,7 @@ void Helmasaur_OnGrabbed(Entity* this) { void sub_0802BC74(Entity* this) { sub_0802C1C0(this); this->subAction = 1; - this->field_0x1d = 60; + this->gustJarTolerance = 60; this->animationState = AnimationStateFlip90(gPlayerEntity.animationState >> 1); InitializeAnimation(this, this->animationState); } @@ -92,11 +92,11 @@ void sub_0802BCA8(Entity* this) { Entity* ent; this->action = 7; - this->actionDelay = 90; + this->timer = 90; this->zVelocity = Q_16_16(1.5); this->hitType = 0x19; - this->field_0x3a = this->field_0x3a & 0xfb; - this->field_0x1c = 0x12; + this->gustJarState = this->gustJarState & 0xfb; + this->gustJarFlags = 0x12; ent = CreateEnemy(HELMASAUR, 1); if (ent != NULL) { ent->animationState = this->animationState; @@ -108,7 +108,7 @@ void sub_0802BCA8(Entity* this) { void sub_0802BCFC(Entity* this) { this->subAction = 1; - this->field_0x1d = 60; + this->gustJarTolerance = 60; } void sub_0802BD08(Entity* this) { @@ -127,7 +127,7 @@ void nullsub_145(Entity* this) { void sub_0802BD28(Entity* this) { if (this->flags & ENT_COLLIDE) { COLLISION_ON(this); - this->field_0x3a &= ~0x4; + this->gustJarState &= ~0x4; } else { this->health = 0; } @@ -137,7 +137,7 @@ void sub_0802BD54(Entity* this) { sub_0804A720(this); this->action = 1; this->field_0x78.HALF.LO = Random(); - this->field_0x1d = 60; + this->gustJarTolerance = 60; this->field_0x78.HALF.HI = 0xff; this->direction = DirectionRound(Random()); this->animationState = this->direction >> 3; @@ -145,8 +145,8 @@ void sub_0802BD54(Entity* this) { } void sub_0802BD8C(Entity* this) { - if (this->actionDelay) { - this->actionDelay--; + if (this->timer) { + this->timer--; } else { u32 direction; @@ -168,20 +168,20 @@ void sub_0802BD8C(Entity* this) { void sub_0802BDE0(Entity* this) { if (sub_0802C06C(this)) { this->action = 3; - this->actionDelay = 60; + this->timer = 60; this->field_0x78.HALF.HI = 0xff; } else { this->action = 1; - this->actionDelay = (Random() & 0xf) + 0xf; + this->timer = (Random() & 0xf) + 0xf; this->field_0x78.HALF.HI = this->direction; } } void sub_0802BE18(Entity* this) { UpdateAnimationVariableFrames(this, 2); - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 4; - this->actionDelay = 0x1e; + this->timer = 0x1e; this->speed = 0x300; } else { sub_0802C18C(this); @@ -212,7 +212,7 @@ void sub_0802BE80(Entity* this) { sub_0802C18C(this); } else { sub_0802C1C0(this); - this->actionDelay += 30; + this->timer += 30; } } @@ -226,15 +226,15 @@ void sub_0802BEBC(Entity* this) { } void sub_0802BEEC(Entity* this) { - if (this->actionDelay) { - if ((--this->actionDelay & 0x1f) == 0) { + if (this->timer) { + if ((--this->timer & 0x1f) == 0) { this->animationState ^= 2; this->direction = this->animationState << 3; InitializeAnimation(this, this->animationState + 4); } } else if (!GravityUpdate(this, Q_16_16(0.109375))) { this->action = 8; - this->actionDelay = 30; + this->timer = 30; this->speed = 0x120; } } @@ -242,10 +242,10 @@ void sub_0802BEEC(Entity* this) { void sub_0802BF3C(Entity* this) { ProcessMovement0(this); GetNextFrame(this); - if (--this->actionDelay == 0) { + if (--this->timer == 0) { u32 sprite; - this->actionDelay = 30; + this->timer = 30; this->direction = sub_0802C020(this); sprite = this->direction >> 3; if (sprite != this->animationState) { @@ -258,7 +258,7 @@ void sub_0802BF3C(Entity* this) { void sub_0802BF78(Entity* this) { this->action = 1; this->flags2 = 4; - this->field_0x1c = 1; + this->gustJarFlags = 1; this->direction = this->animationState << 3; InitializeAnimation(this, this->animationState + 8); } @@ -268,7 +268,7 @@ void sub_0802BF98(Entity* this) { gUnk_080CD450[this->subAction](this); } else { this->action = 2; - this->actionDelay = 30; + this->timer = 30; COLLISION_OFF(this); } } @@ -289,7 +289,7 @@ void sub_0802BFE0(Entity* this) { void sub_0802BFF4(Entity* this) { this->spriteSettings.draw ^= 1; - if (--this->actionDelay == 0) { + if (--this->timer == 0) { DeleteEntity(this); } } @@ -332,7 +332,7 @@ bool32 sub_0802C06C(Entity* this) { bool32 sub_0806FC24(u32, u32); bool32 sub_0802C0E8(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { return TRUE; } else { const s8* ptr = &gUnk_080CD45C[this->direction >> 2]; @@ -364,7 +364,7 @@ void sub_0802C18C(Entity* this) { void sub_0802C1C0(Entity* this) { this->action = 1; - this->actionDelay = 30; + this->timer = 30; } void sub_0802C1CC(Entity* this) { diff --git a/src/enemy/keaton.c b/src/enemy/keaton.c index 09564cd3..a7548f9a 100644 --- a/src/enemy/keaton.c +++ b/src/enemy/keaton.c @@ -42,10 +42,10 @@ void Keaton_OnCollision(Entity* this) { if (this->action != 3 && this->action != 4) { this->action = 3; - this->actionDelay = 0xC; + this->timer = 0xC; this->direction = DirectionTurnAround(DirectionRoundUp(this->knockbackDirection)); InitAnimationForceUpdate(this, this->direction >> 3); - } else if (this->bitfield == 0xCC) { + } else if (this->contactFlags == 0xCC) { if (this->confusedTime == 0) { sub_0803275C(this); } @@ -70,12 +70,12 @@ void sub_08032468(Entity* this) { void sub_0803248C(Entity* this) { if (sub_080325E8(this) == 0) { if (sub_0803271C(this) == 0) { - this->actionDelay--; - if (this->actionDelay == 0) { + this->timer--; + if (this->timer == 0) { sub_08032650(this); } if (ProcessMovement0(this) == 0) { - this->actionDelay = 1; + this->timer = 1; } UpdateAnimationSingleFrame(this); } @@ -93,10 +93,10 @@ void sub_080324CC(Entity* this) { } void sub_080324FC(Entity* this) { - if (this->actionDelay != 0) { - this->actionDelay--; - if (this->actionDelay == 0) { - this->field_0xf = 0x1E; + if (this->timer != 0) { + this->timer--; + if (this->timer == 0) { + this->subtimer = 0x1E; this->animationState = this->direction / 8; InitAnimationForceUpdate(this, this->animationState + 4); } else { @@ -105,8 +105,8 @@ void sub_080324FC(Entity* this) { } UpdateAnimationSingleFrame(this); UpdateAnimationSingleFrame(this); - this->field_0xf--; - if (this->field_0xf == 0) { + this->subtimer--; + if (this->subtimer == 0) { this->action = 4; this->speed = 0x1E0; this->field_0x76.HWORD = 0x46; @@ -114,14 +114,14 @@ void sub_080324FC(Entity* this) { *(((u8*)&this->field_0x7a) + 1) = 0; sub_080327C8(this); } else { - if ((this->field_0xf & 0x3) == 0) { + if ((this->subtimer & 0x3) == 0) { sub_08032794(this); } } } void sub_08032574(Entity* this) { - if (this->child && (this->child->bitfield & 0x80)) { + if (this->child && (this->child->contactFlags & 0x80)) { sub_0803275C(this); return; } @@ -138,8 +138,8 @@ void sub_08032574(Entity* this) { } void sub_080325C4(Entity* this) { - this->actionDelay--; - if ((this->actionDelay == 0) && (sub_080325E8(this) == 0)) { + this->timer--; + if ((this->timer == 0) && (sub_080325E8(this) == 0)) { sub_08032784(this); } } @@ -149,7 +149,7 @@ u32 sub_080325E8(Entity* this) { (EntityInRectRadius(this, gUnk_020000B0, 0x68, 0x40) != 0)) { if (((GetFacingDirection(this, gUnk_020000B0) - (DirectionRound(this->frame)) + 2) & 0x1F) < 5) { this->action = 3; - this->actionDelay = 0xC; + this->timer = 0xC; this->direction = DirectionRound(this->frame); return 1; } @@ -161,7 +161,7 @@ void sub_08032650(Entity* this) { u32 uVar3; uVar3 = Random(); - this->actionDelay = gUnk_080CE7E0[uVar3 & 0xf]; + this->timer = gUnk_080CE7E0[uVar3 & 0xf]; if (!((sub_08049FA0(this) == 0) && ((uVar3 >> 8 & 1) == 0))) { this->direction = DirectionRound(uVar3 >> 0x10); } else { @@ -210,7 +210,7 @@ void sub_08032740(Entity* this) { void sub_0803275C(Entity* this) { this->action = 5; - this->actionDelay = 0x2D; + this->timer = 0x2D; this->speed = 0x80; InitAnimationForceUpdate(this, this->animationState); sub_0803269C(this, this->direction); diff --git a/src/enemy/keese.c b/src/enemy/keese.c index bbc2bac6..424432a5 100644 --- a/src/enemy/keese.c +++ b/src/enemy/keese.c @@ -64,7 +64,7 @@ void Keese_Initialize(Entity* this) { this->z.HALF.HI = -0x10; } this->direction = Random() & 0x1f; - this->field_0x1c = 1; + this->gustJarFlags = 1; this->spritePriority.b0 = 3; this->collisionLayer = 3; UpdateSpriteForCollisionLayer(this); @@ -88,14 +88,14 @@ void Keese_Fly(Entity* this) { } void Keese_Rest(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { Keese_StartFly(this); } } void Keese_Sleep(Entity* this) { - if (this->actionDelay != 0) { - this->actionDelay--; + if (this->timer != 0) { + this->timer--; } else { if (EntityWithinDistance(this, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x70)) Keese_StartFly(this); @@ -112,12 +112,12 @@ void Keese_StartFly(Entity* this) { void sub_08021F24(Entity* this) { if (this->field_0x78.HWORD == 0) { this->action = 2; - this->actionDelay = gKeeseRestDurations[Random() & 0xf]; + this->timer = gKeeseRestDurations[Random() & 0xf]; InitializeAnimation(this, KeeseAnimation_Rest); } else if (!this->field_0x7a.HWORD && !(EntityWithinDistance(this, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x70))) { this->action = 3; - this->actionDelay = 30; + this->timer = 30; InitializeAnimation(this, KeeseAnimation_Rest); } else { if (sub_08049FA0(this) != 0) { diff --git a/src/enemy/lakitu.c b/src/enemy/lakitu.c index 971ffd09..a4c2e6a0 100644 --- a/src/enemy/lakitu.c +++ b/src/enemy/lakitu.c @@ -58,7 +58,7 @@ void Lakitu_OnTick(Entity* this) { } void Lakitu_OnCollision(Entity* this) { - if ((this->bitfield & 0x7f) == 0x1d) { + if ((this->contactFlags & 0x7f) == 0x1d) { this->zVelocity = Q_16_16(2.0); sub_0803CBAC(this); @@ -102,7 +102,7 @@ void Lakitu_OnGrabbed(Entity* this) { void sub_0803C844(Entity* this) { this->subAction = 1; - this->field_0x1d = 0x3c; + this->gustJarTolerance = 0x3c; } void sub_0803C850(Entity* this) { @@ -154,7 +154,7 @@ void Lakitu_EndHide(Entity* this) { if (this->frame & ANIM_DONE) { this->action = IDLE; - this->actionDelay = 0x3c; + this->timer = 0x3c; this->hitType = 0x42; @@ -201,11 +201,11 @@ void Lakitu_Lightning(Entity* this) { this->hitType = 0x42; if ((Random() & 1) && !this->field_0x78.HALF.HI) { - this->actionDelay = 0xf; + this->timer = 0xf; this->field_0x78.HALF.HI = TRUE; } else { - this->actionDelay = 0x1e; + this->timer = 0x1e; this->field_0x78.HALF.HI = FALSE; @@ -214,9 +214,9 @@ void Lakitu_Lightning(Entity* this) { } void Lakitu_LightningDelay(Entity* this) { - this->actionDelay--; + this->timer--; - if (this->actionDelay != 0) { + if (this->timer != 0) { return; } @@ -224,7 +224,7 @@ void Lakitu_LightningDelay(Entity* this) { sub_0803CB34(this); } else { this->action = IDLE; - this->actionDelay = 0xb4; + this->timer = 0xb4; InitAnimationForceUpdate(this, this->animationState + 4); } @@ -279,7 +279,7 @@ bool32 sub_0803CB04(Entity* this) { bool32 returnValue; u8 delay; - delay = --this->actionDelay; + delay = --this->timer; if (delay != 0) { returnValue = 0; } else { diff --git a/src/enemy/lakituCloud.c b/src/enemy/lakituCloud.c index 1c311f6c..98ee064d 100644 --- a/src/enemy/lakituCloud.c +++ b/src/enemy/lakituCloud.c @@ -45,7 +45,7 @@ void LakituCloud_OnGrabbed(Entity* this) { void sub_0803CD2C(Entity* this) { this->subAction = 1; - this->field_0x1d = 0x3c; + this->gustJarTolerance = 0x3c; } void sub_0803CD38(Entity* this) { @@ -104,9 +104,9 @@ void sub_0803CDD8(Entity* this) { one = 1; this->spriteSettings.draw = draw ^ one; - this->actionDelay--; + this->timer--; - if (this->actionDelay == 0) { + if (this->timer == 0) { this->action = 1; COLLISION_ON(this); @@ -134,11 +134,11 @@ void sub_0803CE3C(Entity* this) { CreateFx(this, FX_DEATH, 0); this->action = 2; - this->actionDelay = 60; + this->timer = 60; COLLISION_OFF(this); - this->field_0x3a &= 0xfb; + this->gustJarState &= 0xfb; this->x.HALF.HI = this->field_0x78.HWORD; this->y.HALF.HI = this->field_0x7a.HWORD; diff --git a/src/enemy/leever.c b/src/enemy/leever.c index 3e53a53a..fe7095da 100644 --- a/src/enemy/leever.c +++ b/src/enemy/leever.c @@ -42,7 +42,7 @@ void Leever_OnTick(Entity* this) { } void Leever_OnCollision(Entity* this) { - if (this->bitfield == 0x80) { + if (this->contactFlags == 0x80) { if (this->action == 3) { this->field_0x74.HWORD = 1; } @@ -65,11 +65,11 @@ void Leever_OnDeath(Entity* this) { void Leever_Initialize(Entity* this) { sub_0804A720(this); this->action = 1; - this->actionDelay = Random(); + this->timer = Random(); } void Leever_Idle(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { if (Leever_PlayerInRange(this, Random() & 0x1f)) { this->action = 2; this->spriteSettings.draw = TRUE; @@ -77,7 +77,7 @@ void Leever_Idle(Entity* this) { InitializeAnimation(this, LeeverAnimation_DigUp); UpdateSpriteForCollisionLayer(this); } else { - this->actionDelay = DirectionRound(Random()) + 8; + this->timer = DirectionRound(Random()) + 8; } } } @@ -115,7 +115,7 @@ void Leever_DigDown(Entity* this) { GetNextFrame(this); if (this->frame & ANIM_DONE) { this->action = 1; - this->actionDelay = 0xf0; + this->timer = 0xf0; this->spriteSettings.draw = FALSE; } } @@ -170,12 +170,12 @@ void Leever_Move(Entity* this) { this->speed = (this->frame & 0xf) * 0x20; if (this->type == LeeverForm_Red) { - if ((this->field_0xf++ & 0xf) == 0) { + if ((this->subtimer++ & 0xf) == 0) { sub_08004596(this, sub_0800132C(this, gUnk_020000B0)); } } else { this->speed += 0x40; - if ((this->field_0xf++ & 0x7) == 0) { + if ((this->subtimer++ & 0x7) == 0) { sub_08004596(this, sub_0800132C(this, gUnk_020000B0)); } } diff --git a/src/enemy/likeLike.c b/src/enemy/likeLike.c index da2f06c5..bca36368 100644 --- a/src/enemy/likeLike.c +++ b/src/enemy/likeLike.c @@ -39,12 +39,12 @@ void LikeLike_OnCollision(Entity* this) { } else { if (this->action == 7) { sub_0802810C(this); - } else if (this->bitfield & 0x80) { - u8 tmp = this->bitfield & ~0x80; + } else if (this->contactFlags & 0x80) { + u8 tmp = this->contactFlags & ~0x80; if (!tmp) { this->action = 7; - this->actionDelay = 0x5f; - this->field_0xf = tmp; + this->timer = 0x5f; + this->subtimer = tmp; this->flags2 &= 0xfc; this->field_0x82.HALF.HI = gPlayerEntity.spritePriority.b1; } @@ -52,7 +52,7 @@ void LikeLike_OnCollision(Entity* this) { } if (this->health == 0) { - this->actionDelay = 0x20; + this->timer = 0x20; } if (this->confusedTime) { @@ -63,7 +63,7 @@ void LikeLike_OnCollision(Entity* this) { } void LikeLike_OnDeath(Entity* this) { - if (this->actionDelay == 2 && this->field_0x80.HALF.LO != 0xff) { + if (this->timer == 2 && this->field_0x80.HALF.LO != 0xff) { SetDefaultPriority(this, PRIO_NO_BLOCK); sub_08028224(this->field_0x80.HALF.LO); } @@ -82,18 +82,18 @@ void sub_08027E70(Entity* this) { this->action = 3; this->spriteSettings.draw = 0; COLLISION_OFF(this); - this->actionDelay = 0; + this->timer = 0; break; case 1: this->action = 1; this->spriteSettings.draw = 1; - this->actionDelay = 8; + this->timer = 8; InitializeAnimation(this, 1); break; case 2: this->action = 1; this->spriteSettings.draw = 0; - this->actionDelay = 0; + this->timer = 0; this->hitType = 1; InitializeAnimation(this, 0); break; @@ -117,10 +117,10 @@ void sub_08027EFC(Entity* this) { this->direction = this->field_0x82.HALF.LO; } - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->direction = sub_08049F84(this, 1); this->field_0x82.HALF.LO = this->direction; - this->actionDelay = 8; + this->timer = 8; } ProcessMovement0(this); GetNextFrame(this); @@ -145,9 +145,9 @@ void sub_08027F84(Entity* this) { } void sub_08027FB4(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 1; - this->actionDelay = 1; + this->timer = 1; this->flags2 |= 1; } GetNextFrame(this); @@ -159,7 +159,7 @@ void sub_08027FE0(Entity* this) { this->action = 1; COLLISION_ON(this); this->direction = sub_08049F84(this, 1); - this->actionDelay = 8; + this->timer = 8; this->spritePriority.b1 = 1; InitializeAnimation(this, 1); } @@ -171,7 +171,7 @@ void sub_0802802C(Entity* this) { this->action = 3; this->spriteSettings.draw = 0; this->direction = 0; - this->actionDelay = 0; + this->timer = 0; CreateDust(this); } } @@ -183,12 +183,12 @@ void sub_0802805C(Entity* this) { if (sub_0807953C()) { u32 tmp2 = Random(); - u32 tmp3 = this->field_0xf + 1; + u32 tmp3 = this->subtimer + 1; tmp3 += (tmp2 & 1); - this->field_0xf = tmp3; + this->subtimer = tmp3; } - if (this->field_0xf >= 0x19 || gSave.stats.health == 0) { + if (this->subtimer >= 0x19 || gSave.stats.health == 0) { sub_0802810C(this); } else { ResetPlayerItem(); @@ -200,11 +200,11 @@ void sub_0802805C(Entity* this) { gPlayerEntity.spriteOffsetY = tmp[1]; gPlayerEntity.spritePriority.b1 = 0; - if (--this->actionDelay == 0) { + if (--this->timer == 0) { sub_080281A0(this); } - if ((this->actionDelay & 3) == 0) { + if ((this->timer & 3) == 0) { EnqueueSFX(SFX_PLACE_OBJ); } } @@ -222,8 +222,8 @@ NONMATCH("asm/non_matching/likeLike/sub_0802810C.inc", void sub_0802810C(Entity* gPlayerEntity.z.HALF.HI = gPlayerEntity.spriteOffsetY; gPlayerEntity.spriteOffsetY = 0; this->action = 4; - this->actionDelay = 0x50; - this->field_0xf = 0; + this->timer = 0x50; + this->subtimer = 0; this->flags2 |= 2; if (this->iframes == 0) { this->iframes = -18; @@ -232,7 +232,7 @@ NONMATCH("asm/non_matching/likeLike/sub_0802810C.inc", void sub_0802810C(Entity* END_NONMATCH void sub_080281A0(Entity* this) { - this->field_0xf = 0x19; + this->subtimer = 0x19; if (sub_080281E0(ITEM_MIRROR_SHIELD)) { this->field_0x80.HALF.LO = ITEM_MIRROR_SHIELD; MessageFromTarget(0x578); diff --git a/src/enemy/madderpillar.c b/src/enemy/madderpillar.c index 52098e08..65da7b2a 100644 --- a/src/enemy/madderpillar.c +++ b/src/enemy/madderpillar.c @@ -43,7 +43,7 @@ void Madderpillar_OnTick(Entity* this) { void Madderpillar_OnCollision(Entity* this) { if (this->action == 1) { - switch (this->bitfield & 0x7f) { + switch (this->contactFlags & 0x7f) { case 0: case 1: case 2: @@ -55,7 +55,7 @@ void Madderpillar_OnCollision(Entity* this) { break; default: this->action = 2; - this->actionDelay = 0; + this->timer = 0; this->hitType = 0x6b; this->field_0x76.HALF.HI = 0; ChangeObjPalette(this, 0x7f); @@ -69,8 +69,8 @@ void Madderpillar_OnCollision(Entity* this) { } void Madderpillar_OnDeath(Entity* this) { - if (this->field_0xf) { - this->field_0xf--; + if (this->subtimer) { + this->subtimer--; } else { GenericDeath(this); } @@ -164,13 +164,13 @@ void sub_08029AE0(Entity* this) { void sub_08029B2C(Entity* this) { if (sub_0802A14C(this)) { if (this->field_0x86.HALF.LO) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { CreateFx(this, FX_GIANT_EXPLOSION3, 0); DeleteEntity(this); } } else { COLLISION_OFF(this); - this->actionDelay = -(this->type * 15 - 90); + this->timer = -(this->type * 15 - 90); this->field_0x86.HALF.LO = 1; } } else { @@ -210,13 +210,13 @@ void sub_08029BC4(Entity* this) { void sub_08029C08(Entity* this) { this->action = 3; - this->actionDelay = gUnk_080CCDA0[this->type]; + this->timer = gUnk_080CCDA0[this->type]; this->hitType = 0x6b; this->child->action = 2; } void sub_08029C2C(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 4; ChangeObjPalette(this, 0x7f); EnqueueSFX(SFX_MENU_CANCEL); @@ -265,12 +265,12 @@ void sub_08029CF0(Entity* this) { void sub_08029D08(Entity* this) { this->action = 3; - this->actionDelay = 0x47; + this->timer = 0x47; } void sub_08029D14(Entity* this) { - if (this->actionDelay) { - if (--this->actionDelay == 0) { + if (this->timer) { + if (--this->timer == 0) { InitializeAnimation(this, this->animationState + 0xc); ChangeObjPalette(this, 0x7f); EnqueueSFX(SFX_MENU_CANCEL); @@ -279,7 +279,7 @@ void sub_08029D14(Entity* this) { GetNextFrame(this); if (this->frame & ANIM_DONE) { this->action = 4; - this->actionDelay = 0x78; + this->timer = 0x78; this->hitType = 0x6c; this->hitbox = (Hitbox*)&gUnk_080FD298; EnqueueSFX(SFX_6B); @@ -289,7 +289,7 @@ void sub_08029D14(Entity* this) { void sub_08029D78(Entity* this) { sub_0802A0F8(this); - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 5; this->hitType = 0x6a; this->hitbox = (Hitbox*)&gUnk_080FD2A0; @@ -460,7 +460,7 @@ void sub_0802A098(Entity* this) { void sub_0802A0F8(Entity* this) { if (this->health != 0) { - if ((this->bitfield & 0x80) && this->iframes != 0) { + if ((this->contactFlags & 0x80) && this->iframes != 0) { Entity* ent = this; u32 i; for (i = 0; i < 6; i++) { @@ -471,7 +471,7 @@ void sub_0802A0F8(Entity* this) { } else { this->parent->flags &= ~ENT_COLLIDE; this->parent->health = 0; - this->parent->field_0xf = 0x69; + this->parent->subtimer = 0x69; } } @@ -491,8 +491,8 @@ void sub_0802A16C(Entity* this) { } void sub_0802A18C(Entity* this) { - if (this->bitfield & 0x80) { - switch (this->bitfield & 0x7f) { + if (this->contactFlags & 0x80) { + switch (this->contactFlags & 0x7f) { case 0: case 1: case 2: diff --git a/src/enemy/mazaalBracelet.c b/src/enemy/mazaalBracelet.c index a6a273a1..1f6ff296 100644 --- a/src/enemy/mazaalBracelet.c +++ b/src/enemy/mazaalBracelet.c @@ -138,7 +138,7 @@ void MazaalBracelet_OnCollision(Entity* this) { if (this->type < 2) { if (this->action != 0x2b) { - if ((0 < this->iframes) && ((this->bitfield == 0x95 || (this->bitfield == 0x8e)))) { + if ((0 < this->iframes) && ((this->contactFlags == 0x95 || (this->contactFlags == 0x8e)))) { this->action = 0x28; COLLISION_OFF(this); ent = this->parent; @@ -219,7 +219,7 @@ void sub_0803A364(Entity* this) { s8* ptr; ptr = gUnk_080CED6C; - index = ((this->parent->field_0xf >> 4) + 3); + index = ((this->parent->subtimer >> 4) + 3); this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; switch (this->subAction & 0x7f) { case 0: @@ -250,11 +250,11 @@ void sub_0803A364(Entity* this) { this->type2 = 0; uVar1 = 6; this->subAction = uVar1; - this->actionDelay = 0x1e; + this->timer = 0x1e; break; case 6: - this->actionDelay--; - if (this->actionDelay == 0) { + this->timer--; + if (this->timer == 0) { this->subAction = 7; InitializeAnimation(this, 5); } @@ -275,11 +275,11 @@ void sub_0803A364(Entity* this) { } uVar1 = 9; this->subAction = uVar1; - this->actionDelay = 0x1e; + this->timer = 0x1e; break; case 9: - this->actionDelay--; - if (this->actionDelay == 0) { + this->timer--; + if (this->timer == 0) { this->subAction = 10; InitAnimationForceUpdate(this->child, 6); } @@ -300,16 +300,16 @@ void sub_0803A364(Entity* this) { if (this->type2 != 0) { uVar1 = 0xc; this->subAction = uVar1; - this->actionDelay = 0x1e; + this->timer = 0x1e; } else { this->type2 = 1; this->subAction = 6; - this->actionDelay = 10; + this->timer = 10; } break; default: - this->actionDelay--; - if (this->actionDelay == 0) { + this->timer--; + if (this->timer == 0) { COLLISION_ON(this); sub_0803B4D4(this); } @@ -324,7 +324,7 @@ void sub_0803A548(Entity* this) { sub_0803B5C0(this); UpdateAnimationSingleFrame(this); ptr = gUnk_080CED6C; - index = ((this->parent->field_0xf >> 4) + 3); + index = ((this->parent->subtimer >> 4) + 3); this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; if (sub_0803B4E4(this) == 0) { LinearMoveUpdate(this); @@ -336,7 +336,7 @@ void sub_0803A58C(Entity* this) { s8* ptr; ptr = gUnk_080CED6C; - index = ((this->parent->field_0xf >> 4) + 3); + index = ((this->parent->subtimer >> 4) + 3); this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; if (sub_0803B4E4(this) != 0) { sub_0803B59C(this); @@ -352,7 +352,7 @@ void sub_0803A5D0(Entity* this) { this->action = 5; COLLISION_OFF(this); ptr = gUnk_080CED6C; - index = ((this->parent->field_0xf >> 4) + 3); + index = ((this->parent->subtimer >> 4) + 3); this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; InitializeAnimation(this, 5); } @@ -362,7 +362,7 @@ void sub_0803A60C(Entity* this) { s8* ptr; ptr = gUnk_080CED6C; - index = ((this->parent->field_0xf >> 4) + 3); + index = ((this->parent->subtimer >> 4) + 3); this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; GetNextFrame(this); if ((this->frame & ANIM_DONE) != 0) { @@ -385,7 +385,7 @@ void sub_0803A660(Entity* this) { this->z.HALF.HI = this->z.HALF.HI - 2; } else { this->action = 7; - this->actionDelay = 0; + this->timer = 0; uVar2 = GetFacingDirection(this, &gPlayerEntity); this->direction = (u8)uVar2; this->speed = 0x280; @@ -397,7 +397,7 @@ void sub_0803A660(Entity* this) { SoundReq(SFX_157); } ptr = gUnk_080CED6C; - index = ((this->parent->field_0xf >> 4) + 3); + index = ((this->parent->subtimer >> 4) + 3); this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; } } @@ -407,7 +407,7 @@ void sub_0803A6E8(Entity* this) { if (sub_0803B610(this)) { this->action = 8; - this->actionDelay = 10; + this->timer = 10; } else { sub_0803B63C(this); LinearMoveUpdate(this); @@ -419,7 +419,7 @@ void sub_0803A6E8(Entity* this) { } void sub_0803A720(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 9; sub_0803B8E8(this, 0x16); } @@ -433,7 +433,7 @@ void sub_0803A740(Entity* this) { if (-1 < height * 0x10000) { this->z.HALF.HI = 0; this->action = 10; - this->actionDelay = 10; + this->timer = 10; this->parent->field_0x7c.BYTES.byte1 |= 0x40; sub_0803B8E8(this, 0x13); InitScreenShake(10, 0); @@ -442,7 +442,7 @@ void sub_0803A740(Entity* this) { } void sub_0803A780(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { if (--this->field_0x7c.BYTES.byte0) { this->action = 6; } else { @@ -464,7 +464,7 @@ void sub_0803A7CC(Entity* this) { u32 index; ptr = gUnk_080CED6C; - index = ((this->parent->field_0xf >> 4) + 3); + index = ((this->parent->subtimer >> 4) + 3); this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; if (sub_0803B4E4(this)) { this->action = 0xd; @@ -479,7 +479,7 @@ void sub_0803A814(Entity* this) { u32 index; ptr = gUnk_080CED6C; - index = ((this->parent->field_0xf >> 4) + 3); + index = ((this->parent->subtimer >> 4) + 3); this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; sub_0803B55C(this); if ((this->child->frame & ANIM_DONE) != 0) { @@ -494,7 +494,7 @@ void sub_0803A86C(Entity* this) { u32 index; ptr = gUnk_080CED6C; - index = ((this->parent->field_0xf >> 4) + 3); + index = ((this->parent->subtimer >> 4) + 3); this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; GetNextFrame(this); if ((this->frame & ANIM_DONE) != 0) { @@ -508,12 +508,12 @@ void sub_0803A8B8(Entity* this) { u32 index; this->action = 0x10; - this->actionDelay = 0x1e; + this->timer = 0x1e; this->direction = 0; this->speed = 0x80; ptr = gUnk_080CED6C; - index = ((this->parent->field_0xf >> 4) + 3); + index = ((this->parent->subtimer >> 4) + 3); this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; InitializeAnimation(this, 6); InitAnimationForceUpdate(this->child, 1); @@ -525,13 +525,13 @@ void sub_0803A90C(Entity* this) { u32 index; ptr = gUnk_080CED6C; - index = ((this->parent->field_0xf >> 4) + 3); + index = ((this->parent->subtimer >> 4) + 3); this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; GetNextFrame(this); sub_0803B55C(this); LinearMoveUpdate(this); - this->actionDelay--; - if (this->actionDelay == 0) { + this->timer--; + if (this->timer == 0) { this->action = 0x11; this->direction = this->type * 0x10 + 8; this->speed = 0x200; @@ -545,17 +545,17 @@ void sub_0803A978(Entity* this) { u32 index; ptr = gUnk_080CED6C; - index = ((this->parent->field_0xf >> 4) + 3); + index = ((this->parent->subtimer >> 4) + 3); this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; GetNextFrame(this); sub_0803B55C(this); - if ((++this->actionDelay & 3) == 0) { + if ((++this->timer & 3) == 0) { sub_08004596(this, 0x10); } LinearMoveUpdate(this); if (this->direction == 0x10) { this->action = 0x12; - this->actionDelay = 3; + this->timer = 3; COLLISION_OFF(this); *(u8*)(*(int*)&this->field_0x74 + 0x10) &= 0x7f; InitializeAnimation(this, 8); @@ -569,11 +569,11 @@ void sub_0803AA00(Entity* this) { u32 index; ptr = gUnk_080CED6C; - index = ((this->parent->field_0xf >> 4) + 3); + index = ((this->parent->subtimer >> 4) + 3); 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) { + if ((++this->timer & 3) == 0) { sub_08004596(this, direction); } LinearMoveUpdate(this); @@ -592,7 +592,7 @@ void sub_0803AA98(Entity* this) { u32 index; ptr = gUnk_080CED6C; - index = ((this->parent->field_0xf >> 4) + 3); + index = ((this->parent->subtimer >> 4) + 3); this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; if (sub_0803B870(this) == 0) { LinearMoveUpdate(this); @@ -615,13 +615,13 @@ void sub_0803AB10(Entity* this) { u32 index; ptr = gUnk_080CED6C; - index = ((this->parent->field_0xf >> 4) + 3); + index = ((this->parent->subtimer >> 4) + 3); this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; LinearMoveUpdate(this); sub_0803B55C(this); if ((this->child->frame & ANIM_DONE) != 0) { this->action = 0x15; - this->actionDelay = 0xf; + this->timer = 0xf; } } @@ -630,9 +630,9 @@ void sub_0803AB5C(Entity* this) { u32 index; ptr = gUnk_080CED6C; - index = ((this->parent->field_0xf >> 4) + 3); + index = ((this->parent->subtimer >> 4) + 3); this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 0x16; this->spriteSettings.draw = 1; InitializeAnimation(this, 0xb); @@ -645,7 +645,7 @@ void sub_0803ABB4(Entity* this) { u32 index; ptr = gUnk_080CED6C; - index = ((this->parent->field_0xf >> 4) + 3); + index = ((this->parent->subtimer >> 4) + 3); this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; GetNextFrame(this); sub_0803B55C(this); @@ -663,7 +663,7 @@ void sub_0803AC1C(Entity* this) { u32 index; ptr = gUnk_080CED6C; - index = ((this->parent->field_0xf >> 4) + 3); + index = ((this->parent->subtimer >> 4) + 3); this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; if (sub_0803B4E4(this)) { sub_0803B59C(this); @@ -677,19 +677,19 @@ void sub_0803AC60(Entity* this) { u32 index; ptr = gUnk_080CED6C; - index = ((this->parent->field_0xf >> 4) + 3); + index = ((this->parent->subtimer >> 4) + 3); this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; GetNextFrame(this); - if (!this->actionDelay) { + if (!this->timer) { if (sub_0803B4E4(this) != 0) { this->action = 0x19; this->subAction = 0; - this->actionDelay = 0x1e; + this->timer = 0x1e; } else { LinearMoveUpdate(this); } } else { - this->actionDelay = this->actionDelay - 1; + this->timer = this->timer - 1; } sub_0803B824(this); } @@ -699,7 +699,7 @@ void sub_0803ACC0(Entity* this) { switch (this->subAction) { default: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->subAction = 1; } break; @@ -712,7 +712,7 @@ void sub_0803ACC0(Entity* this) { uVar2 = this->z.HALF.HI += 4; if (-1 < (uVar2 * 0x10000)) { this->z.HALF.HI = 0; - this->actionDelay = 0xc; + this->timer = 0xc; this->subAction = 3; InitScreenShake(8, 0); SoundReq(SFX_158); @@ -720,7 +720,7 @@ void sub_0803ACC0(Entity* this) { } break; case 3: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->subAction = 4; } break; @@ -735,7 +735,7 @@ void sub_0803ACC0(Entity* this) { if (-1 < (uVar2 * 0x10000)) { this->z.HALF.HI = 0; this->action = 0x1a; - this->actionDelay = 0x3c; + this->timer = 0x3c; InitScreenShake(0x1e, 0); SoundReq(SFX_158); sub_0803B804(this); @@ -747,7 +747,7 @@ void sub_0803ACC0(Entity* this) { } void sub_0803ADAC(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 0x16; this->spriteSettings.draw = 1; (*(Entity**)&this->field_0x74)->flags |= ENT_COLLIDE; @@ -764,13 +764,13 @@ void sub_0803ADF4(Entity* this) { u32 index; ptr = gUnk_080CED6C; - index = ((this->parent->field_0xf >> 4) + 3); + index = ((this->parent->subtimer >> 4) + 3); this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; UpdateAnimationSingleFrame(this); GetNextFrame(this); if ((this->frame & ANIM_DONE) != 0) { this->action = 0x1c; - this->actionDelay = 0x1e; + this->timer = 0x1e; this->spriteSettings.draw = 0; } } @@ -780,10 +780,10 @@ void sub_0803AE48(Entity* this) { u32 index; ptr = gUnk_080CED6C; - index = ((this->parent->field_0xf >> 4) + 3); + index = ((this->parent->subtimer >> 4) + 3); 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)) { + if (((this->timer == 0) || (--this->timer == 0)) && ((this->parent->field_0x7c.BYTES.byte1 & 3) != 0)) { this->action = 0x1d; this->spriteSettings.draw = 1; InitializeAnimation(this, 4); @@ -799,7 +799,7 @@ void sub_0803AEC4(Entity* this) { u32 index; ptr = gUnk_080CED6C; - index = ((this->parent->field_0xf >> 4) + 3); + index = ((this->parent->subtimer >> 4) + 3); this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; UpdateAnimationSingleFrame(this); GetNextFrame(this); @@ -813,7 +813,7 @@ void sub_0803AF18(Entity* this) { this->action = 0x1f; COLLISION_OFF(this); InitializeAnimation(this, 5); - this->z.HALF.HI = gUnk_080CED6C[(this->parent->field_0xf >> 4) & 7] + 4; + this->z.HALF.HI = gUnk_080CED6C[(this->parent->subtimer >> 4) & 7] + 4; } void sub_0803AF50(Entity* this) { @@ -829,25 +829,25 @@ void sub_0803AF7C(Entity* this) { sub_0803B55C(this); if ((this->child->frame & ANIM_DONE) != 0) { this->action = 0x21; - this->actionDelay = 0xf; + this->timer = 0xf; } } void sub_0803AF9C(Entity* this) { - if (this->actionDelay != 0) { - this->actionDelay--; + if (this->timer != 0) { + this->timer--; } else { if (-0x20 < this->z.HALF.HI) { this->z.HALF.HI -= 2; } else { this->action = 0x22; - this->actionDelay = 10; + this->timer = 10; } } } void sub_0803AFC8(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 0x23; } } @@ -857,7 +857,7 @@ void sub_0803AFE0(Entity* this) { this->z.HALF.HI += 4; } else { this->action = 0x24; - this->actionDelay = 0xf0; + this->timer = 0xf0; *(u8*)&this->cutsceneBeh = 3; this->z.HALF.HI = 0; InitScreenShake(0xa0, 0); @@ -866,10 +866,10 @@ void sub_0803AFE0(Entity* this) { } void sub_0803B01C(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 0x25; } else { - if ((0x46 < this->actionDelay) && ((this->actionDelay & 0xf) == 0)) { + if ((0x46 < this->timer) && ((this->timer & 0xf) == 0)) { sub_0803B724(this); } } @@ -889,7 +889,7 @@ void sub_0803B074(Entity* this) { u32 index; ptr = gUnk_080CED6C; - index = ((this->parent->field_0xf >> 4) + 3); + index = ((this->parent->subtimer >> 4) + 3); this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; sub_0803B55C(this); if ((this->child->frame & ANIM_DONE) != 0) { @@ -968,7 +968,7 @@ void sub_0803B1B8(Entity* this) { } temp = CreateObject(GROUND_ITEM, 0x5e, 0); if (temp != (Entity*)0x0) { - temp->actionDelay = 0; + temp->timer = 0; temp->direction = 0x90; PositionRelative(this, temp, Q_16_16(this->hitbox->offset_x), Q_16_16(this->hitbox->offset_y)); } @@ -978,7 +978,7 @@ void sub_0803B1B8(Entity* this) { temp->field_0x80.HALF.LO |= (this->type == 0) ? 4 : 8; if ((temp->field_0x80.HALF.LO & 0xc) == 0xc) { temp->action = 0xb; - temp->actionDelay = 0x78; + temp->timer = 0x78; temp->zVelocity = 0; (*(Entity**)&temp->field_0x74)->field_0x7c.HALF_U.HI = 0x708; (*(Entity**)&temp->field_0x78)->field_0x7c.HALF_U.HI = 0x708; @@ -1021,7 +1021,7 @@ void sub_0803B338(Entity* this) { this->z.HALF.HI--; } else { this->action = 0x2f; - this->actionDelay = 0xf; + this->timer = 0xf; } } @@ -1030,9 +1030,9 @@ void sub_0803B35C(Entity* this) { u32 index; ptr = gUnk_080CED6C; - index = ((this->parent->field_0xf >> 4) + 3); + index = ((this->parent->subtimer >> 4) + 3); this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 0x30; } } @@ -1042,7 +1042,7 @@ void sub_0803B398(Entity* this) { u32 index; ptr = gUnk_080CED6C; - index = ((this->parent->field_0xf >> 4) + 3); + index = ((this->parent->subtimer >> 4) + 3); this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; if (sub_0803B4E4(this) != 0) { this->action = 0x31; @@ -1061,7 +1061,7 @@ void sub_0803B3F4(Entity* this) { Entity* temp; ptr = gUnk_080CED6C; - index = ((this->parent->field_0xf >> 4) + 3); + index = ((this->parent->subtimer >> 4) + 3); this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; GetNextFrame(this); if ((this->frame & ANIM_DONE) != 0) { @@ -1172,7 +1172,7 @@ void sub_0803B63C(Entity* this) { x = gPlayerEntity.x.HALF.HI; x += gUnk_080CFD19[this->type]; y = gPlayerEntity.y.HALF.HI - 0xc; - if (this->actionDelay++ >= 0xb5) { + if (this->timer++ >= 0xb5) { this->direction = CalculateDirectionTo(this->x.HALF.HI, this->y.HALF.HI, x, y); } else { sub_08004596(this, CalculateDirectionTo(this->x.HALF.HI, this->y.HALF.HI, x, y)); @@ -1208,7 +1208,7 @@ void sub_0803B724(Entity* param_1) { u32 random_value; u8 temp; - if (((param_1->field_0xf < 3) && (param_1->cutsceneBeh.HALF.LO != 0)) && + if (((param_1->subtimer < 3) && (param_1->cutsceneBeh.HALF.LO != 0)) && (pEVar1 = CreateEnemy(BEETLE, 1), pEVar1 != (Entity*)0x0)) { pEVar1->type2 = 1; random_value = Random(); @@ -1217,7 +1217,7 @@ void sub_0803B724(Entity* param_1) { pEVar1->y.HALF.HI = ((random_value >> 0x10) & 7) * 10 + 0x5c + gRoomControls.origin_y; pEVar1->parent = param_1; ResolveCollisionLayer(pEVar1); - param_1->field_0xf++; + param_1->subtimer++; param_1->cutsceneBeh.HALF.LO--; } } @@ -1255,9 +1255,9 @@ u32 sub_0803B870(Entity* this) { Entity* entity; entity = this->child; - if ((entity->bitfield & 0x80) != 0 && (gPlayerState.flags & PL_CAPTURED)) { + if ((entity->contactFlags & 0x80) != 0 && (gPlayerState.flags & PL_CAPTURED)) { this->action = 0x18; - this->actionDelay = 0x44; + this->timer = 0x44; this->spriteSettings.draw = 0; gPlayerEntity.flags &= ~ENT_COLLIDE; gPlayerEntity.iframes = -0x10; @@ -1305,24 +1305,24 @@ void sub_0803B978(Entity* this) { return; case 1: this->subAction = 2; - this->actionDelay = 2; - this->field_0xf = 0x1e; + this->timer = 2; + this->subtimer = 0x1e; this->field_0x74.HALF.LO = 0; SoundReq(SFX_1A9); case 2: - sub_0803BA8C(this, this->field_0xf); + sub_0803BA8C(this, this->subtimer); if ((this->field_0x74.HALF.HI | this->field_0x74.HALF.LO) == 0) { SoundReq(SFX_1A9); } if (this->field_0x74.HALF.LO != 0) { return; } - if (--this->actionDelay != 0) { + if (--this->timer != 0) { return; } - this->actionDelay = 2; - this->field_0xf -= 4; - if (this->field_0xf != 10) { + this->timer = 2; + this->subtimer -= 4; + if (this->subtimer != 10) { return; } this->parent->parent->subAction = 3; diff --git a/src/enemy/mazaalHead.c b/src/enemy/mazaalHead.c index feee0839..8b8432b3 100644 --- a/src/enemy/mazaalHead.c +++ b/src/enemy/mazaalHead.c @@ -143,7 +143,7 @@ void sub_08033F3C(Entity* this) { if (gRoomTransition.field_0x39 == 0) { this->action = 0xd; this->subAction = 0; - this->actionDelay = 0xfc; + this->timer = 0xfc; COLLISION_OFF(this); } else { pEVar2 = CreateEnemy(MAZAAL_BRACELET, 0); @@ -170,7 +170,7 @@ void sub_08033FFC(Entity* this) { break; case 1: this->subAction = 2; - this->actionDelay = 0x1e; + this->timer = 0x1e; entity = *(Entity**)&(*(Entity**)&this->field_0x74)->field_0x74; entity->subAction = 1; entity = *(Entity**)&(*(Entity**)&this->field_0x78)->field_0x74; @@ -178,7 +178,7 @@ void sub_08033FFC(Entity* this) { UnloadOBJPalette(this); break; case 3: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->subAction = 4; } break; @@ -191,7 +191,7 @@ void sub_08033FFC(Entity* this) { break; case 6: this->subAction = 7; - this->actionDelay = 0; + this->timer = 0; entity = *(Entity**)&this->field_0x74; entity->subAction = 1; entity = *(Entity**)&entity->field_0x74; @@ -204,9 +204,9 @@ void sub_08033FFC(Entity* this) { gScreen.controls.alphaBlend = 0x1000; break; case 7: - temp = ++this->actionDelay >> 1; + temp = ++this->timer >> 1; gScreen.controls.alphaBlend = (temp) | (0x10 - (temp)) * 0x100; - if (0x1f < (this->actionDelay & 0xff)) { + if (0x1f < (this->timer & 0xff)) { this->subAction = 8; entity = *(Entity**)&this->field_0x74; entity->subAction = 3; @@ -259,7 +259,7 @@ void sub_080341B8(Entity* this) { } void sub_080341D0(Entity* this) { - if (((this->field_0x80.HALF.LO & 3) != 3) && (--this->actionDelay == 0)) { + if (((this->field_0x80.HALF.LO & 3) != 3) && (--this->timer == 0)) { sub_0803443C(this); } } @@ -313,11 +313,11 @@ void sub_080342B4(Entity* this) { } void sub_080342C8(Entity* this) { - if (this->actionDelay != 0) { - if (--this->actionDelay == 0) { + if (this->timer != 0) { + if (--this->timer == 0) { SoundReq(SFX_115); } - this->spriteOffsetX = gUnk_080CECEC[this->actionDelay >> 1 & 7]; + this->spriteOffsetX = gUnk_080CECEC[this->timer >> 1 & 7]; } else { this->spriteOffsetX = 0; if (GravityUpdate(this, 0x2000) == 0) { @@ -350,17 +350,17 @@ void sub_0803438C(Entity* this) { Entity* pEVar3; const s8* pVar; - if (this->actionDelay == 0) { + if (this->timer == 0) { this->health = 0; } else { - this->actionDelay--; - if (this->actionDelay > 0xc0) { - this->spriteOffsetX = gUnk_080CED06[this->actionDelay & 3]; + this->timer--; + if (this->timer > 0xc0) { + this->spriteOffsetX = gUnk_080CED06[this->timer & 3]; } else { - if ((this->actionDelay & 0x1f) == 0) { + if ((this->timer & 0x1f) == 0) { pEVar3 = CreateFx(this, gUnk_080CED02[Random() & 3], 0); if (pEVar3 != NULL) { - pVar = &gUnk_080CECF4[this->actionDelay >> 4]; + pVar = &gUnk_080CECF4[this->timer >> 4]; pEVar3->x.HALF.HI = *pVar + pEVar3->x.HALF.HI; pVar++; pEVar3->y.HALF.HI = *pVar + pEVar3->y.HALF.HI; @@ -378,7 +378,7 @@ void sub_08034420(Entity* this) { void sub_0803442C(Entity* this, u32 unk) { this->action = 4; - this->actionDelay = unk; + this->timer = unk; this->field_0x7c.BYTES.byte1 = 3; } @@ -678,7 +678,7 @@ u32 sub_080348A4(Entity* this, Entity* hand_, u32 unk) { void sub_0803499C(Entity* this) { if (((this->field_0x80.HALF.LO & 0xc) != 0xc) && (this->field_0x80.HALF.HI != 0)) { - this->z.HALF.HI = gUnk_080CED6C[(++this->field_0xf >> 4) & 7]; + this->z.HALF.HI = gUnk_080CED6C[(++this->subtimer >> 4) & 7]; } } @@ -747,21 +747,21 @@ void sub_08034AC4(Entity* this) { void sub_08034AEC(Entity* this) { this->action = 1; - this->actionDelay = 0x1e; + this->timer = 0x1e; InitializeAnimation(this, this->type + 1); SoundReq(SFX_151); } void sub_08034B0C(Entity* this) { - if (this->actionDelay != 0) { - this->actionDelay--; + if (this->timer != 0) { + this->timer--; } else { GetNextFrame(this); if ((this->frame & ANIM_DONE) == 0) { return; } this->action = 2; - this->actionDelay = 0x50; + this->timer = 0x50; } } @@ -769,7 +769,7 @@ void sub_08034B38(Entity* this) { Entity* target; const s8* ptr; - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 3; InitializeAnimation(this, this->type + 3); } else { @@ -777,9 +777,9 @@ void sub_08034B38(Entity* this) { if (target != NULL) { target->type = this->type - 2; if (target->type == 0) { - target->direction = 0xa8 - this->actionDelay; + target->direction = 0xa8 - this->timer; } else { - target->direction = this->actionDelay + 0x58; + target->direction = this->timer + 0x58; } ptr = &gUnk_080CED84[target->type * 2]; PositionRelative(this, target, Q_16_16(*(ptr++)), Q_16_16(*ptr)); diff --git a/src/enemy/mazaalMacro.c b/src/enemy/mazaalMacro.c index 24cca8a9..4dbf53d6 100644 --- a/src/enemy/mazaalMacro.c +++ b/src/enemy/mazaalMacro.c @@ -79,7 +79,7 @@ void sub_08034CC4(Entity* this) { if (sub_08035084(this) != 0) { this->action = this->type + 1; - this->field_0xf = 0; + this->subtimer = 0; this->field_0x6c.HALF.HI |= 1; this->field_0x78.HWORD = 0x4b0; sub_08034F70(this); @@ -99,7 +99,7 @@ void sub_08034D4C(Entity* this) { GetNextFrame(this); if (--this->field_0x78.HWORD == 0) { - if ((this->field_0xf < 8) && (entity = CreateEnemy(VAATI_PROJECTILE, 0), entity != (Entity*)0x0)) { + if ((this->subtimer < 8) && (entity = CreateEnemy(VAATI_PROJECTILE, 0), entity != (Entity*)0x0)) { entity->direction = (s32)Random() % 5 + 0xc; entity->x.HALF.HI = (gRoomControls.width / 2) + gRoomControls.origin_x; entity->y.HALF.HI = gRoomControls.origin_y + 8; @@ -107,7 +107,7 @@ void sub_08034D4C(Entity* this) { entity->parent = this; UpdateSpriteForCollisionLayer(entity); this->field_0x78.HWORD = 600; - this->field_0xf = this->field_0xf + 1; + this->subtimer = this->subtimer + 1; } else { this->field_0x78.HWORD = 0x78; } @@ -170,7 +170,7 @@ void sub_08034EE4(Entity* this) { u32 randomValue; Entity* entity; - if ((++this->actionDelay & 0xf) == 0) { + if ((++this->timer & 0xf) == 0) { randomValue = Random(); entity = CreateFx(this, gUnk_080CEEC8[randomValue & 3], 0); if (entity != NULL) { diff --git a/src/enemy/miniFireballGuy.c b/src/enemy/miniFireballGuy.c index 0f847151..5bc32f2b 100644 --- a/src/enemy/miniFireballGuy.c +++ b/src/enemy/miniFireballGuy.c @@ -41,7 +41,7 @@ void sub_08045618(Entity* this) { this->action = 1; this->spriteSettings.draw = 1; this->speed = 0x80; - this->field_0x3c = this->field_0x3c | 0x10; + this->collisionFlags = this->collisionFlags | 0x10; sub_0804A720(this); InitializeAnimation(this, 1); sub_08045678(this); @@ -58,10 +58,10 @@ void sub_08045654(Entity* this) { void sub_08045678(Entity* this) { this->zVelocity = Q_16_16(1.75); - if (this->actionDelay != 0) { - this->actionDelay--; + if (this->timer != 0) { + this->timer--; } else { - this->actionDelay = Random() & 3; + this->timer = Random() & 3; if ((sub_08049FA0(this) == 0) && (Random() & 3)) { this->direction = DirectionRound(sub_08049EE4(this) - 4 + (Random() & 8)); } else { diff --git a/src/enemy/miniSlime.c b/src/enemy/miniSlime.c index aba4510e..80e0666e 100644 --- a/src/enemy/miniSlime.c +++ b/src/enemy/miniSlime.c @@ -55,7 +55,7 @@ void sub_080452A4(Entity* this) { InitializeAnimation(this, 6); if (this->type2) { this->action = 2; - this->actionDelay = 1; + this->timer = 1; } else { sub_080452E4(this); } @@ -63,17 +63,17 @@ void sub_080452A4(Entity* this) { void sub_080452E4(Entity* this) { this->action = 2; - this->actionDelay = (Random() & 0x1f) + 1; + this->timer = (Random() & 0x1f) + 1; } void sub_080452FC(Entity* this) { u32 cVar2, bVar3; GetNextFrame(this); - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 3; - this->actionDelay = 1; + this->timer = 1; if (0 < this->speed) - this->actionDelay = FixedDiv(0x1000, this->speed) >> 0x8; + this->timer = FixedDiv(0x1000, this->speed) >> 0x8; if (sub_08049FA0(this) == 0 && (Random() & 3)) { cVar2 = sub_08049EE4(this); @@ -90,6 +90,6 @@ void sub_080452FC(Entity* this) { void sub_08045374(Entity* this) { ProcessMovement0(this); GetNextFrame(this); - if (--this->actionDelay == 0) + if (--this->timer == 0) this->action = 1; } diff --git a/src/enemy/moldorm.c b/src/enemy/moldorm.c index 2e7597ee..a38eec1e 100644 --- a/src/enemy/moldorm.c +++ b/src/enemy/moldorm.c @@ -40,7 +40,7 @@ void Moldorm_OnCollision(Entity* this) { this->field_0x7a.HALF.HI = 30; this->field_0x7a.HALF.LO = this->health; - this->actionDelay = 1; + this->timer = 1; this->direction = this->knockbackDirection; this->animationState = ((this->direction + 2) & 0x1c) >> 2; @@ -80,8 +80,8 @@ void sub_08022C58(Entity* this) { sub_0804A720(this); this->action = 1; - this->actionDelay = 1; - this->field_0xf = 1; + this->timer = 1; + this->subtimer = 1; COLLISION_ON(this); this->parent = this; this->child = tail0; @@ -157,7 +157,7 @@ void sub_08022F14(Entity* this) { if (sub_08049FA0(this) == 0) { u32 bVar6 = (sub_08049EE4(this) - this->direction) & 0x1f; if (8 < ((bVar6 + 4) & 0x1f)) { - this->field_0xf = 8; + this->subtimer = 8; if (bVar6 < 0x10) { this->field_0x78.HALF.LO = 1; } else { @@ -166,11 +166,11 @@ void sub_08022F14(Entity* this) { } } - if (--this->actionDelay == 0) { - this->actionDelay = 4; + if (--this->timer == 0) { + this->timer = 4; - if (--this->field_0xf == 0) { - this->field_0xf = 8; + if (--this->subtimer == 0) { + this->subtimer = 8; this->field_0x78.HALF.LO = gUnk_080CBBC4[Random() & 1]; } diff --git a/src/enemy/moldworm.c b/src/enemy/moldworm.c index 96a3ada3..8ae79c29 100644 --- a/src/enemy/moldworm.c +++ b/src/enemy/moldworm.c @@ -68,13 +68,13 @@ void Moldworm_OnTick(Entity* this) { void Moldworm_OnCollision(Entity* this) { if (this->subAction == 0xff) { this->action = 7; - this->actionDelay = 1; + this->timer = 1; this->subAction = 0; this->hitType = 0x85; this->iframes = -8; this->field_0x7c.BYTES.byte3 = 0; this->field_0x7a.HALF.HI = 0; - if (this->bitfield == 0x80 || this->bitfield == 0x9e) { + if (this->contactFlags == 0x80 || this->contactFlags == 0x9e) { this->type2 = 0; this->field_0x80.HALF.LO = 0x14; } else { @@ -137,7 +137,7 @@ void sub_080231BC(Entity* this) { ent->child = NULL; sub_0804A720(this); this->action = 6; - this->actionDelay = 0x1e; + this->timer = 0x1e; this->parent = this; this->field_0x78.HWORD = 0x1e; this->palette.b.b0 = 5; @@ -151,7 +151,7 @@ void nullsub_136(Entity* this) { } void sub_08023288(Entity* this) { - if (sub_08049FDC(this, 1) && (this->actionDelay++ & 0xf) == 0) { + if (sub_08049FDC(this, 1) && (this->timer++ & 0xf) == 0) { u32 idx = Random() & 0x1e; u32 i; @@ -172,7 +172,7 @@ void sub_08023330(Entity* this) { GetNextFrame(this); if (this->frame & ANIM_DONE) { this->action = 4; - this->actionDelay = 0x19; + this->timer = 0x19; COLLISION_ON(this); this->field_0x78.HWORD = 600; this->direction = Random() & 0x1c; @@ -201,7 +201,7 @@ void sub_08023398(Entity* this) { this->field_0x7c.BYTES.byte3 = 0; COLLISION_OFF(this); this->hitType = 0x85; - this->child->actionDelay = 1; + this->child->timer = 1; sub_08023A68(this); CreateFx(this, FX_ROCK, 0); return; @@ -213,9 +213,9 @@ void sub_08023398(Entity* this) { sub_08023AB0(this); } - if (--this->actionDelay < 3) { - if (this->actionDelay == 0) - this->actionDelay = 25; + if (--this->timer < 3) { + if (this->timer == 0) + this->timer = 25; } else { int prevX = this->x.WORD; int prevY = this->y.WORD; @@ -258,10 +258,10 @@ void sub_080234D8(Entity* this) { } void sub_0802351C(Entity* this) { - if ((this->actionDelay != 0) && ((this->type2 == 1) || (gPlayerEntity.frameIndex == 0xff))) { - this->actionDelay = 0; + if ((this->timer != 0) && ((this->type2 == 1) || (gPlayerEntity.frameIndex == 0xff))) { + this->timer = 0; this->child->action = 3; - this->child->field_0xf = this->field_0x80.HALF.LO; + this->child->subtimer = this->field_0x80.HALF.LO; InitializeAnimation(this->child, this->child->animationState + 1); InitializeAnimation(this, this->animationState); } @@ -301,7 +301,7 @@ void sub_080235D4(Entity* this) { void sub_08023604(Entity* this) { if (((u8*)&this->field_0x78)[this->parent->field_0x7c.BYTES.byte0 & 0xf] != 0x88) { this->action = 2; - this->actionDelay = 0; + this->timer = 0; COLLISION_ON(this); this->spriteSettings.draw = 1; sub_08023644(this); @@ -311,12 +311,12 @@ void sub_08023604(Entity* this) { void sub_08023644(Entity* this) { Entity* parent = this->parent; - if (parent->animIndex == 0x17 && this->actionDelay != 0 && this->x.HALF.HI == parent->x.HALF.HI && + if (parent->animIndex == 0x17 && this->timer != 0 && this->x.HALF.HI == parent->x.HALF.HI && this->y.HALF.HI == parent->y.HALF.HI) { this->action = 1; COLLISION_OFF(this); this->spriteSettings.draw = 0; - this->child->actionDelay = 1; + this->child->timer = 1; sub_080239F0(this); } @@ -331,10 +331,10 @@ void sub_08023644(Entity* this) { } void sub_080236F8(Entity* parent) { - if (--parent->field_0xf == 0) { + if (--parent->subtimer == 0) { parent->action = 2; parent->child->action = 3; - parent->child->field_0xf = parent->parent->field_0x80.HALF.LO; + parent->child->subtimer = parent->parent->field_0x80.HALF.LO; InitializeAnimation(parent->child, parent->child->animationState + 1); InitializeAnimation(parent, parent->animationState); } @@ -366,7 +366,7 @@ void sub_0802376C(Entity* this) { if (((u8*)&this->field_0x78)[parent->field_0x7c.BYTES.byte0 & 0xf] != 0x88) { this->action = 2; - this->actionDelay = 0; + this->timer = 0; COLLISION_ON(this); this->parent->field_0x7c.BYTES.byte3 = 1; sub_08023A88(this, 20); @@ -377,7 +377,7 @@ void sub_0802376C(Entity* this) { void sub_080237D8(Entity* this) { Entity* parent = this->parent; - if ((parent->animIndex == 0x17) && (this->actionDelay != 0) && (this->x.HALF.HI == parent->x.HALF.HI) && + if ((parent->animIndex == 0x17) && (this->timer != 0) && (this->x.HALF.HI == parent->x.HALF.HI) && (this->y.HALF.HI == parent->y.HALF.HI)) { this->action = 1; COLLISION_OFF(this); @@ -399,7 +399,7 @@ void sub_080237D8(Entity* this) { } void sub_08023894(Entity* this) { - if (--this->field_0xf == 0) { + if (--this->subtimer == 0) { this->action = 2; this->parent->field_0x7c.BYTES.byte3 = 1; InitializeAnimation(this, this->animationState); @@ -417,7 +417,7 @@ void sub_08023894(Entity* this) { } void sub_0802390C(Entity* this) { - if (this->bitfield & 0x80) { + if (this->contactFlags & 0x80) { Entity* ent = this->child; do { ent->iframes = this->iframes; @@ -425,7 +425,7 @@ void sub_0802390C(Entity* this) { } else { Entity* ent = this->child; do { - if (ent->bitfield & 0x80) { + if (ent->contactFlags & 0x80) { u8 bVar2 = 0xff - ent->health; if (bVar2 != 0) { u32 tmp; diff --git a/src/enemy/mulldozer.c b/src/enemy/mulldozer.c index 1550c4d1..adaa991a 100644 --- a/src/enemy/mulldozer.c +++ b/src/enemy/mulldozer.c @@ -59,13 +59,13 @@ void sub_08032CAC(MulldozerEntity* this) { Create0x68FX(super, 0x1c); } EnemyFunctionHandlerAfterCollision(super, Mulldozer_Functions); - if ((super->bitfield & 0x80) != 0) { - switch (super->bitfield & 0x3f) { + if ((super->contactFlags & 0x80) != 0) { + switch (super->contactFlags & 0x3f) { case 2: case 3: super->action = 6; - super->actionDelay = (super->type != 0) ? 0x5a : 200; - super->field_0xf = 2; + super->timer = (super->type != 0) ? 0x5a : 200; + super->subtimer = 2; this->unk_80 = 3; super->direction = super->knockbackDirection; super->direction += ((Random() & 0x40) != 0) ? 4 : 0x1c; @@ -74,7 +74,7 @@ void sub_08032CAC(MulldozerEntity* this) { break; default: super->action = 5; - super->field_0xf = 4; + super->subtimer = 4; sub_08033174(this); break; } @@ -82,8 +82,8 @@ void sub_08032CAC(MulldozerEntity* this) { } void sub_08032D3C(MulldozerEntity* this) { - if (--super->field_0xf == 0) { - super->field_0xf = 2; + if (--super->subtimer == 0) { + super->subtimer = 2; super->animationState = (super->animationState + 1) & 7; sub_08032F24(this); sub_080331E8(this); @@ -100,7 +100,7 @@ void Mulldozer_Init(MulldozerEntity* this) { } void Mulldozer_Action1(MulldozerEntity* this) { - if (--super->actionDelay == 0) { + if (--super->timer == 0) { sub_080330C0(this); } else { if (sub_08033364(this)) { @@ -111,16 +111,16 @@ void Mulldozer_Action1(MulldozerEntity* this) { } void Mulldozer_Action2(MulldozerEntity* this) { - if (--super->actionDelay == 0) { + if (--super->timer == 0) { sub_08033058(this); } sub_08032F48(this); } void Mulldozer_Action3(MulldozerEntity* this) { - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = 4; - super->field_0xf = 8; + super->subtimer = 8; super->speed = 0x1e0; sub_080331B4(this); if ((this->unk_82 & 0x80) != 0) { @@ -140,9 +140,9 @@ void Mulldozer_Action3(MulldozerEntity* this) { } void Mulldozer_Action4(MulldozerEntity* this) { - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = 5; - super->field_0xf = 4; + super->subtimer = 4; sub_08033174(this); } else { sub_08033000(this); @@ -152,11 +152,11 @@ void Mulldozer_Action4(MulldozerEntity* this) { } void Mulldozer_Action5(MulldozerEntity* this) { - if (--super->actionDelay == 0) { + if (--super->timer == 0) { sub_08033320(this); sub_080330C0(this); - } else if ((super->type == 0) && (--super->field_0xf == 0)) { - super->field_0xf = 4; + } else if ((super->type == 0) && (--super->subtimer == 0)) { + super->subtimer = 4; sub_080332A8(this); } sub_080331E8(this); @@ -166,15 +166,15 @@ void Mulldozer_Action5(MulldozerEntity* this) { void Mulldozer_Action6(MulldozerEntity* this) { ProcessMovement0(super); sub_08032F48(this); - if (--super->field_0xf == 0) { - super->field_0xf = 2; + if (--super->subtimer == 0) { + super->subtimer = 2; super->animationState = (super->animationState + 1) & 7; sub_08032F24(this); sub_080331E8(this); } - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = 5; - super->field_0xf = 4; + super->subtimer = 4; sub_08033174(this); } } @@ -212,16 +212,16 @@ void sub_08032F64(MulldozerEntity* this) { void sub_08032F90(MulldozerEntity* this) { if (super->type == 0) { - if (super->actionDelay == 0x10) { + if (super->timer == 0x10) { this->unk_80 = 2; } - if (--super->field_0xf == 0) { - super->field_0xf = 8; + if (--super->subtimer == 0) { + super->subtimer = 8; sub_08033280(this); } } else { - if (--super->field_0xf == 0) { - super->field_0xf = 4; + if (--super->subtimer == 0) { + super->subtimer = 4; if ((this->unk_82 & 0x80) != 0) { super->direction = (super->direction + 0x1c) & 0x1c; } else { @@ -234,8 +234,8 @@ void sub_08032F90(MulldozerEntity* this) { } void sub_08033000(MulldozerEntity* this) { - if (--super->field_0xf == 0) { - super->field_0xf = 0x10; + if (--super->subtimer == 0) { + super->subtimer = 0x10; if ((this->unk_82 & 0x80) != 0) { super->direction = (super->direction + 0x18) & 0x1c; this->unk_82 &= 0x7f; @@ -255,7 +255,7 @@ void sub_08033058(MulldozerEntity* this) { super->action = 1; this->unk_80 = 1; - super->actionDelay = gUnk_080CEA50[Random() & 3]; + super->timer = gUnk_080CEA50[Random() & 3]; if ((sub_08049FA0(super) == 0) && ((Random() & 3) != 0)) { uVar2 = sub_08049EE4(super); uVar3 = Random(); @@ -271,9 +271,9 @@ void sub_080330C0(MulldozerEntity* this) { super->action = 2; this->unk_80 = 0; if (super->type == 0) { - super->actionDelay = (Random() & 0x38) + 0x18; + super->timer = (Random() & 0x38) + 0x18; } else { - super->actionDelay = 6; + super->timer = 6; } super->speed = 0x60; super->direction = (super->direction + 4) & 0x18; @@ -285,15 +285,15 @@ void sub_08033100(MulldozerEntity* this) { super->action = 3; if (super->type == 0) { this->unk_80 = 1; - super->actionDelay = 0x30; - super->field_0xf = 8; + super->timer = 0x30; + super->subtimer = 8; super->speed = 0; super->direction = (sub_08049F84(super, 1) + 2) & 0x1c; } else { this->unk_80 = 2; sub_080331B4(this); - super->actionDelay += 0x10; - super->field_0xf = 4; + super->timer += 0x10; + super->subtimer = 4; super->speed = 0x160; } this->unk_83 = 0; @@ -308,9 +308,9 @@ void sub_08033174(MulldozerEntity* this) { this->unk_82 = 0; this->unk_83 = 0; if (super->type == 0) { - super->actionDelay = (Random() & 0x18) + 0x18; + super->timer = (Random() & 0x18) + 0x18; } else { - super->actionDelay = 0xc; + super->timer = 0xc; } super->speed = 0xa0; sub_08032F24(this); @@ -318,18 +318,18 @@ void sub_08033174(MulldozerEntity* this) { void sub_080331B4(MulldozerEntity* this) { u32 rand = Random() & 0xf0; - u8 actionDelay = 0x1e; + u8 timer = 0x1e; if ((rand & 0x80) != 0) { - actionDelay = 0x3c; + timer = 0x3c; } else { if ((rand & 0x40) != 0) { - actionDelay = 0x2d; + timer = 0x2d; } if ((rand & 0x20) != 0) { - actionDelay = 0x4b; + timer = 0x4b; } } - super->actionDelay = actionDelay; + super->timer = timer; } void sub_080331E8(MulldozerEntity* this) { diff --git a/src/enemy/octorok.c b/src/enemy/octorok.c index 85ed9aaa..e36bc8af 100644 --- a/src/enemy/octorok.c +++ b/src/enemy/octorok.c @@ -61,7 +61,7 @@ void Octorok_OnGrabbed(Entity* this) { void sub_0801EB68(Entity* this) { this->subAction = 1; - this->field_0x1d = 60; + this->gustJarTolerance = 60; } void sub_0801EB74(Entity* this) { @@ -84,7 +84,7 @@ void nullsub_3(Entity* this) { void sub_0801EB9C(Entity* this) { if (this->flags & ENT_COLLIDE) { COLLISION_ON(this); - this->field_0x3a &= 0xfb; + this->gustJarState &= 0xfb; } else { this->health = 0; } @@ -98,15 +98,15 @@ void Octorok_Initialize(Entity* this) { } else { this->animationState = Random() & 3; } - this->field_0x1c = 18; + this->gustJarFlags = 18; Octorok_Pause(this); InitializeAnimation(this, this->animationState); } void Octorok_Idle(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 2; - this->actionDelay = gOctorokWalkDuration[Random() & 3]; + this->timer = gOctorokWalkDuration[Random() & 3]; Octorok_Turn(this); } GetNextFrame(this); @@ -115,7 +115,7 @@ void Octorok_Idle(Entity* this) { void Octorok_Move(Entity* this) { ProcessMovement0(this); GetNextFrame(this); - if (--this->actionDelay == 0) { + if (--this->timer == 0) { if (Octorok_FacesPlayer(this) && gOctorokSpitChanceModifier[this->type] <= (Random() & 3)) { this->action = 3; InitializeAnimation(this, this->animationState + 4); @@ -147,7 +147,7 @@ void Octorok_ShootNut(Entity* this) { void Octorok_Pause(Entity* this) { this->action = 1; - this->actionDelay = (Random() & 0x38) + 24; + this->timer = (Random() & 0x38) + 24; } void Octorok_Turn(Entity* this) { diff --git a/src/enemy/octorokBoss.c b/src/enemy/octorokBoss.c index 51e2b692..d7bc7015 100644 --- a/src/enemy/octorokBoss.c +++ b/src/enemy/octorokBoss.c @@ -457,10 +457,10 @@ void OctorokBoss_Action1(OctorokBossEntity* this) { SortEntityBelow(super->parent, super); if (((this->heap->field_0x2 != 0) || (super->parent->action == INTRO)) || (1 < (u8)(super->parent->subAction - 3))) { - if ((s8)super->field_0xf < 0) { - super->field_0xf = -this->heap->unk_0; + if ((s8)super->subtimer < 0) { + super->subtimer = -this->heap->unk_0; } else { - super->field_0xf = this->heap->unk_0; + super->subtimer = this->heap->unk_0; } sub_08036998(this); } @@ -507,7 +507,7 @@ void OctorokBoss_Action1(OctorokBossEntity* this) { UpdateAnimationSingleFrame(super); if (IS_FROZEN((OctorokBossEntity*)super->parent)) { sub_08036AF0(this, GET_TAIL_RADIUS(this), 0x10); - if ((super->bitfield & 0x7f) == 7) { + if ((super->contactFlags & 0x7f) == 7) { COLLISION_OFF(super); object = CreateObjectWithParent(super, OCTOROK_BOSS_OBJECT, 0, 0); super->child = object; @@ -522,7 +522,7 @@ void OctorokBoss_Action1(OctorokBossEntity* this) { sub_08036998(this); sub_080369D0(this, GET_TAIL_RADIUS(this), 4); } - super->bitfield = 0; + super->contactFlags = 0; SetAffineInfo(super, this->unk_76, this->unk_74, -this->angle.HWORD ^ 0x8000); break; @@ -995,17 +995,17 @@ NONMATCH("asm/non_matching/octorokBoss/sub_08036998.inc", void sub_08036998(Octo // TODO regalloc in this awful structure here tmp2 = &this->timer; - tmp = super->field_0xf + (u8)*tmp2; + tmp = super->subtimer + (u8)*tmp2; *tmp2 = tmp; - if ((s8)super->field_0xf < 0) { + if ((s8)super->subtimer < 0) { a = tmp; - b = -super->actionDelay; + b = -super->timer; if (a << 0x18 < b << 0x18) { - super->field_0xf = -super->field_0xf; + super->subtimer = -super->subtimer; } } else { - if (((s8)*tmp2) > ((s32)super->actionDelay)) { - super->field_0xf = -super->field_0xf; + if (((s8)*tmp2) > ((s32)super->timer)) { + super->subtimer = -super->subtimer; } } } @@ -1211,13 +1211,13 @@ void OctorokBoss_ChangePalette(OctorokBossEntity* this, u32 paletteIndex) { void sub_08036F60(OctorokBossEntity* this) { if ((super->subAction != 4) && (IS_FROZEN(this) == FALSE)) { - this->unk_76 += (s8)super->actionDelay; - this->unk_74 += (s8)super->actionDelay; + this->unk_76 += (s8)super->timer; + this->unk_74 += (s8)super->timer; if (this->unk_76 < 0x9c) { - super->actionDelay = 1; + super->timer = 1; } else { if (this->unk_76 > 0xa4) { - super->actionDelay = 0xff; + super->timer = 0xff; } } } diff --git a/src/enemy/octorokGolden.c b/src/enemy/octorokGolden.c index a2fcfab6..c630053d 100644 --- a/src/enemy/octorokGolden.c +++ b/src/enemy/octorokGolden.c @@ -35,7 +35,7 @@ void OctorokGolden_OnCollision(Entity* this) { } void OctorokGolden_OnDeath(Entity* this) { - if ((this->field_0x3a & 0x2) == 0) { + if ((this->gustJarState & 0x2) == 0) { SetGlobalFlag(this->type2); } @@ -54,8 +54,8 @@ void sub_08037CE4(Entity* this) { } void sub_08037D0C(Entity* this) { - if (this->field_0xf) { - this->field_0xf--; + if (this->subtimer) { + this->subtimer--; } else if (sub_08037E90(this)) { return; } @@ -63,7 +63,7 @@ void sub_08037D0C(Entity* this) { UpdateAnimationVariableFrames(this, 2); if (ProcessMovement0(this) == 0) { sub_08037E14(this); - } else if (--this->actionDelay == 0) { + } else if (--this->timer == 0) { sub_08037E14(this); } } @@ -88,9 +88,9 @@ void sub_08037D54(Entity* this) { } } } else if (this->frame & ANIM_DONE) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 1; - this->field_0xf = 0x3c; + this->subtimer = 0x3c; this->animationState |= 0xff; sub_08037E14(this); } else { @@ -107,7 +107,7 @@ void sub_08037E14(Entity* this) { u8* layer; const s8* ptr; s32 x, y; - this->actionDelay = 0x8; + this->timer = 0x8; dir = (GetFacingDirection(this, &gPlayerEntity) + 4) & 0x18; layer = (u8*)GetLayerByIndex(this->collisionLayer)->collisionData; ptr = gUnk_080CF498 + (dir >> 2); @@ -130,7 +130,7 @@ bool32 sub_08037E90(Entity* this) { u32 dir = sub_0804A044(this, &gPlayerEntity, 8); if (dir != 0xff) { this->action = 2; - this->actionDelay = 3; + this->timer = 3; this->direction = dir; this->animationState = dir >> 3; InitializeAnimation(this, this->animationState + 4); diff --git a/src/enemy/peahat.c b/src/enemy/peahat.c index 93452e64..9b2c8787 100644 --- a/src/enemy/peahat.c +++ b/src/enemy/peahat.c @@ -47,12 +47,12 @@ void Peahat(Entity* this) { void Peahat_OnTick(Entity* this) { gPeahatActions[this->action](this); if (this->field_0x80.HALF.HI) - this->z.HALF.HI = gPeahatFlightHeights[(this->field_0xf++ & 0x30) >> 4]; + this->z.HALF.HI = gPeahatFlightHeights[(this->subtimer++ & 0x30) >> 4]; } void Peahat_OnCollision(Entity* this) { if (this->field_0x82.HALF.LO) { - if (this->bitfield == 0x94) { + if (this->contactFlags == 0x94) { Entity* ent = CreateEnemy(PEAHAT, PeahatForm_Propeller); if (ent != NULL) { CopyPosition(this, ent); @@ -65,17 +65,17 @@ void Peahat_OnCollision(Entity* this) { this->iframes = -30; this->field_0x80.HALF.HI = 0; InitializeAnimation(this, this->animationState); - } else if (this->bitfield == 0x9b) { + } else if (this->contactFlags == 0x9b) { this->animationState = PeahatAnimation_BrokenPropeller; this->action = 5; this->speed = 0x80; this->iframes = -30; this->field_0x80.HALF.HI = 0; InitializeAnimation(this, this->animationState); - } else if (this->bitfield == 0x80) { + } else if (this->contactFlags == 0x80) { if (this->animationState == PeahatAnimation_Flying) { this->action = 1; - this->actionDelay = 30; + this->timer = 30; this->speed = 0x80; this->direction = -1; this->field_0x82.HALF.HI = 0x78; @@ -99,7 +99,7 @@ void Peahat_OnGrabbed(Entity* this) { void sub_080200B4(Entity* this) { this->subAction = 1; - this->field_0x1d = 60; + this->gustJarTolerance = 60; if (this->animationState == PeahatAnimation_Flying) { this->animationState = PeahatAnimation_BrokenPropeller; this->action = 5; @@ -127,7 +127,7 @@ void nullsub_5(Entity* this) { void sub_08020104(Entity* this) { if (this->flags & ENT_COLLIDE) { COLLISION_ON(this); - this->field_0x3a &= 0xfb; + this->gustJarState &= 0xfb; } else { this->health = 0; } @@ -136,10 +136,10 @@ void sub_08020104(Entity* this) { void Peahat_Initialize(Entity* this) { sub_0804A720(this); this->action = 1; - this->actionDelay = 16; - this->field_0xf = Random(); + this->timer = 16; + this->subtimer = Random(); this->direction = Random() & 0x1f; - this->field_0x1c = 18; + this->gustJarFlags = 18; this->field_0x80.HALF.LO = (Random() & 1) ? 2 : -2; this->field_0x80.HALF.HI = 1; this->field_0x82.HALF.LO = 1; @@ -152,16 +152,16 @@ void Peahat_Fly(Entity* this) { this->field_0x82.HALF.HI--; if (sub_08049FDC(this, 1)) { - if (this->field_0x82.HALF.HI == 0 && (this->field_0xf & 0xf) == 0 && sub_08049F1C(this, gUnk_020000B0, 0x30)) { + if (this->field_0x82.HALF.HI == 0 && (this->subtimer & 0xf) == 0 && sub_08049F1C(this, gUnk_020000B0, 0x30)) { this->action = 2; this->subAction = Random() & 3; - this->actionDelay = 60; + this->timer = 60; this->speed = 160; } } - if (--this->actionDelay == 0) { - this->actionDelay = 16; + if (--this->timer == 0) { + this->timer = 16; sub_08020604(this); if ((Random() & 3) == 0) { this->field_0x80.HALF.LO = (Random() & 1) ? 2 : -2; @@ -174,12 +174,12 @@ void Peahat_Fly(Entity* this) { void Peahat_ChargeStart(Entity* this) { if (sub_08049FDC(this, 1)) { - if (--this->actionDelay) { - UpdateAnimationVariableFrames(this, 4 - ((this->actionDelay >> 4) & 0x3)); + if (--this->timer) { + UpdateAnimationVariableFrames(this, 4 - ((this->timer >> 4) & 0x3)); return; } else { this->action = 3; - this->actionDelay = 120; + this->timer = 120; this->speed = 192; this->direction = (GetFacingDirection(this, gUnk_020000B0) + gUnk_080CA5D4[Random() & 1]) & 0x1f; } @@ -192,11 +192,11 @@ void Peahat_ChargeStart(Entity* this) { void Peahat_ChargeTarget(Entity* this) { if (sub_08049FDC(this, 1)) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { sub_080205F8(this); } - if (60 < this->actionDelay) { - if (this->actionDelay & 1) + if (60 < this->timer) { + if (this->timer & 1) this->speed += 4; if ((gRoomTransition.frameCount & 3) == 0) @@ -210,14 +210,14 @@ void Peahat_ChargeTarget(Entity* this) { } void Peahat_ChargeEnd(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 1; - this->actionDelay = 1; + this->timer = 1; this->speed = 128; this->field_0x82.HALF.HI = 120; GetNextFrame(this); } else { - if (this->actionDelay & 1) + if (this->timer & 1) this->speed -= 8; ProcessMovement2(this); @@ -230,8 +230,8 @@ void Peahat_Stunned(Entity* this) { default: if (sub_080044EC(this, 0x1800) == 0) { this->action = 6; - this->actionDelay = 240; - this->field_0xf = 10; + this->timer = 240; + this->subtimer = 10; this->hitType = 0x71; } @@ -245,8 +245,8 @@ void Peahat_Stunned(Entity* this) { GravityUpdate(this, 0x1c00); if (this->z.HALF.HI == 0) { this->action = 7; - this->actionDelay = 150; - this->field_0xf = 10; + this->timer = 150; + this->subtimer = 10; this->hitType = 0x71; } break; @@ -254,11 +254,11 @@ void Peahat_Stunned(Entity* this) { } void Peahat_RepairPropeller(Entity* this) { - if (this->field_0xf) - if (--this->field_0xf == 0) + if (this->subtimer) + if (--this->subtimer == 0) Create0x68FX(this, FX_STARS); - if (!sub_0800442E(this) && --this->actionDelay) + if (!sub_0800442E(this) && --this->timer) return; this->action = 9; @@ -270,29 +270,29 @@ void Peahat_RepairPropeller(Entity* this) { } void Peahat_Recover(Entity* this) { - if (this->field_0xf) - if (--this->field_0xf == 0) + if (this->subtimer) + if (--this->subtimer == 0) Create0x68FX(this, FX_STARS); - if (!sub_0800442E(this) && --this->actionDelay) + if (!sub_0800442E(this) && --this->timer) return; this->action = 8; - this->actionDelay = 240; + this->timer = 240; this->direction = Random() & 0x1f; sub_0804AA1C(this); } void Peahat_Hop(Entity* this) { GetNextFrame(this); - if (--this->actionDelay == 0) { + if (--this->timer == 0) { if (this->frame & ANIM_DONE) { this->action = 9; this->zVelocity = Q_16_16(1.5); this->animationState = PeahatAnimation_NewPropeller; InitializeAnimation(this, this->animationState); } else { - this->actionDelay = 1; + this->timer = 1; } } @@ -327,8 +327,8 @@ void Peahat_Takeoff(Entity* this) { void PeahatPropeller_Initialize(Entity* this) { this->action = 1; - this->actionDelay = 240; - this->field_0xf = 40; + this->timer = 240; + this->subtimer = 40; this->spriteSettings.draw = 1; this->spriteRendering.b3 = 1; this->spriteOrientation.flipY = 1; @@ -340,16 +340,16 @@ void PeahatPropeller_Initialize(Entity* this) { void PeahatPropeller_Fly(Entity* this) { GetNextFrame(this); - if (--this->actionDelay == 0) { + if (--this->timer == 0) { DeleteEntity(this); } else { - if (this->actionDelay < 60) + if (this->timer < 60) this->spriteSettings.draw ^= 1; this->z.WORD -= 0xc000; LinearMoveUpdate(this); - if (--this->field_0xf == 0) { - this->field_0xf = 40; + if (--this->subtimer == 0) { + this->subtimer = 40; this->direction = (Random() & 0x10) + 8; } } @@ -357,7 +357,7 @@ void PeahatPropeller_Fly(Entity* this) { void sub_080205F8(Entity* this) { this->action = 4; - this->actionDelay = 60; + this->timer = 60; } void sub_08020604(Entity* this) { diff --git a/src/enemy/pesto.c b/src/enemy/pesto.c index a5f07588..4da32bcb 100644 --- a/src/enemy/pesto.c +++ b/src/enemy/pesto.c @@ -50,7 +50,7 @@ void Pesto_OnTick(Entity* this) { void Pesto_OnCollision(Entity* this) { if (this->hitType != 0x6e) { - if (this->bitfield == 0x80) { + if (this->contactFlags == 0x80) { this->field_0x86.HALF.LO = 0x30; if ((this->field_0x82.HALF.HI & 0xf) == 3 && this->action == 6) { @@ -85,7 +85,7 @@ void Pesto_OnGrabbed(Entity* this) { this->subAction = 0; COLLISION_ON(this); this->hitType = 0x77; - this->actionDelay = 1; + this->timer = 1; this->speed = 0x40; } else { gUnk_080CBEF8[this->subAction](this); @@ -94,7 +94,7 @@ void Pesto_OnGrabbed(Entity* this) { void sub_08024038(Entity* this) { this->subAction = 1; - this->field_0x1d = 60; + this->gustJarTolerance = 60; GetNextFrame(this); } @@ -159,10 +159,10 @@ void sub_080240B8(Entity* this) { this->field_0x82.HALF.HI = 0x80; this->field_0x86.HALF.LO = 0; this->field_0x86.HALF.HI = 0; - this->actionDelay = 0; - this->field_0xf = 0x20; - this->field_0x3c |= 0x10; - this->field_0x1c = 2; + this->timer = 0; + this->subtimer = 0x20; + this->collisionFlags |= 0x10; + this->gustJarFlags = 2; this->direction = direction; sub_080249DC(this); @@ -188,12 +188,12 @@ void sub_080241C0(Entity* this) { this->field_0x80.HALF.LO++; this->speed = 0; sub_08024A14(this, 3, 10); - } else if (--this->field_0xf == 0) { + } else if (--this->subtimer == 0) { sub_08024A14(this, 0, 0x20); } break; case 1: - if (--this->field_0xf == 0) { + if (--this->subtimer == 0) { if (this->type != 0) { u8 tmp = this->field_0x82.HALF.HI & 0x80; if (tmp) { @@ -202,10 +202,10 @@ void sub_080241C0(Entity* this) { } else { this->action = 3; this->field_0x80.HALF.LO = tmp; - this->field_0xf = 10; + this->subtimer = 10; sub_08024E00(this, 0); sub_08024E1C(this); - sub_08024A14(this, 3, this->field_0xf); + sub_08024A14(this, 3, this->subtimer); } } else { sub_08024C94(this); @@ -222,7 +222,7 @@ void sub_08024298(Entity* this) { void sub_080242A0(Entity* this) { sub_08024940(this); if (sub_08024CC0(this)) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->direction = GetFacingDirection(this, gUnk_020000B0); sub_08024E00(this, 1); if (this->speed != 0) { @@ -230,14 +230,14 @@ void sub_080242A0(Entity* this) { } else { sub_08024E1C(this); } - } else if (--this->field_0xf == 0) { + } else if (--this->subtimer == 0) { sub_08024A14(this, 3, 10); } if (sub_08049F1C(this, gUnk_020000B0, 0x20) && sub_08049FDC(this, 3)) { this->action = 4; this->field_0x80.HALF.LO = 0; - this->actionDelay = 0x10; + this->timer = 0x10; this->speed = 0; } } @@ -247,22 +247,22 @@ void sub_0802433C(Entity* this) { sub_08024940(this); switch (this->field_0x80.HALF.LO) { case 0: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->field_0x80.HALF.LO++; this->speed = 0x100; - this->field_0xf = 8; + this->subtimer = 8; sub_08024E00(this, 1); } break; case 1: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 5; this->field_0x80.HALF.LO = 0; this->speed = 0x140; - this->actionDelay = 0xc0; - this->field_0xf = 8; + this->timer = 0xc0; + this->subtimer = 8; } else { - if (--this->field_0xf == 0) + if (--this->subtimer == 0) sub_08024A14(this, 2, 4); } break; @@ -276,18 +276,18 @@ void sub_080243B8(Entity* this) { if (sub_08024C48(this, TRUE)) { if (this->child == NULL || this->child->next == NULL) { this->field_0x80.HALF.LO = 2; - this->actionDelay = 0x20; + this->timer = 0x20; this->speed = 0x80; this->field_0x82.HALF.HI = 0x80; } else if (sub_08049F1C(this, gUnk_020000B0, 0xe)) { this->field_0x80.HALF.LO++; - this->actionDelay = 0x1e; + this->timer = 0x1e; this->speed = 0x100; this->field_0x82.HALF.HI = 0x80; this->child->action = 2; - } else if (--this->actionDelay) { - if (--this->field_0xf == 0) { - sub_08024A14(this, 2, (this->actionDelay >> 6) + 1); + } else if (--this->timer) { + if (--this->subtimer == 0) { + sub_08024A14(this, 2, (this->timer >> 6) + 1); } } else { sub_08024C7C(this); @@ -297,14 +297,14 @@ void sub_080243B8(Entity* this) { } break; case 1: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->field_0x80.HALF.LO++; - this->actionDelay = 0x20; + this->timer = 0x20; this->speed = 0x80; } break; case 2: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 6; this->field_0x80.HALF.LO = 0; this->speed = 0x80; @@ -313,18 +313,18 @@ void sub_080243B8(Entity* this) { if ((this->field_0x82.HALF.HI & 0x40) == 0) { switch (this->field_0x82.HALF.HI & 0x3f) { case 3: - this->actionDelay = 4; + this->timer = 4; break; case 1: - this->actionDelay = 0x14; + this->timer = 0x14; break; default: - this->actionDelay = 0x30; + this->timer = 0x30; break; } sub_08024A14(this, 2, 8); } else { - this->actionDelay = 0x40; + this->timer = 0x40; sub_08024A14(this, 0, 8); } } @@ -336,19 +336,19 @@ void sub_080244E8(Entity* this) { sub_08024940(this); switch (this->field_0x80.HALF.LO) { case 0: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { if (sub_080B1B44(COORD_TO_TILE(this), 1) == 0) { this->field_0x80.HALF.LO += 1; this->field_0x82.HALF.LO += 1; - this->field_0xf = 0; + this->subtimer = 0; this->speed = 0; } else { - this->actionDelay = 0x30; - this->field_0xf = 4; + this->timer = 0x30; + this->subtimer = 4; } break; } else { - if (--this->field_0xf == 0) { + if (--this->subtimer == 0) { sub_08024A14(this, 1, 8); } } @@ -369,7 +369,7 @@ void sub_080244E8(Entity* this) { if (sub_08024AD8(this)) { u32 tmp; - if (--this->actionDelay == 0) { + if (--this->timer == 0) { if (this->speed) { this->speed = 0; } else { @@ -378,7 +378,7 @@ void sub_080244E8(Entity* this) { this->direction = GetFacingDirection(this, this->child); sub_08024E00(this, 0); sub_080249DC(this); - } else if (--this->field_0xf == 0) { + } else if (--this->subtimer == 0) { sub_08024A14(this, 1, 8); } @@ -387,7 +387,7 @@ void sub_080244E8(Entity* this) { tmp = this->field_0x82.HALF.HI & 0x80; if (tmp == 0) { this->field_0x80.HALF.LO++; - this->actionDelay = 0xc; + this->timer = 0xc; this->direction = 0x10; this->speed = tmp; this->cutsceneBeh.HALF.LO = 0; @@ -407,7 +407,7 @@ void sub_080244E8(Entity* this) { Entity* ent; this->field_0x80.HALF.LO += 1; - this->actionDelay = 0xc; + this->timer = 0xc; this->field_0x82.HALF.HI &= ~0x80; CopyPosition(this->child, this); this->z.HALF.HI -= 0xe; @@ -428,7 +428,7 @@ void sub_080244E8(Entity* this) { Entity* ent; this->field_0x80.HALF.LO += 1; - this->actionDelay = 0xc; + this->timer = 0xc; this->field_0x82.HALF.HI &= ~0x80; ent = this->child; SetTile((u16)ent->field_0x70.HALF.LO, COORD_TO_TILE(ent), ent->collisionLayer); @@ -452,9 +452,9 @@ void sub_080244E8(Entity* this) { } break; case 3: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->field_0x80.HALF.LO++; - this->field_0xf = 0; + this->subtimer = 0; this->speed = 0; this->field_0x82.HALF.LO++; } @@ -482,8 +482,8 @@ void sub_080244E8(Entity* this) { break; case 1 ... 2: this->field_0x80.HALF.LO += 1; - this->actionDelay = 0xc0; - this->field_0xf = 8; + this->timer = 0xc0; + this->subtimer = 8; this->speed = 0x80; sub_080249DC(this); break; @@ -494,19 +494,19 @@ void sub_080244E8(Entity* this) { } break; case 6: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { if (this->field_0x82.HALF.HI & 0x80) { this->field_0x82.HALF.HI = 0xc0; this->field_0x80.HALF.LO = 0; this->speed = 0x40; - this->actionDelay = 0x40; - this->field_0xf = 8; + this->timer = 0x40; + this->subtimer = 8; sub_08024A14(this, 0, 8); } else { - this->actionDelay = 0x40; - this->field_0xf = 8; + this->timer = 0x40; + this->subtimer = 8; } - } else if (--this->field_0xf == 0) { + } else if (--this->subtimer == 0) { sub_08024A14(this, 2, 8); } break; @@ -606,7 +606,7 @@ void sub_08024A14(Entity* this, u32 param_2, u32 param_3) { } sub_080249DC(this); - this->field_0xf = param_3; + this->subtimer = param_3; } bool32 sub_08024AD8(Entity* this) { @@ -703,18 +703,18 @@ ASM_FUNC("asm/non_matching/pesto/sub_08024C48.inc", bool32 sub_08024C48(Entity* void sub_08024C7C(Entity* this) { this->action = 1; this->speed = 0x40; - this->actionDelay = 0; + this->timer = 0; sub_08024A14(this, 0, 0x20); } void sub_08024C94(Entity* this) { this->action = 2; this->field_0x80.HALF.LO = 0; - this->actionDelay = 0x40; - this->field_0xf = 0; + this->timer = 0x40; + this->subtimer = 0; this->speed = 0xc0; this->field_0x82.HALF.HI = 0x80; - sub_08024A14(this, 3, this->field_0xf); + sub_08024A14(this, 3, this->subtimer); } bool32 sub_08024CC0(Entity* this) { @@ -744,9 +744,9 @@ void sub_08024D00(Entity* this) { } else if (sub_08024CC0(this)) { switch (this->field_0x80.HALF.LO) { case 0: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->field_0x80.HALF.LO++; - this->actionDelay = (Random() & 0xf) + 0x20; + this->timer = (Random() & 0xf) + 0x20; this->direction += this->field_0x80.HALF.HI ? 4 : 0x1c; this->direction &= 0x1f; @@ -756,15 +756,15 @@ void sub_08024D00(Entity* this) { } break; case 1: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->field_0x80.HALF.LO = 0; - this->actionDelay = (Random() & 0x1f) + 0x20; + this->timer = (Random() & 0x1f) + 0x20; } else { - if (--this->field_0xf == 0) { + if (--this->subtimer == 0) { this->direction += this->field_0x80.HALF.HI ? 1 : 0x1f; this->direction &= 0x1f; - this->field_0xf = 0x10; + this->subtimer = 0x10; sub_080249DC(this); } } @@ -774,7 +774,7 @@ void sub_08024D00(Entity* this) { } void sub_08024E00(Entity* this, u32 unk) { - this->actionDelay = gUnk_080CBF10[sub_08024E34() * 2 | unk]; + this->timer = gUnk_080CBF10[sub_08024E34() * 2 | unk]; } void sub_08024E1C(Entity* this) { @@ -788,7 +788,7 @@ u32 sub_08024E34(void) { void sub_08024E4C(Entity* this) { if (this->field_0x82.HALF.HI == 3) { - this->field_0xf = ++this->field_0xf & 0x1f; + this->subtimer = ++this->subtimer & 0x1f; if (sub_0807953C()) { u32 r = Random(); this->cutsceneBeh.HALF.LO++; @@ -801,8 +801,8 @@ void sub_08024E4C(Entity* this) { sub_08024F50(this); this->field_0x80.HALF.LO = 0; this->speed = 0x40; - this->actionDelay = 0x40; - this->field_0xf = 8; + this->timer = 0x40; + this->subtimer = 8; sub_08024A14(this, 0, 8); } else { Entity* player = &gPlayerEntity; @@ -817,7 +817,7 @@ void sub_08024E4C(Entity* this) { player->spriteOffsetY = 0x1a; player->animationState = 4; player->spritePriority.b1 = 0; - if (this->field_0xf == 0) { + if (this->subtimer == 0) { this->field_0x86.HALF.HI++; player->iframes = 8; ModHealth(-2); diff --git a/src/enemy/puffstool.c b/src/enemy/puffstool.c index 3b080dd8..aac1c3e7 100644 --- a/src/enemy/puffstool.c +++ b/src/enemy/puffstool.c @@ -53,16 +53,16 @@ void Puffstool_OnTick(Entity* this) { void Puffstool_OnCollide(Entity* this) { u8 tmp; - switch (this->bitfield & 0x7f) { + switch (this->contactFlags & 0x7f) { case 0 ... 3: /* ... */ break; case 0x1b: sub_0804AA1C(this); - tmp = gUnk_080CBFE8[(*(Entity**)&this->field_0x4c)->type]; + tmp = gUnk_080CBFE8[(*(Entity**)&this->contactedEntity)->type]; if (tmp < this->field_0x82.HALF.LO) { - this->field_0x82.HALF.LO -= gUnk_080CBFE8[(*(Entity**)&this->field_0x4c)->type]; + this->field_0x82.HALF.LO -= gUnk_080CBFE8[(*(Entity**)&this->contactedEntity)->type]; } else { this->cutsceneBeh.HWORD = 0x294; this->hitType = 0x83; @@ -70,14 +70,14 @@ void Puffstool_OnCollide(Entity* this) { ChangeObjPalette(this, 0x7c); } this->action = 7; - this->actionDelay = 0x3c; + this->timer = 0x3c; if (0 < this->zVelocity) { this->zVelocity = 0; } this->iframes = -0xc; this->knockbackDuration = 0; if (this->field_0x80.HALF.LO == 0) { - this->animationState = (*(Entity**)&this->field_0x4c)->direction >> 3; + this->animationState = (*(Entity**)&this->contactedEntity)->direction >> 3; InitializeAnimation(this, this->animationState + 4); this->frameDuration = 6; this->field_0x80.HALF.LO = 1; @@ -99,7 +99,7 @@ void Puffstool_OnCollide(Entity* this) { } void Puffstool_OnDeath(Entity* this) { - if ((this->field_0x3a & 2) && this->actionDelay == 1 && this->field_0x82.HALF.LO) { + if ((this->gustJarState & 2) && this->timer == 1 && this->field_0x82.HALF.LO) { sub_08025B18(this); } GenericDeath(this); @@ -116,8 +116,8 @@ void Puffstool_OnGrabbed(Entity* this) { void sub_08025180(Entity* this) { this->subAction = 1; - this->actionDelay = Random(); - this->animationState = (((*(Entity**)&this->field_0x4c)->direction ^ 0x10) >> 3); + this->timer = Random(); + this->animationState = (((*(Entity**)&this->contactedEntity)->direction ^ 0x10) >> 3); InitializeAnimation(this, this->animationState + 4); sub_0804AA1C(this); } @@ -125,7 +125,7 @@ void sub_08025180(Entity* this) { void sub_080251AC(Entity* this) { if (this->field_0x82.HALF.LO >= 4) { this->field_0x82.HALF.LO -= 3; - if ((--this->actionDelay & 3) == 0) { + if ((--this->timer & 3) == 0) { sub_08025BD4(this); } } else { @@ -152,23 +152,23 @@ void sub_08025230(Entity* this) { sub_08025C44(this); GetNextFrame(this); - if (--this->actionDelay == 0) { - this->actionDelay = (Random() & 3) + 4; + if (--this->timer == 0) { + this->timer = (Random() & 3) + 4; this->direction = sub_08025C60(this); } if (this->collisions != COL_NONE) { - if (--this->field_0xf == 0) { + if (--this->subtimer == 0) { sub_0800417E(this, this->collisions); } } else { - this->field_0xf = 30; + this->subtimer = 30; } if (this->field_0x78.HWORD == 0) { if (sub_0802571C(this)) { this->action = 2; - this->actionDelay = 240; + this->timer = 240; this->field_0x86.HWORD = COORD_TO_TILE(this); } } else { @@ -187,26 +187,26 @@ void sub_080252E0(Entity* this) { tile = COORD_TO_TILE(this); if (tile == this->field_0x86.HWORD) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { sub_080256B4(this); } } else { this->field_0x86.HWORD = tile; - this->actionDelay = 240; + this->timer = 240; } if (this->x.HALF.HI == (u16)this->field_0x7c.HALF.LO && this->y.HALF.HI == (u16)this->field_0x7c.HALF.HI) { this->action = 3; - this->actionDelay = 0x1e; - this->field_0xf = 0; + this->timer = 0x1e; + this->subtimer = 0; this->zVelocity = Q_16_16(1.5); InitializeAnimation(this, 1); } } void sub_0802538C(Entity* this) { - if (this->actionDelay) { - this->actionDelay--; + if (this->timer) { + this->timer--; } else { if (this->frame == 0) { GetNextFrame(this); @@ -223,12 +223,12 @@ void sub_0802538C(Entity* this) { void sub_080253D4(Entity* this) { GetNextFrame(this); if (!GravityUpdate(this, 0x2000)) { - if (this->field_0xf == 0) { + if (this->subtimer == 0) { this->action = 5; InitializeAnimation(this, 3); } else { this->action = 6; - this->actionDelay = 0x1e; + this->timer = 0x1e; InitializeAnimation(this, 3); sub_08025A54(this); sub_08025AE8(this); @@ -240,7 +240,7 @@ void sub_0802541C(Entity* this) { GetNextFrame(this); if (this->frame & ANIM_DONE) { this->action = 3; - this->field_0xf = 1; + this->subtimer = 1; this->zVelocity = Q_16_16(2); InitializeAnimation(this, 1); } @@ -250,7 +250,7 @@ void sub_0802544C(Entity* this) { if (this->frame == 0) { GetNextFrame(this); } else { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { sub_080256B4(this); InitializeAnimation(this, 0); } @@ -260,11 +260,11 @@ void sub_0802544C(Entity* this) { void sub_0802547C(Entity* this) { GravityUpdate(this, Q_16_16(0.125)); GetNextFrame(this); - if ((this->actionDelay & 7) == 0) { + if ((this->timer & 7) == 0) { sub_08025BD4(this); } - if (--this->actionDelay == 0) { + if (--this->timer == 0) { sub_08025C2C(this); } } @@ -290,13 +290,13 @@ void sub_080254B4(Entity* this) { void sub_08025514(Entity* this) { GetNextFrame(this); - if (sub_0802594C(this, this->actionDelay++)) { + if (sub_0802594C(this, this->timer++)) { this->action = 2; - this->actionDelay = 240; + this->timer = 240; this->field_0x80.HALF.HI = 120; - } else if (3 < this->actionDelay) { + } else if (3 < this->timer) { this->action = 10; - this->actionDelay = 0x20; + this->timer = 0x20; } } @@ -305,13 +305,13 @@ void sub_08025554(Entity* this) { if (ent == NULL) { sub_080256B4(this); } else { - if ((this->actionDelay & 3) == 0) { + if ((this->timer & 3) == 0) { this->direction = GetFacingDirection(ent, this); } sub_08025C44(this); GetNextFrame(this); - if (this->actionDelay != 0) { - this->actionDelay--; + if (this->timer != 0) { + this->timer--; } else { if (!sub_080258C4(this)) { sub_080256B4(this); @@ -329,10 +329,10 @@ void sub_080255AC(Entity* this) { this->field_0x80.HALF.HI--; } - if (--this->actionDelay == 0) { + if (--this->timer == 0) { s32 tmp; - this->actionDelay = (Random() & 3) + 4; + this->timer = (Random() & 3) + 4; tmp = Random() & 0xf; if (tmp < 8) { @@ -378,8 +378,8 @@ void sub_0802563C(Entity* this) { void sub_080256B4(Entity* this) { this->action = 1; - this->actionDelay = (Random() & 3) + 4; - this->field_0xf = 0x1e; + this->timer = (Random() & 3) + 4; + this->subtimer = 0x1e; this->direction = (this->direction + 7 + ((s32)Random() % 7) * 4) & 0x1c; this->field_0x78.HWORD = gUnk_080CC000[Random() & 0xf]; this->field_0x7a.HALF.LO = ((s32)Random() % 0x18) << 1; @@ -454,11 +454,11 @@ bool32 sub_080258C4(Entity* this) { iVar4 = iVar4 + iVar1; if (this->cutsceneBeh.HWORD == 0 && this->field_0x80.HALF.HI == 0 && 0x400 >= iVar4) { this->action = 9; - this->actionDelay = 0; + this->timer = 0; return TRUE; } else if (0x900 >= iVar4) { this->action = 11; - this->actionDelay = 1; + this->timer = 1; this->field_0x78.HWORD = gUnk_080CC050[Random() & 0xf]; return TRUE; } else { diff --git a/src/enemy/rockChuchu.c b/src/enemy/rockChuchu.c index 9f118b2b..89f62eb5 100644 --- a/src/enemy/rockChuchu.c +++ b/src/enemy/rockChuchu.c @@ -23,7 +23,7 @@ void RockChuchu_OnCollision(Entity* this) { Entity* ent; if (this->health) { - switch (this->bitfield & 0x7f) { + switch (this->contactFlags & 0x7f) { case 4: case 5: case 6: @@ -72,25 +72,25 @@ void RockChuchu_OnGrabbed(Entity* this) { void sub_08022368(Entity* this) { sub_0804A720(this); this->action = 1; - this->actionDelay = Random(); + this->timer = Random(); this->direction = sub_08049F84(this, 1); InitializeAnimation(this, 0); } void sub_08022390(Entity* this) { if (sub_08049FDC(this, 1)) { - if ((this->actionDelay++ & 0xf) == 0) { + if ((this->timer++ & 0xf) == 0) { this->direction = sub_08049F84(this, 1); - this->field_0xf = Random() & 4; + this->subtimer = Random() & 4; } - if (this->field_0xf == 0) { + if (this->subtimer == 0) { ProcessMovement0(this); } else { - this->field_0xf = this->field_0xf - 1; + this->subtimer = this->subtimer - 1; } } else { - this->actionDelay = Random(); + this->timer = Random(); } GetNextFrame(this); @@ -101,7 +101,7 @@ void sub_080223E4(Entity* this) { ent = this->child; if (ent != NULL) { - ent->bitfield = 0x94; + ent->contactFlags = 0x94; ent->iframes = 0x10; #ifndef EU ent->knockbackDuration = 0xc; diff --git a/src/enemy/rollobite.c b/src/enemy/rollobite.c index f86dd5b9..3308f3b6 100644 --- a/src/enemy/rollobite.c +++ b/src/enemy/rollobite.c @@ -42,16 +42,16 @@ void Rollobite_OnCollision(Entity* this) { InitializeAnimation(this, this->animationState + 8); } - if (this->bitfield != 0x80) { + if (this->contactFlags != 0x80) { if (this->action == 4 || this->action == 5) { this->action = 4; - this->actionDelay = 180; + this->timer = 180; this->direction = 0xff; InitializeAnimation(this, this->animationState + 0x10); } } - if (this->bitfield == 0x93) + if (this->contactFlags == 0x93) Rollobite_OnTick(this); } @@ -80,7 +80,7 @@ void Rollobite_OnGrabbed(Entity* this) { void sub_0802077C(Entity* this) { this->subAction = 1; - this->field_0x1d = 60; + this->gustJarTolerance = 60; } void sub_08020788(Entity* this) { @@ -103,7 +103,7 @@ void sub_080207A8(Entity* this) { this->action = 4; COLLISION_ON(this); this->spritePriority.b0 = 4; - this->field_0x3a &= 0xfb; + this->gustJarState &= 0xfb; this->direction ^= 0x10; this->zVelocity = Q_16_16(1.5); this->speed = 0x80; @@ -112,8 +112,8 @@ void sub_080207A8(Entity* this) { void Rollobite_Initialize(Entity* this) { sub_0804A720(this); - this->field_0x16 = 0x30; - this->field_0x1c = 18; + this->carryFlags = 0x30; + this->gustJarFlags = 18; this->cutsceneBeh.HALF.LO = 0; this->direction = DirectionRound(Random()); sub_08020A30(this); @@ -124,14 +124,14 @@ void Rollobite_Walk(Entity* this) { if (this->frame & 0x1) { this->frame &= ~0x1; if (!ProcessMovement0(this)) - this->actionDelay = 1; + this->timer = 1; } if (this->frame & 0x10) { this->frame &= ~0x10; - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 3; - this->actionDelay = 60; + this->timer = 60; } } } @@ -168,7 +168,7 @@ void sub_08020904(Entity* this) { } void Rollobite_Turn(Entity* this) { - if (--this->actionDelay == 0) + if (--this->timer == 0) sub_08020A30(this); } @@ -181,7 +181,7 @@ void Rollobite_RolledUp(Entity* this) { unk = sub_080044EC(this, 0x2800); if (unk == 0) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 5; InitializeAnimation(this, this->animationState + 12); } @@ -226,10 +226,10 @@ void Rollobite_Holed(Entity* this) { void sub_08020A30(Entity* this) { if (this->cutsceneBeh.HALF.LO < 2) { - this->actionDelay = gUnk_080CA6CC[Random() & 7]; - if (this->actionDelay == 0) { + this->timer = gUnk_080CA6CC[Random() & 7]; + if (this->timer == 0) { this->action = 3; - this->actionDelay = 60; + this->timer = 60; this->cutsceneBeh.HALF.LO++; return; } diff --git a/src/enemy/rope.c b/src/enemy/rope.c index 37c63337..c62edf1e 100644 --- a/src/enemy/rope.c +++ b/src/enemy/rope.c @@ -27,7 +27,7 @@ void Rope_OnTick(Entity* this) { void Rope_OnCollision(Entity* this) { if (this->action == 3) { - this->field_0xf = 0x1e; + this->subtimer = 0x1e; this->field_0x78.HALF.LO = 0x3c; sub_08031600(this); } @@ -45,7 +45,7 @@ void Rope_OnGrabbed(Entity* this) { void sub_0803140C(Entity* this) { this->subAction = 1; - this->field_0x1d = 0x3c; + this->gustJarTolerance = 0x3c; } void sub_08031418(Entity* this) { @@ -62,7 +62,7 @@ void sub_08031434(Entity* this) { sub_0804A720(this); this->animationState = 0xff; - this->field_0x1c = 1; + this->gustJarFlags = 1; this->field_0x7a.HWORD = this->speed; if (!(this->type)) { sub_08031600(this); @@ -77,8 +77,8 @@ void sub_08031434(Entity* this) { void sub_08031480(Entity* this) { if (this->subAction == 0) { - if (this->actionDelay != 0) { - this->actionDelay--; + if (this->timer != 0) { + this->timer--; } else { sub_08031600(this); this->action = 1; @@ -91,7 +91,7 @@ void sub_08031480(Entity* this) { } else { if (GravityUpdate(this, 0x1800) == 0) { this->action = 2; - this->field_0xf = 0xf; + this->subtimer = 0xf; this->spriteSettings.draw = 1; UpdateSpriteForCollisionLayer(this); EnqueueSFX(SFX_WATER_SPLASH); @@ -102,8 +102,8 @@ void sub_080314FC(Entity* this) { u32 u; GetNextFrame(this); - if (this->field_0xf) { - this->field_0xf--; + if (this->subtimer) { + this->subtimer--; } else { if (this->field_0x78.HALF.LO) { this->field_0x78.HALF.LO--; @@ -114,7 +114,7 @@ void sub_080314FC(Entity* this) { u = sub_0804A044(this, gUnk_020000B0, 0xc); if (u != 0xff) { this->action = 3; - this->actionDelay = 0x1e; + this->timer = 0x1e; this->field_0x7a.HWORD = this->speed = 0x1a0; this->direction = u; this->animationState = this->direction >> 3; @@ -133,7 +133,7 @@ void sub_080314FC(Entity* this) { } } } - if (!(--this->actionDelay)) { + if (!(--this->timer)) { sub_08031600(this); } sub_0803163C(this); @@ -141,8 +141,8 @@ void sub_080314FC(Entity* this) { } void sub_080315BC(Entity* this) { - if (this->actionDelay) { - this->actionDelay--; + if (this->timer) { + this->timer--; UpdateAnimationVariableFrames(this, 2); } else { if (sub_08049FA0(this)) { @@ -159,7 +159,7 @@ void sub_080315BC(Entity* this) { void sub_08031600(Entity* this) { u32 r; this->action = 2; - this->actionDelay = (Random() & 0x30) + 0x3c; + this->timer = (Random() & 0x30) + 0x3c; this->speed = 0x80; this->field_0x7a.HWORD = 0x80; r = Random() & 0x18; diff --git a/src/enemy/ropeGolden.c b/src/enemy/ropeGolden.c index a4a6fc99..5bb3796b 100644 --- a/src/enemy/ropeGolden.c +++ b/src/enemy/ropeGolden.c @@ -40,7 +40,7 @@ void RopeGolden_OnCollision(Entity* this) { } void RopeGolden_OnDeath(Entity* this) { - if ((this->field_0x3a & 2) == 0) { + if ((this->gustJarState & 2) == 0) { SetGlobalFlag(this->type2); } CreateDeathFx(this, 0xff, 0x58); @@ -56,8 +56,8 @@ void sub_08038258(Entity* this) { } void sub_0803827C(Entity* this) { - if (this->field_0xf != 0) { - this->field_0xf--; + if (this->subtimer != 0) { + this->subtimer--; } else { if ((sub_0804A044(this, &gPlayerEntity, 0x8) != 0xff) || (EntityWithinDistance(this, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x24) != 0)) { @@ -69,14 +69,14 @@ void sub_0803827C(Entity* this) { if (ProcessMovement0(this) == 0) { sub_080383AC(this); } else { - if (!(--this->actionDelay)) { + if (!(--this->timer)) { sub_080383AC(this); } } } void sub_080382EC(Entity* this) { - if (!(--this->actionDelay)) { + if (!(--this->timer)) { this->action = 3; } } @@ -86,7 +86,7 @@ ASM_FUNC("asm/non_matching/ropeGolden/sub_08038304.inc", void sub_08038304(Entit void sub_080383AC(Entity* this) { u32 v; this->action = 1; - this->actionDelay = 0x8; + this->timer = 0x8; this->speed = 0x100; this->direction = DirectionRoundUp(GetFacingDirection(this, &gPlayerEntity)); v = this->direction >> 3; @@ -99,7 +99,7 @@ void sub_080383AC(Entity* this) { void sub_080383E4(Entity* this) { u32 v; this->action = 2; - this->actionDelay = 0x8; + this->timer = 0x8; this->speed = 0x280; v = DirectionRoundUp(GetFacingDirection(this, &gPlayerEntity)); this->direction = v; diff --git a/src/enemy/rupeeLike.c b/src/enemy/rupeeLike.c index 0e6afccb..9a9fc7cd 100644 --- a/src/enemy/rupeeLike.c +++ b/src/enemy/rupeeLike.c @@ -60,14 +60,14 @@ void RupeeLike_OnCollision(Entity* this) { if (this->action == 4) { sub_080296D8(this); } - if (*(u8*)(*(u32*)&this->field_0x4c + 8) == 1) { + if (*(u8*)(*(u32*)&this->contactedEntity + 8) == 1) { if (this->action == 2) { InitializeAnimation(this, 0); InitializeAnimation(this->child, 4); } this->action = 4; - this->actionDelay = 0x3c; - this->field_0xf = 0; + this->timer = 0x3c; + this->subtimer = 0; this->field_0x82.HALF.HI = 0x41; this->flags2 &= 0xfc; this->field_0x80.HALF.LO = gPlayerEntity.spritePriority.b1; @@ -124,7 +124,7 @@ void sub_08029474(Entity* this) { sub_080296C8(this); if (this->frame & ANIM_DONE) { this->action = 3; - this->actionDelay = 8; + this->timer = 8; bVar1 = GetFacingDirection(this, &gPlayerEntity); this->direction = bVar1; this->animationState = (bVar1 << 0x18) >> 0x1c; @@ -140,8 +140,8 @@ void sub_08029474(Entity* this) { void sub_080294D4(Entity* this) { if (sub_08049FDC(this, 1) != 0) { - if (--this->actionDelay == 0) { - this->actionDelay = 8; + if (--this->timer == 0) { + this->timer = 8; sub_08004596(this, GetFacingDirection(this, &gPlayerEntity)); sub_0802969C(this); } @@ -161,12 +161,12 @@ void sub_0802953C(Entity* this) { sub_080296C8(this); sub_080296C8(this); if (sub_0807953C() != 0) { - this->field_0xf++; + this->subtimer++; } - if (this->actionDelay != 0) { - this->actionDelay--; + if (this->timer != 0) { + this->timer--; } - if (((this->field_0xf > 0x2d) || (gSave.stats.rupees == 0)) && (this->actionDelay == 0)) { + if (((this->subtimer > 0x2d) || (gSave.stats.rupees == 0)) && (this->timer == 0)) { sub_080296D8(this); } else { ResetPlayerItem(); @@ -187,9 +187,9 @@ void sub_0802953C(Entity* this) { } void sub_08029610(Entity* this) { - if (--this->field_0xf == 0) { + if (--this->subtimer == 0) { this->action = 3; - this->actionDelay = 1; + this->timer = 1; } sub_080296C8(this); } @@ -248,7 +248,7 @@ void sub_080296D8(Entity* this) { gPlayerEntity.spriteOffsetY = 0; gPlayerEntity.speed = 0x140; this->action = 5; - this->field_0xf = 0x3c; + this->subtimer = 0x3c; this->flags2 |= 3; if ((s8)this->iframes == 0) { this->iframes = 0xf4; @@ -276,7 +276,7 @@ void sub_08029770(Entity* this) { void sub_080297F0(Entity* this) { u32 temp; this->action = 1; - this->actionDelay = 0x78; + this->timer = 0x78; COLLISION_ON(this); this->spriteSettings.draw = TRUE; this->hitType = 0x8e; diff --git a/src/enemy/scissorsBeetle.c b/src/enemy/scissorsBeetle.c index 66914591..b4be1979 100644 --- a/src/enemy/scissorsBeetle.c +++ b/src/enemy/scissorsBeetle.c @@ -40,7 +40,7 @@ void ScissorsBeetle_OnCollision(ScissorsBeetleEntity* this) { } EnemyFunctionHandlerAfterCollision(super, ScissorsBeetle_Functions); - if ((super->bitfield & 0x80) && super->action != 4) { + if ((super->contactFlags & 0x80) && super->action != 4) { u32 knockbackDir; child = super->child; child->iframes = super->iframes; @@ -88,13 +88,13 @@ void sub_080389E8(ScissorsBeetleEntity* this) { if (--this->unk_80 == 0) { super->speed = 0x80; } - } else if (--super->field_0xf == 0) { + } else if (--super->subtimer == 0) { sub_08038BA8(this); sub_08038C2C((ScissorsBeetleEntity*)child); - } else if (super->actionDelay) { - super->actionDelay--; + } else if (super->timer) { + super->timer--; } else if (super->collisions != COL_NONE) { - super->actionDelay = 0xc; + super->timer = 0xc; if ((child->animationState & 1) == 0) { child->animationState += Random() & 0x20 ? 1 : 7; child->animationState &= 7; @@ -113,18 +113,18 @@ void sub_08038A70(ScissorsBeetleEntity* this) { super->action = 3; this->unk_82 = 4; super->speed = 0x80; - super->field_0xf = 0x20; + super->subtimer = 0x20; child->action = 3; ((ScissorsBeetleEntity*)child)->unk_82 = 2; child->animationState = 0xff; sub_08038C84(this, 0); sub_08038C2C((ScissorsBeetleEntity*)child); - child->field_0xf = 0x20; + child->subtimer = 0x20; child->parent = NULL; child->child = super; - } else if (--super->field_0xf == 0) { + } else if (--super->subtimer == 0) { u32 dir; - super->field_0xf = 0x10; + super->subtimer = 0x10; super->direction = sub_08049F84(super, 0); dir = (super->direction + 4) & 0x1c; child->animationState = dir >> 2; @@ -137,8 +137,8 @@ void sub_08038A70(ScissorsBeetleEntity* this) { } void sub_08038B08(ScissorsBeetleEntity* this) { - if (super->field_0xf) { - super->field_0xf--; + if (super->subtimer) { + super->subtimer--; return; } @@ -146,8 +146,8 @@ void sub_08038B08(ScissorsBeetleEntity* this) { if (super->frame & ANIM_DONE) { super->action = 4; this->unk_82 = 3; - super->actionDelay = 0x32; - super->field_0xf = 2; + super->timer = 0x32; + super->subtimer = 2; super->direction = ((super->animationState << 2) + 0x10) & 0x1f; super->speed = 0x80; sub_08038C84(this, 0); @@ -158,8 +158,8 @@ void sub_08038B08(ScissorsBeetleEntity* this) { void sub_08038B64(ScissorsBeetleEntity* this) { ProcessMovement0(super); UpdateAnimationSingleFrame(super); - if (--super->field_0xf == 0) { - super->field_0xf = 2; + if (--super->subtimer == 0) { + super->subtimer = 2; super->direction = DirectionNormalize(super->direction + 0x1f); } } @@ -174,7 +174,7 @@ void sub_08038BA8(ScissorsBeetleEntity* this) { Entity* child; u32 r3; u32 animationState; - super->field_0xf = gUnk_080CF62C[Random() & 7]; + super->subtimer = gUnk_080CF62C[Random() & 7]; this->unk_82 = 1; ((ScissorsBeetleEntity*)super->child)->unk_82 = 0; @@ -207,7 +207,7 @@ void sub_08038BA8(ScissorsBeetleEntity* this) { void sub_08038C2C(ScissorsBeetleEntity* this) { u32 parentAnimState; - super->field_0xf = gUnk_080CF634[Random() & 7]; + super->subtimer = gUnk_080CF634[Random() & 7]; parentAnimState = super->parent->animationState; if (super->animationState == 0xff) { super->animationState = parentAnimState; diff --git a/src/enemy/slime.c b/src/enemy/slime.c index ddae5cb9..70f43914 100644 --- a/src/enemy/slime.c +++ b/src/enemy/slime.c @@ -55,17 +55,17 @@ void sub_08044FC8(Entity* this) { void sub_08044FF8(Entity* this) { this->action = 2; - this->actionDelay = (Random() & 31) + 30; + this->timer = (Random() & 31) + 30; this->cutsceneBeh.HALF.LO = this->health; } void sub_08045018(Entity* this) { GetNextFrame(this); - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 3; - this->actionDelay = 1; + this->timer = 1; if (0 < this->speed) { - this->actionDelay = FixedDiv(4096, this->speed) >> 8; + this->timer = FixedDiv(4096, this->speed) >> 8; } if (sub_08049FA0(this) == 0 && (Random() & 3)) { this->direction = (sub_08049EE4(this) + 0xfc + (Random() & 8)) & 24; @@ -78,7 +78,7 @@ void sub_08045018(Entity* this) { void sub_08045088(Entity* this) { ProcessMovement0(this); GetNextFrame(this); - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 1; } } diff --git a/src/enemy/sluggula.c b/src/enemy/sluggula.c index 759a3c5c..5dc003ef 100644 --- a/src/enemy/sluggula.c +++ b/src/enemy/sluggula.c @@ -65,7 +65,7 @@ void Sluggula_OnGrabbed(Entity* this) { void sub_08023C5C(Entity* this) { sub_0804A720(this); this->action = 1; - this->actionDelay = (Random() & 0x30) + 0xb4; + this->timer = (Random() & 0x30) + 0xb4; this->direction = DirectionRound(Random()); this->animationState = this->direction >> 3; InitializeAnimation(this, this->animationState); @@ -75,11 +75,11 @@ void sub_08023C8C(Entity* this) { ProcessMovement0(this); GetNextFrame(this); sub_08023E54(this); - if (--this->actionDelay == 0) { + if (--this->timer == 0) { if (this->frame != 1) { - this->actionDelay = 8; + this->timer = 8; } else { - this->actionDelay = (Random() & 0x30) + 0xb4; + this->timer = (Random() & 0x30) + 0xb4; sub_08023E9C(this); this->animationState = this->direction >> 3; InitializeAnimation(this, this->animationState); @@ -93,8 +93,8 @@ void sub_08023CE0(Entity* this) { sub_0804A720(this); if (this->type2 == 1) { this->action = 2; - if (this->actionDelay == 0) { - this->actionDelay = 1; + if (this->timer == 0) { + this->timer = 1; } this->spriteSettings.draw = 3; } else { @@ -108,15 +108,15 @@ void sub_08023CE0(Entity* this) { case 1: if (PlayerInRange(this, 1, 0x20)) { this->action = 2; - if (this->actionDelay == 0) { - this->actionDelay = 8; + if (this->timer == 0) { + this->timer = 8; } this->spriteSettings.draw = 3; } break; case 2: - if (this->actionDelay != 0) { - if (--this->actionDelay == 0) { + if (this->timer != 0) { + if (--this->timer == 0) { EnqueueSFX(SFX_12D); InitializeAnimation(this, 4); } @@ -160,8 +160,8 @@ void sub_08023E10(Entity* this) { void sub_08023E54(Entity* this) { Entity* ent; - if (this->field_0xf++ > 27) { - this->field_0xf = 0; + if (this->subtimer++ > 27) { + this->subtimer = 0; ent = CreateEnemy(SLUGGULA, 2); if (ent != NULL) { const s8* ptr = &gUnk_080CBDF7[this->animationState * 2]; diff --git a/src/enemy/smallPesto.c b/src/enemy/smallPesto.c index 1bb11fcd..a5d7b38f 100644 --- a/src/enemy/smallPesto.c +++ b/src/enemy/smallPesto.c @@ -41,7 +41,7 @@ void SmallPesto_OnGrabbed(Entity* this) { this->subAction = 0; COLLISION_ON(this); this->speed = 0x40; - this->field_0xf = 1; + this->subtimer = 1; } else { gUnk_080CE554[this->subAction](this); } @@ -49,7 +49,7 @@ void SmallPesto_OnGrabbed(Entity* this) { void sub_080316DC(Entity* this) { this->subAction = 1; - this->field_0x1d = 0x3c; + this->gustJarTolerance = 0x3c; } void sub_080316E8(Entity* this) { @@ -69,9 +69,9 @@ void sub_08031704(Entity* this) { void sub_08031714(Entity* this) { sub_080317B4(this); - if (--this->field_0xf == 0) { - this->field_0xf = (Random() & 0xf) + 0x10; - if (sub_08049FA0(this) == 0 && (this->field_0xf & 1) != 0) { + if (--this->subtimer == 0) { + this->subtimer = (Random() & 0xf) + 0x10; + if (sub_08049FA0(this) == 0 && (this->subtimer & 1) != 0) { this->direction = sub_08049EE4(this); } else { this->direction += 0x18; @@ -111,13 +111,13 @@ void sub_080317F8(Entity* this) { this->action = 1; this->z.HALF.HI = 0x0000FFF4; this->collisionLayer = 1; - this->field_0x3c |= 0x10; - this->field_0x1c = 1; + this->collisionFlags |= 0x10; + this->gustJarFlags = 1; this->direction = newDirection; this->hitbox = &gUnk_080CE560; sub_080317E0(this); - this->actionDelay = 0; - this->field_0xf = 0x20; + this->timer = 0; + this->subtimer = 0x20; } void sub_08031840(Entity* this) { diff --git a/src/enemy/spark.c b/src/enemy/spark.c index 32cb9345..6326654d 100644 --- a/src/enemy/spark.c +++ b/src/enemy/spark.c @@ -24,8 +24,8 @@ void Spark_OnTick(Entity* this) { void Spark_OnCollision(Entity* this) { Entity* ent; - if (this->bitfield & 0x80) { - if ((this->bitfield & 0x7f) == 0x14) { + if (this->contactFlags & 0x80) { + if ((this->contactFlags & 0x7f) == 0x14) { COLLISION_OFF(this); this->iframes = 0; this->spriteSettings.draw = 0; @@ -33,7 +33,7 @@ void Spark_OnCollision(Entity* this) { ent = CreateFx(this, FX_DEATH, 0); if (ent != NULL) { this->child = ent; - this->actionDelay = 14; + this->timer = 14; CopyPosition(this, ent); } } @@ -47,7 +47,7 @@ void sub_0802B33C(Entity* this) { sub_0804A720(this); this->action = 1; this->direction = this->type2; - this->field_0xf = 0x78; + this->subtimer = 0x78; InitializeAnimation(this, 0); } @@ -58,14 +58,14 @@ void sub_0802B35C(Entity* this) { ProcessMovement0(this); is_head = this->type == 0; if (this->collisions == COL_NONE) { - if (--this->field_0xf == 0) { - this->field_0xf = 0x78; + if (--this->subtimer == 0) { + this->subtimer = 0x78; this->direction += is_head ? 0x08 : 0x18; this->direction = DirectionRound(this->direction); } } else { - this->field_0xf = 0x78; + this->subtimer = 0x78; switch (DirectionRound(this->direction)) { case DirectionNorth: if ((this->collisions & COL_NORTH_ANY) != COL_NONE) { @@ -120,7 +120,7 @@ void sub_0802B35C(Entity* this) { } void sub_0802B4A8(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { Entity* ent = CreateObjectWithParent(this, GROUND_ITEM, 0x60, 0); if (ent != NULL) { ent->y.HALF.HI -= 4; diff --git a/src/enemy/spearMoblin.c b/src/enemy/spearMoblin.c index a824b803..1c4a1971 100644 --- a/src/enemy/spearMoblin.c +++ b/src/enemy/spearMoblin.c @@ -46,11 +46,11 @@ void SpearMoblin_OnCollision(Entity* this) { Create0x68FX(this, FX_STARS); EnemyFunctionHandlerAfterCollision(this, SpearMoblin_Functions); - if (this->bitfield & 0x80) { + if (this->contactFlags & 0x80) { if (this->action != 4) { sub_08028754(this); } else { - if ((this->bitfield & 0x3f) == 0) { + if ((this->contactFlags & 0x3f) == 0) { this->field_0x7a.HALF.LO++; this->field_0x80.HALF.HI = 0x16; sub_08028784(this); @@ -85,9 +85,9 @@ void sub_08028314(Entity* this) { this->field_0x7a.HALF.LO = 0; this->field_0x82.HALF.LO = 1; - if (this->actionDelay) { + if (this->timer) { this->animationState = this->type2 << 1; - this->actionDelay = 0x1e; + this->timer = 0x1e; this->speed = 0x80; this->direction = this->animationState << 2; sub_080287E0(this); @@ -108,7 +108,7 @@ void sub_08028378(Entity* this) { this->field_0x80.HALF.HI--; } - if (--this->actionDelay == 0) { + if (--this->timer == 0) { if (++this->field_0x80.HALF.LO >= 0x10) { sub_08028728(this); } else { @@ -126,19 +126,19 @@ void sub_08028378(Entity* this) { } } - if (this->field_0xf >= 0xc) { + if (this->subtimer >= 0xc) { if (this->field_0x7a.HALF.HI != 0) { sub_08028754(this); } } else { - this->field_0xf++; + this->subtimer++; } sub_08028858(this); } void sub_08028420(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 3; this->field_0x82.HALF.LO = 0; this->field_0x80.HALF.LO = 0; @@ -150,19 +150,19 @@ void sub_08028420(Entity* this) { } } - if (this->field_0xf >= 0xc) { + if (this->subtimer >= 0xc) { if (this->field_0x7a.HALF.HI != 0) { sub_08028754(this); } } else { - this->field_0xf++; + this->subtimer++; } sub_08028858(this); } void sub_08028488(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { switch (this->field_0x82.HALF.LO) { case 3: this->action = 4; @@ -173,7 +173,7 @@ void sub_08028488(Entity* this) { case 2: this->action = 2; this->speed = 0; - this->actionDelay = (Random() & 7) * 3 + 0x40; + this->timer = (Random() & 7) * 3 + 0x40; break; case 4: this->direction = (this->direction + 0x10) & 0x18; @@ -183,11 +183,11 @@ void sub_08028488(Entity* this) { this->action = 1; this->field_0x82.HALF.LO = 1; this->speed = 0x80; - this->actionDelay = (Random() & 7) * 3 + 0x22; + this->timer = (Random() & 7) * 3 + 0x22; break; } - this->field_0xf = 0; + this->subtimer = 0; this->animationState = DirectionRoundUp(this->direction) >> 2; sub_080287E0(this); } @@ -200,7 +200,7 @@ void sub_08028528(Entity* this) { const Hitbox* box; if (ent == NULL) { - this->field_0xf = 0; + this->subtimer = 0; sub_08028728(this); } else { sub_080288C0(this); @@ -215,16 +215,16 @@ void sub_08028528(Entity* this) { this->field_0x80.HALF.HI = 0x16; sub_08028784(this); } else { - if (++this->actionDelay == 0x20) { + if (++this->timer == 0x20) { u32 direction; - this->actionDelay = 0; + this->timer = 0; direction = GetFacingDirection(this, ent); if (sub_08028828(this->direction, direction)) { this->direction = direction; } } - if ((this->actionDelay & 7) == 0) { + if ((this->timer & 7) == 0) { EnqueueSFX(SFX_F0); CreateFx(this, FX_DEATH, 0x40); } @@ -243,9 +243,9 @@ void sub_08028528(Entity* this) { } NONMATCH("asm/non_matching/spearMoblin/sub_08028604.inc", void sub_08028604(Entity* this)) { - this->field_0xf = 0; + this->subtimer = 0; if (this->field_0x82.HALF.LO == 1) { - this->actionDelay = gUnk_080CC7BC[Random() & 3]; + this->timer = gUnk_080CC7BC[Random() & 3]; this->speed = 0x80; if (sub_08049FA0(this) != 0) { this->direction = gUnk_080CC7D0[Random() & 7] + 0x18 + (this->direction & 0x18); @@ -256,13 +256,13 @@ NONMATCH("asm/non_matching/spearMoblin/sub_08028604.inc", void sub_08028604(Enti uVar1 = gUnk_080CC7C0[Random() & 0xf]; } else { uVar1 = gUnk_080CC7C0[Random() & 7]; - this->actionDelay = this->actionDelay + 0x10; + this->timer = this->timer + 0x10; this->field_0x82.HALF.HI--; } this->direction = iVar3 + uVar1 + (4U & 0x18); } } else { - this->actionDelay = 0xc; + this->timer = 0xc; this->speed = 0; } @@ -310,14 +310,14 @@ void sub_08028784(Entity* this) { this->direction = this->animationState << 2; this->field_0x82.HALF.HI = 0; sub_080287B4(this); - this->actionDelay <<= 1; + this->timer <<= 1; this->field_0x82.HALF.LO = 4; } void sub_080287B4(Entity* this) { this->action = 3; - this->actionDelay = 0x20; - this->field_0xf = 0; + this->timer = 0x20; + this->subtimer = 0; this->field_0x80.HALF.LO = 0; this->field_0x7a.HALF.HI = 0; this->speed = 0; @@ -380,7 +380,7 @@ bool32 sub_080288A4(Entity* this) { void sub_080288C0(Entity* this) { Entity* ent = this->child; - if ((ent != NULL) && (ent->bitfield & 0x80)) { + if ((ent != NULL) && (ent->contactFlags & 0x80)) { this->knockbackDirection = ent->knockbackDirection; this->iframes = -ent->iframes; this->knockbackSpeed = ent->knockbackSpeed; diff --git a/src/enemy/spikedBeetle.c b/src/enemy/spikedBeetle.c index e0dedef5..d4c1fb77 100644 --- a/src/enemy/spikedBeetle.c +++ b/src/enemy/spikedBeetle.c @@ -31,7 +31,7 @@ void SpikedBeetle_OnTick(Entity* this) { } void SpikedBeetle_OnCollision(Entity* this) { - switch (this->bitfield & 0x7f) { + switch (this->contactFlags & 0x7f) { case 0: case 4: case 5: @@ -42,7 +42,7 @@ void SpikedBeetle_OnCollision(Entity* this) { case 0xb: case 0xc: if (this->action == 4) { - this->actionDelay = 1; + this->timer = 1; } break; case 2: @@ -75,7 +75,7 @@ void SpikedBeetle_OnGrabbed(Entity* this) { void sub_0802B72C(Entity* this) { sub_0804A720(this); - this->actionDelay = 1; + this->timer = 1; this->animationState = 0xff; sub_0802B7A4(this); } @@ -86,25 +86,25 @@ void sub_0802B744(Entity* this) { GetNextFrame(this); if (sub_08049FDC(this, 1) && (direction = sub_0804A024(this, 1, 0xc), direction != 0xff)) { this->action = 3; - this->actionDelay = 0x1e; + this->timer = 0x1e; this->direction = DirectionRound(direction); InitializeAnimation(this, 8); } else { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 2; - this->actionDelay = 0x1e; + this->timer = 0x1e; } else { if (!ProcessMovement0(this)) { - this->actionDelay = 1; + this->timer = 1; } } } } void sub_0802B7A4(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 1; - this->actionDelay = gUnk_080CD314[Random() & 3]; + this->timer = gUnk_080CD314[Random() & 3]; this->speed = 0x60; sub_0802B960(this); if (this->direction != 0xff) { @@ -119,22 +119,22 @@ void sub_0802B7A4(Entity* this) { void sub_0802B7FC(Entity* this) { GetNextFrame(this); - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 4; - this->actionDelay = 0x78; + this->timer = 0x78; this->speed = 0x1c0; } } void sub_0802B820(Entity* this) { if (!ProcessMovement2(this)) { - this->actionDelay = 1; + this->timer = 1; } GetNextFrame(this); - if (--this->actionDelay == 0) { + if (--this->timer == 0) { sub_0802B9B4(this); } else if (sub_08049FDC(this, 1)) { - if ((this->actionDelay & 0xf) == 0) { + if ((this->timer & 0xf) == 0) { sub_08004596(this, GetFacingDirection(this, gUnk_020000B0)); } } else { @@ -143,9 +143,9 @@ void sub_0802B820(Entity* this) { } void sub_0802B880(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 2; - this->actionDelay = 0x3c; + this->timer = 0x3c; this->animationState = DirectionToAnimationState(this->direction); InitializeAnimation(this, this->animationState); } @@ -156,7 +156,7 @@ void sub_0802B8B0(Entity* this) { switch (sub_080044EC(this, 0x1800)) { case 0: this->action = 7; - this->actionDelay = 0x96; + this->timer = 0x96; /* fallthrough */ case 1: EnqueueSFX(SFX_12B); @@ -165,9 +165,9 @@ void sub_0802B8B0(Entity* this) { } void sub_0802B8E0(Entity* this) { - if (--this->actionDelay) { - if (this->actionDelay < 0x3c && (this->actionDelay & 1)) { - this->spriteOffsetX += gUnk_080CD318[(this->actionDelay >> 1) & 3]; + if (--this->timer) { + if (this->timer < 0x3c && (this->timer & 1)) { + this->spriteOffsetX += gUnk_080CD318[(this->timer >> 1) & 3]; } } else { this->action = 8; @@ -182,7 +182,7 @@ void sub_0802B8E0(Entity* this) { void sub_0802B948(Entity* this) { if (!GravityUpdate(this, 0x1800)) { this->action = 1; - this->actionDelay = 1; + this->timer = 1; } } @@ -204,7 +204,7 @@ void sub_0802B960(Entity* this) { void sub_0802B9B4(Entity* this) { this->action = 5; - this->actionDelay = 0x3c; + this->timer = 0x3c; this->animationState = (this->direction >> 3) & 3; InitializeAnimation(this, this->animationState + 4); } diff --git a/src/enemy/spinyBeetle.c b/src/enemy/spinyBeetle.c index cbdfe52e..d1a3e8ca 100644 --- a/src/enemy/spinyBeetle.c +++ b/src/enemy/spinyBeetle.c @@ -44,15 +44,15 @@ void SpinyBeetle_OnCollision(SpinyBeetleEntity* this) { } EnemyFunctionHandlerAfterCollision(super, SpinyBeetle_Functions); - if (super->bitfield & 0x80) { + if (super->contactFlags & 0x80) { if (super->iframes > 0 && super->child) { sub_08033E1C(this); } - if ((super->bitfield & 0x3f) == 0x14 && super->action != 5) { + if ((super->contactFlags & 0x3f) == 0x14 && super->action != 5) { super->action = 3; - super->actionDelay = 0x5a; - super->field_0xf = 0x10; + super->timer = 0x5a; + super->subtimer = 0x10; super->spritePriority.b1 = 1; super->direction = DirectionRoundUp(sub_08049F84(super, 1)); sub_08033D78(this); @@ -77,8 +77,8 @@ void SpinyBeetle_OnConfused(SpinyBeetleEntity* this) { void SpinyBeetle_Init(SpinyBeetleEntity* this) { Entity* obj; super->action = 1; - super->actionDelay = 0; - super->field_0xf = 0; + super->timer = 0; + super->subtimer = 0; this->unk_7c = (super->x.WORD & 0xfff00000) | 0x80000; this->unk_80 = (super->y.WORD & 0xfff00000) | 0x80000; super->x.WORD = this->unk_7c; @@ -175,8 +175,8 @@ void sub_08033A7C(SpinyBeetleEntity* this) { return; super->action = 3; - super->actionDelay = 0x78; - super->field_0xf = 0x20; + super->timer = 0x78; + super->subtimer = 0x20; super->spritePriority.b1 = 1; InitializeAnimation(super, 3); } @@ -190,14 +190,14 @@ void sub_08033ACC(SpinyBeetleEntity* this) { GetNextFrame(super); GetNextFrame(super); - if (super->field_0xf) { - super->field_0xf--; + if (super->subtimer) { + super->subtimer--; return; } - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = 4; - super->actionDelay = 0x78; + super->timer = 0x78; super->x.WORD = (super->x.WORD & 0xfff00000) | 0x80000; super->y.WORD = (super->y.WORD & 0xfff00000) | 0xC0000; this->unk_7c = super->x.WORD; @@ -216,7 +216,7 @@ void sub_08033B44(SpinyBeetleEntity* this) { } GetNextFrame(super); - if (--super->actionDelay) + if (--super->timer) return; super->action = 1; @@ -267,10 +267,10 @@ void sub_08033C94(SpinyBeetleEntity* this) { super->spriteSettings.draw = 1; } case 1: - if (--super->actionDelay) + if (--super->timer) return; this->unk_79 = 2; - super->actionDelay = 0x78; + super->timer = 0x78; super->spriteOffsetY = 0; super->direction = sub_08049F84(super, 1) + 0x14; @@ -286,15 +286,15 @@ void sub_08033C94(SpinyBeetleEntity* this) { super->direction &= 0x18; break; case 2: - if (super->field_0xf != 0) { - super->field_0xf--; + if (super->subtimer != 0) { + super->subtimer--; } else { sub_08033D78(this); } - if (--super->actionDelay) + if (--super->timer) return; - super->actionDelay = (Random() & 0x1f) + 0x20; + super->timer = (Random() & 0x1f) + 0x20; super->direction = sub_08049F84(super, 1) + 0x14; switch (Random() & 3) { case 1: @@ -361,8 +361,8 @@ void sub_08033E1C(SpinyBeetleEntity* this) { super->y.WORD = (super->y.WORD & 0xfff00000) | 0xC0000; super->hitType = 0x19; super->spritePriority.b1 = 1; - super->actionDelay = 0x30; - super->field_0xf = 0; + super->timer = 0x30; + super->subtimer = 0; super->speed = 0x100; super->child = NULL; InitializeAnimation(super, 3); diff --git a/src/enemy/spinyChuchu.c b/src/enemy/spinyChuchu.c index 7499234b..9cb2653d 100644 --- a/src/enemy/spinyChuchu.c +++ b/src/enemy/spinyChuchu.c @@ -31,11 +31,11 @@ void SpinyChuchu_OnTick(Entity* this) { void SpinyChuchu_OnCollision(Entity* this) { if (this->health) { if (this->hitType == 0x65) { - switch (this->bitfield & 0x7f) { + switch (this->contactFlags & 0x7f) { case 2: case 3: this->action = 2; - this->field_0xf = 0x3c; + this->subtimer = 0x3c; this->hitType = 0x5c; this->hitbox = (Hitbox*)&gHitbox_23; InitializeAnimation(this, 0); @@ -54,7 +54,7 @@ void SpinyChuchu_OnCollision(Entity* this) { this->hitType = 0x5c; InitializeAnimation(this, 1); } - } else if (this->bitfield == 0x94) { + } else if (this->contactFlags == 0x94) { Create0x68FX(this, FX_STARS); this->action = 5; InitializeAnimation(this, 1); @@ -101,12 +101,12 @@ void sub_080225EC(Entity* this) { sub_0804A720(this); this->field_0x80.HALF.LO = this->health; this->field_0x80.HALF.HI = 0x5a; - if (this->actionDelay == 0) { + if (this->timer == 0) { this->action = 2; InitializeAnimation(this, 0); } else { this->action = 1; - this->field_0xf = 0x3c; + this->subtimer = 0x3c; this->spriteSettings.draw = 3; this->spriteRendering.b3 = 1; this->spriteOrientation.flipY = 1; @@ -118,7 +118,7 @@ void sub_080225EC(Entity* this) { void sub_08022654(Entity* this) { switch (this->subAction) { case 0: - if (--this->field_0xf) + if (--this->subtimer) return; this->subAction = 1; SoundReq(SFX_12D); @@ -136,7 +136,7 @@ void sub_08022654(Entity* this) { /* fallthrough */ case 2: GetNextFrame(this); - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 3; this->hitType = 0x65; InitializeAnimation(this, 2); @@ -164,7 +164,7 @@ void sub_080226EC(Entity* this) { return; } - if ((this->actionDelay++ & 7) == 0) { + if ((this->timer++ & 7) == 0) { this->direction = sub_08049F84(this, 1); } @@ -198,7 +198,7 @@ void sub_080227AC(Entity* this) { if (this->frame & ANIM_DONE) { this->action = 2; - this->field_0xf = gUnk_080CBA60[Random() & 3]; + this->subtimer = gUnk_080CBA60[Random() & 3]; InitializeAnimation(this, 0); } } @@ -238,11 +238,11 @@ void sub_0802289C(Entity* this) { } u32 sub_080228CC(Entity* this) { - if (this->field_0xf == 0) { + if (this->subtimer == 0) { if (PlayerInRange(this, 1, 0x28)) return 1; } else { - this->field_0xf--; + this->subtimer--; } return 0; } diff --git a/src/enemy/stalfos.c b/src/enemy/stalfos.c index 31086dc1..a8209b1f 100644 --- a/src/enemy/stalfos.c +++ b/src/enemy/stalfos.c @@ -75,8 +75,8 @@ void Stalfos_OnTick(StalfosEntity* this) { NONMATCH("asm/non_matching/stalfos/sub_0803933C.inc", void sub_0803933C(StalfosEntity* this)) { if (super->hitType == 0x44) { - if ((super->bitfield & 0x7f) < 7) { - if ((super->bitfield & 0x7f) > 3) { + if ((super->contactFlags & 0x7f) < 7) { + if ((super->contactFlags & 0x7f) > 3) { if (super->iframes < 1) { super->action = 4; super->direction = super->knockbackDirection; @@ -87,7 +87,7 @@ NONMATCH("asm/non_matching/stalfos/sub_0803933C.inc", void sub_0803933C(StalfosE } } } - if (super->bitfield == 0x9d) { + if (super->contactFlags == 0x9d) { if (super->child == NULL) { if (super->action < 9) { Entity* projectile = CreateProjectileWithParent(super, STALFOS_PROJECTILE, 1); @@ -100,7 +100,7 @@ NONMATCH("asm/non_matching/stalfos/sub_0803933C.inc", void sub_0803933C(StalfosE this->unk_78 += 0x5a; } } else { - super->child->bitfield = 0x9d; + super->child->contactFlags = 0x9d; EnqueueSFX(SFX_186); super->child = NULL; sub_08039A48(this); @@ -131,7 +131,7 @@ void sub_08039438(StalfosEntity* this) { void Stalfos_SubAction0(StalfosEntity* this) { super->subAction = 1; - super->field_0x1d = 0x5a; + super->gustJarTolerance = 0x5a; } void Stalfos_SubAction1(StalfosEntity* this) { @@ -150,7 +150,7 @@ void Stalfos_SubAction2(StalfosEntity* this) { COLLISION_ON(projectile); } super->child = NULL; - super->field_0x3a &= 0xfb; + super->gustJarState &= 0xfb; super->flags2 &= 0xfb; sub_08039A48(this); this->unk_78 += 0x5a; @@ -176,13 +176,13 @@ void Stalfos_Init(StalfosEntity* this) { void Stalfos_Action1(StalfosEntity* this) { if (GravityUpdate(super, 0x1800) == 0 && sub_08039758(this) == 0 && --this->unk_78 == 0) { super->action = 2; - super->actionDelay = 0xa; + super->timer = 0xa; sub_08039858(this); } } void Stalfos_Action2(StalfosEntity* this) { - if (sub_08039758(this) == 0 && --super->actionDelay == 0) { + if (sub_08039758(this) == 0 && --super->timer == 0) { sub_0803992C(this); } } @@ -215,20 +215,20 @@ void Stalfos_Action5(StalfosEntity* this) { GravityUpdate(super, 0x1800); if (super->zVelocity < 0) { super->action = 6; - super->actionDelay = 0x0f; + super->timer = 0x0f; } } void Stalfos_Action6(StalfosEntity* this) { u16 tmp; - if (super->actionDelay != 0) { - super->actionDelay--; + if (super->timer != 0) { + super->timer--; } else { tmp = super->z.HALF.HI += 4; if (-1 < (tmp * 0x10000)) { super->action = 7; - super->actionDelay = 0xa; + super->timer = 0xa; super->z.HALF.HI = 0; this->unk_7a = 0x78; this->unk_7c = 0x3c; @@ -239,17 +239,17 @@ void Stalfos_Action6(StalfosEntity* this) { } void Stalfos_Action7(StalfosEntity* this) { - if (--super->actionDelay == 0) { + if (--super->timer == 0) { sub_0803998C(this); } } void Stalfos_Action8(StalfosEntity* this) { UpdateAnimationSingleFrame(super); - if (--super->actionDelay == 0) { + if (--super->timer == 0) { sub_08039A00(this, 0x3c); sub_0803998C(this); - } else if ((super->actionDelay & 0x1f) == 0) { + } else if ((super->timer & 0x1f) == 0) { sub_08039A20(this); } } @@ -303,7 +303,7 @@ bool32 sub_08039758(StalfosEntity* this) { } else { if (EntityWithinDistance(super, gUnk_020000B0->x.HALF.HI, gUnk_020000B0->y.HALF.HI, 0x48)) { super->action = 8; - super->actionDelay = 0x3c; + super->timer = 0x3c; super->direction = GetFacingDirection(super, gUnk_020000B0); InitAnimationForceUpdate(super, super->animationState + 0xc); return TRUE; diff --git a/src/enemy/takkuri.c b/src/enemy/takkuri.c index 64c61158..41de753b 100644 --- a/src/enemy/takkuri.c +++ b/src/enemy/takkuri.c @@ -41,8 +41,8 @@ void Takkuri_OnTick(TakkuriEntity* this) { } void Takkuri_OnCollision(TakkuriEntity* this) { - if (super->bitfield & 0x80) { - if ((super->bitfield & 0x7f) == 0) { + if (super->contactFlags & 0x80) { + if ((super->contactFlags & 0x7f) == 0) { u32 direction; sub_0803C0AC(super); COLLISION_OFF(super); @@ -78,7 +78,7 @@ void Takkuri_OnGrabbed(TakkuriEntity* this) { super->action = 2; super->subAction = 0; this->unk_0x84 = 2; - super->actionDelay = 8; + super->timer = 8; super->speed = 0x1c0; sub_0803BF2C(this); } @@ -86,7 +86,7 @@ void Takkuri_OnGrabbed(TakkuriEntity* this) { void sub_0803BC7C(TakkuriEntity* this) { super->subAction = 1; - super->field_0x1d = 0x3c; + super->gustJarTolerance = 0x3c; } void sub_0803BC88(TakkuriEntity* this) { @@ -103,12 +103,12 @@ void sub_0803BCA4(TakkuriEntity* this) { sub_0804A720(super); super->action = 1; - super->field_0xf = 0; + super->subtimer = 0; super->direction = sub_08049F84(super, 1); this->unk_0x80 = 0; this->unk_0x81 = 0; - super->field_0x1c = 1; - super->field_0x3c |= 0x10; + super->gustJarFlags = 1; + super->collisionFlags |= 0x10; super->collisionLayer = 3; super->spriteOrientation.flipY = 1; this->x_0x78 = super->x.HALF.HI; @@ -120,9 +120,9 @@ void sub_0803BCA4(TakkuriEntity* this) { void sub_0803BD08(TakkuriEntity* this) { Entity* ent; - if (super->field_0xf) { + if (super->subtimer) { if (CheckOnScreen(super) == 0) { - super->field_0xf = 0; + super->subtimer = 0; super->spriteSettings.draw = 1; } else { return; @@ -137,7 +137,7 @@ void sub_0803BD08(TakkuriEntity* this) { if (gUnk_020000B0->y.HALF.HI > super->y.HALF.HI + 8) { super->action = 2; this->unk_0x84 = 0; - super->actionDelay = 0x10; + super->timer = 0x10; this->unk_0x81 = 2; sub_0803BF2C(this); } @@ -155,7 +155,7 @@ void sub_0803BD90(TakkuriEntity* this) { super->spriteSettings.draw = 4; COLLISION_OFF(super); super->spritePriority.b1 = 1; - super->actionDelay = 8; + super->timer = 8; } else { sub_0803BF48(this); GetNextFrame(super); @@ -163,7 +163,7 @@ void sub_0803BD90(TakkuriEntity* this) { } void sub_0803BDD8(TakkuriEntity* this) { - if (--super->actionDelay) { + if (--super->timer) { return; } @@ -183,7 +183,7 @@ void sub_0803BDD8(TakkuriEntity* this) { COLLISION_ON(super); super->action = 2; this->unk_0x84 = 1; - super->actionDelay = 0x18; + super->timer = 0x18; this->unk_0x82 = 0x12c; super->speed = 0x12c + 0x94; this->unk_0x81 = 4; @@ -199,8 +199,8 @@ void sub_0803BE7C(TakkuriEntity* this) { super->action = 1; super->spriteSettings.draw = 1; COLLISION_OFF(super); - super->actionDelay = 0x8; - super->field_0xf = 1; + super->timer = 0x8; + super->subtimer = 1; super->direction = sub_08049F84(super, 1); this->unk_0x80 = 0; super->spritePriority.b1 = 3; @@ -211,7 +211,7 @@ void sub_0803BE7C(TakkuriEntity* this) { } void sub_0803BEE8(TakkuriEntity* this) { - if (--super->actionDelay == 0) { + if (--super->timer == 0) { u32 direction; this->unk_0x80 = super->direction; direction = sub_08049F84(super, 1); @@ -219,7 +219,7 @@ void sub_0803BEE8(TakkuriEntity* this) { super->direction = direction; } - super->actionDelay = 8; + super->timer = 8; if (DirectionIsVertical(this->unk_0x80) != DirectionIsVertical(super->direction)) { sub_0803BF2C(this); } @@ -241,21 +241,21 @@ void sub_0803BF70(TakkuriEntity* this) { u32 tmp1, tmp2, tmp3; switch (this->unk_0x84) { case 0: - if (super->actionDelay & 0x1) { + if (super->timer & 0x1) { super->z.HALF.HI--; } - if (--super->actionDelay == 0) { + if (--super->timer == 0) { this->unk_0x84 = 1; - super->actionDelay = 0x18; + super->timer = 0x18; COLLISION_ON(super); this->unk_0x81 = 2; sub_0803BF2C(this); } break; case 1: - if (--super->actionDelay == 0) { + if (--super->timer == 0) { this->unk_0x84 = 2; - super->actionDelay = 8; + super->timer = 8; super->speed = 0x1c0; this->unk_0x81 = 4; sub_0803BF2C(this); @@ -265,7 +265,7 @@ void sub_0803BF70(TakkuriEntity* this) { if (--this->unk_0x82 == 0) { super->action = 3; this->unk_0x84 = 0; - super->actionDelay = 0; + super->timer = 0; super->speed = 0x180; if ((super->direction + 0x18) & 0x10) { super->direction = (0x10 - super->direction) & 0x1f; @@ -273,8 +273,8 @@ void sub_0803BF70(TakkuriEntity* this) { sub_0803BF2C(this); } else { - if (--super->actionDelay == 0) { - super->actionDelay = 8; + if (--super->timer == 0) { + super->timer = 8; this->unk_0x80 = super->direction; sub_08004596(super, sub_08049F84(super, 1)); if ((super->direction + 0x18) & 0x10) { diff --git a/src/enemy/tektite.c b/src/enemy/tektite.c index 776f08e5..da49b413 100644 --- a/src/enemy/tektite.c +++ b/src/enemy/tektite.c @@ -33,17 +33,17 @@ void Tektite_OnCollision(Entity* this) { Create0x68FX(this, FX_STARS); } EnemyFunctionHandlerAfterCollision(this, Tektite_Functions); - if ((this->bitfield & 0x80) != 0) { - switch (this->bitfield & 0x3f) { + if ((this->contactFlags & 0x80) != 0) { + switch (this->contactFlags & 0x3f) { case 0x14: this->action = 1; this->subAction = 0; if (this->type != 0) { - this->actionDelay = 0xc0; + this->timer = 0xc0; } else { - this->actionDelay = gUnk_080CDEF8[Random() & 3]; + this->timer = gUnk_080CDEF8[Random() & 3]; } - this->field_0xf = 0; + this->subtimer = 0; *(u8*)&this->field_0x7c = 0; if (this->z.HALF.HI != 0) { this->zVelocity >>= 2; @@ -77,9 +77,9 @@ void sub_0802F210(Entity* this) { sub_0804A720(this); this->action = 1; this->subAction = 0; - this->actionDelay = gUnk_080CDEF8[Random() & 3]; - this->actionDelay = (Random() & 0x1f) + this->actionDelay; - this->field_0xf = 0; + this->timer = gUnk_080CDEF8[Random() & 3]; + this->timer = (Random() & 0x1f) + this->timer; + this->subtimer = 0; *(u8*)&this->field_0x7c = 0; this->field_0x80.HWORD = this->type == 0 ? 0x1800 : 0x2800; @@ -90,24 +90,24 @@ void sub_0802F210(Entity* this) { } void sub_0802F284(Entity* this) { - if (this->actionDelay > 0x60) { + if (this->timer > 0x60) { UpdateAnimationVariableFrames(this, 2); } else { GetNextFrame(this); } - if (this->actionDelay != 0) { - this->actionDelay--; - } else if (this->field_0xf != 0) { + if (this->timer != 0) { + this->timer--; + } else if (this->subtimer != 0) { if (this->frame & ANIM_DONE) { this->action = 2; - this->actionDelay = 0x10; - this->field_0xf = this->type; + this->timer = 0x10; + this->subtimer = this->type; this->zVelocity = this->field_0x82.HWORD << 4; sub_0802F45C(this); InitializeAnimation(this, 2); } } else if (this->frame & ANIM_DONE) { - this->field_0xf = 0x40; + this->subtimer = 0x40; InitializeAnimation(this, 1); } } @@ -129,11 +129,11 @@ void sub_0802F300(Entity* this) { } if (rand == 0) { - this->actionDelay = 0xc0; + this->timer = 0xc0; } else { - this->actionDelay = gUnk_080CDEF8[rand & 3] + rand; + this->timer = gUnk_080CDEF8[rand & 3] + rand; } - this->field_0xf = 0; + this->subtimer = 0; InitializeAnimation(this, 3); return; } else if (this->collisions != COL_NONE) { @@ -142,10 +142,10 @@ void sub_0802F300(Entity* this) { this->direction = (this->direction + 0x10) & 0x1f; } - if (--this->actionDelay == 0) { - this->actionDelay = 0x10; - if (this->field_0xf != 0) { - this->field_0xf--; + if (--this->timer == 0) { + this->timer = 0x10; + if (this->subtimer != 0) { + this->subtimer--; sub_0802F45C(this); } } @@ -171,8 +171,8 @@ void sub_0802F3F4(Entity* this) { if (this->frame & ANIM_DONE) { if ((*(u8*)&this->field_0x7c.HALF.LO < 2) && ((this->type % 2) != 0)) { this->action = 2; - this->actionDelay = 0x10; - this->field_0xf = this->type; + this->timer = 0x10; + this->subtimer = this->type; this->zVelocity = this->field_0x82.HWORD << 4; (*(u8*)&this->field_0x7c.HALF.LO)++; sub_0802F45C(this); diff --git a/src/enemy/tektiteGolden.c b/src/enemy/tektiteGolden.c index f8862aa8..c77cfdaa 100644 --- a/src/enemy/tektiteGolden.c +++ b/src/enemy/tektiteGolden.c @@ -30,11 +30,11 @@ void TektiteGolden_OnCollision(Entity* this) { Create0x68FX(this, FX_STARS); } EnemyFunctionHandlerAfterCollision(this, &TektiteGolden_Functions); - if (this->bitfield == 0x94) { + if (this->contactFlags == 0x94) { this->action = 1; this->subAction = 0; - this->actionDelay = 0x14; - this->field_0xf = 0; + this->timer = 0x14; + this->subtimer = 0; this->field_0x80.HALF.LO = 0; if (this->z.HALF.HI != 0) { this->zVelocity >>= 2; @@ -49,7 +49,7 @@ void TektiteGolden_OnCollision(Entity* this) { void TektiteGolden_OnDeath(Entity* this) { u32 uVar1; - if ((this->field_0x3a & 2) == 0) { + if ((this->gustJarState & 2) == 0) { SetGlobalFlag(this->type2); } if (this->type != 0) { @@ -75,27 +75,27 @@ void sub_08037FA0(Entity* this) { sub_0804A720(this); this->action = 1; this->subAction = 0; - this->actionDelay = (Random() & 0x1f) + 0x20; - this->field_0xf = 0; + this->timer = (Random() & 0x1f) + 0x20; + this->subtimer = 0; this->field_0x80.HALF.LO = 0; InitializeAnimation(this, 0); } void sub_08037Fe0(Entity* this) { UpdateAnimationVariableFrames(this, 2); - if (this->actionDelay != 0) { - this->actionDelay--; - } else if (this->field_0xf != 0) { + if (this->timer != 0) { + this->timer--; + } else if (this->subtimer != 0) { if (this->frame & ANIM_DONE) { this->action = 2; - this->actionDelay = 6; - this->field_0xf = 0; + this->timer = 6; + this->subtimer = 0; this->zVelocity = Q_16_16(3.5); sub_08038168(this); InitializeAnimation(this, 2); } } else if (this->frame & ANIM_DONE) { - this->field_0xf = 0x40; + this->subtimer = 0x40; InitializeAnimation(this, 1); } } @@ -112,7 +112,7 @@ void sub_08038048(Entity* this) { if (sub_080044EC(this, 0x3000) == 1) { this->action = 3; this->subAction = 0; - this->actionDelay = 0x14; + this->timer = 0x14; InitializeAnimation(this, 3); return; } else if (this->collisions != COL_NONE) { @@ -121,8 +121,8 @@ void sub_08038048(Entity* this) { this->direction = (this->direction + 0x10) & 0x1f; } - if (--this->actionDelay == 0) { - this->actionDelay = rand + 0x10; + if (--this->timer == 0) { + this->timer = rand + 0x10; sub_08038168(this); } @@ -145,14 +145,14 @@ void sub_08038110(Entity* this) { if (this->frame & ANIM_DONE) { if (this->field_0x80.HALF.LO < 5) { this->action = 2; - this->actionDelay = 8; + this->timer = 8; this->zVelocity = Q_16_16(3.5); sub_08038168(this); InitializeAnimation(this, 2); } else { this->action = 1; this->field_0x80.HALF.LO = 0; - this->actionDelay = 0xc0; + this->timer = 0xc0; InitializeAnimation(this, 0); } } diff --git a/src/enemy/treeItem.c b/src/enemy/treeItem.c index 47264fdd..00005671 100644 --- a/src/enemy/treeItem.c +++ b/src/enemy/treeItem.c @@ -56,7 +56,7 @@ void TreeItem(Entity* this) { case FAIRY_INDEX: itemEntity = CreateObject(FAIRY, 0x60, 0); if (itemEntity) { - itemEntity->actionDelay = 0; + itemEntity->timer = 0; CopyPosition(this, itemEntity); } break; diff --git a/src/enemy/vaatiArm.c b/src/enemy/vaatiArm.c index d9f17946..e032cdaa 100644 --- a/src/enemy/vaatiArm.c +++ b/src/enemy/vaatiArm.c @@ -266,7 +266,7 @@ void sub_08042654(Entity* this) { if ((((VaatiArm_HeapStruct*)this->myHeap)->s1[4].unk0c += 2) < 0x1c) break; this->subAction = 5; - this->actionDelay = 0x5a; + this->timer = 0x5a; ((VaatiArm_HeapStruct*)this->myHeap)->entities[0]->flags |= ENT_COLLIDE; ((VaatiArm_HeapStruct*)this->myHeap)->entities[0]->spritePriority.b0 = 4; ((VaatiArm_HeapStruct*)this->myHeap)->entities[1]->flags |= ENT_COLLIDE; @@ -281,7 +281,7 @@ void sub_08042654(Entity* this) { SoundReq(SFX_15E); break; default: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { sub_08043BC8(this); } break; @@ -335,7 +335,7 @@ void sub_080428AC(Entity* this) { pVVar3->unk00.HWORD += pVVar3->unk08; } else { this->subAction = 2; - this->actionDelay = 0x1e; + this->timer = 0x1e; } sub_08043BF0(this); } @@ -344,7 +344,7 @@ void sub_080428FC(Entity* this) { u32 uVar2; VaatiArm_HeapStruct1* ptr; - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->subAction = 3; ptr = &((VaatiArm_HeapStruct*)this->myHeap)->s1[0]; ptr->unk08 *= -3; @@ -380,7 +380,7 @@ void sub_08042970(Entity* this) { pVVar3->unk00.HWORD += pVVar3->unk08; } else { this->subAction = 5; - this->actionDelay = 0x3c; + this->timer = 0x3c; uVar2 = 0; do { ((VaatiArm_HeapStruct*)this->myHeap)->entities[uVar2]->hitType = 0x39; @@ -394,7 +394,7 @@ void sub_080429D4(Entity* this) { s16 sVar2; VaatiArm_HeapStruct1* pVVar3; - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->subAction = 6; pVVar3 = &((VaatiArm_HeapStruct*)this->myHeap)->s1[0]; sVar2 = -this->speed / 6; @@ -448,14 +448,14 @@ void sub_08042A88(Entity* this) { pVVar4->unk04.HWORD = 0; pVVar4->unk08 = gUnk_080D12CA[this->type2]; this->subAction = 2; - this->actionDelay = 0x1e; + this->timer = 0x1e; } } void sub_08042AEC(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->subAction = 3; - this->actionDelay = 4; + this->timer = 4; this->hitType = 0x3d; InitAnimationForceUpdate(this, 0xe); ((VaatiArm_HeapStruct*)this->myHeap)->entities[1]->hitType = 0x3d; @@ -500,10 +500,10 @@ void sub_08042B20(Entity* this) { } } else { this->field_0x78.HALF.LO += 2; - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 5; this->subAction = 0; - this->actionDelay = 0x1e; + this->timer = 0x1e; this->hitType = 0x39; ((VaatiArm_HeapStruct*)this->myHeap)->entities[1]->hitType = 0x39; } @@ -525,9 +525,9 @@ void sub_08042C34(Entity* this) { VaatiArm_HeapStruct1* ptr; - if (--this->actionDelay == 0) { - this->actionDelay = 0x3c; - this->field_0xf = 3; + if (--this->timer == 0) { + this->timer = 0x3c; + this->subtimer = 3; this->subAction = 1; random = Random() & 6; temp = &gUnk_080D12F8[random]; @@ -575,7 +575,7 @@ void sub_08042C34(Entity* this) { void sub_08042D24(Entity* this) { Entity* entity; - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->subAction = 2; this->hitType = 0x3d; ((VaatiArm_HeapStruct*)this->myHeap)->entities[1]->hitType = 0x3d; @@ -612,7 +612,7 @@ void sub_08042D6C(Entity* this) { ((VaatiArm_HeapStruct*)this->myHeap)->s1[0].unk08 = gUnk_080D1300[this->type2]; ((VaatiArm_HeapStruct*)this->myHeap)->s1[0].unk0a = 0xc0; this->subAction = 3; - this->actionDelay = 0x1e; + this->timer = 0x1e; this->hitType = 0x39; this->field_0x7c.BYTES.byte3 = 0x2d; InitAnimationForceUpdate(this, 0); @@ -635,9 +635,9 @@ void sub_08042E30(Entity* this) { this->field_0x7c.BYTES.byte3--; } pVVar9 = &((VaatiArm_HeapStruct*)this->myHeap)->s1[0]; - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->subAction = 4; - this->actionDelay = (Random() & 0x38) + 0x28; + this->timer = (Random() & 0x38) + 0x28; this->speed = 0x200; this->direction = pVVar9->unk00.HALF.HI >> 3; uVar6 = CalculateDirectionTo(this->x.HALF.HI, this->y.HALF.HI, gRoomControls.origin_x + 0x110, @@ -668,10 +668,10 @@ void sub_08042EF4(Entity* this) { UpdateAnimationSingleFrame(this); if (sub_08043C98(this) == 0) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { if (EntityWithinDistance(this, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x50)) { this->subAction = 6; - this->actionDelay = 0x28; + this->timer = 0x28; } else { this->subAction = 5; InitAnimationForceUpdate(this, 0xf); @@ -714,12 +714,12 @@ void sub_08042FD8(Entity* this) { } } else { if (this->frame & ANIM_DONE) { - if (--this->field_0xf == 0) { + if (--this->subtimer == 0) { this->subAction = 8; - this->actionDelay = 0x3c; + this->timer = 0x3c; } else { this->subAction = 3; - this->actionDelay = 0x3c; + this->timer = 0x3c; InitAnimationForceUpdate(this, 0); } } @@ -743,7 +743,7 @@ void sub_08043048(Entity* this) { } } else { ptr[0].unk00.HWORD += ptr[0].unk08 * 8; - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->subAction = 7; for (i = 0; i < 5; i++) { ((VaatiArm_HeapStruct*)this->myHeap)->entities[i]->hitType = 0x39; @@ -762,12 +762,12 @@ void sub_080430D0(Entity* this) { ptr[0].unk00.HWORD += ptr[0].unk08; ptr[0].unk04.HWORD -= 0x100; if (ptr[0].unk04.HALF.HI < 0x18) { - if (--this->field_0xf == 0) { + if (--this->subtimer == 0) { this->subAction = 8; - this->actionDelay = 0x3c; + this->timer = 0x3c; } else { this->subAction = 3; - this->actionDelay = 0x3c; + this->timer = 0x3c; ptr[0].unk0a = -0xc0; InitAnimationForceUpdate(this, 0); } @@ -788,8 +788,8 @@ void sub_08043130(Entity* this) { } } } else { - if (this->actionDelay != 0) { - this->actionDelay--; + if (this->timer != 0) { + this->timer--; for (i = 1; i < 4; i++) { ptr = &((VaatiArm_HeapStruct*)this->myHeap)->s1[i]; if (ptr->unk04.HALF.HI != 0) { @@ -810,7 +810,7 @@ void sub_08043130(Entity* this) { } if (this->spriteSettings.draw == 0) { this->subAction = 9; - this->actionDelay = 0x3c; + this->timer = 0x3c; sub_0804AA1C(this); } } @@ -821,7 +821,7 @@ void sub_080431E8(Entity* this) { u32 i; VaatiArm_HeapStruct1* ptr; - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 6; this->subAction = 0; for (i = 0; i < 4; i++) { @@ -864,8 +864,8 @@ NONMATCH("asm/non_matching/vaati/sub_0804334C.inc", void sub_0804334C(Entity* th u32 i; u8* ptr; - if (this->actionDelay != 0) { - if (--this->actionDelay != 0) { + if (this->timer != 0) { + if (--this->timer != 0) { return; } for (i = 0; i < 5; i++) { @@ -958,7 +958,7 @@ void sub_08043490(Entity* this) { if (entity->z.HALF.HI < 0) { entity->flags = entity->flags | ENT_COLLIDE; entity->spriteSettings.draw = 1; - entity->field_0x3c = entity->field_0x3c & 0xef; + entity->collisionFlags = entity->collisionFlags & 0xef; entity->hitType = 0x3a; entity->hitbox = (Hitbox*)&gUnk_080FD450; entity2 = ((VaatiArm_HeapStruct*)this->myHeap)->entities[2]; @@ -1004,9 +1004,9 @@ void sub_08043580(Entity* this) { } if ((this->spriteSettings.draw & 3) == 0) { this->subAction = 5; - this->actionDelay = 0x3c; + this->timer = 0x3c; entity = ((VaatiArm_HeapStruct*)this->myHeap)->entities[4]; - entity->field_0x3c = entity->field_0x3c | 0x10; + entity->collisionFlags = entity->collisionFlags | 0x10; entity->hitType = 0x39; entity->hitbox = (Hitbox*)&gUnk_080FD538; sub_0804AA1C(this); @@ -1018,10 +1018,10 @@ void sub_080435F4(Entity* this) { u32 i; VaatiArm_HeapStruct1* ptr; - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 6; this->subAction = 1; - this->actionDelay = 1; + this->timer = 1; for (i = 0; i < 5; i++) { ptr = &((VaatiArm_HeapStruct*)this->myHeap)->s1[i]; ptr->unk00.HWORD = gUnk_080D1338[this->type2]; @@ -1047,7 +1047,7 @@ void sub_08043698(Entity* this) { u32 i; this->subAction = 1; - this->actionDelay = 0x3c; + this->timer = 0x3c; for (i = 0; i < 5; i++) { entity = ((VaatiArm_HeapStruct*)this->myHeap)->entities[i]; entity->flags = entity->flags & ~ENT_COLLIDE; @@ -1055,8 +1055,8 @@ void sub_08043698(Entity* this) { } static inline void deleteThing(Entity* this, const u32 index) { - if (--this->actionDelay == 0) { - this->actionDelay = 0x14; + if (--this->timer == 0) { + this->timer = 0x14; this->subAction = index + 1; if (index == 1) { this->spriteSettings.draw = 0; @@ -1082,7 +1082,7 @@ void sub_08043738(Entity* this) { void sub_08043770(Entity* this) { Entity* entity; - if (--this->actionDelay == 0) { + if (--this->timer == 0) { entity = ((VaatiArm_HeapStruct*)this->myHeap)->parent; if ((gRoomTransition.field_0x39 & 0xc) == 0) { entity->subAction = 2; @@ -1112,30 +1112,30 @@ u32 sub_080437DC(Entity* this) { if (heapStruct == NULL) return 0; this->spritePriority.b0 = 5; - this->field_0x3c = this->field_0x3c | 0x10; + this->collisionFlags = this->collisionFlags | 0x10; this->myHeap = (u32*)heapStruct; heapStruct->entities[0] = this; entity = CreateEnemy(VAATI_ARM, 1); entity->spritePriority.b0 = 5; - entity->field_0x3c = entity->field_0x3c | 0x10; + entity->collisionFlags = entity->collisionFlags | 0x10; entity->myHeap = (u32*)heapStruct; heapStruct->entities[1] = entity; CopyPosition(this, entity); entity = CreateEnemy(VAATI_ARM, 2); entity->spritePriority.b0 = 5; - entity->field_0x3c = entity->field_0x3c | 0x10; + entity->collisionFlags = entity->collisionFlags | 0x10; entity->myHeap = (u32*)heapStruct; heapStruct->entities[2] = entity; CopyPosition(this, entity); entity = CreateEnemy(VAATI_ARM, 3); entity->spritePriority.b0 = 5; - entity->field_0x3c = entity->field_0x3c | 0x10; + entity->collisionFlags = entity->collisionFlags | 0x10; entity->myHeap = (u32*)heapStruct; heapStruct->entities[3] = entity; CopyPosition(this, entity); entity = CreateEnemy(VAATI_ARM, 4); entity->spritePriority.b0 = 5; - entity->field_0x3c = entity->field_0x3c | 0x10; + entity->collisionFlags = entity->collisionFlags | 0x10; entity->myHeap = (u32*)heapStruct; heapStruct->entities[4] = entity; CopyPosition(this, entity); @@ -1284,7 +1284,7 @@ void sub_08043C40(Entity* this, VaatiArm_HeapStruct1* heapStruct) { u32 sub_08043C98(Entity* this) { #if defined EU || defined JP Entity* e1 = ((VaatiArm_HeapStruct*)this->myHeap)->entities[3]; - if ((e1->bitfield == 0x9d)) { + if ((e1->contactFlags == 0x9d)) { sub_08043D08(this); return 1; } else { @@ -1293,7 +1293,7 @@ u32 sub_08043C98(Entity* this) { #else Entity* e1 = ((VaatiArm_HeapStruct*)this->myHeap)->entities[2]; Entity* e2 = ((VaatiArm_HeapStruct*)this->myHeap)->entities[3]; - if ((e1->bitfield == 0x9d) || (e2->bitfield == 0x9d)) { + if ((e1->contactFlags == 0x9d) || (e2->contactFlags == 0x9d)) { sub_08043D08(this); gRoomTransition.field_0x38 |= 2; return 1; @@ -1306,7 +1306,7 @@ u32 sub_08043C98(Entity* this) { void sub_08043CD4(Entity* this) { u32 i; for (i = 0; i < 5; i++) { - if (((VaatiArm_HeapStruct*)this->myHeap)->entities[i]->bitfield == 0x9d) { + if (((VaatiArm_HeapStruct*)this->myHeap)->entities[i]->contactFlags == 0x9d) { this->field_0x7c.BYTES.byte0 = 0x78; this->field_0x7c.BYTES.byte1 = i; return; @@ -1406,7 +1406,7 @@ void sub_08043EB8(Entity* this) { pEVar4->x.HALF.HI = (this->type2 == 0) ? gRoomTransition.field_0x44 : gRoomTransition.field_0x48; pEVar4->y.HALF.HI = (this->type2 == 0) ? gRoomTransition.field_0x46 : gRoomTransition.field_0x4a; pEVar4->z.HALF.HI = 0; - pEVar4->field_0x3c = pEVar4->field_0x3c & 0xef; + pEVar4->collisionFlags = pEVar4->collisionFlags & 0xef; pEVar4->hitType = 0x3a; pEVar4->hitbox = (Hitbox*)&gUnk_080FD450; pEVar4 = CreateObject(OBJECT_AF, 0, 0); diff --git a/src/enemy/vaatiBall.c b/src/enemy/vaatiBall.c index fa72f6f8..8d3da887 100644 --- a/src/enemy/vaatiBall.c +++ b/src/enemy/vaatiBall.c @@ -35,8 +35,8 @@ void VaatiBall(Entity* this) { this->health = -1; } - if (this->bitfield & 0x80) { - if ((this->bitfield & 0x3f) == 0 && this->action == 6) { + if (this->contactFlags & 0x80) { + if ((this->contactFlags & 0x3f) == 0 && this->action == 6) { ModHealth(-2); } @@ -65,7 +65,7 @@ void sub_0804468C(Entity* this) { switch (this->type) { case 0: this->action = 1; - this->actionDelay = 1; + this->timer = 1; this->direction = (this->field_0x78.HALF.HI * 8) & 0x1f; this->field_0x78.HALF.LO = 0; this->field_0x82.HALF.HI = 0; @@ -90,17 +90,17 @@ void sub_0804474C(Entity* this) { case 3: this->action = 3; this->field_0x74.HALF.LO = 0; - this->actionDelay = 0; + this->timer = 0; break; case 5: this->action = 5; this->field_0x74.HALF.LO = 0; - this->field_0xf = 1; + this->subtimer = 1; break; case 6: this->action = 6; this->field_0x74.HALF.LO = 0; - this->field_0xf = 32; + this->subtimer = 32; break; case 2: this->action = 2; @@ -112,8 +112,8 @@ void sub_0804474C(Entity* this) { if (this->action != 1) { UpdateAnimationSingleFrame(this); } else { - if (--this->actionDelay == 0) { - this->actionDelay = 2; + if (--this->timer == 0) { + this->timer = 2; this->direction++; this->direction &= 0x1f; } @@ -174,7 +174,7 @@ void sub_08044868(Entity* this) { this->field_0x74.HALF.LO++; this->x.HALF.HI = vaati->x.HALF.HI; this->y.HALF.HI = vaati->y.HALF.HI - 0x10; - vaati->actionDelay++; + vaati->timer++; } else { this->direction = sub_080045B4(this, vaati->x.HALF.HI, vaati->y.HALF.HI - 0x10); } @@ -200,11 +200,11 @@ void sub_08044868(Entity* this) { } } } - this->actionDelay = 32; + this->timer = 32; break; case 2: - if (this->actionDelay) - if (--this->actionDelay < 0x11) + if (this->timer) + if (--this->timer < 0x11) LinearMoveUpdate(this); break; case 3: { @@ -235,7 +235,7 @@ void sub_080449F8(Entity* this) { switch (vaati->field_0x74.HALF.LO) { case 0: LinearMoveUpdate(this); - if (--this->actionDelay) + if (--this->timer) break; if (this->field_0x78.HALF.LO == 0) { @@ -243,17 +243,17 @@ void sub_080449F8(Entity* this) { this->speed = 640; } - this->actionDelay = 4; + this->timer = 4; this->direction++; this->direction &= 0x1f; if (vaati->field_0x80.HALF.LO == 0) vaati->field_0x74.HALF.LO = 1; break; case 1: - switch (this->actionDelay) { + switch (this->timer) { case 2: if (vaati->field_0x80.HALF.LO == 0) { - this->field_0xf = 0; + this->subtimer = 0; sub_08044E74(this, 0); } break; @@ -261,16 +261,16 @@ void sub_080449F8(Entity* this) { this->direction = (this->direction + 0x10) & 0x1f; LinearMoveUpdate(this); this->direction = (this->direction + 0x10) & 0x1f; - this->actionDelay = 2; + this->timer = 2; break; case 3: LinearMoveUpdate(this); - this->actionDelay = 2; + this->timer = 2; break; case 4: LinearMoveUpdate(this); LinearMoveUpdate(this); - this->actionDelay = 2; + this->timer = 2; break; } break; @@ -291,8 +291,8 @@ void sub_080449F8(Entity* this) { } break; case 3: - if (this->field_0xf) { - this->field_0xf = 0; + if (this->subtimer) { + this->subtimer = 0; } break; } @@ -304,7 +304,7 @@ void sub_08044B04(Entity* this) { UpdateAnimationSingleFrame(this); if (vaati->action == 1) { sub_08044E74(this, 0); - this->actionDelay = 32; + this->timer = 32; return; } @@ -313,22 +313,22 @@ void sub_08044B04(Entity* this) { LinearMoveUpdate(this); switch (this->field_0x74.HALF.LO) { case 0: - if (--this->actionDelay == 0) { - this->actionDelay = this->field_0x78.HALF.LO ? 4 : 2; + if (--this->timer == 0) { + this->timer = this->field_0x78.HALF.LO ? 4 : 2; this->direction++; this->direction &= 0x1f; } - if (--this->field_0xf == 0) { - if (this->actionDelay != 2) { - this->field_0xf = 1; + if (--this->subtimer == 0) { + if (this->timer != 2) { + this->subtimer = 1; } else { if (++this->field_0x78.HALF.LO > 2) { this->field_0x74.HALF.LO++; this->field_0x78.HALF.LO = 1; - this->actionDelay = 4; - this->field_0xf = 0; + this->timer = 4; + this->subtimer = 0; } else { - this->field_0xf = 32; + this->subtimer = 32; } this->speed = this->field_0x78.HALF.LO ? 640 : 1280; @@ -336,22 +336,22 @@ void sub_08044B04(Entity* this) { } break; case 1: - if (--this->actionDelay == 0) { - this->actionDelay = 6; + if (--this->timer == 0) { + this->timer = 6; this->direction = (this->direction + 1) & 0x1f; - if (++this->field_0xf == 0x30) { + if (++this->subtimer == 0x30) { u32 direction = sub_080045B4(this, vaati->x.HALF.HI, vaati->y.HALF.HI - 0x10); this->speed = 0; this->direction = (direction + 16) & 0x1f; - this->actionDelay = 16; - this->field_0xf = 16; + this->timer = 16; + this->subtimer = 16; this->field_0x74.HALF.LO++; } } break; case 2: - if (this->field_0xf == 0) { - switch (--this->actionDelay) { + if (this->subtimer == 0) { + switch (--this->timer) { case 12: this->speed = 1280; break; @@ -359,32 +359,32 @@ void sub_08044B04(Entity* this) { this->field_0x74.HALF.LO++; this->direction = sub_080045B4(this, vaati->x.HALF.HI, vaati->y.HALF.HI - 0x10); this->speed = 0; - this->actionDelay = 4; - this->field_0xf = 16; + this->timer = 4; + this->subtimer = 16; break; case 4: this->speed = 640; break; } } else { - if (--this->field_0xf == 0) + if (--this->subtimer == 0) this->speed = 640; } break; case 3: - if (this->field_0xf) { - if (--this->field_0xf == 0) + if (this->subtimer) { + if (--this->subtimer == 0) this->speed = 640; } else { - if (this->actionDelay) { - if (--this->actionDelay == 0) { + if (this->timer) { + if (--this->timer == 0) { this->speed = 1280; SoundReq(SFX_14F); } } if (this->field_0x78.HALF.HI == 3) if (EntityWithinDistance(this, vaati->x.HALF.HI, vaati->y.HALF.HI - 0x10, 0xc)) - vaati->actionDelay++; + vaati->timer++; this->direction = sub_080045B4(this, vaati->x.HALF.HI, vaati->y.HALF.HI - 0x10); return; } @@ -395,17 +395,17 @@ void sub_08044B04(Entity* this) { switch (this->field_0x74.HALF.LO) { case 3: this->field_0x74.HALF.LO = 1; - this->actionDelay = 80; + this->timer = 80; COLLISION_OFF(this); PositionRelative(vaati, this, 0, Q_16_16(-16.0)); - if (this->field_0xf) + if (this->subtimer) this->spriteSettings.draw = 0; break; case 1: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->field_0x74.HALF.LO = 0; - this->actionDelay = 32; - this->field_0xf = 4; + this->timer = 32; + this->subtimer = 4; } break; } @@ -416,17 +416,17 @@ void sub_08044B04(Entity* this) { case 3: switch (this->field_0x74.HALF.LO) { case 0: - if (this->field_0xf) { - if (--this->field_0xf == 0) { + if (this->subtimer) { + if (--this->subtimer == 0) { sub_08044DEC(this); this->field_0x74.HALF.LO = 1; - this->actionDelay = 16; + this->timer = 16; } } break; case 1: LinearMoveUpdate(this); - if (--this->actionDelay == 0) + if (--this->timer == 0) this->field_0x74.HALF.LO++; break; case 2: { @@ -439,7 +439,7 @@ void sub_08044B04(Entity* this) { } else { COLLISION_OFF(this); } - vaati->actionDelay++; + vaati->timer++; break; } } @@ -488,11 +488,11 @@ void sub_08044E74(Entity* this, u32 state) { break; case 0: if (this->field_0x78.HALF.LO) { - switch (this->actionDelay) { + switch (this->timer) { case 3 ... 4: do { LinearMoveUpdate(this); - } while (this->actionDelay-- != 3); + } while (this->timer-- != 3); break; case 1: this->direction = (this->direction + 0x10) & 0x1f; @@ -501,13 +501,13 @@ void sub_08044E74(Entity* this, u32 state) { break; } } else { - if (this->actionDelay == 2) { + if (this->timer == 2) { LinearMoveUpdate(this); } } break; } - this->actionDelay = 1; + this->timer = 1; this->field_0x78.HALF.LO = 0; this->speed = Q_8_8(5); } diff --git a/src/enemy/vaatiEyesMacro.c b/src/enemy/vaatiEyesMacro.c index 2d26cd89..0d4d067d 100644 --- a/src/enemy/vaatiEyesMacro.c +++ b/src/enemy/vaatiEyesMacro.c @@ -139,7 +139,7 @@ void VaatiEyesMacroFunction0Type1Action0(Entity* this) { entity->parent = this; this->action = 1; rand = Random(); - this->actionDelay = (rand & 3) + 1; + this->timer = (rand & 3) + 1; this->field_0x78.HALF.LO = Random() >> 8; this->direction = gUnk_080CDE6C[rand >> 0x10 & 3]; InitializeAnimation(this, 1); @@ -234,7 +234,7 @@ void sub_0802EFB8(Entity* this) { if (iVar4 != 0) { this->direction = 0xff; } else { - this->actionDelay = (rand & 3) + 1; + this->timer = (rand & 3) + 1; this->direction = (uVar1 & 0x18); this->speed = gUnk_080CDE98[rand >> 0x18 & 3]; } @@ -253,10 +253,10 @@ void sub_0802F04C(Entity* this) { switch (this->direction >> 3) { case 0: if (((oldY & 0xf) > 8) && ((this->y.HALF.HI & 0xf) < 9)) { - this->actionDelay--; + this->timer--; oldY = (this->y.HALF.HI & 0xfff0) + 8; } - if (this->actionDelay == 0) { + if (this->timer == 0) { this->x.HALF.HI = oldX; this->y.HALF.HI = oldY; } else { @@ -265,10 +265,10 @@ void sub_0802F04C(Entity* this) { break; case 1: if (((oldX & 0xf) < 8) && ((this->x.HALF.HI & 0xf) >= 8)) { - this->actionDelay--; + this->timer--; oldX = (this->x.HALF.HI & 0xfff0) + 8; } - if (this->actionDelay == 0) { + if (this->timer == 0) { this->x.HALF.HI = oldX; this->y.HALF.HI = oldY; } else { @@ -277,10 +277,10 @@ void sub_0802F04C(Entity* this) { break; case 2: if (((oldY & 0xf) < 8) && ((this->y.HALF.HI & 0xf) >= 8)) { - this->actionDelay--; + this->timer--; oldY = (this->y.HALF.HI & 0xfff0) + 8; } - if (this->actionDelay == 0) { + if (this->timer == 0) { this->x.HALF.HI = oldX; this->y.HALF.HI = oldY; } else { @@ -289,10 +289,10 @@ void sub_0802F04C(Entity* this) { break; default: if (((oldX & 0xf) >= 9) && ((this->x.HALF.HI & 0xf) < 9)) { - this->actionDelay--; + this->timer--; oldX = (this->x.HALF.HI & 0xfff0) + 8; } - if (this->actionDelay == 0) { + if (this->timer == 0) { this->x.HALF.HI = oldX; this->y.HALF.HI = oldY; } else { diff --git a/src/enemy/vaatiProjectile.c b/src/enemy/vaatiProjectile.c index c3abb271..252b7fb2 100644 --- a/src/enemy/vaatiProjectile.c +++ b/src/enemy/vaatiProjectile.c @@ -58,7 +58,7 @@ void VaatiProjectile_OnTick(Entity* this) { void VaatiProjectile_OnCollision(Entity* this) { Entity* entity; - if (this->bitfield == 0x80) { + if (this->contactFlags == 0x80) { #ifndef EU if (this->health != 0) { #endif @@ -87,7 +87,7 @@ void VaatiProjectile_OnCollision(Entity* this) { void VaatiProjectile_OnDeath(Entity* this) { if (this->parent != NULL) { - this->parent->field_0xf--; + this->parent->subtimer--; this->parent = NULL; } GenericDeath(this); @@ -130,7 +130,7 @@ void VaatiProjectileFunction0Action1(Entity* this) { sub_0803E480(this); if (PlayerInRange(this, 0, 8) != 0) { this->action = 2; - this->actionDelay = 10; + this->timer = 10; InitializeAnimation(this->child, 2); } else { if (gUnk_020000B0 != NULL) { @@ -142,8 +142,8 @@ void VaatiProjectileFunction0Action1(Entity* this) { } void VaatiProjectileFunction0Action2(Entity* this) { - if (this->actionDelay != 0) { - this->actionDelay--; + if (this->timer != 0) { + this->timer--; } else { if (++this->z.HALF.HI == 0) { this->action = 3; @@ -156,7 +156,7 @@ void VaatiProjectileFunction0Action3(Entity* this) { if (this->child->frame & ANIM_DONE) { if (--this->z.HALF.HI <= -0x18) { this->action = 4; - this->actionDelay = (Random() & 0xf) + 0xf; + this->timer = (Random() & 0xf) + 0xf; InitializeAnimation(this->child, 1); } GetNextFrame(this); @@ -164,7 +164,7 @@ void VaatiProjectileFunction0Action3(Entity* this) { } void VaatiProjectileFunction0Action4(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 1; this->direction = GetFacingDirection(this, &gPlayerEntity); } @@ -173,19 +173,19 @@ void VaatiProjectileFunction0Action4(Entity* this) { void VaatiProjectileFunction0Action5(Entity* this) { sub_0803E444(this); - if (this->actionDelay != 0) { - this->actionDelay--; + if (this->timer != 0) { + this->timer--; } else { if (-0x18 < --this->z.HALF.HI) { return; } this->action = 6; - this->actionDelay = 0x14; + this->timer = 0x14; } } void VaatiProjectileFunction0Action6(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 7; this->direction = 0x10; this->speed = 0x300; @@ -216,7 +216,7 @@ void VaatiProjectileFunction0Action9(Entity* this) { this->y.HALF.HI = gPlayerEntity.y.HALF.HI; if (this->z.HALF.HI < -8) { if (this->animIndex != 2) { - this->actionDelay = 0; + this->timer = 0; InitializeAnimation(this->child, 2); } VaatiProjectileFunction0Action2(this); @@ -229,7 +229,7 @@ void sub_0803E444(Entity* this) { ResetPlayerItem(); gPlayerState.mobility = gPlayerState.mobility | 0x80; gPlayerState.field_0xa = gPlayerState.field_0xa | 0x80; - sub_0806FA90(this, this->field_0x4c, 0, -2); + sub_0806FA90(this, this->contactedEntity, 0, -2); gPlayerEntity.spriteOffsetY += 0xe; } diff --git a/src/enemy/vaatiRebornEnemy.c b/src/enemy/vaatiRebornEnemy.c index 07639d76..019963cf 100644 --- a/src/enemy/vaatiRebornEnemy.c +++ b/src/enemy/vaatiRebornEnemy.c @@ -100,7 +100,7 @@ void VaatiRebornEnemyType0Action0(Entity* this) { ClearRoomFlag(0); this->action = 3; this->field_0x74.HALF.LO = -1; - this->actionDelay = 0; + this->timer = 0; this->field_0x76.HALF.LO = 0; this->spriteSettings.draw = 1; this->direction = 0xff; @@ -126,7 +126,7 @@ void VaatiRebornEnemyType0Action0(Entity* this) { for (i = 0; i < 4; i++) { entity = CreateEnemy(VAATI_REBORN_ENEMY, 3); entity->parent = this; - entity->actionDelay = i; + entity->timer = i; } for (i = 0; i < 2; i++) { entity = CreateEnemy(VAATI_BALL, 1); @@ -140,15 +140,15 @@ void VaatiRebornEnemyType0Action0(Entity* this) { } void VaatiRebornEnemyType0Action1(Entity* this) { - if (this->actionDelay != 0) { - if (--this->actionDelay == 0) { + if (this->timer != 0) { + if (--this->timer == 0) { if ((this->field_0x74.HALF.LO & 0x70) == 0) { - if (this->child->actionDelay == 0) { + if (this->child->timer == 0) { sub_0803DD78(this); if (this->field_0x74.HALF.HI != 0) { this->action = 2; this->field_0x74.HALF.LO = 0; - this->actionDelay = 0x10; + this->timer = 0x10; this->direction = 0xff; } else { if ((this->field_0x86.HALF.LO != 0) || (this->field_0x80.HALF.LO != 0)) { @@ -158,13 +158,13 @@ void VaatiRebornEnemyType0Action1(Entity* this) { } } } else { - this->actionDelay = 2; + this->timer = 2; } } else { this->action = 3; this->field_0x74.HALF.HI = this->field_0x74.HALF.LO & 0x80; this->field_0x74.HALF.LO = 0; - this->actionDelay = 0xc0; + this->timer = 0xc0; this->direction = 0xff; this->spriteSettings.draw = 1; InitAnimationForceUpdate(this, 0); @@ -175,7 +175,7 @@ void VaatiRebornEnemyType0Action1(Entity* this) { switch (sub_0803DEE0(this)) { case 0: this->action = 4; - this->actionDelay = 0xa0; + this->timer = 0xa0; this->direction = 0xff; this->cutsceneBeh.HALF.LO = 0xff; InitAnimationForceUpdate(this, 1); @@ -183,18 +183,18 @@ void VaatiRebornEnemyType0Action1(Entity* this) { case 1: this->action = 6; this->field_0x74.HALF.LO = 0; - this->actionDelay = 0; + this->timer = 0; this->direction = 0xff; break; case 3: this->action = 5; this->field_0x74.HALF.LO = 0; - this->field_0xf = 0x20; + this->subtimer = 0x20; this->direction = 0xff; break; case 2: this->field_0x74.HALF.LO = 0; - this->actionDelay = 0x20; + this->timer = 0x20; if ((this->field_0x86.HALF.LO != 0) || (this->field_0x80.HALF.LO != 0)) { this->direction = ((Random() & 0x80) >> 3) | 8; } else { @@ -203,7 +203,7 @@ void VaatiRebornEnemyType0Action1(Entity* this) { break; } } - if (this->child->actionDelay == 0) { + if (this->child->timer == 0) { this->cutsceneBeh.HALF.HI++; if ((this->cutsceneBeh.HALF.HI & 3) == 0) { switch (this->cutsceneBeh.HALF.HI & 0x30) { @@ -227,9 +227,9 @@ void VaatiRebornEnemyType0Action2(Entity* this) { switch (this->field_0x74.HALF.LO) { case 0: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->field_0x74.HALF.LO++; - this->actionDelay = 0x20; + this->timer = 0x20; InitAnimationForceUpdate(this, 3); SoundReq(SFX_19B); } @@ -238,11 +238,11 @@ void VaatiRebornEnemyType0Action2(Entity* this) { if ((this->frame & ANIM_DONE) != 0) { this->field_0x74.HALF.LO = 2; this->spriteSettings.draw = 0; - this->actionDelay = 0x10; + this->timer = 0x10; } break; case 2: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->field_0x74.HALF.LO++; if (sub_0803E028(this) == 0) { s32 tmp; @@ -254,7 +254,7 @@ void VaatiRebornEnemyType0Action2(Entity* this) { this->y.HALF.HI = gRoomControls.origin_y + ptr->HALF.y + 0x10; } this->spriteSettings.draw = 1; - this->actionDelay = 0x20; + this->timer = 0x20; InitAnimationForceUpdate(this, 4); SoundReq(SFX_F5); } @@ -268,10 +268,10 @@ void VaatiRebornEnemyType0Action2(Entity* this) { } if (--this->field_0x76.HALF.HI == 0) { this->action = 1; - this->actionDelay = 1; + this->timer = 1; } else { this->field_0x74.HALF.LO = 0; - this->actionDelay = 0x10; + this->timer = 0x10; } InitAnimationForceUpdate(this, 0); } @@ -286,30 +286,30 @@ void VaatiRebornEnemyType0Action3(Entity* this) { switch (this->field_0x74.HALF.LO) { case 0xfe: this->field_0x74.HALF.LO = 0; - this->actionDelay = 1; + this->timer = 1; break; case 0xff: if (this->z.HALF.HI != -4) { this->z.WORD -= Q_16_16(0.125); } - if (this->actionDelay == 2) { + if (this->timer == 2) { this->field_0x74.HALF.LO = 0xfe; } break; case 0: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->field_0x74.HALF.LO++; if ((this->field_0x74.HALF.HI & 0x80) != 0) { temp = 0x14; } else { temp = 0x20; } - this->actionDelay = temp; + this->timer = temp; this->field_0x80.HALF.LO = ((this->field_0x86.HALF.LO + 1) >> 1) * 2 + 2; } break; case 1: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->field_0x74.HALF.LO++; if ((this->field_0x74.HALF.HI & 0x80) == 0) { SoundReq(SFX_1B0); @@ -326,7 +326,7 @@ void VaatiRebornEnemyType0Action3(Entity* this) { case 3: this->action = 1; this->field_0x74.HALF.LO = 0; - this->actionDelay = 1; + this->timer = 1; break; } UpdateAnimationSingleFrame(this); @@ -336,10 +336,10 @@ void VaatiRebornEnemyType0Action4(Entity* this) { u32 index; Entity* entity; - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 1; this->cutsceneBeh.HALF.LO = 0xff; - this->actionDelay = 1; + this->timer = 1; this->direction = (this->direction + 0x10) & 0x1f; InitAnimationForceUpdate(this, 0); } else { @@ -348,15 +348,15 @@ void VaatiRebornEnemyType0Action4(Entity* this) { if (this->cutsceneBeh.HALF.LO == 0xff) { index = Direction8RoundUp(GetFacingDirection(this, &gPlayerEntity)); this->cutsceneBeh.HALF.LO = gUnk_080D04C0[index >> 2]; - this->field_0xf = 0; + this->subtimer = 0; } - if ((this->field_0xf < 0x10) && + if ((this->subtimer < 0x10) && (entity = CreateProjectileWithParent(this, V1_FIRE_PROJECTILE, this->cutsceneBeh.HALF.LO), entity != NULL)) { - entity->field_0xf = this->field_0xf; + entity->subtimer = this->subtimer; entity->parent = this; entity->z.HALF.HI = this->z.HALF.HI; - this->field_0xf = this->field_0xf + 1; + this->subtimer = this->subtimer + 1; } } } @@ -368,7 +368,7 @@ void VaatiRebornEnemyType0Action5(Entity* this) { if (this->field_0x80.HALF.LO == 0) { this->action = 1; - this->actionDelay = 1; + this->timer = 1; this->direction = 0xff; InitAnimationForceUpdate(this, 0); return; @@ -376,7 +376,7 @@ void VaatiRebornEnemyType0Action5(Entity* this) { switch (this->field_0x74.HALF.LO) { case 0: - if (--this->field_0xf == 0) { + if (--this->subtimer == 0) { this->field_0x74.HALF.LO++; InitAnimationForceUpdate(this, 1); } @@ -384,30 +384,30 @@ void VaatiRebornEnemyType0Action5(Entity* this) { case 1: if ((this->frame & 0x10) != 0) { this->field_0x74.HALF.LO = 2; - this->field_0xf = (Random() & 0x3f) + 0x40; + this->subtimer = (Random() & 0x3f) + 0x40; SoundReq(SFX_SUMMON); } break; case 2: - if (--this->field_0xf == 0) { + if (--this->subtimer == 0) { if (!((this->field_0x86.HALF.LO < 2) || (3 < this->field_0x86.HALF.HI)) && (Random() & 0x10) != 0) { this->field_0x86.HALF.HI++; - this->field_0xf = (Random() & 0x3f) + 0x40; + this->subtimer = (Random() & 0x3f) + 0x40; uVar3 = GetFacingDirection(this, &gPlayerEntity); this->direction = (uVar3 & 0x10) | 8; } else { this->field_0x74.HALF.LO++; this->field_0x86.HALF.HI = 0; - this->field_0xf = 0x30; + this->subtimer = 0x30; InitAnimationForceUpdate(this, 0); } } break; case 3: - if (--this->field_0xf == 0) { + if (--this->subtimer == 0) { this->action = 1; this->field_0x74.HALF.LO = 0; - this->actionDelay = 1; + this->timer = 1; this->direction = 0xff; } break; @@ -424,19 +424,19 @@ void VaatiRebornEnemyType0Action6(Entity* this) { if (this->field_0x80.HALF.LO == 0) { this->action = 1; - this->actionDelay = 1; + this->timer = 1; return; } switch (this->field_0x74.HALF.LO) { case 0: - if (this->actionDelay != 0) { + if (this->timer != 0) { this->field_0x74.HALF.LO = 1; - this->actionDelay = 0x70; + this->timer = 0x70; } break; case 1: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->field_0x74.HALF.LO++; SoundReq(SFX_150); target = CreateProjectileWithParent(this, V1_DARK_MAGIC_PROJECTILE, 0); @@ -444,24 +444,24 @@ void VaatiRebornEnemyType0Action6(Entity* this) { PositionRelative(this, target, 0, Q_16_16(-16.0)); target->parent = this; } - } else if (this->actionDelay == 0x40) { + } else if (this->timer == 0x40) { SoundReq(SFX_196); } break; case 2: - if (this->field_0xf != 0) { - this->field_0xf = 0; + if (this->subtimer != 0) { + this->subtimer = 0; } break; case 3: - if (this->field_0xf == 0) { - this->field_0xf = 1; + if (this->subtimer == 0) { + this->subtimer = 1; SoundReq(SFX_14F); } - if (this->actionDelay) { + if (this->timer) { this->action = 1; this->field_0x74.HALF.LO = 0; - this->actionDelay = 1; + this->timer = 1; } break; } @@ -472,11 +472,11 @@ void VaatiRebornEnemyType0Action7(Entity* this) { Entity* fx; u32 tmp; - if (this->actionDelay != 0) { - if (--this->actionDelay == 0) { + if (this->timer != 0) { + if (--this->timer == 0) { SetRoomFlag(1); } else { - if ((this->actionDelay & 7) == 0) { + if ((this->timer & 7) == 0) { fx = CreateFx(this, FX_DEATH, 0); if (fx != NULL) { tmp = Random() & 0x3f3f; @@ -497,7 +497,7 @@ void VaatiRebornEnemyType1Action0(Entity* this) { this->action = 1; this->field_0x74.HALF.LO = 0; this->field_0x74.HALF.HI = 1; - this->actionDelay = 0; + this->timer = 0; this->spriteOffsetY = -1; PositionRelative(this->parent, this, 0, Q_16_16(1.0)); enemy = CreateEnemy(VAATI_REBORN_ENEMY, 2); @@ -522,9 +522,9 @@ void VaatiRebornEnemyType1Action1(Entity* this) { this->hitType = 0x2f; InitAnimationForceUpdate(this, this->field_0x74.HALF.LO); } else { - if (((this->bitfield & 0x80) != 0) && (0 < this->iframes)) { + if (((this->contactFlags & 0x80) != 0) && (0 < this->iframes)) { parent->iframes = this->iframes; - parent->bitfield = this->bitfield; + parent->contactFlags = this->contactFlags; } if ((this->frame & 0x40) != 0) { InitAnimationForceUpdate(this, 2); @@ -633,7 +633,7 @@ void sub_0803DC0C(Entity* this) { const xy* tmp; parent = this->parent; - tmp = &gUnk_080D04C8[this->actionDelay]; + tmp = &gUnk_080D04C8[this->timer]; this->spriteSettings.draw = parent->spriteSettings.draw; this->spriteOffsetX = parent->spriteOffsetX; PositionRelative(parent, this, Q_16_16(tmp->x), Q_16_16(tmp->y + 1)); @@ -648,32 +648,32 @@ void VaatiRebornEnemyType1PreAction(Entity* this) { } parent = this->parent; this->field_0x76.HALF.HI = 0; - if ((this->bitfield & 0x80) != 0) { + if ((this->contactFlags & 0x80) != 0) { if (gUnk_080D04D0[parent->field_0x86.HALF.LO] > this->health) { if (2 < ++parent->field_0x86.HALF.LO) { COLLISION_OFF(this); parent->action = 7; parent->flags &= ~ENT_COLLIDE; - parent->actionDelay = 0x80; + parent->timer = 0x80; parent->spriteOffsetX = 0; parent->direction = -1; - this->actionDelay = 0; + this->timer = 0; SoundReq(SONG_STOP_BGM); gArea.bgm = gArea.queued_bgm; return; } - this->actionDelay = 1; + this->timer = 1; this->field_0x76.HALF.HI = 0xff; } if (0 < this->iframes) { SoundReq(SFX_BOSS_HIT); InitScreenShake(0xc, 1); - if (this->actionDelay == 0) - this->actionDelay = 0x48; + if (this->timer == 0) + this->timer = 0x48; } } - if (this->actionDelay != 0) { - if (--this->actionDelay == 0) { + if (this->timer != 0) { + if (--this->timer == 0) { this->hitType = 0x2f; this->field_0x74.HALF.LO = 1; if (this->field_0x76.HALF.HI == 0) { @@ -683,7 +683,7 @@ void VaatiRebornEnemyType1PreAction(Entity* this) { this->health = 0xff; } parent->action = 1; - parent->actionDelay = 1; + parent->timer = 1; InitAnimationForceUpdate(this, 0); } } diff --git a/src/enemy/vaatiTransfigured.c b/src/enemy/vaatiTransfigured.c index 7149ea69..e9d7b344 100644 --- a/src/enemy/vaatiTransfigured.c +++ b/src/enemy/vaatiTransfigured.c @@ -141,8 +141,8 @@ void VaatiTransfiguredType0Action0(Entity* this) { this->spritePriority.b0 = 5; this->field_0x6c.HALF.HI |= 1; this->direction = (Random() & 0x17) + 4; - this->actionDelay = 48; - this->field_0xf = 12; + this->timer = 48; + this->subtimer = 12; this->field_0x82.HALF.LO = 4; this->field_0x80.HALF.LO = 0xff; this->field_0x74.HALF.LO = 0; @@ -165,9 +165,9 @@ void VaatiTransfiguredType0Action0(Entity* this) { enemy->parent = this; enemy->type2 = i; if ((this->field_0x74.HALF.HI >> (i)&1) != 0) { - enemy->actionDelay = 1; + enemy->timer = 1; } else { - enemy->actionDelay = 0; + enemy->timer = 0; } } InitAnimationForceUpdate(this, 0); @@ -179,41 +179,41 @@ void VaatiTransfiguredType0Action1(Entity* this) { switch (this->field_0x80.HALF.LO) { case 0xff: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->field_0x80.HALF.LO = 0; - this->actionDelay = 11; + this->timer = 11; } break; case 0: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->field_0x80.HALF.LO += 1; this->speed = 0x180; - this->actionDelay = 0x14; + this->timer = 0x14; } break; case 1: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->field_0x80.HALF.LO += 1; this->speed = 0xc0; - this->actionDelay = 12; + this->timer = 12; } break; case 2: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->field_0x80.HALF.LO += 1; this->speed = 0; if (this->animationState < 2) { - this->actionDelay = (Random() & 0x7f) + 0x40; + this->timer = (Random() & 0x7f) + 0x40; } else { - this->actionDelay = 8; + this->timer = 8; } } break; case 3: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->z.HALF.HI = 0; this->field_0x80.HALF.LO = 0; - this->actionDelay = gUnk_080D0ABF[(u32)this->animationState * 2]; + this->timer = gUnk_080D0ABF[(u32)this->animationState * 2]; switch (sub_08040934(this)) { case 1: this->action = 4; @@ -269,20 +269,20 @@ void VaatiTransfiguredType0Action3(Entity* this) { if (uVar4 != 1) break; this->field_0x80.HALF.LO = 1; - this->actionDelay = 0xc0; + this->timer = 0xc0; COLLISION_ON(this); SoundReq(SFX_14C); InitScreenShake(0x14, 4); break; case 1: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->field_0x80.HALF.LO = 2; this->hitType = 0x35; this->spriteOffsetX = 0; } if (this->health < gUnk_080D0ABC[this->animationState]) { tmp = 1; - this->actionDelay = 1; + this->timer = 1; } else { tmp = 0; } @@ -293,7 +293,7 @@ void VaatiTransfiguredType0Action3(Entity* this) { this->animationState++; if (this->animationState > 2) { this->action = 7; - this->actionDelay = 0xe0; + this->timer = 0xe0; DeleteClones(); SoundReq(SFX_BOSS_HIT); return; @@ -302,26 +302,26 @@ void VaatiTransfiguredType0Action3(Entity* this) { break; case 2: this->child->field_0x74.HALF.LO = 0x10; - if (this->actionDelay) { + if (this->timer) { this->field_0x80.HALF.LO = 3; - this->actionDelay = 0x40; + this->timer = 0x40; } else { this->field_0x80.HALF.LO = 4; - this->actionDelay = 0x50; + this->timer = 0x50; } break; case 3: - if (this->actionDelay != 0) { - if (--this->actionDelay == 0) { + if (this->timer != 0) { + if (--this->timer == 0) { COLLISION_OFF(this); this->zVelocity = Q_16_16(3.5); - this->field_0xf = 0x10; + this->subtimer = 0x10; } break; } if (GravityUpdate(this, 0x2800) == 0) { this->field_0x80.HALF.LO = 5; - this->actionDelay = 0x10; + this->timer = 0x10; COLLISION_ON(this); this->health = 0xff; this->field_0x86.HALF.LO = 0; @@ -329,11 +329,11 @@ void VaatiTransfiguredType0Action3(Entity* this) { SoundReq(SFX_14C); InitScreenShake(0x1e, 4); } else { - if (this->field_0xf != 0) { - if (--this->field_0xf == 0) { + if (this->subtimer != 0) { + if (--this->subtimer == 0) { SoundReq(SFX_1B0); } else { - if ((this->field_0xf & 7) == 0) { + if ((this->subtimer & 7) == 0) { SoundReq(SFX_149); } } @@ -341,13 +341,13 @@ void VaatiTransfiguredType0Action3(Entity* this) { } break; case 4: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->field_0x80.HALF.LO = 5; - this->actionDelay = 0x10; + this->timer = 0x10; this->field_0x86.HALF.LO = 0; sub_080408EC(this); } else { - if (((this->actionDelay & 1) != 0) && (pEVar3 = CreateObject(OBJECT_9B, 1, 0xff), pEVar3 != NULL)) { + if (((this->timer & 1) != 0) && (pEVar3 = CreateObject(OBJECT_9B, 1, 0xff), pEVar3 != NULL)) { pEVar3->parent = this; CopyPosition(this, pEVar3); pEVar3->x.HALF.HI += (Random() & 0xf) - 7; @@ -358,7 +358,7 @@ void VaatiTransfiguredType0Action3(Entity* this) { } break; case 5: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 1; this->field_0x80.HALF.LO = 0; this->field_0x80.HALF.HI = 0; @@ -367,7 +367,7 @@ void VaatiTransfiguredType0Action3(Entity* this) { } } if (this->field_0x80.HALF.LO > 2) { - this->spriteOffsetX = this->actionDelay & 1; + this->spriteOffsetX = this->timer & 1; } UpdateAnimationSingleFrame(this); } @@ -375,11 +375,11 @@ void VaatiTransfiguredType0Action3(Entity* this) { void VaatiTransfiguredType0Action4(Entity* this) { switch (this->field_0x80.HALF.LO) { case 0: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->field_0x80.HALF.LO += 1; this->field_0x74.HALF.LO = 0; - this->actionDelay = 0x80; - this->field_0xf = 0; + this->timer = 0x80; + this->subtimer = 0; this->zVelocity = Q_16_16(2.25); SoundReq(SFX_12B); } @@ -391,38 +391,38 @@ void VaatiTransfiguredType0Action4(Entity* this) { switch (this->cutsceneBeh.HALF.LO) { case 1: case 3: - this->field_0xf = 1; + this->subtimer = 1; break; case 0: case 2: - this->field_0xf = 0; + this->subtimer = 0; break; default: - this->field_0xf = (Random() & 0x20) >> 5; + this->subtimer = (Random() & 0x20) >> 5; break; } if (1 < this->animationState) { - this->field_0xf = 1; + this->subtimer = 1; } SoundReq(SFX_14C); InitScreenShake(0x1e, 4); break; case 2: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->field_0x80.HALF.LO += 1; - this->actionDelay = gUnk_080D0ABF[((u32)this->animationState << 1 | 1)]; + this->timer = gUnk_080D0ABF[((u32)this->animationState << 1 | 1)]; } else { - if ((this->actionDelay & 7) == 0) { - CreateProjectileWithParent(this, V2_PROJECTILE, this->field_0xf); + if ((this->timer & 7) == 0) { + CreateProjectileWithParent(this, V2_PROJECTILE, this->subtimer); } - if (((this->field_0xf != 0) && (1 < this->animationState)) && (this->actionDelay < 6)) { - this->actionDelay = 0x80; - this->field_0xf = 0; + if (((this->subtimer != 0) && (1 < this->animationState)) && (this->timer < 6)) { + this->timer = 0x80; + this->subtimer = 0; } } break; case 3: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 1; this->field_0x80.HALF.LO = 0; this->z.HALF.HI = 0; @@ -443,30 +443,30 @@ void VaatiTransfiguredType0Action5(Entity* this) { switch (this->field_0x80.HALF.LO) { case 0: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->field_0x80.HALF.LO += 1; - this->actionDelay = 0x40; + this->timer = 0x40; if (1 < this->animationState) { - this->actionDelay = 0x80; - this->field_0xf = 1; + this->timer = 0x80; + this->subtimer = 1; } } break; case 1: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->field_0x80.HALF.LO += 1; - this->actionDelay = gUnk_080D0ABF[(this->animationState << 1 | 1)]; + this->timer = gUnk_080D0ABF[(this->animationState << 1 | 1)]; } else { - if (this->field_0xf) { - if ((this->actionDelay & 7) == 0) { - CreateProjectileWithParent(this, V2_PROJECTILE, this->field_0xf); + if (this->subtimer) { + if ((this->timer & 7) == 0) { + CreateProjectileWithParent(this, V2_PROJECTILE, this->subtimer); } - if (this->actionDelay < 6) { - this->actionDelay = 0x40; - this->field_0xf = 0; + if (this->timer < 6) { + this->timer = 0x40; + this->subtimer = 0; } } else { - if ((this->actionDelay & 0xf) == 0) { + if ((this->timer & 0xf) == 0) { entity = CreateProjectileWithParent(this, V2_PROJECTILE, 2); if (entity != NULL) { entity->type2 = 0; @@ -479,7 +479,7 @@ void VaatiTransfiguredType0Action5(Entity* this) { } break; case 2: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 1; this->field_0x80.HALF.LO = 0; sub_08040670(this); @@ -496,29 +496,29 @@ void VaatiTransfiguredType0Action6(Entity* this) { switch (this->field_0x80.HALF.LO) { case 0: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->field_0x80.HALF.LO += 1; - this->actionDelay = 0x80; + this->timer = 0x80; if (1 < this->animationState) { - this->field_0xf = 1; + this->subtimer = 1; } } break; case 1: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->field_0x80.HALF.LO += 1; - this->actionDelay = gUnk_080D0ABF[(this->animationState << 1) | 1]; + this->timer = gUnk_080D0ABF[(this->animationState << 1) | 1]; } else { - if (this->field_0xf) { - if ((this->actionDelay & 7) == 0) { - CreateProjectileWithParent(this, V2_PROJECTILE, this->field_0xf); + if (this->subtimer) { + if ((this->timer & 7) == 0) { + CreateProjectileWithParent(this, V2_PROJECTILE, this->subtimer); } - if (this->actionDelay < 6) { - this->actionDelay = 0x80; - this->field_0xf = 0; + if (this->timer < 6) { + this->timer = 0x80; + this->subtimer = 0; } } else { - if ((this->actionDelay & 0x1f) == 0) { + if ((this->timer & 0x1f) == 0) { pEVar2 = CreateProjectileWithParent(this, V2_PROJECTILE, 2); if (pEVar2 != NULL) { pEVar2->type2 = 1; @@ -532,7 +532,7 @@ void VaatiTransfiguredType0Action6(Entity* this) { } break; case 2: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 1; this->field_0x80.HALF.LO = 0; sub_08040670(this); @@ -548,16 +548,16 @@ void VaatiTransfiguredType0Action7(Entity* this) { u32 uVar4; sub_08078B48(); - if (this->actionDelay) { - if (--this->actionDelay == 0) { + if (this->timer) { + if (--this->timer == 0) { SetRoomFlag(2); - this->field_0xf = 8; + this->subtimer = 8; UpdateAnimationSingleFrame(this); return; } } else { - if (this->field_0xf != 0) { - if (--this->field_0xf == 0) { + if (this->subtimer != 0) { + if (--this->subtimer == 0) { this->health = 0; this->spriteSettings.draw = 0; } @@ -567,8 +567,8 @@ void VaatiTransfiguredType0Action7(Entity* this) { UpdateAnimationSingleFrame(this); return; } - this->field_0xf = (this->field_0xf + 1) & 7; - if (this->field_0xf == 0) { + this->subtimer = (this->subtimer + 1) & 7; + if (this->subtimer == 0) { pEVar3 = CreateFx(this, FX_AURA_BASE, 0); if (pEVar3 != NULL) { uVar4 = Random() & 0x3f3f; @@ -585,10 +585,10 @@ void VaatiTransfiguredType0Action7(Entity* this) { void VaatiTransfiguredType1Action0(Entity* this) { this->action = 1; - this->actionDelay = 0; + this->timer = 0; this->field_0x80.HALF.LO = 0; this->spritePriority.b0 = 6; - InitAnimationForceUpdate(this, (u32)this->actionDelay); + InitAnimationForceUpdate(this, (u32)this->timer); } void VaatiTransfiguredType1Action1(Entity* this) { @@ -607,13 +607,13 @@ void VaatiTransfiguredType1Action1(Entity* this) { sub_080042BA(this, 2); } if (parent->action >= 5) { - if (this->actionDelay == 0) { - this->actionDelay = 1; + if (this->timer == 0) { + this->timer = 1; InitAnimationForceUpdate(this, 1); } } else { - if (this->actionDelay != 0) { - this->actionDelay = 0; + if (this->timer != 0) { + this->timer = 0; InitAnimationForceUpdate(this, 0); } } @@ -633,8 +633,8 @@ void VaatiTransfiguredType2Action0(Entity* this) { sub_08040648(this, 2, 1); sub_08040648(this, 2, 2); this->action = 1; - this->actionDelay = 0; - this->field_0xf = (Random() & 0x7f) + 0x17; + this->timer = 0; + this->subtimer = (Random() & 0x7f) + 0x17; this->field_0x74.HALF.LO = 0; InitAnimationForceUpdate(this, 0); } @@ -666,9 +666,9 @@ void VaatiTransfiguredType2Action1(Entity* this) { case 0: switch (this->field_0x74.HALF.LO) { case 0: - if (--this->field_0xf == 0) { - this->field_0xf = (Random() & 0x7f) + 0x27; - if ((this->field_0xf & 1) != 0) { + if (--this->subtimer == 0) { + this->subtimer = (Random() & 0x7f) + 0x27; + if ((this->subtimer & 1) != 0) { this->field_0x74.HALF.LO = 1; InitAnimationForceUpdate(this, 8); } @@ -677,19 +677,19 @@ void VaatiTransfiguredType2Action1(Entity* this) { case 1: if ((this->frame & ANIM_DONE) != 0) { this->field_0x74.HALF.LO = 0; - this->field_0xf = (Random() & 0x7f) + 0x17; + this->subtimer = (Random() & 0x7f) + 0x17; InitAnimationForceUpdate(this, 0); } break; case 0x10: InitAnimationForceUpdate(this, 7); this->field_0x74.HALF.LO = 0x11; - this->field_0xf = 0x50; + this->subtimer = 0x50; break; case 0x11: - if (--this->field_0xf == 0) { + if (--this->subtimer == 0) { this->field_0x74.HALF.LO = 1; - this->field_0xf = 0x30; + this->subtimer = 0x30; InitAnimationForceUpdate(this, 8); } } @@ -728,7 +728,7 @@ void VaatiTransfiguredType3Action1(Entity* this) { void VaatiTransfiguredType4Action0(Entity* this) { this->action = 1; this->field_0x80.HALF.LO = 0; - this->actionDelay = 10; + this->timer = 10; this->spriteSettings.draw = 0; this->spritePriority.b0 = 7; InitializeAnimation(this, 0); @@ -749,8 +749,8 @@ void VaatiTransfiguredType4Action1(Entity* this) { this->field_0x80.HALF.LO += 1; this->spriteSettings.draw = 1; } - if (--this->actionDelay == 0) { - this->actionDelay = 10; + if (--this->timer == 0) { + this->timer = 10; SoundReq(SFX_149); } } @@ -761,7 +761,7 @@ void VaatiTransfiguredType4Action1(Entity* this) { void VaatiTransfiguredType5Action0(Entity* this) { if (this->type2 != 0) { this->action = 2; - this->actionDelay = 10; + this->timer = 10; this->spritePriority.b0 = 3; InitializeAnimation(this, 2); } else { @@ -796,8 +796,8 @@ void VaatiTransfiguredType5Action1(Entity* this) { sub_08040648(this, this->type, 1); } } - if (--this->actionDelay == 0) { - this->actionDelay = 10; + if (--this->timer == 0) { + this->timer = 10; SoundReq(SFX_149); } GetNextFrame(this); @@ -844,7 +844,7 @@ void sub_08040670(Entity* this) { this->action = 1; this->field_0x80.HALF.LO = 0; this->speed = 0x100; - this->actionDelay = 12; + this->timer = 12; if (this->animationState == 0) { sub_080406A0(this); } else { @@ -1074,26 +1074,26 @@ void sub_080409B0(Entity* this) { Knockback1(this); } } else { - if (((this->bitfield & 0x80) != 0) && (0 < this->iframes)) { + if (((this->contactFlags & 0x80) != 0) && (0 < this->iframes)) { InitScreenShake(0xc, 1); SoundReq(SFX_BOSS_HIT); } - if ((this->bitfield == 0x8a) && (gPlayerState.chargeState.action == 5)) { + if ((this->contactFlags == 0x8a) && (gPlayerState.chargeState.action == 5)) { this->health = 0xc0; } } } void sub_08040AD4(Entity* this) { - u32 actionDelay; + u32 timer; - actionDelay = this->actionDelay & 0x3f; - if ((actionDelay & 0x1f) == 0) { + timer = this->timer & 0x3f; + if ((timer & 0x1f) == 0) { SoundReq(SFX_1A9); } - if ((actionDelay & 3) == 0) { - actionDelay >>= 2; - this->x.HALF.HI += ((actionDelay + 4) & 8) ? -1 : 1; - this->y.HALF.HI += ((actionDelay + 2) & 4) ? -1 : 1; + if ((timer & 3) == 0) { + timer >>= 2; + this->x.HALF.HI += ((timer + 4) & 8) ? -1 : 1; + this->y.HALF.HI += ((timer + 2) & 4) ? -1 : 1; } } diff --git a/src/enemy/vaatiTransfiguredEye.c b/src/enemy/vaatiTransfiguredEye.c index 457b294d..04980820 100644 --- a/src/enemy/vaatiTransfiguredEye.c +++ b/src/enemy/vaatiTransfiguredEye.c @@ -8,7 +8,7 @@ #include "entity.h" #include "enemy.h" #include "message.h" -#include "coord.h" +#include "physics.h" #include "functions.h" void sub_08045A00(Entity*); @@ -59,17 +59,17 @@ void VaatiTransfiguredEye_OnCollision(Entity* this) { if (this->type != 0) { pEVar4 = this->parent->parent; - if ((this->bitfield & 0x80) != 0) { - bVar1 = this->bitfield & 0x3f; + if ((this->contactFlags & 0x80) != 0) { + bVar1 = this->contactFlags & 0x3f; if ((bVar1 == 0xe) || (bVar1 == 0x15)) { if (this->field_0x80.HALF.HI == 0) { this->action = 3; this->field_0x80.HALF.HI += 1; - InitializeAnimation(this, (this->type << 3) | (this->actionDelay + 2)); - InitializeAnimation(this->parent, (this->parent->type << 3) | (this->actionDelay + 2)); + InitializeAnimation(this, (this->type << 3) | (this->timer + 2)); + InitializeAnimation(this->parent, (this->parent->type << 3) | (this->timer + 2)); } - if (this->actionDelay != 0) { + if (this->timer != 0) { SoundReq(SFX_17A); } else { SoundReq(SFX_ITEM_GLOVES_KNOCKBACK); @@ -77,7 +77,7 @@ void VaatiTransfiguredEye_OnCollision(Entity* this) { } else { if (this->health != 0xff) { this->health = 0xff; - if (this->actionDelay != 0 && (pEVar4->field_0x80.HALF.HI != 0)) { + if (this->timer != 0 && (pEVar4->field_0x80.HALF.HI != 0)) { pEVar4->field_0x76.HALF.LO |= (1 << this->type2); if (this->cutsceneBeh.HALF.HI == 0) { this->cutsceneBeh.HALF.HI += 1; @@ -106,7 +106,7 @@ void VaatiTransfiguredEyeFunction0Action0(Entity* this) { this->field_0x80.HALF.LO = bVar2; this->field_0x80.HALF.HI = bVar2; this->cutsceneBeh.HALF.HI = bVar2; - this->field_0xf = bVar2; + this->subtimer = bVar2; this->field_0x82.HALF.LO = 0x30; this->field_0x82.HALF.HI = bVar2; if (this->type == 0) { @@ -115,7 +115,7 @@ void VaatiTransfiguredEyeFunction0Action0(Entity* this) { if (child != NULL) { child->parent = this; this->child = child; - child->actionDelay = this->actionDelay; + child->timer = this->timer; child->type2 = this->type2; CopyPosition(this, child); } @@ -153,10 +153,10 @@ void VaatiTransfiguredEyeFunction0Action2(Entity* this) { } if ((parent->action == 3) && (parent->field_0x80.HALF.LO == 1)) { this->action = 4; - this->field_0xf = 0; + this->subtimer = 0; if (this->type != 0) { COLLISION_OFF(this); - if (this->actionDelay != 0) { + if (this->timer != 0) { InitializeAnimation(this, this->type << 3 | 5); InitializeAnimation(this->parent, this->parent->type << 3 | 5); } else { @@ -172,7 +172,7 @@ void VaatiTransfiguredEyeFunction0Action3(Entity* this) { if ((this->frame & ANIM_DONE) != 0) { this->action = 2; if (this->type != 0) { - if (this->actionDelay == 0) { + if (this->timer == 0) { this->hitType = 0x32; } else { this->parent->parent->field_0x76.HALF.LO |= (1 << this->type2); @@ -186,9 +186,9 @@ void VaatiTransfiguredEyeFunction0Action4(Entity* this) { Entity* parent; sub_08045A28(this); - if (this->field_0xf == 0) { + if (this->subtimer == 0) { if ((this->frame & ANIM_DONE) != 0) { - this->field_0xf = 0x20; + this->subtimer = 0x20; } } else { parent = this->parent; @@ -197,16 +197,16 @@ void VaatiTransfiguredEyeFunction0Action4(Entity* this) { } if ((parent->animationState < 3) && (parent->action != 3)) { this->action = 1; - this->field_0xf = 0; + this->subtimer = 0; this->field_0x80.HALF.HI = 0; this->cutsceneBeh.HALF.HI = 0; if (this->type != 0) { this->hitType = 0x33; } if ((parent->field_0x74.HALF.HI >> this->type2 & 1U) != 0) { - this->actionDelay = 1; + this->timer = 1; } else { - this->actionDelay = 0; + this->timer = 0; } InitializeAnimation(this, this->type << 3 | 1); } diff --git a/src/enemy/vaatiWrath.c b/src/enemy/vaatiWrath.c index f2c8c769..44c2569b 100644 --- a/src/enemy/vaatiWrath.c +++ b/src/enemy/vaatiWrath.c @@ -101,7 +101,7 @@ 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->health == 0)) { + if (((this->type == 0) && ((this->contactFlags & 0x80) != 0)) && (this->health == 0)) { COLLISION_ON(this); this->health = 0xff; if (--this->cutsceneBeh.HALF.LO == 0) { @@ -134,7 +134,7 @@ void VaatiWrathType0Action0(Entity* this) { this->subAction = 1; } else { this->action = 2; - this->actionDelay = 0x3c; + this->timer = 0x3c; } this->x.HALF.HI = gRoomTransition.hurtType; this->y.HALF.HI = gRoomTransition.field_0x42; @@ -145,7 +145,7 @@ void VaatiWrathType0Action0(Entity* this) { } this->action = 1; this->subAction = bVar1; - this->actionDelay = 120; + this->timer = 120; this->spritePriority.b1 = 0; this->z.HALF.HI = 0xffb0; gRoomControls.camera_target = this; @@ -178,36 +178,36 @@ void VaatiWrathType0Action1(Entity* this) { break; case 2: sub_08042004(this); - if (this->actionDelay != 0) { - this->actionDelay--; + if (this->timer != 0) { + this->timer--; } else { if (sub_08041F74(this, 0) == 0) { return; } this->subAction = 3; - this->actionDelay = 0x3c; + this->timer = 0x3c; } break; case 3: sub_08042004(this); - if (this->actionDelay != 0) { - this->actionDelay--; + if (this->timer != 0) { + this->timer--; } else { if (sub_08041F74(this, 1) != 0) { this->subAction = 4; - this->actionDelay = 120; - this->field_0xf = 0; + this->timer = 120; + this->subtimer = 0; } } break; case 4: sub_08042004(this); - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->subAction = 5; } else { - if ((this->actionDelay < 0x3d) && (this->field_0xf == 0)) { + if ((this->timer < 0x3d) && (this->subtimer == 0)) { if (sub_08041F1C(this) != 0) { - this->field_0xf = 1; + this->subtimer = 1; } } } @@ -215,18 +215,18 @@ void VaatiWrathType0Action1(Entity* this) { case 5: sub_08042004(this); this->subAction = 6; - this->actionDelay = 0x1e; + this->timer = 0x1e; gRoomTransition.field_0x38 |= 1; gRoomControls.camera_target = &gPlayerEntity; gPlayerState.controlMode = CONTROL_1; break; default: sub_08042004(this); - if (--this->actionDelay != 0) { + if (--this->timer != 0) { return; } this->action = 2; - this->actionDelay = 0x3c; + this->timer = 0x3c; break; } } @@ -234,8 +234,8 @@ void VaatiWrathType0Action1(Entity* this) { void VaatiWrathType0Action2(Entity* this) { sub_08042004(this); UpdateAnimationSingleFrame(this); - if (--this->actionDelay == 0) { - this->field_0xf = (Random() & 1) + 1; + if (--this->timer == 0) { + this->subtimer = (Random() & 1) + 1; sub_08042028(this); } } @@ -262,18 +262,18 @@ void VaatiWrathType0Action3(Entity* this) { } } - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 4; - this->actionDelay = 8; + this->timer = 8; } else { - if (this->actionDelay < 0x1e) { + if (this->timer < 0x1e) { this->speed -= 8; } else { if (this->speed < 0x100) { this->speed += 6; } } - if ((this->actionDelay & 3) == 0) { + if ((this->timer & 3) == 0) { sub_08004596(this, sub_0804207C(this)); } } @@ -284,8 +284,8 @@ void VaatiWrathType0Action3(Entity* this) { void VaatiWrathType0Action4(Entity* this) { sub_08042004(this); UpdateAnimationSingleFrame(this); - if (--this->actionDelay == 0) { - if (--this->field_0xf == 0) { + if (--this->timer == 0) { + if (--this->subtimer == 0) { sub_08042120(this); } else { sub_08042028(this); @@ -320,7 +320,7 @@ void VaatiWrathType0Action5(Entity* this) { arm->action = 4; arm->subAction = 0; } else { - this->field_0xf = (Random() & 1) + 1; + this->subtimer = (Random() & 1) + 1; sub_08042028(this); } } else { @@ -333,13 +333,13 @@ void VaatiWrathType0Action5(Entity* this) { ((VaatiWrathHeapStruct*)this->myHeap)->object5b = object; gRoomControls.camera_target = object; this->action = 6; - this->actionDelay = 0x1e; + this->timer = 0x1e; ((VaatiWrathHeapStruct*)this->myHeap)->type1->subAction = 1; InitializeAnimation(((VaatiWrathHeapStruct*)this->myHeap)->type1, 0xe); } } else { this->action = 2; - this->actionDelay = 0x3c; + this->timer = 0x3c; } } } @@ -349,7 +349,7 @@ void VaatiWrathType0Action5(Entity* this) { void VaatiWrathType0Action6(Entity* this) { Entity* type1; - if (this->actionDelay == 0) { + if (this->timer == 0) { type1 = ((VaatiWrathHeapStruct*)this->myHeap)->type1; GetNextFrame(type1); if (type1->frame == 1) { @@ -371,7 +371,7 @@ void VaatiWrathType0Action6(Entity* this) { } } } else { - this->actionDelay--; + this->timer--; } sub_08042004(this); UpdateAnimationSingleFrame(this); @@ -386,7 +386,7 @@ void VaatiWrathType0Action7(Entity* this) { this->direction = ((gRoomControls.origin_y + 0x48) >= this->y.HALF.HI) ? 0x10 : 0; LinearMoveUpdate(this); } else { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { sub_08042050(this); } } @@ -401,11 +401,11 @@ void VaatiWrathType0Action8(Entity* this) { this->direction ^= 0x10; } } - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 9; - this->actionDelay = 0x3c; + this->timer = 0x3c; } else { - if (this->actionDelay < 0x1e) { + if (this->timer < 0x1e) { this->speed -= 0xc; } else { if (0x1ff >= this->speed) @@ -421,17 +421,17 @@ void VaatiWrathType0Action9(Entity* this) { if (this->field_0x78.HALF.HI != 0) { sub_08042214(this); } else { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { if ((gPlayerEntity.x.HALF.HI - this->x.HALF.HI) + 0x40u < 0x81) { this->action = 10; this->field_0x7a.HALF.HI = 0; - ((VaatiWrathHeapStruct*)this->myHeap)->eyes[0]->actionDelay = 1; - ((VaatiWrathHeapStruct*)this->myHeap)->eyes[1]->actionDelay = 1; - ((VaatiWrathHeapStruct*)this->myHeap)->eyes[2]->actionDelay = 1; - ((VaatiWrathHeapStruct*)this->myHeap)->eyes[3]->actionDelay = 1; + ((VaatiWrathHeapStruct*)this->myHeap)->eyes[0]->timer = 1; + ((VaatiWrathHeapStruct*)this->myHeap)->eyes[1]->timer = 1; + ((VaatiWrathHeapStruct*)this->myHeap)->eyes[2]->timer = 1; + ((VaatiWrathHeapStruct*)this->myHeap)->eyes[3]->timer = 1; } else { this->action = 7; - this->actionDelay = 0x1e; + this->timer = 0x1e; this->field_0x78.HALF.HI = 0; } } @@ -445,7 +445,7 @@ void VaatiWrathType0ActionA(Entity* this) { UpdateAnimationSingleFrame(this); if (this->field_0x7a.HALF.HI == 0x0f) { this->action = 7; - this->actionDelay = 120; + this->timer = 120; this->field_0x78.HALF.HI = 0; } else { if (this->field_0x7a.HALF.HI == 0xf0) { @@ -475,7 +475,7 @@ void VaatiWrathType0ActionB(Entity* this) { GetNextFrame(((VaatiWrathHeapStruct*)this->myHeap)->type2); if (GravityUpdate(this, 0x2000) == 0) { this->subAction = 1; - this->actionDelay = 0xf0; + this->timer = 0xf0; this->health = 8; this->hitType = 0x38; InitScreenShake(0x14, 0); @@ -486,16 +486,16 @@ void VaatiWrathType0ActionB(Entity* this) { case 1: UpdateAnimationSingleFrame(this); GetNextFrame(((VaatiWrathHeapStruct*)this->myHeap)->type2); - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->subAction = 2; - this->actionDelay = 0x3c; + this->timer = 0x3c; this->hitType = 0x39; this->health = 0xff; } break; default: - this->spriteOffsetX = gUnk_080D0E64[--this->actionDelay & 3]; - if (this->actionDelay == 0) { + this->spriteOffsetX = gUnk_080D0E64[--this->timer & 3]; + if (this->timer == 0) { this->action = 0xc; this->subAction = 0; ChangeObjPalette(this, 0x140); @@ -520,15 +520,15 @@ void VaatiWrathType0ActionC(Entity* this) { this->z.WORD -= 0x8000; if (this->z.HALF.HI < -4) { this->subAction = 1; - this->actionDelay = 120; + this->timer = 120; this->direction = 0x10; this->speed = 0x80; } break; case 1: sub_08042004(this); - if (this->actionDelay) { - this->actionDelay--; + if (this->timer) { + this->timer--; } else { LinearMoveUpdate(this); if (gRoomControls.origin_y + 0x48 == this->y.HALF.HI) { @@ -563,7 +563,7 @@ void sub_08041BE8(Entity* this) { if (sub_08079F8C()) { this->subAction = 1; - this->actionDelay = 120; + this->timer = 120; this->updatePriority = PRIO_NO_BLOCK; InitAnimationForceUpdate(this, 10); @@ -618,11 +618,11 @@ void sub_08041BE8(Entity* this) { void sub_08041CD0(Entity* this) { GetNextFrame(((VaatiWrathHeapStruct*)this->myHeap)->type2); if (this->frame & ANIM_DONE) { - if (this->actionDelay != 0) { - this->actionDelay--; + if (this->timer != 0) { + this->timer--; } else { this->subAction = 2; - this->actionDelay = 0x3c; + this->timer = 0x3c; MessageFromTarget(0x1651); } } else { @@ -635,8 +635,8 @@ void sub_08041D14(Entity* this) { GetNextFrame(((VaatiWrathHeapStruct*)this->myHeap)->type2); if ((gMessage.doTextBox & 0x7f) == 0) { - if (this->actionDelay != 0) { - this->actionDelay--; + if (this->timer != 0) { + this->timer--; } else { if (gEntCount < 0x46) { pEVar1 = CreateObject(OBJECT_B6, 0, 0); @@ -645,8 +645,8 @@ void sub_08041D14(Entity* this) { pEVar1 = CreateObject(OBJECT_B6, 1, 0); pEVar1->parent = this; this->subAction = 3; - this->actionDelay = 0x96; - this->field_0xf = 0; + this->timer = 0x96; + this->subtimer = 0; this->spriteSettings.draw = 0; SoundReq(SFX_1C4); } @@ -656,16 +656,16 @@ void sub_08041D14(Entity* this) { void sub_08041D84(Entity* this) { GetNextFrame(((VaatiWrathHeapStruct*)this->myHeap)->type2); - if (this->actionDelay != 0) { - this->actionDelay--; + if (this->timer != 0) { + this->timer--; } else { - if (this->field_0xf < 0xf0) { - if ((0xb7 < this->field_0xf) && ((this->field_0xf & 7) == 0)) { + if (this->subtimer < 0xf0) { + if ((0xb7 < this->subtimer) && ((this->subtimer & 7) == 0)) { ChangeObjPalette(((VaatiWrathHeapStruct*)this->myHeap)->type2, - gUnk_080D0E80[(this->field_0xf - 0xb8) >> 3]); - ChangeObjPalette(this->child, gUnk_080D0E80[(this->field_0xf - 0xb8) >> 3]); + gUnk_080D0E80[(this->subtimer - 0xb8) >> 3]); + ChangeObjPalette(this->child, gUnk_080D0E80[(this->subtimer - 0xb8) >> 3]); } - if (this->field_0xf == 0xe6) { + if (this->subtimer == 0xe6) { SetFade(7, 4); } } else { @@ -674,25 +674,25 @@ void sub_08041D84(Entity* this) { ChangeObjPalette(this, 0x173); InitAnimationForceUpdate(this, 0xb); } - this->field_0xf++; + this->subtimer++; sub_08041E78(this); } } void sub_08041E20(Entity* this) { - this->field_0xf += 1; + this->subtimer += 1; sub_08041E78(this); GetNextFrame(((VaatiWrathHeapStruct*)this->myHeap)->type2); if (gFadeControl.active == 0) { this->subAction = 5; - this->actionDelay = 0x5a; + this->timer = 0x5a; } } void sub_08041E50(Entity* this) { Entity* type2; - if (--this->actionDelay == 0) { + if (--this->timer == 0) { SetGlobalFlag(ENDING); type2 = ((VaatiWrathHeapStruct*)this->myHeap)->type2; type2->myHeap = NULL; @@ -705,10 +705,10 @@ void sub_08041E78(Entity* this) { Entity* fx; const s8* temp; - if ((this->field_0xf & 0xf) == 0) { + if ((this->subtimer & 0xf) == 0) { fx = CreateFx(this, FX_GIANT_EXPLOSION4, 0); if (fx != NULL) { - temp = &gUnk_080D0E90[this->field_0xf >> 3 & 0xe]; + temp = &gUnk_080D0E90[this->subtimer >> 3 & 0xe]; fx->x.HALF.HI += *temp++; fx->y.HALF.HI += *temp; fx->spritePriority.b0 = 3; @@ -804,7 +804,7 @@ void sub_08042004(Entity* this) { void sub_08042028(Entity* this) { this->action = 3; - this->actionDelay = gUnk_080D0EA8[Random() & 3]; + this->timer = gUnk_080D0EA8[Random() & 3]; this->speed = 0x40; this->direction = sub_0804207C(this); } @@ -814,7 +814,7 @@ void sub_08042050(Entity* this) { this->action = 8; uVar1 = Random(); - this->actionDelay = gUnk_080D0EAC[uVar1 & 3]; + this->timer = gUnk_080D0EAC[uVar1 & 3]; this->speed = 0x20; this->direction = ((uVar1 >> 8) & 0x10) + 8; } @@ -983,7 +983,7 @@ void sub_0804235C(Entity* this) { Entity* type1; this->action = 7; - this->actionDelay = 120; + this->timer = 120; this->field_0x78.HALF.HI = 0; this->field_0x7c.HALF.HI = 0xf0; InitAnimationForceUpdate(this, 0); diff --git a/src/enemy/vaatiWrathEye.c b/src/enemy/vaatiWrathEye.c index 784be12b..c5d0a044 100644 --- a/src/enemy/vaatiWrathEye.c +++ b/src/enemy/vaatiWrathEye.c @@ -92,33 +92,33 @@ void VaatiWrathEyeAction3(Entity* this) { 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; + this->timer = 0x3c; } } } void VaatiWrathEyeAction4(Entity* this) { sub_080485FC(this); - if (this->actionDelay != 0) { - if (--this->actionDelay == 0) { + if (this->timer != 0) { + if (--this->timer == 0) { InitializeAnimation(this, 3); } } else { GetNextFrame(this); if ((this->frame & ANIM_DONE) != 0) { this->action = 5; - this->actionDelay = 0; + this->timer = 0; } } } void VaatiWrathEyeAction5(Entity* this) { - if (this->actionDelay != 0) { + if (this->timer != 0) { this->action = 6; if (this->parent->health >= 0x15) { - this->actionDelay = 120; + this->timer = 120; } else { - this->actionDelay = 0x3c; + this->timer = 0x3c; } this->child = NULL; InitializeAnimation(this, 5); @@ -132,15 +132,15 @@ void VaatiWrathEyeAction6(Entity* this) { sub_080485FC(this); GetNextFrame(this); - if (this->actionDelay != 0) { - if (--this->actionDelay == 0) { + if (this->timer != 0) { + if (--this->timer == 0) { InitializeAnimation(this, 6); } } else { if (this->frame & ANIM_DONE) { this->action = 7; - this->actionDelay = 120; - this->field_0xf = 0; + this->timer = 120; + this->subtimer = 0; } else { if (this->frame & 1) { this->frame &= 0xfe; @@ -158,28 +158,28 @@ void VaatiWrathEyeAction6(Entity* this) { void VaatiWrathEyeAction7(Entity* this) { sub_080485FC(this); GetNextFrame(this); - if (this->field_0xf != 0) { + if (this->subtimer != 0) { this->action = 8; - this->actionDelay = 0x3c; + this->timer = 0x3c; COLLISION_OFF(this); this->spriteSettings.draw = 0; CreateFx(this, FX_REFLECT2, 0x40); this->parent->field_0x7a.HALF.HI |= 0x10 << this->type; } else { - if (--this->actionDelay != 0) { + if (--this->timer != 0) { return; } this->action = 5; - this->actionDelay = 0; + this->timer = 0; this->parent->field_0x7a.HALF.HI |= 1 << this->type; } } void VaatiWrathEyeAction8(Entity* this) { if (this->parent->action == 0xb) { - this->actionDelay = 0x3c; + this->timer = 0x3c; } else { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 9; COLLISION_ON(this); this->spriteSettings.draw = 1; @@ -195,7 +195,7 @@ void VaatiWrathEyeAction9(Entity* this) { GetNextFrame(this); if ((this->frame & ANIM_DONE) != 0) { this->action = 4; - this->actionDelay = 1; + this->timer = 1; this->parent->field_0x7a.HALF.HI = (this->parent->field_0x7a.HALF.HI & 0xf) | (1 << this->type); } } diff --git a/src/enemy/wallMaster.c b/src/enemy/wallMaster.c index b9377a19..0e06f87e 100644 --- a/src/enemy/wallMaster.c +++ b/src/enemy/wallMaster.c @@ -29,7 +29,7 @@ void WallMaster_OnTick(Entity* this) { } void WallMaster_OnCollision(Entity* this) { - if (this->hitType != 0x75 && ((this->bitfield & 0x7f) == 0 || (this->bitfield & 0x7f) == 0x1e)) { + if (this->hitType != 0x75 && ((this->contactFlags & 0x7f) == 0 || (this->contactFlags & 0x7f) == 0x1e)) { this->action = 5; COLLISION_OFF(this); this->field_0x7c.HALF.HI = gPlayerEntity.x.HALF.HI; @@ -61,8 +61,8 @@ void sub_0802A4E4(Entity* this) { this->collisionLayer = 3; this->field_0x7c.BYTES.byte1 = Random(); this->field_0x7a.HWORD = this->type2 * 0x3c; - this->field_0x7c.BYTES.byte0 = this->actionDelay; - this->field_0x78.HWORD = this->actionDelay * 0x3c; + this->field_0x7c.BYTES.byte0 = this->timer; + this->field_0x78.HWORD = this->timer * 0x3c; UpdateSpriteForCollisionLayer(this); sub_0802A7D0(this); } @@ -74,7 +74,7 @@ void sub_0802A534(Entity* this) { Entity* ent = sub_08049DF4(1); if (ent != NULL) { this->action = 2; - this->actionDelay = 0x5a; + this->timer = 0x5a; COLLISION_ON(this); this->spriteSettings.draw = 3; this->x.HALF.HI = ent->x.HALF.HI; @@ -90,8 +90,8 @@ void sub_0802A534(Entity* this) { void sub_0802A5B8(Entity* this) { sub_0802A7D0(this); - if (this->actionDelay) { - if (--this->actionDelay == 0) { + if (this->timer) { + if (--this->timer == 0) { EnqueueSFX(SFX_12D); InitializeAnimation(this, 0); } @@ -115,7 +115,7 @@ void sub_0802A610(Entity* this) { flags = this->frame & ANIM_DONE; if (flags) { this->action = 4; - this->actionDelay = 0x1e; + this->timer = 0x1e; } else if (this->frame & 1) { this->frame = flags; this->hitType = 0x75; @@ -157,7 +157,7 @@ void sub_0802A69C(Entity* this) { flags = this->frame & ANIM_DONE; if (flags) { this->action = 6; - this->actionDelay = 0x1e; + this->timer = 0x1e; } else if (this->frame & 0x1) { this->frame = flags; this->spriteOffsetY = 3; @@ -167,7 +167,7 @@ void sub_0802A69C(Entity* this) { void sub_0802A734(Entity* this) { sub_0802A7D0(this); - if (--this->actionDelay == 0) { + if (--this->timer == 0) { SetInitializationPriority(); DoExitTransition(gUnk_0813AB1C[gArea.dungeon_idx]); } else { diff --git a/src/enemy/wallMaster2.c b/src/enemy/wallMaster2.c index 989097fe..59a3e042 100644 --- a/src/enemy/wallMaster2.c +++ b/src/enemy/wallMaster2.c @@ -34,8 +34,8 @@ void WallMaster2_OnTick(Entity* this) { } void WallMaster2_OnCollision(Entity* this) { - u8 bVar1 = this->bitfield & 0x7f; - switch (this->bitfield & 0x7f) { + u8 bVar1 = this->contactFlags & 0x7f; + switch (this->contactFlags & 0x7f) { case 0 ... 1: case 0x1e: this->action = 3; @@ -59,8 +59,8 @@ void sub_0802CCE0(Entity* this) { sub_0804A720(this); this->action = 1; - this->actionDelay = 60; - this->field_0xf = Random(); + this->timer = 60; + this->subtimer = Random(); this->spriteSettings.shadow = 2; this->animationState = 0xff; this->z.HALF.HI = -2; @@ -87,7 +87,7 @@ void sub_0802CD54(Entity* this) { this->action = 2; tmp = Random() >> 0x10; - this->actionDelay = tmp; + this->timer = tmp; this->speed = 0xc0; this->field_0x78.HWORD = gUnk_080CD728[Random() & 3]; this->field_0x7a.HALF.HI = (tmp >> 8) & 0x60; @@ -95,8 +95,8 @@ void sub_0802CD54(Entity* this) { } } - if (--this->actionDelay == 0) { - this->actionDelay = 60; + if (--this->timer == 0) { + this->timer = 60; sub_0802CF64(this); } LinearMoveUpdate(this); @@ -104,14 +104,14 @@ void sub_0802CD54(Entity* this) { void sub_0802CDE8(Entity* this) { if (--this->field_0x78.HWORD && sub_08049FDC(this, 1)) { - if ((this->actionDelay++ & 3) == 0) { + if ((this->timer++ & 3) == 0) { sub_08004596(this, GetFacingDirection(this, gUnk_020000B0)); sub_0802CF8C(this); } LinearMoveUpdate(this); } else { this->action = 1; - this->actionDelay = 60; + this->timer = 60; this->speed = 0x60; this->field_0x7c.HALF.LO = (Random() & 0x38) + 0x96; } @@ -134,7 +134,7 @@ void sub_0802CE68(Entity* this) { frames = this->frame & ANIM_DONE; if (frames) { this->action = 4; - this->actionDelay = 30; + this->timer = 30; } else if (this->frame & 1) { this->frame = frames; gPlayerEntity.spriteSettings.draw = 0; @@ -143,7 +143,7 @@ void sub_0802CE68(Entity* this) { void sub_0802CEF4(Entity* this) { sub_0802CFD8(this); - if (--this->actionDelay == 0) { + if (--this->timer == 0) { SetInitializationPriority(); DoExitTransition(gUnk_0813AB1C[gArea.dungeon_idx]); } else { diff --git a/src/enemy/waterDrop.c b/src/enemy/waterDrop.c index 2b390879..51da1e65 100644 --- a/src/enemy/waterDrop.c +++ b/src/enemy/waterDrop.c @@ -25,7 +25,7 @@ void sub_0802A250(Entity* this) { Entity* ent; this->action = 1; - this->actionDelay = 0; + this->timer = 0; this->zVelocity = Q_16_16(-3.0); this->speed = gUnk_080CD03C[Random() & 3]; this->direction = gUnk_080CD040[Random() & 3] + 0x18; diff --git a/src/enemy/wisp.c b/src/enemy/wisp.c index 73f82457..be4d3f75 100644 --- a/src/enemy/wisp.c +++ b/src/enemy/wisp.c @@ -31,7 +31,7 @@ void Wisp_OnCollision(Entity* this) { u32 bits; Entity* ent; - bits = this->bitfield; + bits = this->contactFlags; if ((bits & 0x80) == 0) { return; } @@ -61,7 +61,7 @@ void Wisp_OnCollision(Entity* this) { ent = CreateFx(this, FX_DEATH, 0); if (ent != NULL) { this->child = ent; - this->actionDelay = 0xe; + this->timer = 0xe; CopyPosition(this, ent); } DeleteThisEntity(); @@ -91,9 +91,9 @@ void sub_08033660(Entity* this) { void sub_08033674(Entity* this) { sub_0804A720(this); - this->actionDelay = 0; + this->timer = 0; this->action = 1; - this->field_0x1c = 1; + this->gustJarFlags = 1; this->field_0x80.HWORD = this->x.HALF.HI; this->field_0x82.HWORD = this->y.HALF.HI; sub_08033744(this); @@ -101,7 +101,7 @@ void sub_08033674(Entity* this) { } void sub_080336A8(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { sub_08033744(this); } else if (this->collisions != COL_NONE) { sub_0800417E(this, this->collisions); @@ -135,7 +135,7 @@ static void sub_08033744(Entity* this) { u32 rand = (u32)Random() % 256; // 8 potential options - this->actionDelay = gUnk_080CEBA4[(rand & 0x70) >> 4]; + this->timer = gUnk_080CEBA4[(rand & 0x70) >> 4]; // 4 potential options temp = ((rand & 0xc) * 2); diff --git a/src/enemy/wizzrobeFire.c b/src/enemy/wizzrobeFire.c index 9cf0272d..714f3866 100644 --- a/src/enemy/wizzrobeFire.c +++ b/src/enemy/wizzrobeFire.c @@ -40,8 +40,8 @@ void WizzrobeFire_Init(WizzrobeEntity* this) { super->action = 1; this->timer2 = 0xff; this->timer1 = 0x28; - super->actionDelay = 0x28; - super->field_0xf = 0x60; + super->timer = 0x28; + super->subtimer = 0x60; sub_0802F888(this); projectile = CreateProjectileWithParent(super, FIRE_PROJECTILE, 0); if (projectile != NULL) { @@ -58,25 +58,25 @@ void WizzrobeFire_Action1(WizzrobeEntity* this) { switch (this->timer2) { case 0xff: - if (--super->field_0xf == 0) { + if (--super->subtimer == 0) { this->timer2 = 0; } break; case 0: - if (--super->actionDelay == 0) { + if (--super->timer == 0) { this->timer2 += 1; - super->actionDelay = 0x0e; + super->timer = 0x0e; super->flags |= 0x80; } break; case 1: - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = 2; this->timer2 = 0; - super->actionDelay = 0x20; + super->timer = 0x20; tmp = super->direction >> 3; child = super->child; - child->actionDelay = 1; + child->timer = 1; child->spriteSettings.draw = 1; InitializeAnimation(super, tmp | 4); } @@ -90,11 +90,11 @@ void WizzrobeFire_Action1(WizzrobeEntity* this) { void WizzrobeFire_Action2(WizzrobeEntity* this) { switch (this->timer2) { case 0: - switch (--super->actionDelay) { + switch (--super->timer) { case 0: this->timer2 += 1; - super->actionDelay = 0x38; - super->field_0xf = 0; + super->timer = 0x38; + super->subtimer = 0; super->child->spriteSettings.draw = 0; break; case 6: @@ -108,11 +108,11 @@ void WizzrobeFire_Action2(WizzrobeEntity* this) { } break; case 1: - if (--super->actionDelay == 0) { + if (--super->timer == 0) { this->timer2++; this->timer1 = 0x28; - super->actionDelay = 0x28; - super->field_0xf = 0; + super->timer = 0x28; + super->subtimer = 0; super->flags &= 0x7f; SetTile(this->tileIndex, this->tilePosition, super->collisionLayer); EnqueueSFX(SFX_156); @@ -121,18 +121,18 @@ void WizzrobeFire_Action2(WizzrobeEntity* this) { break; case 2: - if (--super->actionDelay == 0) { + if (--super->timer == 0) { this->timer2++; - super->actionDelay = (Random() & 0x3f) + 0x1c; + super->timer = (Random() & 0x3f) + 0x1c; super->spriteSettings.draw = 0; } break; case 3: - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = 1; this->timer2 = 0; this->timer1 = 0x28; - super->actionDelay = 0x28; + super->timer = 0x28; EnqueueSFX(SFX_156); sub_0802F8E4(this); InitializeAnimation(super, super->direction >> 3); diff --git a/src/enemy/wizzrobeIce.c b/src/enemy/wizzrobeIce.c index b053eb71..78397f59 100644 --- a/src/enemy/wizzrobeIce.c +++ b/src/enemy/wizzrobeIce.c @@ -29,7 +29,7 @@ void WizzrobeIce_OnCollision(WizzrobeEntity* this) { Create0x68FX(super, FX_STARS); } EnemyFunctionHandlerAfterCollision(super, WizzrobeIce_Functions); - if (super->bitfield == 0x87) { + if (super->contactFlags == 0x87) { Entity* obj = CreateObject(OBJECT_2A, 3, 0); if (obj != NULL) { obj->spritePriority.b0 = 3; @@ -49,8 +49,8 @@ void WizzrobeIce_Init(WizzrobeEntity* this) { super->action = 1; this->timer2 = 0xff; this->timer1 = 0x28; - super->actionDelay = 0x28; - super->field_0xf = 0x60; + super->timer = 0x28; + super->subtimer = 0x60; sub_0802F888(this); projectile = CreateProjectileWithParent(super, ICE_PROJECTILE, 0); if (projectile != NULL) { @@ -66,26 +66,26 @@ void WizzrobeIce_Action1(WizzrobeEntity* this) { Entity* child; switch (this->timer2) { case 0xff: - if (--super->field_0xf == 0) { + if (--super->subtimer == 0) { this->timer2 = 0; } break; case 0: - if (--super->actionDelay == 0) { + if (--super->timer == 0) { this->timer2++; - super->actionDelay = 0xc; + super->timer = 0xc; super->flags |= 0x80; } break; case 1: - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = 2; this->timer2 = 0; - super->actionDelay = 0x20; + super->timer = 0x20; tmp = super->direction >> 3; child = super->child; - child->actionDelay = 1; + child->timer = 1; child->spriteSettings.draw = 1; InitializeAnimation(super, tmp | 4); } @@ -97,11 +97,11 @@ void WizzrobeIce_Action1(WizzrobeEntity* this) { void WizzrobeIce_Action2(WizzrobeEntity* this) { switch (this->timer2) { case 0: - switch (--super->actionDelay) { + switch (--super->timer) { case 0: this->timer2 += 1; - super->actionDelay = 0x38; - super->field_0xf = 0; + super->timer = 0x38; + super->subtimer = 0; super->child->spriteSettings.draw = 0; break; case 0xa: @@ -115,11 +115,11 @@ void WizzrobeIce_Action2(WizzrobeEntity* this) { } break; case 1: - if (--super->actionDelay == 0) { + if (--super->timer == 0) { this->timer2++; this->timer1 = 0x28; - super->actionDelay = 0x28; - super->field_0xf = 0; + super->timer = 0x28; + super->subtimer = 0; super->flags &= 0x7f; SetTile(this->tileIndex, this->tilePosition, super->collisionLayer); EnqueueSFX(SFX_156); @@ -127,18 +127,18 @@ void WizzrobeIce_Action2(WizzrobeEntity* this) { } break; case 2: - if (--super->actionDelay == 0) { + if (--super->timer == 0) { this->timer2++; - super->actionDelay = (Random() & 0x3f) + 0x18; + super->timer = (Random() & 0x3f) + 0x18; super->spriteSettings.draw = 0; } break; case 3: - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = 1; this->timer2 = 0; this->timer1 = 0x28; - super->actionDelay = 0x28; + super->timer = 0x28; EnqueueSFX(SFX_156); sub_0802F8E4(this); InitializeAnimation(super, super->direction >> 3); diff --git a/src/enemy/wizzrobeWind.c b/src/enemy/wizzrobeWind.c index 4fce3d5a..79fe7f9a 100644 --- a/src/enemy/wizzrobeWind.c +++ b/src/enemy/wizzrobeWind.c @@ -36,7 +36,7 @@ void WizzrobeWind_OnCollision(WizzrobeEntity* this) { Create0x68FX(super, FX_STARS); } EnemyFunctionHandlerAfterCollision(super, WizzrobeWind_Functions); - if (super->bitfield == 0x87) { + if (super->contactFlags == 0x87) { Entity* obj = CreateObject(OBJECT_2A, 3, 0); if (obj != NULL) { obj->spritePriority.b0 = 3; @@ -57,7 +57,7 @@ void WizzrobeWind_Init(WizzrobeEntity* this) { super->speed = 0xc0; super->flags |= 0x80; this->targetIndex = 0; - super->child = (Entity*)GetCurrentRoomProperty(super->actionDelay); + super->child = (Entity*)GetCurrentRoomProperty(super->timer); sub_0802FA48(this); sub_0802FA88(this); } else { @@ -65,8 +65,8 @@ void WizzrobeWind_Init(WizzrobeEntity* this) { super->action = 1; this->timer2 = 0xff; this->timer1 = 0x28; - super->actionDelay = 0x28; - super->field_0xf = 0x60; + super->timer = 0x28; + super->subtimer = 0x60; sub_0802F888(this); } projectile = CreateProjectileWithParent(super, WIND_PROJECTILE, 0); @@ -83,25 +83,25 @@ void WizzrobeWind_Action1(WizzrobeEntity* this) { Entity* parent; switch (this->timer2) { case 0xff: - if (--super->field_0xf == 0) { + if (--super->subtimer == 0) { this->timer2 = 0; } break; case 0: - if (--super->actionDelay == 0) { + if (--super->timer == 0) { this->timer2++; - super->actionDelay = 0x10; + super->timer = 0x10; super->flags |= 0x80; } break; case 1: - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = 2; this->timer2 = 0; - super->actionDelay = 0x28; + super->timer = 0x28; tmp = super->direction >> 3; parent = super->parent; - parent->actionDelay = 1; + parent->timer = 1; parent->spriteSettings.draw = 1; InitializeAnimation(super, tmp | 4); } @@ -113,11 +113,11 @@ void WizzrobeWind_Action1(WizzrobeEntity* this) { void WizzrobeWind_Action2(WizzrobeEntity* this) { switch (this->timer2) { case 0: - switch (--super->actionDelay) { + switch (--super->timer) { case 0: this->timer2++; - super->actionDelay = 0x38; - super->field_0xf = 0; + super->timer = 0x38; + super->subtimer = 0; super->parent->spriteSettings.draw = 0; break; case 8: @@ -131,11 +131,11 @@ void WizzrobeWind_Action2(WizzrobeEntity* this) { } break; case 1: - if (--super->actionDelay == 0) { + if (--super->timer == 0) { this->timer2++; this->timer1 = 0x28; - super->actionDelay = 0x28; - super->field_0xf = 0; + super->timer = 0x28; + super->subtimer = 0; super->flags &= 0x7f; EnqueueSFX(SFX_156); SetTile(this->tileIndex, this->tilePosition, super->collisionLayer); @@ -143,18 +143,18 @@ void WizzrobeWind_Action2(WizzrobeEntity* this) { } break; case 2: - if (--super->actionDelay == 0) { + if (--super->timer == 0) { this->timer2++; - super->actionDelay = (Random() & 0x3f) + 0x20; + super->timer = (Random() & 0x3f) + 0x20; super->spriteSettings.draw = 0; } break; case 3: - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = 1; this->timer2 = 0; this->timer1 = 0x28; - super->actionDelay = 0x28; + super->timer = 0x28; EnqueueSFX(SFX_156); sub_0802F8E4(this); InitializeAnimation(super, super->direction >> 3); @@ -174,25 +174,25 @@ void WizzrobeWind_Action3(WizzrobeEntity* this) { switch (this->timer2) { case 0: this->timer2 = 1; - super->actionDelay = 0x40; + super->timer = 0x40; break; case 1: - if (--super->actionDelay != 0) { + if (--super->timer != 0) { return; } this->timer2++; - super->actionDelay = 0x28; - parent->actionDelay = 1; + super->timer = 0x28; + parent->timer = 1; parent->spriteSettings.draw = 1; InitializeAnimation(super, super->animationState >> 1 | 4); break; case 2: - if (--super->actionDelay == 0) { + if (--super->timer == 0) { this->timer2++; - super->actionDelay = (Random() & 0x1f) + 0x30; + super->timer = (Random() & 0x1f) + 0x30; parent->spriteSettings.draw = 0; InitializeAnimation(super, super->animationState >> 1); - } else if (super->actionDelay == 8) { + } else if (super->timer == 8) { parent = CreateProjectileWithParent(super, WIND_PROJECTILE, 1); if (parent != NULL) { parent->direction = super->direction & 0x18; @@ -250,7 +250,7 @@ void sub_0802F8E4(WizzrobeEntity* this) { } void sub_0802F9C8(WizzrobeEntity* this) { - if (super->field_0xf == 0) { + if (super->subtimer == 0) { if (this->timer1 != 0) { if ((--this->timer1 & 1) != 0) { super->spriteSettings.draw = 0; |
