diff options
| author | theo3 <arisstephenson2@gmail.com> | 2022-03-28 19:51:32 -0700 |
|---|---|---|
| committer | theo3 <arisstephenson2@gmail.com> | 2022-03-28 20:10:22 -0700 |
| commit | 92240d43147dd36ed879ce1084f7ca6e35f1db96 (patch) | |
| tree | 78a3119e1cd63d4f3333a3cade6cc622cdcb6db1 /src/object | |
| parent | 755571834d4fc0e21fdd45b065728c87574a3a07 (diff) | |
name remaining entity fields
Diffstat (limited to 'src/object')
127 files changed, 1088 insertions, 1088 deletions
diff --git a/src/object/ambientClouds.c b/src/object/ambientClouds.c index 22fa0964..acddf0c1 100644 --- a/src/object/ambientClouds.c +++ b/src/object/ambientClouds.c @@ -82,12 +82,12 @@ void sub_08089944(Entity* this) { this->spriteRendering.b3 = 0; if ((this->type2 == 1) || (this->child->action == 2)) { if (gPlayerEntity.z.HALF.HI < -0x24) - this->actionDelay = 1; + this->timer = 1; else - this->actionDelay = 0; + this->timer = 0; this->y.HALF.HI += (this->type2 - 1) * -0x24; iVar1 = EntityInRectRadius(this, &gPlayerEntity, 0xf, 0xf); - if ((iVar1 != 0) && (this->actionDelay != 0)) { + if ((iVar1 != 0) && (this->timer != 0)) { this->action = 2; this->spriteOrientation.flipY = 2; this->spriteRendering.b3 = 3; @@ -98,7 +98,7 @@ void sub_08089944(Entity* this) { gPlayerEntity.y.HALF.HI -= 0x24; gPlayerEntity.z.HALF.HI += 0x24; sub_0807AA80(&gPlayerEntity); - if (this->field_0xf == 0) { + if (this->subtimer == 0) { pEVar2 = CreateFx(&gPlayerEntity, FX_DEATH, 0); if (pEVar2 != NULL) { pEVar2->x.HALF.HI += 8; @@ -118,7 +118,7 @@ void sub_08089944(Entity* this) { } } this->y.HALF.HI += (this->type2 - 1) * 0x24; - this->field_0xf = this->actionDelay; + this->subtimer = this->timer; } } } diff --git a/src/object/angryStatue.c b/src/object/angryStatue.c index f1feeb36..f997a69f 100644 --- a/src/object/angryStatue.c +++ b/src/object/angryStatue.c @@ -29,7 +29,7 @@ void AngryStatue_Init(Entity* this) { } void AngryStatue_Action1(Entity* this) { - if (this->parent->field_0xf == 1) { + if (this->parent->subtimer == 1) { this->action = 2; InitializeAnimation(this, this->type + 4); } @@ -62,9 +62,9 @@ void AngryStatue_Action2(Entity* this) { } void AngryStatue_Action3(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 4; - this->actionDelay = 15; + this->timer = 15; InitializeAnimation(this, this->type); } else { this->parent->z.BYTES.byte2 |= 1 << this->type2; @@ -73,7 +73,7 @@ void AngryStatue_Action3(Entity* this) { void AngryStatue_Action4(Entity* this) { this->spriteSettings.draw ^= 1; - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 1; this->spriteSettings.draw = 1; } diff --git a/src/object/backgroundCloud.c b/src/object/backgroundCloud.c index 176bdd58..617ce505 100644 --- a/src/object/backgroundCloud.c +++ b/src/object/backgroundCloud.c @@ -21,7 +21,7 @@ void sub_0808F658(Entity* this) { this->field_0x7a.HWORD = gRoomControls.origin_x + gRoomControls.width + 0x60; this->animationState = 0; this->x.HALF.HI += (Random() & 0xf) << 4; - this->actionDelay = 0; + this->timer = 0; this->subAction = 0; } @@ -35,7 +35,7 @@ void sub_0808F6E0(Entity* this) { void sub_0808F70C(Entity* this) { if (this->subAction == 0) { this->subAction = 1; - this->actionDelay = ((Random() & 7) << 3) + 31; + this->timer = ((Random() & 7) << 3) + 31; if ((this->direction & 0x10)) { this->x.HALF.HI = this->field_0x7a.HWORD; @@ -48,7 +48,7 @@ void sub_0808F70C(Entity* this) { } if (this->subAction == 1) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 1; this->subAction = 0; } diff --git a/src/object/bakerOven.c b/src/object/bakerOven.c index d4b26c28..8f77955f 100644 --- a/src/object/bakerOven.c +++ b/src/object/bakerOven.c @@ -31,10 +31,10 @@ void sub_0809CC74(Entity* this) { } else { if (this->type2 & 1) { this->spriteSettings.draw = 1; - this->actionDelay = 20; + this->timer = 20; } else { this->action = 2; - this->actionDelay = (this->type2 & 2) ? 20 : 18; + this->timer = (this->type2 & 2) ? 20 : 18; } InitializeAnimation(this, 0); } @@ -57,9 +57,9 @@ void sub_0809CD0C(Entity* this) { } /* Damage minish link if he touches a steam cloud */ - if (this->field_0xf == 0 && gPlayerEntity.iframes == 0 && this->frameIndex && + if (this->subtimer == 0 && gPlayerEntity.iframes == 0 && this->frameIndex && sub_0806FC80(this, &gPlayerEntity, 4)) { - this->field_0xf++; + this->subtimer++; ModHealth(-2); SoundReqClipped(&gPlayerEntity, SFX_PLY_VO6); gPlayerEntity.iframes = 16; @@ -72,10 +72,10 @@ void sub_0809CD0C(Entity* this) { void sub_0809CDB4(Entity* this) { /* Reset cloud position and start animation. */ - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 1; - this->actionDelay = 30; - this->field_0xf = 0; + this->timer = 30; + this->subtimer = 0; this->spriteSettings.draw = 1; this->y.HALF.HI = this->parent->y.HALF.HI - 0xe; InitializeAnimation(this, 0); diff --git a/src/object/barrelInside.c b/src/object/barrelInside.c index ea09fd37..fee1a436 100644 --- a/src/object/barrelInside.c +++ b/src/object/barrelInside.c @@ -9,8 +9,8 @@ void BarrelInside(Entity* this) { this->action = 1; this->spriteSettings.draw = 1; this->frameIndex = this->type; - this->actionDelay = 0x10; - this->field_0xf = 1; + this->timer = 0x10; + this->subtimer = 1; ptr = gUnk_08120C80 + this->type * 3; this->spriteRendering.b3 = *ptr; this->spritePriority.b0 = *(ptr + 1); @@ -18,11 +18,11 @@ void BarrelInside(Entity* this) { } if (this->type == 4) { - if (--this->actionDelay == 0) { - this->actionDelay = 0x10; - this->frameIndex = gUnk_08120C92[this->field_0xf++]; - if (this->field_0xf == 3) { - this->field_0xf = 0; + if (--this->timer == 0) { + this->timer = 0x10; + this->frameIndex = gUnk_08120C92[this->subtimer++]; + if (this->subtimer == 3) { + this->subtimer = 0; } } } diff --git a/src/object/beanstalk.c b/src/object/beanstalk.c index 5dace1cc..ee4a6ab0 100644 --- a/src/object/beanstalk.c +++ b/src/object/beanstalk.c @@ -76,8 +76,8 @@ void Beanstalk_Init(BeanstalkEntity* this) { return; } #endif - if (super->type2 == 0 && super->actionDelay != 0) { - if (CheckLocalFlag(super->actionDelay) == 0) { + if (super->type2 == 0 && super->timer != 0) { + if (CheckLocalFlag(super->timer) == 0) { return; } super->spriteOrientation.flipY = 2; @@ -104,22 +104,22 @@ void Beanstalk_Init(BeanstalkEntity* this) { case 5: case 6: super->spriteVramOffset = 0x1c0; - super->actionDelay = 0; + super->timer = 0; break; case 7: switch (super->type2) { case 0: this->unk_6c = 0x10; - super->actionDelay = 0; + super->timer = 0; do { obj = CreateObject(BEANSTALK, 7, 1); super->child = obj; if (obj != NULL) { obj->x.HALF.HI = super->x.HALF.HI; (super->child)->y.HALF.HI = super->y.HALF.HI - (s16)this->unk_6c; - super->field_0xf = 4; - while (--super->field_0xf != 0) { - ptr = &gUnk_08120DFC[super->actionDelay]; + super->subtimer = 4; + while (--super->subtimer != 0) { + ptr = &gUnk_08120DFC[super->timer]; obj = CreateObject(BEANSTALK, 7, ptr->type - 2); super->child = obj; if (obj != NULL) { @@ -127,15 +127,15 @@ void Beanstalk_Init(BeanstalkEntity* this) { (super->child)->y.HALF.HI = (super->y.HALF.HI - (s16)this->unk_6c) - ptr->y; super->child->spriteSettings.flipX = ptr->flipX; } - super->actionDelay++; + super->timer++; } - if (super->actionDelay > 5) { - super->actionDelay = 0; + if (super->timer > 5) { + super->timer = 0; } } this->unk_6c += 0x38; } while (((s16)(super->y.HALF_U.HI - this->unk_6c)) >= gRoomControls.origin_y); - super->actionDelay = 1; + super->timer = 1; break; case 2: case 3: @@ -170,19 +170,19 @@ void Beanstalk_Action1Type0(BeanstalkEntity* this) { void Beanstalk_Action1Type0SubAction0(BeanstalkEntity* this) { UpdateAnimationSingleFrame(super); if ((super->frame & ANIM_DONE) != 0) { - if (super->actionDelay < 2) { - super->actionDelay++; + if (super->timer < 2) { + super->timer++; } else { InitAnimationForceUpdate(super, 1); - super->actionDelay = 0x10; + super->timer = 0x10; super->subAction++; } } } void Beanstalk_Action1Type0SubAction1(BeanstalkEntity* this) { - if (super->actionDelay-- == 0) { - super->actionDelay = 0x10; + if (super->timer-- == 0) { + super->timer = 0x10; SoundReq(SFX_198); } UpdateAnimationSingleFrame(super); @@ -205,8 +205,8 @@ void Beanstalk_Action1Type0SubAction1(BeanstalkEntity* this) { } void Beanstalk_Action1Type0SubAction2(BeanstalkEntity* this) { - if (super->actionDelay-- == 0) { - super->actionDelay = 0x10; + if (super->timer-- == 0) { + super->timer = 0x10; SoundReq(SFX_198); } } @@ -217,15 +217,15 @@ void Beanstalk_Action1Type2(BeanstalkEntity* this) { GetNextFrame(super); if ((super->frame & 1) != 0) { - ptr = &gUnk_08120DFC[super->actionDelay]; + ptr = &gUnk_08120DFC[super->timer]; super->child = CreateObject(BEANSTALK, ptr->type, 0); if (super->child != NULL) { super->child->x.HALF.HI = super->x.HALF.HI + ptr->x; super->child->y.HALF.HI = super->y.HALF.HI - ptr->y; super->child->spriteSettings.flipX = ptr->flipX; } - if (++super->actionDelay > 5) { - super->actionDelay = 0; + if (++super->timer > 5) { + super->timer = 0; } } if ((super->frame & ANIM_DONE) != 0) { @@ -253,7 +253,7 @@ void Beanstalk_Action1Type1(BeanstalkEntity* this) { void Beanstalk_Action1Type7(BeanstalkEntity* this) { switch (super->type2) { case 0: - if (super->actionDelay == 0) { + if (super->timer == 0) { return; } this->unk_6c = gRoomControls.origin_y; @@ -269,7 +269,7 @@ void Beanstalk_Action1Type7(BeanstalkEntity* this) { break; } } - super->actionDelay = 0; + super->timer = 0; return; break; case 1: @@ -279,15 +279,15 @@ void Beanstalk_Action1Type7(BeanstalkEntity* this) { case 4: if (gPlayerState.floor_type == 0x1e) { if (EntityInRectRadius(super, &gPlayerEntity, 0, 8)) { - if ((super->animIndex == (super->type2 - 1) * 3 + 1) && (super->actionDelay == 0)) { - super->actionDelay = 1; + if ((super->animIndex == (super->type2 - 1) * 3 + 1) && (super->timer == 0)) { + super->timer = 1; InitializeAnimation(super, super->animIndex + 1); } } else { - super->actionDelay = 0; + super->timer = 0; } } else { - super->actionDelay = 0; + super->timer = 0; } GetNextFrame(super); if ((super->frame & ANIM_DONE) != 0) { @@ -319,7 +319,7 @@ void Beanstalk_Action1Type8SubAction0(BeanstalkEntity* this) { obj->spriteVramOffset = super->spriteVramOffset; obj->palette.b.b0 = super->palette.b.b0; obj->animIndex = 2; - obj->actionDelay = 0x80; + obj->timer = 0x80; obj->type = 1; obj->spriteRendering.b3 = 2; obj->spritePriority.b0 = 6; diff --git a/src/object/bigBarrel.c b/src/object/bigBarrel.c index 77e6ff6a..3bb56c73 100644 --- a/src/object/bigBarrel.c +++ b/src/object/bigBarrel.c @@ -59,30 +59,30 @@ void sub_08088A68(BigBarrelEntity* this) { } else { if (gRoomVars.animFlags & 1) { gRoomVars.animFlags &= ~1; - super->actionDelay = 1; + super->timer = 1; this->unk68 = gUnk_08120C1C; SoundReq(SFX_BARREL_ENTER); } if (gRoomVars.animFlags & 2) { gRoomVars.animFlags &= ~2; - super->actionDelay = 1; + super->timer = 1; this->unk68 = gUnk_08120C25; SoundReq(SFX_BARREL_RELEASE); } if (gRoomVars.animFlags & 4) { gRoomVars.animFlags &= ~4; - super->actionDelay = 1; + super->timer = 1; this->unk68 = gUnk_08120C2E; SoundReq(SFX_BARREL_ENTER); } - if (super->actionDelay) { - if (super->actionDelay-- == 1) { + if (super->timer) { + if (super->timer-- == 1) { pcVar3 = this->unk68; uVar3 = pcVar3[0]; *(u8*)&super->spriteOffsetY = uVar3; pcVar3++; if (*pcVar3 != 0xff) { - super->actionDelay = 8; + super->timer = 8; this->unk68 = pcVar3; } else { super->spriteOffsetY = 0; @@ -154,8 +154,8 @@ void sub_08088C9C(BigBarrelEntity* this) { } else { localFlag = 22; } - super->field_0xf = localFlag; - if (CheckLocalFlag(super->field_0xf) == 0) { + super->subtimer = localFlag; + if (CheckLocalFlag(super->subtimer) == 0) { return; } @@ -163,7 +163,7 @@ void sub_08088C9C(BigBarrelEntity* this) { super->action = 4; break; case 1: - if (CheckLocalFlag(super->field_0xf) == 0) { + if (CheckLocalFlag(super->subtimer) == 0) { return; } super->action = 2; @@ -175,12 +175,12 @@ void sub_08088C9C(BigBarrelEntity* this) { gRoomVars.animFlags &= ~0x20; super->action = 3; super->subAction = 4; - super->actionDelay = 1; + super->timer = 1; case 3: - if (--super->actionDelay) { + if (--super->timer) { return; } - super->actionDelay = 8; + super->timer = 8; x = super->x.HALF.HI; if (super->type2) { super->x.HALF.HI = x - 2; @@ -209,7 +209,7 @@ void sub_08088DB4(BigBarrelEntity* this) { case 1: if (CheckLocalFlag(super->type2)) { super->action++; - super->actionDelay = 10; + super->timer = 10; } break; case 2: @@ -218,15 +218,15 @@ void sub_08088DB4(BigBarrelEntity* this) { if ((gRoomVars.animFlags & 8) == 0) { return; } - if (--super->actionDelay) { + if (--super->timer) { return; } - super->actionDelay = 0x1e; + super->timer = 0x1e; super->frameIndex++; super->action++; break; default: - if (--super->actionDelay == 0) { + if (--super->timer == 0) { gRoomVars.animFlags &= ~0x8; DeleteEntity(super); } @@ -277,7 +277,7 @@ void sub_08088F20(BigBarrelEntity* this) { return; } super->action = 2; - super->actionDelay = 30; + super->timer = 30; RequestPriorityDuration(super, 0x10e); pEVar3 = CreateObject(OBJECT_2A, 1, 0); if (pEVar3 != NULL) { @@ -290,7 +290,7 @@ void sub_08088F20(BigBarrelEntity* this) { SetTileType(0x76, COORD_TO_TILE(super), 2); break; case 2: - if (--super->actionDelay) { + if (--super->timer) { return; } sub_08089094(this); @@ -301,10 +301,10 @@ void sub_08088F20(BigBarrelEntity* this) { return; } super->action = 4; - super->actionDelay = 0x78; + super->timer = 0x78; break; default: - if (--super->actionDelay == 0x5a) { + if (--super->timer == 0x5a) { if (CheckLocalFlags(0x15, 2)) { gRoomVars.animFlags |= 2; } else { @@ -312,7 +312,7 @@ void sub_08088F20(BigBarrelEntity* this) { } gRoomVars.animFlags |= 0x20; } - if (super->actionDelay == 0) { + if (super->timer == 0) { gRoomVars.animFlags &= ~0x10; if (CheckLocalFlags(0x15, 2)) { RequestPriorityDuration(super, 0x3c); diff --git a/src/object/bigIceBlock.c b/src/object/bigIceBlock.c index f86ac054..e3251336 100644 --- a/src/object/bigIceBlock.c +++ b/src/object/bigIceBlock.c @@ -48,7 +48,7 @@ void BigIceBlock_Init(BigIceBlockEntity* this) { super->action = 1; super->flags |= 0x80; super->updatePriority = 3; - super->field_0x3c = 7; + super->collisionFlags = 7; super->hurtType = 0x48; super->hitType = 1; super->flags2 = 0x80; @@ -64,7 +64,7 @@ void BigIceBlock_Init(BigIceBlockEntity* this) { void BigIceBlock_Action1(BigIceBlockEntity* this) { if (sub_0809963C(this)) { super->action = 2; - super->actionDelay = 0; + super->timer = 0; EnqueueSFX(SFX_ICE_BLOCK_MELT); BigIceBlock_Action2(this); } @@ -73,20 +73,20 @@ void BigIceBlock_Action1(BigIceBlockEntity* this) { void BigIceBlock_Action2(BigIceBlockEntity* this) { u32 tmp; if (!sub_0809963C(this)) { - if (super->actionDelay >= 2) { - super->actionDelay -= 2; + if (super->timer >= 2) { + super->timer -= 2; } else { - super->actionDelay = 0; + super->timer = 0; } - if (super->actionDelay == 0) { + if (super->timer == 0) { super->action = 1; sub_0805EC60(super); return; } } else { - super->actionDelay += 1; + super->timer += 1; } - tmp = gUnk_081237B0[super->actionDelay >> 5]; + tmp = gUnk_081237B0[super->timer >> 5]; SetAffineInfo(super, 0x100, tmp, 0); if (super->type != 1) { if (super->type != 2) { @@ -96,7 +96,7 @@ void BigIceBlock_Action2(BigIceBlockEntity* this) { } } super->action = 3; - super->actionDelay = 0x3c; + super->timer = 0x3c; super->flags &= 0x7f; } @@ -107,13 +107,13 @@ void sub_08099880(BigIceBlockEntity* this) { u32 uVar4; s32 x; - if (--super->actionDelay == 0) { + if (--super->timer == 0) { DeleteThisEntity(); } else { - if (super->actionDelay == 0x30) { + if (super->timer == 0x30) { sub_08099C18(this); } - uVar4 = (0x3c - super->actionDelay) * 0x20 + 0x100; + uVar4 = (0x3c - super->timer) * 0x20 + 0x100; SetAffineInfo(super, 0x100, uVar4, 0); sub_0806FCF4(super, uVar4, 2, 0); obj = CreateObject(SPECIAL_FX, 0x11, 0x40); diff --git a/src/object/bigVortex.c b/src/object/bigVortex.c index 00e43c6b..2aa0f349 100644 --- a/src/object/bigVortex.c +++ b/src/object/bigVortex.c @@ -42,7 +42,7 @@ void sub_08098D6C(Entity* this) { if (CheckFlags(this->field_0x86.HWORD)) { this->action = 2; - this->actionDelay = 0x2d; + this->timer = 0x2d; ent = CreateFx(this, FX_BIG_EXPLOSION2, 0); if (ent != NULL) { ent->y.HALF.HI += 8; @@ -51,7 +51,7 @@ void sub_08098D6C(Entity* this) { } void sub_08098D9C(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 3; this->spriteSettings.draw = TRUE; sub_08098E88(this); diff --git a/src/object/bird.c b/src/object/bird.c index c798c6f5..78798b49 100644 --- a/src/object/bird.c +++ b/src/object/bird.c @@ -45,8 +45,8 @@ void Bird_Type0_Init(Entity* this) { this->action++; this->spriteSettings.draw = TRUE; - this->actionDelay = 0x31; - this->field_0xf = 1; + this->timer = 0x31; + this->subtimer = 1; this->zVelocity = Q_16_16(-1.5); this->z.WORD = Q_16_16(-56.75); this->field_0x68.HWORD = Q_16_16(-0.03125); @@ -68,9 +68,9 @@ void Bird_Type0_Init(Entity* this) { void Bird_Type0_Action1(Entity* this) { LinearMoveUpdate(this); GravityUpdate(this, *(s16*)&this->field_0x68.HWORD); - if (this->actionDelay != 0) { - if (--this->actionDelay == 0) { - this->field_0xf = 0; + if (this->timer != 0) { + if (--this->timer == 0) { + this->subtimer = 0; } } else if (CheckOnScreen(this) == 0) { DeleteThisEntity(); @@ -105,7 +105,7 @@ void Bird_Type1_Action1_Subaction0(Entity* this) { u32 temp; if (this->parent != NULL) { - temp = this->parent->field_0xf; + temp = this->parent->subtimer; if (temp != 0) { PositionRelative(this->parent, this, 0, Q_16_16(8.0)); } else { @@ -183,9 +183,9 @@ void Bird_Type8(Entity* this) { switch (this->action) { case 0: - if (this->actionDelay != 0) { + if (this->timer != 0) { this->frameIndex = 0xff; - this->actionDelay--; + this->timer--; return; } this->action = 1; @@ -221,7 +221,7 @@ void Bird_Type8(Entity* this) { if (pEVar5 != NULL) { this->child = pEVar5; this->action = 2; - this->actionDelay = 8; + this->timer = 8; this->speed = 0x300; this->field_0x68.HWORD = 0xe000; PlayerDropHeldObject(); @@ -249,17 +249,17 @@ void Bird_Type8(Entity* this) { pEVar5 = this->child; if (pEVar5 != NULL) { if (gPlayerEntity.x.HALF.HI < this->x.HALF.HI - 8) { - this->actionDelay = 0; + this->timer = 0; } - if (this->actionDelay == 0) { + if (this->timer == 0) { PositionRelative(this, pEVar5, 0xfff80000, 0); pEVar5->z.HALF.HI += 0x18; pEVar5->spritePriority.b0 = this->spritePriority.b0; pEVar5->spriteRendering.b3 = this->spriteRendering.b3; pEVar5->spriteOrientation.flipY = this->spriteOrientation.flipY; } else { - this->actionDelay--; + this->timer--; CopyPosition(&gPlayerEntity, pEVar5); } } @@ -375,7 +375,7 @@ void CreateBird(void) { if (!FindEntity(OBJECT, BIRD, 6, 8, 0)) { birdEnt = CreateObject(BIRD, 8, 0); if (birdEnt != NULL) { - birdEnt->actionDelay = 0; + birdEnt->timer = 0; } } } diff --git a/src/object/blockPushed.c b/src/object/blockPushed.c index 58280fcd..387518f6 100644 --- a/src/object/blockPushed.c +++ b/src/object/blockPushed.c @@ -38,7 +38,7 @@ void sub_08082EB4(BlockPushedEntity* this) { super->spriteSettings.draw = 1; } super->action = 1; - super->actionDelay = 0x20; + super->timer = 0x20; super->speed = 0x80; super->spritePriority.b0 = 6; pos = COORD_TO_TILE(super); @@ -93,7 +93,7 @@ void sub_08082EB4(BlockPushedEntity* this) { void sub_08083094(BlockPushedEntity* this) { LinearMoveUpdate(super); sub_0800445C(super); - if (--super->actionDelay == 0) { + if (--super->timer == 0) { sub_080830B8(this); } } diff --git a/src/object/book.c b/src/object/book.c index 3c9e12b5..05af98ed 100644 --- a/src/object/book.c +++ b/src/object/book.c @@ -45,8 +45,8 @@ void sub_0809B3C4(Entity* this) { switch (this->type2) { case 0: this->action = 1; - this->actionDelay = 22; - this->field_0xf = 2; + this->timer = 22; + this->subtimer = 2; this->field_0x80.HALF.LO = 0; this->spritePriority.b0 = 3; break; @@ -82,12 +82,12 @@ void sub_0809B4A8(Entity* this) { } if (sub_0809B688(this)) { - if (--this->actionDelay) { + if (--this->timer) { return; } this->action = 2; - this->actionDelay = 30; + this->timer = 30; this->speed = 0x40; this->direction = 0x10; @@ -100,19 +100,19 @@ void sub_0809B4A8(Entity* this) { gPlayerEntity.direction = gPlayerEntity.animationState << 2; EnqueueSFX(SFX_10F); } else { - this->actionDelay = 22; + this->timer = 22; } } void sub_0809B524(Entity* this) { - if (--this->actionDelay == 0) { - if (--this->field_0xf == 0) { + if (--this->timer == 0) { + if (--this->subtimer == 0) { this->action = 3; this->y.HALF.HI += 0x20; this->z.HALF.HI -= 0x20; } else { this->action = 1; - this->actionDelay = 22; + this->timer = 22; this->field_0x80.HALF.LO = 0x18; } } diff --git a/src/object/bossDoor.c b/src/object/bossDoor.c index 0d1844e1..dd199b79 100644 --- a/src/object/bossDoor.c +++ b/src/object/bossDoor.c @@ -105,7 +105,7 @@ void BossDoor_Action2(BossDoorEntity* this) { void BossDoor_Action3(BossDoorEntity* this) { LinearMoveUpdate(super); - if (--super->actionDelay == 0) { + if (--super->timer == 0) { if (super->type < 4) { sub_08078AC0(0x40, 0, 1); gPlayerEntity.direction = super->type << 3; @@ -120,7 +120,7 @@ void BossDoor_Action4(BossDoorEntity* this) { if (sub_08083734(super, this->unk_76)) { super->action = 5; - super->actionDelay = 0xc; + super->timer = 0xc; super->spriteSettings.draw = 1; super->direction = *(u8*)&this->unk_76 << 3 ^ 0x10; ptr = &gUnk_081214F4[this->unk_76 * 2]; @@ -136,7 +136,7 @@ void BossDoor_Action5(BossDoorEntity* this) { const s8* ptr; LinearMoveUpdate(super); - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = 6; super->z.HALF.HI = 0; super->x.HALF.HI = this->unk_70; @@ -166,7 +166,7 @@ void sub_0808C4BC(BossDoorEntity* this) { static const s8 gUnk_0812150C[] = { 0, -2, 2, 0, 0, 2, -2, 0 }; const s8* ptr; super->action = 3; - super->actionDelay = 0xc; + super->timer = 0xc; super->direction = this->unk_76 * 8; ptr = &gUnk_0812150C[this->unk_76 * 2]; super->x.HALF.HI += ptr[0]; diff --git a/src/object/button.c b/src/object/button.c index d4f602ba..20a34d21 100644 --- a/src/object/button.c +++ b/src/object/button.c @@ -44,7 +44,7 @@ void sub_08081FF8(Entity*); void sub_08081BAC(Entity* this) { if (sub_08081CB0(this)) { this->subAction = 0; - this->actionDelay = 0xA; + this->timer = 0xA; RequestPriorityDuration(this, 0xA); sub_08081FF8(this); if (this->type == 1) { @@ -64,11 +64,11 @@ void sub_08081BE0(Entity* this) { return; if (!sub_08081D28(this)) { this->action = 4; - this->field_0xf = 1; + this->subtimer = 1; if ((gPlayerState.heldObject == 2) || (!(gPlayerState.field_0x35 & 0x80))) { - this->actionDelay = 0x18; + this->timer = 0x18; } else { - this->actionDelay = 0x8; + this->timer = 0x8; } } else { sub_08081E6C(this); @@ -76,15 +76,15 @@ void sub_08081BE0(Entity* this) { } void sub_08081C30(Entity* this) { - if (this->actionDelay != 0) { - this->actionDelay--; - if (this->field_0xf != 0) { - this->field_0xf = 0; + if (this->timer != 0) { + this->timer--; + if (this->subtimer != 0) { + this->subtimer = 0; SetTile(0x4035, this->field_0x74.HWORD, this->collisionLayer); } if (sub_08081CB0(this)) { this->action = 3; - this->actionDelay = 0; + this->timer = 0; } } else { this->action = 2; @@ -239,13 +239,13 @@ void sub_08081F24(Entity* this) { u32 sub_08081F7C(Entity* this, u32 r7) { u16 tmp; - if (this->actionDelay == 0) + if (this->timer == 0) return 1; - if (--this->actionDelay > 6) { + if (--this->timer > 6) { if (this->child != NULL) this->child->spriteOffsetY = -4; } else { - if (this->actionDelay == 6) { + if (this->timer == 6) { SetFlag(this->field_0x86.HWORD); SetTileType(r7, this->field_0x74.HWORD, this->collisionLayer); sub_08081F24(this); diff --git a/src/object/chestSpawner.c b/src/object/chestSpawner.c index af493443..af7f4adb 100644 --- a/src/object/chestSpawner.c +++ b/src/object/chestSpawner.c @@ -102,7 +102,7 @@ void ChestSpawner_Type2Action1(ChestSpawnerEntity* this) { gPauseMenuOptions.disabled = 1; super->action = 2; super->subAction = 0; - super->field_0xf = 0x1e; + super->subtimer = 0x1e; super->spriteSettings.draw = 1; super->spriteRendering.alphaBlend = 1; RequestPriorityDuration(super, 0x1e); @@ -125,17 +125,17 @@ void ChestSpawner_Type2Action2(ChestSpawnerEntity* this) { case 1: if ((super->type == 5) || (gPlayerEntity.action == 1)) { super->subAction = 2; - super->actionDelay = 8; - super->field_0xf = 0; + super->timer = 8; + super->subtimer = 0; SoundReq(SFX_14A); } break; default: sub_0800445C(super); CreateMagicSparkles(super->x.HALF.HI, super->y.HALF.HI, 2); - if (--super->actionDelay == 0) { - super->actionDelay = 8; - tmp = ++super->field_0xf; + if (--super->timer == 0) { + super->timer = 8; + tmp = ++super->subtimer; gScreen.controls.alphaBlend = (((0x10 - tmp) * 0x100) & 0xff00) | tmp; if (gScreen.controls.alphaBlend == 0x10) { gPauseMenuOptions.disabled = 0; @@ -152,7 +152,7 @@ void ChestSpawner_Type2Action3(ChestSpawnerEntity* this) { sub_0800445C(super); if (super->interactType != 0) { super->action = 4; - super->field_0xf = 0x1e; + super->subtimer = 0x1e; sub_080788E0(super); RequestPriorityDuration(super, 0x3c); SoundReq(SFX_CHEST_OPEN); @@ -163,11 +163,11 @@ void ChestSpawner_Type2Action4(ChestSpawnerEntity* this) { sub_0800445C(super); GetNextFrame(super); if ((super->frame & ANIM_DONE) != 0) { - if (--super->field_0xf == 0) { - if (super->actionDelay == 0x18) { + if (--super->subtimer == 0) { + if (super->timer == 0x18) { super->action = 6; - super->actionDelay = 8; - super->field_0xf = 0x10; + super->timer = 8; + super->subtimer = 0x10; } else { super->action = 5; sub_08084074(super->type2); @@ -195,7 +195,7 @@ void sub_080840A8(s32 param_1, s32 param_2) { static const s8 gUnk_0811F850[] = { -6, 0, 0, 6 }; Entity* obj = CreateObject(GROUND_ITEM, gUnk_0811F838[Random() & 7], 0); if (obj != NULL) { - obj->actionDelay = 6; + obj->timer = 6; obj->direction = ((Random() & 7) + 0xc) | 0x80; obj->speed = (Random() & 0xf) * 2 + 0x20; obj->zVelocity = gUnk_0811F840[Random() & 3]; @@ -211,9 +211,9 @@ void sub_080840A8(s32 param_1, s32 param_2) { } void ChestSpawner_Type2Action6(ChestSpawnerEntity* this) { - if (--super->actionDelay == 0) { - super->actionDelay = 8; - if (--super->field_0xf != 0) { + if (--super->timer == 0) { + super->timer = 8; + if (--super->subtimer != 0) { sub_080840A8(super->x.HALF.HI, super->y.HALF.HI); } else { super->action = 5; @@ -263,7 +263,7 @@ void ChestSpawner_Type0Action2(ChestSpawnerEntity* this) { break; } super->action = 3; - this->unk_72 = super->actionDelay * 0x3c; + this->unk_72 = super->timer * 0x3c; if ((super->type & 1) == 0) { DeleteThisEntity(); } diff --git a/src/object/cloud.c b/src/object/cloud.c index a8b22546..5c7349bb 100644 --- a/src/object/cloud.c +++ b/src/object/cloud.c @@ -29,7 +29,7 @@ void sub_0809F4DC(Entity* this) { void sub_0809F514(Entity* this) { this->action = 1; - this->actionDelay = 120; + this->timer = 120; this->spriteSettings.draw = 0; this->field_0x68.HALF.LO = 12; gRoomControls.camera_target = this; @@ -39,9 +39,9 @@ void sub_0809F514(Entity* this) { void sub_0809F548(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 2; - this->actionDelay = 90; + this->timer = 90; SoundReq(SFX_11D); sub_0809F814((((this->x.HALF.HI - gRoomControls.origin_x) >> 4) & 63) | (((this->y.HALF.HI - gRoomControls.origin_y) >> 4) & 63) << 6); @@ -54,7 +54,7 @@ void sub_0809F548(Entity* this) { } void sub_0809F5B0(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { SoundReq(SFX_SECRET_BIG); SetGlobalFlag(KUMOTATSUMAKI); LoadRoomEntityList((EntityData*)&gUnk_080DD750); @@ -71,10 +71,10 @@ void sub_0809F5DC(Entity* this) { void sub_0809F5F0(Entity* this) { u32 iVar1; - iVar1 = CheckRoomFlag(this->actionDelay); + iVar1 = CheckRoomFlag(this->timer); if (iVar1 != 0) { this->action = 2; - this->actionDelay = 120; + this->timer = 120; SetPlayerControl(3); sub_08078B48(); gRoomControls.camera_target = this; @@ -84,12 +84,12 @@ void sub_0809F5F0(Entity* this) { void sub_0809F61C(Entity* this) { if ((gRoomControls.scroll_flags & 4) == 0) { - if (this->actionDelay == 30) { + if (this->timer == 30) { SetLocalFlag(this->type2); } - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 3; - this->actionDelay = 120; + this->timer = 120; SoundReq(SFX_11D); sub_0809F814((((this->x.HALF.HI - gRoomControls.origin_x) >> 4) & 63) | (((this->y.HALF.HI - gRoomControls.origin_y) >> 4) & 63) << 6); @@ -104,8 +104,8 @@ void sub_0809F61C(Entity* this) { void sub_0809F69C(Entity* this) { - if (--this->actionDelay == 0) { - this->actionDelay = 30; + if (--this->timer == 0) { + this->timer = 30; this->action = 4; gRoomControls.camera_target = &gPlayerEntity; SoundReq(SFX_SECRET_BIG); @@ -114,7 +114,7 @@ void sub_0809F69C(Entity* this) { void sub_0809F6CC(Entity* this) { - if (((gRoomControls.scroll_flags & 4) == 0) && (--this->actionDelay == 0)) { + if (((gRoomControls.scroll_flags & 4) == 0) && (--this->timer == 0)) { gPlayerState.controlMode = CONTROL_1; DeleteThisEntity(); } @@ -126,7 +126,7 @@ void sub_0809F700(Entity* this) { if (this->action == 0) { this->action = 1; - this->actionDelay = (Random() & 30) + 8; + this->timer = (Random() & 30) + 8; this->flags = this->flags | 12; } if ((gRoomTransition.frameCount & 3) == 0) { @@ -135,7 +135,7 @@ void sub_0809F700(Entity* this) { this->spriteOffsetY = gUnk_081247C0[uVar2 >> 4 & 7]; } LinearMoveUpdate(this); - if (--this->actionDelay == 0) { + if (--this->timer == 0) { DeleteThisEntity(); } } diff --git a/src/object/crenelBeanSprout.c b/src/object/crenelBeanSprout.c index ec5400b3..ab865f7d 100644 --- a/src/object/crenelBeanSprout.c +++ b/src/object/crenelBeanSprout.c @@ -67,7 +67,7 @@ void CrenelBeanSprout_Init(CrenelBeanSproutEntity* this) { return; } super->type2 = 0; - super->field_0xf = 2; + super->subtimer = 2; sub_080969A4(this); DeleteThisEntity(); } @@ -94,7 +94,7 @@ void CrenelBeanSprout_Init(CrenelBeanSproutEntity* this) { if (obj != NULL) { PositionRelative(super, obj, -0x1c0000, -0x280000); } - super->field_0x16 = 0x10; + super->carryFlags = 0x10; super->spriteRendering.b0 = 3; InitializeAnimation(super, 0xc); CrenelBeanSprout_Action1(this); @@ -114,7 +114,7 @@ void CrenelBeanSprout_Init(CrenelBeanSproutEntity* this) { return; } else { super->type2 = 0; - super->field_0xf = 3; + super->subtimer = 3; sub_080969A4(this); DeleteThisEntity(); return; @@ -241,13 +241,13 @@ void CrenelBeanSprout_Action4(CrenelBeanSproutEntity* this) { gPlayerState.keepFacing |= 0x80; gPlayerState.field_0xa |= 0x80; gPlayerState.field_0x7 |= 0x80; - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = 6; super->subAction = 0; CreateDust(super); } } else { - super->actionDelay = 0xc0; + super->timer = 0xc0; } } @@ -279,8 +279,8 @@ void CrenelBeanSprout_Action6SubAction0(CrenelBeanSproutEntity* this) { 3, }; SetLocalFlag(super->type2); - super->actionDelay = 0x0f; - super->field_0xf = gUnk_081231AC[super->type >> 1]; + super->timer = 0x0f; + super->subtimer = gUnk_081231AC[super->type >> 1]; super->type2 = 0; super->spriteSettings.draw = 0; super->subAction++; @@ -294,22 +294,22 @@ void CrenelBeanSprout_Action6SubAction0(CrenelBeanSproutEntity* this) { void CrenelBeanSprout_Action6SubAction1(CrenelBeanSproutEntity* this) { static const u16 gUnk_081231AE[] = { 0x1cc, 0x1cb, 0x1c9 }; - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->y.HALF.HI += -0x10; sub_0807B7D8(gUnk_081231AE[super->type2], COORD_TO_TILE(super), super->collisionLayer); super->type2++; - if (super->type2 == super->field_0xf) { + if (super->type2 == super->subtimer) { gPlayerState.keepFacing &= 0x7f; super->subAction++; - super->actionDelay = 0x3c; + super->timer = 0x3c; } else { - super->actionDelay = 0x0f; + super->timer = 0x0f; } } } void CrenelBeanSprout_Action6SubAction2(CrenelBeanSproutEntity* this) { - if ((super->actionDelay != 0) && (--super->actionDelay == 0)) { + if ((super->timer != 0) && (--super->timer == 0)) { SoundReq(SFX_SECRET); } } @@ -321,7 +321,7 @@ void sub_080969A4(CrenelBeanSproutEntity* this) { } else { sub_0807B7D8(0x1cd, COORD_TO_TILE(super), super->collisionLayer); } - while (super->type2 != super->field_0xf) { + while (super->type2 != super->subtimer) { super->y.HALF.HI -= 0x10; sub_0807B7D8(gUnk_081231B4[super->type2], COORD_TO_TILE(super), super->collisionLayer); super->type2++; diff --git a/src/object/deathFx.c b/src/object/deathFx.c index dee32ccc..3c305737 100644 --- a/src/object/deathFx.c +++ b/src/object/deathFx.c @@ -43,11 +43,11 @@ void DeathFx_Action0(DeathFxObject* this) { super->collisionLayer = 2; UpdateSpriteForCollisionLayer(&this->base); super->spriteRendering.b0 = 3; - if (super->actionDelay == 0) { + if (super->timer == 0) { tmp = 0x80; } else { - tmp = super->actionDelay; - super->actionDelay = 0; + tmp = super->timer; + super->timer = 0; } SetAffineInfo(super, tmp, tmp, 0); LoadSwapGFX(super, 4, 0); @@ -67,7 +67,7 @@ void DeathFx_Action0(DeathFxObject* this) { uVar4 &= 3; parent = super->parent; if (parent != NULL) { - parent->actionDelay = gUnk_0811EC20[uVar4]; + parent->timer = gUnk_0811EC20[uVar4]; } InitializeAnimation(&this->base, uVar4); } diff --git a/src/object/doubleBookshelf.c b/src/object/doubleBookshelf.c index b1fd39fe..65e1b510 100644 --- a/src/object/doubleBookshelf.c +++ b/src/object/doubleBookshelf.c @@ -81,7 +81,7 @@ void DoubleBookshelf_Action1(DoubleBookshelfEntity* this) { void DoubleBookshelf_Action2(DoubleBookshelfEntity* this) { LinearMoveUpdate(super); - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = 1; this->unk_80 = COORD_TO_TILE(super); SetPlayerControl(CONTROL_ENABLED); diff --git a/src/object/enemyItem.c b/src/object/enemyItem.c index 29f360c6..81910655 100644 --- a/src/object/enemyItem.c +++ b/src/object/enemyItem.c @@ -29,7 +29,7 @@ void EnemyItem(EnemyItemEntity* this) { } if (super->action == 0) { super->action++; - super->type = super->actionDelay; + super->type = super->timer; super->child = NULL; list = &gEntityLists[4]; for (entity = list->first; entity != (Entity*)list; entity = entity->next) { @@ -65,7 +65,7 @@ void sub_080A2508(EnemyItemEntity* this) { entity = (EnemyItemEntity*)CreateObjectWithParent(super, GROUND_ITEM, super->type, 0); if (entity != NULL) { - (entity->base).actionDelay = 5; + (entity->base).timer = 5; entity->unk_86 = this->unk_86; } sub_080A2500(this); @@ -76,7 +76,7 @@ void sub_080A2534(EnemyItemEntity* this) { entity = (EnemyItemEntity*)CreateObjectWithParent(super, GROUND_ITEM, super->type, 0); if (entity != NULL) { - (entity->base).actionDelay = 4; + (entity->base).timer = 4; entity->unk_86 = this->unk_86; } sub_080A2500(this); diff --git a/src/object/eyeSwitch.c b/src/object/eyeSwitch.c index 769a2cdf..67a5f62d 100644 --- a/src/object/eyeSwitch.c +++ b/src/object/eyeSwitch.c @@ -29,7 +29,7 @@ void EyeSwitch(Entity* this) { void sub_080886A4(EyeSwitchEntity* this) { super->animationState = super->type & 3; super->spritePriority.b0 = 6; - super->field_0x3c = 7; + super->collisionFlags = 7; super->hurtType = 0x48; super->hitType = 1; super->flags2 = 2; @@ -45,8 +45,8 @@ void sub_080886A4(EyeSwitchEntity* this) { } void sub_08088718(EyeSwitchEntity* this) { - if ((super->bitfield == 0x95 || super->bitfield == 0x8e) && - (DirectionRoundUp(super->field_0x4c->direction) >> 3 == (super->animationState & 3))) { + if ((super->contactFlags == 0x95 || super->contactFlags == 0x8e) && + (DirectionRoundUp(super->contactedEntity->direction) >> 3 == (super->animationState & 3))) { super->action = 2; COLLISION_OFF(super); EnqueueSFX(SFX_111); @@ -58,15 +58,15 @@ void sub_08088760(EyeSwitchEntity* this) { GetNextFrame(super); if ((super->frame & ANIM_DONE) != 0) { super->action = 3; - this->unk70 = super->actionDelay << 1; + this->unk70 = super->timer << 1; InitializeAnimation(super, super->animationState + 4); } } void sub_08088790(EyeSwitchEntity* this) { - if (super->actionDelay != 0) { + if (super->timer != 0) { if ((this->eyeSwitchFlags2 != this->eyeSwitchFlags) && (CheckFlags(this->eyeSwitchFlags))) { - super->actionDelay = 0; + super->timer = 0; } else { if (--this->unk70 == 0) { super->action = 4; diff --git a/src/object/ezloCap.c b/src/object/ezloCap.c index 1a0d8894..39c7793a 100644 --- a/src/object/ezloCap.c +++ b/src/object/ezloCap.c @@ -68,12 +68,12 @@ void EzloCap_Type0Init(EzloCapEntity* this) { } LoadSwapGFX(super, 1, 3); if (super->type == 0) { - super->field_0xf = 7; + super->subtimer = 7; InitAnimationForceUpdate(super, 7); SoundReq(SFX_F3); } else { - super->actionDelay = 0; - super->field_0xf = 0xa; + super->timer = 0; + super->subtimer = 0xa; super->y.HALF.HI -= 0xe; InitAnimationForceUpdate(super, 0x14); } @@ -89,30 +89,30 @@ void EzloCap_Type0Action1(EzloCapEntity* this) { } if ((gMessage.doTextBox & 0x7f) != 5) { if (((gMessage.unk == 0xa) || (gMessage.unk == 0)) || ((gMessage.unk & 0xf) > 9)) { - if (super->animIndex != (super->field_0xf | 3)) { - InitAnimationForceUpdate(super, super->field_0xf | 3); + if (super->animIndex != (super->subtimer | 3)) { + InitAnimationForceUpdate(super, super->subtimer | 3); return; } } else { if ((gMessage.unk & 0x80) != 0) { if ((super->frame & 0x90) != 0) { - super->field_0xf = gUnk_0811F16C[(s32)Random() % 9]; - InitAnimationForceUpdate(super, super->field_0xf); + super->subtimer = gUnk_0811F16C[(s32)Random() % 9]; + InitAnimationForceUpdate(super, super->subtimer); return; } } else { if (super->animIndex != gUnk_0811F16C[gMessage.unk]) { - super->field_0xf = gUnk_0811F16C[gMessage.unk]; - InitAnimationForceUpdate(super, super->field_0xf); + super->subtimer = gUnk_0811F16C[gMessage.unk]; + InitAnimationForceUpdate(super, super->subtimer); return; } } } } if (super->animIndex > 7) { - super->actionDelay = 1; + super->timer = 1; } else { - super->actionDelay = 0; + super->timer = 0; } UpdateAnimationSingleFrame(super); } @@ -127,10 +127,10 @@ void EzloCap_Type1Action1(EzloCapEntity* this) { } UpdateAnimationSingleFrame(super); if (super->subAction == 0) { - if (super->field_0xf-- == 0) { - super->actionDelay++; - super->field_0xf = 0xa; - tmp = super->actionDelay - 1; + if (super->subtimer-- == 0) { + super->timer++; + super->subtimer = 0xa; + tmp = super->timer - 1; obj = CreateObjectWithParent(super, OBJECT_79, tmp, 0); super->child = obj; if (obj != NULL) { @@ -140,23 +140,23 @@ void EzloCap_Type1Action1(EzloCapEntity* this) { obj->parent = super->parent; } } - if (super->actionDelay == 6) { + if (super->timer == 6) { super->subAction = 3; - super->actionDelay = 0x3c; + super->timer = 0x3c; super->parent->type2 = 1; InitAnimationForceUpdate(super, 0x1c); } else { - InitAnimationForceUpdate(super, gUnk_0811F178[super->actionDelay - 1]); - if (super->actionDelay > 2) { + InitAnimationForceUpdate(super, gUnk_0811F178[super->timer - 1]); + if (super->timer > 2) { super->spriteSettings.flipX = 1; } } } } else if ((super->frame & ANIM_DONE) != 0) { - super->actionDelay = Random() & 3; - if (super->actionDelay != 0) { + super->timer = Random() & 3; + if (super->timer != 0) { super->spriteSettings.flipX = Random() & 1; - InitAnimationForceUpdate(super, super->actionDelay + 0x1b); + InitAnimationForceUpdate(super, super->timer + 0x1b); } } } diff --git a/src/object/fairy.c b/src/object/fairy.c index 3289562c..76fdb2df 100644 --- a/src/object/fairy.c +++ b/src/object/fairy.c @@ -40,13 +40,13 @@ void Fairy(FairyEntity* this) { Fairy_Init, Fairy_Action1, Fairy_Action2, Fairy_Action3, Fairy_Action4, }; - if (((super->bitfield & 0x80) != 0)) { - switch (super->bitfield & 0x7f) { + if (((super->contactFlags & 0x80) != 0)) { + switch (super->contactFlags & 0x7f) { case 0x14: super->action = 3; super->flags &= ~ENT_COLLIDE; super->spriteSettings.draw = 1; - super->child = super->field_0x4c; + super->child = super->contactedEntity; break; case 0x1f: DeleteThisEntity(); @@ -84,7 +84,7 @@ void sub_0808D76C(FairyEntity* this) { void Fairy_SubAction0(FairyEntity* this) { super->subAction = 1; - super->field_0x1d = 1; + super->gustJarTolerance = 1; super->spriteSettings.draw = 1; } @@ -100,13 +100,13 @@ void Fairy_SubAction2(FairyEntity* this) { void Fairy_Init(FairyEntity* this) { super->collisionLayer = 3; - super->field_0x3c = 0x17; + super->collisionFlags = 0x17; super->hurtType = 0x49; super->hitType = 7; super->flags2 = 0x17; super->health = 0xff; super->hitbox = (Hitbox*)&gUnk_080FD1A8; - super->field_0x1c = 1; + super->gustJarFlags = 1; this->unk_74 = super->x.HALF.HI; this->unk_76 = super->y.HALF.HI; SetDefaultPriority(super, 6); @@ -132,13 +132,13 @@ void Fairy_Init(FairyEntity* this) { void Fairy_Action1(FairyEntity* this) { super->z.WORD -= 0xe000; if (super->frame != 0) { - if (super->actionDelay != 0) { + if (super->timer != 0) { this->unk_78 *= 0x1e; } else { this->unk_78 = 600; } super->action = 2; - super->field_0xf = 1; + super->subtimer = 1; super->speed = 0x80; } } @@ -150,10 +150,10 @@ void Fairy_Action2(FairyEntity* this) { 0, 0, }; - if (--super->field_0xf == 0) { + if (--super->subtimer == 0) { u32 rand = Random(); super->flags |= ENT_COLLIDE; - super->field_0xf = 0x20; + super->subtimer = 0x20; super->speed = (u16)gUnk_081217A4[rand >> 8 & 1]; if (sub_0808DAA0(this)) { super->direction = rand & 0x1f; @@ -192,27 +192,27 @@ void Fairy_Action4(FairyEntity* this) { s32 tmp; child = super->child; - tmp = gSineTable[super->actionDelay] * 0xa00; + tmp = gSineTable[super->timer] * 0xa00; if (tmp < 0) { tmp += 0xffff; } super->x.HALF.HI = (tmp >> 0x10) + child->x.HALF.HI; - tmp = gSineTable[super->actionDelay + 0x40] * 0x500; + tmp = gSineTable[super->timer + 0x40] * 0x500; if (tmp < 0) { tmp += 0xffff; } super->y.HALF.HI = child->y.HALF.HI - (tmp >> 0x10); - super->actionDelay += 8; + super->timer += 8; super->z.HALF.HI = child->z.HALF.HI; super->spriteOrientation.flipY = child->spriteOrientation.flipY; super->spriteRendering.b3 = child->spriteRendering.b3; - if ((u8)(super->actionDelay - 0x41) < 0x7f) { + if ((u8)(super->timer - 0x41) < 0x7f) { super->spritePriority.b0 = 3; } else { super->spritePriority.b0 = 5; } - if (--super->field_0xf == 0) { - super->field_0xf = 6; + if (--super->subtimer == 0) { + super->subtimer = 6; if (((--super->spriteOffsetY) * 0x1000000) >> 0x18 < -0x16) { sub_08081404(super, 1); } @@ -239,8 +239,8 @@ void sub_0808DAD0(FairyEntity* this) { DeleteThisEntity(); } super->action = 4; - super->actionDelay = 0x80; - super->field_0xf = 6; + super->timer = 0x80; + super->subtimer = 6; super->flags &= ~ENT_COLLIDE; super->spriteSettings.draw = 1; super->spritePriority.b1 = 2; diff --git a/src/object/fan.c b/src/object/fan.c index d372ff5c..51815c83 100644 --- a/src/object/fan.c +++ b/src/object/fan.c @@ -99,7 +99,7 @@ void sub_0809EE24(FanEntity* this) { void sub_0809EE34(FanEntity* this) { super->action = 1; - this->unk74 = super->actionDelay << 2; + this->unk74 = super->timer << 2; } void sub_0809EE44(FanEntity* this) { @@ -138,7 +138,7 @@ void sub_0809EE44(FanEntity* this) { break; break; case 0x4: - if (super->field_0xf != 0) + if (super->subtimer != 0) bVar3 = 1; break; case 0x11: @@ -215,18 +215,18 @@ void sub_0809EFB0(FanEntity* this) { } void sub_0809F08C(FanEntity* this) { - if (super->field_0xf != 0) { - super->field_0xf--; + if (super->subtimer != 0) { + super->subtimer--; } GetNextFrame(super); if (super->frame & 0x20) { super->frame &= ~0x20; - super->field_0xf = 20; + super->subtimer = 20; sub_0809F0E4(this); } else { - if ((super->frame & 0x10) && super->field_0xf == 0) { - super->field_0xf = 20; + if ((super->frame & 0x10) && super->subtimer == 0) { + super->subtimer = 20; super->frame ^= 0x10; sub_0809F0E4(this); } diff --git a/src/object/figurineDevice.c b/src/object/figurineDevice.c index f4c5602c..741548a7 100644 --- a/src/object/figurineDevice.c +++ b/src/object/figurineDevice.c @@ -112,8 +112,8 @@ void FigurineDevice_Init(FigurineDeviceEntity* this) { InitializeAnimation(super, 1); break; case 3: - super->actionDelay = 0x1e; - super->field_0xf = 0; + super->timer = 0x1e; + super->subtimer = 0; this->unk_81 = 1; this->unk_7a = 0; this->unk_7b = 0; @@ -176,9 +176,9 @@ void FigurineDevice_Action2(FigurineDeviceEntity* this) { entity = CreateObject(FIGURINE_DEVICE, 2, 0); if (entity != NULL) { entity->parent = super; - entity->field_0xf = this->unk_7d; + entity->subtimer = this->unk_7d; ptr = (u8*)gUnk_080FC3E4; // FIXME use struct - entity->type2 = ptr[(entity->field_0xf << 3) + 7]; + entity->type2 = ptr[(entity->subtimer << 3) + 7]; PositionRelative(super, entity, 0x80000, 0x70000); } EnqueueSFX(SFX_111); @@ -199,7 +199,7 @@ void FigurineDevice_Action3(FigurineDeviceEntity* this) { case 0: if ((super->frame & ANIM_DONE) != 0) { this->unk_7a = 1; - super->actionDelay = 0x28; + super->timer = 0x28; ChangeObjPalette(super, gUnk_08120AA8[super->type2]); InitializeAnimation(super, 2); SoundReq(SFX_110); @@ -207,10 +207,10 @@ void FigurineDevice_Action3(FigurineDeviceEntity* this) { break; case 1: - if (((super->frame & ANIM_DONE) != 0) && (--super->actionDelay == 0)) { + if (((super->frame & ANIM_DONE) != 0) && (--super->timer == 0)) { this->unk_7a = 2; SetRoomFlag(2); - MenuFadeIn(7, super->field_0xf); + MenuFadeIn(7, super->subtimer); } break; case 2: @@ -248,13 +248,13 @@ void FigurineDevice_Action4(FigurineDeviceEntity* this) { } break; case 1: - if (super->actionDelay != 0) { - super->actionDelay--; + if (super->timer != 0) { + super->timer--; } if ((gInput.newKeys & 1) != 0) { SoundReq(SFX_TEXTBOX_SELECT); this->unk_7a = 2; - super->actionDelay = 0x3c; + super->timer = 0x3c; sub_08050384(); return; } @@ -322,8 +322,8 @@ void sub_08087F58(FigurineDeviceEntity* this) { ASM_FUNC("asm/non_matching/figurineDevice/sub_08087F94.inc", void sub_08087F94(FigurineDeviceEntity* this, s32 param_2)) void sub_08088034(FigurineDeviceEntity* this) { - if (super->actionDelay == 0) { - super->actionDelay = 0x14; + if (super->timer == 0) { + super->timer = 0x14; SoundReq(SFX_MENU_ERROR); } } diff --git a/src/object/fileScreenObjects.c b/src/object/fileScreenObjects.c index d08dce01..9a00d152 100644 --- a/src/object/fileScreenObjects.c +++ b/src/object/fileScreenObjects.c @@ -394,8 +394,8 @@ void sub_0808ED98(Entity* this) { this->y.HALF.HI = y; this->field_0x6a.HWORD = y; - this->field_0xf++; - this->spriteOffsetY = gUnk_08121D10[(this->field_0xf / 4) & 0x7]; + this->subtimer++; + this->spriteOffsetY = gUnk_08121D10[(this->subtimer / 4) & 0x7]; sub_0808EF6C(this); } @@ -424,9 +424,9 @@ void nullsub_522(Entity* this) { } void sub_0808EE98(Entity* this) { - this->actionDelay = gUI.lastState; - this->frameIndex = gUnk_08121D48[this->actionDelay]; - if (this->actionDelay != 2) { + this->timer = gUI.lastState; + this->frameIndex = gUnk_08121D48[this->timer]; + if (this->timer != 2) { this->field_0x68.HWORD = 96; } else { this->field_0x68.HWORD = -96; diff --git a/src/object/fireplace.c b/src/object/fireplace.c index a4513cb8..5a86491a 100644 --- a/src/object/fireplace.c +++ b/src/object/fireplace.c @@ -27,7 +27,7 @@ void sub_0809B708(Entity* this) { void sub_0809B7A0(Entity* this) { sub_0809B7C0(this); - if (this->actionDelay) { + if (this->timer) { SetFlag(this->field_0x86.HWORD); DeleteThisEntity(); } @@ -43,5 +43,5 @@ void sub_0809B7C0(Entity* this) { void sub_0809B7DC(Entity* this) { sub_0807B7D8(0xc3 << 2, TILE(this->x.HALF.HI, this->y.HALF.HI), 2); SetTile(0x4062, TILE(this->x.HALF.HI, this->y.HALF.HI), this->collisionLayer); - this->actionDelay = 1; + this->timer = 1; } diff --git a/src/object/floatingPlatform.c b/src/object/floatingPlatform.c index 9701ba66..74ab1231 100644 --- a/src/object/floatingPlatform.c +++ b/src/object/floatingPlatform.c @@ -35,14 +35,14 @@ void sub_080860D8(FloatingPlatformEntity* this) { void sub_0808611C(FloatingPlatformEntity* this) { bool32 iVar2 = sub_08086168(this); - if (super->actionDelay != 0 && super->parent->actionDelay == 0) { + if (super->timer != 0 && super->parent->timer == 0) { if (iVar2) { - super->parent->actionDelay++; + super->parent->timer++; } sub_080A2BE4(super, iVar2); - } else if (super->actionDelay == 0) { + } else if (super->timer == 0) { sub_080A2BE4(super, iVar2); } else { sub_080A2BE4(super, FALSE); diff --git a/src/object/fourElements.c b/src/object/fourElements.c index 942cc485..8fd25f49 100644 --- a/src/object/fourElements.c +++ b/src/object/fourElements.c @@ -92,7 +92,7 @@ void FourElements_Action2(FourElementsEntity* this) { DeleteEntity(super->child); super->spriteSettings.draw = 0; super->action = 3; - super->actionDelay = 0x2d; + super->timer = 0x2d; gScreen.controls.layerFXControl = 0x640; gScreen.controls.alphaBlend = 0; InitItemGetSequence(super->type, 0, 1); @@ -106,9 +106,9 @@ void FourElements_Action2(FourElementsEntity* this) { } void FourElements_Action3(FourElementsEntity* this) { - if (super->actionDelay != 0) { + if (super->timer != 0) { sub_080A0424(this); - if (--super->actionDelay == 0) { + if (--super->timer == 0) { SetDefaultPriority(&gPlayerEntity, 0); } } else { @@ -159,7 +159,7 @@ void sub_080A0444(FourElementsEntity* this) { static const u8 gUnk_081248B4[] = { 249, 248, 247, 246, 245, 246, 247, 248, }; - super->z.HALF.HI = gUnk_081248B4[(super->field_0xf++ >> 3) & 7] << 0x18 >> 0x18; + super->z.HALF.HI = gUnk_081248B4[(super->subtimer++ >> 3) & 7] << 0x18 >> 0x18; } void sub_080A0464(FourElementsEntity* this, ScriptExecutionContext* context) { diff --git a/src/object/frozenOctorok.c b/src/object/frozenOctorok.c index ea1ea894..100ec565 100644 --- a/src/object/frozenOctorok.c +++ b/src/object/frozenOctorok.c @@ -80,7 +80,7 @@ ASM_FUNC("asm/non_matching/frozenOctorok/FrozenOctorok_Action1.inc", void FrozenOctorok_Action1SubAction0(FrozenOctorokEntity* this) { Entity* child; - if (super->field_0xf != 0) { + if (super->subtimer != 0) { if (this->unk_7e == 0) { child = super->child; if (child->z.HALF.HI > -0x10) { @@ -108,7 +108,7 @@ void FrozenOctorok_Action1SubAction1(FrozenOctorokEntity* this) { obj->y.HALF.HI -= 0x50; gRoomControls.camera_target = obj; } - if (super->field_0xf < 3) { + if (super->subtimer < 3) { super->subAction = 2; this->unk_79 = 0x1e; SoundReq(SFX_THUD_HEAVY); @@ -124,7 +124,7 @@ void FrozenOctorok_Action1SubAction2(FrozenOctorokEntity* this) { if (this->unk_79-- == 0) { super->subAction = 1; this->unk_79 = 0x1e; - super->field_0xf++; + super->subtimer++; return; } switch (this->unk_79 & 3) { @@ -194,7 +194,7 @@ NONMATCH("asm/non_matching/frozenOctorok/FrozenOctorok_Action1SubAction5.inc", super->subAction = 6; super->speed = 0xc0; super->type2 = 0; - super->field_0xf = 0; + super->subtimer = 0; child = super->child; child->spriteSettings.draw = 0; this->heap->mouthObject->unk_76 = 0x100; @@ -257,14 +257,14 @@ void sub_0809CB70(FrozenOctorokEntity* this, s32 angle, s32 radius) { } NONMATCH("asm/non_matching/frozenOctorok/sub_0809CBE4.inc", void sub_0809CBE4(FrozenOctorokEntity* this)) { - this->unk_79 += super->field_0xf; - if ((s8)super->field_0xf < 0) { - if (super->actionDelay < -(this->unk_79 << 0x18 >> 0x18)) { - super->field_0xf = -super->field_0xf; + this->unk_79 += super->subtimer; + if ((s8)super->subtimer < 0) { + if (super->timer < -(this->unk_79 << 0x18 >> 0x18)) { + super->subtimer = -super->subtimer; SoundReq(SFX_19E); } - } else if ((s8)this->unk_79 > super->actionDelay) { - super->field_0xf = -super->field_0xf; + } else if ((s8)this->unk_79 > super->timer) { + super->subtimer = -super->subtimer; SoundReq(SFX_19E); } } diff --git a/src/object/frozenWaterElement.c b/src/object/frozenWaterElement.c index 953480c4..223f172c 100644 --- a/src/object/frozenWaterElement.c +++ b/src/object/frozenWaterElement.c @@ -77,7 +77,7 @@ void sub_0809BF74(FrozenWaterElementEntity* this) { s32 tmp2; if (--this->unk_74 == 0) { - (super->child)->field_0xf = 1; + (super->child)->subtimer = 1; sub_0809C23C(this); CheckFlags(0x9b); DeleteThisEntity(); diff --git a/src/object/furniture.c b/src/object/furniture.c index 5683156c..1e8770ac 100644 --- a/src/object/furniture.c +++ b/src/object/furniture.c @@ -259,23 +259,23 @@ static void FurnitureUpdate(FurnitureEntity* this) { } break; case 0x8: - if (++super->actionDelay == 16) { - super->actionDelay = 0; - super->field_0xf = (super->field_0xf + 1) & 3; + if (++super->timer == 16) { + super->timer = 0; + super->subtimer = (super->subtimer + 1) & 3; sub_08090E4C(this); } break; case 0x10: if (super->type != FORGE_HELPER) { - if (++super->actionDelay == 20) { + if (++super->timer == 20) { super->frameIndex = (super->frameIndex + 1) & 3; - super->actionDelay = 0; + super->timer = 0; } } else { - if (++super->actionDelay == 14) { - super->actionDelay = 0; - super->field_0xf = (super->field_0xf + 1) % 3; - super->frameIndex = super->field_0xf + 1; + if (++super->timer == 14) { + super->timer = 0; + super->subtimer = (super->subtimer + 1) % 3; + super->frameIndex = super->subtimer + 1; } } break; @@ -444,7 +444,7 @@ static void sub_08090DC4(FurnitureEntity* this) { static void sub_08090E4C(FurnitureEntity* this) { static const u32 sPalettes[] = { 0x5f, 0x60, 0x61, 0x62 }; - ChangeObjPalette(super, sPalettes[super->field_0xf]); + ChangeObjPalette(super, sPalettes[super->subtimer]); } void sub_08090E64(FurnitureEntity* this) { diff --git a/src/object/greatFairy.c b/src/object/greatFairy.c index ffbfe2a6..ab08f369 100644 --- a/src/object/greatFairy.c +++ b/src/object/greatFairy.c @@ -65,7 +65,7 @@ void GreatFairy_CallBehavior(Entity* this) { // Init void GreatFairy_Init(Entity* this) { GreatFairy_InitializeAnimation(this); - this->actionDelay = 0; + this->timer = 0; this->cutsceneBeh.HWORD = 290; } @@ -92,9 +92,9 @@ void GreatFairy_DormantUpdate(Entity* this) { case 289: ripple = GreatFairy_CreateForm(this, RIPPLE, 0); if (ripple) { - PositionRelative(this, ripple, Q_16_16(GreatFairy_RippleOffsets[this->actionDelay]), - Q_16_16(GreatFairy_RippleOffsets[this->actionDelay + 1])); - this->actionDelay += 2; + PositionRelative(this, ripple, Q_16_16(GreatFairy_RippleOffsets[this->timer]), + Q_16_16(GreatFairy_RippleOffsets[this->timer + 1])); + this->timer += 2; break; } } @@ -122,7 +122,7 @@ void GreatFairy_SpawningUpdate(Entity* this) { SetFade(6, 4); SoundReq(SFX_145); this->action = 4; - this->actionDelay = 60; + this->timer = 60; this->spriteSettings.draw = 1; } } @@ -132,15 +132,15 @@ void GreatFairy_MiniUpdate(Entity* this) { Entity* target; GetNextFrame(this); - if (this->actionDelay != 0) { - --this->actionDelay; + if (this->timer != 0) { + --this->timer; } else { target = GreatFairy_CreateForm(this, WINGS, 0); if (target != NULL) { PositionRelative(this, target, 0, Q_16_16(-20.0)); this->action = 5; - this->actionDelay = 120; - this->field_0xf = 0; + this->timer = 120; + this->subtimer = 0; } } } @@ -149,13 +149,13 @@ void GreatFairy_MiniUpdate(Entity* this) { void GreatFairy_FinalUpdate(Entity* this) { Entity* target; - if (this->actionDelay != 0) { - --this->actionDelay; + if (this->timer != 0) { + --this->timer; } else { - if ((this->field_0xf == 0) && (target = GreatFairy_CreateForm(this, FORM9, 0), target != NULL)) { + if ((this->subtimer == 0) && (target = GreatFairy_CreateForm(this, FORM9, 0), target != NULL)) { PositionRelative(this, target, 0, Q_16_16(-76.0)); target->parent = this; - this->field_0xf = 1; + this->subtimer = 1; } } GetNextFrame(this); @@ -220,7 +220,7 @@ void GreatFairy_MiniInit(Entity* this) { aff->parent = this; GreatFairy_InitializeAnimation(this); this->spriteSettings.draw = 1; - this->field_0xf = 0; + this->subtimer = 0; } } @@ -234,10 +234,10 @@ void GreatFairy_MiniRisingUpdate(Entity* this) { this->action = 2; SoundReq(SFX_HEART_CONTAINER_SPAWN); } else { - if (((this->z.HALF.HI == -10) && (this->field_0xf == 0)) && + if (((this->z.HALF.HI == -10) && (this->subtimer == 0)) && (target = GreatFairy_CreateForm(this, DROPLET, 0), target != NULL)) { PositionRelative(this, target, 0, Q_16_16(4.0)); - this->field_0xf = 1; + this->subtimer = 1; } } } @@ -270,7 +270,7 @@ void GreatFairy_MiniAffineInit2(Entity* this) { if (this->z.HALF.HI == -20) { this->action = 2; - this->actionDelay = 90; + this->timer = 90; this->speed = 4096; this->spriteRendering.b0 = 3; SetAffineInfo(this, 256, 256, 0); @@ -279,7 +279,7 @@ void GreatFairy_MiniAffineInit2(Entity* this) { // Mini great fairy stretch void GreatFairy_MiniAffineUpdate(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { gRoomVars.animFlags |= 1; this->action = 3; sub_0805EC60(this); @@ -335,7 +335,7 @@ void GreatFairy_BigRippleCallBehavior(Entity* this) { void GreatFairy_BigRippleInit(Entity* this) { GreatFairy_InitializeAnimation(this); - this->actionDelay = 120; + this->timer = 120; this->spriteSettings.draw = 1; this->spritePriority.b0 = 5; SoundReq(SFX_TELEPORTER); @@ -345,8 +345,8 @@ void GreatFairy_BigRippleUpdate(Entity* this) { Entity* target; GetNextFrame(this); - if (this->actionDelay != 0) { - --this->actionDelay; + if (this->timer != 0) { + --this->timer; } else { target = GreatFairy_CreateForm(this, MINI, 0); if (target != NULL) { @@ -400,15 +400,15 @@ void nullsub_516(Entity* this) { } void sub_080871A8(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 3; - this->actionDelay = 60; + this->timer = 60; gRoomVars.animFlags |= 4; } } void sub_080871D0(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { gRoomVars.animFlags |= 8; DeleteEntity(this); } @@ -428,20 +428,20 @@ void sub_080871F8(Entity* this) { void sub_08087240(Entity* this) { if (gRoomVars.animFlags & 4) { this->action = 3; - this->actionDelay = 20; + this->timer = 20; this->direction = 16; } } void sub_08087264(Entity* this) { - if (this->actionDelay != 0) { - this->actionDelay--; + if (this->timer != 0) { + this->timer--; LinearMoveUpdate(this); } } void sub_0808727C(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { DeleteEntity(this); } } @@ -471,9 +471,9 @@ void sub_080872F8(Entity* this) { (s16)this->field_0x6a.HWORD); this->direction = (this->direction + gUnk_081207AC[Random() & 3]) & 0x1f; } - temp = gSineTable[this->actionDelay + 64]; + temp = gSineTable[this->timer + 64]; this->z.HALF.HI = (temp >> 6) - 8; - this->actionDelay++; + this->timer++; } void GreatFairy_InitializeAnimation(Entity* this) { @@ -500,13 +500,13 @@ Entity* GreatFairy_CreateForm(Entity* this, u32 curForm, u32 parameter) { void sub_080873D0(Entity* this) { Entity* ent; - if (this->actionDelay != 0) { - this->actionDelay--; + if (this->timer != 0) { + this->timer--; } else { ent = GreatFairy_CreateForm(this, 8, 0); if (ent != NULL) { CopyPosition(this, ent); - this->actionDelay = 48; + this->timer = 48; } } } diff --git a/src/object/gyorgBossObject.c b/src/object/gyorgBossObject.c index ebbec424..b0f0920b 100644 --- a/src/object/gyorgBossObject.c +++ b/src/object/gyorgBossObject.c @@ -120,7 +120,7 @@ void GyorgBossObject_FemalePhase1(GyorgBossObjectEntity* this) { if (((GyorgHeap*)super->myHeap)->female->base.health == 0) { // start male phase 1 super->action = 3; - super->actionDelay = 0x23; + super->timer = 0x23; this->unk_6c = 1; this->unk_78 = 0x400; this->unk_7b = 1; @@ -156,7 +156,7 @@ void GyorgBossObject_FemalePhase2(GyorgBossObjectEntity* this) { // start male phase 2 ((GyorgHeap*)super->myHeap)->male1->base.health = 12; super->action = 5; - super->actionDelay = 0x23; + super->timer = 0x23; this->unk_6c = 2; this->unk_78 = 0x400; this->unk_7b = 1; @@ -191,7 +191,7 @@ void GyorgBossObject_FemalePhase3(GyorgBossObjectEntity* this) { // start male phase 3 ((GyorgHeap*)super->myHeap)->male2->base.health = 12; super->action = 7; - super->actionDelay = 0x23; + super->timer = 0x23; this->unk_6c = 0x104; this->unk_78 = 0x400; SoundReq(SFX_BOSS_DIE); @@ -227,8 +227,8 @@ void GyorgBossObject_FemalePhase4(GyorgBossObjectEntity* this) { gRoomTransition.field_0x39 = 0; if (sub_08079F8C() && gPlayerEntity.z.HALF.HI == 0) { super->action = 9; - super->actionDelay = 0; - super->field_0xf = 0xF0; + super->timer = 0; + super->subtimer = 0xF0; this->timer = 0x1a4; super->direction = 0; super->speed = 0x60; @@ -246,12 +246,12 @@ void GyorgBossObject_FightEnd(GyorgBossObjectEntity* this) { if (this->timer == 0) { LinearMoveUpdate(super); sub_080A1E54(this); - if (--super->field_0xf == 0) { + if (--super->subtimer == 0) { SetFlag(0x7B); sub_0808091C(&gUnk_0813ABD0, 8); return; } - if (super->field_0xf == 0x3C) { + if (super->subtimer == 0x3C) { SetFade(7, 4); } return; @@ -350,7 +350,7 @@ void sub_080A1DCC(GyorgBossObjectEntity* this) { void sub_080A1E54(GyorgBossObjectEntity* this) { Entity* fx; - if ((++super->actionDelay & 0x1F) == 0) { + if ((++super->timer & 0x1F) == 0) { fx = CreateFx(super, FX_GIANT_EXPLOSION4, 0); if (fx) { u32 r = Random(); @@ -444,9 +444,9 @@ void GyorgBossObject_SpawnChildren(u32 unk0, bool32 fromBlue, u32 animationState } void sub_080A1FF0(GyorgBossObjectEntity* this) { - if (super->actionDelay != 0) { - super->actionDelay--; - if (super->actionDelay <= 0x20 && (super->actionDelay & 0xF) == 0) { + if (super->timer != 0) { + super->timer--; + if (super->timer <= 0x20 && (super->timer & 0xF) == 0) { Entity* fx; fx = CreateFx(super, FX_GIANT_EXPLOSION4, 0); if (fx) { @@ -462,10 +462,10 @@ void sub_080A1FF0(GyorgBossObjectEntity* this) { if (this->unk_7b) { if (EntityWithinDistance(&gPlayerEntity, gRoomControls.origin_x + 0x200, gRoomControls.origin_y + 0x210, 0x100)) { - if (super->actionDelay == 0) { - super->actionDelay = 0x78; + if (super->timer == 0) { + super->timer = 0x78; } else { - if (super->actionDelay == 0x23) { + if (super->timer == 0x23) { InitScreenShake(0x1e, 0); } } diff --git a/src/object/heartContainer.c b/src/object/heartContainer.c index 421990cb..89f7cc8e 100644 --- a/src/object/heartContainer.c +++ b/src/object/heartContainer.c @@ -44,13 +44,13 @@ static void sub_0808E6E4(Entity* this) { } static void sub_0808E714(Entity* this) { - int var0 = 0x400 - this->field_0xf * 8; + int var0 = 0x400 - this->subtimer * 8; if (var0 > 0x100) { - this->field_0xf++; + this->subtimer++; SetAffineInfo(this, var0, var0, 0); } else { this->action = 3; - this->field_0x3c |= 0x10; + this->collisionFlags |= 0x10; sub_0805EC60(this); SoundReq(SFX_HEART_CONTAINER_SPAWN); } diff --git a/src/object/hittableLever.c b/src/object/hittableLever.c index 401e9671..293035a8 100644 --- a/src/object/hittableLever.c +++ b/src/object/hittableLever.c @@ -33,7 +33,7 @@ void HittableLever(HittableLeverEntity* this) { void HittableLever_Init(HittableLeverEntity* this) { super->action = 1; super->flags |= ENT_COLLIDE; - super->field_0x3c = 7; + super->collisionFlags = 7; super->hitType = 0x8f; super->flags2 = 0xa; super->hitbox = (Hitbox*)&HittableLever_Hitbox; @@ -50,7 +50,7 @@ void HittableLever_Init(HittableLeverEntity* this) { } void HittableLever_Idle(HittableLeverEntity* this) { - if (((super->bitfield & 0x80) != 0) && (this->wasHit == 0)) { + if (((super->contactFlags & 0x80) != 0) && (this->wasHit == 0)) { this->wasHit = 1; super->type ^= 1; super->iframes = -0x18; diff --git a/src/object/houseDoorExterior.c b/src/object/houseDoorExterior.c index baadd362..828497e4 100644 --- a/src/object/houseDoorExterior.c +++ b/src/object/houseDoorExterior.c @@ -43,7 +43,7 @@ void sub_080866D8(Entity* this) { if (this->action == 0) { this->action = 1; *((u32*)(&this->field_0x68)) = 0; - this->field_0x6c.HALF.LO = this->actionDelay; + this->field_0x6c.HALF.LO = this->timer; SetDefaultPriority(this, PRIO_PLAYER_EVENT); } @@ -94,7 +94,7 @@ void sub_0808681C(Entity* this) { switch (this->action) { case 0: this->action = 1; - this->actionDelay = 8; + this->timer = 8; this->spriteSettings.draw = 1; this->frameIndex = 0; this->hitbox = &gUnk_081206AC; @@ -127,7 +127,7 @@ void sub_080868B0(Entity* this) { this->action = 1; this->spriteSettings.draw = 1; this->hitbox = &gUnk_081206AC; - this->actionDelay = 8; + this->timer = 8; } ExecuteScript(this, *(ScriptExecutionContext**)&this->cutsceneBeh); sub_080868EC(this, *(void**)&this->cutsceneBeh); @@ -159,25 +159,25 @@ void sub_0808692C(Entity* this) { this->type2 = 2; this->action = (this->frameIndex == 0) ? 1 : 2; this->subAction = 0; - this->actionDelay = 8; + this->timer = 8; } static u8 sub_08086954(Entity* this) { if (sub_0800445C(this)) { if (GetAnimationStateInRectRadius(this, 6, 20) >= 0 && gPlayerEntity.animationState == 0 && (u16)gPlayerState.field_0x90 == 0x400 && gPlayerState.jump_status == 0) { - this->actionDelay--; + this->timer--; } } else { - this->actionDelay = 8; + this->timer = 8; } - return this->actionDelay; + return this->timer; } void sub_080869A4(Entity* this, ScriptExecutionContext* context) { context->condition = 0; if (!sub_08086954(this)) { - this->actionDelay = 8; + this->timer = 8; context->condition = 1; } } diff --git a/src/object/houseDoorInterior.c b/src/object/houseDoorInterior.c index 6ca11ef6..ae0a247e 100644 --- a/src/object/houseDoorInterior.c +++ b/src/object/houseDoorInterior.c @@ -61,10 +61,10 @@ void HouseDoorInterior_Init(HouseDoorInteriorEntity* this) { } super->action = 1; super->spriteSettings.draw = 1; - this->unk7d = super->actionDelay; + this->unk7d = super->timer; super->spritePriority.b0 = 7; super->hitbox = (Hitbox*)&HouseDoorInteriorHitbox; - super->actionDelay = 8; + super->timer = 8; ptr = HouseDoorInteriorFrameIndices + super->type; if (ptr->frameIndex == 0xff) { super->frameIndex = super->type2; @@ -87,13 +87,13 @@ void HouseDoorInterior_Action1(HouseDoorInteriorEntity* this) { ptr = gUnk_081227CC + super->type2; if (GetAnimationStateInRectRadius(super, ptr->x, ptr->y) >= 0 && ptr->animationState == gPlayerEntity.animationState && gPlayerState.field_0x90 & ptr->unk2) { - --super->actionDelay; + --super->timer; } } else { - super->actionDelay = 8; + super->timer = 8; } - if (super->actionDelay == 0) { + if (super->timer == 0) { super->action = 2; sub_08078AC0(8, 0, 0); SoundReq(SFX_111); diff --git a/src/object/itemForSale.c b/src/object/itemForSale.c index c119010f..2718a209 100644 --- a/src/object/itemForSale.c +++ b/src/object/itemForSale.c @@ -23,7 +23,7 @@ typedef struct { typedef struct { u8 before[0x20]; - u8 unk_20[0x4]; // TODO for Entity this is zVelocity which is not an array. spriteAnimation[super->field_0xf-6] does + u8 unk_20[0x4]; // TODO for Entity this is zVelocity which is not an array. spriteAnimation[super->subtimer-6] does // not match. } ModifiedParentEntity; @@ -49,7 +49,7 @@ void ItemForSale(ItemForSaleEntity* this) { if (CheckOnScreen(super)) { sub_08080CB4(super); } - switch (super->actionDelay) { + switch (super->timer) { case 1: case 2: if (super->action == 1) { @@ -66,13 +66,13 @@ void ItemForSale_Init(ItemForSaleEntity* this) { super->action = 1; super->spriteSettings.draw = 1; super->spritePriority.b1 = 0; - super->field_0x16 = 0; + super->carryFlags = 0; #ifdef EU SetDefaultPriority(super, 6); #endif super->child = super; sub_08081A5C(this); - switch (super->actionDelay) { + switch (super->timer) { case 0: super->hitbox = (Hitbox*)&gUnk_080FD328; break; @@ -133,7 +133,7 @@ void sub_080819B4(ItemForSaleEntity* this) { if (gRoomVars.shopItemType == 0) { if (super->parent != NULL) { - ((ModifiedParentEntity*)super->parent)->unk_20[super->field_0xf] = 0xff; + ((ModifiedParentEntity*)super->parent)->unk_20[super->subtimer] = 0xff; } DeleteThisEntity(); } @@ -158,7 +158,7 @@ void sub_080819B4(ItemForSaleEntity* this) { void sub_08081A5C(ItemForSaleEntity* this) { u32 tmp = sub_080787D8(super); - if (super->actionDelay == 1) { + if (super->timer == 1) { gUnk_03003DF0.array[tmp].unk_2 = 0; } } diff --git a/src/object/itemOnGround.c b/src/object/itemOnGround.c index b4683933..b356c38a 100644 --- a/src/object/itemOnGround.c +++ b/src/object/itemOnGround.c @@ -35,14 +35,14 @@ typedef struct { extern const Unk_0811E84C gUnk_0811E84C[]; void ItemOnGround(Entity* this) { - if (this->bitfield & 0x80) { - switch (this->bitfield & 0x7F) { + if (this->contactFlags & 0x80) { + switch (this->contactFlags & 0x7F) { case 20: this->action = 3; COLLISION_OFF(this); this->spriteSettings.draw = 1; - this->field_0x3c |= 0x10; - this->child = this->field_0x4c; + this->collisionFlags |= 0x10; + this->child = this->contactedEntity; break; case 0: case 1: @@ -83,7 +83,7 @@ void sub_08080F20(Entity* this) { this->spritePriority.b1 = 3; this->spriteSettings.shadow = 0; this->hitType = 7; - this->field_0x3c = 0x47; + this->collisionFlags = 0x47; this->hurtType = 0x44; this->health = 0xFF; this->hitbox = (Hitbox*)&gUnk_080FD1A8; @@ -105,19 +105,19 @@ void sub_08080F20(Entity* this) { break; } - this->field_0x68.HALF.HI = this->actionDelay; + this->field_0x68.HALF.HI = this->timer; this->field_0x6a.HALF.LO = 0; this->field_0x6c.HWORD = 0; this->field_0x68.HALF.LO = 0; - this->actionDelay = 0; + this->timer = 0; SetDefaultPriority(this, PRIO_NO_BLOCK); - this->field_0x1c = sub_0808147C(this->type); + this->gustJarFlags = sub_0808147C(this->type); gUnk_0811E7E8[this->field_0x68.HALF.HI](this); } else { Entity* entity = CreateObject(FAIRY, 0x60, 0); if (entity != NULL) { - entity->actionDelay = 0; - if (this->actionDelay == 1) { + entity->timer = 0; + if (this->timer == 1) { entity->type2 = 2; } CopyPosition(this, entity); @@ -286,7 +286,7 @@ void sub_08081328(Entity* this) { } void sub_0808136C(Entity* this) { - if (--this->actionDelay) { + if (--this->timer) { Entity* other = this->child; this->x.WORD = other->x.WORD; this->y.WORD = other->y.WORD; @@ -304,7 +304,7 @@ void sub_080813BC(Entity* this) { void sub_080813D4(Entity* this) { this->subAction = 1; - this->field_0x1d = 1; + this->gustJarTolerance = 1; this->spriteSettings.draw = 1; } @@ -417,7 +417,7 @@ void sub_08081598(Entity* this) { COLLISION_OFF(this); this->action = 4; - this->actionDelay = 14; + this->timer = 14; this->zVelocity = Q_16_16(2.0); this->spriteSettings.draw = 1; this->spritePriority.b1 = 2; diff --git a/src/object/jarPortal.c b/src/object/jarPortal.c index adcd258f..355a6b78 100644 --- a/src/object/jarPortal.c +++ b/src/object/jarPortal.c @@ -18,7 +18,7 @@ void JarPortal(Entity* this) { void sub_0808BE9C(Entity* this) { COLLISION_ON(this); this->hitType = 1; - this->field_0x3c = 0x47; + this->collisionFlags = 0x47; this->hurtType = 0x44; this->flags2 = 0x80; this->field_0x68.HALF.LO = 0; @@ -75,7 +75,7 @@ void sub_0808BF58(Entity* this) { UpdateAnimationSingleFrame(this); if (!this->z.HALF.HI) { ++this->action; - this->field_0xf = 0; + this->subtimer = 0; InitAnimationForceUpdate(this, 1); sub_0808C148(this, 1); } @@ -115,8 +115,8 @@ void sub_0808C01C(Entity* this, u32 r1) { } } CreateMagicSparkles(this->x.HALF.HI, this->y.HALF.HI, this->collisionLayer); - if (this->field_0xf == 0) { - this->field_0xf = 1; + if (this->subtimer == 0) { + this->subtimer = 1; SoundReq(SFX_NEAR_PORTAL); } } @@ -151,7 +151,7 @@ void sub_0808C0AC(Entity* this) { } u32 sub_0808C128(Entity* this) { - return this->bitfield == 157; + return this->contactFlags == 157; } void sub_0808C13C(Entity* this) { diff --git a/src/object/keyStealingTakkuri.c b/src/object/keyStealingTakkuri.c index 76fd3480..d1dc56bf 100644 --- a/src/object/keyStealingTakkuri.c +++ b/src/object/keyStealingTakkuri.c @@ -61,8 +61,8 @@ void KeyStealingTakkuri_Type0_Init(KeyStealingTakkuriEntity* this) { Entity* entity; super->action++; super->collisionLayer = 1; - super->actionDelay = 0x1e; - super->field_0xf = 0; + super->timer = 0x1e; + super->subtimer = 0; super->spriteRendering.b3 = 1; super->speed = 0; super->direction = 0x18; @@ -78,7 +78,7 @@ void KeyStealingTakkuri_Type0_Init(KeyStealingTakkuriEntity* this) { } void KeyStealingTakkuri_Type0_Action1(KeyStealingTakkuriEntity* this) { - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action++; super->y.WORD += 0x100000; super->z.WORD -= 0x100000; @@ -92,8 +92,8 @@ void KeyStealingTakkuri_Type0_Action2(KeyStealingTakkuriEntity* this) { sub_0809E1F0(this); if ((s32)sub_080041DC(super, child->x.HALF.HI, child->y.HALF.HI) * 0x10 < super->speed) { super->action++; - super->actionDelay = 0x10; - super->field_0xf = 1; + super->timer = 0x10; + super->subtimer = 1; InitAnimationForceUpdate(super, 2); } UpdateAnimationSingleFrame(super); @@ -101,8 +101,8 @@ void KeyStealingTakkuri_Type0_Action2(KeyStealingTakkuriEntity* this) { void KeyStealingTakkuri_Type0_Action3(KeyStealingTakkuriEntity* this) { sub_0809E1C8(this, sub_080045B4(super, gRoomControls.origin_x + 0x78, gRoomControls.origin_y + 0xa8)); - if (super->actionDelay != 0) { - super->actionDelay--; + if (super->timer != 0) { + super->timer--; super->speed -= 0x80; } sub_0809E1F0(this); @@ -141,7 +141,7 @@ void KeyStealingTakkuri_Type1_Action1(KeyStealingTakkuriEntity* this) { if (parent->next == NULL) { DeleteThisEntity(); } - if (parent->field_0xf != 0) { + if (parent->subtimer != 0) { PositionRelative(parent, super, 0, 0x80000); } super->spriteSettings.draw = parent->spriteSettings.draw; @@ -160,15 +160,15 @@ void KeyStealingTakkuri_Type5_Init(KeyStealingTakkuriEntity* this) { super->direction = 0x18; super->speed = 0x100; super->zVelocity = 0x20000; - super->actionDelay = 1; + super->timer = 1; SoundReq(SFX_RUPEE_BOUNCE); } void KeyStealingTakkuri_Type5_Action1(KeyStealingTakkuriEntity* this) { LinearMoveUpdate(super); if (sub_080044EC(super, 0x2000) < 2) { - if (super->actionDelay != 0) { - super->actionDelay--; + if (super->timer != 0) { + super->timer--; super->zVelocity = 0x10000; } else { super->action++; @@ -189,8 +189,8 @@ void KeyStealingTakkuri_Type2_Init(KeyStealingTakkuriEntity* this) { super->action++; super->collisionLayer = 2; - super->actionDelay = 0x1e; - super->field_0xf = 1; + super->timer = 0x1e; + super->subtimer = 1; super->spriteRendering.b3 = 1; super->speed = 0; super->direction = 0x18; @@ -213,7 +213,7 @@ void KeyStealingTakkuri_Type2_Init(KeyStealingTakkuriEntity* this) { } void KeyStealingTakkuri_Type2_Action1(KeyStealingTakkuriEntity* this) { - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action++; SoundReq(SFX_146); } @@ -236,7 +236,7 @@ void KeyStealingTakkuri_Type2_Action3(KeyStealingTakkuriEntity* this) { this->unk_6e += 8; if (--this->unk_6c == 0) { super->action++; - super->actionDelay = 0x1e; + super->timer = 0x1e; super->spriteSettings.flipX = 0; } else { sub_0809E238(this); @@ -246,7 +246,7 @@ void KeyStealingTakkuri_Type2_Action3(KeyStealingTakkuriEntity* this) { } void KeyStealingTakkuri_Type2_Action4(KeyStealingTakkuriEntity* this) { - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action++; SoundReq(SFX_15B); } @@ -276,8 +276,8 @@ void KeyStealingTakkuri_Type3_Init(KeyStealingTakkuriEntity* this) { super->action++; super->collisionLayer = 2; - super->actionDelay = 0xa; - super->field_0xf = 0; + super->timer = 0xa; + super->subtimer = 0; super->spriteRendering.b3 = 1; super->speed = 0; super->direction = gUnk_0812412D[super->type2]; @@ -306,7 +306,7 @@ void KeyStealingTakkuri_Type3_Action1(KeyStealingTakkuriEntity* this) { switch (sub_0809E2C4(this, super->type2)) { case 1: super->action += 2; - super->actionDelay = 0xff; + super->timer = 0xff; InitAnimationForceUpdate(super, super->animIndex + 2); SoundReq(SFX_123); child = super->child; @@ -320,17 +320,17 @@ void KeyStealingTakkuri_Type3_Action1(KeyStealingTakkuriEntity* this) { } break; case 2: - if (super->actionDelay == 0) { + if (super->timer == 0) { super->action++; InitAnimationForceUpdate(super, super->animIndex + 2); SoundReq(SFX_123); SoundReq(SFX_1F3); } else { - super->actionDelay--; + super->timer--; } break; default: - super->actionDelay = 0xa; + super->timer = 0xa; break; } UpdateAnimationSingleFrame(super); @@ -342,7 +342,7 @@ void KeyStealingTakkuri_Type3_Action2(KeyStealingTakkuriEntity* this) { child = super->child; if ((child != NULL) && ((((child->x.HALF.HI - super->x.HALF.HI) ^ super->direction << 0xb) & 0x8000) != 0)) { super->action++; - super->field_0xf = 1; + super->subtimer = 1; SoundReq(SFX_102); } KeyStealingTakkuri_Type3_Action3(this); @@ -357,7 +357,7 @@ void KeyStealingTakkuri_Type3_Action3(KeyStealingTakkuriEntity* this) { if (child != NULL) { child->parent = NULL; } - tmp = super->actionDelay & 0x80; + tmp = super->timer & 0x80; if (tmp != 0) { DeleteThisEntity(); } else { @@ -394,7 +394,7 @@ void sub_0809E0A0(KeyStealingTakkuriEntity* this) { if (obj != NULL) { obj->parent = super; super->child = obj; - super->field_0xf = 0; + super->subtimer = 0; CopyPosition(&gPlayerEntity, obj); obj->z.HALF.HI = 0xfff8; } @@ -446,7 +446,7 @@ void sub_0809E0D4(KeyStealingTakkuriEntity* this, ScriptExecutionContext* contex if ((varX3 < 1) && (varY3 < 1)) { super->x.HALF.HI = varX; super->y.HALF.HI = varY; - super->field_0xf = 1; + super->subtimer = 1; SoundReq(SFX_102); } else { gActiveScriptInfo.commandSize = 0; diff --git a/src/object/ladderUp.c b/src/object/ladderUp.c index d45dd1f9..98a3b01a 100644 --- a/src/object/ladderUp.c +++ b/src/object/ladderUp.c @@ -12,7 +12,7 @@ void LadderUp(Entity* this) { switch (this->action) { case 0: - if (this->actionDelay) { + if (this->timer) { uVar4 = 1; } else { #ifndef EU @@ -43,13 +43,13 @@ void LadderUp(Entity* this) { SoundReq(SFX_10B); this->action = 2; #ifndef EU - this->actionDelay = 0x3c; + this->timer = 0x3c; #endif } break; case 2: #ifndef EU - if (--this->actionDelay) { + if (--this->timer) { return; } this->action = 3; diff --git a/src/object/lavaPlatform.c b/src/object/lavaPlatform.c index 56338844..830ba02e 100644 --- a/src/object/lavaPlatform.c +++ b/src/object/lavaPlatform.c @@ -105,7 +105,7 @@ void sub_08092344(LavaPlatformEntity* this) { LavaPlatform_Type1Init, LavaPlatform_Type1Action1, LavaPlatform_Type1Action2, LavaPlatform_Type1Action3, LavaPlatform_Type1Action4, LavaPlatform_Type1Action5, LavaPlatform_Type1Action6, LavaPlatform_Type1Action7, }; - super->field_0xf = 0; + super->subtimer = 0; LavaPlatform_Type1Actions[super->action](this); sub_080926E4(this); } @@ -114,7 +114,7 @@ void LavaPlatform_Type1Init(LavaPlatformEntity* this) { super->animationState = super->type2; super->spritePriority.b0 = 7; super->hurtType = 0x48; - super->field_0x3c = 7; + super->collisionFlags = 7; super->flags2 = 0x81; super->hitbox = (Hitbox*)&gUnk_080FD280; sub_0809264C(this); @@ -134,13 +134,13 @@ void LavaPlatform_Type1Action1(LavaPlatformEntity* this) { } void LavaPlatform_Type1Action2(LavaPlatformEntity* this) { - if (super->bitfield == 0x9d) { + if (super->contactFlags == 0x9d) { sub_08092620(this); } else { if (LavaPlatform_IsPlayerOnPlatform(this)) { super->action = 3; super->flags &= ~ENT_COLLIDE; - super->actionDelay = 0x14; + super->timer = 0x14; gPlayerState.field_0x3f = 0xfd; } } @@ -151,7 +151,7 @@ void LavaPlatform_Type1Action3(LavaPlatformEntity* this) { if (LavaPlatform_IsPlayerOnPlatform(this)) { gPlayerState.field_0x3f = 0xfd; } - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = 4; this->timer = this->wobbleTime; super->spriteOffsetY = 0; @@ -226,7 +226,7 @@ void LavaPlatform_Type1Action6(LavaPlatformEntity* this) { } void LavaPlatform_Type1Action7(LavaPlatformEntity* this) { - if (super->bitfield == 0x9d) { + if (super->contactFlags == 0x9d) { sub_08092620(this); } } @@ -285,7 +285,7 @@ bool32 LavaPlatform_IsPlayerOnPlatform(LavaPlatformEntity* this) { sub_08079F8C()) { gPlayerState.field_0x14 = 1; if (gPlayerEntity.z.HALF.HI == 0) { - super->field_0xf = 1; + super->subtimer = 1; return TRUE; } } @@ -294,7 +294,7 @@ bool32 LavaPlatform_IsPlayerOnPlatform(LavaPlatformEntity* this) { } void sub_080926E4(LavaPlatformEntity* this) { - sub_080A2BE4(super, super->field_0xf); + sub_080A2BE4(super, super->subtimer); if (super->action == 1) { (super->parent)->x.HALF.HI = super->x.HALF.HI; (super->parent)->y.HALF.HI = super->y.HALF.HI; diff --git a/src/object/lightableSwitch.c b/src/object/lightableSwitch.c index ec5fdad5..dcf5ca1e 100644 --- a/src/object/lightableSwitch.c +++ b/src/object/lightableSwitch.c @@ -24,7 +24,7 @@ void sub_0809EA34(Entity* this) { this->action = 1; COLLISION_ON(this); this->frameIndex = 0; - this->field_0x3c = 7; + this->collisionFlags = 7; this->hurtType = 0x48; this->hitType = 0x28; this->flags2 = 10; @@ -36,7 +36,7 @@ void sub_0809EA34(Entity* this) { void sub_0809EA80(Entity* this) { - if ((this->bitfield & 0x80) != 0) { + if ((this->contactFlags & 0x80) != 0) { if (CheckFlags(this->field_0x86.HWORD) != 0) { ClearFlag(this->field_0x86.HWORD); } else { @@ -96,7 +96,7 @@ void sub_0809EB80(Entity* this) { this->action = 1; COLLISION_ON(this); this->frameIndex = 3; - this->field_0x3c = 7; + this->collisionFlags = 7; this->hurtType = 0x48; this->hitType = 0x28; this->flags2 = 10; @@ -110,9 +110,9 @@ void sub_0809EB80(Entity* this) { } void sub_0809EBD8(Entity* this) { - if ((this->bitfield & 0x80) != 0) { + if ((this->contactFlags & 0x80) != 0) { this->action = 2; - this->actionDelay = 0x10; + this->timer = 0x10; this->frameIndex = 2; SetFlag(this->field_0x86.HWORD); EnqueueSFX(SFX_110); @@ -125,7 +125,7 @@ void sub_0809EC08(Entity* this) { this->action = 3; } else { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 1; this->frameIndex = 3; ClearFlag(this->field_0x86.HWORD); diff --git a/src/object/lilypadLarge.c b/src/object/lilypadLarge.c index 845fa697..241ee9de 100644 --- a/src/object/lilypadLarge.c +++ b/src/object/lilypadLarge.c @@ -66,11 +66,11 @@ void sub_08085504(LilypadLargeEntity* this) { } } } - if (super->actionDelay != 0) { + if (super->timer != 0) { if (sub_080040A2(super) == 0) { DeleteThisEntity(); } - super->actionDelay = 0; + super->timer = 0; } else { if (EntityHasDuplicateID(super) != 0) { DeleteThisEntity(); @@ -81,7 +81,7 @@ void sub_08085504(LilypadLargeEntity* this) { super->spritePriority.b0 = 6; super->hitbox = &gUnk_08120640; super->flags |= ENT_COLLIDE; - super->field_0x3c = 7; + super->collisionFlags = 7; super->hitType = 1; super->flags2 = 4; this->unk_78.WORD = 0x1000000; @@ -172,13 +172,13 @@ void sub_08085B40(LilypadLargeEntity* this) { ResetCollisionLayer(&gPlayerEntity); sub_08085F1C(this); super->action = 1; - super->field_0xf = 4; - while (super->field_0xf != 0) { + super->subtimer = 4; + while (super->subtimer != 0) { sub_080A2AF4(super, 8, 10); - super->field_0xf--; + super->subtimer--; } - super->field_0xf = 1; - super->actionDelay |= 0x80; + super->subtimer = 1; + super->timer |= 0x80; this->unk_70 = 0; this->unk_6c = 0; if (GetTileUnderEntity(super) == 0xd) { @@ -338,7 +338,7 @@ void sub_08085F1C(LilypadLargeEntity* this) { } void sub_08085F48(LilypadLargeEntity* this) { - u32 tmp = super->actionDelay & 0x80; + u32 tmp = super->timer & 0x80; if (tmp != 0) { if (gPlayerState.floor_type == SURFACE_ICE) { ResetPlayerVelocity(); @@ -348,35 +348,35 @@ void sub_08085F48(LilypadLargeEntity* this) { if (this->unk_78.WORD_U < 0x1280000) { this->unk_78.WORD_U += 0x80000; } else { - super->actionDelay = 0; + super->timer = 0; } } else { if ((gPlayerState.flags & PL_FLAGS2) != 0) { - if (super->actionDelay != 0) { + if (super->timer != 0) { if (this->unk_78.WORD_U < 0x1200000) { this->unk_78.WORD_U += 0x8000; } else { - super->actionDelay = tmp; + super->timer = tmp; } } else { if (this->unk_78.WORD_U > 0x1100000) { this->unk_78.WORD_U -= 0x8000; } else { - super->actionDelay = 1; + super->timer = 1; } } } else { - if (super->actionDelay != 0) { + if (super->timer != 0) { if (this->unk_78.WORD_U < 0x1100000) { this->unk_78.WORD_U += 0x4000; } else { - super->actionDelay = 0; + super->timer = 0; } } else { if (this->unk_78.WORD_U > 0x1060000) { this->unk_78.WORD_U -= 0x4000; } else { - super->actionDelay = 1; + super->timer = 1; } } } diff --git a/src/object/lilypadSmall.c b/src/object/lilypadSmall.c index eed1578f..3f72f3e3 100644 --- a/src/object/lilypadSmall.c +++ b/src/object/lilypadSmall.c @@ -12,9 +12,9 @@ void LilypadSmall(Entity* this) { if (this->action == 0) { this->action = 1; - this->actionDelay = 0x5a; + this->timer = 0x5a; rand = Random(); - this->field_0xf = rand; + this->subtimer = rand; this->frameIndex = (rand >> 0x10) & 3; this->spriteSettings.draw = TRUE; this->spritePriority.b0 = 7; @@ -51,12 +51,12 @@ static void sub_08097B24(Entity* this) { u32 temp2; u16* temp3; - if (--this->actionDelay == 0) { - this->actionDelay = 90; + if (--this->timer == 0) { + this->timer = 90; this->frameIndex = (this->frameIndex + 1) & 3; } temp3 = gUnk_08123318; - temp2 = ++this->field_0xf; + temp2 = ++this->subtimer; temp = temp3[(temp2 >> 5) & 7]; SetAffineInfo(this, temp, temp, 0); diff --git a/src/object/litArea.c b/src/object/litArea.c index f042209e..0c915d6a 100644 --- a/src/object/litArea.c +++ b/src/object/litArea.c @@ -15,14 +15,14 @@ void LitArea(Entity* this) { this->spriteRendering.b0 = 3; this->frameIndex = 3; this->flags |= ENT_PERSIST; - this->field_0xf = gRoomControls.room; - this->actionDelay = 2; + this->subtimer = gRoomControls.room; + this->timer = 2; this->field_0x68.HWORD = 0xfffe; this->field_0x6a.HWORD = 0x80; SetAffineInfo(this, 0x80, 0x80, 0); } else { - if (--this->actionDelay == 0) { - this->actionDelay = 2; + if (--this->timer == 0) { + this->timer = 2; this->field_0x6a.HWORD += this->field_0x68.HWORD; if (this->field_0x6a.HWORD < 0x78) { this->field_0x68.HWORD = 1; @@ -37,7 +37,7 @@ void LitArea(Entity* this) { gScreen.controls.windowOutsideControl = (gScreen.controls.windowOutsideControl & 0xff) | WINOUT_WINOBJ_BG0 | WINOUT_WINOBJ_BG1 | WINOUT_WINOBJ_BG2 | WINOUT_WINOBJ_OBJ | WINOUT_WINOBJ_CLR; - if ((gRoomControls.room != this->field_0xf) && (gRoomControls.reload_flags == 0)) { + if ((gRoomControls.room != this->subtimer) && (gRoomControls.reload_flags == 0)) { DeleteThisEntity(); } } diff --git a/src/object/lockedDoor.c b/src/object/lockedDoor.c index ebe88f20..f1530d33 100644 --- a/src/object/lockedDoor.c +++ b/src/object/lockedDoor.c @@ -141,9 +141,9 @@ void sub_08083338(Entity* this) { } void sub_080834B4(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 2; - this->actionDelay = 7; + this->timer = 7; SetTile(this->field_0x74.HWORD, this->field_0x76.HWORD, this->collisionLayer); EnqueueSFX(SFX_10B); } @@ -151,7 +151,7 @@ void sub_080834B4(Entity* this) { void sub_080834EC(Entity* this) { LinearMoveUpdate(this); - if (--this->actionDelay == 0) { + if (--this->timer == 0) { if (this->type & 0x80) { sub_08083638(this); } else { @@ -169,7 +169,7 @@ void sub_08083518(Entity* this) { void sub_08083540(Entity* this) { LinearMoveUpdate(this); - if (!--this->actionDelay) { + if (!--this->timer) { if (this->type & 0x10) { this->type &= ~0x10; sub_080836A0(this); @@ -214,7 +214,7 @@ void sub_080835F8(Entity* this) { if (this->interactType == 0 && !CheckFlags(this->field_0x86.HWORD)) return; this->action = 1; - this->actionDelay = 0x14; + this->timer = 0x14; sub_08083658(this); SetFlag(this->field_0x86.HWORD); sub_080526F8(-1); @@ -230,7 +230,7 @@ void sub_08083638(Entity* this) { void sub_08083658(Entity* this) { const struct_0811F680* tmp; this->action = 1; - this->actionDelay = 0x14; + this->timer = 0x14; this->direction = this->field_0x7c.BYTES.byte2 << 3; tmp = &gUnk_0811F680[this->field_0x7c.BYTES.byte2]; this->x.HALF.HI += tmp->x; @@ -250,7 +250,7 @@ void sub_080836A0(Entity* this) { void sub_080836DC(Entity* this, u32 unk_0, u32 unk_1) { const struct_0811F680* tmp; SetTile(0x4022, unk_1, this->collisionLayer); - this->actionDelay = 7; + this->timer = 7; this->spriteSettings.draw = 1; this->direction = (unk_0 << 3) ^ 0x10; tmp = &gUnk_0811F688[unk_0]; diff --git a/src/object/macroBook.c b/src/object/macroBook.c index a69daa92..722ce8a4 100644 --- a/src/object/macroBook.c +++ b/src/object/macroBook.c @@ -35,8 +35,8 @@ void MacroBook(Entity* this) { void MacroBook_Init(MacroBookEntity* this) { super->action = 1; - super->actionDelay = 0x80; - super->field_0xf = 0; + super->timer = 0x80; + super->subtimer = 0; super->spriteRendering.b0 = 3; this->unk80 = 0x80; this->playerWithinRect = 0; @@ -46,24 +46,24 @@ void MacroBook_Init(MacroBookEntity* this) { super->spriteRendering.b3 = 3; SetAffineInfo(super, this->unk80, this->unk80, 0); UpdateSpriteForCollisionLayer(super); - InitAnimationForceUpdate(super, super->field_0xf); + InitAnimationForceUpdate(super, super->subtimer); sub_0809A958(this); } void MacroBook_Action1(MacroBookEntity* this) { UpdateAnimationSingleFrame(super); sub_0809AA00(this); - if (super->actionDelay) { - super->actionDelay--; + if (super->timer) { + super->timer--; } else { if ((super->frame & ANIM_DONE) != 0) { - if (super->field_0xf == 3) { + if (super->subtimer == 3) { super->action = 2; - super->actionDelay = 90; - super->field_0xf = 0; + super->timer = 90; + super->subtimer = 0; InitAnimationForceUpdate(super, 2); } else { - InitAnimationForceUpdate(super, super->field_0xf); + InitAnimationForceUpdate(super, super->subtimer); } } } @@ -72,22 +72,22 @@ void MacroBook_Action1(MacroBookEntity* this) { void MacroBook_Action2(MacroBookEntity* this) { UpdateAnimationSingleFrame(super); sub_0809AA00(this); - if (super->field_0xf < 2) { + if (super->subtimer < 2) { super->action = 1; - super->actionDelay = 0; - } else if (super->actionDelay) { - super->actionDelay--; + super->timer = 0; + } else if (super->timer) { + super->timer--; if (gPlayerClones[0] != 0) { return; } super->action = 1; - super->actionDelay = 0; + super->timer = 0; } else { if ((super->frame & ANIM_DONE) == 0) { return; } super->action = 3; - super->actionDelay = 0; + super->timer = 0; InitAnimationForceUpdate(super, 3); RequestPriorityDuration(super, 0x78); } @@ -105,7 +105,7 @@ void MacroBook_Action3(MacroBookEntity* this) { sub_0809A9D4(this); break; case 0x20: - super->actionDelay++; + super->timer++; super->frame &= 0xdf; SetPlayerControl(0xff); SetGlobalFlag(0x2a); @@ -114,7 +114,7 @@ void MacroBook_Action3(MacroBookEntity* this) { break; } - if (super->actionDelay) { + if (super->timer) { this->unk80 += 8; super->x.WORD += 0x400; SetAffineInfo(super, this->unk80, this->unk80, 0); @@ -167,7 +167,7 @@ void sub_0809A9D4(MacroBookEntity* this) { void sub_0809AA00(MacroBookEntity* this) { Entity* ent; - super->field_0xf = 0; + super->subtimer = 0; if (super->child == NULL) { for (ent = FindEntityByID(NPC, TOWN_MINISH, 7); ent != NULL; ent = FindNextDuplicateID(ent, NPC)) { if (ent->type == 0 && ent->type2 == 8) { @@ -202,7 +202,7 @@ void sub_0809AA9C(MacroBookEntity* this, Entity* ent, u32 arg3) { } if (ent->x.HALF.HI <= gRoomControls.origin_x + 0x15a) { - super->field_0xf++; + super->subtimer++; ent->spriteOffsetY++; } } diff --git a/src/object/macroPlayer.c b/src/object/macroPlayer.c index e3f2a377..4b9f4182 100644 --- a/src/object/macroPlayer.c +++ b/src/object/macroPlayer.c @@ -181,7 +181,7 @@ void MacroPlayer_Type0_Action4(MacroPlayerEntity* this) { } } else { super->action++; - super->actionDelay = 60; + super->timer = 60; this->unk68.HWORD = 0xc04; DeleteEntity(super->child); sub_0805EC60(super); @@ -189,9 +189,9 @@ void MacroPlayer_Type0_Action4(MacroPlayerEntity* this) { } void MacroPlayer_Type0_Action5(MacroPlayerEntity* this) { - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action++; - super->actionDelay = 0x10; + super->timer = 0x10; } } @@ -199,7 +199,7 @@ void MacroPlayer_Type0_Action6(MacroPlayerEntity* this) { static const u8 gUnk_081216B4[] = { 0, 0x1a, 0x2, 0x5, 0x4, 0x11, 0x6, 0x1a }; u32 uVar2; - if (--super->actionDelay == 0) { + if (--super->timer == 0) { uVar2 = gArea.portal_exit_dir; super->action += 1; super->action += uVar2; diff --git a/src/object/mask.c b/src/object/mask.c index 689d3a88..6571de7e 100644 --- a/src/object/mask.c +++ b/src/object/mask.c @@ -38,8 +38,8 @@ void sub_080929A4(Entity* this) { this->field_0x78.HWORD = ((Random() & 7) << 10) | 0x2000; - this->field_0xf = this->actionDelay >> 1; - this->actionDelay = 0; + this->subtimer = this->timer >> 1; + this->timer = 0; this->frameIndex = this->type2 & 0x3f; @@ -67,8 +67,8 @@ void sub_08092A94(Entity* this) { return; } - if (this->x.HALF.HI - gPlayerEntity.x.HALF.HI >= this->field_0xf || - this->x.HALF.HI - gPlayerEntity.x.HALF.HI <= -this->field_0xf) { + if (this->x.HALF.HI - gPlayerEntity.x.HALF.HI >= this->subtimer || + this->x.HALF.HI - gPlayerEntity.x.HALF.HI <= -this->subtimer) { return; } @@ -87,10 +87,10 @@ void sub_08092A94(Entity* this) { // Probably falling down void sub_08092B0C(Entity* this) { - if (this->actionDelay == 1) { + if (this->timer == 1) { this->action = 3; - this->actionDelay = 0; + this->timer = 0; switch (this->type2 & 0xC0) { case 0x80: EnqueueSFX(SFX_SECRET); @@ -106,7 +106,7 @@ void sub_08092B0C(Entity* this) { sub_080044EC(this, this->field_0x78.HWORD); if (this->z.HALF.HI == 0) { - this->actionDelay++; + this->timer++; } } } diff --git a/src/object/mazaalBossObject.c b/src/object/mazaalBossObject.c index adc3ab6d..b82c1910 100644 --- a/src/object/mazaalBossObject.c +++ b/src/object/mazaalBossObject.c @@ -81,7 +81,7 @@ void MazaalBossObject_Action0(MazaalBossObjectEntity* this) { sub_080809D4(); } else { super->action = MAZAAL_BOSS_OBJECT_ACTION_1; - super->actionDelay = 30; + super->timer = 30; super->frameIndex = gRoomTransition.field_0x38; super->spritePriority.b0 = 7; super->spriteOffsetY = 0x20; @@ -95,27 +95,27 @@ void MazaalBossObject_Action1(MazaalBossObjectEntity* this) { } void MazaalBossObject_Action2(MazaalBossObjectEntity* this) { - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = MAZAAL_BOSS_OBJECT_ACTION_3; - super->actionDelay = 120; + super->timer = 120; gRoomControls.camera_target = super->child; } } void MazaalBossObject_Action3(MazaalBossObjectEntity* this) { - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = MAZAAL_BOSS_OBJECT_ACTION_4; - super->actionDelay = 90; + super->timer = 90; super->child->subAction = 1; } } void MazaalBossObject_Action4(MazaalBossObjectEntity* this) { if (super->child->subAction > 2) { - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = MAZAAL_BOSS_OBJECT_ACTION_5; - super->actionDelay = 8; - super->field_0xf = 0; + super->timer = 8; + super->subtimer = 0; super->spriteRendering.alphaBlend = BLDALPHA_BLEND(1, 0); gScreen.controls.layerFXControl = @@ -128,25 +128,25 @@ void MazaalBossObject_Action4(MazaalBossObjectEntity* this) { void MazaalBossObject_Action5(MazaalBossObjectEntity* this) { u32 tmp; - if (--super->actionDelay == 0) { - super->actionDelay = 8; + if (--super->timer == 0) { + super->timer = 8; - tmp = ++super->field_0xf; + tmp = ++super->subtimer; tmp &= 0xFF; gScreen.controls.alphaBlend = BLDALPHA_BLEND((0x10 - tmp) & 0xFF, tmp); - if (super->field_0xf > 15) { + if (super->subtimer > 15) { super->spriteRendering.alphaBlend = BLDALPHA_BLEND(4, 0); gScreen.controls.layerFXControl = 0; super->action = MAZAAL_BOSS_OBJECT_ACTION_6; - super->actionDelay = 15; + super->timer = 15; super->spriteSettings.draw = 0; } } } void MazaalBossObject_Action6(MazaalBossObjectEntity* this) { - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->child->subAction = 6; gRoomTransition.field_0x38 = 0xF1; @@ -155,18 +155,18 @@ void MazaalBossObject_Action6(MazaalBossObjectEntity* this) { } void MazaalBossObject_Action7(MazaalBossObjectEntity* this) { - if (super->child->actionDelay == 1) { + if (super->child->timer == 1) { super->action = MAZAAL_BOSS_OBJECT_ACTION_8; super->subAction = 0; - super->actionDelay = 180; + super->timer = 180; } } void MazaalBossObject_Action8(MazaalBossObjectEntity* this) { switch (super->subAction) { default: - if (--super->actionDelay == 0) { - super->actionDelay = 90; + if (--super->timer == 0) { + super->timer = 90; super->subAction = 1; SoundReq(SFX_SECRET_BIG); SetFlag(0x31); @@ -174,14 +174,14 @@ void MazaalBossObject_Action8(MazaalBossObjectEntity* this) { } break; case 1: - if (--super->actionDelay == 0) { - super->actionDelay = 120; + if (--super->timer == 0) { + super->timer = 120; super->subAction = 2; sub_0809AD68(this); } break; case 2: - if (--super->actionDelay == 0) { + if (--super->timer == 0) { gRoomControls.camera_target = &gNewPlayerEntity.base; gPlayerState.controlMode = CONTROL_1; DeleteThisEntity(); diff --git a/src/object/metalDoor.c b/src/object/metalDoor.c index 383949b5..fd5e7b22 100644 --- a/src/object/metalDoor.c +++ b/src/object/metalDoor.c @@ -37,7 +37,7 @@ void sub_080A0684(Entity* this) { void sub_080A0718(Entity* this) { if (sub_08083734(this, 2) != 0) { this->action = 2; - this->actionDelay = 0xc; + this->timer = 0xc; this->spriteSettings.draw = TRUE; this->direction = 0; this->y.HALF.HI += 0x24; @@ -51,7 +51,7 @@ void sub_080A074C(Entity* this) { LinearMoveUpdate(this); - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 3; this->z.HALF.HI = 0; this->x.HALF.HI = this->field_0x70.HALF.LO; @@ -73,7 +73,7 @@ void sub_080A074C(Entity* this) { void sub_080A07BC(Entity* this) { if (CheckFlags(this->field_0x86.HWORD)) { this->action = 4; - this->actionDelay = 0xc; + this->timer = 0xc; this->direction = 0x10; this->y.HALF.HI += 2; sub_080A0870(this); @@ -85,7 +85,7 @@ void sub_080A07F0(Entity* this) { LinearMoveUpdate(this); - if (--this->actionDelay == 0) { + if (--this->timer == 0) { DeleteThisEntity(); } } diff --git a/src/object/minecart.c b/src/object/minecart.c index 937439fe..f49042bf 100644 --- a/src/object/minecart.c +++ b/src/object/minecart.c @@ -28,11 +28,11 @@ void Minecart(Entity* this) { sub_080916EC, sub_080917DC, sub_080918A4, sub_080919AC, sub_08091C0C, sub_08091C98, sub_08091CC8, sub_08091D90, }; actionFuncs[this->action]((MinecartEntity*)this); - this->bitfield = 0; + this->contactFlags = 0; } void sub_080916EC(MinecartEntity* this) { - struct_030010EC* unk = &gRoomTransition.minecart_data[super->actionDelay]; + struct_030010EC* unk = &gRoomTransition.minecart_data[super->timer]; this->minecartData = unk; if ((gRoomControls.room != unk->room) || (gPlayerState.flags & PL_IN_MINECART) != 0) { @@ -46,7 +46,7 @@ void sub_080916EC(MinecartEntity* this) { super->hitbox = (Hitbox*)&gUnk_080FD310; COLLISION_ON(super); super->hitType = 1; - super->field_0x3c = 0x47; + super->collisionFlags = 0x47; super->hurtType = 0x44; super->flags2 = 0x80; super->direction = DirectionFromAnimationState(super->animationState); @@ -57,7 +57,7 @@ void sub_080916EC(MinecartEntity* this) { } void sub_080917DC(MinecartEntity* this) { - if ((super->bitfield & 0x7f) == 0x1d) { + if ((super->contactFlags & 0x7f) == 0x1d) { super->zVelocity = Q_16_16(2.625); super->action = 7; InitAnimationForceUpdate(super, super->type2 + 4 + super->animationState); @@ -66,15 +66,15 @@ void sub_080917DC(MinecartEntity* this) { if (sub_0800445C(super) != 0) { if (!((gPlayerState.flags & (PL_MINISH | PL_ROLLING)) || gPlayerState.field_0x1c || gPlayerState.heldObject || gPlayerState.jump_status)) { - super->actionDelay++; + super->timer++; } else { - super->actionDelay = 0; + super->timer = 0; } } else { - super->actionDelay = 0; + super->timer = 0; } if (super->type2 == 0) { - if (super->actionDelay > 8) { + if (super->timer > 8) { super->action++; gPlayerState.jump_status = 0x81; gPlayerState.flags |= PL_ENTER_MINECART; @@ -86,7 +86,7 @@ void sub_080917DC(MinecartEntity* this) { SoundReq(SFX_PLY_JUMP); } } else { - super->actionDelay = 0; + super->timer = 0; } } } @@ -102,10 +102,10 @@ void sub_080918A4(MinecartEntity* this) { gPlayerEntity.animationState = super->animationState << 1; gPlayerState.flags = (gPlayerState.flags ^ PL_ENTER_MINECART) | PL_IN_MINECART; super->action++; - super->field_0xf = 1; + super->subtimer = 1; super->flags |= ENT_PERSIST; super->hitType = 0x97; - super->field_0x3c = (gPlayerEntity.field_0x3c + 1) | 0x20; + super->collisionFlags = (gPlayerEntity.collisionFlags + 1) | 0x20; super->flags2 = gPlayerEntity.flags2; super->hurtType = 0x18; super->damage = 8; @@ -152,9 +152,9 @@ void sub_080919AC(MinecartEntity* this) { SoundReq(SFX_138); } - if (super->field_0xf-- == 0) { + if (super->subtimer-- == 0) { SoundReq(SFX_PLY_VO7); - super->field_0xf = 0x3c; + super->subtimer = 0x3c; } uVar3 = GetRelativeCollisionTile(super, gUnk_081223C8[super->animationState * 2], @@ -168,7 +168,7 @@ void sub_080919AC(MinecartEntity* this) { case 0x64: super->flags &= ~ENT_PERSIST; super->hitType = 1; - super->field_0x3c = 0x47; + super->collisionFlags = 0x47; super->hurtType = 0x44; super->flags2 = 0x80; super->action = 6; diff --git a/src/object/minecartDoor.c b/src/object/minecartDoor.c index 514e9b1a..e7f3e52c 100644 --- a/src/object/minecartDoor.c +++ b/src/object/minecartDoor.c @@ -74,7 +74,7 @@ void MinecartDoor_Init(MinecartDoorEntity* this) { void MinecartDoor_Action1(MinecartDoorEntity* this) { if (sub_08096CEC(this)) { super->action = 2; - super->actionDelay = 7; + super->timer = 7; super->direction = super->type << 3; SetTile(this->unk_74, this->unk_76, super->collisionLayer); EnqueueSFX(SFX_10B); @@ -83,7 +83,7 @@ void MinecartDoor_Action1(MinecartDoorEntity* this) { void MinecartDoor_Action2(MinecartDoorEntity* this) { LinearMoveUpdate(super); - if (--super->actionDelay == 0) { + if (--super->timer == 0) { sub_08096E04(this); super->spriteSettings.draw = 0; super->x.HALF.HI = this->unk_70; @@ -107,7 +107,7 @@ void MinecartDoor_Action3(MinecartDoorEntity* this) { } bVar3 = FALSE; } else { - bVar3 = --super->actionDelay * 0x1000000; + bVar3 = --super->timer * 0x1000000; } } else { bVar3 = sub_08096D84(this); @@ -120,7 +120,7 @@ void MinecartDoor_Action3(MinecartDoorEntity* this) { void MinecartDoor_Action4(MinecartDoorEntity* this) { LinearMoveUpdate(super); - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = 1; super->x.HALF.HI = this->unk_70; super->y.HALF.HI = this->unk_72; @@ -189,5 +189,5 @@ bool32 sub_08096D84(MinecartDoorEntity* this) { void sub_08096E04(MinecartDoorEntity* this) { super->action = 3; - super->actionDelay = 8; + super->timer = 8; } diff --git a/src/object/mineralWaterSource.c b/src/object/mineralWaterSource.c index e4b438d4..40f40837 100644 --- a/src/object/mineralWaterSource.c +++ b/src/object/mineralWaterSource.c @@ -32,7 +32,7 @@ void MineralWaterSource_Init(Entity* this) { COLLISION_ON(this); - this->field_0x3c = 7; + this->collisionFlags = 7; this->hitType = 145; this->flags2 = 2; @@ -40,5 +40,5 @@ void MineralWaterSource_Init(Entity* this) { } void sub_080973DC(Entity* this) { - this->bitfield = 0; + this->contactFlags = 0; } diff --git a/src/object/minishEmoticon.c b/src/object/minishEmoticon.c index 20c68e43..fe93538d 100644 --- a/src/object/minishEmoticon.c +++ b/src/object/minishEmoticon.c @@ -70,20 +70,20 @@ void sub_08082098(Entity* this) { animIndex = origAnimIndex + 4; if (this->animIndex != animIndex) { this->z.WORD = 0; - this->actionDelay = 6; - } else if (this->actionDelay-- == 0) { + this->timer = 6; + } else if (this->timer-- == 0) { switch (this->spriteOffsetY) { case 0: this->spriteOffsetY = -2; - this->actionDelay = 6; + this->timer = 6; break; case -2: this->spriteOffsetY = -1; - this->actionDelay = 6; + this->timer = 6; break; case -1: this->spriteOffsetY = 0; - this->actionDelay = 3; + this->timer = 3; break; } } diff --git a/src/object/minishLight.c b/src/object/minishLight.c index a316e499..3ec27575 100644 --- a/src/object/minishLight.c +++ b/src/object/minishLight.c @@ -9,8 +9,8 @@ void MinishLight(Entity* this) { void sub_0809F840(Entity* this) { this->action = 1; this->frameIndex = 0; - this->actionDelay = 0x20; - this->field_0xf = 0; + this->timer = 0x20; + this->subtimer = 0; if (this->type2 != 0) { this->spriteSettings.flipX = 1; @@ -20,16 +20,16 @@ void sub_0809F840(Entity* this) { } void sub_0809F868(Entity* this) { - if (--this->actionDelay == 0) { - if (this->field_0xf == 0) { + if (--this->timer == 0) { + if (this->subtimer == 0) { if (++this->frameIndex == 3) { - this->field_0xf = 1; + this->subtimer = 1; } } else { if (--this->frameIndex == 0) { - this->field_0xf = 0; + this->subtimer = 0; } } - this->actionDelay = 32; + this->timer = 32; } } diff --git a/src/object/minishSizedEntrance.c b/src/object/minishSizedEntrance.c index bf235ee0..e40ac638 100644 --- a/src/object/minishSizedEntrance.c +++ b/src/object/minishSizedEntrance.c @@ -24,13 +24,13 @@ void sub_08090EC0(Entity* this) { void sub_08090F00(Entity* this) { if (this->type == 1) { Entity* parent = this->parent; - u32 mask = 1 << this->field_0xf; + u32 mask = 1 << this->subtimer; if (!(parent->zVelocity & mask)) { DeleteThisEntity(); } } if ((gPlayerState.flags & PL_MINISH) && EntityInRectRadius(this, &gPlayerEntity, 4, 4) && (gPlayerEntity.z.HALF.HI == 0) && (((u16)gPlayerState.field_0x90) & gUnk_0812225C[this->type2])) { - DoExitTransition(GetCurrentRoomProperty(this->actionDelay)); + DoExitTransition(GetCurrentRoomProperty(this->timer)); } } diff --git a/src/object/object11.c b/src/object/object11.c index 884491df..76f688b7 100644 --- a/src/object/object11.c +++ b/src/object/object11.c @@ -60,12 +60,12 @@ void Object11_Init(Object11Entity* this) { super->action = 2; super->flags |= ENT_COLLIDE; super->spriteRendering.b3 = 2; - super->field_0x1d = gUnk_08120588[super->type].unk_1; - super->field_0x1c = gUnk_08120588[super->type].unk_2; + super->gustJarTolerance = gUnk_08120588[super->type].unk_1; + super->gustJarFlags = gUnk_08120588[super->type].unk_2; super->speed = 0x80; super->collisionLayer = gPlayerEntity.collisionLayer; super->health = 1; - super->field_0x3c = 7; + super->collisionFlags = 7; super->hitType = 0x6e; super->flags2 = 4; super->hitbox = (Hitbox*)&gUnk_081205B4; @@ -76,7 +76,7 @@ void Object11_Init(Object11Entity* this) { } void Object11_Action1(Object11Entity* this) { - if (((gPlayerState.field_0x1c & 0xf) != 1) || ((super->bitfield & 0x7f) != 0x13)) { + if (((gPlayerState.field_0x1c & 0xf) != 1) || ((super->contactFlags & 0x7f) != 0x13)) { RestorePrevTileEntity(COORD_TO_TILE(super), super->collisionLayer); DeleteThisEntity(); } @@ -100,7 +100,7 @@ void Object11_Action2SubAction0(Object11Entity* this) { void Object11_Action2SubAction1(Object11Entity* this) { Object11_Action1(this); sub_0806F4E8(super); - if ((super->field_0x1d != 0) && (--super->field_0x1d == 0)) { + if ((super->gustJarTolerance != 0) && (--super->gustJarTolerance == 0)) { super->subAction = 2; } } @@ -111,10 +111,10 @@ void Object11_Action2SubAction2(Object11Entity* this) { super->spriteOffsetX = 0; sub_0807B9B8(this->unk_70, COORD_TO_TILE(super), super->collisionLayer); } - if (((gPlayerState.field_0x1c & 0xf) != 1) || ((super->bitfield & 0x7f) != 0x13)) { + if (((gPlayerState.field_0x1c & 0xf) != 1) || ((super->contactFlags & 0x7f) != 0x13)) { Object11_Action2SubAction5(this); } - if (sub_0806F3E4(super) && ((super->field_0x1c & 0xf) == 1)) { + if (sub_0806F3E4(super) && ((super->gustJarFlags & 0xf) == 1)) { DeleteThisEntity(); } } @@ -130,12 +130,12 @@ void Object11_Action2SubAction5(Object11Entity* this) { case 0xff: break; case 0xf: - CreateFx(super, super->actionDelay, 0x80); + CreateFx(super, super->timer, 0x80); break; case 0: break; default: - CreateObjectWithParent(super, super->type2, super->actionDelay, 0); + CreateObjectWithParent(super, super->type2, super->timer, 0); break; } DeleteThisEntity(); diff --git a/src/object/object12.c b/src/object/object12.c index bc5aa3d6..2b1ce0c5 100644 --- a/src/object/object12.c +++ b/src/object/object12.c @@ -41,7 +41,7 @@ void Object12_Init(Object12Entity* this) { sub_080850FC(this); } else { super->action = 2; - super->actionDelay = 0xf0; + super->timer = 0xf0; super->speed = 0x80; super->direction = 0x18; } @@ -53,9 +53,9 @@ void Object12_Action1(Object12Entity* this) { NONMATCH("asm/non_matching/object12/Object12_Action2.inc", void Object12_Action2(Object12Entity* this)) { u32 tmp; - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = 3; - super->actionDelay = 0x1e; + super->timer = 0x1e; super->spriteOffsetY = 4; gScreen.lcd.displayControl |= 0x2000; gScreen.controls.windowInsideControl = 0x1f; @@ -69,15 +69,15 @@ NONMATCH("asm/non_matching/object12/Object12_Action2.inc", void Object12_Action2 END_NONMATCH void Object12_Action3(Object12Entity* this) { - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = 4; - super->actionDelay = 0x60; + super->timer = 0x60; } } void Object12_Action4(Object12Entity* this) { LinearMoveUpdate(super); - if (--super->actionDelay == 0) { + if (--super->timer == 0) { gScreen.lcd.displayControl &= 0xdfff; DeleteEntity(super); } diff --git a/src/object/object15.c b/src/object/object15.c index 43b03d0b..183ff93b 100644 --- a/src/object/object15.c +++ b/src/object/object15.c @@ -28,9 +28,9 @@ void Object15_Action1(Entity* this) { this->spriteSettings.draw ^= 1; } - if ((int)(this->actionDelay * 0x1000000) >= 0) { - if (this->actionDelay) { - if (--this->actionDelay == 0) { + if ((int)(this->timer * 0x1000000) >= 0) { + if (this->timer) { + if (--this->timer == 0) { DeleteThisEntity(); } } else { diff --git a/src/object/object1F.c b/src/object/object1F.c index 2c548d67..351ff739 100644 --- a/src/object/object1F.c +++ b/src/object/object1F.c @@ -49,13 +49,13 @@ void Object1F_Init(Object1FEntity* this) { super->x.HALF.HI = gUnk_08120A20[super->animationState] + super->x.HALF.HI; super->y.HALF.HI = gUnk_08120A20[super->animationState + 1] + super->y.HALF.HI; - super->spriteVramOffset = gUnk_08120A18[super->field_0xf].spriteVramOffset; - temp = gUnk_08120A18[super->field_0xf].unk1; + super->spriteVramOffset = gUnk_08120A18[super->subtimer].spriteVramOffset; + temp = gUnk_08120A18[super->subtimer].unk1; super->palette.b.b0 = temp; - this->unk6c = gUnk_08120A18[super->field_0xf].unk2; + this->unk6c = gUnk_08120A18[super->subtimer].unk2; super->collisionLayer = gPlayerEntity.collisionLayer; super->speed = 0x100; - InitializeAnimation(super, gUnk_08120A18[super->field_0xf].animationState); + InitializeAnimation(super, gUnk_08120A18[super->subtimer].animationState); } void Object1F_Action1(Object1FEntity* this) { @@ -92,9 +92,9 @@ void Object1F_Action2(Object1FEntity* this) { default: if (super->type2 != 0) { if (super->type2 == 15) { - CreateFx(super, super->actionDelay, 0x80); + CreateFx(super, super->timer, 0x80); } else { - CreateObjectWithParent(super, super->type2, super->actionDelay, 0); + CreateObjectWithParent(super, super->type2, super->timer, 0); } } } diff --git a/src/object/object20.c b/src/object/object20.c index 9474f662..cf8c1d55 100644 --- a/src/object/object20.c +++ b/src/object/object20.c @@ -34,7 +34,7 @@ void sub_08087824(Entity* this) { } this->action = 1; this->flags |= 0x80; - this->field_0x3c = 0x13; + this->collisionFlags = 0x13; this->health = 0xff; this->hitType = 0xa9; this->hurtType = 0x16; diff --git a/src/object/object21.c b/src/object/object21.c index f25e1a50..4f085cf2 100644 --- a/src/object/object21.c +++ b/src/object/object21.c @@ -33,8 +33,8 @@ void Object21(Object21Entity* this) { }; gUnk_08120A68[super->action](this); GetNextFrame(super); - if (super->actionDelay != 0) { - super->actionDelay--; + if (super->timer != 0) { + super->timer--; } else { if (super->animIndex == 0xa) { InitializeAnimation(super, 0xd); @@ -79,14 +79,14 @@ void sub_08087A10(Object21Entity* this) { case 3: super->flags |= ENT_COLLIDE; super->health = 1; - super->field_0x3c = 7; + super->collisionFlags = 7; super->hitType = 0xaa; super->flags2 = 0x0e; super->hitbox = (Hitbox*)&gUnk_08120A8C; - super->field_0x1c = 0; + super->gustJarFlags = 0; case 2: rand = Random(); - super->actionDelay = gUnk_08120A7A[rand & 3]; + super->timer = gUnk_08120A7A[rand & 3]; tmp = (rand >> 8) & 3; if ((rand & 0x10) != 0) { tmp = -tmp; @@ -104,12 +104,12 @@ void sub_08087A10(Object21Entity* this) { void sub_08087AFC(Object21Entity* this) { Object21Entity* entity; - if ((super->bitfield & 0x80) == 0) { + if ((super->contactFlags & 0x80) == 0) { return; } - switch (super->bitfield & 0x7f) { + switch (super->contactFlags & 0x7f) { case 0x16: - super->direction = GetFacingDirection(super->field_0x4c, super); + super->direction = GetFacingDirection(super->contactedEntity, super); super->speed = 0x100; break; case 0x13: @@ -118,7 +118,7 @@ void sub_08087AFC(Object21Entity* this) { break; case 0x1b: case 0x1c: - entity = (Object21Entity*)super->field_0x4c; + entity = (Object21Entity*)super->contactedEntity; super->direction = CalculateDirectionTo(entity->unk_84, entity->unk_80, super->x.WORD, super->y.WORD); super->speed = 0x100; break; @@ -131,7 +131,7 @@ void sub_08087B58(Object21Entity* this) { sub_08087B9C, sub_08087B9C, }; - if ((super->bitfield & 0x80) != 0) { + if ((super->contactFlags & 0x80) != 0) { gUnk_08120A80[super->subAction](this); } else { super->action = 1; @@ -143,7 +143,7 @@ const Hitbox gUnk_08120A8C = { 0, 0, { 6, 3, 3, 6 }, 3, 3 }; void sub_08087B88(Object21Entity* this) { super->knockbackSpeed = 0x100; super->subAction = 1; - super->field_0x1d = 1; + super->gustJarTolerance = 1; } void sub_08087B9C(Object21Entity* this) { diff --git a/src/object/object2A.c b/src/object/object2A.c index 2f24592d..4ace87be 100644 --- a/src/object/object2A.c +++ b/src/object/object2A.c @@ -16,16 +16,16 @@ void Object2A_Init(Entity* this) { this->action = 1; this->spriteSettings.draw = TRUE; if (this->type2 != 0) { - this->actionDelay = this->type2; + this->timer = this->type2; } InitializeAnimation(this, 0); switch (this->type) { case 1: this->y.HALF.HI -= 8; - this->actionDelay = 0x28; + this->timer = 0x28; break; case 2: - this->actionDelay = 0xf; + this->timer = 0xf; sub_08004168(this); break; case 3: @@ -52,7 +52,7 @@ void sub_08089BA0(Entity* this) { return; case 1: case 2: - if (this->actionDelay-- != 0) + if (this->timer-- != 0) return; if (this->type == 2) { sub_0807B7D8(((u16*)this->child)[3], COORD_TO_TILE(this), this->collisionLayer); @@ -67,7 +67,7 @@ void sub_08089BA0(Entity* this) { if (this->parent->next == NULL) { DeleteThisEntity(); } - if (--this->actionDelay == 0) { + if (--this->timer == 0) { DeleteThisEntity(); } diff --git a/src/object/object30.c b/src/object/object30.c index dca304b4..4f6f1d33 100644 --- a/src/object/object30.c +++ b/src/object/object30.c @@ -89,7 +89,7 @@ void Object30_Action2(Object30Entity* this) { } // fallthrough case 1: - tmp = gUnk_08121194[(super->field_0xf++ >> 3) & 7]; + tmp = gUnk_08121194[(super->subtimer++ >> 3) & 7]; super->z.HALF.HI = tmp << 0x18 >> 0x18; if (!IsCollidingPlayer(super)) { return; @@ -102,12 +102,12 @@ void Object30_Action2(Object30Entity* this) { void sub_0808A968(Object30Entity* this) { super->action = 2; - super->actionDelay = 0x1e; + super->timer = 0x1e; super->spriteSettings.draw = 1; super->zVelocity = 0x28000; super->spritePriority.b1 = 3; super->spriteSettings.shadow = 0; - super->field_0x3c |= 0x10; + super->collisionFlags |= 0x10; super->hitbox = (Hitbox*)&gUnk_08121C58; SetDefaultPriority(super, 2); this->unk_70 = 0x2800; diff --git a/src/object/object35.c b/src/object/object35.c index 5a7f0a83..cee74852 100644 --- a/src/object/object35.c +++ b/src/object/object35.c @@ -60,15 +60,15 @@ void Object35_Type0Init(Object35Entity* this) { super->collisionLayer = 2; UpdateSpriteForCollisionLayer(super); super->spritePriority.b0 = 1; - super->actionDelay = -0x4c; + super->timer = -0x4c; InitializeAnimation(super, super->type2); } void Object35_Type0Action1(Object35Entity* this) { s8 tmp; GetNextFrame(super); - if (--super->actionDelay == 0) { - super->actionDelay = -0x4c; + if (--super->timer == 0) { + super->timer = -0x4c; super->type2++; tmp = 3; super->type2 = super->type2 % tmp; @@ -97,22 +97,22 @@ void Object35_Type1Init(Object35Entity* this) { super->spritePriority.b0 = 5; this->unk_76 = COORD_TO_TILE(super); this->unk_74 = GetTileIndex(this->unk_76, super->collisionLayer); - if (super->actionDelay == 0) { + if (super->timer == 0) { super->action = 1; - super->field_0xf = 0x78; + super->subtimer = 0x78; SetTile(0x4022, this->unk_76, super->collisionLayer); } else { super->action = 3; super->spriteSettings.draw = 0; super->spriteSettings.flipY = 1; - super->actionDelay = 0; + super->timer = 0; } } void Object35_Type1Action1(Object35Entity* this) { if (CheckRoomFlag(0)) { super->action = 2; - super->actionDelay = 7; + super->timer = 7; super->direction = 0; SetTile(this->unk_74, this->unk_76, super->collisionLayer); EnqueueSFX(SFX_10B); @@ -121,9 +121,9 @@ void Object35_Type1Action1(Object35Entity* this) { void Object35_Type1Action2(Object35Entity* this) { LinearMoveUpdate(super); - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = 5; - super->actionDelay = 8; + super->timer = 8; super->spriteSettings.draw = 0; super->x.HALF.HI = this->unk_70; super->y.HALF.HI = this->unk_72; @@ -139,7 +139,7 @@ void Object35_Type1Action3(Object35Entity* this) { void Object35_Type1Action4(Object35Entity* this) { LinearMoveUpdate(super); - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = 5; sub_08083814(super, 2); EnqueueSFX(SFX_10B); @@ -160,7 +160,7 @@ void Object35_Type2(Object35Entity* this) { void Object35_Type2Init(Object35Entity* this) { super->action = 1; - super->actionDelay = 0x10; + super->timer = 0x10; super->z.HALF.HI -= 0x10; if (super->type2 == 0) { super->frameIndex = 2; @@ -174,7 +174,7 @@ void Object35_Type2Init(Object35Entity* this) { } void Object35_Type2Action1(Object35Entity* this) { - if (--super->actionDelay == 0) { + if (--super->timer == 0) { DeleteThisEntity(); } } diff --git a/src/object/object36.c b/src/object/object36.c index 94dae2b3..cb262560 100644 --- a/src/object/object36.c +++ b/src/object/object36.c @@ -38,14 +38,14 @@ void sub_0808BB30(Object36Entity* this) { } else { super->action = 1; super->flags |= ENT_COLLIDE; - super->actionDelay = 0x78; - super->field_0xf = 0; + super->timer = 0x78; + super->subtimer = 0; super->spriteRendering.b3 = 3; super->spritePriority.b0 = 4; super->spriteOrientation.flipY = 2; super->speed = 0x300; super->hitType = 1; - super->field_0x3c = 7; + super->collisionFlags = 7; super->hurtType = 0x48; super->flags2 = 4; super->hitbox = (Hitbox*)&gHitbox_0; @@ -71,7 +71,7 @@ void sub_0808BBE0(Object36Entity* this) { ptr = &gUnk_0812144C[diff * 2]; SetAffineInfo(super, ptr[0], ptr[1], 0); } else { - super->bitfield &= 0x7f; + super->contactFlags &= 0x7f; } } @@ -81,29 +81,29 @@ void sub_0808BC3C(Object36Entity* this) { tmp = -0x170; super->y.HALF.HI = gRoomControls.origin_y - ((super->parent)->zVelocity + tmp); sub_0808BBE0(this); - if (super->bitfield == 0x93) { - super->actionDelay--; + if (super->contactFlags == 0x93) { + super->timer--; super->spriteSettings.draw = 1; - if (super->actionDelay == 0) { + if (super->timer == 0) { SetGlobalFlag(LV1TARU_OPEN); super->action = 2; - super->field_0xf = 0x80; + super->subtimer = 0x80; super->spriteOffsetY = 0; } else { - if ((super->actionDelay & 1) != 0) { + if ((super->timer & 1) != 0) { super->x.HALF.HI += ((Random() & 3) - 2); super->y.HALF.HI += ((Random() & 3) - 1); } - if (super->field_0xf != 1) { - super->field_0xf = 1; + if (super->subtimer != 1) { + super->subtimer = 1; LoadGfxGroup(0x4a); } } } else { - super->actionDelay = 0x78; + super->timer = 0x78; super->spriteSettings.draw = 0; - if (super->field_0xf != 0) { - super->field_0xf = 0; + if (super->subtimer != 0) { + super->subtimer = 0; LoadGfxGroup(0x49); } } @@ -117,11 +117,11 @@ void sub_0808BD00(Object36Entity* this) { void sub_0808BD14(Object36Entity* this) { - if (super->field_0xf != 0) { - super->field_0xf -= 8; - SetAffineInfo(super, 0x200 - super->field_0xf, 0x200 - super->field_0xf, 0); + if (super->subtimer != 0) { + super->subtimer -= 8; + SetAffineInfo(super, 0x200 - super->subtimer, 0x200 - super->subtimer, 0); } - if (super->bitfield == 0x93) { + if (super->contactFlags == 0x93) { super->direction = GetFacingDirection(super, &gPlayerEntity); LinearMoveUpdate(super); if (EntityWithinDistance(super, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI - 6, 0x1c)) { @@ -130,10 +130,10 @@ void sub_0808BD14(Object36Entity* this) { } else { if ((super->flags & ENT_COLLIDE) != 0) { super->flags &= ~ENT_COLLIDE; - super->actionDelay = 0x1e; + super->timer = 0x1e; } else { super->spriteSettings.draw ^= 1; - if (--super->actionDelay == 0) { + if (--super->timer == 0) { sub_0808BD00(this); } } diff --git a/src/object/object3D.c b/src/object/object3D.c index 807285ce..79a1aa16 100644 --- a/src/object/object3D.c +++ b/src/object/object3D.c @@ -71,8 +71,8 @@ void Object3D_Action1(Object3DEntity* this) { super->spriteOrientation.flipY = 0; super->spriteRendering.b3 = 0; super->spritePriority.b0 = 0; - super->actionDelay = 0x1e; - super->field_0xf = 0xff; + super->timer = 0x1e; + super->subtimer = 0xff; super->spriteRendering.b0 = 3; SetAffineInfo(super, 0x100, 0x100, 0); gArea.field_0x10 = 1; @@ -97,7 +97,7 @@ void sub_0808D030(void) { } void Object3D_Action2(Object3DEntity* this) { - u32 tmp = super->actionDelay--; + u32 tmp = super->timer--; if (tmp != 0) { if (this->unk_68 != 0) { this->unk_68 -= 2; @@ -105,10 +105,10 @@ void Object3D_Action2(Object3DEntity* this) { this->unk_68 = 0; } sub_0801E1EC(super->x.HALF.HI, super->y.HALF.HI, this->unk_68); - if (0x80 < super->field_0xf) { - super->field_0xf -= 8; + if (0x80 < super->subtimer) { + super->subtimer -= 8; } - SetAffineInfo(super, super->field_0xf, super->field_0xf, 0); + SetAffineInfo(super, super->subtimer, super->subtimer, 0); } else { gArea.filler3[0]++; gArea.field_0x10 = 0; diff --git a/src/object/object3E.c b/src/object/object3E.c index c950452e..6442831b 100644 --- a/src/object/object3E.c +++ b/src/object/object3E.c @@ -41,7 +41,7 @@ void Object3E_Type0(Object3EEntity* this) { switch (super->action) { case 0: super->action = 1; - super->actionDelay = 0x40 - (Random() & 0x1f); + super->timer = 0x40 - (Random() & 0x1f); super->frameIndex = 0; super->animationState = 0; super->spriteRendering.b3 = 3; @@ -49,21 +49,21 @@ void Object3E_Type0(Object3EEntity* this) { super->collisionLayer = 1; break; case 1: - if (--super->actionDelay == 0) { - super->actionDelay = 8; - super->field_0xf = 4; + if (--super->timer == 0) { + super->timer = 8; + super->subtimer = 4; super->action = 2; super->animationState = Random() & 3; } break; case 2: - if (--super->actionDelay == 0) { - if (--super->field_0xf == 0) { + if (--super->timer == 0) { + if (--super->subtimer == 0) { super->frameIndex = 0; super->action = 1; - super->actionDelay = 0x40 - (Random() & 0x1f); + super->timer = 0x40 - (Random() & 0x1f); } else { - super->actionDelay = 8; + super->timer = 8; tmp2 = super->animationState; if (super->frameIndex != tmp2) { tmp = tmp2; @@ -85,8 +85,8 @@ void Object3E_Type1(Object3EEntity* this) { switch (super->action) { case 0: super->action = 1; - super->actionDelay = 8; - super->field_0xf = 0; + super->timer = 8; + super->subtimer = 0; super->frameIndex = 0; super->spritePriority.b0 = 7; SetTile(0x4069, COORD_TO_TILE(super) - 0x40, 1); @@ -104,14 +104,14 @@ void Object3E_Type1(Object3EEntity* this) { case 1: break; } - if (--super->actionDelay == 0) { - super->actionDelay = 8; + if (--super->timer == 0) { + super->timer = 8; if (super->type == 9) { - super->actionDelay = 2; + super->timer = 2; } - ChangeObjPalette(super, gUnk_08121704[super->field_0xf++]); - if (gUnk_08121704[super->field_0xf] == 0) { - super->field_0xf = 0; + ChangeObjPalette(super, gUnk_08121704[super->subtimer++]); + if (gUnk_08121704[super->subtimer] == 0) { + super->subtimer = 0; } } } @@ -170,16 +170,16 @@ void Object3E_Type6(Object3EEntity* this) { static const u16 gUnk_08121720[] = { 0x149, 0x14a, 0x14b, 0x14a, 0, 0 }; if (super->action == 0) { super->action = 1; - super->actionDelay = 8; + super->timer = 8; super->spritePriority.b0 = 7; gScreen.controls.layerFXControl = 0x640; gScreen.controls.alphaBlend = 0x1003; } - if (--super->actionDelay == 0) { - super->actionDelay = 2; - sub_0801D28C(super, gUnk_08121720[super->field_0xf++]); - if (gUnk_08121720[super->field_0xf] == 0) { - super->field_0xf = 0; + if (--super->timer == 0) { + super->timer = 2; + sub_0801D28C(super, gUnk_08121720[super->subtimer++]); + if (gUnk_08121720[super->subtimer] == 0) { + super->subtimer = 0; } } } @@ -212,13 +212,13 @@ void Object3E_Type8_Init(Object3EEntity* this) { super->action = 2; if ((super->type2 == 0) && (CheckLocalFlag(0x7c) == 0)) { super->action = 1; - super->actionDelay = 0; + super->timer = 0; super->spriteRendering.alphaBlend = 1; gScreen.controls.layerFXControl = 0x640; gScreen.controls.alphaBlend = 0x1000; SoundReq(SFX_179); } else { - super->actionDelay = 8; + super->timer = 8; tilePosition = COORD_TO_TILE(super); if (super->type2 != 0) { tilePosition -= 0x40; @@ -229,11 +229,11 @@ void Object3E_Type8_Init(Object3EEntity* this) { void Object3E_Type8_Action1(Object3EEntity* this) { if ((gRoomTransition.frameCount & 3U) == 0) { - gScreen.controls.alphaBlend = ((0x10 - super->actionDelay) * 0x100) | super->actionDelay; - super->actionDelay++; + gScreen.controls.alphaBlend = ((0x10 - super->timer) * 0x100) | super->timer; + super->timer++; if (gScreen.controls.alphaBlend == 0x10) { super->action = 2; - super->actionDelay = 8; + super->timer = 8; super->spriteRendering.alphaBlend = 0; gScreen.controls.layerFXControl = 0; SetTile(0x4069, COORD_TO_TILE(super), super->collisionLayer); @@ -245,11 +245,11 @@ void Object3E_Type8_Action2(Object3EEntity* this) { static const u16 gUnk_08121738[] = { 0x14c, 0x14d, 0x14e, 0x14f, 0x150, 0x151, 0x150, 0x14f, 0x14e, 0x14d, 0x14c, 0, }; - if (--super->actionDelay == 0) { - super->actionDelay = 8; - ChangeObjPalette(super, gUnk_08121738[super->field_0xf++]); - if (gUnk_08121738[super->field_0xf] == 0) { - super->field_0xf = 0; + if (--super->timer == 0) { + super->timer = 8; + ChangeObjPalette(super, gUnk_08121738[super->subtimer++]); + if (gUnk_08121738[super->subtimer] == 0) { + super->subtimer = 0; } } } diff --git a/src/object/object42.c b/src/object/object42.c index 28a5df5c..5fa85943 100644 --- a/src/object/object42.c +++ b/src/object/object42.c @@ -39,7 +39,7 @@ void Object42(Object42Entity* this) { void sub_0808DDB4(Object42Entity* this) { super->action = 1; if (super->type != 0) { - super->actionDelay = 0x78; + super->timer = 0x78; this->unk_6c = 0xf0; InitializeAnimation(super, 0); sub_0808DDE8(this); @@ -55,9 +55,9 @@ void sub_0808DDE8(Object42Entity* this) { Entity* player; this->unk_6c--; if (sub_0807953C()) { - super->field_0xf++; + super->subtimer++; } - if (((0x1e < super->field_0xf) || ((gPlayerState.flags & 0x1810) != 0)) || (this->unk_6c == 0)) { + if (((0x1e < super->subtimer) || ((gPlayerState.flags & 0x1810) != 0)) || (this->unk_6c == 0)) { gPlayerState.flags &= 0xfffffbff; DeleteThisEntity(); } diff --git a/src/object/object43.c b/src/object/object43.c index b8d9edea..6a419c3a 100644 --- a/src/object/object43.c +++ b/src/object/object43.c @@ -39,7 +39,7 @@ void Object43_Init(Object43Entity* this) { super->spriteOrientation.flipY = gPlayerEntity.spriteOrientation.flipY; super->animationState = gPlayerEntity.animationState >> 1; super->direction = (((super->animationState + 1) & 3) << 3); - super->field_0xf = 6; + super->subtimer = 6; super->speed = 0x140; super->spriteVramOffset = 0x3c; super->palette.b.b0 = 4; @@ -48,13 +48,13 @@ void Object43_Init(Object43Entity* this) { super->updatePriority = 6; InitializeAnimation(super, 7); if (super->type2 != 0) { - super->actionDelay = 0x28; + super->timer = 0x28; } else { super->spriteSettings.draw = 1; if ((gPlayerState.skills & SKILL_FAST_SPIN) != 0) { - super->actionDelay = 0x28; + super->timer = 0x28; } else { - super->actionDelay = 0x50; + super->timer = 0x50; } Object43_Action1(this); @@ -99,13 +99,13 @@ void Object43_Action1(Object43Entity* this) { if (tmp1 != 0) { GetNextFrame(super); - if (super->actionDelay != 0) { - super->actionDelay--; + if (super->timer != 0) { + super->timer--; tmp2 = 3; if ((super->type2 == 0) && ((gPlayerState.skills & SKILL_FAST_SPIN) == 0)) { tmp2 = 7; } - if ((super->actionDelay & tmp2) == 0) { + if ((super->timer & tmp2) == 0) { this->unk_6c++; } } else { @@ -148,8 +148,8 @@ void Object43_Action1(Object43Entity* this) { break; } - if (--super->field_0xf == 0) { - super->field_0xf = 6; + if (--super->subtimer == 0) { + super->subtimer = 6; super->direction ^= 0x10; } LinearMoveUpdate(super); diff --git a/src/object/object49.c b/src/object/object49.c index 12ad7e38..75998481 100644 --- a/src/object/object49.c +++ b/src/object/object49.c @@ -172,7 +172,7 @@ void sub_0808F3DC(Entity* this) { if (this->action == 0) { this->spriteSettings.draw = 1; this->action = 1; - this->actionDelay = 120; + this->timer = 120; InitializeAnimation(this, this->type + 1); // TODO: This block of code might supposed to be a switch statement. if (this->type != 8) { @@ -217,7 +217,7 @@ void sub_0808F498(Entity* this) { DeleteThisEntity(); } - if (this->actionDelay-- == 0) { + if (this->timer-- == 0) { DeleteThisEntity(); } @@ -226,7 +226,7 @@ void sub_0808F498(Entity* this) { } } else { this->action = 1; - this->actionDelay = 64; + this->timer = 64; var0 = this->type2 != 0 ? 44 : 43; this->x.HALF.HI -= this->parent->hitbox->width; this->x.HALF.HI += (s32)Random() % (this->parent->hitbox->width * 2); diff --git a/src/object/object4B.c b/src/object/object4B.c index b7dbc6ab..94fd9943 100644 --- a/src/object/object4B.c +++ b/src/object/object4B.c @@ -34,13 +34,13 @@ void Object4B(Object4BEntity* this) { void Object4B_Init(Object4BEntity* this) { super->action = 1; - super->actionDelay = 0x3c; + super->timer = 0x3c; InitializeAnimation(super, 0); } void Object4B_Action1(Object4BEntity* this) { - if (--super->actionDelay == 0) { - super->actionDelay = 0x78; + if (--super->timer == 0) { + super->timer = 0x78; super->action++; super->spriteSettings.draw = 1; } @@ -57,13 +57,13 @@ void Object4B_Action2(Object4BEntity* this) { void Object4B_Action3(Object4BEntity* this) { GetNextFrame(super); - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action++; super->direction = 0; super->speed = 0x100; super->zVelocity = 0x20000; super->spriteOrientation.flipY = 0; - super->actionDelay = 0; + super->timer = 0; InitializeAnimation(super, 3); SoundReq(SFX_12B); } @@ -82,7 +82,7 @@ void Object4B_Action4(Object4BEntity* this) { super->y.HALF.HI = gRoomControls.origin_y + 0x230; if ((super->frame & ANIM_DONE) != 0) { super->action++; - super->actionDelay = 0x78; + super->timer = 0x78; InitializeAnimation(super, 2); } } else if ((super->frame & ANIM_DONE) != 0) { @@ -94,7 +94,7 @@ void Object4B_Action4(Object4BEntity* this) { void Object4B_Action5(Object4BEntity* this) { GetNextFrame(super); - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action++; InitializeAnimation(super, 5); } @@ -104,14 +104,14 @@ void Object4B_Action6(Object4BEntity* this) { GetNextFrame(super); if ((super->frame & ANIM_DONE) != 0) { super->action++; - super->actionDelay = 0x3c; + super->timer = 0x3c; InitializeAnimation(super, 1); } } void Object4B_Action7(Object4BEntity* this) { GetNextFrame(super); - if (--super->actionDelay == 0) { + if (--super->timer == 0) { gMenu.overlayType++; DeleteThisEntity(); } diff --git a/src/object/object53.c b/src/object/object53.c index 0e10371e..c4717fce 100644 --- a/src/object/object53.c +++ b/src/object/object53.c @@ -53,10 +53,10 @@ void sub_08091198(Entity* this) { case 0xff: break; case 0xf: - CreateFx(this, this->actionDelay, 0x80); + CreateFx(this, this->timer, 0x80); break; default: - CreateObjectWithParent(this, this->type2, this->actionDelay, 0); + CreateObjectWithParent(this, this->type2, this->timer, 0); break; } diff --git a/src/object/object61.c b/src/object/object61.c index 5756afdd..acf2c4af 100644 --- a/src/object/object61.c +++ b/src/object/object61.c @@ -73,17 +73,17 @@ void Object61_Action1Type0(Object61Entity* this) { this->unk_72 -= 4; break; case 2: - if (super->field_0xf == 0) { + if (super->subtimer == 0) { if (this->unk_72 > 0x80) { this->unk_72 -= 0x20; } else { - super->field_0xf += 1; + super->subtimer += 1; SoundReq(SFX_124); } if (this->unk_6e < 0x120) { this->unk_6e += 0x40; } - } else if (super->field_0xf != 0xff) { + } else if (super->subtimer != 0xff) { if (this->unk_72 < 0x100) { this->unk_72 += 0x20; } else { @@ -95,7 +95,7 @@ void Object61_Action1Type0(Object61Entity* this) { this->unk_6e = 0x100; } if (this->unk_6e == 0x100) { - super->field_0xf = 0xff; + super->subtimer = 0xff; } } else { sub_080936C8(this); @@ -146,12 +146,12 @@ void sub_080936C8(Object61Entity* this) { s32 tmp = gNewPlayerEntity.unk_7c; this->unk_76 = 0x138 - (gNewPlayerEntity.unk_7c >> 2); this->unk_74 = 8 - (tmp / 0x3c); - if (super->actionDelay == 0) { + if (super->timer == 0) { if (this->unk_76 < this->unk_6e) { this->unk_6e -= 8; this->unk_72 += 8; } else { - super->actionDelay++; + super->timer++; this->unk_6e = this->unk_76; this->unk_72 = this->unk_76 + 0x30; } @@ -160,7 +160,7 @@ void sub_080936C8(Object61Entity* this) { this->unk_6e += 8; this->unk_72 -= 8; } else { - super->actionDelay = 0; + super->timer = 0; this->unk_6e = this->unk_76 + 0x30; this->unk_72 = this->unk_76; } diff --git a/src/object/object63.c b/src/object/object63.c index 5cdd827e..120adaf5 100644 --- a/src/object/object63.c +++ b/src/object/object63.c @@ -25,7 +25,7 @@ void sub_08093D88(Entity* this) { this->action = 1; this->z.HALF.HI -= 8; this->zVelocity = 0x2a000; - this->actionDelay = 32; + this->timer = 32; switch (this->type) { case 0: if (CreateRandomItemDrop(this, 4) == 0) { @@ -36,7 +36,7 @@ void sub_08093D88(Entity* this) { case 1: objEnt = CreateObject(0, OBJECT_BLOCKING_STAIRS, 0); if (objEnt != NULL) { - objEnt->actionDelay = 5; + objEnt->timer = 5; sub_08093E10(this, objEnt); } break; @@ -44,11 +44,11 @@ void sub_08093D88(Entity* this) { } void sub_08093DE0(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 2; } - if ((this->actionDelay & 1) != 0) { + if ((this->timer & 1) != 0) { this->child->y.HALF.HI++; } } diff --git a/src/object/object67.c b/src/object/object67.c index 4f794dd6..dec36521 100644 --- a/src/object/object67.c +++ b/src/object/object67.c @@ -45,7 +45,7 @@ typedef struct { typedef struct { s8 x; s8 y; - u8 actionDelay; + u8 timer; u8 unk3; u8 unk4; u8 filler[3]; @@ -118,8 +118,8 @@ void sub_08094148(Object67Entity* this) { ptr = gUnk_081229F0 + super->type2; super->x.HALF.HI = ptr->x + super->x.HALF.HI; super->y.HALF.HI = ptr->y + super->y.HALF.HI; - super->actionDelay = ptr->actionDelay; - super->field_0xf = ptr->unk3; + super->timer = ptr->timer; + super->subtimer = ptr->unk3; this->unk7c = 0xce; this->unk74 = 0; if ((ptr->unk4 & 0x40) != 0) { @@ -144,7 +144,7 @@ void sub_08094148(Object67Entity* this) { super->hitbox->height = gUnk_080FD2E8.height; COLLISION_ON(super); super->collisionLayer = 2; - super->field_0x3c = 7; + super->collisionFlags = 7; super->hurtType = 0x48; super->hitType = 0x7a; super->flags2 = 1; @@ -220,8 +220,8 @@ void sub_08094424(Object67Entity* this) { super->action = 3; this->unk7c = 0x78; } else { - sub_0806FCF4(super, this->unk80.HALF.HI, 0x20, super->actionDelay); - sub_0806FCF4(super, this->unk84.HALF.HI, 0x20, super->field_0xf); + sub_0806FCF4(super, this->unk80.HALF.HI, 0x20, super->timer); + sub_0806FCF4(super, this->unk84.HALF.HI, 0x20, super->subtimer); SetAffineInfo(super, this->unk80.HALF_U.HI, this->unk84.HALF_U.HI, 0); } @@ -271,8 +271,8 @@ void sub_08094570(Object67Entity* this) { this->unk84.HALF.HI = this->unk84.HALF.HI + 1; uVar3 = this->unk84.HALF_U.HI; } - sub_0806FCF4(super, this->unk80.HALF.HI, 0x20, super->actionDelay); - sub_0806FCF4(super, this->unk84.HALF.HI, 0x20, super->field_0xf); + sub_0806FCF4(super, this->unk80.HALF.HI, 0x20, super->timer); + sub_0806FCF4(super, this->unk84.HALF.HI, 0x20, super->subtimer); SetAffineInfo(super, this->unk80.HALF_U.HI, this->unk84.HALF_U.HI, 0); } diff --git a/src/object/object68.c b/src/object/object68.c index d26bb550..f08b1659 100644 --- a/src/object/object68.c +++ b/src/object/object68.c @@ -58,7 +58,7 @@ void sub_08094774(Object68Entity* this) { } if (super->type2 == 0) { CopyPosition(super->child, super); - super->actionDelay = 0; + super->timer = 0; super->spritePriority.b0 = 0; super->spriteRendering.b3 = 0; sub_08094980(this, 0x403b, 0x403c); @@ -70,7 +70,7 @@ void sub_08094774(Object68Entity* this) { child = CreateGroundItem(&gPlayerEntity, ITEM_FAIRY, 0); super->child = child; if (child != NULL) { - child->actionDelay = 1; + child->timer = 1; } break; case 3 ... 8: @@ -88,9 +88,9 @@ void sub_080948D0(Object68Entity* this) { } void sub_080948E8(Object68Entity* this) { - if (super->actionDelay < 0x3c) { + if (super->timer < 0x3c) { super->z.WORD -= 0x4000; - if ((super->actionDelay & 3) == 0) { + if ((super->timer & 3) == 0) { super->child = CreateFx(super, FX_DASH, 0x40); if (super->child != NULL) { super->child->spriteRendering.b3 = super->spriteRendering.b3; @@ -102,7 +102,7 @@ void sub_080948E8(Object68Entity* this) { } } } - super->actionDelay++; + super->timer++; } else { DeleteThisEntity(); } diff --git a/src/object/object6A.c b/src/object/object6A.c index 79670b5a..83e29ec0 100644 --- a/src/object/object6A.c +++ b/src/object/object6A.c @@ -358,7 +358,7 @@ void sub_08094E30(Object6AEntity* this) { } } else if (super->action == 0) { super->action++; - switch (super->actionDelay) { + switch (super->timer) { case 1: InitializeAnimation(super, 2); break; @@ -414,7 +414,7 @@ void sub_08094FA8(Object6AEntity* this) { if (!CheckGlobalFlag(BIN_DOGFOOD)) { CreateItemEntity(0x1c, 0, 0); SetGlobalFlag(BIN_DOGFOOD); - super->actionDelay = 60; + super->timer = 60; } #else CreateItemEntity(0x1c, 0, 0); @@ -423,7 +423,7 @@ void sub_08094FA8(Object6AEntity* this) { break; #ifndef EU case 4: - if (!--super->actionDelay) { + if (!--super->timer) { super->action = 5; SetPlayerControl(1); } @@ -502,7 +502,7 @@ void sub_080951C4(Object6AEntity* this) { if (super->action == 0) { super->action++; super->z.HALF.HI = -16; - super->actionDelay = 0; + super->timer = 0; sub_0807DD64(super); InitializeAnimation(super, 3); } @@ -512,8 +512,8 @@ void sub_080951C4(Object6AEntity* this) { if (super->z.HALF.HI == 0) { super->z.WORD = 0; super->parent = NULL; - if (super->actionDelay == 0) { - super->actionDelay++; + if (super->timer == 0) { + super->timer++; SoundReq(230); } } @@ -550,8 +550,8 @@ void sub_08095288(Object6AEntity* this) { super->subAction = 0; SetAffineInfo(super, 0x100, 0x100, 0xC000); } else { - SetAffineInfo(super, 0x100, 0x100, super->actionDelay << 8); - super->actionDelay += 10; + SetAffineInfo(super, 0x100, 0x100, super->timer << 8); + super->timer += 10; LinearMoveUpdate(super); } } @@ -653,8 +653,8 @@ void sub_080954AC(Object6AEntity* this, u32 arg2) { void sub_080954DC(Object6AEntity* this) { switch (super->action) { case 0: - if (super->actionDelay != 0) { - super->actionDelay--; + if (super->timer != 0) { + super->timer--; } else { super->action++; super->subAction = 0; @@ -810,7 +810,7 @@ void sub_0809584C(Object6AEntity* this) { idx = super->health; if ((idx & 0x7F) != 0 && !ReadBit((u32*)gArea.filler5, idx - 1)) DeleteThisEntity(); - if (super->actionDelay != 0 && CheckKinstoneFused(super->type2)) + if (super->timer != 0 && CheckKinstoneFused(super->type2)) DeleteThisEntity(); if (super->action == 0) { super->action++; @@ -916,20 +916,20 @@ void sub_08095A8C(Object6AEntity* this) { break; case 2: super->action++; - super->actionDelay = 120; + super->timer = 120; case 3: super->spriteSettings.draw ^= 1; - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = 1; super->spriteSettings.draw = 1; } break; case 4: super->action++; - super->actionDelay = 120; + super->timer = 120; case 5: super->spriteSettings.draw ^= 1; - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = 1; super->spriteSettings.draw = 0; } @@ -1006,11 +1006,11 @@ void sub_08095C68(Object6AEntity* this) { super->action++; sub_080042D0(super, super->frameIndex, (u16)super->spriteIndex); } - if (super->actionDelay != 0) { - if (--super->actionDelay < 8) { + if (super->timer != 0) { + if (--super->timer < 8) { super->spriteSettings.draw ^= 1; } - if (super->actionDelay != 0) { + if (super->timer != 0) { return; } } @@ -1023,7 +1023,7 @@ void sub_08095CB0(Object6AEntity* this) { super->child = e; e->parent = super; CopyPosition(super, e); - e->actionDelay = 16; + e->timer = 16; e->frameIndex = super->frameIndex; e->lastFrameIndex = super->frameIndex; } @@ -1153,12 +1153,12 @@ void sub_08095F38(Object6AEntity* this) { ChangeObjPalette(super, pal); if ((gPlayerEntity.frame & 1) == 0) { local->anim = 0x8BF; - super->actionDelay = 52; - super->field_0xf = -75; + super->timer = 52; + super->subtimer = -75; } else { local->anim = 0x8E3; - super->actionDelay = 85; - super->field_0xf = -42; + super->timer = 85; + super->subtimer = -42; } CopyPosition(&gPlayerEntity, super); super->spritePriority.b0 = 3; @@ -1169,7 +1169,7 @@ void sub_08095F38(Object6AEntity* this) { } if ((u16)gPlayerEntity.spriteIndex != local->anim >> 8 || gPlayerEntity.animIndex != (u8)local->anim) DeleteThisEntity(); - tmp = gPlayerEntity.frameIndex - super->actionDelay + super->field_0xf; + tmp = gPlayerEntity.frameIndex - super->timer + super->subtimer; if (tmp != super->frameIndex) { super->frameIndex = tmp; sub_080042D0(super, super->frameIndex, (u16)super->spriteIndex); diff --git a/src/object/object74.c b/src/object/object74.c index 459880bc..828ad006 100644 --- a/src/object/object74.c +++ b/src/object/object74.c @@ -70,9 +70,9 @@ void sub_08097C20(Object74Entity* this) { SetPriorityTimer(0x1e); sub_0800445C(super); CreateMagicSparkles(super->x.HALF.HI, super->y.HALF.HI, super->collisionLayer); - if (--super->actionDelay == 0) { - super->actionDelay = 8; - tmp = ++super->field_0xf; + if (--super->timer == 0) { + super->timer = 8; + tmp = ++super->subtimer; gScreen.controls.alphaBlend = (((0x10 - tmp) * 0x100)) | tmp; if (gScreen.controls.alphaBlend == 0x10) { SetPlayerControl(CONTROL_ENABLED); @@ -95,8 +95,8 @@ void sub_08097CB4(Object74Entity* this) { super->action = 3; super->spriteSettings.draw = 1; super->spriteRendering.alphaBlend = 1; - super->actionDelay = 0x1e; - super->field_0xf = 0; + super->timer = 0x1e; + super->subtimer = 0; gScreen.controls.layerFXControl = 0xf40; gScreen.controls.alphaBlend = 0x1000; SoundReq(SFX_14A); diff --git a/src/object/object79.c b/src/object/object79.c index b90046a1..fdcf8824 100644 --- a/src/object/object79.c +++ b/src/object/object79.c @@ -42,8 +42,8 @@ void Object79_Init(Object79Entity* this) { super->speed = 0; this->unk6c = 0; this->unk7a = 0x1200; - super->actionDelay = 0; - super->field_0xf = 30; + super->timer = 0; + super->subtimer = 30; this->objDir.HALF.HI = Object79_Directions[super->type]; this->unk74 = 0x2000; SetDefaultPriority(super, 6); @@ -64,7 +64,7 @@ void Object79_Action1(Object79Entity* this) { if (super->type == 0) { UpdateAnimationSingleFrame(super); if (super->type2 != 0) { - gPlayerEntity.field_0xf = 0; + gPlayerEntity.subtimer = 0; super->action++; InitAnimationForceUpdate(super, 1); SoundReq(SFX_178); @@ -95,9 +95,9 @@ void Object79_Action2(Object79Entity* this) { this->objDir.WORD += this->unk74; this->objDir.HALF.HI = DirectionNormalize(this->objDir.HALF.HI); this->unk74 += 0x140; - if (super->field_0xf-- == 0) { - super->field_0xf = 30; - super->actionDelay ^= 1; + if (super->subtimer-- == 0) { + super->subtimer = 30; + super->timer ^= 1; } sub_08098130(this); } diff --git a/src/object/object81.c b/src/object/object81.c index ea5b8072..975fbd2b 100644 --- a/src/object/object81.c +++ b/src/object/object81.c @@ -24,7 +24,7 @@ void Object81(Entity* this) { void Object81_Init(Object81Entity* this) { super->action = 1; - super->actionDelay = 0; + super->timer = 0; this->tilePos = COORD_TO_TILE(super); if (gPlayerState.flags & PL_MINISH) { super->collisionLayer = 2; diff --git a/src/object/object86.c b/src/object/object86.c index bdaa2811..72f880e4 100644 --- a/src/object/object86.c +++ b/src/object/object86.c @@ -42,8 +42,8 @@ void sub_08099E58(Entity* this) { GetNextFrame(this); if (this->frame & ANIM_DONE) { this->frame &= ~0x80; - this->actionDelay++; - if (this->actionDelay == 3) { + this->timer++; + if (this->timer == 3) { this->action = 3; this->frameIndex = 4; } diff --git a/src/object/object8E.c b/src/object/object8E.c index 2c0ce508..5a4956c3 100644 --- a/src/object/object8E.c +++ b/src/object/object8E.c @@ -40,8 +40,8 @@ void Object8E_Type0(Object8EEntity* this) { switch (super->action) { case 0: super->action = 1; - super->actionDelay = 0x3c; - super->field_0xf = 0; + super->timer = 0x3c; + super->subtimer = 0; gRoomControls.camera_target = super; gRoomControls.unk5 = 1; if (super->x.HALF.HI > gPlayerEntity.x.HALF.HI) { @@ -55,19 +55,19 @@ void Object8E_Type0(Object8EEntity* this) { gScreen.controls.window0VerticalDimensions = 0xa0; break; case 1: - if (super->actionDelay != 0) { - super->actionDelay--; + if (super->timer != 0) { + super->timer--; } else { - if (super->field_0xf < 0x20) { + if (super->subtimer < 0x20) { if ((gRoomTransition.frameCount & 0x1fU) == 0) { SoundReq(SFX_133); } if ((gRoomTransition.frameCount & 3U) == 0) { - sub_0809B97C(this, ++super->field_0xf); + sub_0809B97C(this, ++super->subtimer); } } else { super->action = 2; - super->actionDelay = 0x3c; + super->timer = 0x3c; gScreen.lcd.displayControl &= 0xdfff; gRoomControls.camera_target = &gPlayerEntity; SoundReq(SFX_134); @@ -75,7 +75,7 @@ void Object8E_Type0(Object8EEntity* this) { } break; case 2: - if (--super->actionDelay == 0) { + if (--super->timer == 0) { gScreen.lcd.displayControl |= 0x4800; gRoomControls.unk5 = 4; (super->parent)->subAction = 1; @@ -114,8 +114,8 @@ void Object8E_Type1(Object8EEntity* this) { switch (super->action) { case 0: super->action = 1; - super->actionDelay = 0x3c; - super->field_0xf = 0x20; + super->timer = 0x3c; + super->subtimer = 0x20; gRoomControls.camera_target = super; gRoomControls.unk5 = 1; if (super->x.HALF.HI > gPlayerEntity.x.HALF.HI) { @@ -129,26 +129,26 @@ void Object8E_Type1(Object8EEntity* this) { gScreen.controls.window0VerticalDimensions = 0xa0; break; case 1: - if (super->actionDelay != 0) { - super->actionDelay--; + if (super->timer != 0) { + super->timer--; } else { - if (super->field_0xf != 0) { + if (super->subtimer != 0) { if ((gRoomTransition.frameCount & 0x1fU) == 0) { SoundReq(SFX_133); } if ((gRoomTransition.frameCount & 3U) == 0) { - sub_0809B97C(this, --super->field_0xf); + sub_0809B97C(this, --super->subtimer); } } else { super->action = 2; - super->actionDelay = 0x3c; + super->timer = 0x3c; gRoomControls.camera_target = &gPlayerEntity; SoundReq(SFX_134); } } break; case 2: - if (--super->actionDelay == 0) { + if (--super->timer == 0) { gRoomControls.unk5 = 4; gScreen.lcd.displayControl &= 0xd7ff; (super->parent)->subAction = 1; @@ -165,8 +165,8 @@ void Object8E_Type2(Object8EEntity* this) { switch (super->action) { case 0: super->action++; - super->actionDelay = 0x3c; - super->field_0xf = 0; + super->timer = 0x3c; + super->subtimer = 0; gRoomControls.camera_target = super; gRoomControls.unk5 = 1; if (super->x.HALF.HI > gPlayerEntity.x.HALF.HI) { @@ -180,8 +180,8 @@ void Object8E_Type2(Object8EEntity* this) { break; case 1: if (sub_0809BE78(this)) { - if (super->actionDelay != 0) { - if (--super->actionDelay == 0) { + if (super->timer != 0) { + if (--super->timer == 0) { gScreen.lcd.displayControl = (gScreen.lcd.displayControl & 0xbfff) | 0x2800; } } else { @@ -194,7 +194,7 @@ void Object8E_Type2(Object8EEntity* this) { } } else { super->action = 2; - super->actionDelay = 0x1e; + super->timer = 0x1e; gScreen.lcd.displayControl = (gScreen.lcd.displayControl & 0xdfff) | 0x4800; super->x.HALF.HI += 0x68; super->y.HALF.HI += 0x28; @@ -204,15 +204,15 @@ void Object8E_Type2(Object8EEntity* this) { } break; case 2: - if (sub_0809BE78(this) && (--super->actionDelay == 0)) { - super->actionDelay = 0x78; + if (sub_0809BE78(this) && (--super->timer == 0)) { + super->timer = 0x78; super->action = 3; SetLocalFlag(0x35); SoundReq(SFX_SECRET); } break; case 3: - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = 4; gRoomControls.camera_target = &gPlayerEntity; gRoomControls.unk5 = 2; @@ -235,8 +235,8 @@ void Object8E_Type3(Object8EEntity* this) { switch (super->action) { case 0: super->action = 1; - super->actionDelay = 0x3c; - super->field_0xf = 0; + super->timer = 0x3c; + super->subtimer = 0; gRoomControls.camera_target = super; gRoomControls.unk5 = 1; if (super->x.HALF.HI > gPlayerEntity.x.HALF.HI) { @@ -251,8 +251,8 @@ void Object8E_Type3(Object8EEntity* this) { break; case 1: if (sub_0809BE78(this)) { - if (super->actionDelay != 0) { - if (--super->actionDelay == 0) { + if (super->timer != 0) { + if (--super->timer == 0) { SetFade(6, 8); sub_0805AAF0(3); gScreen.lcd.displayControl = (gScreen.lcd.displayControl & 0xbfff) | 0x2800; @@ -268,7 +268,7 @@ void Object8E_Type3(Object8EEntity* this) { } } else { super->action = 2; - super->actionDelay = 0x78; + super->timer = 0x78; gScreen.lcd.displayControl = (gScreen.lcd.displayControl & 0xdfff) | 0x4800; SetLocalFlag(0x37); SoundReq(SFX_134); @@ -277,7 +277,7 @@ void Object8E_Type3(Object8EEntity* this) { } break; case 2: - if (--super->actionDelay == 0) { + if (--super->timer == 0) { (super->parent)->subAction = 1; DeleteThisEntity(); } @@ -291,8 +291,8 @@ void Object8E_Type4(Object8EEntity* this) { switch (super->action) { case 0: super->action = 1; - super->actionDelay = 0x3c; - super->field_0xf = 0x80; + super->timer = 0x3c; + super->subtimer = 0x80; gRoomControls.camera_target = super; gRoomControls.unk5 = 1; if (super->x.HALF.HI > gPlayerEntity.x.HALF.HI) { @@ -303,23 +303,23 @@ void Object8E_Type4(Object8EEntity* this) { gPlayerEntity.animationState = tmp; break; case 1: - if (super->actionDelay != 0) { - super->actionDelay--; + if (super->timer != 0) { + super->timer--; } else { - if (--super->field_0xf != 0) { + if (--super->subtimer != 0) { if ((gRoomTransition.frameCount & 0x1fU) == 0) { SoundReq(SFX_133); } } else { super->action = 2; - super->actionDelay = 0x3c; + super->timer = 0x3c; gRoomControls.camera_target = &gPlayerEntity; SoundReq(SFX_134); } } break; case 2: - if (--super->actionDelay == 0) { + if (--super->timer == 0) { gRoomControls.unk5 = 4; (super->parent)->subAction = 1; DeleteThisEntity(); diff --git a/src/object/object9.c b/src/object/object9.c index a3286f79..b73f2b8c 100644 --- a/src/object/object9.c +++ b/src/object/object9.c @@ -71,7 +71,7 @@ void sub_080838DC(Entity* this) { this->spriteOrientation.flipY = 1; this->spriteRendering.b3 = 0; this->spritePriority.b0 = 0; - this->actionDelay = 4; + this->timer = 4; this->child = NULL; this->action = 0; } @@ -93,8 +93,8 @@ void Object9_Init(Entity* this) { } void Object9_Action1(Entity* this) { - if (this->actionDelay) { - this->actionDelay--; + if (this->timer) { + this->timer--; } else { if ((*(Entity**)(gUnk_03003DF0.unk_4 + 8) != NULL) && ((u8)(gUnk_03003DF0.unk_4[3] - 1) < 100)) { this->child = *(Entity**)(gUnk_03003DF0.unk_4 + 8); diff --git a/src/object/object96.c b/src/object/object96.c index 2ffac509..fde07cb0 100644 --- a/src/object/object96.c +++ b/src/object/object96.c @@ -24,7 +24,7 @@ typedef struct _struct_gUnk_08123FB0 { s16 speed; s16 y; u16 flag; - u8 actionDelay; + u8 timer; u8 unk1f; } struct_gUnk_08123FB0; @@ -77,7 +77,7 @@ void Object96_Init(Entity* this, const struct_gUnk_08123FB0* param_2) { this->speed = param_2->speed; this->y.HALF.HI -= param_2->y; this->z.WORD = 0; - this->actionDelay = param_2->actionDelay; + this->timer = param_2->timer; if ((this->direction & 0x80)) { dir = this->direction; if (dir == 0x81) { @@ -114,8 +114,8 @@ void Object96_Action2(Entity* this, const struct_gUnk_08123FB0* param_2) { LinearMoveUpdate(this); if (sub_080044EC(this, param_2->unk14) < 2) { - if (this->actionDelay) { - this->actionDelay--; + if (this->timer) { + this->timer--; this->zVelocity = param_2->unk14 << 3; } else { this->action++; diff --git a/src/object/object98.c b/src/object/object98.c index 798836dc..d39d7ea2 100644 --- a/src/object/object98.c +++ b/src/object/object98.c @@ -30,14 +30,14 @@ void sub_0809E360(Object98Entity* this) { Entity* projEnt; u32 index; - if (8 < super->actionDelay) { - super->actionDelay = 8; + if (8 < super->timer) { + super->timer = 8; } - if (0x48 - super->actionDelay > gEntCount) { - for (index = 0; index < super->actionDelay; index++) { + if (0x48 - super->timer > gEntCount) { + for (index = 0; index < super->timer; index++) { projEnt = CreateProjectile(GURUGURU_BAR_PROJECTILE); - projEnt->actionDelay = 14 + 12 * index; + projEnt->timer = 14 + 12 * index; projEnt->parent = super; } diff --git a/src/object/objectA2.c b/src/object/objectA2.c index 8091c484..68a79fe4 100644 --- a/src/object/objectA2.c +++ b/src/object/objectA2.c @@ -51,20 +51,20 @@ void sub_0809F374(Entity* this) { InitializeAnimation(this, 1); SoundReq(SFX_186); } else { - this->actionDelay++; + this->timer++; } } else { #endif switch (sub_080044EC(this, 0x2000)) { default: - this->actionDelay++; + this->timer++; break; case 0: this->action = 2; InitializeAnimation(this, 1); // fall through case 1: - this->actionDelay = 0; + this->timer = 0; sub_0809F448(this); SoundReq(SFX_186); } @@ -96,8 +96,8 @@ void sub_0809F408(Entity* this) { void sub_0809F448(Entity* this) { s32 tmp; int rand = Random(); - const struct_08124708* tmp2 = &gUnk_08124708[this->field_0xf]; - this->field_0xf++; + const struct_08124708* tmp2 = &gUnk_08124708[this->subtimer]; + this->subtimer++; tmp = 0x280000 - this->x.WORD; switch (tmp2->unk_0) { case 0: diff --git a/src/object/objectA6.c b/src/object/objectA6.c index fc77a54e..bea33868 100644 --- a/src/object/objectA6.c +++ b/src/object/objectA6.c @@ -29,7 +29,7 @@ void sub_0809F920(ObjectA6Entity* this) { super->action = 1; COLLISION_ON(super); - super->field_0x3c = 7; + super->collisionFlags = 7; super->hurtType = 0x48; super->hitType = 1; super->flags2 = 2; @@ -39,7 +39,7 @@ void sub_0809F920(ObjectA6Entity* this) { void sub_0809F964(ObjectA6Entity* this) { Entity* fxEnt; - if (super->bitfield == 0xa1) { + if (super->contactFlags == 0xa1) { fxEnt = CreateFx(super, FX_MAGIC_STORM, 0); if (fxEnt != NULL) { fxEnt->spritePriority.b0 = 3; diff --git a/src/object/objectA8.c b/src/object/objectA8.c index 008a8d10..4f2c0c13 100644 --- a/src/object/objectA8.c +++ b/src/object/objectA8.c @@ -39,8 +39,8 @@ void ObjectA8(ObjectA8Entity* this) { ObjectA8_Init, ObjectA8_Action1, ObjectA8_Action2, ObjectA8_Action3, ObjectA8_Action4, ObjectA8_Action5, ObjectA8_Action6, }; - if ((super->bitfield & 0x80) != 0) { - switch (super->bitfield & 0x7f) { + if ((super->contactFlags & 0x80) != 0) { + switch (super->contactFlags & 0x7f) { case 0: case 1: case 4: @@ -74,12 +74,12 @@ void ObjectA8_Init(ObjectA8Entity* this) { return; } super->collisionLayer = 3; - super->field_0x3c = 0x17; + super->collisionFlags = 0x17; super->hurtType = 0x48; super->hitType = 7; super->flags2 = 0x17; super->hitbox = (Hitbox*)&gUnk_080FD1A8; - super->field_0x1c = 1; + super->gustJarFlags = 1; this->unk_74 = super->x.HALF.HI; this->unk_76 = super->y.HALF.HI; SetDefaultPriority(super, 3); @@ -89,13 +89,13 @@ void ObjectA8_Init(ObjectA8Entity* this) { void ObjectA8_Action1(ObjectA8Entity* this) { super->z.WORD -= 0xe000; if (super->frame != 0) { - if (super->actionDelay != 0) { - super->actionDelay *= 0x1e; + if (super->timer != 0) { + super->timer *= 0x1e; } else { - super->actionDelay = 0xf0; + super->timer = 0xf0; } super->action = 3; - super->field_0xf = 1; + super->subtimer = 1; super->speed = 0x80; } } @@ -111,12 +111,12 @@ void ObjectA8_Action2(ObjectA8Entity* this) { void ObjectA8_Action2Subaction0(ObjectA8Entity* this) { super->subAction = 1; - super->field_0x1d = 1; + super->gustJarTolerance = 1; super->spriteSettings.draw = 1; } void ObjectA8_Action2Subaction1(ObjectA8Entity* this) { - if ((gPlayerState.field_0x1c & 0xf) != 1 || (super->bitfield & 0x7f) != 0x13) { + if ((gPlayerState.field_0x1c & 0xf) != 1 || (super->contactFlags & 0x7f) != 0x13) { super->action = 3; } else { sub_0806F4E8(super); @@ -124,7 +124,7 @@ void ObjectA8_Action2Subaction1(ObjectA8Entity* this) { } void ObjectA8_Action2Subaction2(ObjectA8Entity* this) { - if ((gPlayerState.field_0x1c & 0xf) != 1 || (super->bitfield & 0x7f) != 0x13) { + if ((gPlayerState.field_0x1c & 0xf) != 1 || (super->contactFlags & 0x7f) != 0x13) { super->action = 3; } else { if (sub_0806F3E4(super)) { @@ -143,10 +143,10 @@ void ObjectA8_Action3(ObjectA8Entity* this) { 0, 0, }; - if (--super->field_0xf == 0) { + if (--super->subtimer == 0) { u32 rand = Random(); super->flags |= ENT_COLLIDE; - super->field_0xf = 0x20; + super->subtimer = 0x20; super->speed = gUnk_0812484C[rand >> 8 & 1]; if (sub_0809FE9C(this)) { super->direction = rand & 0x1f; @@ -159,10 +159,10 @@ void ObjectA8_Action3(ObjectA8Entity* this) { } ProcessMovement1(super); if ((AnyPrioritySet() == 0) && (super->type == 0)) { - if (((gRoomTransition.frameCount & 1) != 0) && (--super->actionDelay == 0)) { + if (((gRoomTransition.frameCount & 1) != 0) && (--super->timer == 0)) { sub_08081404(super, 0); } - if (super->actionDelay < 0x3c) { + if (super->timer < 0x3c) { super->spriteSettings.draw ^= 1; } } @@ -183,8 +183,8 @@ void ObjectA8_Action4(ObjectA8Entity* this) { void ObjectA8_Action5(ObjectA8Entity* this) { super->action = 6; - super->actionDelay = 0x80; - super->field_0xf = 6; + super->timer = 0x80; + super->subtimer = 6; super->flags &= ~ENT_COLLIDE; super->spriteSettings.draw = 1; super->spritePriority.b1 = 2; @@ -195,27 +195,27 @@ void ObjectA8_Action5(ObjectA8Entity* this) { void ObjectA8_Action6(ObjectA8Entity* this) { s32 tmp; Entity* child = super->child; - tmp = gSineTable[super->actionDelay] * 0xa00; + tmp = gSineTable[super->timer] * 0xa00; if (tmp < 0) { tmp += 0xffff; } super->x.HALF.HI = (s16)(tmp >> 0x10) + child->x.HALF.HI; - tmp = gSineTable[super->actionDelay + 0x40] * 0x500; + tmp = gSineTable[super->timer + 0x40] * 0x500; if (tmp < 0) { tmp += 0xffff; } super->y.HALF.HI = super->child->y.HALF.HI - (tmp >> 0x10); - super->actionDelay += 8; + super->timer += 8; super->z.HALF.HI = super->child->z.HALF.HI; super->spriteOrientation.flipY = super->child->spriteOrientation.flipY; super->spriteRendering.b3 = super->child->spriteRendering.b3; - if ((u8)(super->actionDelay - 0x41) < 0x7f) { + if ((u8)(super->timer - 0x41) < 0x7f) { super->spritePriority.b0 = 3; } else { super->spritePriority.b0 = 5; } - if (--super->field_0xf == 0) { - super->field_0xf = 6; + if (--super->subtimer == 0) { + super->subtimer = 6; if (((--super->spriteOffsetY) * 0x1000000) >> 0x18 < -0x16) { sub_08081404(super, 1); } diff --git a/src/object/objectA9.c b/src/object/objectA9.c index 6d9981ba..825aac96 100644 --- a/src/object/objectA9.c +++ b/src/object/objectA9.c @@ -30,8 +30,8 @@ void sub_0809FF28(Entity* this) { if (this->frame & 0x80) { this->action = 2; pEVar1 = this->parent; - pEVar1->flags = this->actionDelay; - pEVar1->spriteSettings.draw = this->field_0xf; + pEVar1->flags = this->timer; + pEVar1->spriteSettings.draw = this->subtimer; ((GenericEntity*)pEVar1)->field_0x6c.HALF.HI &= 0xef; } } diff --git a/src/object/objectAD.c b/src/object/objectAD.c index ca73277e..f128cb2f 100644 --- a/src/object/objectAD.c +++ b/src/object/objectAD.c @@ -19,7 +19,7 @@ void ObjectAD(Entity* this) { void sub_080A04A4(Entity* this) { this->action = 1; this->frameIndex = 4; - this->actionDelay = 0; + this->timer = 0; this->spriteRendering.b3 = 3; this->spritePriority.b0 = 7; this->z.WORD = 0; diff --git a/src/object/objectB.c b/src/object/objectB.c index efdf0c09..a970a016 100644 --- a/src/object/objectB.c +++ b/src/object/objectB.c @@ -58,7 +58,7 @@ void ObjectB_Action1(ObjectBEntity* this) { return; } super->action = 2; - switch (super->actionDelay) { + switch (super->timer) { case 0: case 1: this->unk_68 = GiveItem(super->type, super->type2); @@ -98,7 +98,7 @@ void ObjectB_Action2(ObjectBEntity* this) { u32 messageIndex; if ((super->parent)->frame == 0x42) { super->action = 3; - switch (super->actionDelay) { + switch (super->timer) { case 1: case 3: case 4: @@ -135,7 +135,7 @@ void ObjectB_Action3(ObjectBEntity* this) { if ((super->parent)->action == 8) { return; } - switch (super->actionDelay) { + switch (super->timer) { case 0: case 1: case 2: diff --git a/src/object/objectB2.c b/src/object/objectB2.c index bd2c58b5..a791b9fb 100644 --- a/src/object/objectB2.c +++ b/src/object/objectB2.c @@ -10,7 +10,7 @@ void ObjectB2(Entity* this) { if (this->action == 0) { this->action = 1; - this->actionDelay = 0x10; + this->timer = 0x10; this->direction = this->type << 3; if (this->collisionLayer == 2) { layer = gUnk_0200D654; @@ -28,7 +28,7 @@ void ObjectB2(Entity* this) { if (this->speed < 0x41) { this->spriteSettings.draw ^= 1; - if (--this->actionDelay == 0) { + if (--this->timer == 0) { DeleteThisEntity(); } } diff --git a/src/object/objectB4.c b/src/object/objectB4.c index 2aeaa0f7..4e3cd462 100644 --- a/src/object/objectB4.c +++ b/src/object/objectB4.c @@ -33,23 +33,23 @@ void ObjectB4_Type0(Entity* this) { this->action = 1; this->spriteSettings.draw = 2; this->frameIndex = 9; - this->actionDelay = 8; - this->field_0xf = 0; + this->timer = 8; + this->subtimer = 0; this->spriteRendering.b3 = 1; this->spritePriority.b0 = 4; this->spriteOrientation.flipY = 1; sub_0806FB00(this, 0xbf, 0x48, 0x1e); break; case 1: - if ((this->field_0xf < 7) && (--this->actionDelay == 0)) { - this->actionDelay = 1; - pEVar3 = CreateObject(OBJECT_B4, 1, this->field_0xf); + if ((this->subtimer < 7) && (--this->timer == 0)) { + this->timer = 1; + pEVar3 = CreateObject(OBJECT_B4, 1, this->subtimer); if (pEVar3 != NULL) { CopyPosition(this, pEVar3); pEVar3->y.HALF.HI = 0x68; SortEntityBelow(this, pEVar3); } - this->field_0xf++; + this->subtimer++; } if (sub_0806FB38(this) || (1 < gMenu.menuType)) { @@ -57,14 +57,14 @@ void ObjectB4_Type0(Entity* this) { this->y.HALF.HI = 0x48; this->frameIndex = 10; this->action = 2; - while (this->field_0xf < 7) { - pEVar3 = CreateObject(OBJECT_B4, 1, this->field_0xf); + while (this->subtimer < 7) { + pEVar3 = CreateObject(OBJECT_B4, 1, this->subtimer); if (pEVar3 != NULL) { CopyPosition(this, pEVar3); pEVar3->y.HALF.HI = 0x68; SortEntityBelow(this, pEVar3); } - this->field_0xf++; + this->subtimer++; } pEVar3 = CreateObject(OBJECT_B4, 2, 0); @@ -112,16 +112,16 @@ void ObjectB4_Type2(Entity* this) { this->spritePriority.b0 = 0; this->spriteOrientation.flipY = 1; this->frameIndex = 11; - this->actionDelay = (Random() & 0x3f) + 0x40; - this->field_0xf = 0; + this->timer = (Random() & 0x3f) + 0x40; + this->subtimer = 0; } - if (--this->actionDelay == 0) { - this->actionDelay = 4; - this->frameIndex = gUnk_08124B30[this->field_0xf++] + 2; - if (gUnk_08124B30[this->field_0xf] == 0xff) { - this->actionDelay = (Random() & 0x3f) + 0x40; - this->field_0xf = 0; + if (--this->timer == 0) { + this->timer = 4; + this->frameIndex = gUnk_08124B30[this->subtimer++] + 2; + if (gUnk_08124B30[this->subtimer] == 0xff) { + this->timer = (Random() & 0x3f) + 0x40; + this->subtimer = 0; } } } diff --git a/src/object/objectBD.c b/src/object/objectBD.c index 6e12c57c..714eac33 100644 --- a/src/object/objectBD.c +++ b/src/object/objectBD.c @@ -68,8 +68,8 @@ NONMATCH("asm/non_matching/objectBD/sub_080A22C4.inc", void sub_080A22C4(Entity* switch (this->action) { case 0: sub_080A2340(this); - this->actionDelay = 8; - this->field_0xf = 0; + this->timer = 8; + this->subtimer = 0; this->subAction = this->frameIndex; this->speed = (Random() & 3) * 0x10 + 0x1e; break; @@ -81,11 +81,11 @@ NONMATCH("asm/non_matching/objectBD/sub_080A22C4.inc", void sub_080A22C4(Entity* this->action = 2; break; default: - if (--this->actionDelay != 0) { + if (--this->timer != 0) { return; } - this->actionDelay = 8; - this->field_0xf = tmp2 = (this->field_0xf + 1) & 3; + this->timer = 8; + this->subtimer = tmp2 = (this->subtimer + 1) & 3; tmp3 = this->subAction; tmp1 = tmp3 + tmp2; this->frameIndex = tmp1; diff --git a/src/object/objectBlockingStairs.c b/src/object/objectBlockingStairs.c index aa2108e0..b1274661 100644 --- a/src/object/objectBlockingStairs.c +++ b/src/object/objectBlockingStairs.c @@ -59,9 +59,9 @@ void ObjectBlockingStairs_Init(ObjectBlockingStairsEntity* this) { default: super->action = 1; super->speed = 0x80; - super->field_0x16 = 1; - super->actionDelay = 0; - super->field_0xf = 0; + super->carryFlags = 1; + super->timer = 0; + super->subtimer = 0; this->unk7a = 0x20; this->unk7b = 0x80; if (super->type == 0) { @@ -114,7 +114,7 @@ void ObjectBlockingStairs_Action1(ObjectBlockingStairsEntity* this) { super->action = 3; super->direction = Direction8FromAnimationState(gPlayerEntity.animationState); super->speed = 0x80; - super->actionDelay = 0x40; + super->timer = 0x40; RequestPriorityDuration(super, 0x50); EnqueueSFX(SFX_10F); sub_08093248(this); @@ -151,24 +151,24 @@ void ObjectBlockingStairs_Action1(ObjectBlockingStairsEntity* this) { } void ObjectBlockingStairs_Action2(ObjectBlockingStairsEntity* this) { - if (super->actionDelay) { + if (super->timer) { sub_08093280(this); } else { if (gPlayerState.heldObject == 0x12) { - if ((gPlayerEntity.frame & 2) != 0 && ++super->field_0xf > 8) { + if ((gPlayerEntity.frame & 2) != 0 && ++super->subtimer > 8) { gPlayerState.queued_action = 16; gPlayerState.field_0x38 = 0x40; gPlayerState.flags |= PL_BUSY; gPlayerEntity.x.HALF.LO = 0; gPlayerEntity.y.HALF.LO = 0; super->direction = (gPlayerEntity.animationState ^ 4) << 2; - super->actionDelay = 0x40; + super->timer = 0x40; EnqueueSFX(SFX_10F); sub_08093248(this); } } else if (super->subAction == 6) { super->action = 1; - super->field_0xf = 0; + super->subtimer = 0; } } } @@ -176,7 +176,7 @@ void ObjectBlockingStairs_Action2(ObjectBlockingStairsEntity* this) { void ObjectBlockingStairs_Action3(ObjectBlockingStairsEntity* this) { sub_0800445C(super); LinearMoveUpdate(super); - if (--super->actionDelay == 0) { + if (--super->timer == 0) { sub_08093334(this); } sub_08093364(this); @@ -255,7 +255,7 @@ void sub_08093248(ObjectBlockingStairsEntity* this) { void sub_08093280(ObjectBlockingStairsEntity* this) { sub_0800445C(super); LinearMoveUpdate(super); - if (--super->actionDelay == 0) { + if (--super->timer == 0) { sub_08093334(this); } sub_08093364(this); @@ -328,7 +328,7 @@ void sub_08093364(ObjectBlockingStairsEntity* this) { s32 sVar1; Entity* dashEffectEnt; - if ((super->actionDelay & 3) == 0) { + if ((super->timer & 3) == 0) { dashEffectEnt = CreateObject(SPECIAL_FX, FX_DASH, 0); if (dashEffectEnt != NULL) { dashEffectEnt->parent = super; @@ -340,7 +340,7 @@ void sub_08093364(ObjectBlockingStairsEntity* this) { } sVar1 = dashEffectEnt->y.HALF.HI; - if (super->actionDelay & 8) { + if (super->timer & 8) { dashEffectEnt->y.HALF.HI = sVar1 + 8; } else { dashEffectEnt->y.HALF.HI = sVar1 - 8; diff --git a/src/object/objectD.c b/src/object/objectD.c index 89b72fa2..dc164b85 100644 --- a/src/object/objectD.c +++ b/src/object/objectD.c @@ -36,7 +36,7 @@ void sub_0808434C(ObjectDEntity* this) { super->action = 1; super->flags |= 0x80; super->spriteSettings.draw = 1; - super->field_0x3c = 7; + super->collisionFlags = 7; super->hitType = 1; super->hurtType = 0x47; super->flags2 = 2; @@ -52,7 +52,7 @@ void sub_0808434C(ObjectDEntity* this) { } void sub_080843F8(ObjectDEntity* this) { - if (super->bitfield == 0x9c) { + if (super->contactFlags == 0x9c) { super->action = 2; super->flags &= 0x7f; CreateFx(super, FX_ICE, 0); diff --git a/src/object/objectE.c b/src/object/objectE.c index e7cee6bc..c5b05304 100644 --- a/src/object/objectE.c +++ b/src/object/objectE.c @@ -13,10 +13,10 @@ void ObjectE(Entity* this) { if (this->action == 0) { this->action = 1; - this->actionDelay = 0x14; + this->timer = 0x14; sub_08004168(this); } else { - if (this->actionDelay-- == 0) { + if (this->timer-- == 0) { sub_0807B7D8(0x35, COORD_TO_TILE(this), this->collisionLayer); CreateFx(this, FX_FALL_DOWN, 0x40); SoundReq(SFX_126); diff --git a/src/object/objectOnPillar.c b/src/object/objectOnPillar.c index 0433a93d..7f0456c8 100644 --- a/src/object/objectOnPillar.c +++ b/src/object/objectOnPillar.c @@ -80,7 +80,7 @@ void ObjectOnPillar_Init(ObjectOnPillarEntity* this) { super->spriteSettings.shadow = 1; super->spriteOffsetY = 4; super->hitbox = (Hitbox*)&gUnk_080FD1F4; - super->field_0x16 = 1; + super->carryFlags = 1; this->unk_72 = 0; super->collisionLayer = this->unk_7d >> 4; UpdateSpriteForCollisionLayer(super); diff --git a/src/object/objectOnSpinyBeetle.c b/src/object/objectOnSpinyBeetle.c index faba73b0..fe046591 100644 --- a/src/object/objectOnSpinyBeetle.c +++ b/src/object/objectOnSpinyBeetle.c @@ -55,14 +55,14 @@ void ObjectOnSpinyBeetle_Init(ObjectOnSpinyBeetleEntity* this) { super->flags |= ENT_COLLIDE; super->spritePriority.b0 = 6; super->spriteRendering.b3 = 2; - super->field_0xf = 0; + super->subtimer = 0; super->hitType = 0x6e; super->flags2 = 0x86; - super->field_0x16 = 0; + super->carryFlags = 0; if (super->type != 0) { - super->field_0x1c = 2; + super->gustJarFlags = 2; } else { - super->field_0x1c = 1; + super->gustJarFlags = 1; } SortEntityBelow(super, super->parent); sub_08098918(this); @@ -75,8 +75,8 @@ void ObjectOnSpinyBeetle_Action1(ObjectOnSpinyBeetleEntity* this) { sub_080989C0(this); return; } - if ((super->bitfield & 0x80) != 0) { - switch (super->bitfield & 0x3f) { + if ((super->contactFlags & 0x80) != 0) { + switch (super->contactFlags & 0x3f) { case 0x13: super->action = 3; super->subAction = 0; @@ -139,7 +139,7 @@ void ObjectOnSpinyBeetle_Action2(ObjectOnSpinyBeetleEntity* this) { void ObjectOnSpinyBeetle_Action2Subaction0(ObjectOnSpinyBeetleEntity* this) { super->flags |= ENT_COLLIDE; - super->field_0x3c = 7; + super->collisionFlags = 7; super->hitType = 1; super->flags2 = gPlayerEntity.flags2; super->spriteOffsetY = 0; @@ -202,12 +202,12 @@ void ObjectOnSpinyBeetle_Action3(ObjectOnSpinyBeetleEntity* this) { void ObjectOnSpinyBeetle_Action3Subaction0(ObjectOnSpinyBeetleEntity* this) { super->subAction = 1; - super->field_0x1d = 0x30; - super->actionDelay = 0; + super->gustJarTolerance = 0x30; + super->timer = 0; } void ObjectOnSpinyBeetle_Action3Subaction1(ObjectOnSpinyBeetleEntity* this) { - if ((gPlayerState.field_0x1c & 0xf) != 1 || (super->bitfield & 0x7f) != 0x13) { + if ((gPlayerState.field_0x1c & 0xf) != 1 || (super->contactFlags & 0x7f) != 0x13) { super->spriteOffsetX = 0; super->action = 1; } else { @@ -216,13 +216,13 @@ void ObjectOnSpinyBeetle_Action3Subaction1(ObjectOnSpinyBeetleEntity* this) { } void ObjectOnSpinyBeetle_Action3Subaction2(ObjectOnSpinyBeetleEntity* this) { - if (super->actionDelay == 0) { - super->actionDelay = 1; + if (super->timer == 0) { + super->timer = 1; super->spriteOffsetX = 0; super->spriteOffsetY = -2; (super->parent)->child = NULL; } - if ((gPlayerState.field_0x1c & 0xf) != 1 || (super->bitfield & 0x7f) != 0x13) { + if ((gPlayerState.field_0x1c & 0xf) != 1 || (super->contactFlags & 0x7f) != 0x13) { sub_080989C0(this); } else { if ((sub_0806F3E4(super) != 0) && (super->type == 0)) { @@ -269,16 +269,16 @@ void sub_08098918(ObjectOnSpinyBeetleEntity* this) { CopyPosition(parent, super); tmp = parent->flags & 0x80; if ((parent->flags & ENT_COLLIDE) != 0) { - if (super->field_0xf == 0) { - super->field_0xf += 1; + if (super->subtimer == 0) { + super->subtimer += 1; super->spritePriority.b0 = 3; SortEntityBelow(super, super->parent); } super->z.HALF.HI = gUnk_08123558[parent->frame & 0xf] - 8; super->spriteOffsetY = 0; } else { - if (super->field_0xf != 0) { - super->field_0xf = tmp; + if (super->subtimer != 0) { + super->subtimer = tmp; super->spritePriority.b0 = 6; SortEntityBelow(super, super->parent); } diff --git a/src/object/octorokBossObject.c b/src/object/octorokBossObject.c index b7316b8c..7d47d15d 100644 --- a/src/object/octorokBossObject.c +++ b/src/object/octorokBossObject.c @@ -11,7 +11,7 @@ bool32 sub_0809A6F8(u32, u32, u32, u32); bool32 sub_0809A758(u32, u32); typedef struct HelperStruct { - u8 field_0x0; // [0,1,2,4] is later stored in this->field_0xf + u8 field_0x0; // [0,1,2,4] is later stored in this->subtimer u8 tailCount; u8 field_0x2; // [0,1] u8 field_0x3; // relates to this->field_0x7a.HALF.HI @@ -48,8 +48,8 @@ void OctorokBossObject_Init(Entity* this) { switch (this->type) { case 0: this->field_0x78.HALF.HI = 0x96; - this->actionDelay = 0; - this->field_0xf = 0x1e; + this->timer = 0; + this->subtimer = 0x1e; case 1: InitializeAnimation(this, 0); EnqueueSFX(SFX_124); @@ -115,14 +115,14 @@ void OctorokBossObject_Init(Entity* this) { InitializeAnimation(this, 7); break; case 7: - this->actionDelay = 0; + this->timer = 0; InitializeAnimation(this, 8); CopyPosition(this->parent, this); break; case 8: this->type2 = this->parent->field_0x7c.BYTES.byte0; - this->actionDelay = 4; - this->field_0xf = 0; + this->timer = 4; + this->subtimer = 0; this->field_0x82.HWORD = (this->x.HALF.HI - (gRoomControls.origin_x)) & 0x1f0; this->field_0x80.HWORD = (this->y.HALF.HI - ((u32)gRoomControls.origin_y)) & 0x1f0; *(int*)&this->cutsceneBeh = @@ -153,8 +153,8 @@ NONMATCH("asm/non_matching/octorokBossObject/OctorokBossObject_Action1.inc", case 0: if (this->field_0x78.HALF.HI != 0) { this->field_0x78.HALF.HI--; - if (this->field_0xf-- == 0) { - this->field_0xf = 5; + if (this->subtimer-- == 0) { + this->subtimer = 5; this->child = CreateObjectWithParent(this, OCTOROK_BOSS_OBJECT, 1, this->type2); if (this->child != NULL) { this->child->parent = this->parent; @@ -166,18 +166,18 @@ NONMATCH("asm/non_matching/octorokBossObject/OctorokBossObject_Action1.inc", return; } case 1: - this->direction = sub_080045DA(GET_HELPER(this)->tailObjects[this->actionDelay]->x.WORD - this->x.WORD, - GET_HELPER(this)->tailObjects[this->actionDelay]->y.WORD - this->y.WORD); + this->direction = sub_080045DA(GET_HELPER(this)->tailObjects[this->timer]->x.WORD - this->x.WORD, + GET_HELPER(this)->tailObjects[this->timer]->y.WORD - this->y.WORD); LinearMoveAngle(this, this->speed, this->direction); - if (EntityInRectRadius(this, GET_HELPER(this)->tailObjects[this->actionDelay], 2, 2) == 0) { + if (EntityInRectRadius(this, GET_HELPER(this)->tailObjects[this->timer], 2, 2) == 0) { return; } if (this->type == 0) { - GET_HELPER(this)->tailObjects[this->actionDelay]->spriteSettings.draw &= -2; + GET_HELPER(this)->tailObjects[this->timer]->spriteSettings.draw &= -2; } - if ((u32)this->actionDelay == GET_HELPER(this)->tailCount - 1) { + if ((u32)this->timer == GET_HELPER(this)->tailCount - 1) { this->action = 2; - this->actionDelay = 0xf0; + this->timer = 0xf0; this->direction = gUnk_0812384C[(this->type2 & 0xf) * 2] + ((u8)Random() & 0xf); this->speed = gUnk_0812384C[(this->type2 & 0xf) * 2 + 1] + ((u16)Random() & 0x1ff); if (this->type != 0) { @@ -187,7 +187,7 @@ NONMATCH("asm/non_matching/octorokBossObject/OctorokBossObject_Action1.inc", this->parent->subAction = 0; return; } - this->actionDelay += 1; + this->timer += 1; return; case 2: if (this->parent->type2 == 3) { @@ -250,25 +250,25 @@ NONMATCH("asm/non_matching/octorokBossObject/OctorokBossObject_Action1.inc", (u32)gUnk_0812388C[(u32)this->type2 * 2]); return; case 7: - if (this->actionDelay == 0) { + if (this->timer == 0) { CopyPosition(this->parent, this); return; } DeleteThisEntity(); break; case 8: - if (this->actionDelay-- != 0) { + if (this->timer-- != 0) { return; } - this->actionDelay = 4; - this->field_0xf++; - t2 = t1 = (*(int*)&this->cutsceneBeh) - this->field_0xf * 0x1f; + this->timer = 4; + this->subtimer++; + t2 = t1 = (*(int*)&this->cutsceneBeh) - this->subtimer * 0x1f; this->field_0x7c.HALF_U.HI = this->field_0x82.HWORD; this->field_0x7a.HWORD = this->field_0x82.HWORD; - this->field_0x7c.HALF_U.LO = this->field_0x80.HWORD - this->field_0xf * 0x10; + this->field_0x7c.HALF_U.LO = this->field_0x80.HWORD - this->subtimer * 0x10; this->field_0x78.HWORD = this->field_0x7c.HALF.LO; tmp_c = sub_0809A6F8(this->field_0x7a.HWORD, this->field_0x78.HWORD, t1, this->type2); - for (loop_var = this->field_0xf; loop_var != 0; loop_var--) { + for (loop_var = this->subtimer; loop_var != 0; loop_var--) { this->field_0x7a.HWORD -= 0x10; this->field_0x78.HWORD += 0x10; t1 += 0x1e; @@ -278,13 +278,13 @@ NONMATCH("asm/non_matching/octorokBossObject/OctorokBossObject_Action1.inc", t2 += 0x20; tmp_c += sub_0809A6F8(this->field_0x7c.HALF_U.HI, this->field_0x7c.HALF_U.LO, t2, this->type2); } - t2 = t1 = (*(int*)&this->cutsceneBeh) + this->field_0xf * 0x1f; + t2 = t1 = (*(int*)&this->cutsceneBeh) + this->subtimer * 0x1f; this->field_0x7c.HALF.HI = this->field_0x82.HWORD; this->field_0x7a.HWORD = this->field_0x82.HWORD; - this->field_0x7c.HALF.LO = this->field_0xf * 0x10 + this->field_0x80.HWORD; + this->field_0x7c.HALF.LO = this->subtimer * 0x10 + this->field_0x80.HWORD; this->field_0x78.HWORD = this->field_0x7c.HALF.LO; tmp_c += sub_0809A6F8(this->field_0x7a.HWORD, this->field_0x78.HWORD, t1, this->type2); - for (loop_var = this->field_0xf - 1; loop_var != 0; loop_var--) { + for (loop_var = this->subtimer - 1; loop_var != 0; loop_var--) { this->field_0x7a.HWORD -= 0x10; this->field_0x78.HWORD -= 0x10; t1 -= 0x20; @@ -314,7 +314,7 @@ void OctorokBossObject_Action2(Entity* this) { s32 radius; GetNextFrame(this); - if (this->actionDelay-- != 0) { + if (this->timer-- != 0) { tmp = (0x10000 / this->parent->field_0x74.HWORD); radius = (this->speed * tmp) >> 8; this->field_0x7a.HALF.HI = -this->parent->field_0x7a.HALF.HI + this->direction; diff --git a/src/object/picoBloom.c b/src/object/picoBloom.c index de912b8a..37b6a751 100644 --- a/src/object/picoBloom.c +++ b/src/object/picoBloom.c @@ -26,14 +26,14 @@ void PicoBloom_Init(Entity* this) { nextAction = 2; } this->action = nextAction; - this->actionDelay = (Random() & 0x7f) + 0x7f; + this->timer = (Random() & 0x7f) + 0x7f; this->collisionLayer = 1; UpdateSpriteForCollisionLayer(this); InitializeAnimation(this, typeAnimationStates[this->type] + this->type2); } void PicoBloom_Action1(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action++; } } diff --git a/src/object/playerClone.c b/src/object/playerClone.c index 3e7eadab..29ecc16e 100644 --- a/src/object/playerClone.c +++ b/src/object/playerClone.c @@ -66,7 +66,7 @@ void PlayerClone_Action1(PlayerCloneEntity* this) { super->action = 2; super->updatePriority = 6; super->hitbox = (Hitbox*)&PlayerCloneHitbox; - super->field_0xf = (super->type + 1) * 15; + super->subtimer = (super->type + 1) * 15; this->unk78 = super->x.HALF.HI - gPlayerEntity.x.HALF.HI; this->unk7a = super->y.HALF.HI - gPlayerEntity.y.HALF.HI; if ((this->unk78 != 0) && (this->unk7a != 0)) { @@ -92,11 +92,11 @@ void PlayerClone_Action1(PlayerCloneEntity* this) { void PlayerClone_Action2(PlayerCloneEntity* this) { u32 index; - if (super->field_0xf == 1) { + if (super->subtimer == 1) { SoundReq(SFX_PLY_VO2); - super->field_0xf--; - } else if (super->field_0xf != 0) { - super->field_0xf--; + super->subtimer--; + } else if (super->subtimer != 0) { + super->subtimer--; } if (gPlayerState.chargeState.action == 5 && gPlayerClones[super->type] != NULL && gPlayerState.framestate != 19 && @@ -119,17 +119,17 @@ void PlayerClone_Action2(PlayerCloneEntity* this) { } if (index == 4) { - super->actionDelay = 0; + super->timer = 0; super->spriteSettings.draw = 1; return; } else { - if (super->actionDelay != 0) { - if (--super->actionDelay != 0) { + if (super->timer != 0) { + if (--super->timer != 0) { super->spriteSettings.draw ^= 1; return; } } else { - super->actionDelay = 30; + super->timer = 30; return; } } @@ -160,7 +160,7 @@ void sub_08084B1C(PlayerCloneEntity* this) { super->collisionLayer = gPlayerEntity.collisionLayer; super->flags2 = gPlayerEntity.flags2; super->hitType = gPlayerEntity.hitType; - super->field_0x3c = gPlayerEntity.field_0x3c; + super->collisionFlags = gPlayerEntity.collisionFlags; super->hurtType = gPlayerEntity.hurtType; CopyPosition(super, super->child); if (gPlayerState.field_0x3[1] != 0) { diff --git a/src/object/pot.c b/src/object/pot.c index b75999d6..18f69ed2 100644 --- a/src/object/pot.c +++ b/src/object/pot.c @@ -21,7 +21,7 @@ extern void sub_08016A6C(Entity*); void Pot(Entity* this) { gUnk_0811F090[this->action](this); - this->bitfield = 0; + this->contactFlags = 0; } void sub_0808222C(Entity* this) { @@ -33,13 +33,13 @@ void sub_0808222C(Entity* this) { this->hitbox = (Hitbox*)&gHitbox_18; this->speed = 0x80; this->y.HALF.HI += 3; - this->field_0x16 = 0; + this->carryFlags = 0; COLLISION_ON(this); this->health = 1; - this->field_0x3c = 7; + this->collisionFlags = 7; this->hitType = 0x6E; this->flags2 = 0x84; - this->field_0x1c = 0x12; + this->gustJarFlags = 0x12; if (this->collisionLayer == 0) { ResolveCollisionLayer(this); } @@ -55,7 +55,7 @@ void sub_0808222C(Entity* this) { void sub_08082310(Entity* this) { u32 tileType; - u32 var0 = this->bitfield & 0x7F; + u32 var0 = this->contactFlags & 0x7F; switch (var0) { case 0x13: this->action = 3; @@ -80,11 +80,11 @@ void sub_08082310(Entity* this) { case 0x4002: case 0x4001: this->direction = (tileType - 0x4001) * 8; - this->actionDelay = 32; + this->timer = 32; this->action = 4; if (gPlayerState.flags & PL_MINISH) { this->speed >>= 1; - this->actionDelay = 64; + this->timer = 64; } SetTile((u16)this->field_0x70.HALF.LO, COORD_TO_TILE(this), this->collisionLayer); EnqueueSFX(SFX_10F); @@ -117,7 +117,7 @@ void sub_080824F8(Entity* this) { void sub_08082510(Entity* this) { COLLISION_ON(this); this->hitbox = (Hitbox*)&gUnk_080FD340; - this->field_0x3c = 7; + this->collisionFlags = 7; this->hitType = 1; this->flags2 = gPlayerEntity.flags2; this->spriteOffsetY = 0; @@ -170,7 +170,7 @@ void sub_08082614(Entity* this) { u32 tileType; sub_0800445C(this); - if (this->actionDelay-- != 0) { + if (this->timer-- != 0) { LinearMoveUpdate(this); sub_08016A6C(this); return; @@ -205,12 +205,12 @@ void sub_080826E4(Entity* this) { void sub_080826FC(Entity* this) { this->subAction = 1; - this->field_0x1d = 48; - this->actionDelay = 0; + this->gustJarTolerance = 48; + this->timer = 0; } void sub_0808270C(Entity* this) { - if ((gPlayerState.field_0x1c & 0xF) != 0x1 || (this->bitfield & 0x7F) != 0x13) { + if ((gPlayerState.field_0x1c & 0xF) != 0x1 || (this->contactFlags & 0x7F) != 0x13) { this->spriteOffsetX = 0; this->action = 1; SetTile(0x4000, COORD_TO_TILE(this), this->collisionLayer); @@ -220,14 +220,14 @@ void sub_0808270C(Entity* this) { } void sub_08082778(Entity* this) { - if (this->actionDelay == 0) { - this->actionDelay = 1; + if (this->timer == 0) { + this->timer = 1; this->spriteOffsetX = 0; this->spriteOffsetY = -2; SetTile((u16)this->field_0x70.HALF.LO, COORD_TO_TILE(this), this->collisionLayer); } - if ((gPlayerState.field_0x1c & 0xF) != 0x1 || (this->bitfield & 0x7F) != 0x13) { + if ((gPlayerState.field_0x1c & 0xF) != 0x1 || (this->contactFlags & 0x7F) != 0x13) { sub_08082850(this, NULL); } else { sub_0806F3E4(this); @@ -285,10 +285,10 @@ u32 sub_0808288C(Entity* this, u32 form, u32 arg2, u32 arg3) { entity = CreateObjectWithParent(this, GROUND_ITEM, form, arg2); if (entity != NULL) { if (arg3 == 2) { - entity->actionDelay = 5; + entity->timer = 5; entity->field_0x86.HWORD = this->field_0x86.HWORD; } else { - entity->actionDelay = 0; + entity->timer = 0; } } break; diff --git a/src/object/pressurePlate.c b/src/object/pressurePlate.c index b3231615..4536eeda 100644 --- a/src/object/pressurePlate.c +++ b/src/object/pressurePlate.c @@ -33,8 +33,8 @@ void PressurePlate(PressurePlateEntity* this) { sub_080888F4, }; - if (super->field_0xf) { - if (--super->field_0xf == 0) { + if (super->subtimer) { + if (--super->subtimer == 0) { this->dir = super->animationState; InitializeAnimation(super, super->animationState); } @@ -57,7 +57,7 @@ void sub_0808886C(PressurePlateEntity* this) { weight = sub_08088938(this) + get_standing_count(this); if (super->type + 2 <= weight) { super->action = 2; - super->field_0xf = 0; + super->subtimer = 0; super->animationState = 4; super->z.HALF.HI = 0; InitializeAnimation(super, 4); @@ -66,7 +66,7 @@ void sub_0808886C(PressurePlateEntity* this) { } else { if (weight > super->animationState) { if (super->type + 1 == weight) { - super->field_0xf = 4; + super->subtimer = 4; InitializeAnimation(super, weight + 1); } else { InitializeAnimation(super, weight); diff --git a/src/object/pullableLever.c b/src/object/pullableLever.c index 98b62c82..e3c762e4 100644 --- a/src/object/pullableLever.c +++ b/src/object/pullableLever.c @@ -17,7 +17,7 @@ typedef struct { /*0x68*/ u8 unk_68[8]; /*0x70*/ u16 pullLength; /*0x72*/ u16 leverPart; // lever part number? [0,1,2] - /*0x74*/ u8 actionDelay; + /*0x74*/ u8 timer; /*0x75*/ u8 unk_75; /*0x76*/ u16 necessaryPullLength; /*0x78*/ u8 unk_78[6]; @@ -49,7 +49,7 @@ void PullableLever(PullableLeverEntity* this) { case HANDLE: PullableLever_HandleActions[super->action](this); sub_0800445C(super); - gUnk_02021F00[this->actionDelay] = this->pullLength; + gUnk_02021F00[this->timer] = this->pullLength; break; case MIDDLE: PullableLever_MiddleActions[super->action](this); @@ -79,14 +79,14 @@ void PullableLever_HandleInit(PullableLeverEntity* this) { } else { super->hitbox = (Hitbox*)&gUnk_080FD270; } - super->field_0x16 = 1; + super->carryFlags = 1; super->x.HALF.HI += PullableLever_InitialOffsets[super->type2 * 2]; this->initialX = super->x.HALF.HI; super->y.HALF.HI += PullableLever_InitialOffsets[super->type2 * 2 + 1]; this->initialY = super->y.HALF.HI; CopyPosition(super, &entity1->base); this->necessaryPullLength = this->unk_7e; - this->actionDelay = super->actionDelay; + this->timer = super->timer; InitializeAnimation(super, super->type2); } } @@ -120,7 +120,7 @@ void PullableLever_HandleSubAction0(PullableLeverEntity* this) { } } this->unk_75 = 1; - super->field_0xf = 2; + super->subtimer = 2; } if (player->animationState >> 1 == super->type2) { if (gPlayerState.framestate == PL_STATE_PULL) { @@ -228,8 +228,8 @@ void sub_0809153C(PullableLeverEntity* this) { EnqueueSFX(SFX_BUTTON_PRESS); SetFlag(this->pulledFlag); } else { - if (--super->field_0xf == 0) { - super->field_0xf = 0x10; + if (--super->subtimer == 0) { + super->subtimer = 0x10; EnqueueSFX(SFX_10F); } } diff --git a/src/object/pullableMushroom.c b/src/object/pullableMushroom.c index 80d2c605..f4b1d794 100644 --- a/src/object/pullableMushroom.c +++ b/src/object/pullableMushroom.c @@ -49,7 +49,7 @@ void PullableMushroom(PullableMushroomEntity* this) { PullableMushroom_Action3, }; PullableMushroom_Actions[super->action](this); - super->bitfield = 0; + super->contactFlags = 0; } void PullableMushroom_Init(PullableMushroomEntity* this) { @@ -61,13 +61,13 @@ void PullableMushroom_Init(PullableMushroomEntity* this) { case 0: super->spritePriority.b0 = 4; super->hitbox = (Hitbox*)&gUnk_080FD224; - super->field_0x16 = 1; + super->carryFlags = 1; SetTile(0x4022, COORD_TO_TILE(super), super->collisionLayer); super->health = 1; - super->field_0x3c = 7; + super->collisionFlags = 7; super->hitType = 0x6e; super->flags2 = 0x0e; - super->field_0x1c = 1; + super->gustJarFlags = 1; super->flags |= 0x80; super->spriteOffsetY = 4; break; @@ -77,10 +77,10 @@ void PullableMushroom_Init(PullableMushroomEntity* this) { super->hitbox = (Hitbox*)&gUnk_080FD224; super->flags |= 0x80; super->health = 1; - super->field_0x3c = 7; + super->collisionFlags = 7; super->hitType = 0x6e; super->flags2 = 4; - super->field_0x1c = 1; + super->gustJarFlags = 1; super->action = 3; } InitializeAnimation(super, super->animationState + 9); @@ -135,7 +135,7 @@ void sub_0808ACEC(PullableMushroomEntity* this) { InitializeAnimation(super, 0); } - switch (super->bitfield & 0x7f) { + switch (super->contactFlags & 0x7f) { case 0x4: case 0x5: case 0x6: @@ -153,15 +153,15 @@ void sub_0808ACEC(PullableMushroomEntity* this) { COLLISION_OFF(super); super->animationState = sub_0806F5A4(super->knockbackDirection); super->subAction = 2; - super->actionDelay = 2; + super->timer = 2; break; case 0x13: super->action = 3; super->subAction = 0; break; default: - super->field_0xf = 0; - super->actionDelay = 0; + super->subtimer = 0; + super->timer = 0; RegisterCarryEntity(super); break; } @@ -170,7 +170,7 @@ void sub_0808ACEC(PullableMushroomEntity* this) { void sub_0808ADA0(PullableMushroomEntity* this) { if ((sub_0808B1F0(this, super->child) < 8) || (super->child == NULL)) { super->subAction += 1; - super->actionDelay = 2; + super->timer = 2; super->flags |= ENT_COLLIDE; super->animationState ^= 2; super->spritePriority.b0 = 4; @@ -199,7 +199,7 @@ void sub_0808ADF0(PullableMushroomEntity* this) { SoundReq(SFX_12E); } else { GetNextFrame(super); - if (((super->frame & ANIM_DONE) != 0) && (super->actionDelay-- == 0)) { + if (((super->frame & ANIM_DONE) != 0) && (super->timer-- == 0)) { InitializeAnimation(super, super->animationState + 0xd); } } @@ -220,7 +220,7 @@ void PullableMushroom_Action2(PullableMushroomEntity* this) { void sub_0808AEB0(PullableMushroomEntity* this) { static const u16 gUnk_081211E4[] = { 1024, 256, 2048, 512 }; u32 uVar1; - if (super->actionDelay != 0) { + if (super->timer != 0) { uVar1 = sub_0808B1F0(this, super->child); if ((gPlayerState.field_0x90 & gUnk_081211E4[super->animationState]) != 0) { GetNextFrame(super); @@ -231,10 +231,10 @@ void sub_0808AEB0(PullableMushroomEntity* this) { SoundReq(SFX_12F); } } - super->field_0xf = 1; + super->subtimer = 1; } else { - if (((super->field_0xf != 0) && (gPlayerEntity.action == 1)) && (gPlayerState.swim_state == 0)) { + if (((super->subtimer != 0) && (gPlayerEntity.action == 1)) && (gPlayerState.swim_state == 0)) { gPlayerState.queued_action = 0x1b; gPlayerState.field_0x38 = uVar1; gPlayerState.field_0x39 = super->direction ^ 0x10; @@ -243,7 +243,7 @@ void sub_0808AEB0(PullableMushroomEntity* this) { } } } else { - super->actionDelay = 1; + super->timer = 1; this->unk_7c = 1; super->animationState = AnimationStateFlip90(gPlayerEntity.animationState >> 1); super->direction = (super->animationState << 3); @@ -275,7 +275,7 @@ void PullableMushroom_Action3(PullableMushroomEntity* this) { }; funcs[super->subAction](this); - if ((((gPlayerState.field_0x1c & 0xf) != 1) || ((super->bitfield & 0x7f) != 0x13)) && (super->type == 1)) { + if ((((gPlayerState.field_0x1c & 0xf) != 1) || ((super->contactFlags & 0x7f) != 0x13)) && (super->type == 1)) { (super->parent)->action = 1; (super->parent)->subAction = 1; super->direction = DirectionTurnAround(super->parent->direction); diff --git a/src/object/pushableFurniture.c b/src/object/pushableFurniture.c index 70213732..4b9c269c 100644 --- a/src/object/pushableFurniture.c +++ b/src/object/pushableFurniture.c @@ -68,7 +68,7 @@ void PushableFurniture_Action1(PushableFurnitureEntity* this) { sub_0808FB68(this); } } else { - if (super->actionDelay != 0 && --super->actionDelay == 0) { + if (super->timer != 0 && --super->timer == 0) { EnqueueSFX(SFX_BUTTON_PRESS); } } @@ -79,11 +79,11 @@ void PushableFurniture_Action1(PushableFurnitureEntity* this) { case 0: if (sub_0808FECC(this)) { super->subAction = 1; - super->actionDelay = 0xc; + super->timer = 0xc; } break; case 1: - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->frameIndex = 1; super->subAction = 2; EnqueueSFX(SFX_80); @@ -146,7 +146,7 @@ bool32 sub_0808FC5C(PushableFurnitureEntity* this) { u8* puVar5; LinearMoveUpdate(super); - if (--super->actionDelay == 0) { + if (--super->timer == 0) { if ((super->type == 2) || (super->type == 4)) { super->spriteOffsetY = 0xfe; } else { @@ -155,7 +155,7 @@ bool32 sub_0808FC5C(PushableFurnitureEntity* this) { if (sub_080B1B0C(super)) { return 0; } - if (super->field_0xf == 0) { + if (super->subtimer == 0) { sub_0808FF50(this); return TRUE; } @@ -187,12 +187,12 @@ bool32 sub_0808FC5C(PushableFurnitureEntity* this) { } } if (this->unk_80 == 0) { - super->actionDelay = 4; + super->timer = 4; } else { - super->actionDelay = 0x18; + super->timer = 0x18; } if ((gPlayerState.flags & 0x80) == 0) { - super->actionDelay += 0x10; + super->timer += 0x10; } sub_0808FF50(this); return TRUE; @@ -215,19 +215,19 @@ void sub_0808FD44(PushableFurnitureEntity* this, u32 param_2) { } if ((gPlayerState.flags & 0x80) != 0) { super->speed = 0x40; - super->actionDelay = 0x20; + super->timer = 0x20; } else { super->speed = 0x80; - super->actionDelay = 0x10; + super->timer = 0x10; } } else { tmp = this->unk_7c; if ((gPlayerState.flags & 0x80) != 0) { super->speed = 0x40; - super->actionDelay = 0x40; + super->timer = 0x40; } else { super->speed = 0x80; - super->actionDelay = 0x20; + super->timer = 0x20; } } EnqueueSFX(SFX_10F); diff --git a/src/object/pushableGrave.c b/src/object/pushableGrave.c index 5e882fd7..f84681ea 100644 --- a/src/object/pushableGrave.c +++ b/src/object/pushableGrave.c @@ -86,23 +86,23 @@ void PushableGrave_Init(PushableGraveEntity* this) { void PushableGrave_Action1(PushableGraveEntity* this) { if (sub_0809785C(this)) { - RequestPriorityDuration(super, super->actionDelay); + RequestPriorityDuration(super, super->timer); } } void PushableGrave_Action2(PushableGraveEntity* this) { if (super->subAction == 0) { - if (--super->field_0xf == 0) { + if (--super->subtimer == 0) { super->subAction = 1; - super->field_0xf = 0x78; + super->subtimer = 0x78; gRoomControls.camera_target = super; gRoomControls.unk5 = 2; } } else { - if (--super->field_0xf == 0) { + if (--super->subtimer == 0) { super->action = 3; - super->actionDelay = 0x60; - super->field_0xf = 0x14; + super->timer = 0x60; + super->subtimer = 0x14; RequestPriorityDuration(super, 0x60); SoundReq(SFX_10F); } @@ -110,13 +110,13 @@ void PushableGrave_Action2(PushableGraveEntity* this) { } void PushableGrave_Action3(PushableGraveEntity* this) { - if (super->actionDelay != 0) { - super->actionDelay--; + if (super->timer != 0) { + super->timer--; LinearMoveUpdate(super); sub_0800445C(super); } else { - if (super->field_0xf != 0) { - super->field_0xf--; + if (super->subtimer != 0) { + super->subtimer--; } else { EnqueueSFX(SFX_SECRET); sub_080977F4(this); @@ -152,8 +152,8 @@ bool32 sub_0809785C(PushableGraveEntity* this) { if (super->type2 != 0) { if ((CheckFlags(this->pushedFlag) != 0) || GetTileType(this->unk_68, super->collisionLayer) == 0x403f) { super->action = 3; - super->actionDelay = 0x40; - super->field_0xf = 0; + super->timer = 0x40; + super->subtimer = 0; super->direction = 0; super->speed = 0x40; tilePosition = this->unk_68; @@ -177,8 +177,8 @@ bool32 sub_0809785C(PushableGraveEntity* this) { if (CheckFlags(this->pushedFlag) != 0) { super->action = 2; super->subAction = 0; - super->actionDelay = 0xf0; - super->field_0xf = 0x3c; + super->timer = 0xf0; + super->subtimer = 0x3c; super->direction = 0; super->speed = 0x40; RestorePrevTileEntity(this->unk_68, super->collisionLayer); diff --git a/src/object/pushableStatue.c b/src/object/pushableStatue.c index 3074fcff..c94f81fb 100644 --- a/src/object/pushableStatue.c +++ b/src/object/pushableStatue.c @@ -50,7 +50,7 @@ void PushableStatue_Init(PushableStatueEntity* this) { super->speed = 0x80; super->updatePriority = 3; super->hitbox = (Hitbox*)&gUnk_080FD1F4; - super->field_0x16 = 1; + super->carryFlags = 1; this->unk_86 = 0; sub_08089454(this); sub_080894C8(this); @@ -153,7 +153,7 @@ void PushableStatue_Action3(PushableStatueEntity* this) { } void PushableStatue_Action4(PushableStatueEntity* this) { - if (--super->actionDelay != 0) { + if (--super->timer != 0) { super->spriteSettings.draw ^= 1; } else { super->spriteSettings.draw = 1; @@ -226,7 +226,7 @@ bool32 sub_080895C0(PushableStatueEntity* this) { super->y.HALF.HI += gUnk_08120CBC[(super->direction >> 2) + 1]; sub_08089454(this); super->action = 4; - super->actionDelay = 0x3c; + super->timer = 0x3c; } sub_0800445C(super); return FALSE; diff --git a/src/object/railtrack.c b/src/object/railtrack.c index cb6fb550..e021ac7e 100644 --- a/src/object/railtrack.c +++ b/src/object/railtrack.c @@ -47,7 +47,7 @@ void sub_080851AC(Entity* this) { void sub_08085264(Entity* this) { if (CheckFlags(this->field_0x86.HWORD)) { this->action = 2; - this->field_0xf = 8; + this->subtimer = 8; if (this->type == 1) { ClearFlag(this->field_0x86.HWORD); } @@ -59,9 +59,9 @@ void sub_08085264(Entity* this) { } void sub_080852B4(Entity* this) { - if (--this->field_0xf == 0) { + if (--this->subtimer == 0) { this->action = 3; - this->field_0xf = this->actionDelay; + this->subtimer = this->timer; this->field_0x7a.HWORD = CheckFlags(this->field_0x86.HWORD); this->animationState = (this->animationState + *(u8*)&this->field_0x7c) & 3; InitializeAnimation(this, this->animationState); @@ -84,15 +84,15 @@ void sub_08085308(Entity* this) { break; case 3: if (CheckFlags(this->field_0x86.HWORD) == *(u16*)&this->field_0x7a) { - this->field_0xf = 0xff; + this->subtimer = 0xff; } else { - this->field_0xf = 1; + this->subtimer = 1; } } - if (--this->field_0xf == 0) { + if (--this->subtimer == 0) { this->action = 2; - this->field_0xf = 8; + this->subtimer = 8; this->animationState = (this->animationState + *(u8*)&this->field_0x7c) & 3; InitializeAnimation(this, this->animationState); sub_0808543C(this); diff --git a/src/object/rupee.c b/src/object/rupee.c index 5bf774e2..f511f652 100644 --- a/src/object/rupee.c +++ b/src/object/rupee.c @@ -17,10 +17,10 @@ void sub_080869DC(Entity* ent) { ent->action = 1; ent->spriteSettings.draw = 0; ent->hitbox = (Hitbox*)&gUnk_080FD1A8; - ent->field_0x3c |= 16; + ent->collisionFlags |= 16; itemEntity = CreateObject(GROUND_ITEM, ent->type, 0); if (itemEntity != NULL) { - itemEntity->actionDelay = 10; + itemEntity->timer = 10; itemEntity->parent = ent; ent->child = itemEntity; CopyPosition(ent, itemEntity); diff --git a/src/object/smallIceBlock.c b/src/object/smallIceBlock.c index e9689baf..6ba2940f 100644 --- a/src/object/smallIceBlock.c +++ b/src/object/smallIceBlock.c @@ -60,7 +60,7 @@ void SmallIceBlock_Init(SmallIceBlockEntity* this) { super->action = 1; super->flags |= 0x80; super->updatePriority = 3; - super->field_0x3c = 7; + super->collisionFlags = 7; super->hurtType = 0x48; super->hitType = 1; super->flags2 = 0x80; @@ -79,7 +79,7 @@ void SmallIceBlock_Action1(SmallIceBlockEntity* this) { if (sub_0809963C(this)) { super->action = 3; - super->actionDelay = 0; + super->timer = 0; EnqueueSFX(SFX_ICE_BLOCK_MELT); SmallIceBlock_Action3(this); if (super->type == 0) { @@ -92,7 +92,7 @@ void SmallIceBlock_Action1(SmallIceBlockEntity* this) { switch (sub_08099618(tileType)) { case 1: super->action = 2; - super->actionDelay = 0x16; + super->timer = 0x16; super->direction = ((tileType - 0x5b) & 3) << 3; super->speed = 0x20; sub_080994B8(this); @@ -125,20 +125,20 @@ void SmallIceBlock_Action2(SmallIceBlockEntity* this) { void SmallIceBlock_Action3(SmallIceBlockEntity* this) { if (sub_0809963C(this) == 0) { - if (super->actionDelay >= 2) { - super->actionDelay -= 2; + if (super->timer >= 2) { + super->timer -= 2; } else { - super->actionDelay = 0; + super->timer = 0; } - if (super->actionDelay == 0) { + if (super->timer == 0) { super->action = 1; sub_0805EC60(super); return; } } else { - super->actionDelay++; + super->timer++; } - SetAffineInfo(super, 0x100, gUnk_08123748[super->actionDelay >> 5], 0); + SetAffineInfo(super, 0x100, gUnk_08123748[super->timer >> 5], 0); if (super->type == 1) { CreateGroundItemWithFlags(super, ITEM_SMALL_KEY, 0, this->unk_86); SoundReq(SFX_SECRET); @@ -147,7 +147,7 @@ void SmallIceBlock_Action3(SmallIceBlockEntity* this) { SoundReq(SFX_SECRET); } super->action = 4; - super->actionDelay = 0x3c; + super->timer = 0x3c; super->flags &= 0x7f; } @@ -157,14 +157,14 @@ void SmallIceBlock_Action4(SmallIceBlockEntity* this) { s32 x; s32 y; - if (--super->actionDelay == 0) { + if (--super->timer == 0) { DeleteThisEntity(); } else { - if (super->actionDelay == 0x30) { + if (super->timer == 0x30) { SetTile(this->unk_6c, this->unk_70, super->collisionLayer); } - SetAffineInfo(super, 0x100, (0x3c - super->actionDelay) * 0x20 + 0x100, 0); - if ((super->actionDelay & 1) != 0) { + SetAffineInfo(super, 0x100, (0x3c - super->timer) * 0x20 + 0x100, 0); + if ((super->timer & 1) != 0) { obj = CreateObject(SPECIAL_FX, 0x11, 0x40); if (obj != NULL) { rand = Random(); @@ -209,9 +209,9 @@ bool32 sub_0809953C(SmallIceBlockEntity* this) { } ProcessMovement2(super); sub_0800445C(super); - if (super->actionDelay != 0) { + if (super->timer != 0) { super->speed += 0x10; - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->speed = 0x200; } } @@ -284,7 +284,7 @@ bool32 sub_0809963C(SmallIceBlockEntity* this) { } } } - if (super->bitfield == 0x87) { + if (super->contactFlags == 0x87) { return TRUE; } return FALSE; diff --git a/src/object/smoke.c b/src/object/smoke.c index 4ce9b8c4..a33cf5b3 100644 --- a/src/object/smoke.c +++ b/src/object/smoke.c @@ -14,10 +14,10 @@ void sub_0808A40C(Entity* this) { if (this->action == 0) { this->action = 1; - this->actionDelay = 0x28; + this->timer = 0x28; } - if (--this->actionDelay == 0) { - this->actionDelay = 0x40 - (Random() & 0x1f); + if (--this->timer == 0) { + this->timer = 0x40 - (Random() & 0x1f); ent = CreateObject(SMOKE, 1, 0); if (ent != NULL) { CopyPosition(this, ent); diff --git a/src/object/specialFx.c b/src/object/specialFx.c index dc51b4c4..9f00d303 100644 --- a/src/object/specialFx.c +++ b/src/object/specialFx.c @@ -228,20 +228,20 @@ void sub_08084694(SpecialFxObject* this) { void sub_080846B0(SpecialFxObject* this) { s32 tmp; - if (super->actionDelay != 0) { + if (super->timer != 0) { if (super->speed != 0) { super->speed -= 0x10; } LinearMoveUpdate(super); sub_080845DC(this); } else { - super->actionDelay = 1; + super->timer = 1; if ((super->animationState | 2) == 2) { super->direction = 0x1e; } else { super->direction = 2; } - if (super->field_0xf != 0) { + if (super->subtimer != 0) { super->spriteVramOffset++; tmp = (super->direction > 0x17 ? -1 : 1); super->direction += tmp; diff --git a/src/object/steam.c b/src/object/steam.c index eaf2938e..393888b5 100644 --- a/src/object/steam.c +++ b/src/object/steam.c @@ -22,8 +22,8 @@ void Steam(Entity* _this) { super->action = 1; super->spriteSettings.draw = 1; super->spriteRendering.alphaBlend = 1; - super->actionDelay = 1; - super->field_0xf = Random() & 0xf; + super->timer = 1; + super->subtimer = Random() & 0xf; this->unk_0x68 = action; super->collisionLayer = 2; ResolveCollisionLayer(super); @@ -49,13 +49,13 @@ void Steam(Entity* _this) { } } - if (--super->actionDelay == 0) { - super->actionDelay = 8; - super->field_0xf = (super->field_0xf + 1) & 0xf; + if (--super->timer == 0) { + super->timer = 8; + super->subtimer = (super->subtimer + 1) & 0xf; } - super->spriteOffsetX = gUnk_08123484[super->field_0xf]; - super->spriteOffsetY = gUnk_08123484[super->field_0xf] + *ptr; + super->spriteOffsetX = gUnk_08123484[super->subtimer]; + super->spriteOffsetY = gUnk_08123484[super->subtimer] + *ptr; } const u8 gUnk_08123484[] = { diff --git a/src/object/thoughtBubble.c b/src/object/thoughtBubble.c index 57ba5cae..0a622628 100644 --- a/src/object/thoughtBubble.c +++ b/src/object/thoughtBubble.c @@ -13,8 +13,8 @@ void ThoughtBubble(Entity* this) { void ThoughtBubble_Init(Entity* this) { this->action = 1; this->spriteSettings.draw = 1; - if (this->actionDelay == 0) { - this->actionDelay = 0x2d; + if (this->timer == 0) { + this->timer = 0x2d; } this->spriteOrientation.flipY = 1; InitializeAnimation(this, this->type2); @@ -28,7 +28,7 @@ void ThoughtBubble_Update(Entity* this) { this->z.HALF.HI = this->parent->z.HALF.HI; } if (this->type2 != 2) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { DeleteThisEntity(); } } diff --git a/src/object/treeHidingPortal.c b/src/object/treeHidingPortal.c index c4a0518a..696f469e 100644 --- a/src/object/treeHidingPortal.c +++ b/src/object/treeHidingPortal.c @@ -45,15 +45,15 @@ void sub_0809E86C(Entity* this) { } if (sub_0809E9A0() == 0x54) { this->action = 2; - this->actionDelay = 0xf; + this->timer = 0xf; SetPlayerControl(1); } } void sub_0809E8BC(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 3; - this->actionDelay = 0x3c; + this->timer = 0x3c; this->spriteSettings.draw = 0; sub_0809E96C(this); sub_0809E918(this); @@ -61,7 +61,7 @@ void sub_0809E8BC(Entity* this) { } void sub_0809E8EC(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { SetFlag(this->field_0x86.HWORD); SetPlayerControl(0); SoundReq(SFX_SECRET_BIG); diff --git a/src/object/treeThorns.c b/src/object/treeThorns.c index ffb359a8..32602e48 100644 --- a/src/object/treeThorns.c +++ b/src/object/treeThorns.c @@ -18,7 +18,7 @@ void TreeThorns(Entity* this) { this->frameIndex = 1; layer = &this->collisionLayer; *layer = 1; - this->field_0x3c = 7; + this->collisionFlags = 7; this->hurtType = 0x48; this->hitType = 0x7a; this->flags2 = 1; diff --git a/src/object/warpPoint.c b/src/object/warpPoint.c index a5f9e0ec..84949f45 100644 --- a/src/object/warpPoint.c +++ b/src/object/warpPoint.c @@ -34,7 +34,7 @@ void WarpPoint(Entity* this) { void sub_0808B474(Entity* this) { u32 tmp; this->action = 1; - this->field_0xf = 0; + this->subtimer = 0; tmp = gUnk_08121380[this->type]; this->palette.b.b0 = tmp; this->spritePriority.b0 = 6; @@ -51,12 +51,12 @@ void sub_0808B474(Entity* this) { if (!sub_0808B7C8(this)) return; this->action = 4; - this->field_0xf = 0x60; + this->subtimer = 0x60; gPlayerEntity.x.HALF.HI = this->x.HALF.HI; gPlayerEntity.y.HALF.HI = this->y.HALF.HI; gPlayerEntity.animationState = 4; EnqueueSFX(SFX_112); - RequestPriorityDuration(this, this->field_0xf + 0x10); + RequestPriorityDuration(this, this->subtimer + 0x10); } void sub_0808B530(Entity* this) { @@ -66,66 +66,66 @@ void sub_0808B530(Entity* this) { sub_0807CAC8(this->type); } this->action = 2; - this->field_0xf = 60; + this->subtimer = 60; EnqueueSFX(SFX_112); } } void sub_0808B564(Entity* this) { - if (!--this->field_0xf) { + if (!--this->subtimer) { this->action = 3; } else { - this->spriteSettings.draw = this->field_0xf & 2 ? 0 : 1; + this->spriteSettings.draw = this->subtimer & 2 ? 0 : 1; } } void sub_0808B590(Entity* this) { GetNextFrame(this); if (sub_0808B7C8(this)) { - if (this->actionDelay) + if (this->timer) return; this->action = 5; - this->field_0xf = 0x60; + this->subtimer = 0x60; PutAwayItems(); gPlayerEntity.x.HALF.HI = this->x.HALF.HI; gPlayerEntity.y.HALF.HI = this->y.HALF.HI; gPlayerEntity.animationState = 4; gPlayerEntity.flags &= ~ENT_COLLIDE; - RequestPriorityDuration(this, this->field_0xf + 0x10); + RequestPriorityDuration(this, this->subtimer + 0x10); SoundReq(SFX_113); } else { - this->actionDelay = 0; + this->timer = 0; } } void sub_0808B5E8(Entity* this) { u32 tmp; - if (!--this->field_0xf) { + if (!--this->subtimer) { this->action = 3; - this->actionDelay = 1; + this->timer = 1; gPlayerEntity.animationState = 4; gPlayerEntity.direction = DirectionSouth; return; } tmp = 0; - switch (this->field_0xf & 0x60) { + switch (this->subtimer & 0x60) { case 0x40: - if (this->field_0xf == 0x58) { + if (this->subtimer == 0x58) { SoundReq(SFX_114); } - if (!(this->field_0xf & 1)) { + if (!(this->subtimer & 1)) { tmp = 1; } break; case 0x20: - if (!(this->field_0xf & 3)) { + if (!(this->subtimer & 3)) { tmp = 1; } break; case 0: - if (!(this->field_0xf & 7)) { + if (!(this->subtimer & 7)) { if (gPlayerEntity.animationState == 4) { - if (this->field_0xf > 0x18) { + if (this->subtimer > 0x18) { tmp = 1; } } else { @@ -142,7 +142,7 @@ void sub_0808B5E8(Entity* this) { void sub_0808B684(Entity* this) { u32 tmp; - if (!--this->field_0xf) { + if (!--this->subtimer) { gRoomTransition.transitioningOut = 1; gRoomTransition.type = TRANSITION_DEFAULT; gRoomTransition.player_status.area_next = this->field_0x7c.BYTES.byte0; @@ -158,20 +158,20 @@ void sub_0808B684(Entity* this) { return; } tmp = 0; - switch (this->field_0xf & 0x60) { + switch (this->subtimer & 0x60) { case 0x40: - if (!(this->field_0xf & 7)) { + if (!(this->subtimer & 7)) { tmp = 1; } break; case 0x20: - if (!(this->field_0xf & 3)) { + if (!(this->subtimer & 3)) { tmp = 1; } break; case 0: - if (this->field_0xf > 0x10) { - if (!(this->field_0xf & 1)) { + if (this->subtimer > 0x10) { + if (!(this->subtimer & 1)) { tmp = 1; } } else { @@ -206,7 +206,7 @@ void sub_0808B73C(Entity* this) { u32 sub_0808B7C8(Entity* this) { if (!(gPlayerState.flags & PL_MINISH) && gPlayerState.framestate != PL_STATE_DIE && gPlayerEntity.health != 0 && sub_08079F8C() && EntityInRectRadius(this, &gPlayerEntity, 5, 5) && gPlayerEntity.z.HALF.HI == 0) { - if (this->actionDelay == 0 && gPlayerEntity.action == PLAYER_08072C9C) { + if (this->timer == 0 && gPlayerEntity.action == PLAYER_08072C9C) { ResetPlayerAnimationAndAction(); } return 1; @@ -217,7 +217,7 @@ u32 sub_0808B7C8(Entity* this) { void sub_0808B830(Entity* this) { Entity* tmp; this->action = 3; - this->actionDelay = 0; + this->timer = 0; this->spriteSettings.draw = 1; tmp = CreateObject(WARP_POINT, 0, 0); if (tmp) { diff --git a/src/object/waterfallOpening.c b/src/object/waterfallOpening.c index 34216c0d..b8f5d650 100644 --- a/src/object/waterfallOpening.c +++ b/src/object/waterfallOpening.c @@ -18,8 +18,8 @@ void sub_080A00B0(WaterfallOpeningEntity*); void WaterfallOpening(Entity* this) { if (this->action == 0) { this->action = 1; - this->actionDelay = 8; - this->field_0xf = 0; + this->timer = 8; + this->subtimer = 0; this->spriteRendering.b3 = 3; this->spritePriority.b0 = 7; this->frameIndex = WaterfallOpening_FrameIndices[this->type]; @@ -32,8 +32,8 @@ void WaterfallOpening(Entity* this) { case 0: if (--((WaterfallOpeningEntity*)this)->unk68 == 0) { ((WaterfallOpeningEntity*)this)->unk68 = 0x20; - this->actionDelay = 1; - this->field_0xf = 0; + this->timer = 1; + this->subtimer = 0; this->subAction = 1; this->type = 1; UnloadGFXSlots(this); @@ -46,7 +46,7 @@ void WaterfallOpening(Entity* this) { case 1: if (--((WaterfallOpeningEntity*)this)->unk68 == 0) { ((WaterfallOpeningEntity*)this)->unk68 = 0x2d; - this->actionDelay = 1; + this->timer = 1; this->subAction = 2; this->type = 2; UnloadGFXSlots(this); @@ -80,9 +80,9 @@ void WaterfallOpening(Entity* this) { } void sub_080A00B0(WaterfallOpeningEntity* this) { - if (--super->actionDelay == 0) { - super->actionDelay = 8; - super->frameIndex = super->field_0xf + WaterfallOpening_FrameIndices[super->type]; - super->field_0xf = (super->field_0xf + 1) & 3; + if (--super->timer == 0) { + super->timer = 8; + super->frameIndex = super->subtimer + WaterfallOpening_FrameIndices[super->type]; + super->subtimer = (super->subtimer + 1) & 3; } } diff --git a/src/object/whirlwind.c b/src/object/whirlwind.c index 7a843ab1..6017bbe7 100644 --- a/src/object/whirlwind.c +++ b/src/object/whirlwind.c @@ -34,7 +34,7 @@ void Whirlwind_Init(Entity* this) { this->hitbox = (Hitbox*)&gUnk_080FD320; this->flags |= ENT_COLLIDE; this->hitType = 1; - this->field_0x3c = 0x47; + this->collisionFlags = 0x47; this->hurtType = 0x44; this->flags2 = 0x80; this->spriteOrientation.flipY = 1; diff --git a/src/object/windTribeTeleporter.c b/src/object/windTribeTeleporter.c index 7dd0e600..c76a6190 100644 --- a/src/object/windTribeTeleporter.c +++ b/src/object/windTribeTeleporter.c @@ -75,19 +75,19 @@ void WindTribeTeleporter_Action1(WindTribeTeleporterEntity* this) { void WindTribeTeleporter_Action2(WindTribeTeleporterEntity* this) { switch (super->subAction) { case 0: - super->actionDelay = 0x1e; + super->timer = 0x1e; super->subAction++; break; case 1: - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->subAction++; - super->actionDelay = 0x1e; + super->timer = 0x1e; } break; case 2: - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->subAction++; - super->actionDelay = 0x1e; + super->timer = 0x1e; SoundReq(SFX_113); } else { if ((gRoomTransition.frameCount & 7) == 0) { @@ -96,9 +96,9 @@ void WindTribeTeleporter_Action2(WindTribeTeleporterEntity* this) { } break; case 3: - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->subAction++; - super->actionDelay = 0x1e; + super->timer = 0x1e; } else { if ((gRoomTransition.frameCount & 3) == 0) { gPlayerEntity.animationState = (gPlayerEntity.animationState + 2) & 6; @@ -106,7 +106,7 @@ void WindTribeTeleporter_Action2(WindTribeTeleporterEntity* this) { } break; default: - if (--super->actionDelay == 0) { + if (--super->timer == 0) { #if defined(DEMO_JP) || defined(JP) || defined(EU) #ifdef DEMO_JP SetLocalFlag(0xfc); @@ -131,23 +131,23 @@ void WindTribeTeleporter_Action3(WindTribeTeleporterEntity* this) { switch (super->subAction) { case 0: super->subAction = 1; - super->actionDelay = 0x1e; + super->timer = 0x1e; SoundReq(SFX_114); break; case 1: - if (--super->actionDelay != 0) { + if (--super->timer != 0) { if ((gRoomTransition.frameCount & 1) == 0) { gPlayerEntity.animationState = (gPlayerEntity.animationState + 2) & 6; } } else { super->subAction++; - super->actionDelay = 0x1e; + super->timer = 0x1e; } break; case 2: - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->subAction++; - super->actionDelay = 0x1e; + super->timer = 0x1e; } else { if ((gRoomTransition.frameCount & 3) == 0) { gPlayerEntity.animationState = (gPlayerEntity.animationState + 2) & 6; @@ -155,7 +155,7 @@ void WindTribeTeleporter_Action3(WindTribeTeleporterEntity* this) { } break; case 3: - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->subAction++; } else { if ((gRoomTransition.frameCount & 7) == 0) { |
