diff --git a/asm/src/intr.s b/asm/src/intr.s index c2dab21db..86ec06182 100644 --- a/asm/src/intr.s +++ b/asm/src/intr.s @@ -286,77 +286,80 @@ UpdateCollision: @ 0x080B1C54 arm_func_start arm_CollideAll arm_CollideAll: @ 0x080B1C7C + THIS .req r4 + OTHER .req r5 + push {r4, r5, r6, r7, r8, sb, sl, lr} add r0, pc, #0x104 @ =_080B1D8C ldm r0, {r8, sb, sl} ldrb sl, [sl] cmp sl, #0 beq _080B1D84 - ldr r8, [r8] + ldr r8, [r8] // load entity mov r7, r8 -_080B1C9C: - ldr r4, [r8, #8] - ldrb r0, [r4, #0x10] - ands r0, r0, #0x80 - beq _080B1D78 - ldrb r0, [r4, #0x3c] - and r0, r0, #7 +next_this: + ldr THIS, [r8, #8] + ldrb r0, [THIS, #0x10] + ands r0, r0, #0x80 // disable collision flag + beq end_check_this + ldrb r0, [THIS, #0x3c] // collisionFlags + and r0, r0, #7 // first 3 bits mov r1, #1 - lsl r6, r1, r0 - ldrb r3, [r4, #0x3c] - ldrb r2, [r4, #0x3d] + lsl r6, r1, r0 // 1 << (collisionFlags & 7) + ldrb r3, [THIS, #0x3c] + ldrb r2, [THIS, #0x3d] // iframes mov ip, sl -_080B1CC8: +next_other: // r4 = this, r5 = other subs ip, ip, #1 - bmi _080B1D78 - ldr r5, [sb, ip, lsl #2] - cmp r4, r5 - beq _080B1CC8 - ldr r0, [r5, #0x3b] - ands r0, r0, r6 - beq _080B1CC8 - ldrb r0, [r5, #0x10] + bmi end_check_this + ldr OTHER, [sb, ip, lsl #2] + cmp THIS, OTHER + beq next_other + ldr r0, [OTHER, #0x3b] // collisionMask + ands r0, r0, r6 // other.collisionMask & (1 << m) + beq next_other + ldrb r0, [OTHER, #0x10] // disable collision flag ands r0, r0, #0x80 - beq _080B1CC8 - ldrb r0, [r4, #0x38] - ldrb r1, [r5, #0x38] + beq next_other + ldrb r0, [THIS, #0x38] // collisionLayer + ldrb r1, [OTHER, #0x38] ands r0, r0, r1 - beq _080B1CC8 - ldrb r0, [r5, #0x3c] + beq next_other + ldrb r0, [OTHER, #0x3c] // collisionFlags orr r0, r0, r3 - lsrs r0, r0, #7 + lsrs r0, r0, #7 // top bhs _080B1D20 - ldrb r0, [r5, #0x3d] + ldrb r0, [OTHER, #0x3d] // iframes orrs r0, r0, r2 - bne _080B1CC8 + bne next_other _080B1D20: bl arm_CalcCollision cmp r0, #0 - beq _080B1CC8 - ldrb r3, [r4, #0x3c] - ldrb r0, [r4, #0x3d] - ldrb r1, [r4, #0x43] + beq next_other + ldrb r3, [THIS, #0x3c] + ldrb r0, [THIS, #0x3d] // iframes + ldrb r1, [THIS, #0x43] // hitType orr r2, r0, r1 - ldrb r0, [r5, #0x41] + ldrb r0, [OTHER, #0x41] // OTHER processing a collision already? ands r0, r0, #0x80 - bne _080B1D58 - str r4, [r5, #0x4c] - ldrb r0, [r4, #0x40] + bne _080B1D58 // branch if set + str THIS, [OTHER, #0x4c] // contactedEntity + ldrb r0, [THIS, #0x40] orr r0, r0, #0x80 - strb r0, [r5, #0x41] + strb r0, [OTHER, #0x41] // contactFlags |= 0x80 _080B1D58: - ldrb r0, [r4, #0x41] + ldrb r0, [THIS, #0x41] // THIS processing a collision already? ands r0, r0, #0x80 - bne _080B1CC8 - str r5, [r4, #0x4c] - ldrb r0, [r5, #0x40] + bne next_other + str OTHER, [THIS, #0x4c] + ldrb r0, [OTHER, #0x40] orr r0, r0, #0x80 - strb r0, [r4, #0x41] - b _080B1CC8 -_080B1D78: + strb r0, [THIS, #0x41] + b next_other +end_check_this: ldr r8, [r8, #4] cmp r8, r7 - bne _080B1C9C + bne next_this _080B1D84: pop {r4, r5, r6, r7, r8, sb, sl, lr} bx lr @@ -366,56 +369,59 @@ _080B1D94: .4byte gCollidableCount arm_func_start arm_CalcCollision arm_CalcCollision: @ 0x080B1D98 - @ r6 = this, r7 = other + THIS .req r4 + OTHER .req r5 + BB_THIS .req r6 + BB_OTHER .req r7 push {r2, r3, r6, r7, r8, sb, ip, lr} - ldr r6, [r4, #0x48] - ldr r7, [r5, #0x48] - ldrh r0, [r4, #0x2e] - ldrh r1, [r5, #0x2e] + ldr BB_THIS, [THIS, #0x48] + ldr BB_OTHER, [OTHER, #0x48] + ldrh r0, [THIS, #0x2e] + ldrh r1, [OTHER, #0x2e] sub r0, r0, r1 - ldrsb r1, [r6] + ldrsb r1, [BB_THIS] add r0, r0, r1 - ldrsb r1, [r7] + ldrsb r1, [BB_OTHER] sub r0, r0, r1 - ldrb r1, [r6, #6] - ldrb r2, [r7, #6] + ldrb r1, [BB_THIS, #6] + ldrb r2, [BB_OTHER, #6] add r1, r1, r2 add r2, r0, r1 cmp r2, r1, lsl #1 - bhi _080B1F28 - ldrh r1, [r4, #0x32] - ldrh r2, [r5, #0x32] + bhi not_overlapping + ldrh r1, [THIS, #0x32] + ldrh r2, [OTHER, #0x32] sub r1, r1, r2 - ldrsb r2, [r6, #1] + ldrsb r2, [BB_THIS, #1] add r1, r1, r2 - ldrsb r2, [r7, #1] + ldrsb r2, [BB_OTHER, #1] sub r1, r1, r2 - ldrb r2, [r6, #7] - ldrb r3, [r7, #7] + ldrb r2, [BB_THIS, #7] + ldrb r3, [BB_OTHER, #7] add r2, r2, r3 add r3, r1, r2 cmp r3, r2, lsl #1 - bhi _080B1F28 + bhi not_overlapping mov r2, #5 mov r3, #5 - ldr r8, [r4, #0x3c] + ldr r8, [THIS, #0x3c] // collisionFlags & 0x10 ands r8, r8, #0x10 - ldrbne r2, [r6, #8] - ldr r8, [r5, #0x3c] + ldrbne r2, [BB_THIS, #8] // 3d hitbox + ldr r8, [OTHER, #0x3c] ands r8, r8, #0x10 - ldrbne r3, [r7, #8] + ldrbne r3, [BB_OTHER, #8] add r2, r2, r3 - ldrsh r8, [r4, #0x36] - ldrsh sb, [r5, #0x36] + ldrsh r8, [THIS, #0x36] // Z + ldrsh sb, [OTHER, #0x36] sub r8, r8, sb add r8, r2, r8 cmp r8, r2, lsl #1 - bhi _080B1F28 - ldrb r2, [r4, #0x3c] + bhi not_overlapping + ldrb r2, [THIS, #0x3c] // collisionFlags & BBOX_SOLID and r2, r2, #0x20 lsr r2, r2, #3 - ldrb r3, [r5, #0x3c] + ldrb r3, [OTHER, #0x3c] and r3, r3, #0x20 adds r2, r2, r3, lsr #2 beq _080B1E74 @@ -428,10 +434,10 @@ _080B1E74: mov ip, #0 bl arm_CalcCollisionDirection mov r6, r0 - ldrb r1, [r5, #0x3f] // hitType + ldrb r1, [OTHER, #0x3f] // hitType mov r0, #0x22 mul r1, r0, r1 - ldrb r0, [r4, #0x40] // hurtType + ldrb r0, [THIS, #0x40] // hurtType add r0, r0, r1 mov r1, #0xc mul r2, r0, r1 @@ -449,106 +455,120 @@ _080B1E74: mov lr, pc bx r7 _080B1ED4: - cmp r0, #0 - beq _080B1F20 - cmp r0, #2 - beq _080B1F1C - ldrb r0, [r4, #0x3c] + cmp r0, #0 // RESULT_NO_COLLISION + beq no_col + cmp r0, #2 // RESULT_COLLISION_WITHOUT_SET + beq col_no_set + // RESULT_COLLISION + ldrb r0, [THIS, #0x3c] // collisionFlags and r0, r0, #0x80 lsr r0, r0, #5 - ldrb r1, [r5, #0x3c] + ldrb r1, [OTHER, #0x3c] // collisionFlags and r1, r1, #0x80 lsr r1, r1, #4 add r0, r0, r1 add r1, pc, #0xF4 @ =_080B1FFC ldr r0, [r1, r0] mov lr, pc - bx r0 + bx r0 // jumptable 0 1 2 _080B1F10: - strb r6, [r5, #0x3e] + strb r6, [OTHER, #0x3e] eor r6, r6, #0x10 - strb r6, [r4, #0x3e] -_080B1F1C: + strb r6, [THIS, #0x3e] +col_no_set: mov r0, #1 -_080B1F20: +no_col: pop {r2, r3, r6, r7, r8, sb, ip, lr} bx lr -_080B1F28: +not_overlapping: mov r0, #0 - b _080B1F20 + b no_col + // BBOX_SOLID THIS arm_func_start arm_sub_080B1F30 arm_sub_080B1F30: @ 0x080B1F30 - ldrh r0, [r4, #0x2e] - ldrh r1, [r5, #0x2e] + ldrh r0, [THIS, #0x2e] + ldrh r1, [OTHER, #0x2e] sub r0, r0, r1 - ldrsb r1, [r7] + ldrsb r1, [BB_OTHER] sub r0, r0, r1 - ldrh r1, [r4, #0x32] - ldrh r2, [r5, #0x32] + ldrh r1, [THIS, #0x32] + ldrh r2, [OTHER, #0x32] sub r1, r1, r2 - ldrsb r2, [r7, #1] + ldrsb r2, [BB_OTHER, #1] sub r1, r1, r2 bx lr + // BBOX_SOLID OTHER arm_func_start arm_sub_080B1F5C arm_sub_080B1F5C: @ 0x080B1F5C - ldrh r0, [r4, #0x2e] - ldrh r1, [r5, #0x2e] + ldrh r0, [THIS, #0x2e] + ldrh r1, [OTHER, #0x2e] sub r0, r0, r1 - ldrsb r1, [r6] + ldrsb r1, [BB_THIS] add r0, r0, r1 - ldrh r1, [r4, #0x32] - ldrh r2, [r5, #0x32] + ldrh r1, [THIS, #0x32] + ldrh r2, [OTHER, #0x32] sub r1, r1, r2 - ldrsb r2, [r6, #1] + ldrsb r2, [BB_THIS, #1] add r1, r1, r2 bx lr + // BBOX_SOLID BOTH arm_func_start arm_sub_080B1F88 arm_sub_080B1F88: @ 0x080B1F88 - ldrh r0, [r4, #0x2e] - ldrh r1, [r5, #0x2e] + ldrh r0, [THIS, #0x2e] + ldrh r1, [OTHER, #0x2e] sub r0, r0, r1 - ldrh r1, [r4, #0x32] - ldrh r2, [r5, #0x32] + ldrh r1, [THIS, #0x32] + ldrh r2, [OTHER, #0x32] sub r1, r1, r2 bx lr + // BBOX_REFLECT OTHER arm_func_start arm_sub_080B1FA4 arm_sub_080B1FA4: @ 0x080B1FA4 - ldrb r0, [r5, #0x15] + ldrb r0, [r5, #0x15] // invert direction eor r0, r0, #0x10 b _080B1FB4 + + // BBOX_REFLECT THIS _080B1FB0: - ldrb r0, [r4, #0x15] + ldrb r0, [THIS, #0x15] // direction _080B1FB4: - sub r1, r0, #8 - and r1, r1, #0x1f - sub r1, r6, r1 - and r1, r1, #0x1f + sub r1, r0, #8 // turn counterclockwise + and r1, r1, #0x1f // normalize + sub r1, r6, r1 // sub calcDir + and r1, r1, #0x1f // normalize cmp r1, #0x11 - bxlo lr - sub r0, r6, r0 - sub r0, r0, #8 - and r0, r0, #0x1f - sub r6, r6, r0, lsl #1 + bxlo lr // branch if facing to the right + sub r0, r6, r0 // sub calcDir + sub r0, r0, #8 // turn counterclockwise + and r0, r0, #0x1f // normalize + sub r6, r6, r0, lsl #1 // calcDir -= 2 * temp and r6, r6, #0x1f bx lr + // BBOX_REFLECT BOTH arm_func_start arm_sub_080B1FE4 arm_sub_080B1FE4: @ 0x080B1FE4 - ldrb r6, [r4, #0x15] + ldrb r6, [THIS, #0x15] // direction + + // BBOX_REFLECT NONE, BBOX_SOLID NONE _080B1FE8: bx lr + + _080B1FEC: .4byte ram_sub_080B1FE8 _080B1FF0: .4byte ram_sub_080B1F30 _080B1FF4: .4byte ram_sub_080B1F5C _080B1FF8: .4byte ram_sub_080B1F88 + _080B1FFC: .4byte ram_sub_080B1FE8 _080B2000: .4byte ram_sub_080B1FB0 _080B2004: .4byte ram_sub_080B1FA4 _080B2008: .4byte ram_sub_080B1FE4 + _080B200C: .4byte gCollidableList _080B2010: .4byte gCollidableCount _080B2014: .4byte gCollisionMtx diff --git a/include/definitions.h b/include/definitions.h index 7764f76fb..088635dba 100644 --- a/include/definitions.h +++ b/include/definitions.h @@ -22,7 +22,7 @@ typedef struct EnemyDefinition { u8 health; s16 speed; u8 damageType; - u8 flags2; + u8 collisionMask; } EnemyDefinition; typedef struct ProjectileDefinition { @@ -43,7 +43,7 @@ typedef struct ProjectileDefinition { u8 field0x40; s16 speed; u8 damageType; - u8 flags2; + u8 collisionMask; } ProjectileDefinition; // Sprite data definition for objects and npcs diff --git a/include/entity.h b/include/entity.h index 8a66283c7..455761c03 100644 --- a/include/entity.h +++ b/include/entity.h @@ -79,7 +79,39 @@ typedef enum { DirectionNorthWest = 0x1c, /**< North West. */ } Direction; -#define CONTACT_TAKE_DAMAGE 0x80 +/** Collision layer flags. */ +typedef enum { + COL_LAYER_NONE = 0x0, + COL_LAYER_BOTTOM = 0x1, + COL_LAYER_TOP = 0x2, + COL_LAYER_BOTH = 0x3 +} CollisionLayer; + +/** + * Collision class flags. + * An Entity's collision class is determined by the first 3 bits of #Entity::collisionFlags. + * What classes an Entity collides with is determined by the bitfield #Entity::collisionMask. +*/ +typedef enum { + COL_CLASS_NONE = 0x0, + COL_CLASS_PLAYER = 0x1, + COL_CLASS_ITEM = 0x2, + COL_CLASS_FLAMMABLE = 0x3, + COL_CLASS_4 = 0x4, + COL_CLASS_5 = 0x5, + COL_CLASS_6 = 0x6, + COL_CLASS_PACCI_OBJ = 0x7, +} CollisionClass; + +/** Collision flags. */ +typedef enum { + COL_FLAG_3D = 0x10, + COL_FLAG_SOLID = 0x20, + COL_FLAG_REFLECT = 0x80, +} CollisionFlags; + +#define COLLISION_MASK(layer) (1 << (layer)) +#define CONTACT_NOW 0x80 typedef struct { void* entity1; @@ -194,11 +226,11 @@ typedef struct Entity_ { /*0x2c*/ union SplitWord x; /**< X position, fixed point Q16.16. */ /*0x30*/ union SplitWord y; /**< Y position, fixed point Q16.16. */ /*0x34*/ union SplitWord z; /**< Z position, fixed point Q16.16. */ - /*0x38*/ u8 collisionLayer; /**< Collision layer. */ + /*0x38*/ u8 collisionLayer; /**< @see CollisionLayer. */ /*0x39*/ s8 interactType; /*0x3a*/ u8 gustJarState; /**< 4: grabbed by GustJar */ - /*0x3b*/ u8 flags2; /**< Debug visualization related? */ - /*0x3c*/ u8 collisionFlags; /**< Controls collision modes. */ + /*0x3b*/ u8 collisionMask; /**< Bitfield. @see CollisionClass */ + /*0x3c*/ u8 collisionFlags; /**< @see CollisionFlags, @see CollisionClass */ /*0x3d*/ s8 iframes; /**< Invulnerability frames. */ /*0x3e*/ u8 knockbackDirection; /**< Direction of knockback. */ /*0x3f*/ u8 hitType; /**< Behavior as a collision sender. */ diff --git a/include/player.h b/include/player.h index 0f0aa0275..e344d0afd 100644 --- a/include/player.h +++ b/include/player.h @@ -511,7 +511,7 @@ typedef struct { /*0x39*/ u8 field_0x39; /*0x3a*/ u8 field_0x3a; /*0x3b*/ u8 field_0x3b; - /*0x3c*/ u8 field_0x3c; + /*0x3c*/ u8 killed; /**< Non-zero if player is dead */ /*0x3d*/ u8 moleMittsState; /*0x3e*/ u8 swordDamage : 2; /* */ u8 filler14 : 6; diff --git a/src/code_08049DF4.c b/src/code_08049DF4.c index 89cf62167..c72da0d8a 100644 --- a/src/code_08049DF4.c +++ b/src/code_08049DF4.c @@ -18,7 +18,7 @@ Entity* sub_08049DF4(u32 arg0) { } Entity* sub_08049E18(void) { - if ((gPlayerState.field_0x3c == 0) && + if ((gPlayerState.killed == 0) && !(gPlayerState.flags & (PL_BUSY | PL_DROWNING | PL_CAPTURED | PL_USE_PORTAL | PL_HIDDEN | PL_DISABLE_ITEMS | PL_FALLING | PL_FROZEN | PL_IN_MINECART | PL_PIT_IS_EXIT | PL_MOLDWORM_CAPTURED | PL_IN_HOLE | PL_CONVEYOR_PUSHED | PL_CLIMBING))) { @@ -29,7 +29,7 @@ Entity* sub_08049E18(void) { } Entity* sub_08049E4C(void) { - if ((gPlayerState.field_0x3c == 0) && + if ((gPlayerState.killed == 0) && !(gPlayerState.flags & (PL_BUSY | PL_DROWNING | PL_CAPTURED | PL_USE_PORTAL | PL_HIDDEN | PL_MINISH | PL_DISABLE_ITEMS | PL_FALLING | PL_FROZEN | PL_IN_MINECART | PL_PIT_IS_EXIT | PL_MOLDWORM_CAPTURED | PL_IN_HOLE | PL_CONVEYOR_PUSHED | PL_CLIMBING))) { @@ -40,7 +40,7 @@ Entity* sub_08049E4C(void) { } Entity* sub_08049E80(void) { - if ((gPlayerState.field_0x3c != 0) || !(gPlayerState.flags & PL_MINISH)) { + if ((gPlayerState.killed != 0) || !(gPlayerState.flags & PL_MINISH)) { return NULL; } gUnk_020000B0 = &gPlayerEntity.base; @@ -48,7 +48,7 @@ Entity* sub_08049E80(void) { } Entity* sub_08049EB0(void) { - if ((gPlayerState.field_0x3c == 0) && + if ((gPlayerState.killed == 0) && !(gPlayerState.flags & (PL_MOLDWORM_CAPTURED | PL_DISABLE_ITEMS | PL_MINISH | PL_CAPTURED))) { gUnk_020000B0 = &gPlayerEntity.base; return &gPlayerEntity.base; diff --git a/src/collision.c b/src/collision.c index 6dda05c31..955959066 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 | CONTACT_TAKE_DAMAGE; + tgt->contactFlags = org->hurtType | CONTACT_NOW; 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 | CONTACT_TAKE_DAMAGE; + gPlayerEntity.base.contactFlags = tgt->hurtType | CONTACT_NOW; 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 73911ecfd..f2e7c2018 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 db597408f..99fe9517c 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 75924746d..19603462b 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 7dfae72ec..f1ae158bf 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 6a1176ee8..b071ced48 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 3c374cd44..a17f4c960 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 c9ee902c7..d5502a80e 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 64bf98cc6..74f4be6b9 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 c540e4ae5..5c8824809 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 39820a644..6a7a17db5 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 9987ee888..36156ce7b 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 3b4ee58c7..1ccf4e780 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 cc868bc0e..0402aac52 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 23ba5c877..4e5acb0eb 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 87a9c402d..f835ec1fb 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 0f521e14a..e0813e6df 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 9eb430b91..e88550f12 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 dfdcae96a..2f52e0ab6 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 ab1437ccd..6a929ab61 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 348d7e25e..40688bfec 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 740ceb54e..c0dba3db1 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 4bdc4253f..17745ecb1 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 373953f62..0a124fe50 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 39d929c96..387740b9c 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 15e848469..a4ec8dd88 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 ef1650f76..a09275f1a 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 8af9198af..9afd925a4 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 c3250c605..a8404af91 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 e386d4b67..05e382866 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 4b760d663..72e18f8dd 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 db6233e18..deb60f260 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 7ebff811d..ada5434ef 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 bbd7f2231..72bb2f8ac 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 7006c8b90..79a65afe3 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 97d5850bb..271a4c23c 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 297b3b510..3bd9b0da8 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 d736b8e09..72329b9f1 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 b4a26dfb3..4bb4b5c1d 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 38aa602f7..fc5c90bd5 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 0cc625b32..be3e79e4a 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 c6af233a8..617376441 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 b94db4e55..facc55272 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 a32eb6248..94e040be5 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 3df5abe68..7a27a6eba 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 285865493..5463b4f0a 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 9d8f71588..663133fef 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 74e0a5221..c3e33442b 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 cac6435ce..21f5c5061 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 88125bcfb..e5c4c5e5e 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 ae2dbcfe5..364d56bd6 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 18ee71162..92afac49d 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; diff --git a/src/enemyUtils.c b/src/enemyUtils.c index ed13377fd..35ff738d0 100644 --- a/src/enemyUtils.c +++ b/src/enemyUtils.c @@ -79,7 +79,7 @@ bool32 EnemyInit(Enemy* this) { if (super->speed == 0) { super->speed = definition->speed; } - super->flags2 = definition->flags2; + super->collisionMask = definition->collisionMask; super->hitType = definition->damageType; super->hitbox = (Hitbox*)definition->ptr.hitbox; super->health = definition->health; @@ -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 &= ~CONTACT_TAKE_DAMAGE; + entity->contactFlags &= ~CONTACT_NOW; idx = GetNextFunction(entity); - entity->contactFlags |= CONTACT_TAKE_DAMAGE; + entity->contactFlags |= CONTACT_NOW; fntable[idx](entity); } diff --git a/src/interrupts.c b/src/interrupts.c index f52a8da3e..828a65379 100644 --- a/src/interrupts.c +++ b/src/interrupts.c @@ -10,6 +10,7 @@ #include "sound.h" #include "structures.h" #include "ui.h" +#include "collision.h" extern u8 gUnk_03003DE0; extern u8 gUnk_03000C30; @@ -236,7 +237,7 @@ static void HandlePlayerLife(Entity* this) { gUnk_0200AF00.rActionInteractTile = R_ACTION_NONE; gUnk_0200AF00.rActionGrabbing = R_ACTION_NONE; - if ((gPlayerEntity.base.contactFlags & CONTACT_TAKE_DAMAGE) && (gPlayerEntity.base.iframes > 0)) + if ((gPlayerEntity.base.contactFlags & CONTACT_NOW) && (gPlayerEntity.base.iframes > 0)) SoundReq(SFX_86); gPlayerState.flags &= ~(PL_FALLING | PL_CONVEYOR_PUSHED); @@ -323,7 +324,7 @@ static void sub_080171F0(void) { if (gPlayerEntity.unk_7a != 0) gPlayerEntity.unk_7a--; - gPlayerEntity.base.contactFlags &= ~CONTACT_TAKE_DAMAGE; + gPlayerEntity.base.contactFlags &= ~CONTACT_NOW; if (gPlayerEntity.base.action != PLAYER_DROWN) COPY_FLAG_FROM_TO(gPlayerState.flags, 0x2, 0x10000); diff --git a/src/npc/cat.c b/src/npc/cat.c index a3228998a..9adf40f1c 100644 --- a/src/npc/cat.c +++ b/src/npc/cat.c @@ -140,7 +140,7 @@ void sub_080677EC(CatEntity* this) { super->collisionFlags = 7; super->hurtType = 0x48; super->hitType = -0x58; - super->flags2 = 1; + super->collisionMask = 1; this->unk_69 = 0xff; if (super->x.HALF.HI < gPlayerEntity.base.x.HALF.HI) { super->spriteSettings.flipX = 1; diff --git a/src/npc/npc5.c b/src/npc/npc5.c index 1b60767d7..b6b17ca60 100644 --- a/src/npc/npc5.c +++ b/src/npc/npc5.c @@ -2,7 +2,7 @@ * @file npc5.c * @ingroup NPCs * - * @brief NPC 5 + * @brief Unused Zelda follower NPC. */ #include "collision.h" #include "functions.h" @@ -166,7 +166,7 @@ void sub_08060AE0(NPC5Entity* this) { super->collisionFlags = 7; super->hurtType = 0x48; super->hitType = 0x49; - super->flags2 = 3; + super->collisionMask = 3; super->hitbox = (Hitbox*)&gHitbox_0; super->followerFlag &= 0xfe; this->unk_6c = 0xff; @@ -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 & CONTACT_TAKE_DAMAGE) != 0) { + if ((super->contactFlags & CONTACT_NOW) != 0) { switch (super->contactFlags & 0x7f) { case 0: case 1: diff --git a/src/object.c b/src/object.c index 31bbdd639..4f61cd10c 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 &= ~CONTACT_TAKE_DAMAGE; + this->contactFlags &= ~CONTACT_NOW; } DrawEntity(this); } diff --git a/src/object/barrelSpiderweb.c b/src/object/barrelSpiderweb.c index d4d821ddc..69a1ea777 100644 --- a/src/object/barrelSpiderweb.c +++ b/src/object/barrelSpiderweb.c @@ -40,7 +40,7 @@ void BarrelSpiderweb_Init(Entity* this) { this->hitType = 1; this->collisionFlags = 7; this->hurtType = 0x48; - this->flags2 = 4; + this->collisionMask = 4; this->hitbox = (Hitbox*)&gHitbox_0; this->frameIndex = 2; this->collisionLayer = gPlayerEntity.base.collisionLayer; @@ -64,7 +64,7 @@ void sub_0808BBE0(Entity* this) { ptr = &gUnk_0812144C[diff * 2]; SetAffineInfo(this, ptr[0], ptr[1], 0); } else { - this->contactFlags &= ~CONTACT_TAKE_DAMAGE; + this->contactFlags &= ~CONTACT_NOW; } } @@ -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 == (CONTACT_TAKE_DAMAGE | 0x13)) { + if (this->contactFlags == (CONTACT_NOW | 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 == (CONTACT_TAKE_DAMAGE | 0x13)) { + if (this->contactFlags == (CONTACT_NOW | 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/bigIceBlock.c b/src/object/bigIceBlock.c index 126b06005..0cc856b9e 100644 --- a/src/object/bigIceBlock.c +++ b/src/object/bigIceBlock.c @@ -48,7 +48,7 @@ void BigIceBlock_Init(BigIceBlockEntity* this) { super->collisionFlags = 7; super->hurtType = 0x48; super->hitType = 1; - super->flags2 = 0x80; + super->collisionMask = 0x80; super->hitbox = (Hitbox*)&gUnk_080FD190; sub_08099910(this); InitializeAnimation(super, super->type); diff --git a/src/object/bush.c b/src/object/bush.c index 4e0863471..d0fbc49e8 100644 --- a/src/object/bush.c +++ b/src/object/bush.c @@ -64,7 +64,7 @@ void Bush_Init(BushEntity* this) { super->health = 1; super->collisionFlags = 7; super->hitType = 0x6e; - super->flags2 = 4; + super->collisionMask = 4; super->hitbox = (Hitbox*)&gUnk_081205B4; this->unk_72 = 0; this->unk_70 = GetTileIndex(COORD_TO_TILE(super), super->collisionLayer); diff --git a/src/object/dirtParticle.c b/src/object/dirtParticle.c index ac7e848e1..cfd0295a7 100644 --- a/src/object/dirtParticle.c +++ b/src/object/dirtParticle.c @@ -78,7 +78,7 @@ void DirtParticle_Init(DirtParticleEntity* this) { super->health = 1; super->collisionFlags = 7; super->hitType = 0xaa; - super->flags2 = 0x0e; + super->collisionMask = 0x0e; super->hitbox = (Hitbox*)&gUnk_08120A8C; super->gustJarFlags = 0; case 2: @@ -101,7 +101,7 @@ void DirtParticle_Init(DirtParticleEntity* this) { void DirtParticle_Action1(DirtParticleEntity* this) { DirtParticleEntity* entity; - if ((super->contactFlags & CONTACT_TAKE_DAMAGE) == 0) { + if ((super->contactFlags & CONTACT_NOW) == 0) { return; } switch (super->contactFlags & 0x7f) { @@ -128,7 +128,7 @@ void DirtParticle_Action3(DirtParticleEntity* this) { sub_08087B9C, sub_08087B9C, }; - if ((super->contactFlags & CONTACT_TAKE_DAMAGE) != 0) { + if ((super->contactFlags & CONTACT_NOW) != 0) { gUnk_08120A80[super->subAction](this); } else { super->action = 1; diff --git a/src/object/evilSpirit.c b/src/object/evilSpirit.c index a09392a48..43dc00ab2 100644 --- a/src/object/evilSpirit.c +++ b/src/object/evilSpirit.c @@ -55,7 +55,7 @@ void EvilSpirit_Init(EvilSpiritEntity* this) { COLLISION_ON(super); super->collisionFlags = 7; super->hitType = 1; - super->flags2 = 4; + super->collisionMask = 4; for (index = 0; index < 4; index++) { evilSpiritEnt = CreateObjectWithParent(super, EVIL_SPIRIT, index + 1, 0); super->child = evilSpiritEnt; diff --git a/src/object/eyeSwitch.c b/src/object/eyeSwitch.c index 60310e5c0..0e401a64d 100644 --- a/src/object/eyeSwitch.c +++ b/src/object/eyeSwitch.c @@ -37,7 +37,7 @@ void EyeSwitch_Init(EyeSwitchEntity* this) { super->collisionFlags = 7; super->hurtType = 0x48; super->hitType = 1; - super->flags2 = 2; + super->collisionMask = 2; super->hitbox = (Hitbox*)&gHitbox_1; if (CheckFlags(this->eyeSwitchFlags)) { super->action = 3; @@ -50,7 +50,7 @@ void EyeSwitch_Init(EyeSwitchEntity* this) { } void EyeSwitch_Action1(EyeSwitchEntity* this) { - if ((super->contactFlags == (CONTACT_TAKE_DAMAGE | 0x15) || super->contactFlags == (CONTACT_TAKE_DAMAGE | 0xe)) && + if ((super->contactFlags == (CONTACT_NOW | 0x15) || super->contactFlags == (CONTACT_NOW | 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 380269060..0f2eb209c 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 & CONTACT_TAKE_DAMAGE) != 0)) { + if (((super->contactFlags & CONTACT_NOW) != 0)) { switch (super->contactFlags & 0x7f) { case 0x14: super->action = 3; @@ -103,7 +103,7 @@ void Fairy_Init(FairyEntity* this) { super->collisionFlags = 0x17; super->hurtType = 0x49; super->hitType = 7; - super->flags2 = 0x17; + super->collisionMask = 0x17; super->health = 0xff; super->hitbox = (Hitbox*)&gUnk_080FD1A8; super->gustJarFlags = 1; @@ -253,6 +253,6 @@ void sub_0808DB2C(FairyEntity* this) { super->action = 2; super->subAction = 0; super->flags |= ENT_COLLIDE; - super->flags2 = 1; + super->collisionMask = 1; CopyPosition(&gPlayerEntity.base, super); } diff --git a/src/object/gleerokParticle.c b/src/object/gleerokParticle.c index 23bd5d172..7af41d2f6 100644 --- a/src/object/gleerokParticle.c +++ b/src/object/gleerokParticle.c @@ -152,7 +152,7 @@ void GleerokParticle_Init(GleerokParticleEntity* this) { super->collisionFlags = 7; super->hurtType = 0x48; super->hitType = 0x7a; - super->flags2 = 1; + super->collisionMask = 1; } break; case 0x80: diff --git a/src/object/hittableLever.c b/src/object/hittableLever.c index 0bf530acc..a2d973019 100644 --- a/src/object/hittableLever.c +++ b/src/object/hittableLever.c @@ -32,7 +32,7 @@ void HittableLever_Init(HittableLeverEntity* this) { super->flags |= ENT_COLLIDE; super->collisionFlags = 7; super->hitType = 0x8f; - super->flags2 = 0xa; + super->collisionMask = 0xa; super->hitbox = (Hitbox*)&HittableLever_Hitbox; if (super->type == 0) { if (CheckFlags(this->hitFlag)) { @@ -47,7 +47,7 @@ void HittableLever_Init(HittableLeverEntity* this) { } void HittableLever_Idle(HittableLeverEntity* this) { - if (((super->contactFlags & CONTACT_TAKE_DAMAGE) != 0) && (this->wasHit == 0)) { + if (((super->contactFlags & CONTACT_NOW) != 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 b3f6f0453..8080b14c7 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 & CONTACT_TAKE_DAMAGE) { + if (super->contactFlags & CONTACT_NOW) { switch (super->contactFlags & 0x7F) { case 20: super->action = 3; @@ -130,10 +130,10 @@ void ItemOnGround_Init(ItemOnGroundEntity* this) { case ITEM_BOMBS5: case ITEM_ARROWS5: case ITEM_HEART: - super->flags2 = 0x17; + super->collisionMask = 0x17; break; default: - super->flags2 = 0x11; + super->collisionMask = 0x11; break; } @@ -186,7 +186,7 @@ void sub_080810FC(ItemOnGroundEntity* this) { super->action = 2; super->subAction = 0; COLLISION_ON(super); - super->flags2 = 0x11; + super->collisionMask = 0x11; CopyPosition(&gPlayerEntity.base, super); } } diff --git a/src/object/jarPortal.c b/src/object/jarPortal.c index cd77b9568..83c47a0db 100644 --- a/src/object/jarPortal.c +++ b/src/object/jarPortal.c @@ -39,7 +39,7 @@ void JarPortal_Init(JarPortalEntity* this) { super->hitType = 1; super->collisionFlags = 0x47; super->hurtType = 0x44; - super->flags2 = 0x80; + super->collisionMask = 0x80; this->unk_68 = 0; if (CheckLocalFlag(super->type)) { if (this->unk_7c != 0) { @@ -170,7 +170,7 @@ void JarPortal_Action4(JarPortalEntity* this) { } u32 sub_0808C128(JarPortalEntity* this) { - return super->contactFlags == (CONTACT_TAKE_DAMAGE | 0x1d); + return super->contactFlags == (CONTACT_NOW | 0x1d); } void sub_0808C13C(JarPortalEntity* this) { diff --git a/src/object/lavaPlatform.c b/src/object/lavaPlatform.c index 619bc6850..5e8064941 100644 --- a/src/object/lavaPlatform.c +++ b/src/object/lavaPlatform.c @@ -112,7 +112,7 @@ void LavaPlatform_Type1Init(LavaPlatformEntity* this) { super->spritePriority.b0 = 7; super->hurtType = 0x48; super->collisionFlags = 7; - super->flags2 = 0x81; + super->collisionMask = 0x81; super->hitbox = (Hitbox*)&gUnk_080FD280; sub_0809264C(this); } @@ -131,7 +131,7 @@ void LavaPlatform_Type1Action1(LavaPlatformEntity* this) { } void LavaPlatform_Type1Action2(LavaPlatformEntity* this) { - if (super->contactFlags == (CONTACT_TAKE_DAMAGE | 0x1d)) { + if (super->contactFlags == (CONTACT_NOW | 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 == (CONTACT_TAKE_DAMAGE | 0x1d)) { + if (super->contactFlags == (CONTACT_NOW | 0x1d)) { sub_08092620(this); } } diff --git a/src/object/lightableSwitch.c b/src/object/lightableSwitch.c index 06bb32448..a6f0427f4 100644 --- a/src/object/lightableSwitch.c +++ b/src/object/lightableSwitch.c @@ -58,7 +58,7 @@ void LightableSwitch_Type0_Init(LightableSwitchEntity* this) { super->collisionFlags = 7; super->hurtType = 0x48; super->hitType = 0x28; - super->flags2 = 10; + super->collisionMask = 10; super->hitbox = (Hitbox*)&gHitbox_0; sub_0809EAD8(this); UpdateSpriteForCollisionLayer(super); @@ -67,7 +67,7 @@ void LightableSwitch_Type0_Init(LightableSwitchEntity* this) { void LightableSwitch_Type0_Action1(LightableSwitchEntity* this) { - if ((super->contactFlags & CONTACT_TAKE_DAMAGE) != 0) { + if ((super->contactFlags & CONTACT_NOW) != 0) { if (CheckFlags(this->unk_86) != 0) { ClearFlag(this->unk_86); } else { @@ -136,7 +136,7 @@ void LightableSwitch_Type1_Init(LightableSwitchEntity* this) { super->collisionFlags = 7; super->hurtType = 0x48; super->hitType = 0x28; - super->flags2 = 10; + super->collisionMask = 10; super->hitbox = (Hitbox*)&gHitbox_0; sub_0809EAD8(this); UpdateSpriteForCollisionLayer(super); @@ -147,7 +147,7 @@ void LightableSwitch_Type1_Init(LightableSwitchEntity* this) { } void LightableSwitch_Type1_Action1(LightableSwitchEntity* this) { - if ((super->contactFlags & CONTACT_TAKE_DAMAGE) != 0) { + if ((super->contactFlags & CONTACT_NOW) != 0) { super->action = 2; super->timer = 16; super->frameIndex = 2; diff --git a/src/object/lilypadLarge.c b/src/object/lilypadLarge.c index b4bd9c604..d90c16106 100644 --- a/src/object/lilypadLarge.c +++ b/src/object/lilypadLarge.c @@ -76,7 +76,7 @@ void LilypadLarge_Init(LilypadLargeEntity* this) { super->flags |= ENT_COLLIDE; super->collisionFlags = 7; super->hitType = 1; - super->flags2 = 4; + super->collisionMask = 4; this->unk_78.WORD = 0x1000000; this->unk_7c.HALF_U.HI = 0x1000; this->unk_85 = 0; diff --git a/src/object/minecart.c b/src/object/minecart.c index b13f2c7e7..30594d6d7 100644 --- a/src/object/minecart.c +++ b/src/object/minecart.c @@ -54,7 +54,7 @@ void Minecart_Init(MinecartEntity* this) { super->hitType = 1; super->collisionFlags = 0x47; super->hurtType = 0x44; - super->flags2 = 0x80; + super->collisionMask = 0x80; super->direction = DirectionFromAnimationState(super->animationState); super->speed = 0x700; super->spritePriority.b1 = 3; @@ -112,7 +112,7 @@ void Minecart_Action2(MinecartEntity* this) { super->flags |= ENT_PERSIST; super->hitType = 0x97; super->collisionFlags = (gPlayerEntity.base.collisionFlags + 1) | 0x20; - super->flags2 = gPlayerEntity.base.flags2; + super->collisionMask = gPlayerEntity.base.collisionMask; super->hurtType = 0x18; super->damage = 8; sub_0801766C(super); @@ -176,7 +176,7 @@ void Minecart_Action3(MinecartEntity* this) { super->hitType = 1; super->collisionFlags = 0x47; super->hurtType = 0x44; - super->flags2 = 0x80; + super->collisionMask = 0x80; super->action = 6; sub_08017744(super); gPlayerState.jump_status = 0x41; diff --git a/src/object/mineralWaterSource.c b/src/object/mineralWaterSource.c index e60006d8a..3692821b5 100644 --- a/src/object/mineralWaterSource.c +++ b/src/object/mineralWaterSource.c @@ -46,7 +46,7 @@ void MineralWaterSource_Init(Entity* this) { this->collisionFlags = 7; this->hitType = 145; - this->flags2 = 2; + this->collisionMask = 2; this->action = 1; } diff --git a/src/object/objectA8.c b/src/object/objectA8.c index 6f47de252..4f602fd0a 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 & CONTACT_TAKE_DAMAGE) != 0) { + if ((super->contactFlags & CONTACT_NOW) != 0) { switch (super->contactFlags & 0x7f) { case 0: case 1: @@ -77,7 +77,7 @@ void ObjectA8_Init(ObjectA8Entity* this) { super->collisionFlags = 0x17; super->hurtType = 0x48; super->hitType = 7; - super->flags2 = 0x17; + super->collisionMask = 0x17; super->hitbox = (Hitbox*)&gUnk_080FD1A8; super->gustJarFlags = 1; this->unk_74 = super->x.HALF.HI; diff --git a/src/object/objectOnSpinyBeetle.c b/src/object/objectOnSpinyBeetle.c index aafecc5b3..fda7b4178 100644 --- a/src/object/objectOnSpinyBeetle.c +++ b/src/object/objectOnSpinyBeetle.c @@ -54,7 +54,7 @@ void ObjectOnSpinyBeetle_Init(ObjectOnSpinyBeetleEntity* this) { super->spriteRendering.b3 = 2; super->subtimer = 0; super->hitType = 0x6e; - super->flags2 = 0x86; + super->collisionMask = 0x86; super->carryFlags = 0; if (super->type != 0) { super->gustJarFlags = 2; @@ -72,7 +72,7 @@ void ObjectOnSpinyBeetle_Action1(ObjectOnSpinyBeetleEntity* this) { sub_080989C0(this); return; } - if ((super->contactFlags & CONTACT_TAKE_DAMAGE) != 0) { + if ((super->contactFlags & CONTACT_NOW) != 0) { switch (super->contactFlags & 0x3f) { case 0x13: super->action = 3; @@ -138,7 +138,7 @@ void ObjectOnSpinyBeetle_Action2Subaction0(ObjectOnSpinyBeetleEntity* this) { super->flags |= ENT_COLLIDE; super->collisionFlags = 7; super->hitType = 1; - super->flags2 = gPlayerEntity.base.flags2; + super->collisionMask = gPlayerEntity.base.collisionMask; super->spriteOffsetY = 0; (super->parent)->child = NULL; super->subAction++; diff --git a/src/object/playerClone.c b/src/object/playerClone.c index c6e65188d..f6767e076 100644 --- a/src/object/playerClone.c +++ b/src/object/playerClone.c @@ -163,7 +163,7 @@ void sub_08084B1C(PlayerCloneEntity* this) { super->spritePriority.b0 = gPlayerEntity.base.spritePriority.b0; super->spriteOrientation.flipY = gPlayerEntity.base.spriteOrientation.flipY; super->collisionLayer = gPlayerEntity.base.collisionLayer; - super->flags2 = gPlayerEntity.base.flags2; + super->collisionMask = gPlayerEntity.base.collisionMask; super->hitType = gPlayerEntity.base.hitType; super->collisionFlags = gPlayerEntity.base.collisionFlags; super->hurtType = gPlayerEntity.base.hurtType; diff --git a/src/object/pot.c b/src/object/pot.c index 3901820e3..444c14bb7 100644 --- a/src/object/pot.c +++ b/src/object/pot.c @@ -72,7 +72,7 @@ void Pot_Init(PotEntity* this) { super->health = 1; super->collisionFlags = 7; super->hitType = 0x6E; - super->flags2 = 0x84; + super->collisionMask = 0x84; super->gustJarFlags = 0x12; if (super->collisionLayer == 0) { ResolveCollisionLayer(super); @@ -156,7 +156,7 @@ void sub_08082510(PotEntity* this) { super->hitbox = (Hitbox*)&gUnk_080FD340; super->collisionFlags = 7; super->hitType = 1; - super->flags2 = gPlayerEntity.base.flags2; + super->collisionMask = gPlayerEntity.base.collisionMask; super->spriteOffsetY = 0; SetBottomTile((u16)this->unk_70, COORD_TO_TILE(super), super->collisionLayer); super->subAction++; diff --git a/src/object/pullableMushroom.c b/src/object/pullableMushroom.c index b8f6eabce..de90f11de 100644 --- a/src/object/pullableMushroom.c +++ b/src/object/pullableMushroom.c @@ -63,7 +63,7 @@ void PullableMushroom_Init(PullableMushroomEntity* this) { super->health = 1; super->collisionFlags = 7; super->hitType = 0x6e; - super->flags2 = 0x0e; + super->collisionMask = 0x0e; super->gustJarFlags = 1; super->flags |= 0x80; super->spriteOffsetY = 4; @@ -76,7 +76,7 @@ void PullableMushroom_Init(PullableMushroomEntity* this) { super->health = 1; super->collisionFlags = 7; super->hitType = 0x6e; - super->flags2 = 4; + super->collisionMask = 4; super->gustJarFlags = 1; super->action = 3; } diff --git a/src/object/sanctuaryStoneTablet.c b/src/object/sanctuaryStoneTablet.c index b612f4871..9d9439270 100644 --- a/src/object/sanctuaryStoneTablet.c +++ b/src/object/sanctuaryStoneTablet.c @@ -37,14 +37,14 @@ void SanctuaryStoneTablet_Init(SanctuaryStoneTabletEntity* this) { super->collisionFlags = 7; super->hurtType = 0x48; super->hitType = 1; - super->flags2 = 2; + super->collisionMask = 2; super->hitbox = (Hitbox*)&gHitbox_0; } void SanctuaryStoneTablet_Action1(SanctuaryStoneTabletEntity* this) { Entity* fxEnt; - if (super->contactFlags == (CONTACT_TAKE_DAMAGE | 0x21)) { + if (super->contactFlags == (CONTACT_NOW | 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 e79311908..f6e6e7b30 100644 --- a/src/object/smallIceBlock.c +++ b/src/object/smallIceBlock.c @@ -60,7 +60,7 @@ void SmallIceBlock_Init(SmallIceBlockEntity* this) { super->collisionFlags = 7; super->hurtType = 0x48; super->hitType = 1; - super->flags2 = 0x80; + super->collisionMask = 0x80; super->hitbox = (Hitbox*)&gUnk_080FD408; sub_08099468(this); InitializeAnimation(super, super->type); @@ -281,7 +281,7 @@ bool32 sub_0809963C(SmallIceBlockEntity* this) { } } } - if (super->contactFlags == (CONTACT_TAKE_DAMAGE | 0x7)) { + if (super->contactFlags == (CONTACT_NOW | 0x7)) { return TRUE; } return FALSE; diff --git a/src/object/smokeParticle.c b/src/object/smokeParticle.c index 4c24717ac..b6b2305d3 100644 --- a/src/object/smokeParticle.c +++ b/src/object/smokeParticle.c @@ -36,7 +36,7 @@ void SmokeParticle_Init(Entity* this) { this->hitType = 0xa9; this->hurtType = 0x16; this->hitbox = (Hitbox*)gUnk_08120A54[0]; - this->flags2 = 0x8b; + this->collisionMask = 0x8b; sub_080878CC(this); InitializeAnimation(this, 1); sub_0801766C(this); diff --git a/src/object/treeThorns.c b/src/object/treeThorns.c index 66f26cc6b..1af836210 100644 --- a/src/object/treeThorns.c +++ b/src/object/treeThorns.c @@ -26,7 +26,7 @@ void TreeThorns(Entity* this) { this->collisionFlags = 7; this->hurtType = 0x48; this->hitType = 0x7a; - this->flags2 = 1; + this->collisionMask = 1; this->hitbox = (Hitbox*)&gHitbox_1; tilePos = COORD_TO_TILE(this); SetBottomTile(0x4066, tilePos - 1, *layer); diff --git a/src/object/unusedSkull.c b/src/object/unusedSkull.c index d594d5c1e..038472d28 100644 --- a/src/object/unusedSkull.c +++ b/src/object/unusedSkull.c @@ -36,7 +36,7 @@ void UnusedSkull_Init(UnusedSkullEntity* this) { super->collisionFlags = 7; super->hitType = 1; super->hurtType = 0x47; - super->flags2 = 2; + super->collisionMask = 2; super->hitbox = (Hitbox*)&gHitbox_4; SetBottomTile(0x4050, COORD_TO_TILE(super), super->collisionLayer); if (super->type == 1 || CheckFlags(this->unk_86)) { @@ -49,7 +49,7 @@ void UnusedSkull_Init(UnusedSkullEntity* this) { } void UnusedSkull_Action1(UnusedSkullEntity* this) { - if (super->contactFlags == (CONTACT_TAKE_DAMAGE | 0x1c)) { + if (super->contactFlags == (CONTACT_NOW | 0x1c)) { super->action = 2; super->flags &= ~0x80; CreateFx(super, FX_ICE, 0); diff --git a/src/object/whirlwind.c b/src/object/whirlwind.c index 979a62a32..add243195 100644 --- a/src/object/whirlwind.c +++ b/src/object/whirlwind.c @@ -33,7 +33,7 @@ void Whirlwind_Init(Entity* this) { this->hitType = 1; this->collisionFlags = 0x47; this->hurtType = 0x44; - this->flags2 = 0x80; + this->collisionMask = 0x80; this->spriteOrientation.flipY = 1; this->spriteRendering.b3 = 1; this->animationState = this->type; @@ -58,7 +58,7 @@ void Whirlwind_Action1(Entity* this) { } if (this->spriteSettings.draw != 0) { GetNextFrame(this); - if ((((((gPlayerState.flags & PL_MINISH) == 0)) && (gPlayerState.field_0x3c == 0)) && + if ((((((gPlayerState.flags & PL_MINISH) == 0)) && (gPlayerState.killed == 0)) && ((gPlayerEntity.base.action == PLAYER_JUMP || ((gPlayerEntity.base.flags & ENT_COLLIDE) != 0)))) && ((gPlayerEntity.base.action != PLAYER_BOUNCE && (sub_0800419C(this, &gPlayerEntity.base, 0xc, 0xc) != 0)))) { diff --git a/src/physics.c b/src/physics.c index 04eae6c1c..421c24743 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 == (CONTACT_TAKE_DAMAGE | 0x13)) + if (ent->contactFlags == (CONTACT_NOW | 0x13)) return 1; ent->gustJarState &= ~4; ent->spriteOffsetY = 0; diff --git a/src/player.c b/src/player.c index 064b47ec1..ffb4ca6c9 100644 --- a/src/player.c +++ b/src/player.c @@ -349,7 +349,7 @@ static void PlayerInit(PlayerEntity* this) { super->spritePriority.b1 = 1; super->spriteSettings.shadow = 1; super->carryFlags = 0x20; - super->flags2 = 8; + super->collisionMask = 8; super->hitType = 0x79; super->hitbox = (Hitbox*)&gPlayerHitbox; super->spriteIndex = 1; @@ -1561,7 +1561,7 @@ static void sub_08071D04(PlayerEntity* this) { if (deltaHealth != 0) { ModHealth(deltaHealth); super->subAction = 3; - gPlayerState.field_0x3c = 0; + gPlayerState.killed = 0; super->direction = DIR_NONE; super->speed = 0; super->zVelocity = Q_16_16(1.5); @@ -2068,7 +2068,7 @@ 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 & CONTACT_TAKE_DAMAGE))) { + (super->contactFlags & CONTACT_NOW))) { gPlayerState.flags &= ~PL_ROLLING; if (CheckQueuedAction()) return; @@ -2753,7 +2753,7 @@ static void sub_08073504(PlayerEntity* this) { static void sub_08073584(PlayerEntity* this) { u32 state, dir, idx; - if ((gPlayerState.playerInput.newInput & INPUT_ACTION) || super->iframes > 0 || gPlayerState.field_0x3c || + if ((gPlayerState.playerInput.newInput & INPUT_ACTION) || super->iframes > 0 || gPlayerState.killed || (gPlayerState.flags & PL_PARACHUTE) == 0) { gPlayerState.jump_status |= 0x40; PlayerSetNormalAndCollide(); diff --git a/src/playerItem.c b/src/playerItem.c index 46fbd0237..266d12d01 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 &= ~CONTACT_TAKE_DAMAGE; + this->contactFlags &= ~CONTACT_NOW; if (this->iframes != 0) { if (this->iframes > 0) this->iframes--; diff --git a/src/playerItem/playerItemBoomerang.c b/src/playerItem/playerItemBoomerang.c index 46bc2ca44..bcc151a8b 100644 --- a/src/playerItem/playerItemBoomerang.c +++ b/src/playerItem/playerItemBoomerang.c @@ -128,7 +128,7 @@ void PlayerItemBoomerang_Action1(PlayerItemBoomerangEntity* this) { super->spriteVramOffset = 0xd5; COLLISION_ON(super); super->collisionFlags |= 1; - super->flags2 = gPlayerEntity.base.flags2; + super->collisionMask = gPlayerEntity.base.collisionMask; super->spriteIndex = 0xa6; super->spriteSettings.flipX = 0; super->spriteSettings.draw = 1; @@ -184,7 +184,7 @@ void PlayerItemBoomerang_Action2(PlayerItemBoomerangEntity* this) { if (super->timer == 0) { uVar6 = TRUE; } - if (super->contactFlags & CONTACT_TAKE_DAMAGE) { + if (super->contactFlags & CONTACT_NOW) { uVar6 = TRUE; } if (!uVar6) { diff --git a/src/playerItem/playerItemBottle.c b/src/playerItem/playerItemBottle.c index 962f8d7ad..c8cb3ad7c 100644 --- a/src/playerItem/playerItemBottle.c +++ b/src/playerItem/playerItemBottle.c @@ -48,7 +48,7 @@ void PlayerItemBottle_Init(PlayerItemBottleEntity* this) { } COLLISION_ON(super); super->collisionFlags = (gPlayerEntity.base.collisionFlags + 1) | 0x20; - super->flags2 = gPlayerEntity.base.flags2; + super->collisionMask = gPlayerEntity.base.collisionMask; super->hurtType = 0x1f; super->type = 1; super->type2 = ITEM_BOTTLE_EMPTY; diff --git a/src/playerItem/playerItemBow.c b/src/playerItem/playerItemBow.c index 4495475b4..0c3932a8f 100644 --- a/src/playerItem/playerItemBow.c +++ b/src/playerItem/playerItemBow.c @@ -87,7 +87,7 @@ void PlayerItemBow_Init(PlayerItemBowEntity* this) { } super->direction = super->animationState << 2; super->collisionFlags = gPlayerEntity.base.collisionFlags + 1; - super->flags2 = gPlayerEntity.base.flags2; + super->collisionMask = gPlayerEntity.base.collisionMask; if (super->collisionLayer == 2) { super->type2 = 1; } else { diff --git a/src/playerItem/playerItemDashSword.c b/src/playerItem/playerItemDashSword.c index 126d17bba..0256561cc 100644 --- a/src/playerItem/playerItemDashSword.c +++ b/src/playerItem/playerItemDashSword.c @@ -29,7 +29,7 @@ void PlayerItemDashSword_Init(Entity* this) { gPlayerState.item = this; this->flags |= ENT_PERSIST; this->action = 1; - this->flags2 = 8; + this->collisionMask = 8; LoadSwapGFX(this, 1, 3); sub_08079BD8(this); sub_0801766C(this); diff --git a/src/playerItem/playerItemGust.c b/src/playerItem/playerItemGust.c index d77d17479..94fd1bdbb 100644 --- a/src/playerItem/playerItemGust.c +++ b/src/playerItem/playerItemGust.c @@ -70,7 +70,7 @@ void PlayerItemGust(Entity* this) { static void PlayerItemGust_Init(PlayerItemGustEntity* this) { super->action = GUST_UPDATE; - super->flags2 = gPlayerEntity.base.flags2; + super->collisionMask = gPlayerEntity.base.collisionMask; super->direction = super->animationState << 2; super->speed = 0x200; super->flags |= ENT_COLLIDE | ENT_PERSIST; diff --git a/src/playerItem/playerItemGustBig.c b/src/playerItem/playerItemGustBig.c index a2e18c99c..228ca1a33 100644 --- a/src/playerItem/playerItemGustBig.c +++ b/src/playerItem/playerItemGustBig.c @@ -73,7 +73,7 @@ void PlayerItemGustBig_Init(PlayerItemGustBigEntity* this) { super->speed = 0x400; super->hitType = 0x96; super->collisionFlags = (gPlayerEntity.base.collisionFlags + 1) | 0x80; - super->flags2 = gPlayerEntity.base.flags2; + super->collisionMask = gPlayerEntity.base.collisionMask; pEVar3 = super->child; if (pEVar3 != NULL) { super->action = 1; @@ -141,7 +141,7 @@ void PlayerItemGustBig_Action2(PlayerItemGustBigEntity* this) { if ((super->child->gustJarState & 4) == 0) { DeleteThisEntity(); } - if ((super->contactFlags & CONTACT_TAKE_DAMAGE) != 0) { + if ((super->contactFlags & CONTACT_NOW) != 0) { PlayerItemGustBig_Action3(this); return; } diff --git a/src/playerItem/playerItemHeldObject.c b/src/playerItem/playerItemHeldObject.c index 669c77ca5..520d83593 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 & CONTACT_TAKE_DAMAGE) != 0) { + if ((super->contactFlags & CONTACT_NOW) != 0) { super->z.WORD = 0; } if (super->speed != 0) { diff --git a/src/playerItem/playerItemLantern.c b/src/playerItem/playerItemLantern.c index 046644647..7c16acbc5 100644 --- a/src/playerItem/playerItemLantern.c +++ b/src/playerItem/playerItemLantern.c @@ -29,7 +29,7 @@ void PlayerItemLantern_Init(Entity* this) { this->frameIndex = -1; this->updatePriority = 6; this->collisionFlags = 7; - this->flags2 = -0x80; + this->collisionMask = -0x80; this->animationState = gPlayerEntity.base.animationState & 0xe; if (AllocMutableHitbox(this) == NULL) { DeleteThisEntity(); diff --git a/src/playerItem/playerItemPacciCaneProjectile.c b/src/playerItem/playerItemPacciCaneProjectile.c index 4c4bc0056..cb6cdfb57 100644 --- a/src/playerItem/playerItemPacciCaneProjectile.c +++ b/src/playerItem/playerItemPacciCaneProjectile.c @@ -74,7 +74,7 @@ void PlayerItemPacciCaneProjectile_Init(PlayerItemPacciCaneProjectileEntity* thi super->x.HALF.HI = gPlayerEntity.base.x.HALF.HI + gUnk_0811B9A0[super->animationState]; super->y.HALF.HI = gPlayerEntity.base.y.HALF.HI + gUnk_0811B9A0[super->animationState + 1]; super->collisionFlags = 7; - super->flags2 = 0x8a; + super->collisionMask = 0x8a; super->hitbox = (Hitbox*)&gUnk_0811B9D0; if (super->collisionLayer == 2) { super->type = 1; diff --git a/src/playerItem/playerItemShield.c b/src/playerItem/playerItemShield.c index 35bd85864..7df31ebd1 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 & CONTACT_TAKE_DAMAGE) != 0) { + if ((super->contactFlags & CONTACT_NOW) != 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 bed81f9fc..13d96c42b 100644 --- a/src/playerItem/playerItemSword.c +++ b/src/playerItem/playerItemSword.c @@ -59,7 +59,7 @@ void PlayerItemSword_Init(PlayerItemSwordEntity* this) { } LoadSwapGFX(super, 1, 3); super->collisionFlags = (gPlayerEntity.base.collisionFlags + 1) | 0x20; - super->flags2 = gPlayerEntity.base.flags2; + super->collisionMask = gPlayerEntity.base.collisionMask; super->updatePriority = 6; super->contactFlags = 0; super->iframes = 0; @@ -285,7 +285,7 @@ void sub_080A78B8(PlayerItemSwordEntity* this, Entity* param_2) { } super->spriteSettings.flipX = flipX; } - if ((super->contactFlags & CONTACT_TAKE_DAMAGE) != 0) { + if ((super->contactFlags & CONTACT_NOW) != 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/playerUtils.c b/src/playerUtils.c index 8ff5a7f97..856563440 100644 --- a/src/playerUtils.c +++ b/src/playerUtils.c @@ -1564,7 +1564,7 @@ void ClearPlayerState(void) { gPlayerState.field_0x39 = 0; gPlayerState.field_0x3a = 0; gPlayerState.spriteOffsetY = 0; - gPlayerState.field_0x3c = 0; + gPlayerState.killed = 0; MemFill32(0xffffffff, gPlayerState.path_memory, 0x40); MemClear(&gPossibleInteraction, sizeof(gPossibleInteraction)); } @@ -2029,9 +2029,9 @@ bool32 sub_08079550(void) { void sub_08079708(Entity* this) { gPlayerState.framestate = PL_STATE_DIE; - gPlayerState.field_0x3c = 0xff; + gPlayerState.killed = 0xff; this->flags &= ~ENT_COLLIDE; - this->action = 0xa; + this->action = PLAYER_MINISHDIE; this->subAction = 0; sub_080085B0(this); if (!(gPlayerState.flags & (PL_CAPTURED | PL_DISABLE_ITEMS))) { @@ -2450,7 +2450,7 @@ bool32 PlayerCanBeMoved(void) { if ((gPlayerState.flags & (PL_BUSY | PL_DROWNING | PL_CAPTURED | PL_USE_PORTAL | PL_HIDDEN | PL_FROZEN | PL_FALLING | PL_DISABLE_ITEMS | PL_PIT_IS_EXIT | PL_IN_MINECART | PL_MOLDWORM_CAPTURED | PL_IN_HOLE | PL_CONVEYOR_PUSHED | PL_CLIMBING)) != 0 || - gPlayerState.field_0x3c != 0 || gPlayerEntity.base.action == PLAYER_FALL || + gPlayerState.killed != 0 || gPlayerEntity.base.action == PLAYER_FALL || gPlayerEntity.base.action == PLAYER_08071DB8) { return FALSE; } else { diff --git a/src/projectile/arrowProjectile.c b/src/projectile/arrowProjectile.c index 7acc80031..c47f04144 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 & CONTACT_TAKE_DAMAGE) != 0) { + if ((this->contactFlags & CONTACT_NOW) != 0) { if ((this->contactFlags & 0x3f) != 0) { ModHealth(-2); sub_080A9488(this); diff --git a/src/projectile/boneProjectile.c b/src/projectile/boneProjectile.c index d1052df8f..336920a24 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 == CONTACT_TAKE_DAMAGE) { + if (this->contactFlags == CONTACT_NOW) { DeleteEntity(this); } else { sub_080A82D8(this); diff --git a/src/projectile/darkNutSwordSlash.c b/src/projectile/darkNutSwordSlash.c index 838435e58..1b09cf4bf 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 & CONTACT_TAKE_DAMAGE) != 0) && (this->contactedEntity == &gPlayerEntity.base)) { + if (((this->contactFlags & CONTACT_NOW) != 0) && (this->contactedEntity == &gPlayerEntity.base)) { this->iframes = -0x2d; } this->contactFlags = 0; diff --git a/src/projectile/dekuSeedProjectile.c b/src/projectile/dekuSeedProjectile.c index c086f2513..f3b2f5e78 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 == CONTACT_TAKE_DAMAGE) { + if (this->contactFlags == CONTACT_NOW) { 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 = CONTACT_TAKE_DAMAGE; + this->contactFlags = CONTACT_NOW; this->knockbackDuration = 0xc; this->knockbackSpeed = 0; parent->iframes = 0x10; diff --git a/src/projectile/dirtBallProjectile.c b/src/projectile/dirtBallProjectile.c index 2ef3867ea..a03009de1 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 == CONTACT_TAKE_DAMAGE) { + if (this->contactFlags == CONTACT_NOW) { gPlayerState.hurtBlinkSpeed = 0xf0; ModHealth(-2); } diff --git a/src/projectile/gleerokProjectile.c b/src/projectile/gleerokProjectile.c index d40d2a926..2b01180f9 100644 --- a/src/projectile/gleerokProjectile.c +++ b/src/projectile/gleerokProjectile.c @@ -28,8 +28,7 @@ void GleerokProjectile(GleerokProjectileEntity* this) { } void GleerokProjectile_OnTick(GleerokProjectileEntity* this) { - if (((super->type != 3) && ((super->contactFlags & CONTACT_TAKE_DAMAGE) != 0)) && - ((super->contactFlags & 0x7f) != 0x1e)) { + if (((super->type != 3) && ((super->contactFlags & CONTACT_NOW) != 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 dfb592373..d117507c6 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 == CONTACT_TAKE_DAMAGE) { + if (this->contactFlags == CONTACT_NOW) { 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 == CONTACT_TAKE_DAMAGE) { + if (this->contactFlags == CONTACT_NOW) { if (this->parent != NULL) { this->parent->type = 0xff; } diff --git a/src/projectile/keatonDagger.c b/src/projectile/keatonDagger.c index 6a4b66c39..cf1fa1094 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 & CONTACT_TAKE_DAMAGE) != 0) && (this->contactedEntity == &gPlayerEntity.base)) { + if (((this->contactFlags & CONTACT_NOW) != 0) && (this->contactedEntity == &gPlayerEntity.base)) { sub_0803C0AC(this); } DeleteEntity(this); diff --git a/src/projectile/lakituLightning.c b/src/projectile/lakituLightning.c index 47d300a73..279ef9e9e 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 == CONTACT_TAKE_DAMAGE)) { + if ((this->health == 0) || (this->contactFlags == CONTACT_NOW)) { DeleteThisEntity(); } LakituLightning_OnTick(this); diff --git a/src/projectile/mandiblesProjectile.c b/src/projectile/mandiblesProjectile.c index 64142a9c9..2b6f67a3b 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 & CONTACT_TAKE_DAMAGE) != 0) { + if ((super->contactFlags & CONTACT_NOW) != 0) { switch (super->action) { case 4: super->subtimer = 0; diff --git a/src/projectile/moblinSpear.c b/src/projectile/moblinSpear.c index 076477b03..2e58a0912 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 == CONTACT_TAKE_DAMAGE) { + if (this->contactFlags == CONTACT_NOW) { this->iframes = 0x10; this->knockbackDuration = 0xc; this->knockbackSpeed = 0x180; diff --git a/src/projectile/octorokBossProjectile.c b/src/projectile/octorokBossProjectile.c index 43982f37d..8ca0d67d5 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 & CONTACT_TAKE_DAMAGE) != 0)) { + if ((super->type2 == 0) && ((super->contactFlags & CONTACT_NOW) != 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 & CONTACT_TAKE_DAMAGE) == 0) { + if ((super->contactFlags & CONTACT_NOW) == 0) { return; } OctorokBossProjectile_Action2(this); diff --git a/src/projectile/projectile5.c b/src/projectile/projectile5.c index 379dd97d1..4fa9a3d8a 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 == CONTACT_TAKE_DAMAGE) { + if (this->contactFlags == CONTACT_NOW) { *pbVar2 = *pbVar2 & 0x7f; DeleteThisEntity(); } diff --git a/src/projectile/removableDust.c b/src/projectile/removableDust.c index e89cd3b47..49da5582f 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 == (CONTACT_TAKE_DAMAGE | 0x16)) { + if (super->contactFlags == (CONTACT_NOW | 0x16)) { RemovableDust_OnGrabbed(this); } } diff --git a/src/projectile/rockProjectile.c b/src/projectile/rockProjectile.c index 7dc35d0c6..a2e75f114 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 == CONTACT_TAKE_DAMAGE) { + if (this->contactFlags == CONTACT_NOW) { DeleteEntity(this); } else { this->direction = this->knockbackDirection; diff --git a/src/projectile/spiderWeb.c b/src/projectile/spiderWeb.c index c1cb7adc0..b749caf44 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 == (CONTACT_TAKE_DAMAGE | 0x7)) { + if (super->contactFlags == (CONTACT_NOW | 0x7)) { super->action = 3; super->timer = 90; COLLISION_OFF(super); diff --git a/src/projectile/stalfosProjectile.c b/src/projectile/stalfosProjectile.c index 660b8f5ca..bbe7b7286 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 == (CONTACT_TAKE_DAMAGE | 0x1d)) { + if (this->contactFlags == (CONTACT_NOW | 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 eb5f73ccd..dd3d1d0bc 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 & CONTACT_TAKE_DAMAGE) != 0) { + if ((super->contactFlags & CONTACT_NOW) != 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 661547ba0..9fa0260f0 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 & CONTACT_TAKE_DAMAGE) != 0) { + if ((super->contactFlags & CONTACT_NOW) != 0) { super->action = 3; COLLISION_OFF(super); InitializeAnimation(super, 0x53); diff --git a/src/projectile/v2Projectile.c b/src/projectile/v2Projectile.c index 8f7531c43..68759c916 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 & CONTACT_TAKE_DAMAGE) == 0) + if ((super->contactFlags & CONTACT_NOW) == 0) return; switch (super->type) { diff --git a/src/projectileUtils.c b/src/projectileUtils.c index 56dc2a66b..e11be579a 100644 --- a/src/projectileUtils.c +++ b/src/projectileUtils.c @@ -35,7 +35,7 @@ bool32 ProjectileInit(Entity* this) { this->speed = definition->speed; } this->collisionFlags = (definition->field0x3c << 4) | 7; - this->flags2 = definition->flags2; + this->collisionMask = definition->collisionMask; this->hitType = definition->damageType; this->hurtType = definition->field0x40; this->health = 0xff;