summaryrefslogtreecommitdiff
path: root/src/enemy
diff options
context:
space:
mode:
authortheo3 <arisstephenson2@gmail.com>2021-12-14 23:31:27 -0800
committertheo3 <arisstephenson2@gmail.com>2021-12-14 23:31:27 -0800
commit34e69959df548688ef8535eb4cab18e5a53992a8 (patch)
treed5a822be15b8f06323912e90ad2a25746b47b76e /src/enemy
parent83fc0285020c456beb809d9918515ad1c1c73245 (diff)
cleanup
Diffstat (limited to 'src/enemy')
-rw-r--r--src/enemy/acroBandits.c2
-rw-r--r--src/enemy/beetle.c2
-rw-r--r--src/enemy/businessScrub.c6
-rw-r--r--src/enemy/cuccoChickAggr.c2
-rw-r--r--src/enemy/darkNut.c4
-rw-r--r--src/enemy/fireballGuy.c2
-rw-r--r--src/enemy/keaton.c2
-rw-r--r--src/enemy/lakitu.c2
-rw-r--r--src/enemy/likeLike.c2
-rw-r--r--src/enemy/mazaalHead.c2
-rw-r--r--src/enemy/moldworm.c6
-rw-r--r--src/enemy/pesto.c4
-rw-r--r--src/enemy/slime.c2
-rw-r--r--src/enemy/vaatiWrath.c6
14 files changed, 22 insertions, 22 deletions
diff --git a/src/enemy/acroBandits.c b/src/enemy/acroBandits.c
index 368606f2..c4784ee0 100644
--- a/src/enemy/acroBandits.c
+++ b/src/enemy/acroBandits.c
@@ -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);
}
diff --git a/src/enemy/beetle.c b/src/enemy/beetle.c
index c1b560d1..b2b3e5ed 100644
--- a/src/enemy/beetle.c
+++ b/src/enemy/beetle.c
@@ -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;
diff --git a/src/enemy/businessScrub.c b/src/enemy/businessScrub.c
index a0c18290..6e75d855 100644
--- a/src/enemy/businessScrub.c
+++ b/src/enemy/businessScrub.c
@@ -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;
}
}
diff --git a/src/enemy/cuccoChickAggr.c b/src/enemy/cuccoChickAggr.c
index fa2fb63a..d3295203 100644
--- a/src/enemy/cuccoChickAggr.c
+++ b/src/enemy/cuccoChickAggr.c
@@ -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) {
diff --git a/src/enemy/darkNut.c b/src/enemy/darkNut.c
index aa7d5993..e9061ad0 100644
--- a/src/enemy/darkNut.c
+++ b/src/enemy/darkNut.c
@@ -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);
}
diff --git a/src/enemy/fireballGuy.c b/src/enemy/fireballGuy.c
index 3ec57bc7..c6e0123e 100644
--- a/src/enemy/fireballGuy.c
+++ b/src/enemy/fireballGuy.c
@@ -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 */
diff --git a/src/enemy/keaton.c b/src/enemy/keaton.c
index 0c9adb33..b5bbef3f 100644
--- a/src/enemy/keaton.c
+++ b/src/enemy/keaton.c
@@ -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;
diff --git a/src/enemy/lakitu.c b/src/enemy/lakitu.c
index d96950d7..8e4ae08e 100644
--- a/src/enemy/lakitu.c
+++ b/src/enemy/lakitu.c
@@ -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;
}
}
diff --git a/src/enemy/likeLike.c b/src/enemy/likeLike.c
index 6dce5fba..42e8d88f 100644
--- a/src/enemy/likeLike.c
+++ b/src/enemy/likeLike.c
@@ -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);
diff --git a/src/enemy/mazaalHead.c b/src/enemy/mazaalHead.c
index ce77d2c4..b282e776 100644
--- a/src/enemy/mazaalHead.c
+++ b/src/enemy/mazaalHead.c
@@ -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);
}
diff --git a/src/enemy/moldworm.c b/src/enemy/moldworm.c
index 7fb15f46..ce7f9249 100644
--- a/src/enemy/moldworm.c
+++ b/src/enemy/moldworm.c
@@ -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);
}
}
diff --git a/src/enemy/pesto.c b/src/enemy/pesto.c
index 3f0e0c51..472d982d 100644
--- a/src/enemy/pesto.c
+++ b/src/enemy/pesto.c
@@ -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;
diff --git a/src/enemy/slime.c b/src/enemy/slime.c
index 92de7a7f..ab7666f8 100644
--- a/src/enemy/slime.c
+++ b/src/enemy/slime.c
@@ -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 */
diff --git a/src/enemy/vaatiWrath.c b/src/enemy/vaatiWrath.c
index 43d870c1..d96b04ee 100644
--- a/src/enemy/vaatiWrath.c
+++ b/src/enemy/vaatiWrath.c
@@ -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);