diff options
| author | notyourav <65437533+notyourav@users.noreply.github.com> | 2022-03-28 20:15:08 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-03-28 20:15:08 -0700 |
| commit | 6000b4f2d3bc4ef482496560e3a47b3ca2b7e2b8 (patch) | |
| tree | 78a3119e1cd63d4f3333a3cade6cc622cdcb6db1 /src/enemy/enemy64.c | |
| parent | 52439a0fc8cf34aeb4612b43cb7a0894add0ae57 (diff) | |
| parent | 92240d43147dd36ed879ce1084f7ca6e35f1db96 (diff) | |
Merge pull request #477 from notyourav/mas
Name rest of entity fields
Diffstat (limited to 'src/enemy/enemy64.c')
| -rw-r--r-- | src/enemy/enemy64.c | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/src/enemy/enemy64.c b/src/enemy/enemy64.c index 919a569b..9f3f242d 100644 --- a/src/enemy/enemy64.c +++ b/src/enemy/enemy64.c @@ -85,7 +85,7 @@ void Enemy64_Init(Enemy64Entity* this) { super->child = tail; super->action = 1; super->subAction = 0; - super->actionDelay = 0x3c; + super->timer = 0x3c; super->direction = 0xc0; super->animationState = 0xc0; super->speed = 0x300; @@ -107,8 +107,8 @@ void Enemy64_Action1(Enemy64Entity* this) { } void Enemy64_Action1_SubAction0(Enemy64Entity* this) { - if (super->actionDelay != 0) { - super->actionDelay--; + if (super->timer != 0) { + super->timer--; } else { sub_08049998(this, ((0x100 - super->direction) & 0xff) << 8); if ((gRoomControls.origin_x - 0x100) > super->x.HALF.HI) { @@ -193,8 +193,8 @@ void Enemy64_Action2_SubAction2(Enemy64Entity* this) { gRoomControls.origin_y + 0x80), ((((uVar3 + 2) & 0x1c) - (super->direction >> 3)) & 0xf) == 8)) { super->subAction = 4; - super->actionDelay = 0x3c; - super->field_0xf = 7; + super->timer = 0x3c; + super->subtimer = 7; } sub_08049944(this); sub_08047EA4(super, ((0x100 - super->direction) & 0xff) << 8); @@ -207,10 +207,10 @@ void Enemy64_Action2_SubAction3(Enemy64Entity* this) { iVar1 = this->unk_76 += this->unk_74; uVar2 = iVar1 * 0x10000; super->direction = (uVar2 >> 0x18); - if (super->actionDelay == 0) { + if (super->timer == 0) { if ((uVar2 >> 0x18 & 0x1f) == 0) { super->subAction = 4; - super->actionDelay = 0x5a; + super->timer = 0x5a; } } else { if (sub_08049A8C(this)) { @@ -228,15 +228,15 @@ void Enemy64_Action2_SubAction3(Enemy64Entity* this) { void Enemy64_Action2_SubAction4(Enemy64Entity* this) { sub_08049998(this, ((0x100 - super->direction) & 0xff) << 8); - if (--super->actionDelay == 0) { - if (--super->field_0xf == 0) { + if (--super->timer == 0) { + if (--super->subtimer == 0) { super->subAction = 5; super->speed += 0x40; } else { super->subAction = 3; - super->actionDelay = 0xa; + super->timer = 0xa; } - } else if (super->actionDelay == 0x50) { + } else if (super->timer == 0x50) { Entity* enemy = CreateEnemy(GYORG_MALE_EYE, Random() & 3); if (enemy != NULL) { enemy->parent = super; @@ -277,7 +277,7 @@ void Enemy64_Action3_SubAction0(Enemy64Entity* this) { void Enemy64_Action3_SubAction1(Enemy64Entity* this) { if (EntityWithinDistance(super, gRoomControls.origin_x + 0xa8, gRoomControls.origin_y + 0x80, 0x28)) { super->subAction = 2; - super->actionDelay = 0x2d; + super->timer = 0x2d; this->unk_74 = gUnk_080D29B8[Random() & 7] << 0x18 >> 0x18; this->unk_76 = super->direction << 8; } @@ -288,15 +288,15 @@ void Enemy64_Action3_SubAction2(Enemy64Entity* this) { this->unk_76 += this->unk_74; super->direction = this->unk_76 >> 8; sub_08049998(this, ((0x100 - super->direction) & 0xff) << 8); - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->subAction = 3; - super->actionDelay = 0x1e; + super->timer = 0x1e; } } void Enemy64_Action3_SubAction3(Enemy64Entity* this) { sub_08049998(this, ((0x100 - super->direction) & 0xff) << 8); - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = 2; super->subAction = 0; } @@ -312,7 +312,7 @@ void Enemy64_Action4_SubAction0(Enemy64Entity* this) { if (sub_08079F8C() && gPlayerEntity.z.HALF.HI == 0) { SetPlayerControl(CONTROL_2); super->subAction = 2; - super->actionDelay = 0x1e; + super->timer = 0x1e; } else { super->subAction = 1; } @@ -323,15 +323,15 @@ void Enemy64_Action4_SubAction1(Enemy64Entity* this) { if (sub_08079F8C() && gPlayerEntity.z.HALF.HI == 0) { SetPlayerControl(CONTROL_2); super->subAction = 2; - super->actionDelay = 1; + super->timer = 1; } sub_08049944(this); } void Enemy64_Action4_SubAction2(Enemy64Entity* this) { - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->subAction = 3; - super->actionDelay = 0xb4; + super->timer = 0xb4; super->speed = 0x100; super->direction -= 0x40; } @@ -340,8 +340,8 @@ void Enemy64_Action4_SubAction2(Enemy64Entity* this) { void Enemy64_Action4_SubAction3(Enemy64Entity* this) { sub_08049AB0(this); - if (--super->actionDelay == 0) { - super->actionDelay = 0x1e; + if (--super->timer == 0) { + super->timer = 0x1e; super->subAction = 4; super->speed = 0x400; super->direction = super->animationState; @@ -356,7 +356,7 @@ void Enemy64_Action4_SubAction3(Enemy64Entity* this) { void Enemy64_Action4_SubAction4(Enemy64Entity* this) { sub_08049AB0(this); sub_08049998(this, ((0x100 - super->direction) & 0xff) << 8); - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->subAction = 5; SetFade(5, 0x10); } @@ -389,7 +389,7 @@ void Enemy64_Action4_SubAction5(Enemy64Entity* this) { void Enemy64_Action4_SubAction6(Enemy64Entity* this) { if (gFadeControl.active == 0) { super->subAction = 7; - super->actionDelay = 0xa0; + super->timer = 0xa0; SoundReq(SFX_SECRET); SetFlag(0x7c); SetPlayerControl(CONTROL_1); @@ -397,21 +397,21 @@ void Enemy64_Action4_SubAction6(Enemy64Entity* this) { } void Enemy64_Action4_SubAction7(Enemy64Entity* this) { - if (--super->actionDelay == 0) { + if (--super->timer == 0) { DeleteThisEntity(); - } else if (super->actionDelay == 0x10) { + } else if (super->timer == 0x10) { sub_0807B7D8(0x36, 0xca, 1); SetTile(0x4081, 0xca, 2); SoundReq(SFX_HEART_GET); - } else if (super->actionDelay == 0x18) { + } else if (super->timer == 0x18) { sub_0807B7D8(0x36, 0x8a, 1); SetTile(0x4081, 0x8a, 2); SoundReq(SFX_HEART_GET); - } else if (super->actionDelay == 0x20) { + } else if (super->timer == 0x20) { sub_0807B7D8(0x36, 0x4a, 1); SetTile(0x4081, 0x4a, 2); SoundReq(SFX_HEART_GET); - } else if (super->actionDelay == 0x28) { + } else if (super->timer == 0x28) { sub_0807B7D8(0x36, 10, 1); SetTile(0x4081, 10, 2); SoundReq(SFX_HEART_GET); @@ -460,7 +460,7 @@ void sub_080499F0(Enemy64Entity* this) { } bool32 sub_08049A8C(Enemy64Entity* this) { - if (--super->actionDelay == 0 && (Random() & 0xf) != 0) { + if (--super->timer == 0 && (Random() & 0xf) != 0) { return TRUE; } else { return FALSE; @@ -470,7 +470,7 @@ bool32 sub_08049A8C(Enemy64Entity* this) { void sub_08049AB0(Enemy64Entity* this) { u32 rand; - if ((++super->field_0xf & 0xf) == 0) { + if ((++super->subtimer & 0xf) == 0) { Entity* effect = CreateFx(super, FX_GIANT_EXPLOSION3, 0); if (effect != NULL) { rand = Random(); |
