summaryrefslogtreecommitdiff
path: root/src/enemy
diff options
context:
space:
mode:
authortheo3 <arisstephenson2@gmail.com>2023-12-30 21:07:06 -0800
committertheo3 <arisstephenson2@gmail.com>2023-12-30 21:07:06 -0800
commit5049daabc59d113152143d123aea2798d9487a0c (patch)
treeb502c841b46f25267be35f3986bd90ef45cba9da /src/enemy
parentbd1be092aa85e4eb1d368bef05c88eaae2a0ae84 (diff)
label contact flags
Diffstat (limited to 'src/enemy')
-rw-r--r--src/enemy/acroBandits.c2
-rw-r--r--src/enemy/armos.c2
-rw-r--r--src/enemy/beetle.c4
-rw-r--r--src/enemy/bobomb.c2
-rw-r--r--src/enemy/bowMoblin.c2
-rw-r--r--src/enemy/chaser.c2
-rw-r--r--src/enemy/chuchuBoss.c4
-rw-r--r--src/enemy/cloudPiranha.c2
-rw-r--r--src/enemy/crow.c2
-rw-r--r--src/enemy/darkNut.c3
-rw-r--r--src/enemy/enemy50.c8
-rw-r--r--src/enemy/eyegore.c6
-rw-r--r--src/enemy/flyingPot.c2
-rw-r--r--src/enemy/flyingSkull.c2
-rw-r--r--src/enemy/ghini.c4
-rw-r--r--src/enemy/gibdo.c4
-rw-r--r--src/enemy/gleerok.c4
-rw-r--r--src/enemy/hangingSeed.c2
-rw-r--r--src/enemy/keaton.c2
-rw-r--r--src/enemy/leever.c2
-rw-r--r--src/enemy/likeLike.c4
-rw-r--r--src/enemy/madderpillar.c4
-rw-r--r--src/enemy/mazaalBracelet.c4
-rw-r--r--src/enemy/moldworm.c6
-rw-r--r--src/enemy/mulldozer.c2
-rw-r--r--src/enemy/peahat.c6
-rw-r--r--src/enemy/pesto.c2
-rw-r--r--src/enemy/rockChuchu.c2
-rw-r--r--src/enemy/rollobite.c4
-rw-r--r--src/enemy/scissorsBeetle.c2
-rw-r--r--src/enemy/spark.c2
-rw-r--r--src/enemy/spearMoblin.c4
-rw-r--r--src/enemy/spinyBeetle.c2
-rw-r--r--src/enemy/spinyChuchu.c2
-rw-r--r--src/enemy/takkuri.c2
-rw-r--r--src/enemy/tektite.c2
-rw-r--r--src/enemy/tektiteGolden.c2
-rw-r--r--src/enemy/vaatiArm.c6
-rw-r--r--src/enemy/vaatiBall.c2
-rw-r--r--src/enemy/vaatiProjectile.c2
-rw-r--r--src/enemy/vaatiRebornEnemy.c4
-rw-r--r--src/enemy/vaatiTransfigured.c4
-rw-r--r--src/enemy/vaatiTransfiguredEye.c2
-rw-r--r--src/enemy/vaatiWrath.c2
-rw-r--r--src/enemy/wisp.c2
-rw-r--r--src/enemy/wizzrobeIce.c2
-rw-r--r--src/enemy/wizzrobeWind.c2
47 files changed, 71 insertions, 70 deletions
diff --git a/src/enemy/acroBandits.c b/src/enemy/acroBandits.c
index ac12c313..73911ecf 100644
--- a/src/enemy/acroBandits.c
+++ b/src/enemy/acroBandits.c
@@ -96,7 +96,7 @@ void AcroBandit_OnTick(AcroBanditEntity* this) {
void AcroBandit_OnCollision(AcroBanditEntity* this) {
Entity* brother;
- if (super->contactFlags != 0x80 && super->contactFlags != 0x81) {
+ if (super->contactFlags != CONTACT_TAKE_DAMAGE && super->contactFlags != (CONTACT_TAKE_DAMAGE | 0x1)) {
if (super->type == 1) {
if (super->action < 7 && super->knockbackDuration != 0) {
brother = super->child;
diff --git a/src/enemy/armos.c b/src/enemy/armos.c
index 2824b950..bd164871 100644
--- a/src/enemy/armos.c
+++ b/src/enemy/armos.c
@@ -337,7 +337,7 @@ bool32 sub_080305BC(ArmosEntity* this) {
bool32 sub_08030650(ArmosEntity* this) {
if (super->type == 0) {
- if (super->contactFlags == 0x80) {
+ if (super->contactFlags == CONTACT_TAKE_DAMAGE) {
return 1;
}
} else if (this->unk_80 != 2) {
diff --git a/src/enemy/beetle.c b/src/enemy/beetle.c
index 10263a30..75924746 100644
--- a/src/enemy/beetle.c
+++ b/src/enemy/beetle.c
@@ -35,7 +35,7 @@ void Beetle_OnTick(BeetleEntity* this) {
void Beetle_OnCollision(BeetleEntity* this) {
switch (super->contactFlags) {
- case 0x80:
+ case CONTACT_TAKE_DAMAGE:
if (gPlayerState.framestate == PL_STATE_CLIMB) {
Beetle_OnTick(this);
} else {
@@ -50,7 +50,7 @@ void Beetle_OnCollision(BeetleEntity* this) {
InitializeAnimation(super, 6);
}
break;
- case 0x93:
+ case CONTACT_TAKE_DAMAGE | 0x13:
Beetle_OnTick(this);
break;
}
diff --git a/src/enemy/bobomb.c b/src/enemy/bobomb.c
index f007f779..7dfae72e 100644
--- a/src/enemy/bobomb.c
+++ b/src/enemy/bobomb.c
@@ -38,7 +38,7 @@ void Bobomb_OnTick(BobombEntity* this) {
}
void Bobomb_OnCollision(BobombEntity* this) {
- if (super->contactFlags & 0x80) {
+ if (super->contactFlags & CONTACT_TAKE_DAMAGE) {
switch (super->contactFlags & 0x7f) {
case 0:
case 1:
diff --git a/src/enemy/bowMoblin.c b/src/enemy/bowMoblin.c
index 3a86b016..6a1176ee 100644
--- a/src/enemy/bowMoblin.c
+++ b/src/enemy/bowMoblin.c
@@ -56,7 +56,7 @@ void BowMoblin_OnCollision(BowMoblinEntity* this) {
EnemyCreateFX(super, FX_STARS);
}
EnemyFunctionHandlerAfterCollision(super, (EntityActionArray)BowMoblin_Functions);
- if ((super->contactFlags & 0x80) != 0) {
+ if (super->contactFlags & CONTACT_TAKE_DAMAGE) {
sub_0803C5F0(this);
pEVar1 = super->child;
if (pEVar1 != NULL) {
diff --git a/src/enemy/chaser.c b/src/enemy/chaser.c
index 9255b1f1..3c374cd4 100644
--- a/src/enemy/chaser.c
+++ b/src/enemy/chaser.c
@@ -43,7 +43,7 @@ void sub_0802B540(Entity* this) {
void sub_0802B56C(Entity* this) {
GetNextFrame(this);
- if (this->contactFlags & 0x80) {
+ if (this->contactFlags & CONTACT_TAKE_DAMAGE) {
this->speed = 0x40;
}
diff --git a/src/enemy/chuchuBoss.c b/src/enemy/chuchuBoss.c
index ca490003..0f054bdd 100644
--- a/src/enemy/chuchuBoss.c
+++ b/src/enemy/chuchuBoss.c
@@ -1346,7 +1346,7 @@ void sub_080272D4(ChuchuBossEntity* this) {
super->hitbox->height = (u32)((0x10000 / this->unk_74.HALF_U.HI) * 5) >> 6;
if (*(char*)&this->unk_84 == 0)
break;
- if ((super->contactFlags & 0x80) != 0) {
+ if (super->contactFlags & CONTACT_TAKE_DAMAGE) {
if (super->iframes != 0) {
((ChuchuBossEntity*)super->child)->unk_68->base.iframes = super->iframes;
super->child->parent->iframes = super->iframes;
@@ -1697,7 +1697,7 @@ bool32 sub_08027AA4(ChuchuBossEntity* this) {
s32 iVar4;
Helper* pHelper;
- if ((super->contactFlags & 0x80) == 0) {
+ if ((super->contactFlags & CONTACT_TAKE_DAMAGE) == 0) {
return FALSE;
}
switch (super->contactFlags & 0x7f) {
diff --git a/src/enemy/cloudPiranha.c b/src/enemy/cloudPiranha.c
index 14296cd6..64bf98cc 100644
--- a/src/enemy/cloudPiranha.c
+++ b/src/enemy/cloudPiranha.c
@@ -58,7 +58,7 @@ void CloudPiranha_OnCollision(CloudPiranhaEntity* this) {
EnemyCreateFX(super, FX_STARS);
}
EnemyFunctionHandlerAfterCollision(super, gUnk_080CF4F0);
- if ((super->contactFlags & 0x80) != 0) {
+ if (super->contactFlags & CONTACT_TAKE_DAMAGE) {
if (super->hitType == 0x5a) {
switch (super->contactFlags & 0x3f) {
case 0x14:
diff --git a/src/enemy/crow.c b/src/enemy/crow.c
index 4f0c587b..c540e4ae 100644
--- a/src/enemy/crow.c
+++ b/src/enemy/crow.c
@@ -44,7 +44,7 @@ void Crow_OnTick(CrowEntity* this) {
}
void Crow_OnCollision(CrowEntity* this) {
- if (super->contactFlags & 0x80) {
+ if (super->contactFlags & CONTACT_TAKE_DAMAGE) {
if ((super->contactFlags & 0x3f) == 0) {
COLLISION_OFF(super);
super->subtimer = 16;
diff --git a/src/enemy/darkNut.c b/src/enemy/darkNut.c
index f5d0919e..39820a64 100644
--- a/src/enemy/darkNut.c
+++ b/src/enemy/darkNut.c
@@ -335,7 +335,8 @@ void sub_080210E4(DarkNutEntity* this) {
}
sub_08021644(this);
- if ((super->frame & 0x10) && (!ProcessMovement0(super) || (super->child && (super->child->contactFlags & 0x80)))) {
+ if ((super->frame & 0x10) &&
+ (!ProcessMovement0(super) || (super->child && (super->child->contactFlags & CONTACT_TAKE_DAMAGE)))) {
sub_080213D0(this, 0);
} else {
if (--this->unk_76 == 0)
diff --git a/src/enemy/enemy50.c b/src/enemy/enemy50.c
index 3839aabf..9987ee88 100644
--- a/src/enemy/enemy50.c
+++ b/src/enemy/enemy50.c
@@ -79,15 +79,15 @@ void Enemy50_OnCollision(Enemy50Entity* this) {
sub_08041134(this);
sub_0803F6EC(this);
}
- if (super->hitType == 0x25 && super->contactFlags == 0x80) {
+ if (super->hitType == 0x25 && super->contactFlags == CONTACT_TAKE_DAMAGE) {
super->action = 8;
InitializeAnimation(super, 3);
} else {
- if (super->contactFlags == 0x80) {
+ if (super->contactFlags == CONTACT_TAKE_DAMAGE) {
this->unk_7c = 0x78;
sub_08041128(this);
}
- if (super->contactFlags == 0x9d) {
+ if (super->contactFlags == (CONTACT_TAKE_DAMAGE | 0x1d)) {
super->zVelocity = Q_16_16(1.5);
}
if (super->confusedTime != 0) {
@@ -422,7 +422,7 @@ void sub_0804122C(Enemy50Entity* this) {
#ifndef EU
bool32 sub_08041300(Enemy50Entity* this) {
- if ((super->hitType == 0x25) && (super->contactFlags == 0x80)) {
+ if ((super->hitType == 0x25) && (super->contactFlags == CONTACT_TAKE_DAMAGE)) {
return TRUE;
} else {
return super->action == 8 || super->action == 9;
diff --git a/src/enemy/eyegore.c b/src/enemy/eyegore.c
index 9c8eb9e1..b023469c 100644
--- a/src/enemy/eyegore.c
+++ b/src/enemy/eyegore.c
@@ -82,14 +82,14 @@ void Eyegore_OnTick(EyegoreEntity* this) {
void Eyegore_OnCollision(EyegoreEntity* this) {
u32 tmp;
- if ((super->contactFlags == 0x95) || (super->contactFlags == 0x8e)) {
+ if ((super->contactFlags == (CONTACT_TAKE_DAMAGE | 0x15)) || (super->contactFlags == (CONTACT_TAKE_DAMAGE | 0xe))) {
Entity* entity = super->contactedEntity;
tmp = (((entity->direction + 4) & 0x18) ^ 0x10) >> 3;
if (tmp == super->animationState) {
if ((tmp & 1) != 0) {
if (0x10 < ((entity->y.HALF.HI + entity->z.HALF.HI) - (super->y.HALF.HI + super->z.HALF.HI)) + 0x14U) {
} else {
- if (super->contactFlags == 0x8e) {
+ if (super->contactFlags == (CONTACT_TAKE_DAMAGE | 0xe)) {
super->health = 0;
} else {
super->health--;
@@ -105,7 +105,7 @@ void Eyegore_OnCollision(EyegoreEntity* this) {
EnqueueSFX(SFX_BUTTON_PRESS);
sub_08031344(this);
} else {
- if (super->contactFlags == 0x8e) {
+ if (super->contactFlags == (CONTACT_TAKE_DAMAGE | 0xe)) {
super->health = 0;
} else {
super->health--;
diff --git a/src/enemy/flyingPot.c b/src/enemy/flyingPot.c
index 8c4159d4..74f0a3b5 100644
--- a/src/enemy/flyingPot.c
+++ b/src/enemy/flyingPot.c
@@ -93,7 +93,7 @@ void FlyingPot_OnTick(FlyingPotEntity* this) {
void FlyingPot_OnCollision(FlyingPotEntity* this) {
sub_08037418(this);
- if (super->contactFlags == 0x9D) {
+ if (super->contactFlags == (CONTACT_TAKE_DAMAGE | 0x1d)) {
super->action = FLYING_POT_ACTION_6;
COLLISION_OFF(super);
super->zVelocity = Q_16_16(2.625);
diff --git a/src/enemy/flyingSkull.c b/src/enemy/flyingSkull.c
index 17c46040..7318f358 100644
--- a/src/enemy/flyingSkull.c
+++ b/src/enemy/flyingSkull.c
@@ -45,7 +45,7 @@ void FlyingSkull_OnTick(FlyingSkullEntity* this) {
void FlyingSkull_OnCollision(FlyingSkullEntity* this) {
sub_0803A100(this);
- if (super->contactFlags == 0x9d) {
+ if (super->contactFlags == (CONTACT_TAKE_DAMAGE | 0x1d)) {
super->action = 7;
COLLISION_OFF(super);
super->zVelocity = Q_16_16(2.625);
diff --git a/src/enemy/ghini.c b/src/enemy/ghini.c
index e49b8293..87a9c402 100644
--- a/src/enemy/ghini.c
+++ b/src/enemy/ghini.c
@@ -59,11 +59,11 @@ void Ghini_OnCollision(GhiniEntity* this) {
sub_0803F630(this);
sub_0803F6EC(this);
}
- if ((super->hitType == 0x25) && (super->contactFlags == 0x80)) {
+ if ((super->hitType == 0x25) && (super->contactFlags == CONTACT_TAKE_DAMAGE)) {
super->action = 8;
InitializeAnimation(super, 3);
} else {
- if (super->contactFlags == 0x9d) {
+ if (super->contactFlags == (CONTACT_TAKE_DAMAGE | 0x1d)) {
super->zVelocity = 0x18000;
}
if (super->confusedTime != 0) {
diff --git a/src/enemy/gibdo.c b/src/enemy/gibdo.c
index 5da67ddf..0f521e14 100644
--- a/src/enemy/gibdo.c
+++ b/src/enemy/gibdo.c
@@ -52,7 +52,7 @@ void Gibdo_OnTick(GibdoEntity* this) {
}
void Gibdo_OnCollision(GibdoEntity* this) {
- if (super->contactFlags == 0x87) {
+ if (super->contactFlags == (CONTACT_TAKE_DAMAGE | 0x7)) {
if (super->action == 0x6) {
sub_08037ACC(this);
}
@@ -62,7 +62,7 @@ void Gibdo_OnCollision(GibdoEntity* this) {
Gibdo_CreateObjects(this);
} else {
if (super->action != 0x6) {
- if (super->hitType == 0x27 && super->contactFlags == 0x80) {
+ if (super->hitType == 0x27 && super->contactFlags == CONTACT_TAKE_DAMAGE) {
sub_08037A14(this);
} else {
if ((u8)(super->action - 1) < 2) {
diff --git a/src/enemy/gleerok.c b/src/enemy/gleerok.c
index dfbbd62c..9eb430b9 100644
--- a/src/enemy/gleerok.c
+++ b/src/enemy/gleerok.c
@@ -659,7 +659,7 @@ void sub_0802D86C(GleerokEntity* this) {
}
}
- if ((super->contactFlags & 0x80) && this->unk_74 == 0) {
+ if ((super->contactFlags & CONTACT_TAKE_DAMAGE) && this->unk_74 == 0) {
if ((super->contactFlags & 0x7f) == 0x1d) {
super->zVelocity = Q_16_16(3.0);
super->parent->subAction = 4;
@@ -1039,7 +1039,7 @@ void sub_0802E0B8(GleerokEntity* this) {
super->type2 = 4;
InitializeAnimation(super, 0x4e);
} else {
- if (super->contactFlags & 0x80) {
+ if (super->contactFlags & CONTACT_TAKE_DAMAGE) {
if (super->iframes > 0) {
SoundReq(SFX_BOSS_HIT);
}
diff --git a/src/enemy/hangingSeed.c b/src/enemy/hangingSeed.c
index 1a383efb..dfdcae96 100644
--- a/src/enemy/hangingSeed.c
+++ b/src/enemy/hangingSeed.c
@@ -20,7 +20,7 @@ void HangingSeed_OnTick(Entity* this) {
}
void HangingSeed_OnCollision(Entity* this) {
- if (this->contactFlags & 0x80) {
+ if (this->contactFlags & CONTACT_TAKE_DAMAGE) {
CreateFx(this, FX_BUSH, 0x80);
DeleteThisEntity();
}
diff --git a/src/enemy/keaton.c b/src/enemy/keaton.c
index d499adad..348d7e25 100644
--- a/src/enemy/keaton.c
+++ b/src/enemy/keaton.c
@@ -143,7 +143,7 @@ void Keaton_Action3(KeatonEntity* this) {
}
void Keaton_Action4(KeatonEntity* this) {
- if (super->child && (super->child->contactFlags & 0x80)) {
+ if (super->child && (super->child->contactFlags & CONTACT_TAKE_DAMAGE)) {
sub_0803275C(this);
return;
}
diff --git a/src/enemy/leever.c b/src/enemy/leever.c
index 3f8937b3..4bdc4253 100644
--- a/src/enemy/leever.c
+++ b/src/enemy/leever.c
@@ -47,7 +47,7 @@ void Leever_OnTick(LeeverEntity* this) {
}
void Leever_OnCollision(LeeverEntity* this) {
- if (super->contactFlags == 0x80) {
+ if (super->contactFlags == CONTACT_TAKE_DAMAGE) {
if (super->action == 3) {
this->unk_74 = 1;
}
diff --git a/src/enemy/likeLike.c b/src/enemy/likeLike.c
index 85919220..373953f6 100644
--- a/src/enemy/likeLike.c
+++ b/src/enemy/likeLike.c
@@ -46,8 +46,8 @@ void LikeLike_OnCollision(LikeLikeEntity* this) {
} else {
if (super->action == 7) {
LikeLike_ReleasePlayer(this);
- } else if (super->contactFlags & 0x80) {
- u8 tmp = super->contactFlags & ~0x80;
+ } else if (super->contactFlags & CONTACT_TAKE_DAMAGE) {
+ u8 tmp = super->contactFlags & ~CONTACT_TAKE_DAMAGE;
if (tmp == 0) {
super->action = 7;
super->timer = 95;
diff --git a/src/enemy/madderpillar.c b/src/enemy/madderpillar.c
index 4dda2643..39d929c9 100644
--- a/src/enemy/madderpillar.c
+++ b/src/enemy/madderpillar.c
@@ -518,7 +518,7 @@ void sub_0802A098(MadderpillarEntity* this) {
void sub_0802A0F8(MadderpillarEntity* this) {
if (super->health != 0) {
- if ((super->contactFlags & 0x80) && super->iframes != 0) {
+ if ((super->contactFlags & CONTACT_TAKE_DAMAGE) && super->iframes != 0) {
Entity* entity = super;
u32 i;
for (i = 0; i < 6; i++) {
@@ -549,7 +549,7 @@ void sub_0802A16C(MadderpillarEntity* this) {
}
void sub_0802A18C(MadderpillarEntity* this) {
- if (super->contactFlags & 0x80) {
+ if (super->contactFlags & CONTACT_TAKE_DAMAGE) {
switch (super->contactFlags & 0x7f) {
case 0:
case 1:
diff --git a/src/enemy/mazaalBracelet.c b/src/enemy/mazaalBracelet.c
index c2afcae9..65e917a2 100644
--- a/src/enemy/mazaalBracelet.c
+++ b/src/enemy/mazaalBracelet.c
@@ -167,7 +167,7 @@ void MazaalBracelet_OnCollision(MazaalBraceletEntity* this) {
if (super->type < 2) {
if (super->action != 0x2b) {
- if ((0 < super->iframes) && ((super->contactFlags == 0x95 || (super->contactFlags == 0x8e)))) {
+ if ((0 < super->iframes) && ((super->contactFlags == (CONTACT_TAKE_DAMAGE | 0x15) || (super->contactFlags == (CONTACT_TAKE_DAMAGE | 0xe))))) {
super->action = 0x28;
COLLISION_OFF(super);
entity = (MazaalBraceletEntity*)super->parent;
@@ -1299,7 +1299,7 @@ u32 sub_0803B870(MazaalBraceletEntity* this) {
Entity* entity;
entity = super->child;
- if ((entity->contactFlags & 0x80) != 0 && (gPlayerState.flags & PL_CAPTURED)) {
+ if ((entity->contactFlags & CONTACT_TAKE_DAMAGE) != 0 && (gPlayerState.flags & PL_CAPTURED)) {
super->action = 0x18;
super->timer = 68;
super->spriteSettings.draw = 0;
diff --git a/src/enemy/moldworm.c b/src/enemy/moldworm.c
index acb85509..ef1650f7 100644
--- a/src/enemy/moldworm.c
+++ b/src/enemy/moldworm.c
@@ -101,7 +101,7 @@ void Moldworm_OnCollision(MoldwormEntity* this) {
super->iframes = -8;
this->unk_7f = 0;
this->unk_7b = 0;
- if (super->contactFlags == 0x80 || super->contactFlags == 0x9e) {
+ if (super->contactFlags == CONTACT_TAKE_DAMAGE || super->contactFlags == (CONTACT_TAKE_DAMAGE | 0x1e)) {
super->type2 = 0;
this->unk_80 = 0x14;
} else {
@@ -441,7 +441,7 @@ void sub_08023894(MoldwormEntity* this) {
}
void sub_0802390C(MoldwormEntity* this) {
- if (super->contactFlags & 0x80) {
+ if (super->contactFlags & CONTACT_TAKE_DAMAGE) {
Entity* ent = super->child;
do {
ent->iframes = super->iframes;
@@ -449,7 +449,7 @@ void sub_0802390C(MoldwormEntity* this) {
} else {
Entity* ent = super->child;
do {
- if (ent->contactFlags & 0x80) {
+ if (ent->contactFlags & CONTACT_TAKE_DAMAGE) {
u8 bVar2 = 0xff - ent->health;
if (bVar2 != 0) {
u32 tmp;
diff --git a/src/enemy/mulldozer.c b/src/enemy/mulldozer.c
index b9911272..8af9198a 100644
--- a/src/enemy/mulldozer.c
+++ b/src/enemy/mulldozer.c
@@ -55,7 +55,7 @@ void Mulldozer_OnCollision(MulldozerEntity* this) {
EnemyCreateFX(super, 0x1c);
}
EnemyFunctionHandlerAfterCollision(super, Mulldozer_Functions);
- if ((super->contactFlags & 0x80) != 0) {
+ if ((super->contactFlags & CONTACT_TAKE_DAMAGE) != 0) {
switch (super->contactFlags & 0x3f) {
case 2:
case 3:
diff --git a/src/enemy/peahat.c b/src/enemy/peahat.c
index d4c0e3d8..c3250c60 100644
--- a/src/enemy/peahat.c
+++ b/src/enemy/peahat.c
@@ -61,7 +61,7 @@ void Peahat_OnTick(PeahatEntity* this) {
void Peahat_OnCollision(PeahatEntity* this) {
if (this->unk_82) {
- if (super->contactFlags == 0x94) {
+ if (super->contactFlags == (CONTACT_TAKE_DAMAGE | 0x14)) {
Entity* entity = CreateEnemy(PEAHAT, PeahatForm_Propeller);
if (entity != NULL) {
CopyPosition(super, entity);
@@ -74,14 +74,14 @@ void Peahat_OnCollision(PeahatEntity* this) {
super->iframes = -30;
this->unk_81 = 0;
InitializeAnimation(super, super->animationState);
- } else if (super->contactFlags == 0x9b) {
+ } else if (super->contactFlags == (CONTACT_TAKE_DAMAGE | 0x1b)) {
super->animationState = PeahatAnimation_BrokenPropeller;
super->action = 5;
super->speed = 0x80;
super->iframes = -30;
this->unk_81 = 0;
InitializeAnimation(super, super->animationState);
- } else if (super->contactFlags == 0x80) {
+ } else if (super->contactFlags == CONTACT_TAKE_DAMAGE) {
if (super->animationState == PeahatAnimation_Flying) {
super->action = 1;
super->timer = 30;
diff --git a/src/enemy/pesto.c b/src/enemy/pesto.c
index b3f6cfdc..f0bdb5a2 100644
--- a/src/enemy/pesto.c
+++ b/src/enemy/pesto.c
@@ -65,7 +65,7 @@ void Pesto_OnTick(PestoEntity* this) {
void Pesto_OnCollision(PestoEntity* this) {
if (super->hitType != 0x6e) {
- if (super->contactFlags == 0x80) {
+ if (super->contactFlags == CONTACT_TAKE_DAMAGE) {
this->unk_86 = 0x30;
if ((this->unk_83 & 0xf) == 3 && super->action == 6) {
diff --git a/src/enemy/rockChuchu.c b/src/enemy/rockChuchu.c
index f6eba66d..4b760d66 100644
--- a/src/enemy/rockChuchu.c
+++ b/src/enemy/rockChuchu.c
@@ -100,7 +100,7 @@ void sub_080223E4(Entity* this) {
entity = this->child;
if (entity != NULL) {
- entity->contactFlags = 0x94;
+ entity->contactFlags = (CONTACT_TAKE_DAMAGE | 0x14);
entity->iframes = 0x10;
#ifndef EU
entity->knockbackDuration = 0xc;
diff --git a/src/enemy/rollobite.c b/src/enemy/rollobite.c
index 7d297f8d..6031dd12 100644
--- a/src/enemy/rollobite.c
+++ b/src/enemy/rollobite.c
@@ -51,7 +51,7 @@ void Rollobite_OnCollision(RollobiteEntity* this) {
InitializeAnimation(super, super->animationState + 8);
}
- if (super->contactFlags != 0x80) {
+ if (super->contactFlags != CONTACT_TAKE_DAMAGE) {
if (super->action == 4 || super->action == 5) {
super->action = 4;
super->timer = 180;
@@ -60,7 +60,7 @@ void Rollobite_OnCollision(RollobiteEntity* this) {
}
}
- if (super->contactFlags == 0x93)
+ if (super->contactFlags == (CONTACT_TAKE_DAMAGE | 0x13))
Rollobite_OnTick(this);
}
diff --git a/src/enemy/scissorsBeetle.c b/src/enemy/scissorsBeetle.c
index 34aca2b2..bbd7f223 100644
--- a/src/enemy/scissorsBeetle.c
+++ b/src/enemy/scissorsBeetle.c
@@ -44,7 +44,7 @@ void ScissorsBeetle_OnCollision(ScissorsBeetleEntity* this) {
}
EnemyFunctionHandlerAfterCollision(super, ScissorsBeetle_Functions);
- if ((super->contactFlags & 0x80) && super->action != 4) {
+ if ((super->contactFlags & CONTACT_TAKE_DAMAGE) && super->action != 4) {
u32 knockbackDir;
child = super->child;
child->iframes = super->iframes;
diff --git a/src/enemy/spark.c b/src/enemy/spark.c
index e135424b..7006c8b9 100644
--- a/src/enemy/spark.c
+++ b/src/enemy/spark.c
@@ -22,7 +22,7 @@ void Spark_OnTick(Entity* this) {
void Spark_OnCollision(Entity* this) {
Entity* entity;
- if (this->contactFlags & 0x80) {
+ if (this->contactFlags & CONTACT_TAKE_DAMAGE) {
if ((this->contactFlags & 0x7f) == 0x14) {
COLLISION_OFF(this);
this->iframes = 0;
diff --git a/src/enemy/spearMoblin.c b/src/enemy/spearMoblin.c
index ac61f57e..97d5850b 100644
--- a/src/enemy/spearMoblin.c
+++ b/src/enemy/spearMoblin.c
@@ -57,7 +57,7 @@ void SpearMoblin_OnCollision(SpearMoblinEntity* this) {
EnemyCreateFX(super, FX_STARS);
EnemyFunctionHandlerAfterCollision(super, SpearMoblin_Functions);
- if (super->contactFlags & 0x80) {
+ if (super->contactFlags & CONTACT_TAKE_DAMAGE) {
if (super->action != 4) {
sub_08028754(this);
} else {
@@ -398,7 +398,7 @@ bool32 sub_080288A4(SpearMoblinEntity* this) {
void sub_080288C0(SpearMoblinEntity* this) {
Entity* entity = super->child;
- if ((entity != NULL) && (entity->contactFlags & 0x80)) {
+ if ((entity != NULL) && (entity->contactFlags & CONTACT_TAKE_DAMAGE)) {
super->knockbackDirection = entity->knockbackDirection;
super->iframes = -entity->iframes;
super->knockbackSpeed = entity->knockbackSpeed;
diff --git a/src/enemy/spinyBeetle.c b/src/enemy/spinyBeetle.c
index ebaa6322..d729bc52 100644
--- a/src/enemy/spinyBeetle.c
+++ b/src/enemy/spinyBeetle.c
@@ -49,7 +49,7 @@ void SpinyBeetle_OnCollision(SpinyBeetleEntity* this) {
}
EnemyFunctionHandlerAfterCollision(super, SpinyBeetle_Functions);
- if (super->contactFlags & 0x80) {
+ if (super->contactFlags & CONTACT_TAKE_DAMAGE) {
if (super->iframes > 0 && super->child) {
sub_08033E1C(this);
}
diff --git a/src/enemy/spinyChuchu.c b/src/enemy/spinyChuchu.c
index 0028054f..d736b8e0 100644
--- a/src/enemy/spinyChuchu.c
+++ b/src/enemy/spinyChuchu.c
@@ -60,7 +60,7 @@ void SpinyChuchu_OnCollision(SpinyChuchuEntity* this) {
super->hitType = 0x5c;
InitializeAnimation(super, 1);
}
- } else if (super->contactFlags == 0x94) {
+ } else if (super->contactFlags == (CONTACT_TAKE_DAMAGE | 0x14)) {
EnemyCreateFX(super, FX_STARS);
super->action = 5;
InitializeAnimation(super, 1);
diff --git a/src/enemy/takkuri.c b/src/enemy/takkuri.c
index 20dd168a..38aa602f 100644
--- a/src/enemy/takkuri.c
+++ b/src/enemy/takkuri.c
@@ -46,7 +46,7 @@ void Takkuri_OnTick(TakkuriEntity* this) {
}
void Takkuri_OnCollision(TakkuriEntity* this) {
- if (super->contactFlags & 0x80) {
+ if (super->contactFlags & CONTACT_TAKE_DAMAGE) {
if ((super->contactFlags & 0x7f) == 0) {
u32 direction;
sub_0803C0AC(super);
diff --git a/src/enemy/tektite.c b/src/enemy/tektite.c
index 803ebd47..0cc625b3 100644
--- a/src/enemy/tektite.c
+++ b/src/enemy/tektite.c
@@ -63,7 +63,7 @@ void Tektite_OnCollision(TektiteEntity* this) {
EnemyCreateFX(super, FX_STARS);
}
EnemyFunctionHandlerAfterCollision(super, Tektite_Functions);
- if ((super->contactFlags & 0x80) != 0) {
+ if ((super->contactFlags & CONTACT_TAKE_DAMAGE) != 0) {
switch (super->contactFlags & 0x3f) {
case 0x14:
super->action = 1;
diff --git a/src/enemy/tektiteGolden.c b/src/enemy/tektiteGolden.c
index 22184e0d..c6af233a 100644
--- a/src/enemy/tektiteGolden.c
+++ b/src/enemy/tektiteGolden.c
@@ -51,7 +51,7 @@ void TektiteGolden_OnCollision(TektiteGoldenEntity* this) {
EnemyCreateFX(super, FX_STARS);
}
EnemyFunctionHandlerAfterCollision(super, TektiteGolden_Functions);
- if (super->contactFlags == 0x94) {
+ if (super->contactFlags == (CONTACT_TAKE_DAMAGE | 0x14)) {
super->action = 1;
super->subAction = 0;
super->timer = 20;
diff --git a/src/enemy/vaatiArm.c b/src/enemy/vaatiArm.c
index 65ace01e..b94db4e5 100644
--- a/src/enemy/vaatiArm.c
+++ b/src/enemy/vaatiArm.c
@@ -1401,7 +1401,7 @@ static void sub_08043C40(VaatiArmEntity* this, VaatiArm_HeapStruct1* heapStruct)
static bool32 sub_08043C98(VaatiArmEntity* this) {
#if defined EU || defined JP
Entity* e1 = &((VaatiArm_HeapStruct*)super->myHeap)->entities[3]->base;
- if ((e1->contactFlags == 0x9d)) {
+ if ((e1->contactFlags == (CONTACT_TAKE_DAMAGE | 0x1d))) {
sub_08043D08(this);
return TRUE;
} else {
@@ -1410,7 +1410,7 @@ static bool32 sub_08043C98(VaatiArmEntity* this) {
#else
Entity* e1 = &((VaatiArm_HeapStruct*)super->myHeap)->entities[2]->base;
Entity* e2 = &((VaatiArm_HeapStruct*)super->myHeap)->entities[3]->base;
- if ((e1->contactFlags == 0x9d) || (e2->contactFlags == 0x9d)) {
+ if ((e1->contactFlags == (CONTACT_TAKE_DAMAGE | 0x1d)) || (e2->contactFlags == (CONTACT_TAKE_DAMAGE | 0x1d))) {
sub_08043D08(this);
gRoomTransition.field_0x38 |= 2;
return TRUE;
@@ -1423,7 +1423,7 @@ static bool32 sub_08043C98(VaatiArmEntity* this) {
static void sub_08043CD4(VaatiArmEntity* this) {
u32 i;
for (i = 0; i < 5; i++) {
- if (((VaatiArm_HeapStruct*)super->myHeap)->entities[i]->base.contactFlags == 0x9d) {
+ if (((VaatiArm_HeapStruct*)super->myHeap)->entities[i]->base.contactFlags == (CONTACT_TAKE_DAMAGE | 0x1d)) {
this->unk_7c = 0x78;
this->unk_7d = i;
return;
diff --git a/src/enemy/vaatiBall.c b/src/enemy/vaatiBall.c
index 485749b5..a32eb624 100644
--- a/src/enemy/vaatiBall.c
+++ b/src/enemy/vaatiBall.c
@@ -58,7 +58,7 @@ void VaatiBall(VaatiBallEntity* this) {
super->health = -1;
}
- if (super->contactFlags & 0x80) {
+ if (super->contactFlags & CONTACT_TAKE_DAMAGE) {
if ((super->contactFlags & 0x3f) == 0 && super->action == 6) {
ModHealth(-2);
}
diff --git a/src/enemy/vaatiProjectile.c b/src/enemy/vaatiProjectile.c
index a202f9a3..a7efe411 100644
--- a/src/enemy/vaatiProjectile.c
+++ b/src/enemy/vaatiProjectile.c
@@ -66,7 +66,7 @@ void VaatiProjectile_OnTick(VaatiProjectileEntity* this) {
void VaatiProjectile_OnCollision(VaatiProjectileEntity* this) {
Entity* entity;
- if (super->contactFlags == 0x80) {
+ if (super->contactFlags == CONTACT_TAKE_DAMAGE) {
#ifndef EU
if (super->health != 0) {
#endif
diff --git a/src/enemy/vaatiRebornEnemy.c b/src/enemy/vaatiRebornEnemy.c
index 83fcbc65..28586549 100644
--- a/src/enemy/vaatiRebornEnemy.c
+++ b/src/enemy/vaatiRebornEnemy.c
@@ -539,7 +539,7 @@ void VaatiRebornEnemyType1Action1(VaatiRebornEnemyEntity* this) {
super->hitType = 0x2f;
InitAnimationForceUpdate(super, this->unk_74);
} else {
- if (((super->contactFlags & 0x80) != 0) && (0 < super->iframes)) {
+ if (((super->contactFlags & CONTACT_TAKE_DAMAGE) != 0) && (0 < super->iframes)) {
parent->iframes = super->iframes;
parent->contactFlags = super->contactFlags;
}
@@ -665,7 +665,7 @@ void VaatiRebornEnemyType1PreAction(VaatiRebornEnemyEntity* this) {
}
parent = super->parent;
this->unk_77 = 0;
- if ((super->contactFlags & 0x80) != 0) {
+ if ((super->contactFlags & CONTACT_TAKE_DAMAGE) != 0) {
if (gUnk_080D04D0[((VaatiRebornEnemyEntity*)parent)->unk_86] > super->health) {
if (2 < ++((VaatiRebornEnemyEntity*)parent)->unk_86) {
COLLISION_OFF(super);
diff --git a/src/enemy/vaatiTransfigured.c b/src/enemy/vaatiTransfigured.c
index e04bd547..9d8f7158 100644
--- a/src/enemy/vaatiTransfigured.c
+++ b/src/enemy/vaatiTransfigured.c
@@ -1097,11 +1097,11 @@ void sub_080409B0(VaatiTransfiguredEntity* this) {
Knockback1(super);
}
} else {
- if (((super->contactFlags & 0x80) != 0) && (0 < super->iframes)) {
+ if (((super->contactFlags & CONTACT_TAKE_DAMAGE) != 0) && (0 < super->iframes)) {
InitScreenShake(12, 1);
SoundReq(SFX_BOSS_HIT);
}
- if ((super->contactFlags == 0x8a) && (gPlayerState.chargeState.action == 5)) {
+ if ((super->contactFlags == (CONTACT_TAKE_DAMAGE | 0xa)) && (gPlayerState.chargeState.action == 5)) {
super->health = 0xc0;
}
}
diff --git a/src/enemy/vaatiTransfiguredEye.c b/src/enemy/vaatiTransfiguredEye.c
index e417c2fd..74e0a522 100644
--- a/src/enemy/vaatiTransfiguredEye.c
+++ b/src/enemy/vaatiTransfiguredEye.c
@@ -72,7 +72,7 @@ void VaatiTransfiguredEye_OnCollision(VaatiTransfiguredEyeEntity* this) {
if (super->type != 0) {
pEVar4 = super->parent->parent;
- if ((super->contactFlags & 0x80) != 0) {
+ if ((super->contactFlags & CONTACT_TAKE_DAMAGE) != 0) {
bVar1 = super->contactFlags & 0x3f;
if ((bVar1 == 0xe) || (bVar1 == 0x15)) {
diff --git a/src/enemy/vaatiWrath.c b/src/enemy/vaatiWrath.c
index b8bd9b20..cac6435c 100644
--- a/src/enemy/vaatiWrath.c
+++ b/src/enemy/vaatiWrath.c
@@ -101,7 +101,7 @@ const s8 gUnk_080D0EB0[] = { 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x0
0xfd, 0xfd, 0xfd, 0xfd, 0xfd, 0xfd, 0xfd, 0xfd, 0xfd, 0xfd };
void VaatiWrath(VaatiWrathEntity* this) {
- if (((super->type == 0) && ((super->contactFlags & 0x80) != 0)) && (super->health == 0)) {
+ if (((super->type == 0) && ((super->contactFlags & CONTACT_TAKE_DAMAGE) != 0)) && (super->health == 0)) {
COLLISION_ON(super);
super->health = 0xff;
if (--this->unk_84 == 0) {
diff --git a/src/enemy/wisp.c b/src/enemy/wisp.c
index 1ed368b6..88125bcf 100644
--- a/src/enemy/wisp.c
+++ b/src/enemy/wisp.c
@@ -57,7 +57,7 @@ void Wisp_OnCollision(WispEntity* this) {
Entity* entity;
bits = super->contactFlags;
- if ((bits & 0x80) == 0) {
+ if ((bits & CONTACT_TAKE_DAMAGE) == 0) {
return;
}
diff --git a/src/enemy/wizzrobeIce.c b/src/enemy/wizzrobeIce.c
index 84fe790e..def00092 100644
--- a/src/enemy/wizzrobeIce.c
+++ b/src/enemy/wizzrobeIce.c
@@ -26,7 +26,7 @@ void WizzrobeIce_OnCollision(WizzrobeEntity* this) {
EnemyCreateFX(super, FX_STARS);
}
EnemyFunctionHandlerAfterCollision(super, WizzrobeIce_Functions);
- if (super->contactFlags == 0x87) {
+ if (super->contactFlags == (CONTACT_TAKE_DAMAGE | 0x7)) {
Entity* obj = CreateObject(FLAME, 3, 0);
if (obj != NULL) {
obj->spritePriority.b0 = 3;
diff --git a/src/enemy/wizzrobeWind.c b/src/enemy/wizzrobeWind.c
index 8f23e3da..b4aeca23 100644
--- a/src/enemy/wizzrobeWind.c
+++ b/src/enemy/wizzrobeWind.c
@@ -33,7 +33,7 @@ void WizzrobeWind_OnCollision(WizzrobeEntity* this) {
EnemyCreateFX(super, FX_STARS);
}
EnemyFunctionHandlerAfterCollision(super, WizzrobeWind_Functions);
- if (super->contactFlags == 0x87) {
+ if (super->contactFlags == (CONTACT_TAKE_DAMAGE | 0x7)) {
Entity* obj = CreateObject(FLAME, 3, 0);
if (obj != NULL) {
obj->spritePriority.b0 = 3;