summaryrefslogtreecommitdiff
path: root/src/enemy
diff options
context:
space:
mode:
authortheo3 <arisstephenson2@gmail.com>2021-11-10 00:35:06 -0800
committertheo3 <arisstephenson2@gmail.com>2021-11-10 00:35:06 -0800
commit313cc336f21fcf81e3e336b4fe45ca5053771f93 (patch)
tree9733b9af938fd26c5a6e56013af9c8a915de105e /src/enemy
parente6eeeefc50d5e7e4578443ea1f976de694fdb852 (diff)
thumb interwork finished
Diffstat (limited to 'src/enemy')
-rw-r--r--src/enemy/acroBandits.c14
-rw-r--r--src/enemy/beetle.c8
-rw-r--r--src/enemy/bobomb.c22
-rw-r--r--src/enemy/bombPeahat.c6
-rw-r--r--src/enemy/businessScrub.c10
-rw-r--r--src/enemy/chuchu.c36
-rw-r--r--src/enemy/darkNut.c14
-rw-r--r--src/enemy/doorMimic.c4
-rw-r--r--src/enemy/enemy4D.c2
-rw-r--r--src/enemy/fallingBoulder.c6
-rw-r--r--src/enemy/gibdo.c12
-rw-r--r--src/enemy/gyorgMale.c4
-rw-r--r--src/enemy/helmasaur.c16
-rw-r--r--src/enemy/keaton.c2
-rw-r--r--src/enemy/lakitu.c14
-rw-r--r--src/enemy/lakituCloud.c4
-rw-r--r--src/enemy/leever.c4
-rw-r--r--src/enemy/likeLike.c16
-rw-r--r--src/enemy/madderpillar.c16
-rw-r--r--src/enemy/mazaalBracelet.c40
-rw-r--r--src/enemy/mazaalHead.c2
-rw-r--r--src/enemy/mazaalMacro.c2
-rw-r--r--src/enemy/moldorm.c4
-rw-r--r--src/enemy/moldworm.c20
-rw-r--r--src/enemy/octorok.c6
-rw-r--r--src/enemy/peahat.c14
-rw-r--r--src/enemy/pesto.c12
-rw-r--r--src/enemy/puffstool.c10
-rw-r--r--src/enemy/rockChuchu.c4
-rw-r--r--src/enemy/rollobite.c20
-rw-r--r--src/enemy/rupeeLike.c14
-rw-r--r--src/enemy/smallPesto.c2
-rw-r--r--src/enemy/spark.c2
-rw-r--r--src/enemy/spikedBeetle.c4
-rw-r--r--src/enemy/spinyChuchu.c18
-rw-r--r--src/enemy/vaatiArm.c38
-rw-r--r--src/enemy/vaatiBall.c24
-rw-r--r--src/enemy/vaatiEyesMacro.c2
-rw-r--r--src/enemy/vaatiProjectile.c6
-rw-r--r--src/enemy/vaatiRebornEnemy.c14
-rw-r--r--src/enemy/vaatiTransfigured.c14
-rw-r--r--src/enemy/vaatiTransfiguredEye.c10
-rw-r--r--src/enemy/vaatiWrath.c12
-rw-r--r--src/enemy/vaatiWrathEye.c6
-rw-r--r--src/enemy/wallMaster.c12
-rw-r--r--src/enemy/wallMaster2.c2
-rw-r--r--src/enemy/waterDrop.c6
-rw-r--r--src/enemy/wisp.c6
48 files changed, 268 insertions, 268 deletions
diff --git a/src/enemy/acroBandits.c b/src/enemy/acroBandits.c
index 4644e620..dc8fdf95 100644
--- a/src/enemy/acroBandits.c
+++ b/src/enemy/acroBandits.c
@@ -160,7 +160,7 @@ void sub_08031B48(Entity* this) {
GetNextFrame(this);
if (this->frames.b.f0) {
this->frames.all = 0;
- this->flags |= 0x80;
+ COLLISION_ON(this);
} else {
if (this->frames.b.f3) {
this->action = 0x3;
@@ -188,7 +188,7 @@ void sub_08031B98(Entity* this) {
GetNextFrame(this);
if (this->actionDelay == 0) {
this->action = 4;
- this->flags &= 0x7f;
+ COLLISION_OFF(this);
InitializeAnimation(this, 2);
}
}
@@ -255,7 +255,7 @@ void sub_08031C58(Entity* this) {
} else {
if (this->frames.b.f0) {
this->frames.all = 0;
- this->flags &= 0x7f;
+ COLLISION_OFF(this);
}
}
}
@@ -264,7 +264,7 @@ void sub_08031D70(Entity* this) {
GetNextFrame(this);
if (--this->actionDelay == '\0') {
this->action = 7;
- this->flags &= 0x7f;
+ COLLISION_OFF(this);
this->actionDelay = 5;
this->spriteSettings.b.draw = 0;
}
@@ -289,7 +289,7 @@ void sub_08031DC4(Entity* this) {
} else {
GetNextFrame(this);
if ((this->frames.all & 0xf) == 2) {
- this->flags &= 0x7f;
+ COLLISION_OFF(this);
}
}
}
@@ -349,7 +349,7 @@ void sub_08031EE8(Entity* this) {
if (this->hVelocity < 1) {
this->action = 2;
- this->flags |= 0x80;
+ COLLISION_ON(this);
InitializeAnimation(this, 5);
}
}
@@ -494,7 +494,7 @@ void sub_08032248(Entity* this) {
GetNextFrame(this);
if ((this->frames.all & 0xf) == 2)
- this->flags &= 0x7f;
+ COLLISION_OFF(this);
}
}
}
diff --git a/src/enemy/beetle.c b/src/enemy/beetle.c
index 15535172..4b1d8429 100644
--- a/src/enemy/beetle.c
+++ b/src/enemy/beetle.c
@@ -34,7 +34,7 @@ void sub_08021780(Entity* this) {
this->action = 5;
this->actionDelay = 0xb4;
this->field_0xf = 0;
- this->flags &= ~0x80;
+ COLLISION_OFF(this);
this->spritePriority.b0 = 3;
CopyPositionAndSpriteOffset(&gPlayerEntity, this);
this->height.HALF.HI = -1;
@@ -119,7 +119,7 @@ void sub_080218CC(Entity* this) {
this->action = 2;
this->actionDelay = (Random() & 0x38) + 8;
this->field_0xf = 1;
- this->flags |= 0x80;
+ COLLISION_ON(this);
this->speed = 0x180;
InitializeAnimation(this, 0);
}
@@ -128,7 +128,7 @@ void sub_080218CC(Entity* this) {
void sub_08021984(Entity* this) {
if (this->subAction == 0) {
this->subAction = 1;
- this->flags |= 0x80;
+ COLLISION_ON(this);
this->spriteSettings.b.draw = 3;
this->height.HALF.HI = -0x80;
this->spriteRendering.b3 = 1;
@@ -270,7 +270,7 @@ void sub_08021C58(Entity* this) {
this->action = 2;
this->actionDelay = 60;
this->field_0xf = 1;
- this->flags |= 0x80;
+ COLLISION_ON(this);
this->spritePriority.b0 = 4;
((u8*)&this->field_0x86)[0] = 60;
InitializeAnimation(this, 0);
diff --git a/src/enemy/bobomb.c b/src/enemy/bobomb.c
index 67bb138b..579a5c4c 100644
--- a/src/enemy/bobomb.c
+++ b/src/enemy/bobomb.c
@@ -52,7 +52,7 @@ void sub_0802C688(Entity* this) {
break;
case 2:
this->action = 3;
- this->damageType = 0x6e;
+ this->hitType = 0x6e;
this->field_0xf = 1;
this->hVelocity = 0x18000;
this->speed = 0;
@@ -112,15 +112,15 @@ void sub_0802C83C(Entity* this) {
sub_0802CBC4(this);
} else {
sub_0802CC18(this);
- this->flags &= ~0x80;
- this->damageType = 0x6e;
+ COLLISION_OFF(this);
+ this->hitType = 0x6e;
}
} else {
this->field_0x82.HALF.LO = 2;
this->actionDelay = 120;
InitializeAnimation(this, (this->direction >> 4) | 6);
- this->flags &= ~0x80;
- this->damageType = 0x6e;
+ COLLISION_OFF(this);
+ this->hitType = 0x6e;
}
}
@@ -187,7 +187,7 @@ void sub_0802C9B8(Entity* this) {
void sub_0802C9D0(Entity* this) {
this->subAction = 1;
- this->flags &= ~0x80;
+ COLLISION_OFF(this);
this->spritePriority.b1 = 0;
this->field_0x82.HALF.HI = 1;
sub_0802CC18(this);
@@ -222,7 +222,7 @@ void sub_0802CA6C(Entity* this) {
void sub_0802CA94(Entity* this) {
this->action = 3;
- this->flags &= ~0x80;
+ COLLISION_OFF(this);
this->field_0xf = 1;
this->spritePriority.b1 = 1;
this->hVelocity = 0x18000;
@@ -244,8 +244,8 @@ void sub_0802CAF8(Entity* this) {
sub_08078930(this);
if (this->field_0xf && this->height.HALF.HI == 0) {
this->field_0xf = 0;
- this->flags = this->flags | 0x80;
- this->damageType = 0x6e;
+ COLLISION_ON(this);
+ this->hitType = 0x6e;
}
GetNextFrame(this);
}
@@ -260,7 +260,7 @@ void sub_0802CB68(Entity* this) {
this->subAction = 0;
this->direction = Random() & 0x18;
this->direction |= 4;
- this->flags |= 0x80;
+ COLLISION_ON(this);
if (this->field_0x82.HALF.LO) {
this->actionDelay = 200;
this->speed = 0x200;
@@ -277,7 +277,7 @@ void sub_0802CBC4(Entity* this) {
this->action = 4;
this->spriteSettings.b.draw = 0;
- this->flags &= ~0x80;
+ COLLISION_OFF(this);
this->currentHealth = 0;
if (this->field_0x82.HALF.HI) {
sub_08079184();
diff --git a/src/enemy/bombPeahat.c b/src/enemy/bombPeahat.c
index d5220c6d..9b2b5547 100644
--- a/src/enemy/bombPeahat.c
+++ b/src/enemy/bombPeahat.c
@@ -507,9 +507,9 @@ void sub_0802B048(Entity* this) {
if (this->field_0x7a.HALF.HI) {
if (gRoomControls.roomOriginY > this->y.HALF.HI ||
(gRoomControls.roomOriginY + gRoomControls.height + 0x20) < this->y.HALF.HI) {
- this->flags &= ~0x80;
+ COLLISION_OFF(this);
} else {
- this->flags |= 0x80;
+ COLLISION_ON(this);
}
}
@@ -540,7 +540,7 @@ void sub_0802B048(Entity* this) {
this->hitbox = (Hitbox*)&gUnk_080CD17C;
this->actionDelay = 0xf;
this->spriteSettings.b.draw = 0;
- this->flags |= 0x80;
+ COLLISION_ON(this);
this->field_0x7a.HALF.HI = 0;
sub_08078954(this);
if (this->parent->next) {
diff --git a/src/enemy/businessScrub.c b/src/enemy/businessScrub.c
index 989c6bea..275b1775 100644
--- a/src/enemy/businessScrub.c
+++ b/src/enemy/businessScrub.c
@@ -55,11 +55,11 @@ void sub_0802891C(Entity* this) {
void sub_08028934(Entity* this) {
Entity* pEVar1;
- if (this->damageType == 1 && (this->bitfield & 0x7f) == 0x42) {
+ if (this->hitType == 1 && (this->bitfield & 0x7f) == 0x42) {
this->action = 3;
this->subAction = 0;
this->actionDelay = 0x28;
- this->flags &= ~0x80;
+ COLLISION_OFF(this);
sub_080290E0(this, 4);
pEVar1 = CreateFx(this, FX_BUSH, 0);
if (pEVar1 != NULL) {
@@ -90,7 +90,7 @@ void sub_08028994(Entity* this) {
this->actionDelay = 0;
this->field_0x76.HWORD = COORD_TO_TILE(this);
this->field_0x74.HWORD = sub_080001DA(this->field_0x76.HWORD, this->collisionLayer);
- this->field_0x40 = 0x41;
+ this->hurtType = 0x41;
sub_08028FFC(this);
}
}
@@ -417,7 +417,7 @@ bool32 sub_08028FDC(Entity* this) {
void sub_08028FFC(Entity* this) {
this->action = 1;
- this->flags &= ~0x80;
+ COLLISION_OFF(this);
this->spritePriority.b1 = 0;
sub_080AE068(this);
UnloadOBJPalette(this);
@@ -433,7 +433,7 @@ void sub_08028FFC(Entity* this) {
void sub_08029078(Entity* this) {
this->action = 2;
- this->flags = this->flags | 0x80;
+ COLLISION_ON(this);
this->spritePriority.b1 = 1;
if (LoadFixedGFX(this, 0x72) == 0) {
DeleteEntity(this);
diff --git a/src/enemy/chuchu.c b/src/enemy/chuchu.c
index 56e23b75..32f1a1b1 100644
--- a/src/enemy/chuchu.c
+++ b/src/enemy/chuchu.c
@@ -52,11 +52,11 @@ void Chuchu(Entity* this) {
if (index != this->field_0x80.HALF.HI) {
switch (this->type) {
case 0:
- if (this->flags & 0x80) {
+ if (this->flags & ENT_COLLIDE) {
this->action = 6;
- this->flags &= ~0x80;
+ COLLISION_OFF(this);
this->speed = 0x20;
- this->damageType = 0x5c;
+ this->hitType = 0x5c;
InitializeAnimation(this, 5);
}
break;
@@ -100,7 +100,7 @@ void sub_0801EF40(Entity* this) {
if (this->type == 2) {
if (this->bitfield == 0x8e || this->bitfield == 0x95) {
- this->flags &= ~0x80;
+ COLLISION_OFF(this);
this->currentHealth = 0;
}
}
@@ -180,7 +180,7 @@ void sub_0801F0C8(Entity* this) {
this->actionDelay = (Random() & 3) + 0xc;
this->field_0xf = Random();
this->direction = sub_08049F84(this, 1);
- this->flags |= 0x80;
+ COLLISION_ON(this);
this->spritePriority.b0 = 4;
this->spritePriority.b1 = 3;
InitializeAnimation(this, 2);
@@ -213,7 +213,7 @@ void sub_0801F1B0(Entity* this) {
if (this->frames.all & 0x10) {
if (this->frames.all & 1) {
this->frames.all ^= 1;
- this->damageType = 90;
+ this->hitType = 90;
EnqueueSFX(299);
}
sub_080AEFE0(this);
@@ -287,7 +287,7 @@ void sub_0801F2F8(Entity* this) {
void sub_0801F328(Entity* this) {
this->action = 6;
- this->flags &= ~0x80;
+ COLLISION_OFF(this);
InitializeAnimation(this, 5);
}
@@ -295,7 +295,7 @@ void sub_0801F340(Entity* this) {
this->action = 5;
this->actionDelay = 60;
this->speed = 0x20;
- this->damageType = 92;
+ this->hitType = 92;
InitializeAnimation(this, 2);
}
@@ -346,7 +346,7 @@ void sub_0801F428(Entity* this) {
this->action = 3;
this->field_0xf = 30;
- this->flags |= 0x80;
+ COLLISION_ON(this);
this->spritePriority.b1 = 3;
this->spriteSettings.b.draw = 1;
InitializeAnimation(this, 2);
@@ -363,7 +363,7 @@ void sub_0801F494(Entity* this) {
this->action = 3;
this->field_0xf = 30;
this->direction = sub_08049F84(this, 1);
- this->flags |= 0x80;
+ COLLISION_ON(this);
this->spritePriority.b0 = 4;
this->spritePriority.b1 = 3;
InitializeAnimation(this, 2);
@@ -404,7 +404,7 @@ void sub_0801F584(Entity* this) {
if (this->frames.all & 0x10) {
if (this->frames.all & 0x1) {
this->frames.all ^= 1;
- this->damageType = 91;
+ this->hitType = 91;
EnqueueSFX(299);
}
sub_080AEFE0(this);
@@ -423,7 +423,7 @@ void sub_0801F584(Entity* this) {
this->action = 6;
this->field_0xf = 60;
this->speed = 0x20;
- this->damageType = 92;
+ this->hitType = 92;
InitializeAnimation(this, 2);
}
}
@@ -482,7 +482,7 @@ void sub_0801F6F8(Entity* this) {
void sub_0801F730(Entity* this) {
this->action = 7;
- this->flags &= ~0x80;
+ COLLISION_OFF(this);
InitializeAnimation(this, 5);
}
@@ -537,7 +537,7 @@ void sub_0801F840(Entity* this) {
GetNextFrame(this);
if (this->frames.all & 0x80) {
sub_0801FB14(this);
- this->flags |= 0x80;
+ COLLISION_ON(this);
this->spritePriority.b0 = 4;
this->spritePriority.b1 = 3;
}
@@ -552,7 +552,7 @@ void sub_0801F884(Entity* this) {
if (ent) {
ent->type2 = 64;
this->action = 4;
- this->damageType = 165;
+ this->hitType = 165;
EnqueueSFX(0x193);
}
}
@@ -656,7 +656,7 @@ void sub_0801FAAC(Entity* this) {
void sub_0801FAE0(Entity* this) {
this->action = 7;
- this->flags &= ~0x80;
+ COLLISION_OFF(this);
InitializeAnimation(this, 5);
}
@@ -687,13 +687,13 @@ void sub_0801FB68(Entity* this) {
break;
case 1:
this->action = 10;
- this->flags |= 0x80;
+ COLLISION_ON(this);
this->spriteSettings.b.draw = 1;
this->spritePriority.b1 = 3;
break;
case 2:
this->action = 10;
- this->damageType = 92;
+ this->hitType = 92;
sub_0804AA1C(this);
break;
}
diff --git a/src/enemy/darkNut.c b/src/enemy/darkNut.c
index d28e3b15..09648a8f 100644
--- a/src/enemy/darkNut.c
+++ b/src/enemy/darkNut.c
@@ -63,7 +63,7 @@ void sub_08020BB8(Entity* this) {
case 0x1c:
this->action = 11;
this->actionDelay = gUnk_080CAB0C[this->type];
- this->damageType = 81;
+ this->hitType = 81;
sub_08021218(this, 8, DirectionToAnimationState(this->knockbackDirection ^ 0x10));
sub_08021588(this);
sub_0804A9FC(this, 0x1c);
@@ -71,7 +71,7 @@ void sub_08020BB8(Entity* this) {
case 0x16:
this->action = 11;
this->actionDelay = gUnk_080CAB10[this->type];
- this->damageType = 81;
+ this->hitType = 81;
sub_08021218(this, 8, DirectionToAnimationState(this->knockbackDirection ^ 0x10));
sub_08021588(this);
sub_0804A9FC(this, 0x1c);
@@ -263,7 +263,7 @@ void sub_08020FE4(Entity* this) {
void sub_08021010(Entity* this) {
UpdateAnimationSingleFrame(this);
if (this->frames.all & 0x80) {
- this->damageType = 0x56;
+ this->hitType = 0x56;
sub_080213F0(this);
}
}
@@ -288,7 +288,7 @@ void sub_08021038(Entity* this) {
} else {
UpdateAnimationSingleFrame(this);
if (this->frames.all == 4)
- this->damageType = 81;
+ this->hitType = 81;
}
}
@@ -445,7 +445,7 @@ void sub_08021380(Entity* this) {
void sub_08021390(Entity* this) {
this->action = 7;
this->speed = 0x200;
- this->damageType = 0x56;
+ this->hitType = 0x56;
sub_08021218(this, 6, this->animationState);
}
@@ -568,7 +568,7 @@ void sub_0802159C(Entity* this) {
Entity* ent;
this->frames.all = 0;
- this->damageType = 0x51;
+ this->hitType = 0x51;
ent = CreateProjectileWithParent(this, 0, 3);
if (ent) {
ent->parent = this;
@@ -589,7 +589,7 @@ void sub_08021600(Entity* this) {
Entity* ent;
this->frames.all = 0;
- this->damageType = 0x51;
+ this->hitType = 0x51;
ent = CreateProjectileWithParent(this, 0, 4);
if (ent) {
ent->parent = this;
diff --git a/src/enemy/doorMimic.c b/src/enemy/doorMimic.c
index c3fd44ee..301efced 100644
--- a/src/enemy/doorMimic.c
+++ b/src/enemy/doorMimic.c
@@ -77,7 +77,7 @@ void sub_080220F0(Entity* this) {
this->action = 4;
this->actionDelay = 0x78;
- this->field_0x44 = 0;
+ this->damage = 0;
off = gUnk_080CB76C[this->type2];
for (i = 0; i < 6; i++, off++) {
Entity* fx = CreateFx(this, FX_DASH, 0);
@@ -88,7 +88,7 @@ void sub_080220F0(Entity* this) {
}
EnqueueSFX(260);
} else if (this->frames.all & 1) {
- this->field_0x44 = 4;
+ this->damage = 4;
}
}
diff --git a/src/enemy/enemy4D.c b/src/enemy/enemy4D.c
index 0049a853..f1b16cc7 100644
--- a/src/enemy/enemy4D.c
+++ b/src/enemy/enemy4D.c
@@ -40,7 +40,7 @@ void sub_0803EB44(Entity* this) {
if (pEVar1 != NULL) {
pEVar1->parent = this;
this->attachedEntity = pEVar1;
- this->flags |= 0x80;
+ COLLISION_ON(this);
this->spriteSettings.b.draw = TRUE;
this->animationState = 2;
*((u8*)&this->field_0x7a + 1) = 0;
diff --git a/src/enemy/fallingBoulder.c b/src/enemy/fallingBoulder.c
index 29446667..039c817f 100644
--- a/src/enemy/fallingBoulder.c
+++ b/src/enemy/fallingBoulder.c
@@ -76,7 +76,7 @@ NONMATCH("asm/non_matching/fallingBoulder/sub_0802C334.inc", void sub_0802C334(E
this->field_0x7c.HALF.HI = COORD_TO_TILE(this);
if (sub_080044EC(this, *(u32*)&this->cutsceneBeh) == 1) {
EnqueueSFX(0x14c);
- this->flags = this->flags | 0x80;
+ COLLISION_ON(this);
this->field_0x7a.HWORD = 0xc;
sub_0802C4B0(this);
} else {
@@ -86,7 +86,7 @@ NONMATCH("asm/non_matching/fallingBoulder/sub_0802C334.inc", void sub_0802C334(E
u16 tmp = --this->field_0x7a.HWORD;
switch (tmp) {
case 0:
- this->flags &= ~0x80;
+ COLLISION_OFF(this);
break;
case 8:
if (this->type2 != 0 && !sub_08049FA0(this)) {
@@ -211,7 +211,7 @@ void sub_0802C62C(Entity* this) {
this->y.HALF.HI = this->field_0x82.HWORD;
this->x.HALF.HI = this->field_0x80.HWORD;
this->spriteSettings.b.draw = 0;
- this->flags &= ~0x80;
+ COLLISION_OFF(this);
this->field_0x7c.HALF.LO = 0;
}
diff --git a/src/enemy/gibdo.c b/src/enemy/gibdo.c
index d1773a7d..6fc3a27f 100644
--- a/src/enemy/gibdo.c
+++ b/src/enemy/gibdo.c
@@ -47,18 +47,18 @@ NONMATCH("asm/non_matching/gibdo/sub_080374A4.inc", void sub_080374A4(Entity* th
}
this->action = 0x8;
this->actionDelay = 0x3c;
- this->flags &= 0x7F;
+ COLLISION_OFF(this);
sub_08037B48(this);
} else {
if (this->action != 0x6) {
- if (this->damageType == 0x27) {
+ if (this->hitType == 0x27) {
if (this->bitfield == 0x80) {
sub_08037A14(this);
}
} else {
if ((u8)(this->action - 1) < 2) {
this->action = 1;
- x = DirectionTurnAround(this->knockbackDirection);
+ x = DirectionTurnAround(DirectionRoundUp(this->knockbackDirection));
this->direction = x;
this->animationState = x >> 3;
InitAnimationForceUpdate(this, this->animationState);
@@ -153,7 +153,7 @@ void sub_08037690(Entity* this) {
sub_08037794(this);
} else {
if ((this->frames.all & 1) != 0) {
- this->damageType = 0x27;
+ this->hitType = 0x27;
ProcessMovement(this);
}
}
@@ -202,7 +202,7 @@ void sub_0803775C(Entity* this) {
void sub_08037794(Entity* this) {
this->action = 1;
this->field_0x74.HWORD = 0x1e;
- this->damageType = 0x26;
+ this->hitType = 0x26;
InitAnimationForceUpdate(this, this->animationState);
}
@@ -339,7 +339,7 @@ void sub_08037A58(Entity* this) {
if (this->iframes == 0) {
this->iframes = 0xec;
}
- this->damageType = 0x26;
+ this->hitType = 0x26;
this->flags2 |= 1;
this->iframes = 0xf4;
this->knockbackDirection = DirectionFromAnimationState(this->animationState) ^ 0x10;
diff --git a/src/enemy/gyorgMale.c b/src/enemy/gyorgMale.c
index 7aaa2153..6c0fb567 100644
--- a/src/enemy/gyorgMale.c
+++ b/src/enemy/gyorgMale.c
@@ -1113,7 +1113,7 @@ void sub_08048004(Entity* this) {
if (this->action == 0)
return;
if (this->animIndex == 0) {
- this->flags &= ~0x80;
+ COLLISION_OFF(this);
if (gPlayerEntity.height.HALF.HI != 0)
return;
if (!sub_08079F8C())
@@ -1151,7 +1151,7 @@ void sub_08048004(Entity* this) {
this->field_0x7c.BYTES.byte0 = 0;
}
} else {
- this->flags |= 0x80;
+ COLLISION_ON(this);
}
}
diff --git a/src/enemy/helmasaur.c b/src/enemy/helmasaur.c
index 41f0ed85..870831bc 100644
--- a/src/enemy/helmasaur.c
+++ b/src/enemy/helmasaur.c
@@ -42,7 +42,7 @@ void sub_0802BBAC(Entity* this) {
}
void sub_0802BBC4(Entity* this) {
- if (this->damageType != 0x19) {
+ if (this->hitType != 0x19) {
switch (this->bitfield & 0x7f) {
case 0:
case 2:
@@ -62,7 +62,7 @@ void sub_0802BBC4(Entity* this) {
}
void sub_0802BC20(Entity* this) {
- if (this->damageType != 0x19) {
+ if (this->hitType != 0x19) {
if (sub_0806F520(this)) {
gUnk_080CD42C[this->subAction](this);
}
@@ -84,13 +84,13 @@ void sub_0802BCA0(Entity* this) {
}
void sub_0802BCA8(Entity* this) {
- if (this->damageType != 0x19) {
+ if (this->hitType != 0x19) {
Entity* ent;
this->action = 7;
this->actionDelay = 0x5a;
this->hVelocity = 0x18000;
- this->damageType = 0x19;
+ this->hitType = 0x19;
this->field_0x3a = this->field_0x3a & 0xfb;
this->field_0x1c = 0x12;
ent = CreateEnemy(HELMASAUR, 1);
@@ -112,7 +112,7 @@ void sub_0802BD08(Entity* this) {
}
void sub_0802BD10(Entity* this) {
- this->flags &= ~0x80;
+ COLLISION_OFF(this);
UpdateAnimationVariableFrames(this, 2);
}
@@ -121,8 +121,8 @@ void nullsub_145(Entity* this) {
}
void sub_0802BD28(Entity* this) {
- if (this->flags & 0x80) {
- this->flags |= 0x80;
+ if (this->flags & ENT_COLLIDE) {
+ COLLISION_ON(this);
this->field_0x3a &= ~0x4;
} else {
this->currentHealth = 0;
@@ -265,7 +265,7 @@ void sub_0802BF98(Entity* this) {
} else {
this->action = 2;
this->actionDelay = 30;
- this->flags &= ~0x80;
+ COLLISION_OFF(this);
}
}
diff --git a/src/enemy/keaton.c b/src/enemy/keaton.c
index 1b4f20c0..d1a41424 100644
--- a/src/enemy/keaton.c
+++ b/src/enemy/keaton.c
@@ -40,7 +40,7 @@ void sub_080323F4(Entity* this) {
if (this->action != 3 && this->action != 4) {
this->action = 3;
this->actionDelay = 0xC;
- this->direction = DirectionTurnAround(this->knockbackDirection);
+ this->direction = DirectionTurnAround(DirectionRoundUp(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 1353d489..91798d2e 100644
--- a/src/enemy/lakitu.c
+++ b/src/enemy/lakitu.c
@@ -61,7 +61,7 @@ void sub_0803C784(Entity* this) {
sub_0803CBAC(this);
} else {
- if (this->damageType == 0x43) {
+ if (this->hitType == 0x43) {
Entity* fx = CreateFx(this, FX_DEATH, 0);
if (fx != NULL) {
@@ -154,7 +154,7 @@ void Lakitu_EndHide(Entity* this) {
this->action = IDLE;
this->actionDelay = 0x3c;
- this->damageType = 0x42;
+ this->hitType = 0x42;
InitAnimationForceUpdate(this, this->animationState + 4);
}
@@ -168,7 +168,7 @@ void Lakitu_Idle(Entity* this) {
if (!sub_0803CA4C(this)) {
this->action = BEGIN_HIDE;
- this->damageType = 0x43;
+ this->hitType = 0x43;
InitAnimationForceUpdate(this, this->animationState + 0xc);
} else {
sub_0803CA84(this, 4);
@@ -196,7 +196,7 @@ void Lakitu_Lightning(Entity* this) {
Lakitu_SpawnLightning(this);
this->action = LIGHTNING_DELAY;
- this->damageType = 0x42;
+ this->hitType = 0x42;
if ((Random() & 1) && !this->field_0x78.HALF.HI) {
this->actionDelay = 0xf;
@@ -293,7 +293,7 @@ bool32 sub_0803CB04(Entity* this) {
void sub_0803CB34(Entity* this) {
this->action = LIGHTNING_THROW;
- this->damageType = 0xa6;
+ this->hitType = 0xa6;
this->field_0x78.HALF.LO = GetFacingDirection(this, &gPlayerEntity);
@@ -325,7 +325,7 @@ void sub_0803CBAC(Entity* this) {
cloud = this->attachedEntity;
if (cloud != NULL) {
cloud->flags |= 0x80;
- cloud->damageType = 0x43;
+ cloud->hitType = 0x43;
}
this->action = CLOUDLESS;
@@ -335,7 +335,7 @@ void sub_0803CBAC(Entity* this) {
this->flags2 &= 0x7b;
- this->damageType = 0x42;
+ this->hitType = 0x42;
InitAnimationForceUpdate(this, this->animationState + 16);
}
diff --git a/src/enemy/lakituCloud.c b/src/enemy/lakituCloud.c
index b7301df7..4ace44e2 100644
--- a/src/enemy/lakituCloud.c
+++ b/src/enemy/lakituCloud.c
@@ -105,7 +105,7 @@ void sub_0803CDD8(Entity* this) {
if (this->actionDelay == 0) {
this->action = 1;
- this->flags |= 0x80;
+ COLLISION_ON(this);
this->spriteSettings.b.draw = one;
}
@@ -132,7 +132,7 @@ void sub_0803CE3C(Entity* this) {
this->action = 2;
this->actionDelay = 60;
- this->flags &= 0x7f;
+ COLLISION_OFF(this);
this->field_0x3a &= 0xfb;
diff --git a/src/enemy/leever.c b/src/enemy/leever.c
index d92e1d26..4bdb53c8 100644
--- a/src/enemy/leever.c
+++ b/src/enemy/leever.c
@@ -92,7 +92,7 @@ void Leever_DigUp(Entity* this) {
InitializeAnimation(this, LeeverAnimation_Attack);
} else if (this->frames.b.f0 != 0) {
this->frames.all &= 0xfe;
- this->flags |= 0x80;
+ COLLISION_ON(this);
}
}
@@ -102,7 +102,7 @@ void Leever_Attack(Entity* this) {
if (--this->field_0x74.HWORD == 0) {
this->action = 4;
- this->flags &= 0x7f;
+ COLLISION_OFF(this);
InitializeAnimation(this, LeeverAnimation_DigDown);
}
}
diff --git a/src/enemy/likeLike.c b/src/enemy/likeLike.c
index 70f5ea3f..54d0852f 100644
--- a/src/enemy/likeLike.c
+++ b/src/enemy/likeLike.c
@@ -26,10 +26,10 @@ void sub_08027D8C(Entity* this) {
}
void sub_08027DA4(Entity* this) {
- if (this->damageType == 1) {
+ if (this->hitType == 1) {
this->action = 3;
- this->flags &= ~0x80;
- this->damageType = 0x8c;
+ COLLISION_OFF(this);
+ this->hitType = 0x8c;
} else {
if (this->action == 7) {
sub_0802810C(this);
@@ -75,7 +75,7 @@ void sub_08027E70(Entity* this) {
case 0:
this->action = 3;
this->spriteSettings.b.draw = 0;
- this->flags = this->flags & 0x7f;
+ COLLISION_OFF(this);
this->actionDelay = 0;
break;
case 1:
@@ -88,7 +88,7 @@ void sub_08027E70(Entity* this) {
this->action = 1;
this->spriteSettings.b.draw = 0;
this->actionDelay = 0;
- this->damageType = 1;
+ this->hitType = 1;
InitializeAnimation(this, 0);
break;
}
@@ -101,7 +101,7 @@ void sub_08027E70(Entity* this) {
}
void sub_08027EFC(Entity* this) {
- if (this->damageType == 1)
+ if (this->hitType == 1)
return;
if (sub_08049FDC(this, 1)) {
@@ -120,7 +120,7 @@ void sub_08027EFC(Entity* this) {
GetNextFrame(this);
} else {
this->action = 6;
- this->flags &= ~0x80;
+ COLLISION_OFF(this);
InitializeAnimation(this, 2);
}
}
@@ -151,7 +151,7 @@ void sub_08027FE0(Entity* this) {
GetNextFrame(this);
if (this->frames.all & 1) {
this->action = 1;
- this->flags |= 0x80;
+ COLLISION_ON(this);
this->direction = sub_08049F84(this, 1);
this->actionDelay = 8;
this->spritePriority.b1 = 1;
diff --git a/src/enemy/madderpillar.c b/src/enemy/madderpillar.c
index 513848d9..314b28fc 100644
--- a/src/enemy/madderpillar.c
+++ b/src/enemy/madderpillar.c
@@ -55,7 +55,7 @@ void sub_080298A4(Entity* this) {
default:
this->action = 2;
this->actionDelay = 0;
- this->damageType = 0x6b;
+ this->hitType = 0x6b;
this->field_0x76.HALF.HI = 0;
sub_0801D2B4(this, 0x7f);
EnqueueSFX(0xfe);
@@ -115,7 +115,7 @@ void sub_0802999C(Entity* this) {
ent5->attachedEntity = ent6;
this->action = 1;
- this->flags |= 0x80;
+ COLLISION_ON(this);
this->direction = DirectionRound(Random());
this->speed = 0xa0;
this->animationState = 0xff;
@@ -138,7 +138,7 @@ void sub_08029AA4(Entity* this) {
if (this->field_0x76.HALF.HI != 0) {
this->action = 3;
this->speed = 0x108;
- this->damageType = 0x6a;
+ this->hitType = 0x6a;
this->field_0x7a.HWORD = 0x168;
this->field_0x74.HALF.HI = 4;
sub_08029EEC(this);
@@ -168,7 +168,7 @@ void sub_08029B2C(Entity* this) {
DeleteEntity(this);
}
} else {
- this->flags &= ~0x80;
+ COLLISION_OFF(this);
this->actionDelay = -(this->type * 15 - 90);
this->field_0x86.HALF.LO = 1;
}
@@ -210,7 +210,7 @@ void sub_08029BC4(Entity* this) {
void sub_08029C08(Entity* this) {
this->action = 3;
this->actionDelay = gUnk_080CCDA0[this->type];
- this->damageType = 0x6b;
+ this->hitType = 0x6b;
this->attachedEntity->action = 2;
}
@@ -225,7 +225,7 @@ void sub_08029C2C(Entity* this) {
void sub_08029C50(Entity* this) {
if (this->parent->field_0x76.HALF.HI != 0) {
this->action = 5;
- this->damageType = 0x6a;
+ this->hitType = 0x6a;
}
}
@@ -279,7 +279,7 @@ void sub_08029D14(Entity* this) {
if (this->frames.all & 0x80) {
this->action = 4;
this->actionDelay = 0x78;
- this->damageType = 0x6c;
+ this->hitType = 0x6c;
this->hitbox = &gUnk_080FD298;
EnqueueSFX(0x6b);
}
@@ -290,7 +290,7 @@ void sub_08029D78(Entity* this) {
sub_0802A0F8(this);
if (--this->actionDelay == 0) {
this->action = 5;
- this->damageType = 0x6a;
+ this->hitType = 0x6a;
this->hitbox = (Hitbox*)&gUnk_080FD2A0;
InitializeAnimation(this, this->animationState + 0x10);
}
diff --git a/src/enemy/mazaalBracelet.c b/src/enemy/mazaalBracelet.c
index 96ded54d..0437d6f2 100644
--- a/src/enemy/mazaalBracelet.c
+++ b/src/enemy/mazaalBracelet.c
@@ -143,7 +143,7 @@ NONMATCH("asm/non_matching/mazaal/sub_0803A188.inc", void sub_0803A188(Entity* t
if (this->action != 0x2b) {
if ((0 < this->iframes) && ((this->bitfield == 0x95 || (this->bitfield == 0x8e)))) {
this->action = 0x28;
- this->flags = this->flags & 0x7f;
+ COLLISION_OFF(this);
pEVar3 = this->parent;
pEVar3->field_0x7c.BYTES.byte1 = pEVar3->field_0x7c.BYTES.byte1 | (this->type == 0 ? 1 : 2);
pEVar3->field_0x80.HALF.LO = (this->type == 0 ? 1 : 2) | pEVar3->field_0x80.HALF.LO;
@@ -203,7 +203,7 @@ void sub_0803A274(Entity* this) {
}
if (gScreenTransition.field_0x38 != 0) {
this->action = 3;
- this->flags |= 0x80;
+ COLLISION_ON(this);
this->spriteSettings.b.draw = 1;
this->attachedEntity->spriteSettings.b.draw = 1;
InitializeAnimation(this, 0x10);
@@ -312,7 +312,7 @@ void sub_0803A364(Entity* this) {
default:
this->actionDelay--;
if (this->actionDelay == 0) {
- this->flags = this->flags | 0x80;
+ COLLISION_ON(this);
sub_0803B4D4(this);
}
break;
@@ -352,7 +352,7 @@ void sub_0803A5D0(Entity* this) {
s8* ptr;
this->action = 5;
- this->flags = this->flags & 0x7f;
+ COLLISION_OFF(this);
ptr = gUnk_080CED6C;
index = ((this->parent->field_0xf >> 4) + 3);
this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
@@ -500,7 +500,7 @@ void sub_0803A86C(Entity* this) {
this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
GetNextFrame(this);
if ((this->frames.all & 0x80) != 0) {
- this->flags = this->flags | 0x80;
+ COLLISION_ON(this);
sub_0803B59C(this);
}
}
@@ -558,7 +558,7 @@ void sub_0803A978(Entity* this) {
if (this->direction == 0x10) {
this->action = 0x12;
this->actionDelay = 3;
- this->flags = this->flags & 0x7f;
+ COLLISION_OFF(this);
*(u8*)(*(int*)&this->field_0x74 + 0x10) &= 0x7f;
InitializeAnimation(this, 8);
InitAnimationForceUpdate(this->attachedEntity, 3);
@@ -605,7 +605,7 @@ NONMATCH("asm/non_matching/mazaal/sub_0803AA98.inc", void sub_0803AA98(Entity* t
InitializeAnimation(this, 10);
(*(Entity**)&this->field_0x74)->flags |= 0x80;
temp = this->attachedEntity;
- temp->damageType = 0x13;
+ temp->hitType = 0x13;
InitAnimationForceUpdate(temp, 5);
SoundReq(SFX_16E);
}
@@ -654,7 +654,7 @@ void sub_0803ABB4(Entity* this) {
sub_0803B55C(this);
if ((this->attachedEntity->frames.all & 0x80) != 0) {
this->action = 0x17;
- this->flags = this->flags | 0x80;
+ COLLISION_ON(this);
this->speed = 0x180;
InitializeAnimation(this, 0x10);
InitAnimationForceUpdate(this->attachedEntity, 0);
@@ -807,14 +807,14 @@ void sub_0803AEC4(Entity* this) {
UpdateAnimationSingleFrame(this);
GetNextFrame(this);
if ((this->frames.all & 0x80) != 0) {
- this->flags |= 0x80;
+ COLLISION_ON(this);
sub_0803B59C(this);
}
}
void sub_0803AF18(Entity* this) {
this->action = 0x1f;
- this->flags = this->flags & 0x7f;
+ COLLISION_OFF(this);
InitializeAnimation(this, 5);
this->height.HALF.HI = gUnk_080CED6C[(this->parent->field_0xf >> 4) & 7] + 4;
}
@@ -907,7 +907,7 @@ void sub_0803B0D4(Entity* this) {
UpdateAnimationSingleFrame(this);
GetNextFrame(this);
if ((this->frames.all & 0x80) != 0) {
- this->flags |= 0x80;
+ COLLISION_ON(this);
sub_0803B59C(this);
}
}
@@ -943,8 +943,8 @@ void sub_0803B17C(Entity* this) {
GetNextFrame(this);
if ((this->frames.all & 0x80) != 0) {
this->action = 0x2b;
- this->flags |= 0x80;
- this->damageType = 0x18;
+ COLLISION_ON(this);
+ this->hitType = 0x18;
this->currentHealth = 0xff;
this->field_0x7c.HALF.HI = 600;
}
@@ -962,7 +962,7 @@ void sub_0803B1B8(Entity* this) {
this->action = 0x32;
this->field_0x7c.HALF.HI = 0x5dc;
this->spriteSettings.b.draw = 0;
- this->damageType = 0x14;
+ this->hitType = 0x14;
temp = CreateFx(this, FX_GIANT_EXPLOSION4, 0);
if (temp != (Entity*)0x0) {
temp->x.HALF.HI += this->hitbox->offset_x;
@@ -1068,7 +1068,7 @@ void sub_0803B3F4(Entity* this) {
this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
GetNextFrame(this);
if ((this->frames.all & 0x80) != 0) {
- this->damageType = 0x17;
+ this->hitType = 0x17;
if (this->type == 0) {
this->hitbox = (Hitbox*)&gUnk_080FD35C;
} else {
@@ -1185,7 +1185,7 @@ void sub_0803B6A4(Entity* this) {
Entity* temp;
this->action = 0x2c;
- this->damageType = 0x14;
+ this->hitType = 0x14;
temp = this->parent;
temp->field_0x80.HALF.LO |= (this->type == 0) ? 0x10 : 0x20;
temp->field_0x80.HALF.LO &= (this->type == 0) ? -5 : -9;
@@ -1264,12 +1264,12 @@ u32 sub_0803B870(Entity* this) {
gPlayerEntity.flags = gPlayerEntity.flags & 0x7f;
gPlayerEntity.iframes = -0x10;
sub_0803B824(this);
- entity->damageType = 0x13;
+ entity->hitType = 0x13;
InitAnimationForceUpdate(entity, 7);
SoundReq(SFX_16E);
return 1;
} else {
- entity->damageType = 0x15;
+ entity->hitType = 0x15;
return 0;
}
}
@@ -1277,9 +1277,9 @@ u32 sub_0803B870(Entity* this) {
void sub_0803B8E8(Entity* this, u32 unk) {
Entity* entity;
entity = this->attachedEntity;
- entity->damageType = unk;
+ entity->hitType = unk;
entity = (*(Entity**)&this->field_0x74);
- entity->damageType = unk;
+ entity->hitType = unk;
}
void sub_0803B8F8(Entity* this) {
diff --git a/src/enemy/mazaalHead.c b/src/enemy/mazaalHead.c
index a4b000e8..55199ec2 100644
--- a/src/enemy/mazaalHead.c
+++ b/src/enemy/mazaalHead.c
@@ -144,7 +144,7 @@ void sub_08033F3C(Entity* this) {
this->action = 0xd;
this->subAction = 0;
this->actionDelay = 0xfc;
- this->flags = this->flags & 0x7f;
+ COLLISION_OFF(this);
} else {
pEVar2 = CreateEnemy(MAZAAL_BRACELET, 0);
pEVar2->parent = this;
diff --git a/src/enemy/mazaalMacro.c b/src/enemy/mazaalMacro.c
index e9cf7191..2edf3d96 100644
--- a/src/enemy/mazaalMacro.c
+++ b/src/enemy/mazaalMacro.c
@@ -229,7 +229,7 @@ void sub_08034FA0(Entity* this) {
void sub_08035050(Entity* this) {
Entity* entity;
- this->flags = this->flags & 0x7f;
+ COLLISION_OFF(this);
this->currentHealth = 0;
entity = CreateEnemy(VAATI_PROJECTILE, 0);
if (entity != NULL) {
diff --git a/src/enemy/moldorm.c b/src/enemy/moldorm.c
index 1ee92567..909f3792 100644
--- a/src/enemy/moldorm.c
+++ b/src/enemy/moldorm.c
@@ -50,7 +50,7 @@ void sub_08022BEC(Entity* this) {
void sub_08022C58(Entity* this) {
Entity *tail0, *tail1, *tail2;
- this->flags &= ~0x80;
+ COLLISION_OFF(this);
if (gEntCount >= 0x45)
return;
@@ -77,7 +77,7 @@ void sub_08022C58(Entity* this) {
this->action = 1;
this->actionDelay = 1;
this->field_0xf = 1;
- this->flags = this->flags | 0x80;
+ COLLISION_ON(this);
this->parent = this;
this->attachedEntity = tail0;
*(Entity**)&this->field_0x7c = tail1;
diff --git a/src/enemy/moldworm.c b/src/enemy/moldworm.c
index 88ad48bf..9b53911f 100644
--- a/src/enemy/moldworm.c
+++ b/src/enemy/moldworm.c
@@ -67,7 +67,7 @@ void sub_080230E4(Entity* this) {
this->action = 7;
this->actionDelay = 1;
this->subAction = 0;
- this->damageType = 0x85;
+ this->hitType = 0x85;
this->iframes = -8;
this->field_0x7c.BYTES.byte3 = 0;
this->field_0x7a.HALF.HI = 0;
@@ -170,7 +170,7 @@ void sub_08023330(Entity* this) {
if (this->frames.all & 0x80) {
this->action = 4;
this->actionDelay = 0x19;
- this->flags |= 0x80;
+ COLLISION_ON(this);
this->field_0x78.HWORD = 600;
this->direction = Random() & 0x1c;
this->animationState = this->direction >> 2;
@@ -196,8 +196,8 @@ void sub_08023398(Entity* this) {
if (sub_08023A38(GetTileTypeByEntity(this))) {
this->action = 5;
this->field_0x7c.BYTES.byte3 = 0;
- this->flags = this->flags & 0x7f;
- this->damageType = 0x85;
+ COLLISION_OFF(this);
+ this->hitType = 0x85;
this->attachedEntity->actionDelay = 1;
sub_08023A68(this);
CreateFx(this, FX_ROCK, 0);
@@ -299,7 +299,7 @@ void sub_08023604(Entity* this) {
if (((u8*)&this->field_0x78)[this->parent->field_0x7c.BYTES.byte0 & 0xf] != 0x88) {
this->action = 2;
this->actionDelay = 0;
- this->flags |= 0x80;
+ COLLISION_ON(this);
this->spriteSettings.b.draw = 1;
sub_08023644(this);
}
@@ -311,7 +311,7 @@ void sub_08023644(Entity* this) {
if (parent->animIndex == 0x17 && this->actionDelay != 0 && this->x.HALF.HI == parent->x.HALF.HI &&
this->y.HALF.HI == parent->y.HALF.HI) {
this->action = 1;
- this->flags &= ~0x80;
+ COLLISION_OFF(this);
this->spriteSettings.b.draw = 0;
this->attachedEntity->actionDelay = 1;
sub_080239F0(this);
@@ -364,7 +364,7 @@ void sub_0802376C(Entity* this) {
if (((u8*)&this->field_0x78)[parent->field_0x7c.BYTES.byte0 & 0xf] != 0x88) {
this->action = 2;
this->actionDelay = 0;
- this->flags |= 0x80;
+ COLLISION_ON(this);
this->parent->field_0x7c.BYTES.byte3 = 1;
sub_08023A88(this, 20);
sub_080237D8(this);
@@ -377,7 +377,7 @@ void sub_080237D8(Entity* this) {
if (parent->animIndex == 0x17 && this->actionDelay != 0 && this->x.HALF.HI == parent->x.HALF.HI &&
this->y.HALF.HI == parent->y.HALF.HI) {
this->action = 1;
- this->flags &= ~0x80;
+ COLLISION_OFF(this);
this->spriteSettings.b.draw = 0;
parent->field_0x7c.BYTES.byte3 = 1;
sub_080239F0(this);
@@ -499,7 +499,7 @@ void sub_08023AB0(Entity* this) {
if (this->field_0x7c.BYTES.byte2) {
this->field_0x7c.BYTES.byte2--;
} else if (!sub_08023B38(this) || 0x1d >= this->field_0x78.HWORD) {
- this->damageType = 0x85;
+ this->hitType = 0x85;
this->field_0x7a.HALF.HI = 0;
this->field_0x7c.BYTES.byte2 = 30;
InitializeAnimation(this, this->animationState);
@@ -507,7 +507,7 @@ void sub_08023AB0(Entity* this) {
} else if (this->field_0x7c.BYTES.byte2) {
this->field_0x7c.BYTES.byte2--;
} else if (this->field_0x78.HWORD >= 90 && sub_08023B38(this)) {
- this->damageType = 0x87;
+ this->hitType = 0x87;
this->field_0x7a.HALF.HI = 8;
this->field_0x7c.BYTES.byte2 = 10;
InitializeAnimation(this, this->animationState + 8);
diff --git a/src/enemy/octorok.c b/src/enemy/octorok.c
index 525ad1bf..53794388 100644
--- a/src/enemy/octorok.c
+++ b/src/enemy/octorok.c
@@ -71,7 +71,7 @@ void sub_0801EB7C(Entity* this) {
}
void sub_0801EB84(Entity* this) {
- this->flags &= 0x7f;
+ COLLISION_OFF(this);
UpdateAnimationVariableFrames(this, 2);
}
@@ -80,8 +80,8 @@ void nullsub_3(Entity* this) {
}
void sub_0801EB9C(Entity* this) {
- if (this->flags & 0x80) {
- this->flags |= 0x80;
+ if (this->flags & ENT_COLLIDE) {
+ COLLISION_ON(this);
this->field_0x3a &= 0xfb;
} else {
this->currentHealth = 0;
diff --git a/src/enemy/peahat.c b/src/enemy/peahat.c
index 9a96a72d..6ac631b5 100644
--- a/src/enemy/peahat.c
+++ b/src/enemy/peahat.c
@@ -101,7 +101,7 @@ void sub_080200B4(Entity* this) {
if (this->animationState == PeahatAnimation_Flying) {
this->animationState = PeahatAnimation_BrokenPropeller;
this->action = 5;
- this->damageType = 0x71;
+ this->hitType = 0x71;
this->field_0x80.HALF.HI = 0;
InitializeAnimation(this, this->animationState);
}
@@ -116,15 +116,15 @@ void sub_080200EC(Entity* this) {
}
void sub_080200F4(Entity* this) {
- this->flags &= ~0x80;
+ COLLISION_OFF(this);
}
void nullsub_5(Entity* this) {
}
void sub_08020104(Entity* this) {
- if (this->flags & 0x80) {
- this->flags |= 0x80;
+ if (this->flags & ENT_COLLIDE) {
+ COLLISION_ON(this);
this->field_0x3a &= 0xfb;
} else {
this->currentHealth = 0;
@@ -230,7 +230,7 @@ void Peahat_Stunned(Entity* this) {
this->action = 6;
this->actionDelay = 240;
this->field_0xf = 10;
- this->damageType = 0x71;
+ this->hitType = 0x71;
}
if (this->direction == 0xff)
@@ -245,7 +245,7 @@ void Peahat_Stunned(Entity* this) {
this->action = 7;
this->actionDelay = 150;
this->field_0xf = 10;
- this->damageType = 0x71;
+ this->hitType = 0x71;
}
break;
};
@@ -310,7 +310,7 @@ void Peahat_Takeoff(Entity* this) {
GetNextFrame(this);
if (this->frames.all & 0x80) {
this->action = 1;
- this->damageType = 0x70;
+ this->hitType = 0x70;
this->field_0x82.HALF.LO = 1;
this->field_0x80.HALF.HI = 1;
this->animationState = PeahatAnimation_Flying;
diff --git a/src/enemy/pesto.c b/src/enemy/pesto.c
index b8247e34..6ee4a4da 100644
--- a/src/enemy/pesto.c
+++ b/src/enemy/pesto.c
@@ -49,7 +49,7 @@ void sub_08023F44(Entity* this) {
}
void sub_08023F5C(Entity* this) {
- if (this->damageType != 0x6e) {
+ if (this->hitType != 0x6e) {
if (this->bitfield == 0x80) {
this->field_0x86.HALF.LO = 0x30;
@@ -83,8 +83,8 @@ void sub_08023FF0(Entity* this) {
if (this->subAction < 3 && !sub_0806F520(this)) {
this->action = 1;
this->subAction = 0;
- this->flags |= 0x80;
- this->damageType = 0x77;
+ COLLISION_ON(this);
+ this->hitType = 0x77;
this->actionDelay = 1;
this->speed = 0x40;
} else {
@@ -108,9 +108,9 @@ void sub_08024058(Entity* this) {
}
void sub_08024060(Entity* this) {
- if (this->damageType != 0x6e) {
- this->flags = this->flags & 0x7f;
- this->damageType = 0x6e;
+ if (this->hitType != 0x6e) {
+ COLLISION_OFF(this);
+ this->hitType = 0x6e;
this->spriteRendering.b3 = gPlayerEntity.spriteRendering.b3;
}
diff --git a/src/enemy/puffstool.c b/src/enemy/puffstool.c
index 4225a61f..4688d174 100644
--- a/src/enemy/puffstool.c
+++ b/src/enemy/puffstool.c
@@ -66,7 +66,7 @@ void sub_08025020(Entity* this) {
this->field_0x82.HALF.LO -= gUnk_080CBFE8[(*(Entity**)&this->field_0x4c)->type];
} else {
this->cutsceneBeh.HWORD = 0x294;
- this->damageType = 0x83;
+ this->hitType = 0x83;
this->field_0x82.HALF.LO = 0;
sub_0801D2B4(this, 0x7c);
}
@@ -85,7 +85,7 @@ void sub_08025020(Entity* this) {
}
break;
default:
- if (this->damageType == 0x82 && this->iframes < 0) {
+ if (this->hitType == 0x82 && this->iframes < 0) {
Entity* ent = CreateObject(OBJECT_21, 2, 0);
if (ent != NULL) {
ent->spritePriority.b0 = 3;
@@ -131,7 +131,7 @@ void sub_080251AC(Entity* this) {
}
} else {
this->cutsceneBeh.HWORD = 0x294;
- this->damageType = 0x83;
+ this->hitType = 0x83;
this->field_0x82.HALF.LO = 0;
sub_0801D2B4(this, 0x7c);
}
@@ -275,7 +275,7 @@ void sub_080254B4(Entity* this) {
if (this->frames.all & 0x80) {
if (this->height.HALF.HI == 0) {
if (this->cutsceneBeh.HWORD == 0) {
- this->damageType = 0x82;
+ this->hitType = 0x82;
this->field_0x82.HALF.LO = -0x10;
sub_080256B4(this);
} else {
@@ -361,7 +361,7 @@ void sub_0802563C(Entity* this) {
if (--this->cutsceneBeh.HWORD == 0) {
sub_0801D2B4(this, 0x28);
- this->damageType = 0x82;
+ this->hitType = 0x82;
this->field_0x82.HALF.LO = 240;
sub_080256B4(this);
sub_0804AA1C(this);
diff --git a/src/enemy/rockChuchu.c b/src/enemy/rockChuchu.c
index e4f2bf30..3248714f 100644
--- a/src/enemy/rockChuchu.c
+++ b/src/enemy/rockChuchu.c
@@ -50,14 +50,14 @@ void sub_08022254(Entity* this) {
#endif
sub_0804A4E4(this, ent);
this->action = 2;
- this->flags &= ~0x80;
+ COLLISION_OFF(this);
this->spriteSettings.b.draw = 0;
this->direction = this->knockbackDirection;
this->attachedEntity = ent;
}
}
} else {
- if (this->damageType != 0x94)
+ if (this->hitType != 0x94)
InitializeAnimation(this, 2);
}
diff --git a/src/enemy/rollobite.c b/src/enemy/rollobite.c
index cafa618d..3316e6e5 100644
--- a/src/enemy/rollobite.c
+++ b/src/enemy/rollobite.c
@@ -30,12 +30,12 @@ void Rollobite_OnTick(Entity* this) {
}
void sub_08020668(Entity* this) {
- if (this->damageType == 34 && this->currentHealth != 0xff) {
+ if (this->hitType == 34 && this->currentHealth != 0xff) {
this->action = 4;
this->hVelocity = 0x20000;
this->direction = 0xff;
this->currentHealth = 0xff;
- this->damageType = 35;
+ this->hitType = 35;
InitializeAnimation(this, this->animationState + 8);
}
@@ -67,7 +67,7 @@ void sub_080206E0(Entity* this) {
void sub_08020734(Entity* this) {
if (this->subAction < 3 && !sub_0806F520(this)) {
this->action = 4;
- this->flags |= 0x80;
+ COLLISION_ON(this);
this->direction = 0xff;
InitializeAnimation(this, this->animationState + 0x10);
} else {
@@ -89,7 +89,7 @@ void sub_08020790(Entity* this) {
}
void sub_08020798(Entity* this) {
- this->flags &= ~0x80;
+ COLLISION_OFF(this);
}
void nullsub_6(Entity* this) {
@@ -98,7 +98,7 @@ void nullsub_6(Entity* this) {
void sub_080207A8(Entity* this) {
this->action = 4;
- this->flags |= 0x80;
+ COLLISION_ON(this);
this->spritePriority.b0 = 4;
this->field_0x3a &= 0xfb;
this->direction ^= 0x10;
@@ -139,7 +139,7 @@ void sub_08020874(Entity* this) {
void sub_0802088C(Entity* this) {
this->subAction = 1;
- this->flags &= ~0x80;
+ COLLISION_OFF(this);
this->cutsceneBeh.HALF.HI = gPlayerEntity.animationState;
this->spritePriority.b1 = 0;
}
@@ -159,7 +159,7 @@ void sub_080208F0(Entity* this) {
void sub_08020904(Entity* this) {
this->action = 4;
- this->flags |= 0x80;
+ COLLISION_ON(this);
this->direction = -1;
InitializeAnimation(this, this->animationState + 0x10);
}
@@ -195,9 +195,9 @@ void Rollobite_RolledUp(Entity* this) {
void Rollobite_Unroll(Entity* this) {
GetNextFrame(this);
if (this->frames.all & 0x80) {
- this->flags |= 0x80;
+ COLLISION_ON(this);
this->speed = 0x100;
- this->damageType = 34;
+ this->hitType = 34;
sub_08020A30(this);
this->direction = DirectionFromAnimationState(this->animationState);
InitializeAnimation(this, this->animationState);
@@ -257,7 +257,7 @@ bool32 Rollobite_TryToHoleUp(Entity* this) {
int iVar1 = GetTileType(tile, this->collisionLayer);
if ((iVar1 * 0x10000 - 0x710000U) >> 0x10 < 2) {
this->action = 6;
- this->flags &= ~0x80;
+ COLLISION_OFF(this);
this->x.HALF.HI &= 0xfff0;
this->x.HALF.HI += 8;
this->y.HALF.HI &= 0xfff0;
diff --git a/src/enemy/rupeeLike.c b/src/enemy/rupeeLike.c
index fd72c272..04c87bba 100644
--- a/src/enemy/rupeeLike.c
+++ b/src/enemy/rupeeLike.c
@@ -47,7 +47,7 @@ void sub_08029300(Entity* this) {
}
void sub_08029318(Entity* this) {
- if (this->damageType == 0x8e) {
+ if (this->hitType == 0x8e) {
sub_08029770(this);
} else {
if (this->action == 4) {
@@ -126,7 +126,7 @@ void sub_08029474(Entity* this) {
} else {
if (this->frames.all == 1) {
this->frames.all = 0;
- this->flags |= 0x80;
+ COLLISION_ON(this);
}
}
}
@@ -142,7 +142,7 @@ void sub_080294D4(Entity* this) {
sub_080296C8(this);
} else {
this->action = 6;
- this->flags &= 0x7f;
+ COLLISION_OFF(this);
InitializeAnimation(this, 3);
InitializeAnimation(this->attachedEntity, 7);
}
@@ -252,12 +252,12 @@ void sub_08029770(Entity* this) {
u32 temp;
if (LoadFixedGFX(this, 0x73) != 0) {
this->action = 2;
- this->flags = this->flags & 0x7f;
+ COLLISION_OFF(this);
this->spriteIndex = 0xd1;
this->spritePriority.b1 = 3;
temp = this->field_0x82.HALF.LO;
this->palette.b.b0 = temp;
- this->damageType = 0x8d;
+ this->hitType = 0x8d;
this->hitbox = &gUnk_080FD260;
InitializeAnimation(this, 2);
this->attachedEntity->spriteSettings.b.draw = TRUE;
@@ -270,9 +270,9 @@ void sub_080297F0(Entity* this) {
u32 temp;
this->action = 1;
this->actionDelay = 0x78;
- this->flags = this->flags | 0x80;
+ COLLISION_ON(this);
this->spriteSettings.b.draw = TRUE;
- this->damageType = 0x8e;
+ this->hitType = 0x8e;
sub_080AE068(this);
#ifdef EU
this->spriteIndex = 0x142;
diff --git a/src/enemy/smallPesto.c b/src/enemy/smallPesto.c
index 1d09e3c1..660a3110 100644
--- a/src/enemy/smallPesto.c
+++ b/src/enemy/smallPesto.c
@@ -36,7 +36,7 @@ void sub_0803169C(Entity* this) {
if (iVar1 == 0) {
this->action = 1;
this->subAction = 0;
- this->flags = this->flags | 0x80;
+ COLLISION_ON(this);
this->speed = 0x40;
this->field_0xf = 1;
} else {
diff --git a/src/enemy/spark.c b/src/enemy/spark.c
index 71e913c5..811bea88 100644
--- a/src/enemy/spark.c
+++ b/src/enemy/spark.c
@@ -20,7 +20,7 @@ void sub_0802B2E0(Entity* this) {
if (this->bitfield & 0x80) {
if ((this->bitfield & 0x7f) == 0x14) {
- this->flags &= ~0x80;
+ COLLISION_OFF(this);
this->iframes = 0;
this->spriteSettings.b.draw = 0;
this->action = 2;
diff --git a/src/enemy/spikedBeetle.c b/src/enemy/spikedBeetle.c
index 4884f873..9f3aa75f 100644
--- a/src/enemy/spikedBeetle.c
+++ b/src/enemy/spikedBeetle.c
@@ -54,7 +54,7 @@ void sub_0802B628(Entity* this) {
this->direction = this->knockbackDirection;
this->knockbackDuration = 0;
this->iframes = -8;
- this->damageType = 100;
+ this->hitType = 100;
InitializeAnimation(this, 9);
}
}
@@ -168,7 +168,7 @@ void sub_0802B8E0(Entity* this) {
this->action = 8;
this->hVelocity = 0x10000;
this->speed = 0x60;
- this->damageType = 99;
+ this->hitType = 99;
InitializeAnimation(this, this->animationState);
EnqueueSFX(299);
}
diff --git a/src/enemy/spinyChuchu.c b/src/enemy/spinyChuchu.c
index 5f928636..56872a16 100644
--- a/src/enemy/spinyChuchu.c
+++ b/src/enemy/spinyChuchu.c
@@ -33,13 +33,13 @@ void sub_08022434(Entity* this) {
void sub_0802244C(Entity* this) {
if (this->currentHealth) {
- if (this->damageType == 0x65) {
+ if (this->hitType == 0x65) {
switch (this->bitfield & 0x7f) {
case 2:
case 3:
this->action = 2;
this->field_0xf = 0x3c;
- this->damageType = 0x5c;
+ this->hitType = 0x5c;
this->hitbox = &gUnk_080FD468;
InitializeAnimation(this, 0);
break;
@@ -54,7 +54,7 @@ void sub_0802244C(Entity* this) {
case 0x1a:
sub_0804A9FC(this, 0x1c);
this->action = 5;
- this->damageType = 0x5c;
+ this->hitType = 0x5c;
InitializeAnimation(this, 1);
}
} else if (this->bitfield == 0x94) {
@@ -65,7 +65,7 @@ void sub_0802244C(Entity* this) {
if (this->field_0x80.HALF.LO != this->currentHealth) {
this->action = 5;
- this->damageType = 0x5c;
+ this->hitType = 0x5c;
InitializeAnimation(this, 1);
} else {
if (this->action == 3) {
@@ -141,7 +141,7 @@ void sub_08022654(Entity* this) {
GetNextFrame(this);
if (--this->actionDelay == 0) {
this->action = 3;
- this->damageType = 0x65;
+ this->hitType = 0x65;
InitializeAnimation(this, 2);
}
break;
@@ -152,7 +152,7 @@ void sub_080226EC(Entity* this) {
if (sub_08049FDC(this, 1)) {
if (sub_080228CC(this)) {
this->action = 3;
- this->damageType = 0x65;
+ this->hitType = 0x65;
InitializeAnimation(this, 2);
return;
}
@@ -162,7 +162,7 @@ void sub_080226EC(Entity* this) {
this->hVelocity = 0x12000;
this->speed = 0x140;
this->direction = GetFacingDirection(this, gUnk_020000B0);
- this->damageType = 0x5a;
+ this->hitType = 0x5a;
InitializeAnimation(this, 4);
return;
}
@@ -196,7 +196,7 @@ void sub_080227AC(Entity* this) {
if (this->frames.all & 2) {
this->frames.all &= ~2;
- this->damageType = 0x5c;
+ this->hitType = 0x5c;
}
if (this->frames.all & 0x80) {
@@ -223,7 +223,7 @@ void sub_08022854(Entity* this) {
sub_080AEFE0(this);
if (sub_08003FC4(this, 0x1800) == 0) {
this->action = 7;
- this->damageType = 0x5c;
+ this->hitType = 0x5c;
InitializeAnimation(this, 5);
EnqueueSFX(0x7d);
}
diff --git a/src/enemy/vaatiArm.c b/src/enemy/vaatiArm.c
index bd5d18f8..d001699a 100644
--- a/src/enemy/vaatiArm.c
+++ b/src/enemy/vaatiArm.c
@@ -355,7 +355,7 @@ void sub_080428FC(Entity* this) {
SoundReq(SFX_153);
uVar2 = 0;
do {
- ((VaatiArm_HeapStruct*)this->myHeap)->entities[uVar2]->damageType = 0x3b;
+ ((VaatiArm_HeapStruct*)this->myHeap)->entities[uVar2]->hitType = 0x3b;
uVar2 = uVar2 + 1;
} while (uVar2 < 5);
}
@@ -387,7 +387,7 @@ void sub_08042970(Entity* this) {
this->actionDelay = 0x3c;
uVar2 = 0;
do {
- ((VaatiArm_HeapStruct*)this->myHeap)->entities[uVar2]->damageType = 0x39;
+ ((VaatiArm_HeapStruct*)this->myHeap)->entities[uVar2]->hitType = 0x39;
uVar2 = uVar2 + 1;
} while (uVar2 < 5);
}
@@ -460,9 +460,9 @@ void sub_08042AEC(Entity* this) {
if (--this->actionDelay == 0) {
this->subAction = 3;
this->actionDelay = 4;
- this->damageType = 0x3d;
+ this->hitType = 0x3d;
InitAnimationForceUpdate(this, 0xe);
- ((VaatiArm_HeapStruct*)this->myHeap)->entities[1]->damageType = 0x3d;
+ ((VaatiArm_HeapStruct*)this->myHeap)->entities[1]->hitType = 0x3d;
}
}
@@ -508,8 +508,8 @@ void sub_08042B20(Entity* this) {
this->action = 5;
this->subAction = 0;
this->actionDelay = 0x1e;
- this->damageType = 0x39;
- ((VaatiArm_HeapStruct*)this->myHeap)->entities[1]->damageType = 0x39;
+ this->hitType = 0x39;
+ ((VaatiArm_HeapStruct*)this->myHeap)->entities[1]->hitType = 0x39;
}
}
}
@@ -565,7 +565,7 @@ void sub_08042C34(Entity* this) {
entity->x.HALF.HI = x;
entity->y.HALF.HI = y;
entity->height.HALF.HI = 0x32;
- entity->damageType = 0x39;
+ entity->hitType = 0x39;
ptr = &((VaatiArm_HeapStruct*)this->myHeap)->s1[i];
ptr->unk00.HWORD = 0x80;
ptr->unk04.HWORD = 0;
@@ -582,8 +582,8 @@ void sub_08042D24(Entity* this) {
if (--this->actionDelay == 0) {
this->subAction = 2;
- this->damageType = 0x3d;
- ((VaatiArm_HeapStruct*)this->myHeap)->entities[1]->damageType = 0x3d;
+ this->hitType = 0x3d;
+ ((VaatiArm_HeapStruct*)this->myHeap)->entities[1]->hitType = 0x3d;
entity = CreateObject(OBJECT_AF, 1, 0);
if (entity != NULL) {
entity->parent = ((VaatiArm_HeapStruct*)this->myHeap)->entities[3];
@@ -618,10 +618,10 @@ void sub_08042D6C(Entity* this) {
((VaatiArm_HeapStruct*)this->myHeap)->s1[0].unk0a = 0xc0;
this->subAction = 3;
this->actionDelay = 0x1e;
- this->damageType = 0x39;
+ this->hitType = 0x39;
this->field_0x7c.BYTES.byte3 = 0x2d;
InitAnimationForceUpdate(this, 0);
- ((VaatiArm_HeapStruct*)this->myHeap)->entities[1]->damageType = 0x39;
+ ((VaatiArm_HeapStruct*)this->myHeap)->entities[1]->hitType = 0x39;
} else {
entity->height.HALF.HI -= 2;
}
@@ -742,7 +742,7 @@ void sub_08043048(Entity* this) {
ptr[0].unk04.HWORD += 0x200;
if (0x4f < ptr[0].unk04.HALF.HI) {
for (i = 0; i < 5; i++) {
- ((VaatiArm_HeapStruct*)this->myHeap)->entities[i]->damageType = 0x3b;
+ ((VaatiArm_HeapStruct*)this->myHeap)->entities[i]->hitType = 0x3b;
}
SoundReq(SFX_153);
}
@@ -751,7 +751,7 @@ void sub_08043048(Entity* this) {
if (--this->actionDelay == 0) {
this->subAction = 7;
for (i = 0; i < 5; i++) {
- ((VaatiArm_HeapStruct*)this->myHeap)->entities[i]->damageType = 0x39;
+ ((VaatiArm_HeapStruct*)this->myHeap)->entities[i]->hitType = 0x39;
}
}
}
@@ -962,7 +962,7 @@ NONMATCH("asm/non_matching/vaati/sub_08043490.inc", void sub_08043490(Entity* th
entity->flags = entity->flags | 0x80;
entity->spriteSettings.b.draw = 1;
entity->field_0x3c = entity->field_0x3c & 0xef;
- entity->damageType = 0x3a;
+ entity->hitType = 0x3a;
entity->hitbox = (Hitbox*)&gUnk_080FD450;
entity = ((VaatiArm_HeapStruct*)this->myHeap)->entities[2];
entity->flags = entity->flags | 0x80;
@@ -1011,7 +1011,7 @@ void sub_08043580(Entity* this) {
this->actionDelay = 0x3c;
entity = ((VaatiArm_HeapStruct*)this->myHeap)->entities[4];
entity->field_0x3c = entity->field_0x3c | 0x10;
- entity->damageType = 0x39;
+ entity->hitType = 0x39;
entity->hitbox = (Hitbox*)&gUnk_080FD538;
sub_0804AA1C(this);
}
@@ -1341,7 +1341,7 @@ void sub_08043D08(Entity* this) {
CopyPosition(((VaatiArm_HeapStruct*)this->myHeap)->entities[3], entity);
entity->height.HALF.HI += ((VaatiArm_HeapStruct*)this->myHeap)->s1[3].unk0c;
for (i = 0; i < 5; i++) {
- ((VaatiArm_HeapStruct*)this->myHeap)->entities[i]->damageType = 0x39;
+ ((VaatiArm_HeapStruct*)this->myHeap)->entities[i]->hitType = 0x39;
}
EnqueueSFX(SFX_HIT);
}
@@ -1364,7 +1364,7 @@ void sub_08043DB0(Entity* this) {
gScreenTransition.field_0x3d = 0x1e - (cVar1 / 0x3c);
gScreenTransition.field_0x3c = this->type2;
pEVar2 = ((VaatiArm_HeapStruct*)this->myHeap)->parent;
- gScreenTransition.field_0x40 = pEVar2->x.HALF.HI;
+ gScreenTransition.hurtType = pEVar2->x.HALF.HI;
gScreenTransition.field_0x42 = pEVar2->y.HALF.HI;
pEVar4 = ((VaatiArm_HeapStruct*)pEVar2->myHeap)->parent;
if (pEVar4 != NULL) {
@@ -1391,7 +1391,7 @@ void sub_08043EB8(Entity* this) {
Entity* pEVar4;
VaatiArm_HeapStruct1* ptr;
- this->flags = this->flags | 0x80;
+ COLLISION_ON(this);
this->spritePriority.b0 = 4;
InitAnimationForceUpdate(this, 0xd);
pEVar4 = ((VaatiArm_HeapStruct*)this->myHeap)->entities[1];
@@ -1412,7 +1412,7 @@ void sub_08043EB8(Entity* this) {
pEVar4->y.HALF.HI = (this->type2 == 0) ? gScreenTransition.field_0x46 : gScreenTransition.field_0x4a;
pEVar4->height.HALF.HI = 0;
pEVar4->field_0x3c = pEVar4->field_0x3c & 0xef;
- pEVar4->damageType = 0x3a;
+ pEVar4->hitType = 0x3a;
pEVar4->hitbox = (Hitbox*)&gUnk_080FD450;
pEVar4 = CreateObject(OBJECT_AF, 0, 0);
if (pEVar4 != NULL) {
diff --git a/src/enemy/vaatiBall.c b/src/enemy/vaatiBall.c
index 00c3f24c..dca843d9 100644
--- a/src/enemy/vaatiBall.c
+++ b/src/enemy/vaatiBall.c
@@ -40,7 +40,7 @@ void VaatiBall(Entity* this) {
if (this->currentHealth < 0xfd) {
#endif
this->spriteSettings.b.draw = 0;
- this->flags &= 0x7f;
+ COLLISION_OFF(this);
this->currentHealth = -1;
parent->field_0x80.HALF.LO--;
CreateDust(this);
@@ -99,7 +99,7 @@ void sub_0804474C(Entity* this) {
case 2:
this->action = 2;
this->field_0x74.HALF.LO = 0;
- this->damageType = 0;
+ this->hitType = 0;
break;
}
@@ -121,14 +121,14 @@ void sub_080447E0(Entity* this) {
if (vaati->action == 1) {
this->action = 1;
- this->damageType = 43;
+ this->hitType = 43;
sub_08044E74(this, 0);
- if (this->flags & 0x80)
+ if (this->flags & ENT_COLLIDE)
this->spriteSettings.b.draw = 1;
} else {
this->field_0x76.HALF.HI++;
this->field_0x76.HALF.HI &= 7;
- if (this->flags & 0x80) {
+ if (this->flags & ENT_COLLIDE) {
if (this->field_0x76.HALF.HI & 1) {
this->spriteSettings.b.draw = 1;
} else {
@@ -190,7 +190,7 @@ void sub_08044868(Entity* this) {
vaati->type2 = 1;
vaati->parent = this;
this->cutsceneBeh.HALF.LO = 1;
- this->damageType = 0;
+ this->hitType = 0;
}
}
}
@@ -207,9 +207,9 @@ void sub_08044868(Entity* this) {
sub_08044E74(this, 1);
draw = this->spriteSettings.b.draw;
if (draw == 1) {
- this->flags |= 0x80;
+ COLLISION_ON(this);
} else {
- this->flags &= 0x7f;
+ COLLISION_OFF(this);
}
break;
}
@@ -390,7 +390,7 @@ void sub_08044B04(Entity* this) {
case 3:
this->field_0x74.HALF.LO = 1;
this->actionDelay = 80;
- this->flags &= 0x7f;
+ COLLISION_OFF(this);
PositionRelative(vaati, this, 0, -0x100000);
if (this->field_0xf)
this->spriteSettings.b.draw = 0;
@@ -429,9 +429,9 @@ void sub_08044B04(Entity* this) {
sub_08044E74(this, 1);
draw = this->spriteSettings.b.draw;
if (draw == 1) {
- this->flags |= 0x80;
+ COLLISION_ON(this);
} else {
- this->flags &= 0x7f;
+ COLLISION_OFF(this);
}
vaati->actionDelay++;
break;
@@ -452,7 +452,7 @@ void sub_08044DEC(Entity* this) {
} else {
this->spriteSettings.b.draw = 0;
}
- this->flags &= 0x7f;
+ COLLISION_OFF(this);
this->field_0x78.HALF.LO = 0;
this->speed = 0x300;
off = this->parent->field_0x80.HALF.LO - 1;
diff --git a/src/enemy/vaatiEyesMacro.c b/src/enemy/vaatiEyesMacro.c
index f2d3041d..86b5a739 100644
--- a/src/enemy/vaatiEyesMacro.c
+++ b/src/enemy/vaatiEyesMacro.c
@@ -146,7 +146,7 @@ void VaatiEyesMacroFunction0Type1Action0(Entity* this) {
void VaatiEyesMacroFunction0Type1Action1(Entity* this) {
if (this->parent->next == NULL) {
- this->flags &= 0x7f;
+ COLLISION_OFF(this);
this->currentHealth = 0;
} else {
sub_0802F04C(this);
diff --git a/src/enemy/vaatiProjectile.c b/src/enemy/vaatiProjectile.c
index a74de388..f86fb5ab 100644
--- a/src/enemy/vaatiProjectile.c
+++ b/src/enemy/vaatiProjectile.c
@@ -42,7 +42,7 @@ void (*const vaatiProjectileFunction0Actions[])(Entity*) = {
void VaatiProjectile(Entity* this) {
if (sub_0803E4A0(this)) {
- this->flags &= 0x7f;
+ COLLISION_OFF(this);
this->currentHealth = 0;
this->parent = NULL;
}
@@ -61,7 +61,7 @@ void VaatiProjectileFunction1(Entity* this) {
if (this->currentHealth != 0) {
#endif
this->action = 5;
- this->flags = this->flags & 0x7f;
+ COLLISION_OFF(this);
this->spritePriority.b1 = 0;
gPlayerEntity.flags &= 0x7f;
gPlayerEntity.spriteOrientation.flipY = this->spriteOrientation.flipY;
@@ -114,7 +114,7 @@ void VaatiProjectileFunction0Action0(Entity* this) {
}
} else {
this->action = 8;
- this->flags = this->flags & 0x7f;
+ COLLISION_OFF(this);
this->spriteOffsetY = 1;
this->spriteOrientation.flipY = this->parent->spriteOrientation.flipY;
this->spriteRendering.b3 = this->parent->spriteRendering.b3;
diff --git a/src/enemy/vaatiRebornEnemy.c b/src/enemy/vaatiRebornEnemy.c
index f96527e9..85c39122 100644
--- a/src/enemy/vaatiRebornEnemy.c
+++ b/src/enemy/vaatiRebornEnemy.c
@@ -514,13 +514,13 @@ void VaatiRebornEnemyType1Action1(Entity* this) {
if (this->field_0x74.HALF.LO == 0) {
if (parent->field_0x80.HALF.LO == 0) {
this->field_0x74.HALF.LO = 1;
- this->damageType = 0x30;
+ this->hitType = 0x30;
InitAnimationForceUpdate(this, this->field_0x74.HALF.LO);
}
} else {
if (parent->field_0x80.HALF.LO != 0) {
this->field_0x74.HALF.LO = 0;
- this->damageType = 0x2f;
+ this->hitType = 0x2f;
InitAnimationForceUpdate(this, this->field_0x74.HALF.LO);
} else {
if (((this->bitfield & 0x80) != 0) && (0 < this->iframes)) {
@@ -536,12 +536,12 @@ void VaatiRebornEnemyType1Action1(Entity* this) {
if (this->field_0x74.HALF.HI == 0) {
if (parent->action != 2) {
this->field_0x74.HALF.HI = 1;
- this->flags |= 0x80;
+ COLLISION_ON(this);
}
} else {
if (parent->action == 2) {
this->field_0x74.HALF.HI = 0;
- this->flags &= 0x7f;
+ COLLISION_OFF(this);
}
}
this->spriteSettings.b.draw = parent->spriteSettings.b.draw;
@@ -644,7 +644,7 @@ void sub_0803DC0C(Entity* this) {
void VaatiRebornEnemyType1PreAction(Entity* this) {
Entity* parent;
- if (this->damageType != 0x30) {
+ if (this->hitType != 0x30) {
return;
}
parent = this->parent;
@@ -652,7 +652,7 @@ void VaatiRebornEnemyType1PreAction(Entity* this) {
if ((this->bitfield & 0x80) != 0) {
if (gUnk_080D04D0[parent->field_0x86.HALF.LO] > this->currentHealth) {
if (2 < ++parent->field_0x86.HALF.LO) {
- this->flags &= 0x7f;
+ COLLISION_OFF(this);
parent->action = 7;
parent->flags &= 0x7f;
parent->actionDelay = 0x80;
@@ -675,7 +675,7 @@ void VaatiRebornEnemyType1PreAction(Entity* this) {
}
if (this->actionDelay != 0) {
if (--this->actionDelay == 0) {
- this->damageType = 0x2f;
+ this->hitType = 0x2f;
this->field_0x74.HALF.LO = 1;
if (this->field_0x76.HALF.HI == 0) {
parent->field_0x74.HALF.LO = 0xf0;
diff --git a/src/enemy/vaatiTransfigured.c b/src/enemy/vaatiTransfigured.c
index 757d6544..0933b1eb 100644
--- a/src/enemy/vaatiTransfigured.c
+++ b/src/enemy/vaatiTransfigured.c
@@ -269,14 +269,14 @@ void VaatiTransfiguredType0Action3(Entity* this) {
break;
this->field_0x80.HALF.LO = 1;
this->actionDelay = 0xc0;
- this->flags |= 0x80;
+ COLLISION_ON(this);
SoundReq(SFX_14C);
sub_08080964(0x14, 4);
break;
case 1:
if (--this->actionDelay == 0) {
this->field_0x80.HALF.LO = 2;
- this->damageType = 0x35;
+ this->hitType = 0x35;
this->spriteOffsetX = 0;
}
if (this->currentHealth < gUnk_080D0ABC[this->animationState]) {
@@ -287,7 +287,7 @@ void VaatiTransfiguredType0Action3(Entity* this) {
}
if (tmp) {
this->field_0x80.HALF.LO = 2;
- this->damageType = 0x35;
+ this->hitType = 0x35;
this->spriteOffsetX = 0;
this->animationState++;
if (this->animationState > 2) {
@@ -312,7 +312,7 @@ void VaatiTransfiguredType0Action3(Entity* this) {
case 3:
if (this->actionDelay != 0) {
if (--this->actionDelay == 0) {
- this->flags &= 0x7f;
+ COLLISION_OFF(this);
this->hVelocity = 0x38000;
this->field_0xf = 0x10;
}
@@ -321,7 +321,7 @@ void VaatiTransfiguredType0Action3(Entity* this) {
if (sub_08003FC4(this, 0x2800) == 0) {
this->field_0x80.HALF.LO = 5;
this->actionDelay = 0x10;
- this->flags |= 0x80;
+ COLLISION_ON(this);
this->currentHealth = 0xff;
this->field_0x86.HALF.LO = 0;
sub_080408EC(this);
@@ -1059,8 +1059,8 @@ void sub_080409B0(Entity* this) {
this->action = 3;
this->field_0x80.HALF.LO = 0;
this->field_0x80.HALF.HI = 3;
- this->flags &= 0x7f;
- this->damageType = 0x36;
+ COLLISION_OFF(this);
+ this->hitType = 0x36;
this->hVelocity = 0x18000;
SoundReq(SFX_164);
}
diff --git a/src/enemy/vaatiTransfiguredEye.c b/src/enemy/vaatiTransfiguredEye.c
index a4cf8999..a6777666 100644
--- a/src/enemy/vaatiTransfiguredEye.c
+++ b/src/enemy/vaatiTransfiguredEye.c
@@ -125,7 +125,7 @@ void VaatiTransfiguredEyeFunction0Action1(Entity* this) {
if (this->field_0x82.HALF.LO == 0) {
if ((this->frames.all & 0x80) != 0) {
if (this->type != 0) {
- this->flags |= 0x80;
+ COLLISION_ON(this);
}
this->action = 2;
InitializeAnimation(this, this->type << 3);
@@ -149,7 +149,7 @@ void VaatiTransfiguredEyeFunction0Action2(Entity* this) {
this->action = 4;
this->field_0xf = 0;
if (this->type != 0) {
- this->flags &= 0x7f;
+ COLLISION_OFF(this);
if (this->actionDelay != 0) {
InitializeAnimation(this, this->type << 3 | 5);
InitializeAnimation(this->parent, this->parent->type << 3 | 5);
@@ -167,10 +167,10 @@ void VaatiTransfiguredEyeFunction0Action3(Entity* this) {
this->action = 2;
if (this->type != 0) {
if (this->actionDelay == 0) {
- this->damageType = 0x32;
+ this->hitType = 0x32;
} else {
this->parent->parent->field_0x76.HALF.LO |= (1 << this->type2);
- this->damageType = 0x31;
+ this->hitType = 0x31;
}
}
}
@@ -195,7 +195,7 @@ void VaatiTransfiguredEyeFunction0Action4(Entity* this) {
this->field_0x80.HALF.HI = 0;
this->cutsceneBeh.HALF.HI = 0;
if (this->type != 0) {
- this->damageType = 0x33;
+ this->hitType = 0x33;
}
if ((parent->field_0x74.HALF.HI >> this->type2 & 1U) != 0) {
this->actionDelay = 1;
diff --git a/src/enemy/vaatiWrath.c b/src/enemy/vaatiWrath.c
index 08b5cb85..23063fc3 100644
--- a/src/enemy/vaatiWrath.c
+++ b/src/enemy/vaatiWrath.c
@@ -104,7 +104,7 @@ const s8 gUnk_080D0EB0[] = { 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x0
void VaatiWrath(Entity* this) {
if (((this->type == 0) && ((this->bitfield & 0x80) != 0)) && (this->currentHealth == 0)) {
- this->flags |= 0x80;
+ COLLISION_ON(this);
this->currentHealth = 0xff;
if (--this->cutsceneBeh.HALF.LO == 0) {
this->action = 0xd;
@@ -138,7 +138,7 @@ void VaatiWrathType0Action0(Entity* this) {
this->action = 2;
this->actionDelay = 0x3c;
}
- this->x.HALF.HI = gScreenTransition.field_0x40;
+ this->x.HALF.HI = gScreenTransition.hurtType;
this->y.HALF.HI = gScreenTransition.field_0x42;
sub_08042004(this);
} else {
@@ -480,7 +480,7 @@ void VaatiWrathType0ActionB(Entity* this) {
this->subAction = 1;
this->actionDelay = 0xf0;
this->currentHealth = 8;
- this->damageType = 0x38;
+ this->hitType = 0x38;
sub_08080964(0x14, 0);
InitAnimationForceUpdate(this, 6);
InitializeAnimation(((VaatiWrathHeapStruct*)this->myHeap)->type2, 0x16);
@@ -492,7 +492,7 @@ void VaatiWrathType0ActionB(Entity* this) {
if (--this->actionDelay == 0) {
this->subAction = 2;
this->actionDelay = 0x3c;
- this->damageType = 0x39;
+ this->hitType = 0x39;
this->currentHealth = 0xff;
}
break;
@@ -567,7 +567,7 @@ void sub_08041BE8(Entity* this) {
if (sub_08079F8C() != 0) {
this->subAction = 1;
this->actionDelay = 120;
- this->scriptedScene = 3;
+ this->updateConditions = 3;
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->scriptedScene = 3;
+ entity->updateConditions = 3;
sub_080AE068(entity);
LoadFixedGFX(entity, 0x1f5);
sub_0801D2B4(entity, 0x16b);
diff --git a/src/enemy/vaatiWrathEye.c b/src/enemy/vaatiWrathEye.c
index 2fd855f5..f33e4009 100644
--- a/src/enemy/vaatiWrathEye.c
+++ b/src/enemy/vaatiWrathEye.c
@@ -62,7 +62,7 @@ void VaatiWrathEyeAction2(Entity* this) {
sub_080485D8(this);
if ((gScreenTransition.field_0x39 & 3) == 0) {
this->action = 3;
- this->flags |= 0x80;
+ COLLISION_ON(this);
this->speed = 0x80;
}
}
@@ -157,7 +157,7 @@ void VaatiWrathEyeAction7(Entity* this) {
if (this->field_0xf != 0) {
this->action = 8;
this->actionDelay = 0x3c;
- this->flags &= 0x7f;
+ COLLISION_OFF(this);
this->spriteSettings.b.draw = 0;
CreateFx(this, FX_REFLECT2, 0x40);
this->parent->field_0x7a.HALF.HI |= 0x10 << this->type;
@@ -177,7 +177,7 @@ void VaatiWrathEyeAction8(Entity* this) {
} else {
if (--this->actionDelay == 0) {
this->action = 9;
- this->flags |= 0x80;
+ COLLISION_ON(this);
this->spriteSettings.b.draw = 1;
InitializeAnimation(this, 0);
sub_080485FC(this);
diff --git a/src/enemy/wallMaster.c b/src/enemy/wallMaster.c
index 9a3ae8d2..7107cf9c 100644
--- a/src/enemy/wallMaster.c
+++ b/src/enemy/wallMaster.c
@@ -26,9 +26,9 @@ void sub_0802A434(Entity* this) {
}
void sub_0802A454(Entity* this) {
- if (this->damageType != 0x75 && ((this->bitfield & 0x7f) == 0 || (this->bitfield & 0x7f) == 0x1e)) {
+ if (this->hitType != 0x75 && ((this->bitfield & 0x7f) == 0 || (this->bitfield & 0x7f) == 0x1e)) {
this->action = 5;
- this->flags &= ~0x80;
+ COLLISION_OFF(this);
this->field_0x7c.HALF.HI = gPlayerEntity.x.HALF.HI;
this->field_0x80.HWORD = gPlayerEntity.y.HALF.HI;
this->field_0x82.HWORD = gPlayerEntity.height.HALF.HI;
@@ -72,7 +72,7 @@ void sub_0802A534(Entity* this) {
if (ent != NULL) {
this->action = 2;
this->actionDelay = 0x5a;
- this->flags |= 0x80;
+ COLLISION_ON(this);
this->spriteSettings.b.draw = 3;
this->x.HALF.HI = ent->x.HALF.HI;
this->y.HALF.HI = ent->y.HALF.HI;
@@ -115,7 +115,7 @@ void sub_0802A610(Entity* this) {
this->actionDelay = 0x1e;
} else if (this->frames.all & 1) {
this->frames.all = flags;
- this->damageType = 0x75;
+ this->hitType = 0x75;
}
}
@@ -124,9 +124,9 @@ void sub_0802A650(Entity* this) {
this->height.HALF.HI -= 2;
if (-0xa0 > this->height.HALF.HI) {
this->action = 1;
- this->flags &= ~0x80;
+ COLLISION_OFF(this);
this->spriteSettings.b.draw = 0;
- this->damageType = 0x74;
+ this->hitType = 0x74;
this->field_0x78.HWORD = this->field_0x7c.BYTES.byte0 * 0x3c;
}
}
diff --git a/src/enemy/wallMaster2.c b/src/enemy/wallMaster2.c
index 26074c7d..d21ca8a2 100644
--- a/src/enemy/wallMaster2.c
+++ b/src/enemy/wallMaster2.c
@@ -33,7 +33,7 @@ void sub_0802CC80(Entity* this) {
case 0 ... 1:
case 0x1e:
this->action = 3;
- this->flags &= ~0x80;
+ COLLISION_OFF(this);
InitializeAnimation(this, 1);
gPlayerEntity.flags &= ~0x80;
break;
diff --git a/src/enemy/waterDrop.c b/src/enemy/waterDrop.c
index 73fc59eb..0625569c 100644
--- a/src/enemy/waterDrop.c
+++ b/src/enemy/waterDrop.c
@@ -55,7 +55,7 @@ void sub_0802A2FC(Entity* this) {
if (this->frames.all & 0x80) {
DeleteEntity(this);
} else if (this->frames.all & 1) {
- this->flags &= ~0x80;
+ COLLISION_OFF(this);
} else {
sub_0802A39C(this);
}
@@ -76,9 +76,9 @@ void sub_0802A39C(Entity* this) {
u32 x = (gPlayerEntity.x.HALF.HI - gRoomControls.roomScrollX + gScreen.bg.bg1xOffset) >> 3;
u32 y = (gPlayerEntity.y.HALF.HI - gRoomControls.roomScrollY + gScreen.bg.bg1yOffset - 10) >> 3;
if (gBG3Buffer[(x & 0x1fU) + (y & 0x1fU) * 0x20 + 0x400]) {
- this->flags &= ~0x80;
+ COLLISION_OFF(this);
} else {
- this->flags |= 0x80;
+ COLLISION_ON(this);
}
}
diff --git a/src/enemy/wisp.c b/src/enemy/wisp.c
index 05fdc4e0..734b47df 100644
--- a/src/enemy/wisp.c
+++ b/src/enemy/wisp.c
@@ -35,7 +35,7 @@ void sub_08033564(Entity* this) {
case 0:
this->action = 2;
this->spriteSettings.b.draw = FALSE;
- this->flags &= 0x7f;
+ COLLISION_OFF(this);
this->field_0x7c.HALF.LO = 0x27c;
gPlayerState.flags |= 0x4000;
gSave.stats.effect = this->type + 1;
@@ -50,7 +50,7 @@ void sub_08033564(Entity* this) {
this->currentHealth = 0;
break;
case 0x14:
- this->flags &= 0x7f;
+ COLLISION_OFF(this);
this->iframes = 0;
this->spriteSettings.b.draw = FALSE;
ent = CreateFx(this, FX_DEATH, 0);
@@ -119,7 +119,7 @@ void sub_080336DC(Entity* this) {
break;
case 0x0:
this->action = 1;
- this->flags |= 0x80;
+ COLLISION_ON(this);
sub_08033744(this);
break;
}