diff options
| author | Theo <65437533+notyourav@users.noreply.github.com> | 2023-12-31 21:28:46 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-31 21:28:46 -0800 |
| commit | 983412cc77d81692ad9431c0bd55f8d24e5554f8 (patch) | |
| tree | 108145ce0ee3172e48ac6529d9d49da53e9719b9 /src/enemy | |
| parent | 48fdf9d8277d2bd2e071cb30fc6284c58645e343 (diff) | |
| parent | dcc596ed8763efd9f71ce9a669cb67a1849d7c2b (diff) | |
Merge pull request #685 from notyourav/col
define collisions
Diffstat (limited to 'src/enemy')
51 files changed, 94 insertions, 94 deletions
diff --git a/src/enemy/acroBandits.c b/src/enemy/acroBandits.c index 73911ecf..f2e7c201 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 != CONTACT_TAKE_DAMAGE && super->contactFlags != (CONTACT_TAKE_DAMAGE | 0x1)) { + if (super->contactFlags != CONTACT_NOW && super->contactFlags != (CONTACT_NOW | 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 db597408..99fe9517 100644 --- a/src/enemy/armos.c +++ b/src/enemy/armos.c @@ -176,7 +176,7 @@ void sub_08030338(ArmosEntity* this) { if (super->frame == 2) { super->frame = 0; if (this->unk_80 != 2) { - super->flags2 = 0xb; + super->collisionMask = 0xb; super->hitType = 8; super->hitbox = (Hitbox*)&gUnk_080FD2F0; } @@ -281,7 +281,7 @@ void sub_08030580(ArmosEntity* this) { void sub_08030590(ArmosEntity* this) { super->action = 5; - super->flags2 = 1; + super->collisionMask = 1; super->hitType = 1; super->hitbox = (Hitbox*)&gHitbox_15; sub_080309C8(this, 5); @@ -337,7 +337,7 @@ bool32 sub_080305BC(ArmosEntity* this) { bool32 sub_08030650(ArmosEntity* this) { if (super->type == 0) { - if (super->contactFlags == CONTACT_TAKE_DAMAGE) { + if (super->contactFlags == CONTACT_NOW) { return 1; } } else if (this->unk_80 != 2) { diff --git a/src/enemy/beetle.c b/src/enemy/beetle.c index 75924746..19603462 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 CONTACT_TAKE_DAMAGE: + case CONTACT_NOW: if (gPlayerState.framestate == PL_STATE_CLIMB) { Beetle_OnTick(this); } else { @@ -50,7 +50,7 @@ void Beetle_OnCollision(BeetleEntity* this) { InitializeAnimation(super, 6); } break; - case CONTACT_TAKE_DAMAGE | 0x13: + case CONTACT_NOW | 0x13: Beetle_OnTick(this); break; } diff --git a/src/enemy/bobomb.c b/src/enemy/bobomb.c index 7dfae72e..f1ae158b 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 & CONTACT_TAKE_DAMAGE) { + if (super->contactFlags & CONTACT_NOW) { switch (super->contactFlags & 0x7f) { case 0: case 1: diff --git a/src/enemy/bowMoblin.c b/src/enemy/bowMoblin.c index 6a1176ee..b071ced4 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 & CONTACT_TAKE_DAMAGE) { + if (super->contactFlags & CONTACT_NOW) { sub_0803C5F0(this); pEVar1 = super->child; if (pEVar1 != NULL) { diff --git a/src/enemy/chaser.c b/src/enemy/chaser.c index 3c374cd4..a17f4c96 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 & CONTACT_TAKE_DAMAGE) { + if (this->contactFlags & CONTACT_NOW) { this->speed = 0x40; } diff --git a/src/enemy/chuchuBoss.c b/src/enemy/chuchuBoss.c index c9ee902c..d5502a80 100644 --- a/src/enemy/chuchuBoss.c +++ b/src/enemy/chuchuBoss.c @@ -978,13 +978,13 @@ void sub_08026BE8(ChuchuBossEntity* this) { Entity* child; child = super->child; - child->flags2 &= ~1; + child->collisionMask &= ~1; if (this->unk_7c == 0) { super->subAction = 7; this->unk_84->unk_03 = 0; this->unk_7d = 0x2d; child->flags &= ~0x80; - child->flags2 |= 1; + child->collisionMask |= 1; SoundReq(SFX_155); } else { this->unk_7c--; @@ -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 & CONTACT_TAKE_DAMAGE) { + if (super->contactFlags & CONTACT_NOW) { 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 & CONTACT_TAKE_DAMAGE) == 0) { + if ((super->contactFlags & CONTACT_NOW) == 0) { return FALSE; } switch (super->contactFlags & 0x7f) { diff --git a/src/enemy/cloudPiranha.c b/src/enemy/cloudPiranha.c index 64bf98cc..74f4be6b 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 & CONTACT_TAKE_DAMAGE) { + if (super->contactFlags & CONTACT_NOW) { if (super->hitType == 0x5a) { switch (super->contactFlags & 0x3f) { case 0x14: diff --git a/src/enemy/crow.c b/src/enemy/crow.c index c540e4ae..5c882480 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 & CONTACT_TAKE_DAMAGE) { + if (super->contactFlags & CONTACT_NOW) { if ((super->contactFlags & 0x3f) == 0) { COLLISION_OFF(super); super->subtimer = 16; diff --git a/src/enemy/darkNut.c b/src/enemy/darkNut.c index 39820a64..6a7a17db 100644 --- a/src/enemy/darkNut.c +++ b/src/enemy/darkNut.c @@ -336,7 +336,7 @@ void sub_080210E4(DarkNutEntity* this) { sub_08021644(this); if ((super->frame & 0x10) && - (!ProcessMovement0(super) || (super->child && (super->child->contactFlags & CONTACT_TAKE_DAMAGE)))) { + (!ProcessMovement0(super) || (super->child && (super->child->contactFlags & CONTACT_NOW)))) { sub_080213D0(this, 0); } else { if (--this->unk_76 == 0) diff --git a/src/enemy/enemy50.c b/src/enemy/enemy50.c index 9987ee88..36156ce7 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 == CONTACT_TAKE_DAMAGE) { + if (super->hitType == 0x25 && super->contactFlags == CONTACT_NOW) { super->action = 8; InitializeAnimation(super, 3); } else { - if (super->contactFlags == CONTACT_TAKE_DAMAGE) { + if (super->contactFlags == CONTACT_NOW) { this->unk_7c = 0x78; sub_08041128(this); } - if (super->contactFlags == (CONTACT_TAKE_DAMAGE | 0x1d)) { + if (super->contactFlags == (CONTACT_NOW | 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 == CONTACT_TAKE_DAMAGE)) { + if ((super->hitType == 0x25) && (super->contactFlags == CONTACT_NOW)) { return TRUE; } else { return super->action == 8 || super->action == 9; diff --git a/src/enemy/eyegore.c b/src/enemy/eyegore.c index 3b4ee58c..1ccf4e78 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 == (CONTACT_TAKE_DAMAGE | 0x15)) || (super->contactFlags == (CONTACT_TAKE_DAMAGE | 0xe))) { + if ((super->contactFlags == (CONTACT_NOW | 0x15)) || (super->contactFlags == (CONTACT_NOW | 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 == (CONTACT_TAKE_DAMAGE | 0xe)) { + if (super->contactFlags == (CONTACT_NOW | 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 == (CONTACT_TAKE_DAMAGE | 0xe)) { + if (super->contactFlags == (CONTACT_NOW | 0xe)) { super->health = 0; } else { super->health--; diff --git a/src/enemy/flyingPot.c b/src/enemy/flyingPot.c index cc868bc0..0402aac5 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 == (CONTACT_TAKE_DAMAGE | 0x1d)) { + if (super->contactFlags == (CONTACT_NOW | 0x1d)) { super->action = FLYING_POT_ACTION_6; COLLISION_OFF(super); super->zVelocity = Q_16_16(2.625); @@ -207,7 +207,7 @@ void FlyingPot_Action2(FlyingPotEntity* this) { super->spritePriority.b1 = 1; super->spriteOffsetX = 0; super->hitType = 0xA0; - super->flags2 = 0xF; + super->collisionMask = 0xF; super->hitbox = &gUnk_080FD34C; SetBottomTile(this->tileIndex, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer); diff --git a/src/enemy/flyingSkull.c b/src/enemy/flyingSkull.c index 23ba5c87..4e5acb0e 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 == (CONTACT_TAKE_DAMAGE | 0x1d)) { + if (super->contactFlags == (CONTACT_NOW | 0x1d)) { super->action = 7; COLLISION_OFF(super); super->zVelocity = Q_16_16(2.625); @@ -198,7 +198,7 @@ void sub_08039FAC(FlyingSkullEntity* this) { super->spritePriority.b1 = 1; super->spriteOffsetX = 0; super->hitType = 0xa0; - super->flags2 = 0xf; + super->collisionMask = 0xf; super->hitbox = (Hitbox*)&gUnk_080FD34C; SetBottomTile(this->unk_0x74, COORD_TO_TILE(super), super->collisionLayer); } diff --git a/src/enemy/ghini.c b/src/enemy/ghini.c index 87a9c402..f835ec1f 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 == CONTACT_TAKE_DAMAGE)) { + if ((super->hitType == 0x25) && (super->contactFlags == CONTACT_NOW)) { super->action = 8; InitializeAnimation(super, 3); } else { - if (super->contactFlags == (CONTACT_TAKE_DAMAGE | 0x1d)) { + if (super->contactFlags == (CONTACT_NOW | 0x1d)) { super->zVelocity = 0x18000; } if (super->confusedTime != 0) { diff --git a/src/enemy/gibdo.c b/src/enemy/gibdo.c index 0f521e14..e0813e6d 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 == (CONTACT_TAKE_DAMAGE | 0x7)) { + if (super->contactFlags == (CONTACT_NOW | 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 == CONTACT_TAKE_DAMAGE) { + if (super->hitType == 0x27 && super->contactFlags == CONTACT_NOW) { sub_08037A14(this); } else { if ((u8)(super->action - 1) < 2) { @@ -326,7 +326,7 @@ void sub_08037A14(GibdoEntity* this) { super->timer = 24; super->spritePriority.b0 &= super->timer - 32; super->spritePriority.b0 |= 3; - super->flags2 &= 0xfe; + super->collisionMask &= 0xfe; this->field_0x7c = 5; CopyPosition(super, super->contactedEntity); InitAnimationForceUpdate(super, super->animationState + 0xc); @@ -341,7 +341,7 @@ void sub_08037A58(GibdoEntity* this) { super->iframes = 0xec; } super->hitType = 0x26; - super->flags2 |= 1; + super->collisionMask |= 1; super->iframes = 0xf4; super->knockbackDirection = DirectionFromAnimationState(super->animationState) ^ 0x10; super->knockbackDuration = 8; diff --git a/src/enemy/gleerok.c b/src/enemy/gleerok.c index 9eb430b9..e88550f1 100644 --- a/src/enemy/gleerok.c +++ b/src/enemy/gleerok.c @@ -383,7 +383,7 @@ void sub_0802D3B8(GleerokEntity* this) { case 1: if (super->type2 == 1) { COLLISION_ON(super); - super->flags2 |= 0x80; + super->collisionMask |= 0x80; } super->spritePriority.b0 = gUnk_080CD7C4[super->type2].unk0.HALF.HI; @@ -399,7 +399,7 @@ void sub_0802D3B8(GleerokEntity* this) { this->unk_74 = gUnk_080CD884[0]; this->unk_75 = 0; super->spritePriority.b0 = 6; - super->flags2 |= 0x80; + super->collisionMask |= 0x80; CopyPosition(super->parent, super); InitializeAnimation(super, 0x4f); break; @@ -659,7 +659,7 @@ void sub_0802D86C(GleerokEntity* this) { } } - if ((super->contactFlags & CONTACT_TAKE_DAMAGE) && this->unk_74 == 0) { + if ((super->contactFlags & CONTACT_NOW) && 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 & CONTACT_TAKE_DAMAGE) { + if (super->contactFlags & CONTACT_NOW) { if (super->iframes > 0) { SoundReq(SFX_BOSS_HIT); } diff --git a/src/enemy/hangingSeed.c b/src/enemy/hangingSeed.c index dfdcae96..2f52e0ab 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 & CONTACT_TAKE_DAMAGE) { + if (this->contactFlags & CONTACT_NOW) { CreateFx(this, FX_BUSH, 0x80); DeleteThisEntity(); } diff --git a/src/enemy/helmasaur.c b/src/enemy/helmasaur.c index ab1437cc..6a929ab6 100644 --- a/src/enemy/helmasaur.c +++ b/src/enemy/helmasaur.c @@ -261,7 +261,7 @@ void sub_0802BF3C(HelmasaurEntity* this) { void sub_0802BF78(HelmasaurEntity* this) { super->action = 1; - super->flags2 = 4; + super->collisionMask = 4; super->gustJarFlags = 1; super->direction = super->animationState << 3; InitializeAnimation(super, super->animationState + 8); diff --git a/src/enemy/keaton.c b/src/enemy/keaton.c index 348d7e25..40688bfe 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 & CONTACT_TAKE_DAMAGE)) { + if (super->child && (super->child->contactFlags & CONTACT_NOW)) { sub_0803275C(this); return; } diff --git a/src/enemy/lakitu.c b/src/enemy/lakitu.c index 740ceb54..c0dba3db 100644 --- a/src/enemy/lakitu.c +++ b/src/enemy/lakitu.c @@ -342,7 +342,7 @@ void sub_0803CBAC(LakituEntity* this) { super->spritePriority.b1 = 1; - super->flags2 &= 0x7b; + super->collisionMask &= 0x7b; super->hitType = 0x42; diff --git a/src/enemy/leever.c b/src/enemy/leever.c index 4bdc4253..17745ecb 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 == CONTACT_TAKE_DAMAGE) { + if (super->contactFlags == CONTACT_NOW) { if (super->action == 3) { this->unk_74 = 1; } diff --git a/src/enemy/likeLike.c b/src/enemy/likeLike.c index 373953f6..0a124fe5 100644 --- a/src/enemy/likeLike.c +++ b/src/enemy/likeLike.c @@ -46,13 +46,13 @@ void LikeLike_OnCollision(LikeLikeEntity* this) { } else { if (super->action == 7) { LikeLike_ReleasePlayer(this); - } else if (super->contactFlags & CONTACT_TAKE_DAMAGE) { - u8 tmp = super->contactFlags & ~CONTACT_TAKE_DAMAGE; + } else if (super->contactFlags & CONTACT_NOW) { + u8 tmp = super->contactFlags & ~CONTACT_NOW; if (tmp == 0) { super->action = 7; super->timer = 95; super->subtimer = tmp; - super->flags2 &= 0xfc; + super->collisionMask &= 0xfc; this->prevSpritePriority = gPlayerEntity.base.spritePriority.b1; } } @@ -153,7 +153,7 @@ void sub_08027FB4(LikeLikeEntity* this) { if (--super->timer == 0) { super->action = 1; super->timer = 1; - super->flags2 |= 1; + super->collisionMask |= 1; } GetNextFrame(super); } @@ -236,7 +236,7 @@ void LikeLike_ReleasePlayer(LikeLikeEntity* this) { super->action = 4; super->timer = 80; super->subtimer = tmp; - super->flags2 |= 2; + super->collisionMask |= 2; if (super->iframes == 0) { super->iframes = -18; } diff --git a/src/enemy/madderpillar.c b/src/enemy/madderpillar.c index 39d929c9..387740b9 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 & CONTACT_TAKE_DAMAGE) && super->iframes != 0) { + if ((super->contactFlags & CONTACT_NOW) && 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 & CONTACT_TAKE_DAMAGE) { + if (super->contactFlags & CONTACT_NOW) { switch (super->contactFlags & 0x7f) { case 0: case 1: diff --git a/src/enemy/mazaalBracelet.c b/src/enemy/mazaalBracelet.c index 15e84846..a4ec8dd8 100644 --- a/src/enemy/mazaalBracelet.c +++ b/src/enemy/mazaalBracelet.c @@ -167,8 +167,8 @@ void MazaalBracelet_OnCollision(MazaalBraceletEntity* this) { if (super->type < 2) { if (super->action != 0x2b) { - if ((0 < super->iframes) && ((super->contactFlags == (CONTACT_TAKE_DAMAGE | 0x15) || - (super->contactFlags == (CONTACT_TAKE_DAMAGE | 0xe))))) { + if ((0 < super->iframes) && + ((super->contactFlags == (CONTACT_NOW | 0x15) || (super->contactFlags == (CONTACT_NOW | 0xe))))) { super->action = 0x28; COLLISION_OFF(super); entity = (MazaalBraceletEntity*)super->parent; @@ -1300,7 +1300,7 @@ u32 sub_0803B870(MazaalBraceletEntity* this) { Entity* entity; entity = super->child; - if ((entity->contactFlags & CONTACT_TAKE_DAMAGE) != 0 && (gPlayerState.flags & PL_CAPTURED)) { + if ((entity->contactFlags & CONTACT_NOW) != 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 ef1650f7..a09275f1 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 == CONTACT_TAKE_DAMAGE || super->contactFlags == (CONTACT_TAKE_DAMAGE | 0x1e)) { + if (super->contactFlags == CONTACT_NOW || super->contactFlags == (CONTACT_NOW | 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 & CONTACT_TAKE_DAMAGE) { + if (super->contactFlags & CONTACT_NOW) { 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 & CONTACT_TAKE_DAMAGE) { + if (ent->contactFlags & CONTACT_NOW) { u8 bVar2 = 0xff - ent->health; if (bVar2 != 0) { u32 tmp; diff --git a/src/enemy/mulldozer.c b/src/enemy/mulldozer.c index 8af9198a..9afd925a 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 & CONTACT_TAKE_DAMAGE) != 0) { + if ((super->contactFlags & CONTACT_NOW) != 0) { switch (super->contactFlags & 0x3f) { case 2: case 3: diff --git a/src/enemy/peahat.c b/src/enemy/peahat.c index c3250c60..a8404af9 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 == (CONTACT_TAKE_DAMAGE | 0x14)) { + if (super->contactFlags == (CONTACT_NOW | 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 == (CONTACT_TAKE_DAMAGE | 0x1b)) { + } else if (super->contactFlags == (CONTACT_NOW | 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 == CONTACT_TAKE_DAMAGE) { + } else if (super->contactFlags == CONTACT_NOW) { if (super->animationState == PeahatAnimation_Flying) { super->action = 1; super->timer = 30; diff --git a/src/enemy/pesto.c b/src/enemy/pesto.c index e386d4b6..05e38286 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 == CONTACT_TAKE_DAMAGE) { + if (super->contactFlags == CONTACT_NOW) { this->unk_86 = 0x30; if ((this->unk_83 & 0xf) == 3 && super->action == 6) { @@ -406,7 +406,7 @@ void sub_080244E8(PestoEntity* this) { super->direction = DirectionSouth; super->speed = tmp; this->unk_84 = 0; - super->flags2 &= 0xfc; + super->collisionMask &= 0xfc; sub_080249DC(this); this->unk_85 = gPlayerEntity.base.spritePriority.b1; gPlayerEntity.base.flags &= ~ENT_COLLIDE; @@ -878,7 +878,7 @@ void sub_08024F50(PestoEntity* this) { gPlayerEntity.base.spritePriority.b1 = this->unk_85; gPlayerEntity.base.z.HALF.HI = gPlayerEntity.base.spriteOffsetY; gPlayerEntity.base.spriteOffsetY = 0; - super->flags2 |= 3; + super->collisionMask |= 3; this->unk_83 = 0xc0; this->unk_80 += 2; this->unk_84 = 0; diff --git a/src/enemy/rockChuchu.c b/src/enemy/rockChuchu.c index 4b760d66..72e18f8d 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 = (CONTACT_TAKE_DAMAGE | 0x14); + entity->contactFlags = (CONTACT_NOW | 0x14); entity->iframes = 0x10; #ifndef EU entity->knockbackDuration = 0xc; diff --git a/src/enemy/rollobite.c b/src/enemy/rollobite.c index db6233e1..deb60f26 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 != CONTACT_TAKE_DAMAGE) { + if (super->contactFlags != CONTACT_NOW) { 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 == (CONTACT_TAKE_DAMAGE | 0x13)) + if (super->contactFlags == (CONTACT_NOW | 0x13)) Rollobite_OnTick(this); } diff --git a/src/enemy/rupeeLike.c b/src/enemy/rupeeLike.c index 7ebff811..ada5434e 100644 --- a/src/enemy/rupeeLike.c +++ b/src/enemy/rupeeLike.c @@ -75,7 +75,7 @@ void RupeeLike_OnCollision(RupeeLikeEntity* this) { super->timer = 60; super->subtimer = 0; this->unk_83 = 0x41; - super->flags2 &= 0xfc; + super->collisionMask &= 0xfc; this->unk_80 = gPlayerEntity.base.spritePriority.b1; EnqueueSFX(SFX_PLACE_OBJ); } else { @@ -255,7 +255,7 @@ void sub_080296D8(RupeeLikeEntity* this) { gPlayerEntity.base.speed = 0x140; super->action = 5; super->subtimer = 60; - super->flags2 |= 3; + super->collisionMask |= 3; if ((s8)super->iframes == 0) { super->iframes = 0xf4; } diff --git a/src/enemy/scissorsBeetle.c b/src/enemy/scissorsBeetle.c index bbd7f223..72bb2f8a 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 & CONTACT_TAKE_DAMAGE) && super->action != 4) { + if ((super->contactFlags & CONTACT_NOW) && 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 7006c8b9..79a65afe 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 & CONTACT_TAKE_DAMAGE) { + if (this->contactFlags & CONTACT_NOW) { if ((this->contactFlags & 0x7f) == 0x14) { COLLISION_OFF(this); this->iframes = 0; diff --git a/src/enemy/spearMoblin.c b/src/enemy/spearMoblin.c index 97d5850b..271a4c23 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 & CONTACT_TAKE_DAMAGE) { + if (super->contactFlags & CONTACT_NOW) { 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 & CONTACT_TAKE_DAMAGE)) { + if ((entity != NULL) && (entity->contactFlags & CONTACT_NOW)) { 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 297b3b51..3bd9b0da 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 & CONTACT_TAKE_DAMAGE) { + if (super->contactFlags & CONTACT_NOW) { if (super->iframes > 0 && super->child) { sub_08033E1C(this); } diff --git a/src/enemy/spinyChuchu.c b/src/enemy/spinyChuchu.c index d736b8e0..72329b9f 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 == (CONTACT_TAKE_DAMAGE | 0x14)) { + } else if (super->contactFlags == (CONTACT_NOW | 0x14)) { EnemyCreateFX(super, FX_STARS); super->action = 5; InitializeAnimation(super, 1); diff --git a/src/enemy/stalfos.c b/src/enemy/stalfos.c index b4a26dfb..4bb4b5c1 100644 --- a/src/enemy/stalfos.c +++ b/src/enemy/stalfos.c @@ -109,7 +109,7 @@ void Stalfos_OnCollision(StalfosEntity* this) { sub_08039A48(this); this->unk_78 += 0x5a; } - super->flags2 &= 0xfb; + super->collisionMask &= 0xfb; } if (super->confusedTime != 0) { EnemyCreateFX(super, FX_STARS); @@ -153,7 +153,7 @@ void Stalfos_SubAction2(StalfosEntity* this) { } super->child = NULL; super->gustJarState &= 0xfb; - super->flags2 &= 0xfb; + super->collisionMask &= 0xfb; sub_08039A48(this); this->unk_78 += 0x5a; } @@ -279,7 +279,7 @@ void Stalfos_Action12(StalfosEntity* this) { } else { sub_08039A48(this); } - super->flags2 |= 4; + super->collisionMask |= 4; this->unk_78 += 0x3c; } } diff --git a/src/enemy/takkuri.c b/src/enemy/takkuri.c index 38aa602f..fc5c90bd 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 & CONTACT_TAKE_DAMAGE) { + if (super->contactFlags & CONTACT_NOW) { if ((super->contactFlags & 0x7f) == 0) { u32 direction; sub_0803C0AC(super); diff --git a/src/enemy/tektite.c b/src/enemy/tektite.c index 0cc625b3..be3e79e4 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 & CONTACT_TAKE_DAMAGE) != 0) { + if ((super->contactFlags & CONTACT_NOW) != 0) { switch (super->contactFlags & 0x3f) { case 0x14: super->action = 1; diff --git a/src/enemy/tektiteGolden.c b/src/enemy/tektiteGolden.c index c6af233a..61737644 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 == (CONTACT_TAKE_DAMAGE | 0x14)) { + if (super->contactFlags == (CONTACT_NOW | 0x14)) { super->action = 1; super->subAction = 0; super->timer = 20; diff --git a/src/enemy/vaatiArm.c b/src/enemy/vaatiArm.c index b94db4e5..facc5527 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 == (CONTACT_TAKE_DAMAGE | 0x1d))) { + if ((e1->contactFlags == (CONTACT_NOW | 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 == (CONTACT_TAKE_DAMAGE | 0x1d)) || (e2->contactFlags == (CONTACT_TAKE_DAMAGE | 0x1d))) { + if ((e1->contactFlags == (CONTACT_NOW | 0x1d)) || (e2->contactFlags == (CONTACT_NOW | 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 == (CONTACT_TAKE_DAMAGE | 0x1d)) { + if (((VaatiArm_HeapStruct*)super->myHeap)->entities[i]->base.contactFlags == (CONTACT_NOW | 0x1d)) { this->unk_7c = 0x78; this->unk_7d = i; return; diff --git a/src/enemy/vaatiBall.c b/src/enemy/vaatiBall.c index a32eb624..94e040be 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 & CONTACT_TAKE_DAMAGE) { + if (super->contactFlags & CONTACT_NOW) { if ((super->contactFlags & 0x3f) == 0 && super->action == 6) { ModHealth(-2); } diff --git a/src/enemy/vaatiProjectile.c b/src/enemy/vaatiProjectile.c index 3df5abe6..7a27a6eb 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 == CONTACT_TAKE_DAMAGE) { + if (super->contactFlags == CONTACT_NOW) { #ifndef EU if (super->health != 0) { #endif @@ -118,7 +118,7 @@ void VaatiProjectileFunction0Action0(VaatiProjectileEntity* this) { } else { super->action = 9; super->z.HALF.HI = -0x80; - super->flags2 = 1; + super->collisionMask = 1; } InitializeAnimation(super, 0); } diff --git a/src/enemy/vaatiRebornEnemy.c b/src/enemy/vaatiRebornEnemy.c index 28586549..5463b4f0 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 & CONTACT_TAKE_DAMAGE) != 0) && (0 < super->iframes)) { + if (((super->contactFlags & CONTACT_NOW) != 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 & CONTACT_TAKE_DAMAGE) != 0) { + if ((super->contactFlags & CONTACT_NOW) != 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 9d8f7158..663133fe 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 & CONTACT_TAKE_DAMAGE) != 0) && (0 < super->iframes)) { + if (((super->contactFlags & CONTACT_NOW) != 0) && (0 < super->iframes)) { InitScreenShake(12, 1); SoundReq(SFX_BOSS_HIT); } - if ((super->contactFlags == (CONTACT_TAKE_DAMAGE | 0xa)) && (gPlayerState.chargeState.action == 5)) { + if ((super->contactFlags == (CONTACT_NOW | 0xa)) && (gPlayerState.chargeState.action == 5)) { super->health = 0xc0; } } diff --git a/src/enemy/vaatiTransfiguredEye.c b/src/enemy/vaatiTransfiguredEye.c index 74e0a522..c3e33442 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 & CONTACT_TAKE_DAMAGE) != 0) { + if ((super->contactFlags & CONTACT_NOW) != 0) { bVar1 = super->contactFlags & 0x3f; if ((bVar1 == 0xe) || (bVar1 == 0x15)) { diff --git a/src/enemy/vaatiWrath.c b/src/enemy/vaatiWrath.c index cac6435c..21f5c506 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 & CONTACT_TAKE_DAMAGE) != 0)) && (super->health == 0)) { + if (((super->type == 0) && ((super->contactFlags & CONTACT_NOW) != 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 88125bcf..e5c4c5e5 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 & CONTACT_TAKE_DAMAGE) == 0) { + if ((bits & CONTACT_NOW) == 0) { return; } diff --git a/src/enemy/wizzrobeIce.c b/src/enemy/wizzrobeIce.c index ae2dbcfe..364d56bd 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 == (CONTACT_TAKE_DAMAGE | 0x7)) { + if (super->contactFlags == (CONTACT_NOW | 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 18ee7116..92afac49 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 == (CONTACT_TAKE_DAMAGE | 0x7)) { + if (super->contactFlags == (CONTACT_NOW | 0x7)) { Entity* obj = CreateObject(FLAME, 3, 0); if (obj != NULL) { obj->spritePriority.b0 = 3; |
