From 5049daabc59d113152143d123aea2798d9487a0c Mon Sep 17 00:00:00 2001 From: theo3 Date: Sat, 30 Dec 2023 21:07:06 -0800 Subject: [PATCH] label contact flags --- include/collision.h | 10 ++++++++++ include/entity.h | 2 ++ src/collision.c | 4 ++-- src/enemy/acroBandits.c | 2 +- src/enemy/armos.c | 2 +- src/enemy/beetle.c | 4 ++-- src/enemy/bobomb.c | 2 +- src/enemy/bowMoblin.c | 2 +- src/enemy/chaser.c | 2 +- src/enemy/chuchuBoss.c | 4 ++-- src/enemy/cloudPiranha.c | 2 +- src/enemy/crow.c | 2 +- src/enemy/darkNut.c | 3 ++- src/enemy/enemy50.c | 8 ++++---- src/enemy/eyegore.c | 6 +++--- src/enemy/flyingPot.c | 2 +- src/enemy/flyingSkull.c | 2 +- src/enemy/ghini.c | 4 ++-- src/enemy/gibdo.c | 4 ++-- src/enemy/gleerok.c | 4 ++-- src/enemy/hangingSeed.c | 2 +- src/enemy/keaton.c | 2 +- src/enemy/leever.c | 2 +- src/enemy/likeLike.c | 4 ++-- src/enemy/madderpillar.c | 4 ++-- src/enemy/mazaalBracelet.c | 4 ++-- src/enemy/moldworm.c | 6 +++--- src/enemy/mulldozer.c | 2 +- src/enemy/peahat.c | 6 +++--- src/enemy/pesto.c | 2 +- src/enemy/rockChuchu.c | 2 +- src/enemy/rollobite.c | 4 ++-- src/enemy/scissorsBeetle.c | 2 +- src/enemy/spark.c | 2 +- src/enemy/spearMoblin.c | 4 ++-- src/enemy/spinyBeetle.c | 2 +- src/enemy/spinyChuchu.c | 2 +- src/enemy/takkuri.c | 2 +- src/enemy/tektite.c | 2 +- src/enemy/tektiteGolden.c | 2 +- src/enemy/vaatiArm.c | 6 +++--- src/enemy/vaatiBall.c | 2 +- src/enemy/vaatiProjectile.c | 2 +- src/enemy/vaatiRebornEnemy.c | 4 ++-- src/enemy/vaatiTransfigured.c | 4 ++-- src/enemy/vaatiTransfiguredEye.c | 2 +- src/enemy/vaatiWrath.c | 2 +- src/enemy/wisp.c | 2 +- src/enemy/wizzrobeIce.c | 2 +- src/enemy/wizzrobeWind.c | 2 +- src/enemyUtils.c | 4 ++-- src/interrupts.c | 4 ++-- src/npc/npc5.c | 2 +- src/object.c | 2 +- src/object/barrelSpiderweb.c | 6 +++--- src/object/dirtParticle.c | 4 ++-- src/object/eyeSwitch.c | 2 +- src/object/fairy.c | 2 +- src/object/hittableLever.c | 2 +- src/object/itemOnGround.c | 2 +- src/object/jarPortal.c | 2 +- src/object/lavaPlatform.c | 4 ++-- src/object/lightableSwitch.c | 4 ++-- src/object/objectA8.c | 2 +- src/object/objectOnSpinyBeetle.c | 2 +- src/object/sanctuaryStoneTablet.c | 2 +- src/object/smallIceBlock.c | 2 +- src/object/unusedSkull.c | 2 +- src/physics.c | 2 +- src/player.c | 3 ++- src/playerItem.c | 2 +- src/playerItem/playerItemBoomerang.c | 2 +- src/playerItem/playerItemGustBig.c | 2 +- src/playerItem/playerItemHeldObject.c | 2 +- src/playerItem/playerItemShield.c | 2 +- src/playerItem/playerItemSword.c | 2 +- src/projectile/arrowProjectile.c | 2 +- src/projectile/boneProjectile.c | 2 +- src/projectile/darkNutSwordSlash.c | 2 +- src/projectile/dekuSeedProjectile.c | 4 ++-- src/projectile/dirtBallProjectile.c | 2 +- src/projectile/gleerokProjectile.c | 2 +- src/projectile/guardLineOfSight.c | 4 ++-- src/projectile/keatonDagger.c | 2 +- src/projectile/lakituLightning.c | 2 +- src/projectile/mandiblesProjectile.c | 2 +- src/projectile/moblinSpear.c | 2 +- src/projectile/octorokBossProjectile.c | 4 ++-- src/projectile/projectile5.c | 2 +- src/projectile/removableDust.c | 2 +- src/projectile/rockProjectile.c | 2 +- src/projectile/spiderWeb.c | 2 +- src/projectile/stalfosProjectile.c | 2 +- src/projectile/v1DarkMagicProjectile.c | 2 +- src/projectile/v1FireProjectile.c | 2 +- src/projectile/v2Projectile.c | 2 +- 96 files changed, 142 insertions(+), 128 deletions(-) diff --git a/include/collision.h b/include/collision.h index af8ba9847..465d3e9fe 100644 --- a/include/collision.h +++ b/include/collision.h @@ -6,6 +6,16 @@ /** Collisions. */ +enum { + COL_LANTERN = 0x7, + COL_SMALL_GUST = 0x13, + COL_BOOMERANG = 0x14, + COL_ARROW = 0x15, + COL_BIG_GUST = 0x1b, + COL_PACCI = 0x1d, + COL_SWORD_BEAM = 0x21, +}; + typedef enum { COL_NONE = 0x0, COL_NORTH_WEST = 0x2, diff --git a/include/entity.h b/include/entity.h index 315e94db8..8a66283c7 100644 --- a/include/entity.h +++ b/include/entity.h @@ -79,6 +79,8 @@ typedef enum { DirectionNorthWest = 0x1c, /**< North West. */ } Direction; +#define CONTACT_TAKE_DAMAGE 0x80 + typedef struct { void* entity1; void* entity2; diff --git a/src/collision.c b/src/collision.c index d1408375f..6dda05c31 100644 --- a/src/collision.c +++ b/src/collision.c @@ -371,7 +371,7 @@ CollisionResult CollisionNoOp(Entity* org, Entity* tgt, u32 direction, ColSettin // target: item CollisionResult CollisionGroundItem(Entity* org, Entity* tgt, u32 direction, ColSettings* settings) { COLLISION_OFF(tgt); - tgt->contactFlags = org->hurtType | 0x80; + tgt->contactFlags = org->hurtType | CONTACT_TAKE_DAMAGE; if ((tgt->type == 0x5F || tgt->type == 0x60) && sub_08081420(tgt)) tgt->health = 0; return RESULT_COLLISION_WITHOUT_SET; @@ -503,7 +503,7 @@ CollisionResult sub_08017DD4(Entity* org, Entity* tgt, u32 direction, ColSetting sub_08079D84(); org->iframes = 90; } else { - gPlayerEntity.base.contactFlags = tgt->hurtType | 0x80; + gPlayerEntity.base.contactFlags = tgt->hurtType | CONTACT_TAKE_DAMAGE; gPlayerEntity.base.iframes = 12; gPlayerEntity.base.knockbackDuration = 16; gPlayerEntity.base.knockbackDirection = DirectionTurnAround(direction); diff --git a/src/enemy/acroBandits.c b/src/enemy/acroBandits.c index ac12c3133..73911ecfd 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 2824b950e..bd164871f 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 10263a309..75924746d 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 f007f779e..7dfae72ec 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 3a86b0166..6a1176ee8 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 9255b1f15..3c374cd44 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 ca4900037..0f054bdd4 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 14296cd6e..64bf98cc6 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 4f0c587bb..c540e4ae5 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 f5d0919e9..39820a644 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 3839aabf7..9987ee888 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 9c8eb9e1a..b023469c3 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 8c4159d4b..74f0a3b52 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 17c46040f..7318f3589 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 e49b8293d..87a9c402d 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 5da67ddf0..0f521e14a 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 dfbbd62c2..9eb430b91 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 1a383efb4..dfdcae96a 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 d499adad9..348d7e25e 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 3f8937b3e..4bdc4253f 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 859192207..373953f62 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 4dda2643d..39d929c96 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 c2afcae98..65e917a23 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 acb85509b..ef1650f76 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 b9911272f..8af9198af 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 d4c0e3d8b..c3250c605 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 b3f6cfdc7..f0bdb5a21 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 f6eba66da..4b760d663 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 7d297f8dc..6031dd128 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 34aca2b2b..bbd7f2231 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 e135424bd..7006c8b90 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 ac61f57eb..97d5850bb 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 ebaa63229..d729bc520 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 0028054f9..d736b8e09 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 20dd168aa..38aa602f7 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 803ebd47c..0cc625b32 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 22184e0d0..c6af233a8 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 65ace01e0..b94db4e55 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 485749b56..a32eb6248 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 a202f9a3d..a7efe4119 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 83fcbc657..285865493 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 e04bd5473..9d8f71588 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 e417c2fd0..74e0a5221 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 b8bd9b201..cac6435ce 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 1ed368b6d..88125bcfb 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 84fe790e0..def000926 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 8f23e3da7..b4aeca233 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; diff --git a/src/enemyUtils.c b/src/enemyUtils.c index 04281240b..ed13377fd 100644 --- a/src/enemyUtils.c +++ b/src/enemyUtils.c @@ -314,9 +314,9 @@ void EnemyDetachFX(Entity* entity) { /** Unsets bitfield 0x80 before calling GetNextFunction, so that the enemyFunction 1 is not called. */ void EnemyFunctionHandlerAfterCollision(Entity* entity, void (*const fntable[])()) { u32 idx; - entity->contactFlags &= ~0x80; + entity->contactFlags &= ~CONTACT_TAKE_DAMAGE; idx = GetNextFunction(entity); - entity->contactFlags |= 0x80; + entity->contactFlags |= CONTACT_TAKE_DAMAGE; fntable[idx](entity); } diff --git a/src/interrupts.c b/src/interrupts.c index b27a43a78..5ea8bc64c 100644 --- a/src/interrupts.c +++ b/src/interrupts.c @@ -236,7 +236,7 @@ static void HandlePlayerLife(Entity* this) { gUnk_0200AF00.rActionInteractTile = R_ACTION_NONE; gUnk_0200AF00.rActionGrabbing = R_ACTION_NONE; - if ((gPlayerEntity.base.contactFlags & 0x80) && (gPlayerEntity.base.iframes > 0)) + if ((gPlayerEntity.base.contactFlags & CONTACT_TAKE_DAMAGE) && (gPlayerEntity.base.iframes > 0)) SoundReq(SFX_86); gPlayerState.flags &= ~(PL_FALLING | PL_CONVEYOR_PUSHED); @@ -323,7 +323,7 @@ static void sub_080171F0(void) { if (gPlayerEntity.unk_7a != 0) gPlayerEntity.unk_7a--; - gPlayerEntity.base.contactFlags &= ~0x80; + gPlayerEntity.base.contactFlags &= ~CONTACT_TAKE_DAMAGE; if (gPlayerEntity.base.action != PLAYER_DROWN) COPY_FLAG_FROM_TO(gPlayerState.flags, 0x2, 0x10000); diff --git a/src/npc/npc5.c b/src/npc/npc5.c index d4a78753c..dc301ae8a 100644 --- a/src/npc/npc5.c +++ b/src/npc/npc5.c @@ -525,7 +525,7 @@ u32 sub_080611D4(Entity* this) { u32 sub_08061230(NPC5Entity* this) { if ((((UnkHeap*)super->myHeap)->unk_0 & 1) == 0) { - if ((super->contactFlags & 0x80) != 0) { + if ((super->contactFlags & CONTACT_TAKE_DAMAGE) != 0) { switch (super->contactFlags & 0x7f) { case 0: case 1: diff --git a/src/object.c b/src/object.c index 8f23887e7..31bbdd639 100644 --- a/src/object.c +++ b/src/object.c @@ -207,7 +207,7 @@ void ObjectUpdate(Entity* this) { this->iframes++; if (!EntityDisabled(this)) { gObjectFunctions[this->id](this); - this->contactFlags &= ~0x80; + this->contactFlags &= ~CONTACT_TAKE_DAMAGE; } DrawEntity(this); } diff --git a/src/object/barrelSpiderweb.c b/src/object/barrelSpiderweb.c index 386f2c747..d4d821ddc 100644 --- a/src/object/barrelSpiderweb.c +++ b/src/object/barrelSpiderweb.c @@ -64,7 +64,7 @@ void sub_0808BBE0(Entity* this) { ptr = &gUnk_0812144C[diff * 2]; SetAffineInfo(this, ptr[0], ptr[1], 0); } else { - this->contactFlags &= ~0x80; + this->contactFlags &= ~CONTACT_TAKE_DAMAGE; } } @@ -74,7 +74,7 @@ void BarrelSpiderweb_Action1(Entity* this) { tmp = -0x170; this->y.HALF.HI = gRoomControls.origin_y - ((this->parent)->zVelocity + tmp); sub_0808BBE0(this); - if (this->contactFlags == 0x93) { + if (this->contactFlags == (CONTACT_TAKE_DAMAGE | 0x13)) { this->timer--; this->spriteSettings.draw = 1; if (this->timer == 0) { @@ -114,7 +114,7 @@ void BarrelSpiderweb_Action2(Entity* this) { this->subtimer -= 8; SetAffineInfo(this, 0x200 - this->subtimer, 0x200 - this->subtimer, 0); } - if (this->contactFlags == 0x93) { + if (this->contactFlags == (CONTACT_TAKE_DAMAGE | 0x13)) { this->direction = GetFacingDirection(this, &gPlayerEntity.base); LinearMoveUpdate(this); if (EntityWithinDistance(this, gPlayerEntity.base.x.HALF.HI, gPlayerEntity.base.y.HALF.HI - 6, 0x1c)) { diff --git a/src/object/dirtParticle.c b/src/object/dirtParticle.c index 827456c29..ac7e848e1 100644 --- a/src/object/dirtParticle.c +++ b/src/object/dirtParticle.c @@ -101,7 +101,7 @@ void DirtParticle_Init(DirtParticleEntity* this) { void DirtParticle_Action1(DirtParticleEntity* this) { DirtParticleEntity* entity; - if ((super->contactFlags & 0x80) == 0) { + if ((super->contactFlags & CONTACT_TAKE_DAMAGE) == 0) { return; } switch (super->contactFlags & 0x7f) { @@ -128,7 +128,7 @@ void DirtParticle_Action3(DirtParticleEntity* this) { sub_08087B9C, sub_08087B9C, }; - if ((super->contactFlags & 0x80) != 0) { + if ((super->contactFlags & CONTACT_TAKE_DAMAGE) != 0) { gUnk_08120A80[super->subAction](this); } else { super->action = 1; diff --git a/src/object/eyeSwitch.c b/src/object/eyeSwitch.c index 152d511a0..60310e5c0 100644 --- a/src/object/eyeSwitch.c +++ b/src/object/eyeSwitch.c @@ -50,7 +50,7 @@ void EyeSwitch_Init(EyeSwitchEntity* this) { } void EyeSwitch_Action1(EyeSwitchEntity* this) { - if ((super->contactFlags == 0x95 || super->contactFlags == 0x8e) && + if ((super->contactFlags == (CONTACT_TAKE_DAMAGE | 0x15) || super->contactFlags == (CONTACT_TAKE_DAMAGE | 0xe)) && (DirectionRoundUp(super->contactedEntity->direction) >> 3 == (super->animationState & 3))) { super->action = 2; COLLISION_OFF(super); diff --git a/src/object/fairy.c b/src/object/fairy.c index 871da3dd3..380269060 100644 --- a/src/object/fairy.c +++ b/src/object/fairy.c @@ -40,7 +40,7 @@ void Fairy(FairyEntity* this) { Fairy_Init, Fairy_Action1, Fairy_Action2, Fairy_Action3, Fairy_Action4, }; - if (((super->contactFlags & 0x80) != 0)) { + if (((super->contactFlags & CONTACT_TAKE_DAMAGE) != 0)) { switch (super->contactFlags & 0x7f) { case 0x14: super->action = 3; diff --git a/src/object/hittableLever.c b/src/object/hittableLever.c index 8e6b63bec..0bf530acc 100644 --- a/src/object/hittableLever.c +++ b/src/object/hittableLever.c @@ -47,7 +47,7 @@ void HittableLever_Init(HittableLeverEntity* this) { } void HittableLever_Idle(HittableLeverEntity* this) { - if (((super->contactFlags & 0x80) != 0) && (this->wasHit == 0)) { + if (((super->contactFlags & CONTACT_TAKE_DAMAGE) != 0) && (this->wasHit == 0)) { this->wasHit = 1; super->type ^= 1; super->iframes = -0x18; diff --git a/src/object/itemOnGround.c b/src/object/itemOnGround.c index dc9d09750..b3f6f0453 100644 --- a/src/object/itemOnGround.c +++ b/src/object/itemOnGround.c @@ -63,7 +63,7 @@ void ItemOnGround(ItemOnGroundEntity* this) { static void (*const ItemOnGround_Actions[])(ItemOnGroundEntity*) = { ItemOnGround_Init, ItemOnGround_Action1, ItemOnGround_Action2, ItemOnGround_Action3, ItemOnGround_Action4, }; - if (super->contactFlags & 0x80) { + if (super->contactFlags & CONTACT_TAKE_DAMAGE) { switch (super->contactFlags & 0x7F) { case 20: super->action = 3; diff --git a/src/object/jarPortal.c b/src/object/jarPortal.c index aa94b26ff..f2e4f8520 100644 --- a/src/object/jarPortal.c +++ b/src/object/jarPortal.c @@ -170,7 +170,7 @@ void JarPortal_Action4(JarPortalEntity* this) { } u32 sub_0808C128(JarPortalEntity* this) { - return super->contactFlags == 157; + return super->contactFlags == (CONTACT_TAKE_DAMAGE | 0x1d); } void sub_0808C13C(JarPortalEntity* this) { diff --git a/src/object/lavaPlatform.c b/src/object/lavaPlatform.c index 5db1f0b9d..619bc6850 100644 --- a/src/object/lavaPlatform.c +++ b/src/object/lavaPlatform.c @@ -131,7 +131,7 @@ void LavaPlatform_Type1Action1(LavaPlatformEntity* this) { } void LavaPlatform_Type1Action2(LavaPlatformEntity* this) { - if (super->contactFlags == 0x9d) { + if (super->contactFlags == (CONTACT_TAKE_DAMAGE | 0x1d)) { sub_08092620(this); } else { if (LavaPlatform_IsPlayerOnPlatform(this)) { @@ -223,7 +223,7 @@ void LavaPlatform_Type1Action6(LavaPlatformEntity* this) { } void LavaPlatform_Type1Action7(LavaPlatformEntity* this) { - if (super->contactFlags == 0x9d) { + if (super->contactFlags == (CONTACT_TAKE_DAMAGE | 0x1d)) { sub_08092620(this); } } diff --git a/src/object/lightableSwitch.c b/src/object/lightableSwitch.c index 927a4c9df..8c68f7082 100644 --- a/src/object/lightableSwitch.c +++ b/src/object/lightableSwitch.c @@ -67,7 +67,7 @@ void LightableSwitch_Type0_Init(LightableSwitchEntity* this) { void LightableSwitch_Type0_Action1(LightableSwitchEntity* this) { - if ((super->contactFlags & 0x80) != 0) { + if ((super->contactFlags & CONTACT_TAKE_DAMAGE) != 0) { if (CheckFlags(this->unk_86) != 0) { ClearFlag(this->unk_86); } else { @@ -147,7 +147,7 @@ void LightableSwitch_Type1_Init(LightableSwitchEntity* this) { } void LightableSwitch_Type1_Action1(LightableSwitchEntity* this) { - if ((super->contactFlags & 0x80) != 0) { + if ((super->contactFlags & CONTACT_TAKE_DAMAGE) != 0) { super->action = 2; super->timer = 16; super->frameIndex = 2; diff --git a/src/object/objectA8.c b/src/object/objectA8.c index 4de9ccae3..6f47de252 100644 --- a/src/object/objectA8.c +++ b/src/object/objectA8.c @@ -39,7 +39,7 @@ void ObjectA8(ObjectA8Entity* this) { ObjectA8_Init, ObjectA8_Action1, ObjectA8_Action2, ObjectA8_Action3, ObjectA8_Action4, ObjectA8_Action5, ObjectA8_Action6, }; - if ((super->contactFlags & 0x80) != 0) { + if ((super->contactFlags & CONTACT_TAKE_DAMAGE) != 0) { switch (super->contactFlags & 0x7f) { case 0: case 1: diff --git a/src/object/objectOnSpinyBeetle.c b/src/object/objectOnSpinyBeetle.c index 17597f8f8..aa28ae969 100644 --- a/src/object/objectOnSpinyBeetle.c +++ b/src/object/objectOnSpinyBeetle.c @@ -72,7 +72,7 @@ void ObjectOnSpinyBeetle_Action1(ObjectOnSpinyBeetleEntity* this) { sub_080989C0(this); return; } - if ((super->contactFlags & 0x80) != 0) { + if ((super->contactFlags & CONTACT_TAKE_DAMAGE) != 0) { switch (super->contactFlags & 0x3f) { case 0x13: super->action = 3; diff --git a/src/object/sanctuaryStoneTablet.c b/src/object/sanctuaryStoneTablet.c index 31201381d..b612f4871 100644 --- a/src/object/sanctuaryStoneTablet.c +++ b/src/object/sanctuaryStoneTablet.c @@ -44,7 +44,7 @@ void SanctuaryStoneTablet_Init(SanctuaryStoneTabletEntity* this) { void SanctuaryStoneTablet_Action1(SanctuaryStoneTabletEntity* this) { Entity* fxEnt; - if (super->contactFlags == 0xa1) { + if (super->contactFlags == (CONTACT_TAKE_DAMAGE | 0x21)) { fxEnt = CreateFx(super, FX_MAGIC_STORM, 0); if (fxEnt != NULL) { fxEnt->spritePriority.b0 = 3; diff --git a/src/object/smallIceBlock.c b/src/object/smallIceBlock.c index e5a6c3f11..836dc6482 100644 --- a/src/object/smallIceBlock.c +++ b/src/object/smallIceBlock.c @@ -281,7 +281,7 @@ bool32 sub_0809963C(SmallIceBlockEntity* this) { } } } - if (super->contactFlags == 0x87) { + if (super->contactFlags == (CONTACT_TAKE_DAMAGE | 0x7)) { return TRUE; } return FALSE; diff --git a/src/object/unusedSkull.c b/src/object/unusedSkull.c index 204fc9b6e..40303016f 100644 --- a/src/object/unusedSkull.c +++ b/src/object/unusedSkull.c @@ -49,7 +49,7 @@ void UnusedSkull_Init(UnusedSkullEntity* this) { } void UnusedSkull_Action1(UnusedSkullEntity* this) { - if (super->contactFlags == 0x9c) { + if (super->contactFlags == (CONTACT_TAKE_DAMAGE | 0x1c)) { super->action = 2; super->flags &= ~0x80; CreateFx(super, FX_ICE, 0); diff --git a/src/physics.c b/src/physics.c index 206b33c3e..ac34b9992 100644 --- a/src/physics.c +++ b/src/physics.c @@ -114,7 +114,7 @@ void sub_0806F4E8(Entity* ent) { } bool32 sub_0806F520(Entity* ent) { - if (ent->contactFlags == 0x93) + if (ent->contactFlags == (CONTACT_TAKE_DAMAGE | 0x13)) return 1; ent->gustJarState &= ~4; ent->spriteOffsetY = 0; diff --git a/src/player.c b/src/player.c index a67e1022b..4f0dec35a 100644 --- a/src/player.c +++ b/src/player.c @@ -2067,7 +2067,8 @@ static void PlayerRollInit(PlayerEntity* this) { static void PlayerRollUpdate(PlayerEntity* this) { if (((gPlayerState.flags & (PL_ROLLING | PL_MOLDWORM_CAPTURED)) != PL_ROLLING) || - (!(gPlayerState.flags & PL_MOLDWORM_RELEASED) && (super->iframes != 0) && (super->contactFlags & 0x80))) { + (!(gPlayerState.flags & PL_MOLDWORM_RELEASED) && (super->iframes != 0) && + (super->contactFlags & CONTACT_TAKE_DAMAGE))) { gPlayerState.flags &= ~PL_ROLLING; if (CheckQueuedAction()) return; diff --git a/src/playerItem.c b/src/playerItem.c index dcf2532b2..46fbd0237 100644 --- a/src/playerItem.c +++ b/src/playerItem.c @@ -74,7 +74,7 @@ void ItemUpdate(Entity* this) { if (!EntityDisabled(this)) { gPlayerItemFunctions[this->id](this); - this->contactFlags &= ~0x80; + this->contactFlags &= ~CONTACT_TAKE_DAMAGE; if (this->iframes != 0) { if (this->iframes > 0) this->iframes--; diff --git a/src/playerItem/playerItemBoomerang.c b/src/playerItem/playerItemBoomerang.c index 0f7a8662d..ca380e3e2 100644 --- a/src/playerItem/playerItemBoomerang.c +++ b/src/playerItem/playerItemBoomerang.c @@ -184,7 +184,7 @@ void PlayerItemBoomerang_Action2(PlayerItemBoomerangEntity* this) { if (super->timer == 0) { uVar6 = TRUE; } - if (super->contactFlags & 0x80) { + if (super->contactFlags & CONTACT_TAKE_DAMAGE) { uVar6 = TRUE; } if (!uVar6) { diff --git a/src/playerItem/playerItemGustBig.c b/src/playerItem/playerItemGustBig.c index 15e95c2d1..e0adbfcb4 100644 --- a/src/playerItem/playerItemGustBig.c +++ b/src/playerItem/playerItemGustBig.c @@ -141,7 +141,7 @@ void PlayerItemGustBig_Action2(PlayerItemGustBigEntity* this) { if ((super->child->gustJarState & 4) == 0) { DeleteThisEntity(); } - if ((super->contactFlags & 0x80) != 0) { + if ((super->contactFlags & CONTACT_TAKE_DAMAGE) != 0) { PlayerItemGustBig_Action3(this); return; } diff --git a/src/playerItem/playerItemHeldObject.c b/src/playerItem/playerItemHeldObject.c index 7d1eebd67..dee58c8be 100644 --- a/src/playerItem/playerItemHeldObject.c +++ b/src/playerItem/playerItemHeldObject.c @@ -112,7 +112,7 @@ void PlayerItemHeldObject_SubAction2(PlayerItemHeldObjectEntity* this) { if ((child->base).action != 2) { DeleteThisEntity(); } - if ((super->contactFlags & 0x80) != 0) { + if ((super->contactFlags & CONTACT_TAKE_DAMAGE) != 0) { super->z.WORD = 0; } if (super->speed != 0) { diff --git a/src/playerItem/playerItemShield.c b/src/playerItem/playerItemShield.c index bb592f74d..35bd85864 100644 --- a/src/playerItem/playerItemShield.c +++ b/src/playerItem/playerItemShield.c @@ -102,7 +102,7 @@ void PlayerItemShield_Action1(PlayerItemShieldEntity* this) { gPlayerState.shield_status &= ~0x80; sub_080176E4(super); } else { - if ((super->contactFlags & 0x80) != 0) { + if ((super->contactFlags & CONTACT_TAKE_DAMAGE) != 0) { if ((((super->contactFlags & 0x7f) == 0x42) && this->unk_68 == 0xe) && ((gPlayerState.shield_status & 0x40) == 0)) { playerItem = CreatePlayerItem(PLAYER_ITEM_FIRE_ROD_PROJECTILE, 0, 0, this->unk_68); diff --git a/src/playerItem/playerItemSword.c b/src/playerItem/playerItemSword.c index 6df617094..e9e45087b 100644 --- a/src/playerItem/playerItemSword.c +++ b/src/playerItem/playerItemSword.c @@ -285,7 +285,7 @@ void sub_080A78B8(PlayerItemSwordEntity* this, Entity* param_2) { } super->spriteSettings.flipX = flipX; } - if ((super->contactFlags & 0x80) != 0) { + if ((super->contactFlags & CONTACT_TAKE_DAMAGE) != 0) { if ((param_2->iframes == 0) || ((u8)param_2->iframes == 0x81)) { param_2->iframes = super->iframes; param_2->knockbackDirection = super->knockbackDirection; diff --git a/src/projectile/arrowProjectile.c b/src/projectile/arrowProjectile.c index 0eda80ebf..7acc80031 100644 --- a/src/projectile/arrowProjectile.c +++ b/src/projectile/arrowProjectile.c @@ -34,7 +34,7 @@ void ArrowProjectile_OnTick(Entity* this) { } void ArrowProjectile_OnCollision(Entity* this) { - if ((this->contactFlags & 0x80) != 0) { + if ((this->contactFlags & CONTACT_TAKE_DAMAGE) != 0) { if ((this->contactFlags & 0x3f) != 0) { ModHealth(-2); sub_080A9488(this); diff --git a/src/projectile/boneProjectile.c b/src/projectile/boneProjectile.c index 164ec13bf..82c2156c9 100644 --- a/src/projectile/boneProjectile.c +++ b/src/projectile/boneProjectile.c @@ -23,7 +23,7 @@ void BoneProjectile_OnTick(Entity* this) { } void BoneProjectile_OnCollision(Entity* this) { - if (this->contactFlags == 0x80) { + if (this->contactFlags == CONTACT_TAKE_DAMAGE) { DeleteEntity(this); } else { sub_080A82D8(this); diff --git a/src/projectile/darkNutSwordSlash.c b/src/projectile/darkNutSwordSlash.c index e95ab908e..838435e58 100644 --- a/src/projectile/darkNutSwordSlash.c +++ b/src/projectile/darkNutSwordSlash.c @@ -30,7 +30,7 @@ void DarkNutSwordSlash(Entity* this) { if ((this->parent == NULL) || (this->parent->health == 0)) { DeleteThisEntity(); } - if (((this->contactFlags & 0x80) != 0) && (this->contactedEntity == &gPlayerEntity.base)) { + if (((this->contactFlags & CONTACT_TAKE_DAMAGE) != 0) && (this->contactedEntity == &gPlayerEntity.base)) { this->iframes = -0x2d; } this->contactFlags = 0; diff --git a/src/projectile/dekuSeedProjectile.c b/src/projectile/dekuSeedProjectile.c index 132bf708d..302615fe4 100644 --- a/src/projectile/dekuSeedProjectile.c +++ b/src/projectile/dekuSeedProjectile.c @@ -24,7 +24,7 @@ void DekuSeedProjectile_OnTick(Entity* this) { } void DekuSeedProjectile_OnCollision(Entity* this) { - if (this->contactFlags == 0x80) { + if (this->contactFlags == CONTACT_TAKE_DAMAGE) { if (this->hitType == 0x68) { EnqueueSFX(SFX_86); } @@ -75,7 +75,7 @@ void DekuSeedProjectile_Action1(Entity* this) { if ((parent->next != NULL) && (IsColliding(this, parent) != 0)) { this->iframes = 0x10; this->knockbackDirection = -this->direction; - this->contactFlags = 0x80; + this->contactFlags = CONTACT_TAKE_DAMAGE; this->knockbackDuration = 0xc; this->knockbackSpeed = 0; parent->iframes = 0x10; diff --git a/src/projectile/dirtBallProjectile.c b/src/projectile/dirtBallProjectile.c index 12f9beaee..3da1926c8 100644 --- a/src/projectile/dirtBallProjectile.c +++ b/src/projectile/dirtBallProjectile.c @@ -41,7 +41,7 @@ void DirtBallProjectile_OnCollision(Entity* this) { this->knockbackSpeed = 0; if (this->type == 0) { this->parent->child = NULL; - if (this->contactFlags == 0x80) { + if (this->contactFlags == CONTACT_TAKE_DAMAGE) { gPlayerState.hurtBlinkSpeed = 0xf0; ModHealth(-2); } diff --git a/src/projectile/gleerokProjectile.c b/src/projectile/gleerokProjectile.c index 2b4af4f24..cac30dd39 100644 --- a/src/projectile/gleerokProjectile.c +++ b/src/projectile/gleerokProjectile.c @@ -28,7 +28,7 @@ void GleerokProjectile(GleerokProjectileEntity* this) { } void GleerokProjectile_OnTick(GleerokProjectileEntity* this) { - if (((super->type != 3) && ((super->contactFlags & 0x80) != 0)) && ((super->contactFlags & 0x7f) != 0x1e)) { + if (((super->type != 3) && ((super->contactFlags & CONTACT_TAKE_DAMAGE) != 0)) && ((super->contactFlags & 0x7f) != 0x1e)) { super->action = 3; COLLISION_OFF(super); InitializeAnimation(super, 0x53); diff --git a/src/projectile/guardLineOfSight.c b/src/projectile/guardLineOfSight.c index f76f43606..dfb592373 100644 --- a/src/projectile/guardLineOfSight.c +++ b/src/projectile/guardLineOfSight.c @@ -26,7 +26,7 @@ void GuardLineOfSight(Entity* this) { this->timer = Random(); this->spriteSettings.draw = 0; } - if (this->contactFlags == 0x80) { + if (this->contactFlags == CONTACT_TAKE_DAMAGE) { if (this->parent != NULL) { this->parent->type = 0xff; } @@ -58,7 +58,7 @@ void GuardLineOfSight(Entity* this) { this->hitbox = (Hitbox*)&gUnk_080FD1E4; InitializeAnimation(this, 0); } - if (this->contactFlags == 0x80) { + if (this->contactFlags == CONTACT_TAKE_DAMAGE) { if (this->parent != NULL) { this->parent->type = 0xff; } diff --git a/src/projectile/keatonDagger.c b/src/projectile/keatonDagger.c index 4f5b95afa..6a4b66c39 100644 --- a/src/projectile/keatonDagger.c +++ b/src/projectile/keatonDagger.c @@ -20,7 +20,7 @@ void KeatonDagger(Entity* this) { } parent = this->parent; if (((parent == NULL) || (parent->health == 0)) || (parent->next == NULL)) { - if (((this->contactFlags & 0x80) != 0) && (this->contactedEntity == &gPlayerEntity.base)) { + if (((this->contactFlags & CONTACT_TAKE_DAMAGE) != 0) && (this->contactedEntity == &gPlayerEntity.base)) { sub_0803C0AC(this); } DeleteEntity(this); diff --git a/src/projectile/lakituLightning.c b/src/projectile/lakituLightning.c index 866c5b20c..47d300a73 100644 --- a/src/projectile/lakituLightning.c +++ b/src/projectile/lakituLightning.c @@ -23,7 +23,7 @@ void LakituLightning_OnTick(Entity* this) { } void LakituLightning_OnCollision(Entity* this) { - if ((this->health == 0) || (this->contactFlags == 0x80)) { + if ((this->health == 0) || (this->contactFlags == CONTACT_TAKE_DAMAGE)) { DeleteThisEntity(); } LakituLightning_OnTick(this); diff --git a/src/projectile/mandiblesProjectile.c b/src/projectile/mandiblesProjectile.c index 6e7971401..0062d6220 100644 --- a/src/projectile/mandiblesProjectile.c +++ b/src/projectile/mandiblesProjectile.c @@ -55,7 +55,7 @@ void MandiblesProjectile_OnTick(MandiblesProjectileEntity* this) { void MandiblesProjectile_OnCollision(MandiblesProjectileEntity* this) { Entity* parent; - if ((super->contactFlags & 0x80) != 0) { + if ((super->contactFlags & CONTACT_TAKE_DAMAGE) != 0) { switch (super->action) { case 4: super->subtimer = 0; diff --git a/src/projectile/moblinSpear.c b/src/projectile/moblinSpear.c index ea1ac3748..076477b03 100644 --- a/src/projectile/moblinSpear.c +++ b/src/projectile/moblinSpear.c @@ -38,7 +38,7 @@ void MoblinSpear_OnTick(Entity* this) { void MoblinSpear_OnCollision(Entity* this) { u8 tmp; - if (this->contactFlags == 0x80) { + if (this->contactFlags == CONTACT_TAKE_DAMAGE) { this->iframes = 0x10; this->knockbackDuration = 0xc; this->knockbackSpeed = 0x180; diff --git a/src/projectile/octorokBossProjectile.c b/src/projectile/octorokBossProjectile.c index 789e3a417..43982f37d 100644 --- a/src/projectile/octorokBossProjectile.c +++ b/src/projectile/octorokBossProjectile.c @@ -99,7 +99,7 @@ void OctorokBossProjectile_Action1(OctorokBossProjectileEntity* this) { if (super->parent->action == 2) { DeleteThisEntity(); } - if ((super->type2 == 0) && ((super->contactFlags & 0x80) != 0)) { + if ((super->type2 == 0) && ((super->contactFlags & CONTACT_TAKE_DAMAGE) != 0)) { if ((super->contactFlags & 0x7f) == 0) { OctorokBossProjectile_Action2(this); } @@ -182,7 +182,7 @@ void OctorokBossProjectile_Action1(OctorokBossProjectileEntity* this) { if (--*(u32*)&this->unk_78 == -1) { OctorokBossProjectile_Action2(this); } - if ((super->contactFlags & 0x80) == 0) { + if ((super->contactFlags & CONTACT_TAKE_DAMAGE) == 0) { return; } OctorokBossProjectile_Action2(this); diff --git a/src/projectile/projectile5.c b/src/projectile/projectile5.c index 31471e100..379dd97d1 100644 --- a/src/projectile/projectile5.c +++ b/src/projectile/projectile5.c @@ -41,7 +41,7 @@ void Projectile5_OnCollision(Entity* this) { if ((((Projectile5Entity*)this->parent)->unk_83 & 0x3f) == 3) { if (gPlayerState.hurtBlinkSpeed != 0) { if (sub_080B1B44(TILE(this->x.HALF.HI, this->y.HALF.HI), gPlayerEntity.base.collisionLayer) == 0) { - if (this->contactFlags == 0x80) { + if (this->contactFlags == CONTACT_TAKE_DAMAGE) { *pbVar2 = *pbVar2 & 0x7f; DeleteThisEntity(); } diff --git a/src/projectile/removableDust.c b/src/projectile/removableDust.c index c3138d167..40ef06402 100644 --- a/src/projectile/removableDust.c +++ b/src/projectile/removableDust.c @@ -51,7 +51,7 @@ void RemovableDust_OnTick(RemovableDustEntity* this) { } void RemovableDust_OnCollision(RemovableDustEntity* this) { - if (super->contactFlags == 0x96) { + if (super->contactFlags == (CONTACT_TAKE_DAMAGE | 0x16)) { RemovableDust_OnGrabbed(this); } } diff --git a/src/projectile/rockProjectile.c b/src/projectile/rockProjectile.c index 70957e97f..e8ebe5655 100644 --- a/src/projectile/rockProjectile.c +++ b/src/projectile/rockProjectile.c @@ -22,7 +22,7 @@ void RockProjectile_OnTick(Entity* this) { } void RockProjectile_OnCollision(Entity* this) { - if (this->contactFlags == 0x80) { + if (this->contactFlags == CONTACT_TAKE_DAMAGE) { DeleteEntity(this); } else { this->direction = this->knockbackDirection; diff --git a/src/projectile/spiderWeb.c b/src/projectile/spiderWeb.c index dca0bc9a9..b2e97623d 100644 --- a/src/projectile/spiderWeb.c +++ b/src/projectile/spiderWeb.c @@ -64,7 +64,7 @@ void SpiderWeb_OnCollision(SpiderWebEntity* this) { }; Entity* object; - if (super->contactFlags == 0x87) { + if (super->contactFlags == (CONTACT_TAKE_DAMAGE | 0x7)) { super->action = 3; super->timer = 90; COLLISION_OFF(super); diff --git a/src/projectile/stalfosProjectile.c b/src/projectile/stalfosProjectile.c index ff776f2e2..660b8f5ca 100644 --- a/src/projectile/stalfosProjectile.c +++ b/src/projectile/stalfosProjectile.c @@ -35,7 +35,7 @@ void StalfosProjectile_OnTick(Entity* this) { } void StalfosProjectile_OnCollision(Entity* this) { - if (this->contactFlags == 0x9d) { + if (this->contactFlags == (CONTACT_TAKE_DAMAGE | 0x1d)) { this->action = 3; COLLISION_OFF(this); this->zVelocity = Q_16_16(2.625); diff --git a/src/projectile/v1DarkMagicProjectile.c b/src/projectile/v1DarkMagicProjectile.c index 248612e46..eb5f73ccd 100644 --- a/src/projectile/v1DarkMagicProjectile.c +++ b/src/projectile/v1DarkMagicProjectile.c @@ -43,7 +43,7 @@ void V1DarkMagicProjectile_OnTick(V1DarkMagicProjectileEntity* this) { } void V1DarkMagicProjectile_OnCollision(V1DarkMagicProjectileEntity* this) { - if ((super->contactFlags & 0x80) != 0) { + if ((super->contactFlags & CONTACT_TAKE_DAMAGE) != 0) { if (super->type2 == 0) { if ((super->contactFlags & 0x3f) == 0) { super->action = 2; diff --git a/src/projectile/v1FireProjectile.c b/src/projectile/v1FireProjectile.c index a0f89b5b9..661547ba0 100644 --- a/src/projectile/v1FireProjectile.c +++ b/src/projectile/v1FireProjectile.c @@ -31,7 +31,7 @@ void V1FireProjectile_OnTick(V1FireProjectileEntity* this) { } void V1FireProjectile_OnCollision(V1FireProjectileEntity* this) { - if ((super->contactFlags & 0x80) != 0) { + if ((super->contactFlags & CONTACT_TAKE_DAMAGE) != 0) { super->action = 3; COLLISION_OFF(super); InitializeAnimation(super, 0x53); diff --git a/src/projectile/v2Projectile.c b/src/projectile/v2Projectile.c index e602c6f4e..8f7531c43 100644 --- a/src/projectile/v2Projectile.c +++ b/src/projectile/v2Projectile.c @@ -43,7 +43,7 @@ void V2Projectile_OnTick(V2ProjectileEntity* this) { } void V2Projectile_OnCollision(V2ProjectileEntity* this) { - if ((super->contactFlags & 0x80) == 0) + if ((super->contactFlags & CONTACT_TAKE_DAMAGE) == 0) return; switch (super->type) {