label contact flags

This commit is contained in:
theo3 2023-12-30 21:07:06 -08:00
parent bd1be092aa
commit 5049daabc5
96 changed files with 142 additions and 128 deletions

View File

@ -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,

View File

@ -79,6 +79,8 @@ typedef enum {
DirectionNorthWest = 0x1c, /**< North West. */
} Direction;
#define CONTACT_TAKE_DAMAGE 0x80
typedef struct {
void* entity1;
void* entity2;

View File

@ -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);

View File

@ -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;

View File

@ -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) {

View File

@ -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;
}

View File

@ -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:

View File

@ -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) {

View File

@ -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;
}

View File

@ -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) {

View File

@ -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:

View File

@ -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;

View File

@ -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)

View File

@ -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;

View File

@ -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--;

View File

@ -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);

View File

@ -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);

View File

@ -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) {

View File

@ -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) {

View File

@ -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);
}

View File

@ -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();
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;

View File

@ -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:

View File

@ -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;

View File

@ -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;

View File

@ -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:

View File

@ -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;

View File

@ -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) {

View File

@ -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;

View File

@ -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);
}

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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);
}

View File

@ -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);

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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);
}

View File

@ -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

View File

@ -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);

View File

@ -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;
}
}

View File

@ -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)) {

View File

@ -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) {

View File

@ -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;
}

View File

@ -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;

View File

@ -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;

View File

@ -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);
}

View File

@ -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);

View File

@ -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:

View File

@ -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);
}

View File

@ -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)) {

View File

@ -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;

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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) {

View File

@ -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);
}
}

View File

@ -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;

View File

@ -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:

View File

@ -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;

View File

@ -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;

View File

@ -281,7 +281,7 @@ bool32 sub_0809963C(SmallIceBlockEntity* this) {
}
}
}
if (super->contactFlags == 0x87) {
if (super->contactFlags == (CONTACT_TAKE_DAMAGE | 0x7)) {
return TRUE;
}
return FALSE;

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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--;

View File

@ -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) {

View File

@ -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;
}

View File

@ -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) {

View File

@ -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);

View File

@ -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;

View File

@ -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);

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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);
}

View File

@ -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);

View File

@ -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;
}

View File

@ -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);

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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);

View File

@ -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();
}

View File

@ -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);
}
}

View File

@ -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;

View File

@ -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);

View File

@ -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);

View File

@ -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;

View File

@ -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);

View File

@ -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) {