mirror of
https://github.com/zeldaret/tmc
synced 2026-08-20 14:15:10 -04:00
cleanup
This commit is contained in:
@@ -81,7 +81,7 @@ void sub_080318DC(Entity* this) {
|
||||
}
|
||||
|
||||
if (this->health == 0) {
|
||||
this->knockbackDirection = ((this->knockbackDirection + (7 & Random())) - 4) & 0x1f;
|
||||
this->knockbackDirection = DirectionNormalize((this->knockbackDirection + (7 & Random())) - 4);
|
||||
this->knockbackDuration += this->type2 * 3;
|
||||
sub_08032338(this);
|
||||
}
|
||||
|
||||
+1
-1
@@ -150,7 +150,7 @@ void sub_08021984(Entity* this) {
|
||||
|
||||
void sub_08021A10(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if (sub_080041A0(this, &gPlayerEntity, 120, 80) && sub_08021D00(this) == 0) {
|
||||
if (EntityInRectRadius(this, &gPlayerEntity, 120, 80) && sub_08021D00(this) == 0) {
|
||||
if (--this->actionDelay == 0) {
|
||||
this->action = 3;
|
||||
this->actionDelay = (Random() & 0x3f) + 30;
|
||||
|
||||
@@ -210,7 +210,7 @@ void sub_08028BC4(Entity* this) {
|
||||
if (iVar1 != NULL) {
|
||||
iVar1->spritePriority.b0 = 3;
|
||||
iVar1->z.HALF.HI -= 12;
|
||||
SetDefaultPriority(iVar1, 2);
|
||||
SetDefaultPriority(iVar1, PRIO_MESSAGE);
|
||||
}
|
||||
SetFlag(this->field_0x86.HWORD);
|
||||
sub_0802925C(this);
|
||||
@@ -390,14 +390,14 @@ void sub_08028F0C(Entity* this) {
|
||||
|
||||
bool32 sub_08028F98(Entity* this, u32 param_2) {
|
||||
Entity* ent = sub_08049DF4(1);
|
||||
if (ent == NULL || sub_080041A0(this, ent, 0x28, 0x28)) {
|
||||
if (ent == NULL || EntityInRectRadius(this, ent, 0x28, 0x28)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (param_2 != 2) {
|
||||
u32 distance = param_2 ? 0x58 : 0x50;
|
||||
|
||||
if (!sub_080041A0(this, ent, distance, distance)) {
|
||||
if (!EntityInRectRadius(this, ent, distance, distance)) {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ u32 sub_08022B20(Entity* this) {
|
||||
if (!sub_08049DF4(2))
|
||||
return 0;
|
||||
|
||||
return sub_080041A0(this, &gPlayerEntity, 0x24, 0x24);
|
||||
return EntityInRectRadius(this, &gPlayerEntity, 36, 36);
|
||||
}
|
||||
|
||||
void sub_08022B44(Entity* this) {
|
||||
|
||||
+2
-2
@@ -180,7 +180,7 @@ void sub_08020E78(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_08020E98(Entity* this) {
|
||||
if (PlayerInRange(this, 1, 0x38)) {
|
||||
if (PlayerInRange(this, 1, 56)) {
|
||||
if (sub_0802169C(this, gUnk_020000B0)) {
|
||||
this->action = 8;
|
||||
sub_08021218(this, 7, this->animationState);
|
||||
@@ -190,7 +190,7 @@ void sub_08020E98(Entity* this) {
|
||||
this->action = 8;
|
||||
sub_08021218(this, 7, this->animationState);
|
||||
} else {
|
||||
this->direction ^= 0x10;
|
||||
this->direction = DirectionTurnAround(this->direction);
|
||||
sub_0802124C(this);
|
||||
sub_08021644(this);
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ void sub_08045454(Entity* this) {
|
||||
|
||||
/* Can we create enough new entities? */
|
||||
count = gUnk_080D180C[this->type];
|
||||
if (72 - count <= gEntCount)
|
||||
if (MAX_ENTITIES + 1 - count <= gEntCount)
|
||||
return;
|
||||
|
||||
/* Create 2-5 new MiniFireballGuy */
|
||||
|
||||
+1
-1
@@ -143,7 +143,7 @@ void sub_080325C4(Entity* this) {
|
||||
|
||||
u32 sub_080325E8(Entity* this) {
|
||||
if (((sub_08049FA0(this) != 0) && (sub_08049FDC(this, 1) != 0)) &&
|
||||
(sub_080041A0(this, gUnk_020000B0, 0x68, 0x40) != 0)) {
|
||||
(EntityInRectRadius(this, gUnk_020000B0, 0x68, 0x40) != 0)) {
|
||||
if (((GetFacingDirection(this, gUnk_020000B0) - (DirectionRound(this->frame)) + 2) & 0x1F) < 5) {
|
||||
this->action = 3;
|
||||
this->actionDelay = 0xC;
|
||||
|
||||
+1
-1
@@ -241,7 +241,7 @@ void Lakitu_Cloudless(Entity* this) {
|
||||
|
||||
bool32 sub_0803CA4C(Entity* this) {
|
||||
if (sub_0806FCB8(this, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x28) == 0) {
|
||||
if (sub_080041A0(this, &gPlayerEntity, 0x70, 0x50)) {
|
||||
if (EntityInRectRadius(this, &gPlayerEntity, 0x70, 0x50)) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ void sub_08027DA4(Entity* this) {
|
||||
|
||||
void sub_08027E40(Entity* this) {
|
||||
if (this->actionDelay == 2 && this->field_0x80.HALF.LO != 0xff) {
|
||||
SetDefaultPriority(this, 3);
|
||||
SetDefaultPriority(this, PRIO_NO_BLOCK);
|
||||
sub_08028224(this->field_0x80.HALF.LO);
|
||||
}
|
||||
sub_0804A7D4(this);
|
||||
|
||||
@@ -224,7 +224,7 @@ void sub_08033FFC(Entity* this) {
|
||||
if (((*(Entity**)&this->field_0x74)->flags & 0x80) != 0) {
|
||||
gRoomControls.cameraTarget = &gPlayerEntity;
|
||||
sub_08034420(this);
|
||||
gPlayerState.field_0x8b = 1;
|
||||
gPlayerState.controlMode = 1;
|
||||
sub_080791D0();
|
||||
SoundReq(BGM_BOSS_THEME);
|
||||
}
|
||||
|
||||
@@ -139,7 +139,7 @@ void sub_080231BC(Entity* this) {
|
||||
this->field_0x78.HWORD = 0x1e;
|
||||
this->palette.b.b0 = 5;
|
||||
this->direction = Random() & 0x1f;
|
||||
this->animationState = Direction8ToAnimationState(this->direction);
|
||||
this->animationState = Direction8ToAnimationState(Direction8RoundUp(this->direction));
|
||||
InitializeAnimation(this, this->animationState);
|
||||
}
|
||||
}
|
||||
@@ -225,7 +225,7 @@ void sub_08023398(Entity* this) {
|
||||
u32 uVar4;
|
||||
|
||||
sub_08004596(this, sub_08049F84(this, 1));
|
||||
uVar4 = Direction8ToAnimationState(this->direction);
|
||||
uVar4 = Direction8ToAnimationState(Direction8RoundUp(this->direction));
|
||||
if (uVar4 != this->animationState) {
|
||||
this->animationState = uVar4;
|
||||
InitializeAnimation(this, uVar4 + this->field_0x7a.HALF.HI);
|
||||
@@ -249,7 +249,7 @@ void sub_080234D8(Entity* this) {
|
||||
this->action = 2;
|
||||
this->palette.b.b0 = 5;
|
||||
this->direction = Random() & 0x1f;
|
||||
this->animationState = Direction8ToAnimationState(this->direction);
|
||||
this->animationState = Direction8ToAnimationState(Direction8RoundUp(this->direction));
|
||||
sub_08023A88(this, this->animationState);
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -403,7 +403,7 @@ void sub_080244E8(Entity* this) {
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (sub_080041A0(this, this->child, 6, 6)) {
|
||||
if (EntityInRectRadius(this, this->child, 6, 6)) {
|
||||
Entity* ent;
|
||||
|
||||
this->field_0x80.HALF.LO += 1;
|
||||
@@ -424,7 +424,7 @@ void sub_080244E8(Entity* this) {
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (sub_080041A0(this, this->child, 6, 6)) {
|
||||
if (EntityInRectRadius(this, this->child, 6, 6)) {
|
||||
Entity* ent;
|
||||
|
||||
this->field_0x80.HALF.LO += 1;
|
||||
|
||||
+1
-1
@@ -95,7 +95,7 @@ void sub_080450A8(Entity* this) {
|
||||
|
||||
/* Can we create enough new entities? */
|
||||
count = gUnk_080D16D0[this->type];
|
||||
if (72 - count <= gEntCount)
|
||||
if (MAX_ENTITIES + 1 - count <= gEntCount)
|
||||
return;
|
||||
|
||||
/* Create 2-4 new MiniSlime */
|
||||
|
||||
@@ -220,7 +220,7 @@ void VaatiWrathType0Action1(Entity* this) {
|
||||
this->actionDelay = 0x1e;
|
||||
gScreenTransition.field_0x38 |= 1;
|
||||
gRoomControls.cameraTarget = &gPlayerEntity;
|
||||
gPlayerState.field_0x8b = 1;
|
||||
gPlayerState.controlMode = 1;
|
||||
break;
|
||||
default:
|
||||
sub_08042004(this);
|
||||
@@ -567,7 +567,7 @@ void sub_08041BE8(Entity* this) {
|
||||
if (sub_08079F8C() != 0) {
|
||||
this->subAction = 1;
|
||||
this->actionDelay = 120;
|
||||
this->updatePriority = 3;
|
||||
this->updatePriority = PRIO_NO_BLOCK;
|
||||
InitAnimationForceUpdate(this, 10);
|
||||
|
||||
entity = ((VaatiWrathHeapStruct*)this->myHeap)->type1;
|
||||
@@ -576,7 +576,7 @@ void sub_08041BE8(Entity* this) {
|
||||
((VaatiWrathHeapStruct*)this->myHeap)->type1 = NULL;
|
||||
|
||||
entity = ((VaatiWrathHeapStruct*)this->myHeap)->type2;
|
||||
entity->updatePriority = 3;
|
||||
entity->updatePriority = PRIO_NO_BLOCK;
|
||||
sub_080AE068(entity);
|
||||
LoadFixedGFX(entity, 0x1f5);
|
||||
sub_0801D2B4(entity, 0x16b);
|
||||
|
||||
Reference in New Issue
Block a user