define collisions

This commit is contained in:
theo3 2023-12-31 21:24:07 -08:00
parent 48fdf9d827
commit dcc596ed87
125 changed files with 388 additions and 336 deletions

View File

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

View File

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

View File

@ -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. */

View File

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

View File

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

View File

@ -371,7 +371,7 @@ CollisionResult CollisionNoOp(Entity* org, Entity* tgt, u32 direction, ColSettin
// target: item
CollisionResult CollisionGroundItem(Entity* org, Entity* tgt, u32 direction, ColSettings* settings) {
COLLISION_OFF(tgt);
tgt->contactFlags = org->hurtType | 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);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -342,7 +342,7 @@ void sub_0803CBAC(LakituEntity* this) {
super->spritePriority.b1 = 1;
super->flags2 &= 0x7b;
super->collisionMask &= 0x7b;
super->hitType = 0x42;

View File

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

View File

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

View File

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

View File

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

View File

@ -101,7 +101,7 @@ void Moldworm_OnCollision(MoldwormEntity* this) {
super->iframes = -8;
this->unk_7f = 0;
this->unk_7b = 0;
if (super->contactFlags == 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;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1401,7 +1401,7 @@ static void sub_08043C40(VaatiArmEntity* this, VaatiArm_HeapStruct1* heapStruct)
static bool32 sub_08043C98(VaatiArmEntity* this) {
#if defined EU || defined JP
Entity* e1 = &((VaatiArm_HeapStruct*)super->myHeap)->entities[3]->base;
if ((e1->contactFlags == (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;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -101,7 +101,7 @@ const s8 gUnk_080D0EB0[] = { 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x0
0xfd, 0xfd, 0xfd, 0xfd, 0xfd, 0xfd, 0xfd, 0xfd, 0xfd, 0xfd };
void VaatiWrath(VaatiWrathEntity* this) {
if (((super->type == 0) && ((super->contactFlags & 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) {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -63,7 +63,7 @@ void ItemOnGround(ItemOnGroundEntity* this) {
static void (*const ItemOnGround_Actions[])(ItemOnGroundEntity*) = {
ItemOnGround_Init, ItemOnGround_Action1, ItemOnGround_Action2, ItemOnGround_Action3, ItemOnGround_Action4,
};
if (super->contactFlags & 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);
}
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -46,7 +46,7 @@ void MineralWaterSource_Init(Entity* this) {
this->collisionFlags = 7;
this->hitType = 145;
this->flags2 = 2;
this->collisionMask = 2;
this->action = 1;
}

View File

@ -39,7 +39,7 @@ void ObjectA8(ObjectA8Entity* this) {
ObjectA8_Init, ObjectA8_Action1, ObjectA8_Action2, ObjectA8_Action3,
ObjectA8_Action4, ObjectA8_Action5, ObjectA8_Action6,
};
if ((super->contactFlags & 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;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

Some files were not shown because too many files have changed in this diff Show More