diff --git a/include/entity.h b/include/entity.h index 2109a212..70e84d38 100644 --- a/include/entity.h +++ b/include/entity.h @@ -109,11 +109,11 @@ typedef struct Entity { /*0x3b*/ u8 flags2; /*0x3c*/ u8 field_0x3c; /*0x3d*/ s8 iframes; - /*0x3e*/ u8 field_0x3e; + /*0x3e*/ u8 knockbackDirection; /*0x3f*/ u8 damageType; /*0x40*/ u8 field_0x40; /*0x41*/ u8 bitfield; - /*0x42*/ u8 field_0x42; + /*0x42*/ u8 knockbackDuration; /*0x43*/ u8 field_0x43; /*0x44*/ u8 field_0x44; /*0x45*/ u8 currentHealth; diff --git a/src/enemy/acroBandits.c b/src/enemy/acroBandits.c index e506a605..5edc7d1d 100644 --- a/src/enemy/acroBandits.c +++ b/src/enemy/acroBandits.c @@ -52,7 +52,7 @@ void sub_080318DC(Entity* this) { if (this->bitfield != 0x80 && this->bitfield != 0x81) { if (this->type == 1) { - if (this->action < 7 && this->field_0x42) { + if (this->action < 7 && this->knockbackDuration != 0) { brother = this->attachedEntity; if (brother) { brother->parent = this->parent; @@ -72,7 +72,7 @@ void sub_080318DC(Entity* this) { this->action = 9; this->spritePriority.b1 = 1; - if (this->field_0x3e < 0x10) { + if (this->knockbackDirection < 0x10) { this->spriteSettings.b.flipX = 0; } else { this->spriteSettings.b.flipX = 1; @@ -81,19 +81,19 @@ void sub_080318DC(Entity* this) { } if (this->currentHealth == 0) { - this->field_0x3e = ((this->field_0x3e + (7 & Random())) - 4) & 0x1f; - this->field_0x42 += this->type2 * 3; + this->knockbackDirection = ((this->knockbackDirection + (7 & Random())) - 4) & 0x1f; + this->knockbackDuration += this->type2 * 3; sub_08032338(this); } } - if (this->field_0x42 && this->frames.all & 0x10) { + if (this->knockbackDuration != 0 && this->frames.all & 0x10) { if (this->type == 0) { this->action = 8; } else { this->action = 9; } - if (this->field_0x3e < 0x10) { + if (this->knockbackDirection < 0x10) { this->spriteSettings.b.flipX = 0; } else { this->spriteSettings.b.flipX = 1; diff --git a/src/enemy/beetle.c b/src/enemy/beetle.c index 8ce4858b..09224225 100644 --- a/src/enemy/beetle.c +++ b/src/enemy/beetle.c @@ -48,7 +48,7 @@ void sub_08021780(Entity* this) { } if (this->currentHealth == 0) - this->field_0x42 = 0; + this->knockbackDuration = 0; sub_0804AA30(this, gUnk_080CB590); } diff --git a/src/enemy/bobomb.c b/src/enemy/bobomb.c index 77bf64da..3d107aa3 100644 --- a/src/enemy/bobomb.c +++ b/src/enemy/bobomb.c @@ -30,8 +30,8 @@ void sub_0802C688(Entity* this) { case 0: case 1: if (this->field_0x82.HALF.LO) { - this->field_0x42 = 0; - gPlayerEntity.field_0x42 = 4; + this->knockbackDuration = 0; + gPlayerEntity.knockbackDuration = 4; } return; case 0xe: @@ -39,7 +39,7 @@ void sub_0802C688(Entity* this) { case 0x15: case 0x16: this->action = 3; - this->field_0x42 = 0; + this->knockbackDuration = 0; sub_0802CBC4(this); return; } diff --git a/src/enemy/darkNut.c b/src/enemy/darkNut.c index 4ede2e2d..d28e3b15 100644 --- a/src/enemy/darkNut.c +++ b/src/enemy/darkNut.c @@ -64,7 +64,7 @@ void sub_08020BB8(Entity* this) { this->action = 11; this->actionDelay = gUnk_080CAB0C[this->type]; this->damageType = 81; - sub_08021218(this, 8, DirectionToAnimationState(this->field_0x3e ^ 0x10)); + sub_08021218(this, 8, DirectionToAnimationState(this->knockbackDirection ^ 0x10)); sub_08021588(this); sub_0804A9FC(this, 0x1c); break; @@ -72,7 +72,7 @@ void sub_08020BB8(Entity* this) { this->action = 11; this->actionDelay = gUnk_080CAB10[this->type]; this->damageType = 81; - sub_08021218(this, 8, DirectionToAnimationState(this->field_0x3e ^ 0x10)); + sub_08021218(this, 8, DirectionToAnimationState(this->knockbackDirection ^ 0x10)); sub_08021588(this); sub_0804A9FC(this, 0x1c); break; diff --git a/src/enemy/gibdo.c b/src/enemy/gibdo.c index 7f6d04e6..923ebbdc 100644 --- a/src/enemy/gibdo.c +++ b/src/enemy/gibdo.c @@ -58,7 +58,7 @@ NONMATCH("asm/non_matching/gibdo/sub_080374A4.inc", void sub_080374A4(Entity* th } else { if ((u8)(this->action - 1) < 2) { this->action = 1; - x = DirectionTurnAround(this->field_0x3e); + x = DirectionTurnAround(this->knockbackDirection); this->direction = x; this->animationState = x >> 3; InitAnimationForceUpdate(this, this->animationState); @@ -342,8 +342,8 @@ void sub_08037A58(Entity* this) { this->damageType = 0x26; this->flags2 |= 1; this->iframes = 0xf4; - this->field_0x3e = (this->animationState << 3) ^ 0x10; - this->field_0x42 = 8; + this->knockbackDirection = DirectionFromAnimationState(this->animationState) ^ 0x10; + this->knockbackDuration = 8; this->field_0x46 = 0x180; this->field_0x76.HALF.LO = 0x3c; InitAnimationForceUpdate(this, this->animationState + 0x10); @@ -353,8 +353,8 @@ void sub_08037ACC(Entity* this) { gPlayerState.flags.all &= 0xFFFFFEFF; gPlayerEntity.flags |= 0x80; gPlayerEntity.iframes = 0x1e; - gPlayerEntity.field_0x3e = DirectionFromAnimationState(this->animationState); - gPlayerEntity.field_0x42 = 4; + gPlayerEntity.knockbackDirection = DirectionFromAnimationState(this->animationState); + gPlayerEntity.knockbackDuration = 4; gPlayerEntity.field_0x46 = 0x180; } // Damage player maybe? diff --git a/src/enemy/helmasaur.c b/src/enemy/helmasaur.c index 169f9db2..2385b12e 100644 --- a/src/enemy/helmasaur.c +++ b/src/enemy/helmasaur.c @@ -48,7 +48,7 @@ void sub_0802BBC4(Entity* this) { case 2: case 3: if (this->action == 4) { - this->field_0x42 = 0; + this->knockbackDuration = 0; sub_0802C218(this); } break; diff --git a/src/enemy/keaton.c b/src/enemy/keaton.c index df748792..1ed5af8e 100644 --- a/src/enemy/keaton.c +++ b/src/enemy/keaton.c @@ -39,7 +39,7 @@ void sub_080323F4(Entity* this) { if (this->action != 3 && this->action != 4) { this->action = 3; this->actionDelay = 0xC; - this->direction = DirectionTurnAround(this->field_0x3e); + this->direction = DirectionTurnAround(this->knockbackDirection); InitAnimationForceUpdate(this, this->direction >> 3); } else if (this->bitfield == 0xCC) { if (this->field_0x43 == 0) { diff --git a/src/enemy/lakitu.c b/src/enemy/lakitu.c index d97bec40..cbbab57f 100644 --- a/src/enemy/lakitu.c +++ b/src/enemy/lakitu.c @@ -64,7 +64,7 @@ void sub_0803C784(Entity* this) { Entity* fx = CreateFx(this, 2, 0); if (fx != NULL) { - u32 angle = (this->field_0x3e ^ 0x10) << 3; + u32 angle = (this->knockbackDirection ^ 0x10) << 3; s32 sine; sine = gSineTable[angle]; diff --git a/src/enemy/lakituCloud.c b/src/enemy/lakituCloud.c index 5ce140c5..df0c0cca 100644 --- a/src/enemy/lakituCloud.c +++ b/src/enemy/lakituCloud.c @@ -24,7 +24,7 @@ void sub_0803CCD4(Entity* this) { } void sub_0803CCEC(Entity* this) { - this->field_0x42 = 0; + this->knockbackDuration = 0; sub_0803CCD4(this); } diff --git a/src/enemy/moldorm.c b/src/enemy/moldorm.c index 2fc1f67f..1ee92567 100644 --- a/src/enemy/moldorm.c +++ b/src/enemy/moldorm.c @@ -36,7 +36,7 @@ void sub_08022BEC(Entity* this) { this->field_0x7a.HALF.LO = this->currentHealth; this->actionDelay = 1; - this->direction = this->field_0x3e; + this->direction = this->knockbackDirection; this->animationState = ((this->direction + 2) & 0x1c) >> 2; this->frameIndex = this->animationState; diff --git a/src/enemy/peahat.c b/src/enemy/peahat.c index adcbea9d..597ab1da 100644 --- a/src/enemy/peahat.c +++ b/src/enemy/peahat.c @@ -234,7 +234,7 @@ void Peahat_Stunned(Entity* this) { } if (this->direction == 0xff) - this->direction = this->field_0x3e; + this->direction = this->knockbackDirection; ProcessMovement(this); GetNextFrame(this); diff --git a/src/enemy/puffstool.c b/src/enemy/puffstool.c index c3b02ae4..69df19d6 100644 --- a/src/enemy/puffstool.c +++ b/src/enemy/puffstool.c @@ -75,7 +75,7 @@ void sub_08025020(Entity* this) { this->field_0x20 = 0; } this->iframes = -0xc; - this->field_0x42 = 0; + this->knockbackDuration = 0; if (this->field_0x80.HALF.LO == 0) { this->animationState = (*(Entity**)&this->field_0x4c)->direction >> 3; InitializeAnimation(this, this->animationState + 4); diff --git a/src/enemy/rockChuchu.c b/src/enemy/rockChuchu.c index c7b0dbe1..9e3ad499 100644 --- a/src/enemy/rockChuchu.c +++ b/src/enemy/rockChuchu.c @@ -51,7 +51,7 @@ void sub_08022254(Entity* this) { this->action = 2; this->flags &= ~0x80; this->spriteSettings.b.draw = 0; - this->direction = this->field_0x3e; + this->direction = this->knockbackDirection; this->attachedEntity = ent; } } @@ -101,8 +101,8 @@ void sub_080223E4(Entity* this) { ent->bitfield = 0x94; ent->iframes = 0x10; #ifndef EU - ent->field_0x42 = 0xc; - ent->field_0x3e = this->direction; + ent->knockbackDuration = 0xc; + ent->knockbackDirection = this->direction; #endif } diff --git a/src/enemy/rollobite.c b/src/enemy/rollobite.c index 0e6ee1bb..d8774285 100644 --- a/src/enemy/rollobite.c +++ b/src/enemy/rollobite.c @@ -54,11 +54,11 @@ void sub_08020668(Entity* this) { void sub_080206E0(Entity* this) { if (Rollobite_TryToHoleUp(this)) { - this->field_0x42 = 0; + this->knockbackDuration = 0; } else if (Rollobite_IsRolledUp(this)) { - this->field_0x42--; - sub_080AE58C(this, this->field_0x3e, 10); - sub_080AE7E8(this, this->field_0x46, this->field_0x3e, 10); + this->knockbackDuration--; + sub_080AE58C(this, this->knockbackDirection, 10); + sub_080AE7E8(this, this->field_0x46, this->knockbackDirection, 10); } else { sub_08001324(this); } diff --git a/src/enemy/spearMoblin.c b/src/enemy/spearMoblin.c index 68f52f04..a66fe5b3 100644 --- a/src/enemy/spearMoblin.c +++ b/src/enemy/spearMoblin.c @@ -379,11 +379,11 @@ bool32 sub_080288A4(Entity* this) { void sub_080288C0(Entity* this) { Entity* ent = this->attachedEntity; if (ent && (ent->bitfield & 0x80)) { - this->field_0x3e = ent->field_0x3e; + this->knockbackDirection = ent->knockbackDirection; this->iframes = -ent->iframes; this->field_0x46 = ent->field_0x46; - this->field_0x42 = ent->field_0x42; - ent->field_0x42 = 0; + this->knockbackDuration = ent->knockbackDuration; + ent->knockbackDuration = 0; } } diff --git a/src/enemy/spikedBeetle.c b/src/enemy/spikedBeetle.c index 46c87653..4c458a14 100644 --- a/src/enemy/spikedBeetle.c +++ b/src/enemy/spikedBeetle.c @@ -51,8 +51,8 @@ void sub_0802B628(Entity* this) { this->action = 6; this->field_0x20 = 0x18000; this->speed = 0xc0; - this->direction = this->field_0x3e; - this->field_0x42 = 0; + this->direction = this->knockbackDirection; + this->knockbackDuration = 0; this->iframes = -8; this->damageType = 100; InitializeAnimation(this, 9); diff --git a/src/enemy/vaatiTransfigured.c b/src/enemy/vaatiTransfigured.c index 399f511b..9efa55e8 100644 --- a/src/enemy/vaatiTransfigured.c +++ b/src/enemy/vaatiTransfigured.c @@ -1068,7 +1068,7 @@ void sub_080409B0(Entity* this) { } if (this->field_0x80.HALF.HI < 3) { - if (this->field_0x42 != 0) { + if (this->knockbackDuration != 0) { sub_080AF18C(this); } } else { diff --git a/src/enemy/wallMaster.c b/src/enemy/wallMaster.c index 663c3612..9a3ae8d2 100644 --- a/src/enemy/wallMaster.c +++ b/src/enemy/wallMaster.c @@ -37,9 +37,9 @@ void sub_0802A454(Entity* this) { } } - if (this->field_0x42) - if (this->field_0x42 > 4) - this->field_0x42 -= 4; + if (this->knockbackDuration != 0) + if (this->knockbackDuration > 4) + this->knockbackDuration -= 4; if (this->field_0x43 != 0) { sub_0804A9FC(this, 0x1c); diff --git a/src/entity.c b/src/entity.c index 60e571ff..cd9361f4 100644 --- a/src/entity.c +++ b/src/entity.c @@ -102,7 +102,7 @@ void DeleteEntity(Entity* ent) { ent->spriteSettings.b.draw = 0; ent->field_0x3c = 0; ent->bitfield = 0; - ent->field_0x42 = 0; + ent->knockbackDuration = 0; ent->currentHealth = 0; UnlinkEntity(ent); ent->next = NULL; diff --git a/src/npc/guard.c b/src/npc/guard.c index 7e9b0034..0f6470ad 100644 --- a/src/npc/guard.c +++ b/src/npc/guard.c @@ -85,8 +85,8 @@ void sub_08063DC8(Entity* this) { InitAnimationForceUpdate(this, this->animationState + 4); } else { sub_0806EE20(this); - if (this->field_0x3e != this->animationState) { - this->animationState = this->field_0x3e; + if (this->knockbackDirection != this->animationState) { + this->animationState = this->knockbackDirection; InitializeAnimation(this, this->animationState + 4); } else { GetNextFrame(this); diff --git a/src/npc/postman.c b/src/npc/postman.c index 40a482e4..c0708c12 100644 --- a/src/npc/postman.c +++ b/src/npc/postman.c @@ -67,7 +67,7 @@ void sub_0806045C(Entity* this) { TextboxNoOverlapFollow(0); break; default: - bVar1 = this->field_0x3e; + bVar1 = this->knockbackDirection; if (bVar1 != this->animationState) { this->animationState = bVar1; InitAnimationForceUpdate(this, 4 + bVar1); diff --git a/src/object/bakerOven.c b/src/object/bakerOven.c index f9de2600..13cb6627 100644 --- a/src/object/bakerOven.c +++ b/src/object/bakerOven.c @@ -66,8 +66,8 @@ void sub_0809CD0C(Entity* this) { ModHealth(-2); sub_0800449C(&gPlayerEntity, 0x7a); gPlayerEntity.iframes = 16; - gPlayerEntity.field_0x3e = 16; - gPlayerEntity.field_0x42 = 12; + gPlayerEntity.knockbackDirection = 16; + gPlayerEntity.knockbackDuration = 12; gPlayerEntity.field_0x46 = 16; } } diff --git a/src/player.c b/src/player.c index 1d7be0a7..92ddc33d 100644 --- a/src/player.c +++ b/src/player.c @@ -199,7 +199,7 @@ void sub_08070D38(Entity* this) { this->flags &= ~0x80; this->direction = ((this->animationState & 0xe) << 2) ^ 0x10; this->speed = 0x100; - this->field_0x42 = 0; + this->knockbackDuration = 0; this->subAction++; this->actionDelay = gPlayerState.field_0x38; this->spriteIndex = 1; @@ -366,7 +366,7 @@ void sub_08071038(Entity* this) { if (this->frames.all & 0x80) { this->attachedEntity = 0; - this->field_0x42 = 0; + this->knockbackDuration = 0; this->iframes = 248; gPlayerState.jumpStatus = 0; sub_080791D0(); @@ -465,7 +465,7 @@ void sub_08071130(Entity* this) { this->subAction++; sub_08078F60(); - this->field_0x42 = 0; + this->knockbackDuration = 0; SoundReq(SFX_PLY_LAND); } @@ -531,7 +531,7 @@ void sub_080712F0(Entity* this) { if (temp == FALSE) return; - this->field_0x42 = 0; + this->knockbackDuration = 0; this->iframes = 32; this->spritePriority.b1 = 1; this->spriteSettings.b.draw = FALSE; @@ -568,7 +568,7 @@ void PortalJumpOnUpdate(Entity* this) { u16 y; this->flags &= ~0x80; - this->field_0x42 = 0; + this->knockbackDuration = 0; x = gArea.curPortalX; y = gArea.curPortalY; @@ -887,7 +887,7 @@ void sub_08071B60(Entity* this) { gPlayerState.pushedObject = 2; gPlayerState.flags.all &= ~0x1; this->type = 0; - this->field_0x42 = 0; + this->knockbackDuration = 0; sub_080728AC(this); this->field_0xf = 6; if ((gPlayerState.flags.all & 0x80) == 0) { @@ -1139,7 +1139,7 @@ void sub_08071F80(Entity* this) { void sub_08072008(Entity* this) { this->iframes = 160; - this->field_0x42 = 0; + this->knockbackDuration = 0; this->flags |= 0x80; this->spriteOffsetX = 0; gPlayerState.flags.all &= ~(0x800 | 0x1); @@ -1216,7 +1216,7 @@ void sub_08072168(Entity* this) { gPlayerState.field_0xd = this->direction; sub_08019840(); if (--this->actionDelay == 0xff) { - this->field_0x42 = 0; + this->knockbackDuration = 0; this->flags |= 0x80; UpdateSpriteForCollisionLayer(this); sub_080791BC(); @@ -1256,7 +1256,7 @@ void sub_08072260(Entity* this) { } else { gPlayerState.field_0x8 = 0x944; } - this->field_0x42 = 0; + this->knockbackDuration = 0; sub_080791BC(); } } @@ -1283,7 +1283,7 @@ void sub_080722DC(Entity* this) { } else { this->spriteSettings.b.draw = 0; this->subAction = 3; - this->field_0x42 = 10; + this->knockbackDuration = 10; } gPlayerState.flags.all |= (0x400 | 0x1); ResetPlayer(); @@ -1299,7 +1299,7 @@ void sub_08072354(Entity* this) { return; this->spritePriority.b1 = 0; - this->field_0x42 = 0; + this->knockbackDuration = 0; this->subAction = 2; this->actionDelay = 0x3c; gPlayerState.field_0x8 = 0x2c1; @@ -1320,7 +1320,7 @@ void sub_080723D0(Entity* this) { } void sub_0807240C(Entity* this) { - if (--this->field_0x42 == 0xff) { + if (--this->knockbackDuration == 0xff) { this->spriteSettings.b.draw = 3; this->iframes = 0x14; gPlayerState.flags.all &= ~0x400; @@ -1360,7 +1360,7 @@ void PlayerRoomTransition(Entity* this) { } void sub_080724DC(Entity* this) { - this->field_0x42 = 0; + this->knockbackDuration = 0; sub_0807A108(); if (sub_080002B8(this) != 0x29) { if ((gPlayerState.field_0x82[7] == 0) && (gPlayerState.swimState != 0)) { @@ -1794,7 +1794,7 @@ NONMATCH("asm/non_matching/player/sub_08072D54.inc", void sub_08072D54(Entity* t } this->actionDelay = 6; this->subAction = 3; - this->field_0x42 = 0; + this->knockbackDuration = 0; SoundReq(0x7d); } } @@ -1816,9 +1816,9 @@ void sub_08072F34(Entity* this) { gPlayerState.field_0xa8 = 0x18; gPlayerState.field_0x10[2] = sub_0807A1E8(this, 0, 0); gUnk_0811BBE4[this->subAction](this); - if (this->field_0x42 != 0) { + if (this->knockbackDuration != 0) { sub_080792D8(); - if (this->field_0x42 == 0) { + if (this->knockbackDuration == 0) { this->action = 0x1d; this->subAction = 0; this->y.HALF.LO = 0; @@ -1897,7 +1897,7 @@ void sub_08073094(Entity* this) { switch (gPlayerState.field_0x10[2]) { case 0x2a: case 0x2c: - this->field_0x42 = 0; + this->knockbackDuration = 0; gPlayerState.flags.all |= 0x20000000; UpdateAnimationSingleFrame(this); if ((this->frames.all & 0x40) != 0) { diff --git a/src/projectile/arrowProjectile.c b/src/projectile/arrowProjectile.c index 48db32b3..d2f4f45e 100644 --- a/src/projectile/arrowProjectile.c +++ b/src/projectile/arrowProjectile.c @@ -34,7 +34,7 @@ void sub_080A9334(Entity* this) { if ((this->bitfield & 0x3f) != 0) { ModHealth(-2); sub_080A9488(this); - this->field_0x42 = 0; + this->knockbackDuration = 0; this->iframes = 0; } else { DeleteThisEntity(); @@ -107,7 +107,7 @@ void sub_080A9488(Entity* this) { this->flags &= 0x7f; this->actionDelay = 2; this->field_0x20 = 0x18000; - this->animationState = (this->field_0x3e & 0x18) >> 3; + this->animationState = (this->knockbackDirection & 0x18) >> 3; EnqueueSFX(SFX_METAL_CLINK); sub_080A94C0(this, this->animationState); } diff --git a/src/projectile/cannonballProjectile.c b/src/projectile/cannonballProjectile.c index 950b6159..8c6e7da4 100644 --- a/src/projectile/cannonballProjectile.c +++ b/src/projectile/cannonballProjectile.c @@ -27,7 +27,7 @@ void sub_080AB544(Entity* this) { if (this->iframes < -4) { this->action = 2; - this->direction = this->field_0x3e; + this->direction = this->knockbackDirection; tmp = (this->type ^ 2) << 3; if (this->direction - tmp + 1 < 3) { this->direction = tmp; diff --git a/src/projectile/dekuSeedProjectile.c b/src/projectile/dekuSeedProjectile.c index e17caa58..40c51e69 100644 --- a/src/projectile/dekuSeedProjectile.c +++ b/src/projectile/dekuSeedProjectile.c @@ -30,7 +30,7 @@ void sub_080A8470(Entity* this) { } DeleteEntity(this); } else { - this->direction = (this->field_0x3e + 4) & 0x18; + this->direction = DirectionRoundUp(this->knockbackDirection); if ((u8)(this->bitfield + 0x7e) < 2) { sub_080A8680(this); } else { @@ -74,14 +74,14 @@ void DekuSeedProjectile_Action1(Entity* this) { parent = this->parent; if ((parent->next != NULL) && (sub_080177A0(this, parent) != 0)) { this->iframes = 0x10; - this->field_0x3e = -this->direction; + this->knockbackDirection = -this->direction; this->bitfield = -0x80; - this->field_0x42 = 0xc; + this->knockbackDuration = 0xc; this->field_0x46 = 0; parent->iframes = 0x10; - parent->field_0x3e = this->direction; + parent->knockbackDirection = this->direction; parent->bitfield = -0x3e; - parent->field_0x42 = 0xc; + parent->knockbackDuration = 0xc; parent->field_0x46 = 0; } } diff --git a/src/projectile/guardLineOfSight.c b/src/projectile/guardLineOfSight.c index 9cbe3a22..2fff5c06 100644 --- a/src/projectile/guardLineOfSight.c +++ b/src/projectile/guardLineOfSight.c @@ -35,7 +35,7 @@ void GuardLineOfSight(Entity* this) { entity = CreateProjectile(0xc); if (entity != NULL) { entity->type = 1; - tmp = this->parent->field_0x3e; + tmp = this->parent->knockbackDirection; entity->direction = (gUnk_081299C8[(this->actionDelay >> 2 & 7)] + (tmp << 3)) & 0x1f; entity->parent = this->parent; CopyPosition(this, entity); diff --git a/src/projectile/mandiblesProjectile.c b/src/projectile/mandiblesProjectile.c index 0ab5c3ad..1bcfd7cf 100644 --- a/src/projectile/mandiblesProjectile.c +++ b/src/projectile/mandiblesProjectile.c @@ -66,14 +66,14 @@ void sub_080A9EBC(Entity* this) { default: parent = this->parent; parent->iframes = this->iframes; - parent->field_0x3e = this->field_0x3e; - parent->field_0x42 = this->field_0x42; + parent->knockbackDirection = this->knockbackDirection; + parent->knockbackDuration = this->knockbackDuration; if (this->action == 1) { sub_080AA320(this); } break; } - this->field_0x42 = 0; + this->knockbackDuration = 0; } } diff --git a/src/projectile/moblinSpear.c b/src/projectile/moblinSpear.c index a4123e20..c24e3480 100644 --- a/src/projectile/moblinSpear.c +++ b/src/projectile/moblinSpear.c @@ -27,7 +27,7 @@ void sub_080A832C(Entity* this) { if (this->bitfield == 0x80) { this->iframes = 0x10; - this->field_0x42 = 0xc; + this->knockbackDuration = 0xc; this->field_0x46 = 0x180; this->parent->bitfield = this->bitfield; } @@ -37,10 +37,10 @@ void sub_080A832C(Entity* this) { } else { this->parent->iframes = -tmp; } - this->parent->field_0x42 = this->field_0x42; + this->parent->knockbackDuration = this->knockbackDuration; this->parent->field_0x46 = this->field_0x46; - this->parent->field_0x3e = this->field_0x3e; - this->field_0x42 = 0; + this->parent->knockbackDirection = this->knockbackDirection; + this->knockbackDuration = 0; } void MoblinSpear_Init(Entity* this) { diff --git a/src/projectile/octorokBossProjectile.c b/src/projectile/octorokBossProjectile.c index e927283e..5d41b4f1 100644 --- a/src/projectile/octorokBossProjectile.c +++ b/src/projectile/octorokBossProjectile.c @@ -84,7 +84,7 @@ void OctorokBossProjectile_Action1(Entity* this) { if ((this->bitfield & 0x7f) == 0) { OctorokBossProjectile_Action2(this); } - this->direction = this->field_0x3e << 3; + this->direction = this->knockbackDirection << 3; this->speed = 0x400; this->type2 = 1; this->actionDelay = 0; @@ -98,9 +98,9 @@ void OctorokBossProjectile_Action1(Entity* this) { this->parent->currentHealth -= 1; this->parent->iframes = 0x1e; if (this->parent->field_0x7c.BYTES.byte0 != 0) { - this->parent->field_0x42 = 0x18; + this->parent->knockbackDuration = 0x18; this->parent->field_0x46 = 0x200; - this->parent->field_0x3e = this->direction >> 3; + this->parent->knockbackDirection = this->direction >> 3; } SoundReq(SFX_BOSS_HIT); OctorokBossProjectile_Action2(this); diff --git a/src/projectile/rockProjectile.c b/src/projectile/rockProjectile.c index e9e47b2c..265a1e5b 100644 --- a/src/projectile/rockProjectile.c +++ b/src/projectile/rockProjectile.c @@ -23,7 +23,7 @@ void sub_080A8064(Entity* this) { if (this->bitfield == 0x80) { DeleteEntity(this); } else { - this->direction = this->field_0x3e; + this->direction = this->knockbackDirection; sub_080A8178(this); } } diff --git a/src/projectile/v1DarkMagicProjectile.c b/src/projectile/v1DarkMagicProjectile.c index baa70ecb..dc9c97c3 100644 --- a/src/projectile/v1DarkMagicProjectile.c +++ b/src/projectile/v1DarkMagicProjectile.c @@ -49,8 +49,8 @@ void sub_080AAC44(Entity* this) { CopyPosition(this->parent, this); } } - if (this->field_0x42 != 0) { - this->field_0x42 = 0; + if (this->knockbackDuration != 0) { + this->knockbackDuration = 0; } }