Renamed Entity fields for knockback

SolidifiedGaming identified these while glitchhunting.
This commit is contained in:
Ibot02
2021-10-25 13:32:54 +02:00
parent 9bca0fe57f
commit 59076fccb7
33 changed files with 87 additions and 87 deletions
+6 -6
View File
@@ -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;
+1 -1
View File
@@ -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);
}
+3 -3
View File
@@ -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;
}
+2 -2
View File
@@ -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;
+5 -5
View File
@@ -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?
+1 -1
View File
@@ -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;
+1 -1
View File
@@ -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) {
+1 -1
View File
@@ -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];
+1 -1
View File
@@ -24,7 +24,7 @@ void sub_0803CCD4(Entity* this) {
}
void sub_0803CCEC(Entity* this) {
this->field_0x42 = 0;
this->knockbackDuration = 0;
sub_0803CCD4(this);
}
+1 -1
View File
@@ -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;
+1 -1
View File
@@ -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);
+1 -1
View File
@@ -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);
+3 -3
View File
@@ -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
}
+4 -4
View File
@@ -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);
}
+3 -3
View File
@@ -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;
}
}
+2 -2
View File
@@ -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);
+1 -1
View File
@@ -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 {
+3 -3
View File
@@ -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);