mirror of https://github.com/zeldaret/tmc.git
label contact flags
This commit is contained in:
parent
bd1be092aa
commit
5049daabc5
|
@ -6,6 +6,16 @@
|
||||||
|
|
||||||
/** Collisions. */
|
/** Collisions. */
|
||||||
|
|
||||||
|
enum {
|
||||||
|
COL_LANTERN = 0x7,
|
||||||
|
COL_SMALL_GUST = 0x13,
|
||||||
|
COL_BOOMERANG = 0x14,
|
||||||
|
COL_ARROW = 0x15,
|
||||||
|
COL_BIG_GUST = 0x1b,
|
||||||
|
COL_PACCI = 0x1d,
|
||||||
|
COL_SWORD_BEAM = 0x21,
|
||||||
|
};
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
COL_NONE = 0x0,
|
COL_NONE = 0x0,
|
||||||
COL_NORTH_WEST = 0x2,
|
COL_NORTH_WEST = 0x2,
|
||||||
|
|
|
@ -79,6 +79,8 @@ typedef enum {
|
||||||
DirectionNorthWest = 0x1c, /**< North West. */
|
DirectionNorthWest = 0x1c, /**< North West. */
|
||||||
} Direction;
|
} Direction;
|
||||||
|
|
||||||
|
#define CONTACT_TAKE_DAMAGE 0x80
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
void* entity1;
|
void* entity1;
|
||||||
void* entity2;
|
void* entity2;
|
||||||
|
|
|
@ -371,7 +371,7 @@ CollisionResult CollisionNoOp(Entity* org, Entity* tgt, u32 direction, ColSettin
|
||||||
// target: item
|
// target: item
|
||||||
CollisionResult CollisionGroundItem(Entity* org, Entity* tgt, u32 direction, ColSettings* settings) {
|
CollisionResult CollisionGroundItem(Entity* org, Entity* tgt, u32 direction, ColSettings* settings) {
|
||||||
COLLISION_OFF(tgt);
|
COLLISION_OFF(tgt);
|
||||||
tgt->contactFlags = org->hurtType | 0x80;
|
tgt->contactFlags = org->hurtType | CONTACT_TAKE_DAMAGE;
|
||||||
if ((tgt->type == 0x5F || tgt->type == 0x60) && sub_08081420(tgt))
|
if ((tgt->type == 0x5F || tgt->type == 0x60) && sub_08081420(tgt))
|
||||||
tgt->health = 0;
|
tgt->health = 0;
|
||||||
return RESULT_COLLISION_WITHOUT_SET;
|
return RESULT_COLLISION_WITHOUT_SET;
|
||||||
|
@ -503,7 +503,7 @@ CollisionResult sub_08017DD4(Entity* org, Entity* tgt, u32 direction, ColSetting
|
||||||
sub_08079D84();
|
sub_08079D84();
|
||||||
org->iframes = 90;
|
org->iframes = 90;
|
||||||
} else {
|
} else {
|
||||||
gPlayerEntity.base.contactFlags = tgt->hurtType | 0x80;
|
gPlayerEntity.base.contactFlags = tgt->hurtType | CONTACT_TAKE_DAMAGE;
|
||||||
gPlayerEntity.base.iframes = 12;
|
gPlayerEntity.base.iframes = 12;
|
||||||
gPlayerEntity.base.knockbackDuration = 16;
|
gPlayerEntity.base.knockbackDuration = 16;
|
||||||
gPlayerEntity.base.knockbackDirection = DirectionTurnAround(direction);
|
gPlayerEntity.base.knockbackDirection = DirectionTurnAround(direction);
|
||||||
|
|
|
@ -96,7 +96,7 @@ void AcroBandit_OnTick(AcroBanditEntity* this) {
|
||||||
void AcroBandit_OnCollision(AcroBanditEntity* this) {
|
void AcroBandit_OnCollision(AcroBanditEntity* this) {
|
||||||
Entity* brother;
|
Entity* brother;
|
||||||
|
|
||||||
if (super->contactFlags != 0x80 && super->contactFlags != 0x81) {
|
if (super->contactFlags != CONTACT_TAKE_DAMAGE && super->contactFlags != (CONTACT_TAKE_DAMAGE | 0x1)) {
|
||||||
if (super->type == 1) {
|
if (super->type == 1) {
|
||||||
if (super->action < 7 && super->knockbackDuration != 0) {
|
if (super->action < 7 && super->knockbackDuration != 0) {
|
||||||
brother = super->child;
|
brother = super->child;
|
||||||
|
|
|
@ -337,7 +337,7 @@ bool32 sub_080305BC(ArmosEntity* this) {
|
||||||
|
|
||||||
bool32 sub_08030650(ArmosEntity* this) {
|
bool32 sub_08030650(ArmosEntity* this) {
|
||||||
if (super->type == 0) {
|
if (super->type == 0) {
|
||||||
if (super->contactFlags == 0x80) {
|
if (super->contactFlags == CONTACT_TAKE_DAMAGE) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
} else if (this->unk_80 != 2) {
|
} else if (this->unk_80 != 2) {
|
||||||
|
|
|
@ -35,7 +35,7 @@ void Beetle_OnTick(BeetleEntity* this) {
|
||||||
|
|
||||||
void Beetle_OnCollision(BeetleEntity* this) {
|
void Beetle_OnCollision(BeetleEntity* this) {
|
||||||
switch (super->contactFlags) {
|
switch (super->contactFlags) {
|
||||||
case 0x80:
|
case CONTACT_TAKE_DAMAGE:
|
||||||
if (gPlayerState.framestate == PL_STATE_CLIMB) {
|
if (gPlayerState.framestate == PL_STATE_CLIMB) {
|
||||||
Beetle_OnTick(this);
|
Beetle_OnTick(this);
|
||||||
} else {
|
} else {
|
||||||
|
@ -50,7 +50,7 @@ void Beetle_OnCollision(BeetleEntity* this) {
|
||||||
InitializeAnimation(super, 6);
|
InitializeAnimation(super, 6);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 0x93:
|
case CONTACT_TAKE_DAMAGE | 0x13:
|
||||||
Beetle_OnTick(this);
|
Beetle_OnTick(this);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,7 @@ void Bobomb_OnTick(BobombEntity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Bobomb_OnCollision(BobombEntity* this) {
|
void Bobomb_OnCollision(BobombEntity* this) {
|
||||||
if (super->contactFlags & 0x80) {
|
if (super->contactFlags & CONTACT_TAKE_DAMAGE) {
|
||||||
switch (super->contactFlags & 0x7f) {
|
switch (super->contactFlags & 0x7f) {
|
||||||
case 0:
|
case 0:
|
||||||
case 1:
|
case 1:
|
||||||
|
|
|
@ -56,7 +56,7 @@ void BowMoblin_OnCollision(BowMoblinEntity* this) {
|
||||||
EnemyCreateFX(super, FX_STARS);
|
EnemyCreateFX(super, FX_STARS);
|
||||||
}
|
}
|
||||||
EnemyFunctionHandlerAfterCollision(super, (EntityActionArray)BowMoblin_Functions);
|
EnemyFunctionHandlerAfterCollision(super, (EntityActionArray)BowMoblin_Functions);
|
||||||
if ((super->contactFlags & 0x80) != 0) {
|
if (super->contactFlags & CONTACT_TAKE_DAMAGE) {
|
||||||
sub_0803C5F0(this);
|
sub_0803C5F0(this);
|
||||||
pEVar1 = super->child;
|
pEVar1 = super->child;
|
||||||
if (pEVar1 != NULL) {
|
if (pEVar1 != NULL) {
|
||||||
|
|
|
@ -43,7 +43,7 @@ void sub_0802B540(Entity* this) {
|
||||||
|
|
||||||
void sub_0802B56C(Entity* this) {
|
void sub_0802B56C(Entity* this) {
|
||||||
GetNextFrame(this);
|
GetNextFrame(this);
|
||||||
if (this->contactFlags & 0x80) {
|
if (this->contactFlags & CONTACT_TAKE_DAMAGE) {
|
||||||
this->speed = 0x40;
|
this->speed = 0x40;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1346,7 +1346,7 @@ void sub_080272D4(ChuchuBossEntity* this) {
|
||||||
super->hitbox->height = (u32)((0x10000 / this->unk_74.HALF_U.HI) * 5) >> 6;
|
super->hitbox->height = (u32)((0x10000 / this->unk_74.HALF_U.HI) * 5) >> 6;
|
||||||
if (*(char*)&this->unk_84 == 0)
|
if (*(char*)&this->unk_84 == 0)
|
||||||
break;
|
break;
|
||||||
if ((super->contactFlags & 0x80) != 0) {
|
if (super->contactFlags & CONTACT_TAKE_DAMAGE) {
|
||||||
if (super->iframes != 0) {
|
if (super->iframes != 0) {
|
||||||
((ChuchuBossEntity*)super->child)->unk_68->base.iframes = super->iframes;
|
((ChuchuBossEntity*)super->child)->unk_68->base.iframes = super->iframes;
|
||||||
super->child->parent->iframes = super->iframes;
|
super->child->parent->iframes = super->iframes;
|
||||||
|
@ -1697,7 +1697,7 @@ bool32 sub_08027AA4(ChuchuBossEntity* this) {
|
||||||
s32 iVar4;
|
s32 iVar4;
|
||||||
Helper* pHelper;
|
Helper* pHelper;
|
||||||
|
|
||||||
if ((super->contactFlags & 0x80) == 0) {
|
if ((super->contactFlags & CONTACT_TAKE_DAMAGE) == 0) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
switch (super->contactFlags & 0x7f) {
|
switch (super->contactFlags & 0x7f) {
|
||||||
|
|
|
@ -58,7 +58,7 @@ void CloudPiranha_OnCollision(CloudPiranhaEntity* this) {
|
||||||
EnemyCreateFX(super, FX_STARS);
|
EnemyCreateFX(super, FX_STARS);
|
||||||
}
|
}
|
||||||
EnemyFunctionHandlerAfterCollision(super, gUnk_080CF4F0);
|
EnemyFunctionHandlerAfterCollision(super, gUnk_080CF4F0);
|
||||||
if ((super->contactFlags & 0x80) != 0) {
|
if (super->contactFlags & CONTACT_TAKE_DAMAGE) {
|
||||||
if (super->hitType == 0x5a) {
|
if (super->hitType == 0x5a) {
|
||||||
switch (super->contactFlags & 0x3f) {
|
switch (super->contactFlags & 0x3f) {
|
||||||
case 0x14:
|
case 0x14:
|
||||||
|
|
|
@ -44,7 +44,7 @@ void Crow_OnTick(CrowEntity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Crow_OnCollision(CrowEntity* this) {
|
void Crow_OnCollision(CrowEntity* this) {
|
||||||
if (super->contactFlags & 0x80) {
|
if (super->contactFlags & CONTACT_TAKE_DAMAGE) {
|
||||||
if ((super->contactFlags & 0x3f) == 0) {
|
if ((super->contactFlags & 0x3f) == 0) {
|
||||||
COLLISION_OFF(super);
|
COLLISION_OFF(super);
|
||||||
super->subtimer = 16;
|
super->subtimer = 16;
|
||||||
|
|
|
@ -335,7 +335,8 @@ void sub_080210E4(DarkNutEntity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
sub_08021644(this);
|
sub_08021644(this);
|
||||||
if ((super->frame & 0x10) && (!ProcessMovement0(super) || (super->child && (super->child->contactFlags & 0x80)))) {
|
if ((super->frame & 0x10) &&
|
||||||
|
(!ProcessMovement0(super) || (super->child && (super->child->contactFlags & CONTACT_TAKE_DAMAGE)))) {
|
||||||
sub_080213D0(this, 0);
|
sub_080213D0(this, 0);
|
||||||
} else {
|
} else {
|
||||||
if (--this->unk_76 == 0)
|
if (--this->unk_76 == 0)
|
||||||
|
|
|
@ -79,15 +79,15 @@ void Enemy50_OnCollision(Enemy50Entity* this) {
|
||||||
sub_08041134(this);
|
sub_08041134(this);
|
||||||
sub_0803F6EC(this);
|
sub_0803F6EC(this);
|
||||||
}
|
}
|
||||||
if (super->hitType == 0x25 && super->contactFlags == 0x80) {
|
if (super->hitType == 0x25 && super->contactFlags == CONTACT_TAKE_DAMAGE) {
|
||||||
super->action = 8;
|
super->action = 8;
|
||||||
InitializeAnimation(super, 3);
|
InitializeAnimation(super, 3);
|
||||||
} else {
|
} else {
|
||||||
if (super->contactFlags == 0x80) {
|
if (super->contactFlags == CONTACT_TAKE_DAMAGE) {
|
||||||
this->unk_7c = 0x78;
|
this->unk_7c = 0x78;
|
||||||
sub_08041128(this);
|
sub_08041128(this);
|
||||||
}
|
}
|
||||||
if (super->contactFlags == 0x9d) {
|
if (super->contactFlags == (CONTACT_TAKE_DAMAGE | 0x1d)) {
|
||||||
super->zVelocity = Q_16_16(1.5);
|
super->zVelocity = Q_16_16(1.5);
|
||||||
}
|
}
|
||||||
if (super->confusedTime != 0) {
|
if (super->confusedTime != 0) {
|
||||||
|
@ -422,7 +422,7 @@ void sub_0804122C(Enemy50Entity* this) {
|
||||||
|
|
||||||
#ifndef EU
|
#ifndef EU
|
||||||
bool32 sub_08041300(Enemy50Entity* this) {
|
bool32 sub_08041300(Enemy50Entity* this) {
|
||||||
if ((super->hitType == 0x25) && (super->contactFlags == 0x80)) {
|
if ((super->hitType == 0x25) && (super->contactFlags == CONTACT_TAKE_DAMAGE)) {
|
||||||
return TRUE;
|
return TRUE;
|
||||||
} else {
|
} else {
|
||||||
return super->action == 8 || super->action == 9;
|
return super->action == 8 || super->action == 9;
|
||||||
|
|
|
@ -82,14 +82,14 @@ void Eyegore_OnTick(EyegoreEntity* this) {
|
||||||
void Eyegore_OnCollision(EyegoreEntity* this) {
|
void Eyegore_OnCollision(EyegoreEntity* this) {
|
||||||
u32 tmp;
|
u32 tmp;
|
||||||
|
|
||||||
if ((super->contactFlags == 0x95) || (super->contactFlags == 0x8e)) {
|
if ((super->contactFlags == (CONTACT_TAKE_DAMAGE | 0x15)) || (super->contactFlags == (CONTACT_TAKE_DAMAGE | 0xe))) {
|
||||||
Entity* entity = super->contactedEntity;
|
Entity* entity = super->contactedEntity;
|
||||||
tmp = (((entity->direction + 4) & 0x18) ^ 0x10) >> 3;
|
tmp = (((entity->direction + 4) & 0x18) ^ 0x10) >> 3;
|
||||||
if (tmp == super->animationState) {
|
if (tmp == super->animationState) {
|
||||||
if ((tmp & 1) != 0) {
|
if ((tmp & 1) != 0) {
|
||||||
if (0x10 < ((entity->y.HALF.HI + entity->z.HALF.HI) - (super->y.HALF.HI + super->z.HALF.HI)) + 0x14U) {
|
if (0x10 < ((entity->y.HALF.HI + entity->z.HALF.HI) - (super->y.HALF.HI + super->z.HALF.HI)) + 0x14U) {
|
||||||
} else {
|
} else {
|
||||||
if (super->contactFlags == 0x8e) {
|
if (super->contactFlags == (CONTACT_TAKE_DAMAGE | 0xe)) {
|
||||||
super->health = 0;
|
super->health = 0;
|
||||||
} else {
|
} else {
|
||||||
super->health--;
|
super->health--;
|
||||||
|
@ -105,7 +105,7 @@ void Eyegore_OnCollision(EyegoreEntity* this) {
|
||||||
EnqueueSFX(SFX_BUTTON_PRESS);
|
EnqueueSFX(SFX_BUTTON_PRESS);
|
||||||
sub_08031344(this);
|
sub_08031344(this);
|
||||||
} else {
|
} else {
|
||||||
if (super->contactFlags == 0x8e) {
|
if (super->contactFlags == (CONTACT_TAKE_DAMAGE | 0xe)) {
|
||||||
super->health = 0;
|
super->health = 0;
|
||||||
} else {
|
} else {
|
||||||
super->health--;
|
super->health--;
|
||||||
|
|
|
@ -93,7 +93,7 @@ void FlyingPot_OnTick(FlyingPotEntity* this) {
|
||||||
void FlyingPot_OnCollision(FlyingPotEntity* this) {
|
void FlyingPot_OnCollision(FlyingPotEntity* this) {
|
||||||
sub_08037418(this);
|
sub_08037418(this);
|
||||||
|
|
||||||
if (super->contactFlags == 0x9D) {
|
if (super->contactFlags == (CONTACT_TAKE_DAMAGE | 0x1d)) {
|
||||||
super->action = FLYING_POT_ACTION_6;
|
super->action = FLYING_POT_ACTION_6;
|
||||||
COLLISION_OFF(super);
|
COLLISION_OFF(super);
|
||||||
super->zVelocity = Q_16_16(2.625);
|
super->zVelocity = Q_16_16(2.625);
|
||||||
|
|
|
@ -45,7 +45,7 @@ void FlyingSkull_OnTick(FlyingSkullEntity* this) {
|
||||||
void FlyingSkull_OnCollision(FlyingSkullEntity* this) {
|
void FlyingSkull_OnCollision(FlyingSkullEntity* this) {
|
||||||
sub_0803A100(this);
|
sub_0803A100(this);
|
||||||
|
|
||||||
if (super->contactFlags == 0x9d) {
|
if (super->contactFlags == (CONTACT_TAKE_DAMAGE | 0x1d)) {
|
||||||
super->action = 7;
|
super->action = 7;
|
||||||
COLLISION_OFF(super);
|
COLLISION_OFF(super);
|
||||||
super->zVelocity = Q_16_16(2.625);
|
super->zVelocity = Q_16_16(2.625);
|
||||||
|
|
|
@ -59,11 +59,11 @@ void Ghini_OnCollision(GhiniEntity* this) {
|
||||||
sub_0803F630(this);
|
sub_0803F630(this);
|
||||||
sub_0803F6EC(this);
|
sub_0803F6EC(this);
|
||||||
}
|
}
|
||||||
if ((super->hitType == 0x25) && (super->contactFlags == 0x80)) {
|
if ((super->hitType == 0x25) && (super->contactFlags == CONTACT_TAKE_DAMAGE)) {
|
||||||
super->action = 8;
|
super->action = 8;
|
||||||
InitializeAnimation(super, 3);
|
InitializeAnimation(super, 3);
|
||||||
} else {
|
} else {
|
||||||
if (super->contactFlags == 0x9d) {
|
if (super->contactFlags == (CONTACT_TAKE_DAMAGE | 0x1d)) {
|
||||||
super->zVelocity = 0x18000;
|
super->zVelocity = 0x18000;
|
||||||
}
|
}
|
||||||
if (super->confusedTime != 0) {
|
if (super->confusedTime != 0) {
|
||||||
|
|
|
@ -52,7 +52,7 @@ void Gibdo_OnTick(GibdoEntity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Gibdo_OnCollision(GibdoEntity* this) {
|
void Gibdo_OnCollision(GibdoEntity* this) {
|
||||||
if (super->contactFlags == 0x87) {
|
if (super->contactFlags == (CONTACT_TAKE_DAMAGE | 0x7)) {
|
||||||
if (super->action == 0x6) {
|
if (super->action == 0x6) {
|
||||||
sub_08037ACC(this);
|
sub_08037ACC(this);
|
||||||
}
|
}
|
||||||
|
@ -62,7 +62,7 @@ void Gibdo_OnCollision(GibdoEntity* this) {
|
||||||
Gibdo_CreateObjects(this);
|
Gibdo_CreateObjects(this);
|
||||||
} else {
|
} else {
|
||||||
if (super->action != 0x6) {
|
if (super->action != 0x6) {
|
||||||
if (super->hitType == 0x27 && super->contactFlags == 0x80) {
|
if (super->hitType == 0x27 && super->contactFlags == CONTACT_TAKE_DAMAGE) {
|
||||||
sub_08037A14(this);
|
sub_08037A14(this);
|
||||||
} else {
|
} else {
|
||||||
if ((u8)(super->action - 1) < 2) {
|
if ((u8)(super->action - 1) < 2) {
|
||||||
|
|
|
@ -659,7 +659,7 @@ void sub_0802D86C(GleerokEntity* this) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((super->contactFlags & 0x80) && this->unk_74 == 0) {
|
if ((super->contactFlags & CONTACT_TAKE_DAMAGE) && this->unk_74 == 0) {
|
||||||
if ((super->contactFlags & 0x7f) == 0x1d) {
|
if ((super->contactFlags & 0x7f) == 0x1d) {
|
||||||
super->zVelocity = Q_16_16(3.0);
|
super->zVelocity = Q_16_16(3.0);
|
||||||
super->parent->subAction = 4;
|
super->parent->subAction = 4;
|
||||||
|
@ -1039,7 +1039,7 @@ void sub_0802E0B8(GleerokEntity* this) {
|
||||||
super->type2 = 4;
|
super->type2 = 4;
|
||||||
InitializeAnimation(super, 0x4e);
|
InitializeAnimation(super, 0x4e);
|
||||||
} else {
|
} else {
|
||||||
if (super->contactFlags & 0x80) {
|
if (super->contactFlags & CONTACT_TAKE_DAMAGE) {
|
||||||
if (super->iframes > 0) {
|
if (super->iframes > 0) {
|
||||||
SoundReq(SFX_BOSS_HIT);
|
SoundReq(SFX_BOSS_HIT);
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,7 @@ void HangingSeed_OnTick(Entity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void HangingSeed_OnCollision(Entity* this) {
|
void HangingSeed_OnCollision(Entity* this) {
|
||||||
if (this->contactFlags & 0x80) {
|
if (this->contactFlags & CONTACT_TAKE_DAMAGE) {
|
||||||
CreateFx(this, FX_BUSH, 0x80);
|
CreateFx(this, FX_BUSH, 0x80);
|
||||||
DeleteThisEntity();
|
DeleteThisEntity();
|
||||||
}
|
}
|
||||||
|
|
|
@ -143,7 +143,7 @@ void Keaton_Action3(KeatonEntity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Keaton_Action4(KeatonEntity* this) {
|
void Keaton_Action4(KeatonEntity* this) {
|
||||||
if (super->child && (super->child->contactFlags & 0x80)) {
|
if (super->child && (super->child->contactFlags & CONTACT_TAKE_DAMAGE)) {
|
||||||
sub_0803275C(this);
|
sub_0803275C(this);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,7 @@ void Leever_OnTick(LeeverEntity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Leever_OnCollision(LeeverEntity* this) {
|
void Leever_OnCollision(LeeverEntity* this) {
|
||||||
if (super->contactFlags == 0x80) {
|
if (super->contactFlags == CONTACT_TAKE_DAMAGE) {
|
||||||
if (super->action == 3) {
|
if (super->action == 3) {
|
||||||
this->unk_74 = 1;
|
this->unk_74 = 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,8 +46,8 @@ void LikeLike_OnCollision(LikeLikeEntity* this) {
|
||||||
} else {
|
} else {
|
||||||
if (super->action == 7) {
|
if (super->action == 7) {
|
||||||
LikeLike_ReleasePlayer(this);
|
LikeLike_ReleasePlayer(this);
|
||||||
} else if (super->contactFlags & 0x80) {
|
} else if (super->contactFlags & CONTACT_TAKE_DAMAGE) {
|
||||||
u8 tmp = super->contactFlags & ~0x80;
|
u8 tmp = super->contactFlags & ~CONTACT_TAKE_DAMAGE;
|
||||||
if (tmp == 0) {
|
if (tmp == 0) {
|
||||||
super->action = 7;
|
super->action = 7;
|
||||||
super->timer = 95;
|
super->timer = 95;
|
||||||
|
|
|
@ -518,7 +518,7 @@ void sub_0802A098(MadderpillarEntity* this) {
|
||||||
|
|
||||||
void sub_0802A0F8(MadderpillarEntity* this) {
|
void sub_0802A0F8(MadderpillarEntity* this) {
|
||||||
if (super->health != 0) {
|
if (super->health != 0) {
|
||||||
if ((super->contactFlags & 0x80) && super->iframes != 0) {
|
if ((super->contactFlags & CONTACT_TAKE_DAMAGE) && super->iframes != 0) {
|
||||||
Entity* entity = super;
|
Entity* entity = super;
|
||||||
u32 i;
|
u32 i;
|
||||||
for (i = 0; i < 6; i++) {
|
for (i = 0; i < 6; i++) {
|
||||||
|
@ -549,7 +549,7 @@ void sub_0802A16C(MadderpillarEntity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_0802A18C(MadderpillarEntity* this) {
|
void sub_0802A18C(MadderpillarEntity* this) {
|
||||||
if (super->contactFlags & 0x80) {
|
if (super->contactFlags & CONTACT_TAKE_DAMAGE) {
|
||||||
switch (super->contactFlags & 0x7f) {
|
switch (super->contactFlags & 0x7f) {
|
||||||
case 0:
|
case 0:
|
||||||
case 1:
|
case 1:
|
||||||
|
|
|
@ -167,7 +167,7 @@ void MazaalBracelet_OnCollision(MazaalBraceletEntity* this) {
|
||||||
|
|
||||||
if (super->type < 2) {
|
if (super->type < 2) {
|
||||||
if (super->action != 0x2b) {
|
if (super->action != 0x2b) {
|
||||||
if ((0 < super->iframes) && ((super->contactFlags == 0x95 || (super->contactFlags == 0x8e)))) {
|
if ((0 < super->iframes) && ((super->contactFlags == (CONTACT_TAKE_DAMAGE | 0x15) || (super->contactFlags == (CONTACT_TAKE_DAMAGE | 0xe))))) {
|
||||||
super->action = 0x28;
|
super->action = 0x28;
|
||||||
COLLISION_OFF(super);
|
COLLISION_OFF(super);
|
||||||
entity = (MazaalBraceletEntity*)super->parent;
|
entity = (MazaalBraceletEntity*)super->parent;
|
||||||
|
@ -1299,7 +1299,7 @@ u32 sub_0803B870(MazaalBraceletEntity* this) {
|
||||||
Entity* entity;
|
Entity* entity;
|
||||||
|
|
||||||
entity = super->child;
|
entity = super->child;
|
||||||
if ((entity->contactFlags & 0x80) != 0 && (gPlayerState.flags & PL_CAPTURED)) {
|
if ((entity->contactFlags & CONTACT_TAKE_DAMAGE) != 0 && (gPlayerState.flags & PL_CAPTURED)) {
|
||||||
super->action = 0x18;
|
super->action = 0x18;
|
||||||
super->timer = 68;
|
super->timer = 68;
|
||||||
super->spriteSettings.draw = 0;
|
super->spriteSettings.draw = 0;
|
||||||
|
|
|
@ -101,7 +101,7 @@ void Moldworm_OnCollision(MoldwormEntity* this) {
|
||||||
super->iframes = -8;
|
super->iframes = -8;
|
||||||
this->unk_7f = 0;
|
this->unk_7f = 0;
|
||||||
this->unk_7b = 0;
|
this->unk_7b = 0;
|
||||||
if (super->contactFlags == 0x80 || super->contactFlags == 0x9e) {
|
if (super->contactFlags == CONTACT_TAKE_DAMAGE || super->contactFlags == (CONTACT_TAKE_DAMAGE | 0x1e)) {
|
||||||
super->type2 = 0;
|
super->type2 = 0;
|
||||||
this->unk_80 = 0x14;
|
this->unk_80 = 0x14;
|
||||||
} else {
|
} else {
|
||||||
|
@ -441,7 +441,7 @@ void sub_08023894(MoldwormEntity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_0802390C(MoldwormEntity* this) {
|
void sub_0802390C(MoldwormEntity* this) {
|
||||||
if (super->contactFlags & 0x80) {
|
if (super->contactFlags & CONTACT_TAKE_DAMAGE) {
|
||||||
Entity* ent = super->child;
|
Entity* ent = super->child;
|
||||||
do {
|
do {
|
||||||
ent->iframes = super->iframes;
|
ent->iframes = super->iframes;
|
||||||
|
@ -449,7 +449,7 @@ void sub_0802390C(MoldwormEntity* this) {
|
||||||
} else {
|
} else {
|
||||||
Entity* ent = super->child;
|
Entity* ent = super->child;
|
||||||
do {
|
do {
|
||||||
if (ent->contactFlags & 0x80) {
|
if (ent->contactFlags & CONTACT_TAKE_DAMAGE) {
|
||||||
u8 bVar2 = 0xff - ent->health;
|
u8 bVar2 = 0xff - ent->health;
|
||||||
if (bVar2 != 0) {
|
if (bVar2 != 0) {
|
||||||
u32 tmp;
|
u32 tmp;
|
||||||
|
|
|
@ -55,7 +55,7 @@ void Mulldozer_OnCollision(MulldozerEntity* this) {
|
||||||
EnemyCreateFX(super, 0x1c);
|
EnemyCreateFX(super, 0x1c);
|
||||||
}
|
}
|
||||||
EnemyFunctionHandlerAfterCollision(super, Mulldozer_Functions);
|
EnemyFunctionHandlerAfterCollision(super, Mulldozer_Functions);
|
||||||
if ((super->contactFlags & 0x80) != 0) {
|
if ((super->contactFlags & CONTACT_TAKE_DAMAGE) != 0) {
|
||||||
switch (super->contactFlags & 0x3f) {
|
switch (super->contactFlags & 0x3f) {
|
||||||
case 2:
|
case 2:
|
||||||
case 3:
|
case 3:
|
||||||
|
|
|
@ -61,7 +61,7 @@ void Peahat_OnTick(PeahatEntity* this) {
|
||||||
|
|
||||||
void Peahat_OnCollision(PeahatEntity* this) {
|
void Peahat_OnCollision(PeahatEntity* this) {
|
||||||
if (this->unk_82) {
|
if (this->unk_82) {
|
||||||
if (super->contactFlags == 0x94) {
|
if (super->contactFlags == (CONTACT_TAKE_DAMAGE | 0x14)) {
|
||||||
Entity* entity = CreateEnemy(PEAHAT, PeahatForm_Propeller);
|
Entity* entity = CreateEnemy(PEAHAT, PeahatForm_Propeller);
|
||||||
if (entity != NULL) {
|
if (entity != NULL) {
|
||||||
CopyPosition(super, entity);
|
CopyPosition(super, entity);
|
||||||
|
@ -74,14 +74,14 @@ void Peahat_OnCollision(PeahatEntity* this) {
|
||||||
super->iframes = -30;
|
super->iframes = -30;
|
||||||
this->unk_81 = 0;
|
this->unk_81 = 0;
|
||||||
InitializeAnimation(super, super->animationState);
|
InitializeAnimation(super, super->animationState);
|
||||||
} else if (super->contactFlags == 0x9b) {
|
} else if (super->contactFlags == (CONTACT_TAKE_DAMAGE | 0x1b)) {
|
||||||
super->animationState = PeahatAnimation_BrokenPropeller;
|
super->animationState = PeahatAnimation_BrokenPropeller;
|
||||||
super->action = 5;
|
super->action = 5;
|
||||||
super->speed = 0x80;
|
super->speed = 0x80;
|
||||||
super->iframes = -30;
|
super->iframes = -30;
|
||||||
this->unk_81 = 0;
|
this->unk_81 = 0;
|
||||||
InitializeAnimation(super, super->animationState);
|
InitializeAnimation(super, super->animationState);
|
||||||
} else if (super->contactFlags == 0x80) {
|
} else if (super->contactFlags == CONTACT_TAKE_DAMAGE) {
|
||||||
if (super->animationState == PeahatAnimation_Flying) {
|
if (super->animationState == PeahatAnimation_Flying) {
|
||||||
super->action = 1;
|
super->action = 1;
|
||||||
super->timer = 30;
|
super->timer = 30;
|
||||||
|
|
|
@ -65,7 +65,7 @@ void Pesto_OnTick(PestoEntity* this) {
|
||||||
|
|
||||||
void Pesto_OnCollision(PestoEntity* this) {
|
void Pesto_OnCollision(PestoEntity* this) {
|
||||||
if (super->hitType != 0x6e) {
|
if (super->hitType != 0x6e) {
|
||||||
if (super->contactFlags == 0x80) {
|
if (super->contactFlags == CONTACT_TAKE_DAMAGE) {
|
||||||
this->unk_86 = 0x30;
|
this->unk_86 = 0x30;
|
||||||
|
|
||||||
if ((this->unk_83 & 0xf) == 3 && super->action == 6) {
|
if ((this->unk_83 & 0xf) == 3 && super->action == 6) {
|
||||||
|
|
|
@ -100,7 +100,7 @@ void sub_080223E4(Entity* this) {
|
||||||
|
|
||||||
entity = this->child;
|
entity = this->child;
|
||||||
if (entity != NULL) {
|
if (entity != NULL) {
|
||||||
entity->contactFlags = 0x94;
|
entity->contactFlags = (CONTACT_TAKE_DAMAGE | 0x14);
|
||||||
entity->iframes = 0x10;
|
entity->iframes = 0x10;
|
||||||
#ifndef EU
|
#ifndef EU
|
||||||
entity->knockbackDuration = 0xc;
|
entity->knockbackDuration = 0xc;
|
||||||
|
|
|
@ -51,7 +51,7 @@ void Rollobite_OnCollision(RollobiteEntity* this) {
|
||||||
InitializeAnimation(super, super->animationState + 8);
|
InitializeAnimation(super, super->animationState + 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (super->contactFlags != 0x80) {
|
if (super->contactFlags != CONTACT_TAKE_DAMAGE) {
|
||||||
if (super->action == 4 || super->action == 5) {
|
if (super->action == 4 || super->action == 5) {
|
||||||
super->action = 4;
|
super->action = 4;
|
||||||
super->timer = 180;
|
super->timer = 180;
|
||||||
|
@ -60,7 +60,7 @@ void Rollobite_OnCollision(RollobiteEntity* this) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (super->contactFlags == 0x93)
|
if (super->contactFlags == (CONTACT_TAKE_DAMAGE | 0x13))
|
||||||
Rollobite_OnTick(this);
|
Rollobite_OnTick(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,7 @@ void ScissorsBeetle_OnCollision(ScissorsBeetleEntity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
EnemyFunctionHandlerAfterCollision(super, ScissorsBeetle_Functions);
|
EnemyFunctionHandlerAfterCollision(super, ScissorsBeetle_Functions);
|
||||||
if ((super->contactFlags & 0x80) && super->action != 4) {
|
if ((super->contactFlags & CONTACT_TAKE_DAMAGE) && super->action != 4) {
|
||||||
u32 knockbackDir;
|
u32 knockbackDir;
|
||||||
child = super->child;
|
child = super->child;
|
||||||
child->iframes = super->iframes;
|
child->iframes = super->iframes;
|
||||||
|
|
|
@ -22,7 +22,7 @@ void Spark_OnTick(Entity* this) {
|
||||||
void Spark_OnCollision(Entity* this) {
|
void Spark_OnCollision(Entity* this) {
|
||||||
Entity* entity;
|
Entity* entity;
|
||||||
|
|
||||||
if (this->contactFlags & 0x80) {
|
if (this->contactFlags & CONTACT_TAKE_DAMAGE) {
|
||||||
if ((this->contactFlags & 0x7f) == 0x14) {
|
if ((this->contactFlags & 0x7f) == 0x14) {
|
||||||
COLLISION_OFF(this);
|
COLLISION_OFF(this);
|
||||||
this->iframes = 0;
|
this->iframes = 0;
|
||||||
|
|
|
@ -57,7 +57,7 @@ void SpearMoblin_OnCollision(SpearMoblinEntity* this) {
|
||||||
EnemyCreateFX(super, FX_STARS);
|
EnemyCreateFX(super, FX_STARS);
|
||||||
|
|
||||||
EnemyFunctionHandlerAfterCollision(super, SpearMoblin_Functions);
|
EnemyFunctionHandlerAfterCollision(super, SpearMoblin_Functions);
|
||||||
if (super->contactFlags & 0x80) {
|
if (super->contactFlags & CONTACT_TAKE_DAMAGE) {
|
||||||
if (super->action != 4) {
|
if (super->action != 4) {
|
||||||
sub_08028754(this);
|
sub_08028754(this);
|
||||||
} else {
|
} else {
|
||||||
|
@ -398,7 +398,7 @@ bool32 sub_080288A4(SpearMoblinEntity* this) {
|
||||||
|
|
||||||
void sub_080288C0(SpearMoblinEntity* this) {
|
void sub_080288C0(SpearMoblinEntity* this) {
|
||||||
Entity* entity = super->child;
|
Entity* entity = super->child;
|
||||||
if ((entity != NULL) && (entity->contactFlags & 0x80)) {
|
if ((entity != NULL) && (entity->contactFlags & CONTACT_TAKE_DAMAGE)) {
|
||||||
super->knockbackDirection = entity->knockbackDirection;
|
super->knockbackDirection = entity->knockbackDirection;
|
||||||
super->iframes = -entity->iframes;
|
super->iframes = -entity->iframes;
|
||||||
super->knockbackSpeed = entity->knockbackSpeed;
|
super->knockbackSpeed = entity->knockbackSpeed;
|
||||||
|
|
|
@ -49,7 +49,7 @@ void SpinyBeetle_OnCollision(SpinyBeetleEntity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
EnemyFunctionHandlerAfterCollision(super, SpinyBeetle_Functions);
|
EnemyFunctionHandlerAfterCollision(super, SpinyBeetle_Functions);
|
||||||
if (super->contactFlags & 0x80) {
|
if (super->contactFlags & CONTACT_TAKE_DAMAGE) {
|
||||||
if (super->iframes > 0 && super->child) {
|
if (super->iframes > 0 && super->child) {
|
||||||
sub_08033E1C(this);
|
sub_08033E1C(this);
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,7 +60,7 @@ void SpinyChuchu_OnCollision(SpinyChuchuEntity* this) {
|
||||||
super->hitType = 0x5c;
|
super->hitType = 0x5c;
|
||||||
InitializeAnimation(super, 1);
|
InitializeAnimation(super, 1);
|
||||||
}
|
}
|
||||||
} else if (super->contactFlags == 0x94) {
|
} else if (super->contactFlags == (CONTACT_TAKE_DAMAGE | 0x14)) {
|
||||||
EnemyCreateFX(super, FX_STARS);
|
EnemyCreateFX(super, FX_STARS);
|
||||||
super->action = 5;
|
super->action = 5;
|
||||||
InitializeAnimation(super, 1);
|
InitializeAnimation(super, 1);
|
||||||
|
|
|
@ -46,7 +46,7 @@ void Takkuri_OnTick(TakkuriEntity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Takkuri_OnCollision(TakkuriEntity* this) {
|
void Takkuri_OnCollision(TakkuriEntity* this) {
|
||||||
if (super->contactFlags & 0x80) {
|
if (super->contactFlags & CONTACT_TAKE_DAMAGE) {
|
||||||
if ((super->contactFlags & 0x7f) == 0) {
|
if ((super->contactFlags & 0x7f) == 0) {
|
||||||
u32 direction;
|
u32 direction;
|
||||||
sub_0803C0AC(super);
|
sub_0803C0AC(super);
|
||||||
|
|
|
@ -63,7 +63,7 @@ void Tektite_OnCollision(TektiteEntity* this) {
|
||||||
EnemyCreateFX(super, FX_STARS);
|
EnemyCreateFX(super, FX_STARS);
|
||||||
}
|
}
|
||||||
EnemyFunctionHandlerAfterCollision(super, Tektite_Functions);
|
EnemyFunctionHandlerAfterCollision(super, Tektite_Functions);
|
||||||
if ((super->contactFlags & 0x80) != 0) {
|
if ((super->contactFlags & CONTACT_TAKE_DAMAGE) != 0) {
|
||||||
switch (super->contactFlags & 0x3f) {
|
switch (super->contactFlags & 0x3f) {
|
||||||
case 0x14:
|
case 0x14:
|
||||||
super->action = 1;
|
super->action = 1;
|
||||||
|
|
|
@ -51,7 +51,7 @@ void TektiteGolden_OnCollision(TektiteGoldenEntity* this) {
|
||||||
EnemyCreateFX(super, FX_STARS);
|
EnemyCreateFX(super, FX_STARS);
|
||||||
}
|
}
|
||||||
EnemyFunctionHandlerAfterCollision(super, TektiteGolden_Functions);
|
EnemyFunctionHandlerAfterCollision(super, TektiteGolden_Functions);
|
||||||
if (super->contactFlags == 0x94) {
|
if (super->contactFlags == (CONTACT_TAKE_DAMAGE | 0x14)) {
|
||||||
super->action = 1;
|
super->action = 1;
|
||||||
super->subAction = 0;
|
super->subAction = 0;
|
||||||
super->timer = 20;
|
super->timer = 20;
|
||||||
|
|
|
@ -1401,7 +1401,7 @@ static void sub_08043C40(VaatiArmEntity* this, VaatiArm_HeapStruct1* heapStruct)
|
||||||
static bool32 sub_08043C98(VaatiArmEntity* this) {
|
static bool32 sub_08043C98(VaatiArmEntity* this) {
|
||||||
#if defined EU || defined JP
|
#if defined EU || defined JP
|
||||||
Entity* e1 = &((VaatiArm_HeapStruct*)super->myHeap)->entities[3]->base;
|
Entity* e1 = &((VaatiArm_HeapStruct*)super->myHeap)->entities[3]->base;
|
||||||
if ((e1->contactFlags == 0x9d)) {
|
if ((e1->contactFlags == (CONTACT_TAKE_DAMAGE | 0x1d))) {
|
||||||
sub_08043D08(this);
|
sub_08043D08(this);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
} else {
|
} else {
|
||||||
|
@ -1410,7 +1410,7 @@ static bool32 sub_08043C98(VaatiArmEntity* this) {
|
||||||
#else
|
#else
|
||||||
Entity* e1 = &((VaatiArm_HeapStruct*)super->myHeap)->entities[2]->base;
|
Entity* e1 = &((VaatiArm_HeapStruct*)super->myHeap)->entities[2]->base;
|
||||||
Entity* e2 = &((VaatiArm_HeapStruct*)super->myHeap)->entities[3]->base;
|
Entity* e2 = &((VaatiArm_HeapStruct*)super->myHeap)->entities[3]->base;
|
||||||
if ((e1->contactFlags == 0x9d) || (e2->contactFlags == 0x9d)) {
|
if ((e1->contactFlags == (CONTACT_TAKE_DAMAGE | 0x1d)) || (e2->contactFlags == (CONTACT_TAKE_DAMAGE | 0x1d))) {
|
||||||
sub_08043D08(this);
|
sub_08043D08(this);
|
||||||
gRoomTransition.field_0x38 |= 2;
|
gRoomTransition.field_0x38 |= 2;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -1423,7 +1423,7 @@ static bool32 sub_08043C98(VaatiArmEntity* this) {
|
||||||
static void sub_08043CD4(VaatiArmEntity* this) {
|
static void sub_08043CD4(VaatiArmEntity* this) {
|
||||||
u32 i;
|
u32 i;
|
||||||
for (i = 0; i < 5; i++) {
|
for (i = 0; i < 5; i++) {
|
||||||
if (((VaatiArm_HeapStruct*)super->myHeap)->entities[i]->base.contactFlags == 0x9d) {
|
if (((VaatiArm_HeapStruct*)super->myHeap)->entities[i]->base.contactFlags == (CONTACT_TAKE_DAMAGE | 0x1d)) {
|
||||||
this->unk_7c = 0x78;
|
this->unk_7c = 0x78;
|
||||||
this->unk_7d = i;
|
this->unk_7d = i;
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -58,7 +58,7 @@ void VaatiBall(VaatiBallEntity* this) {
|
||||||
super->health = -1;
|
super->health = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (super->contactFlags & 0x80) {
|
if (super->contactFlags & CONTACT_TAKE_DAMAGE) {
|
||||||
if ((super->contactFlags & 0x3f) == 0 && super->action == 6) {
|
if ((super->contactFlags & 0x3f) == 0 && super->action == 6) {
|
||||||
ModHealth(-2);
|
ModHealth(-2);
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,7 +66,7 @@ void VaatiProjectile_OnTick(VaatiProjectileEntity* this) {
|
||||||
void VaatiProjectile_OnCollision(VaatiProjectileEntity* this) {
|
void VaatiProjectile_OnCollision(VaatiProjectileEntity* this) {
|
||||||
Entity* entity;
|
Entity* entity;
|
||||||
|
|
||||||
if (super->contactFlags == 0x80) {
|
if (super->contactFlags == CONTACT_TAKE_DAMAGE) {
|
||||||
#ifndef EU
|
#ifndef EU
|
||||||
if (super->health != 0) {
|
if (super->health != 0) {
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -539,7 +539,7 @@ void VaatiRebornEnemyType1Action1(VaatiRebornEnemyEntity* this) {
|
||||||
super->hitType = 0x2f;
|
super->hitType = 0x2f;
|
||||||
InitAnimationForceUpdate(super, this->unk_74);
|
InitAnimationForceUpdate(super, this->unk_74);
|
||||||
} else {
|
} else {
|
||||||
if (((super->contactFlags & 0x80) != 0) && (0 < super->iframes)) {
|
if (((super->contactFlags & CONTACT_TAKE_DAMAGE) != 0) && (0 < super->iframes)) {
|
||||||
parent->iframes = super->iframes;
|
parent->iframes = super->iframes;
|
||||||
parent->contactFlags = super->contactFlags;
|
parent->contactFlags = super->contactFlags;
|
||||||
}
|
}
|
||||||
|
@ -665,7 +665,7 @@ void VaatiRebornEnemyType1PreAction(VaatiRebornEnemyEntity* this) {
|
||||||
}
|
}
|
||||||
parent = super->parent;
|
parent = super->parent;
|
||||||
this->unk_77 = 0;
|
this->unk_77 = 0;
|
||||||
if ((super->contactFlags & 0x80) != 0) {
|
if ((super->contactFlags & CONTACT_TAKE_DAMAGE) != 0) {
|
||||||
if (gUnk_080D04D0[((VaatiRebornEnemyEntity*)parent)->unk_86] > super->health) {
|
if (gUnk_080D04D0[((VaatiRebornEnemyEntity*)parent)->unk_86] > super->health) {
|
||||||
if (2 < ++((VaatiRebornEnemyEntity*)parent)->unk_86) {
|
if (2 < ++((VaatiRebornEnemyEntity*)parent)->unk_86) {
|
||||||
COLLISION_OFF(super);
|
COLLISION_OFF(super);
|
||||||
|
|
|
@ -1097,11 +1097,11 @@ void sub_080409B0(VaatiTransfiguredEntity* this) {
|
||||||
Knockback1(super);
|
Knockback1(super);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (((super->contactFlags & 0x80) != 0) && (0 < super->iframes)) {
|
if (((super->contactFlags & CONTACT_TAKE_DAMAGE) != 0) && (0 < super->iframes)) {
|
||||||
InitScreenShake(12, 1);
|
InitScreenShake(12, 1);
|
||||||
SoundReq(SFX_BOSS_HIT);
|
SoundReq(SFX_BOSS_HIT);
|
||||||
}
|
}
|
||||||
if ((super->contactFlags == 0x8a) && (gPlayerState.chargeState.action == 5)) {
|
if ((super->contactFlags == (CONTACT_TAKE_DAMAGE | 0xa)) && (gPlayerState.chargeState.action == 5)) {
|
||||||
super->health = 0xc0;
|
super->health = 0xc0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,7 +72,7 @@ void VaatiTransfiguredEye_OnCollision(VaatiTransfiguredEyeEntity* this) {
|
||||||
|
|
||||||
if (super->type != 0) {
|
if (super->type != 0) {
|
||||||
pEVar4 = super->parent->parent;
|
pEVar4 = super->parent->parent;
|
||||||
if ((super->contactFlags & 0x80) != 0) {
|
if ((super->contactFlags & CONTACT_TAKE_DAMAGE) != 0) {
|
||||||
bVar1 = super->contactFlags & 0x3f;
|
bVar1 = super->contactFlags & 0x3f;
|
||||||
if ((bVar1 == 0xe) || (bVar1 == 0x15)) {
|
if ((bVar1 == 0xe) || (bVar1 == 0x15)) {
|
||||||
|
|
||||||
|
|
|
@ -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 };
|
0xfd, 0xfd, 0xfd, 0xfd, 0xfd, 0xfd, 0xfd, 0xfd, 0xfd, 0xfd };
|
||||||
|
|
||||||
void VaatiWrath(VaatiWrathEntity* this) {
|
void VaatiWrath(VaatiWrathEntity* this) {
|
||||||
if (((super->type == 0) && ((super->contactFlags & 0x80) != 0)) && (super->health == 0)) {
|
if (((super->type == 0) && ((super->contactFlags & CONTACT_TAKE_DAMAGE) != 0)) && (super->health == 0)) {
|
||||||
COLLISION_ON(super);
|
COLLISION_ON(super);
|
||||||
super->health = 0xff;
|
super->health = 0xff;
|
||||||
if (--this->unk_84 == 0) {
|
if (--this->unk_84 == 0) {
|
||||||
|
|
|
@ -57,7 +57,7 @@ void Wisp_OnCollision(WispEntity* this) {
|
||||||
Entity* entity;
|
Entity* entity;
|
||||||
|
|
||||||
bits = super->contactFlags;
|
bits = super->contactFlags;
|
||||||
if ((bits & 0x80) == 0) {
|
if ((bits & CONTACT_TAKE_DAMAGE) == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ void WizzrobeIce_OnCollision(WizzrobeEntity* this) {
|
||||||
EnemyCreateFX(super, FX_STARS);
|
EnemyCreateFX(super, FX_STARS);
|
||||||
}
|
}
|
||||||
EnemyFunctionHandlerAfterCollision(super, WizzrobeIce_Functions);
|
EnemyFunctionHandlerAfterCollision(super, WizzrobeIce_Functions);
|
||||||
if (super->contactFlags == 0x87) {
|
if (super->contactFlags == (CONTACT_TAKE_DAMAGE | 0x7)) {
|
||||||
Entity* obj = CreateObject(FLAME, 3, 0);
|
Entity* obj = CreateObject(FLAME, 3, 0);
|
||||||
if (obj != NULL) {
|
if (obj != NULL) {
|
||||||
obj->spritePriority.b0 = 3;
|
obj->spritePriority.b0 = 3;
|
||||||
|
|
|
@ -33,7 +33,7 @@ void WizzrobeWind_OnCollision(WizzrobeEntity* this) {
|
||||||
EnemyCreateFX(super, FX_STARS);
|
EnemyCreateFX(super, FX_STARS);
|
||||||
}
|
}
|
||||||
EnemyFunctionHandlerAfterCollision(super, WizzrobeWind_Functions);
|
EnemyFunctionHandlerAfterCollision(super, WizzrobeWind_Functions);
|
||||||
if (super->contactFlags == 0x87) {
|
if (super->contactFlags == (CONTACT_TAKE_DAMAGE | 0x7)) {
|
||||||
Entity* obj = CreateObject(FLAME, 3, 0);
|
Entity* obj = CreateObject(FLAME, 3, 0);
|
||||||
if (obj != NULL) {
|
if (obj != NULL) {
|
||||||
obj->spritePriority.b0 = 3;
|
obj->spritePriority.b0 = 3;
|
||||||
|
|
|
@ -314,9 +314,9 @@ void EnemyDetachFX(Entity* entity) {
|
||||||
/** Unsets bitfield 0x80 before calling GetNextFunction, so that the enemyFunction 1 is not called. */
|
/** Unsets bitfield 0x80 before calling GetNextFunction, so that the enemyFunction 1 is not called. */
|
||||||
void EnemyFunctionHandlerAfterCollision(Entity* entity, void (*const fntable[])()) {
|
void EnemyFunctionHandlerAfterCollision(Entity* entity, void (*const fntable[])()) {
|
||||||
u32 idx;
|
u32 idx;
|
||||||
entity->contactFlags &= ~0x80;
|
entity->contactFlags &= ~CONTACT_TAKE_DAMAGE;
|
||||||
idx = GetNextFunction(entity);
|
idx = GetNextFunction(entity);
|
||||||
entity->contactFlags |= 0x80;
|
entity->contactFlags |= CONTACT_TAKE_DAMAGE;
|
||||||
fntable[idx](entity);
|
fntable[idx](entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -236,7 +236,7 @@ static void HandlePlayerLife(Entity* this) {
|
||||||
gUnk_0200AF00.rActionInteractTile = R_ACTION_NONE;
|
gUnk_0200AF00.rActionInteractTile = R_ACTION_NONE;
|
||||||
gUnk_0200AF00.rActionGrabbing = R_ACTION_NONE;
|
gUnk_0200AF00.rActionGrabbing = R_ACTION_NONE;
|
||||||
|
|
||||||
if ((gPlayerEntity.base.contactFlags & 0x80) && (gPlayerEntity.base.iframes > 0))
|
if ((gPlayerEntity.base.contactFlags & CONTACT_TAKE_DAMAGE) && (gPlayerEntity.base.iframes > 0))
|
||||||
SoundReq(SFX_86);
|
SoundReq(SFX_86);
|
||||||
|
|
||||||
gPlayerState.flags &= ~(PL_FALLING | PL_CONVEYOR_PUSHED);
|
gPlayerState.flags &= ~(PL_FALLING | PL_CONVEYOR_PUSHED);
|
||||||
|
@ -323,7 +323,7 @@ static void sub_080171F0(void) {
|
||||||
if (gPlayerEntity.unk_7a != 0)
|
if (gPlayerEntity.unk_7a != 0)
|
||||||
gPlayerEntity.unk_7a--;
|
gPlayerEntity.unk_7a--;
|
||||||
|
|
||||||
gPlayerEntity.base.contactFlags &= ~0x80;
|
gPlayerEntity.base.contactFlags &= ~CONTACT_TAKE_DAMAGE;
|
||||||
if (gPlayerEntity.base.action != PLAYER_DROWN)
|
if (gPlayerEntity.base.action != PLAYER_DROWN)
|
||||||
COPY_FLAG_FROM_TO(gPlayerState.flags, 0x2, 0x10000);
|
COPY_FLAG_FROM_TO(gPlayerState.flags, 0x2, 0x10000);
|
||||||
|
|
||||||
|
|
|
@ -525,7 +525,7 @@ u32 sub_080611D4(Entity* this) {
|
||||||
|
|
||||||
u32 sub_08061230(NPC5Entity* this) {
|
u32 sub_08061230(NPC5Entity* this) {
|
||||||
if ((((UnkHeap*)super->myHeap)->unk_0 & 1) == 0) {
|
if ((((UnkHeap*)super->myHeap)->unk_0 & 1) == 0) {
|
||||||
if ((super->contactFlags & 0x80) != 0) {
|
if ((super->contactFlags & CONTACT_TAKE_DAMAGE) != 0) {
|
||||||
switch (super->contactFlags & 0x7f) {
|
switch (super->contactFlags & 0x7f) {
|
||||||
case 0:
|
case 0:
|
||||||
case 1:
|
case 1:
|
||||||
|
|
|
@ -207,7 +207,7 @@ void ObjectUpdate(Entity* this) {
|
||||||
this->iframes++;
|
this->iframes++;
|
||||||
if (!EntityDisabled(this)) {
|
if (!EntityDisabled(this)) {
|
||||||
gObjectFunctions[this->id](this);
|
gObjectFunctions[this->id](this);
|
||||||
this->contactFlags &= ~0x80;
|
this->contactFlags &= ~CONTACT_TAKE_DAMAGE;
|
||||||
}
|
}
|
||||||
DrawEntity(this);
|
DrawEntity(this);
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,7 +64,7 @@ void sub_0808BBE0(Entity* this) {
|
||||||
ptr = &gUnk_0812144C[diff * 2];
|
ptr = &gUnk_0812144C[diff * 2];
|
||||||
SetAffineInfo(this, ptr[0], ptr[1], 0);
|
SetAffineInfo(this, ptr[0], ptr[1], 0);
|
||||||
} else {
|
} else {
|
||||||
this->contactFlags &= ~0x80;
|
this->contactFlags &= ~CONTACT_TAKE_DAMAGE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -74,7 +74,7 @@ void BarrelSpiderweb_Action1(Entity* this) {
|
||||||
tmp = -0x170;
|
tmp = -0x170;
|
||||||
this->y.HALF.HI = gRoomControls.origin_y - ((this->parent)->zVelocity + tmp);
|
this->y.HALF.HI = gRoomControls.origin_y - ((this->parent)->zVelocity + tmp);
|
||||||
sub_0808BBE0(this);
|
sub_0808BBE0(this);
|
||||||
if (this->contactFlags == 0x93) {
|
if (this->contactFlags == (CONTACT_TAKE_DAMAGE | 0x13)) {
|
||||||
this->timer--;
|
this->timer--;
|
||||||
this->spriteSettings.draw = 1;
|
this->spriteSettings.draw = 1;
|
||||||
if (this->timer == 0) {
|
if (this->timer == 0) {
|
||||||
|
@ -114,7 +114,7 @@ void BarrelSpiderweb_Action2(Entity* this) {
|
||||||
this->subtimer -= 8;
|
this->subtimer -= 8;
|
||||||
SetAffineInfo(this, 0x200 - this->subtimer, 0x200 - this->subtimer, 0);
|
SetAffineInfo(this, 0x200 - this->subtimer, 0x200 - this->subtimer, 0);
|
||||||
}
|
}
|
||||||
if (this->contactFlags == 0x93) {
|
if (this->contactFlags == (CONTACT_TAKE_DAMAGE | 0x13)) {
|
||||||
this->direction = GetFacingDirection(this, &gPlayerEntity.base);
|
this->direction = GetFacingDirection(this, &gPlayerEntity.base);
|
||||||
LinearMoveUpdate(this);
|
LinearMoveUpdate(this);
|
||||||
if (EntityWithinDistance(this, gPlayerEntity.base.x.HALF.HI, gPlayerEntity.base.y.HALF.HI - 6, 0x1c)) {
|
if (EntityWithinDistance(this, gPlayerEntity.base.x.HALF.HI, gPlayerEntity.base.y.HALF.HI - 6, 0x1c)) {
|
||||||
|
|
|
@ -101,7 +101,7 @@ void DirtParticle_Init(DirtParticleEntity* this) {
|
||||||
|
|
||||||
void DirtParticle_Action1(DirtParticleEntity* this) {
|
void DirtParticle_Action1(DirtParticleEntity* this) {
|
||||||
DirtParticleEntity* entity;
|
DirtParticleEntity* entity;
|
||||||
if ((super->contactFlags & 0x80) == 0) {
|
if ((super->contactFlags & CONTACT_TAKE_DAMAGE) == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
switch (super->contactFlags & 0x7f) {
|
switch (super->contactFlags & 0x7f) {
|
||||||
|
@ -128,7 +128,7 @@ void DirtParticle_Action3(DirtParticleEntity* this) {
|
||||||
sub_08087B9C,
|
sub_08087B9C,
|
||||||
sub_08087B9C,
|
sub_08087B9C,
|
||||||
};
|
};
|
||||||
if ((super->contactFlags & 0x80) != 0) {
|
if ((super->contactFlags & CONTACT_TAKE_DAMAGE) != 0) {
|
||||||
gUnk_08120A80[super->subAction](this);
|
gUnk_08120A80[super->subAction](this);
|
||||||
} else {
|
} else {
|
||||||
super->action = 1;
|
super->action = 1;
|
||||||
|
|
|
@ -50,7 +50,7 @@ void EyeSwitch_Init(EyeSwitchEntity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void EyeSwitch_Action1(EyeSwitchEntity* this) {
|
void EyeSwitch_Action1(EyeSwitchEntity* this) {
|
||||||
if ((super->contactFlags == 0x95 || super->contactFlags == 0x8e) &&
|
if ((super->contactFlags == (CONTACT_TAKE_DAMAGE | 0x15) || super->contactFlags == (CONTACT_TAKE_DAMAGE | 0xe)) &&
|
||||||
(DirectionRoundUp(super->contactedEntity->direction) >> 3 == (super->animationState & 3))) {
|
(DirectionRoundUp(super->contactedEntity->direction) >> 3 == (super->animationState & 3))) {
|
||||||
super->action = 2;
|
super->action = 2;
|
||||||
COLLISION_OFF(super);
|
COLLISION_OFF(super);
|
||||||
|
|
|
@ -40,7 +40,7 @@ void Fairy(FairyEntity* this) {
|
||||||
Fairy_Init, Fairy_Action1, Fairy_Action2, Fairy_Action3, Fairy_Action4,
|
Fairy_Init, Fairy_Action1, Fairy_Action2, Fairy_Action3, Fairy_Action4,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (((super->contactFlags & 0x80) != 0)) {
|
if (((super->contactFlags & CONTACT_TAKE_DAMAGE) != 0)) {
|
||||||
switch (super->contactFlags & 0x7f) {
|
switch (super->contactFlags & 0x7f) {
|
||||||
case 0x14:
|
case 0x14:
|
||||||
super->action = 3;
|
super->action = 3;
|
||||||
|
|
|
@ -47,7 +47,7 @@ void HittableLever_Init(HittableLeverEntity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void HittableLever_Idle(HittableLeverEntity* this) {
|
void HittableLever_Idle(HittableLeverEntity* this) {
|
||||||
if (((super->contactFlags & 0x80) != 0) && (this->wasHit == 0)) {
|
if (((super->contactFlags & CONTACT_TAKE_DAMAGE) != 0) && (this->wasHit == 0)) {
|
||||||
this->wasHit = 1;
|
this->wasHit = 1;
|
||||||
super->type ^= 1;
|
super->type ^= 1;
|
||||||
super->iframes = -0x18;
|
super->iframes = -0x18;
|
||||||
|
|
|
@ -63,7 +63,7 @@ void ItemOnGround(ItemOnGroundEntity* this) {
|
||||||
static void (*const ItemOnGround_Actions[])(ItemOnGroundEntity*) = {
|
static void (*const ItemOnGround_Actions[])(ItemOnGroundEntity*) = {
|
||||||
ItemOnGround_Init, ItemOnGround_Action1, ItemOnGround_Action2, ItemOnGround_Action3, ItemOnGround_Action4,
|
ItemOnGround_Init, ItemOnGround_Action1, ItemOnGround_Action2, ItemOnGround_Action3, ItemOnGround_Action4,
|
||||||
};
|
};
|
||||||
if (super->contactFlags & 0x80) {
|
if (super->contactFlags & CONTACT_TAKE_DAMAGE) {
|
||||||
switch (super->contactFlags & 0x7F) {
|
switch (super->contactFlags & 0x7F) {
|
||||||
case 20:
|
case 20:
|
||||||
super->action = 3;
|
super->action = 3;
|
||||||
|
|
|
@ -170,7 +170,7 @@ void JarPortal_Action4(JarPortalEntity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 sub_0808C128(JarPortalEntity* this) {
|
u32 sub_0808C128(JarPortalEntity* this) {
|
||||||
return super->contactFlags == 157;
|
return super->contactFlags == (CONTACT_TAKE_DAMAGE | 0x1d);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_0808C13C(JarPortalEntity* this) {
|
void sub_0808C13C(JarPortalEntity* this) {
|
||||||
|
|
|
@ -131,7 +131,7 @@ void LavaPlatform_Type1Action1(LavaPlatformEntity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void LavaPlatform_Type1Action2(LavaPlatformEntity* this) {
|
void LavaPlatform_Type1Action2(LavaPlatformEntity* this) {
|
||||||
if (super->contactFlags == 0x9d) {
|
if (super->contactFlags == (CONTACT_TAKE_DAMAGE | 0x1d)) {
|
||||||
sub_08092620(this);
|
sub_08092620(this);
|
||||||
} else {
|
} else {
|
||||||
if (LavaPlatform_IsPlayerOnPlatform(this)) {
|
if (LavaPlatform_IsPlayerOnPlatform(this)) {
|
||||||
|
@ -223,7 +223,7 @@ void LavaPlatform_Type1Action6(LavaPlatformEntity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void LavaPlatform_Type1Action7(LavaPlatformEntity* this) {
|
void LavaPlatform_Type1Action7(LavaPlatformEntity* this) {
|
||||||
if (super->contactFlags == 0x9d) {
|
if (super->contactFlags == (CONTACT_TAKE_DAMAGE | 0x1d)) {
|
||||||
sub_08092620(this);
|
sub_08092620(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,7 +67,7 @@ void LightableSwitch_Type0_Init(LightableSwitchEntity* this) {
|
||||||
|
|
||||||
void LightableSwitch_Type0_Action1(LightableSwitchEntity* this) {
|
void LightableSwitch_Type0_Action1(LightableSwitchEntity* this) {
|
||||||
|
|
||||||
if ((super->contactFlags & 0x80) != 0) {
|
if ((super->contactFlags & CONTACT_TAKE_DAMAGE) != 0) {
|
||||||
if (CheckFlags(this->unk_86) != 0) {
|
if (CheckFlags(this->unk_86) != 0) {
|
||||||
ClearFlag(this->unk_86);
|
ClearFlag(this->unk_86);
|
||||||
} else {
|
} else {
|
||||||
|
@ -147,7 +147,7 @@ void LightableSwitch_Type1_Init(LightableSwitchEntity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void LightableSwitch_Type1_Action1(LightableSwitchEntity* this) {
|
void LightableSwitch_Type1_Action1(LightableSwitchEntity* this) {
|
||||||
if ((super->contactFlags & 0x80) != 0) {
|
if ((super->contactFlags & CONTACT_TAKE_DAMAGE) != 0) {
|
||||||
super->action = 2;
|
super->action = 2;
|
||||||
super->timer = 16;
|
super->timer = 16;
|
||||||
super->frameIndex = 2;
|
super->frameIndex = 2;
|
||||||
|
|
|
@ -39,7 +39,7 @@ void ObjectA8(ObjectA8Entity* this) {
|
||||||
ObjectA8_Init, ObjectA8_Action1, ObjectA8_Action2, ObjectA8_Action3,
|
ObjectA8_Init, ObjectA8_Action1, ObjectA8_Action2, ObjectA8_Action3,
|
||||||
ObjectA8_Action4, ObjectA8_Action5, ObjectA8_Action6,
|
ObjectA8_Action4, ObjectA8_Action5, ObjectA8_Action6,
|
||||||
};
|
};
|
||||||
if ((super->contactFlags & 0x80) != 0) {
|
if ((super->contactFlags & CONTACT_TAKE_DAMAGE) != 0) {
|
||||||
switch (super->contactFlags & 0x7f) {
|
switch (super->contactFlags & 0x7f) {
|
||||||
case 0:
|
case 0:
|
||||||
case 1:
|
case 1:
|
||||||
|
|
|
@ -72,7 +72,7 @@ void ObjectOnSpinyBeetle_Action1(ObjectOnSpinyBeetleEntity* this) {
|
||||||
sub_080989C0(this);
|
sub_080989C0(this);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ((super->contactFlags & 0x80) != 0) {
|
if ((super->contactFlags & CONTACT_TAKE_DAMAGE) != 0) {
|
||||||
switch (super->contactFlags & 0x3f) {
|
switch (super->contactFlags & 0x3f) {
|
||||||
case 0x13:
|
case 0x13:
|
||||||
super->action = 3;
|
super->action = 3;
|
||||||
|
|
|
@ -44,7 +44,7 @@ void SanctuaryStoneTablet_Init(SanctuaryStoneTabletEntity* this) {
|
||||||
void SanctuaryStoneTablet_Action1(SanctuaryStoneTabletEntity* this) {
|
void SanctuaryStoneTablet_Action1(SanctuaryStoneTabletEntity* this) {
|
||||||
Entity* fxEnt;
|
Entity* fxEnt;
|
||||||
|
|
||||||
if (super->contactFlags == 0xa1) {
|
if (super->contactFlags == (CONTACT_TAKE_DAMAGE | 0x21)) {
|
||||||
fxEnt = CreateFx(super, FX_MAGIC_STORM, 0);
|
fxEnt = CreateFx(super, FX_MAGIC_STORM, 0);
|
||||||
if (fxEnt != NULL) {
|
if (fxEnt != NULL) {
|
||||||
fxEnt->spritePriority.b0 = 3;
|
fxEnt->spritePriority.b0 = 3;
|
||||||
|
|
|
@ -281,7 +281,7 @@ bool32 sub_0809963C(SmallIceBlockEntity* this) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (super->contactFlags == 0x87) {
|
if (super->contactFlags == (CONTACT_TAKE_DAMAGE | 0x7)) {
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
|
@ -49,7 +49,7 @@ void UnusedSkull_Init(UnusedSkullEntity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void UnusedSkull_Action1(UnusedSkullEntity* this) {
|
void UnusedSkull_Action1(UnusedSkullEntity* this) {
|
||||||
if (super->contactFlags == 0x9c) {
|
if (super->contactFlags == (CONTACT_TAKE_DAMAGE | 0x1c)) {
|
||||||
super->action = 2;
|
super->action = 2;
|
||||||
super->flags &= ~0x80;
|
super->flags &= ~0x80;
|
||||||
CreateFx(super, FX_ICE, 0);
|
CreateFx(super, FX_ICE, 0);
|
||||||
|
|
|
@ -114,7 +114,7 @@ void sub_0806F4E8(Entity* ent) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool32 sub_0806F520(Entity* ent) {
|
bool32 sub_0806F520(Entity* ent) {
|
||||||
if (ent->contactFlags == 0x93)
|
if (ent->contactFlags == (CONTACT_TAKE_DAMAGE | 0x13))
|
||||||
return 1;
|
return 1;
|
||||||
ent->gustJarState &= ~4;
|
ent->gustJarState &= ~4;
|
||||||
ent->spriteOffsetY = 0;
|
ent->spriteOffsetY = 0;
|
||||||
|
|
|
@ -2067,7 +2067,8 @@ static void PlayerRollInit(PlayerEntity* this) {
|
||||||
|
|
||||||
static void PlayerRollUpdate(PlayerEntity* this) {
|
static void PlayerRollUpdate(PlayerEntity* this) {
|
||||||
if (((gPlayerState.flags & (PL_ROLLING | PL_MOLDWORM_CAPTURED)) != PL_ROLLING) ||
|
if (((gPlayerState.flags & (PL_ROLLING | PL_MOLDWORM_CAPTURED)) != PL_ROLLING) ||
|
||||||
(!(gPlayerState.flags & PL_MOLDWORM_RELEASED) && (super->iframes != 0) && (super->contactFlags & 0x80))) {
|
(!(gPlayerState.flags & PL_MOLDWORM_RELEASED) && (super->iframes != 0) &&
|
||||||
|
(super->contactFlags & CONTACT_TAKE_DAMAGE))) {
|
||||||
gPlayerState.flags &= ~PL_ROLLING;
|
gPlayerState.flags &= ~PL_ROLLING;
|
||||||
if (CheckQueuedAction())
|
if (CheckQueuedAction())
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -74,7 +74,7 @@ void ItemUpdate(Entity* this) {
|
||||||
|
|
||||||
if (!EntityDisabled(this)) {
|
if (!EntityDisabled(this)) {
|
||||||
gPlayerItemFunctions[this->id](this);
|
gPlayerItemFunctions[this->id](this);
|
||||||
this->contactFlags &= ~0x80;
|
this->contactFlags &= ~CONTACT_TAKE_DAMAGE;
|
||||||
if (this->iframes != 0) {
|
if (this->iframes != 0) {
|
||||||
if (this->iframes > 0)
|
if (this->iframes > 0)
|
||||||
this->iframes--;
|
this->iframes--;
|
||||||
|
|
|
@ -184,7 +184,7 @@ void PlayerItemBoomerang_Action2(PlayerItemBoomerangEntity* this) {
|
||||||
if (super->timer == 0) {
|
if (super->timer == 0) {
|
||||||
uVar6 = TRUE;
|
uVar6 = TRUE;
|
||||||
}
|
}
|
||||||
if (super->contactFlags & 0x80) {
|
if (super->contactFlags & CONTACT_TAKE_DAMAGE) {
|
||||||
uVar6 = TRUE;
|
uVar6 = TRUE;
|
||||||
}
|
}
|
||||||
if (!uVar6) {
|
if (!uVar6) {
|
||||||
|
|
|
@ -141,7 +141,7 @@ void PlayerItemGustBig_Action2(PlayerItemGustBigEntity* this) {
|
||||||
if ((super->child->gustJarState & 4) == 0) {
|
if ((super->child->gustJarState & 4) == 0) {
|
||||||
DeleteThisEntity();
|
DeleteThisEntity();
|
||||||
}
|
}
|
||||||
if ((super->contactFlags & 0x80) != 0) {
|
if ((super->contactFlags & CONTACT_TAKE_DAMAGE) != 0) {
|
||||||
PlayerItemGustBig_Action3(this);
|
PlayerItemGustBig_Action3(this);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -112,7 +112,7 @@ void PlayerItemHeldObject_SubAction2(PlayerItemHeldObjectEntity* this) {
|
||||||
if ((child->base).action != 2) {
|
if ((child->base).action != 2) {
|
||||||
DeleteThisEntity();
|
DeleteThisEntity();
|
||||||
}
|
}
|
||||||
if ((super->contactFlags & 0x80) != 0) {
|
if ((super->contactFlags & CONTACT_TAKE_DAMAGE) != 0) {
|
||||||
super->z.WORD = 0;
|
super->z.WORD = 0;
|
||||||
}
|
}
|
||||||
if (super->speed != 0) {
|
if (super->speed != 0) {
|
||||||
|
|
|
@ -102,7 +102,7 @@ void PlayerItemShield_Action1(PlayerItemShieldEntity* this) {
|
||||||
gPlayerState.shield_status &= ~0x80;
|
gPlayerState.shield_status &= ~0x80;
|
||||||
sub_080176E4(super);
|
sub_080176E4(super);
|
||||||
} else {
|
} else {
|
||||||
if ((super->contactFlags & 0x80) != 0) {
|
if ((super->contactFlags & CONTACT_TAKE_DAMAGE) != 0) {
|
||||||
if ((((super->contactFlags & 0x7f) == 0x42) && this->unk_68 == 0xe) &&
|
if ((((super->contactFlags & 0x7f) == 0x42) && this->unk_68 == 0xe) &&
|
||||||
((gPlayerState.shield_status & 0x40) == 0)) {
|
((gPlayerState.shield_status & 0x40) == 0)) {
|
||||||
playerItem = CreatePlayerItem(PLAYER_ITEM_FIRE_ROD_PROJECTILE, 0, 0, this->unk_68);
|
playerItem = CreatePlayerItem(PLAYER_ITEM_FIRE_ROD_PROJECTILE, 0, 0, this->unk_68);
|
||||||
|
|
|
@ -285,7 +285,7 @@ void sub_080A78B8(PlayerItemSwordEntity* this, Entity* param_2) {
|
||||||
}
|
}
|
||||||
super->spriteSettings.flipX = flipX;
|
super->spriteSettings.flipX = flipX;
|
||||||
}
|
}
|
||||||
if ((super->contactFlags & 0x80) != 0) {
|
if ((super->contactFlags & CONTACT_TAKE_DAMAGE) != 0) {
|
||||||
if ((param_2->iframes == 0) || ((u8)param_2->iframes == 0x81)) {
|
if ((param_2->iframes == 0) || ((u8)param_2->iframes == 0x81)) {
|
||||||
param_2->iframes = super->iframes;
|
param_2->iframes = super->iframes;
|
||||||
param_2->knockbackDirection = super->knockbackDirection;
|
param_2->knockbackDirection = super->knockbackDirection;
|
||||||
|
|
|
@ -34,7 +34,7 @@ void ArrowProjectile_OnTick(Entity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void ArrowProjectile_OnCollision(Entity* this) {
|
void ArrowProjectile_OnCollision(Entity* this) {
|
||||||
if ((this->contactFlags & 0x80) != 0) {
|
if ((this->contactFlags & CONTACT_TAKE_DAMAGE) != 0) {
|
||||||
if ((this->contactFlags & 0x3f) != 0) {
|
if ((this->contactFlags & 0x3f) != 0) {
|
||||||
ModHealth(-2);
|
ModHealth(-2);
|
||||||
sub_080A9488(this);
|
sub_080A9488(this);
|
||||||
|
|
|
@ -23,7 +23,7 @@ void BoneProjectile_OnTick(Entity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void BoneProjectile_OnCollision(Entity* this) {
|
void BoneProjectile_OnCollision(Entity* this) {
|
||||||
if (this->contactFlags == 0x80) {
|
if (this->contactFlags == CONTACT_TAKE_DAMAGE) {
|
||||||
DeleteEntity(this);
|
DeleteEntity(this);
|
||||||
} else {
|
} else {
|
||||||
sub_080A82D8(this);
|
sub_080A82D8(this);
|
||||||
|
|
|
@ -30,7 +30,7 @@ void DarkNutSwordSlash(Entity* this) {
|
||||||
if ((this->parent == NULL) || (this->parent->health == 0)) {
|
if ((this->parent == NULL) || (this->parent->health == 0)) {
|
||||||
DeleteThisEntity();
|
DeleteThisEntity();
|
||||||
}
|
}
|
||||||
if (((this->contactFlags & 0x80) != 0) && (this->contactedEntity == &gPlayerEntity.base)) {
|
if (((this->contactFlags & CONTACT_TAKE_DAMAGE) != 0) && (this->contactedEntity == &gPlayerEntity.base)) {
|
||||||
this->iframes = -0x2d;
|
this->iframes = -0x2d;
|
||||||
}
|
}
|
||||||
this->contactFlags = 0;
|
this->contactFlags = 0;
|
||||||
|
|
|
@ -24,7 +24,7 @@ void DekuSeedProjectile_OnTick(Entity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void DekuSeedProjectile_OnCollision(Entity* this) {
|
void DekuSeedProjectile_OnCollision(Entity* this) {
|
||||||
if (this->contactFlags == 0x80) {
|
if (this->contactFlags == CONTACT_TAKE_DAMAGE) {
|
||||||
if (this->hitType == 0x68) {
|
if (this->hitType == 0x68) {
|
||||||
EnqueueSFX(SFX_86);
|
EnqueueSFX(SFX_86);
|
||||||
}
|
}
|
||||||
|
@ -75,7 +75,7 @@ void DekuSeedProjectile_Action1(Entity* this) {
|
||||||
if ((parent->next != NULL) && (IsColliding(this, parent) != 0)) {
|
if ((parent->next != NULL) && (IsColliding(this, parent) != 0)) {
|
||||||
this->iframes = 0x10;
|
this->iframes = 0x10;
|
||||||
this->knockbackDirection = -this->direction;
|
this->knockbackDirection = -this->direction;
|
||||||
this->contactFlags = 0x80;
|
this->contactFlags = CONTACT_TAKE_DAMAGE;
|
||||||
this->knockbackDuration = 0xc;
|
this->knockbackDuration = 0xc;
|
||||||
this->knockbackSpeed = 0;
|
this->knockbackSpeed = 0;
|
||||||
parent->iframes = 0x10;
|
parent->iframes = 0x10;
|
||||||
|
|
|
@ -41,7 +41,7 @@ void DirtBallProjectile_OnCollision(Entity* this) {
|
||||||
this->knockbackSpeed = 0;
|
this->knockbackSpeed = 0;
|
||||||
if (this->type == 0) {
|
if (this->type == 0) {
|
||||||
this->parent->child = NULL;
|
this->parent->child = NULL;
|
||||||
if (this->contactFlags == 0x80) {
|
if (this->contactFlags == CONTACT_TAKE_DAMAGE) {
|
||||||
gPlayerState.hurtBlinkSpeed = 0xf0;
|
gPlayerState.hurtBlinkSpeed = 0xf0;
|
||||||
ModHealth(-2);
|
ModHealth(-2);
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ void GleerokProjectile(GleerokProjectileEntity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void GleerokProjectile_OnTick(GleerokProjectileEntity* this) {
|
void GleerokProjectile_OnTick(GleerokProjectileEntity* this) {
|
||||||
if (((super->type != 3) && ((super->contactFlags & 0x80) != 0)) && ((super->contactFlags & 0x7f) != 0x1e)) {
|
if (((super->type != 3) && ((super->contactFlags & CONTACT_TAKE_DAMAGE) != 0)) && ((super->contactFlags & 0x7f) != 0x1e)) {
|
||||||
super->action = 3;
|
super->action = 3;
|
||||||
COLLISION_OFF(super);
|
COLLISION_OFF(super);
|
||||||
InitializeAnimation(super, 0x53);
|
InitializeAnimation(super, 0x53);
|
||||||
|
|
|
@ -26,7 +26,7 @@ void GuardLineOfSight(Entity* this) {
|
||||||
this->timer = Random();
|
this->timer = Random();
|
||||||
this->spriteSettings.draw = 0;
|
this->spriteSettings.draw = 0;
|
||||||
}
|
}
|
||||||
if (this->contactFlags == 0x80) {
|
if (this->contactFlags == CONTACT_TAKE_DAMAGE) {
|
||||||
if (this->parent != NULL) {
|
if (this->parent != NULL) {
|
||||||
this->parent->type = 0xff;
|
this->parent->type = 0xff;
|
||||||
}
|
}
|
||||||
|
@ -58,7 +58,7 @@ void GuardLineOfSight(Entity* this) {
|
||||||
this->hitbox = (Hitbox*)&gUnk_080FD1E4;
|
this->hitbox = (Hitbox*)&gUnk_080FD1E4;
|
||||||
InitializeAnimation(this, 0);
|
InitializeAnimation(this, 0);
|
||||||
}
|
}
|
||||||
if (this->contactFlags == 0x80) {
|
if (this->contactFlags == CONTACT_TAKE_DAMAGE) {
|
||||||
if (this->parent != NULL) {
|
if (this->parent != NULL) {
|
||||||
this->parent->type = 0xff;
|
this->parent->type = 0xff;
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,7 @@ void KeatonDagger(Entity* this) {
|
||||||
}
|
}
|
||||||
parent = this->parent;
|
parent = this->parent;
|
||||||
if (((parent == NULL) || (parent->health == 0)) || (parent->next == NULL)) {
|
if (((parent == NULL) || (parent->health == 0)) || (parent->next == NULL)) {
|
||||||
if (((this->contactFlags & 0x80) != 0) && (this->contactedEntity == &gPlayerEntity.base)) {
|
if (((this->contactFlags & CONTACT_TAKE_DAMAGE) != 0) && (this->contactedEntity == &gPlayerEntity.base)) {
|
||||||
sub_0803C0AC(this);
|
sub_0803C0AC(this);
|
||||||
}
|
}
|
||||||
DeleteEntity(this);
|
DeleteEntity(this);
|
||||||
|
|
|
@ -23,7 +23,7 @@ void LakituLightning_OnTick(Entity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void LakituLightning_OnCollision(Entity* this) {
|
void LakituLightning_OnCollision(Entity* this) {
|
||||||
if ((this->health == 0) || (this->contactFlags == 0x80)) {
|
if ((this->health == 0) || (this->contactFlags == CONTACT_TAKE_DAMAGE)) {
|
||||||
DeleteThisEntity();
|
DeleteThisEntity();
|
||||||
}
|
}
|
||||||
LakituLightning_OnTick(this);
|
LakituLightning_OnTick(this);
|
||||||
|
|
|
@ -55,7 +55,7 @@ void MandiblesProjectile_OnTick(MandiblesProjectileEntity* this) {
|
||||||
void MandiblesProjectile_OnCollision(MandiblesProjectileEntity* this) {
|
void MandiblesProjectile_OnCollision(MandiblesProjectileEntity* this) {
|
||||||
Entity* parent;
|
Entity* parent;
|
||||||
|
|
||||||
if ((super->contactFlags & 0x80) != 0) {
|
if ((super->contactFlags & CONTACT_TAKE_DAMAGE) != 0) {
|
||||||
switch (super->action) {
|
switch (super->action) {
|
||||||
case 4:
|
case 4:
|
||||||
super->subtimer = 0;
|
super->subtimer = 0;
|
||||||
|
|
|
@ -38,7 +38,7 @@ void MoblinSpear_OnTick(Entity* this) {
|
||||||
void MoblinSpear_OnCollision(Entity* this) {
|
void MoblinSpear_OnCollision(Entity* this) {
|
||||||
u8 tmp;
|
u8 tmp;
|
||||||
|
|
||||||
if (this->contactFlags == 0x80) {
|
if (this->contactFlags == CONTACT_TAKE_DAMAGE) {
|
||||||
this->iframes = 0x10;
|
this->iframes = 0x10;
|
||||||
this->knockbackDuration = 0xc;
|
this->knockbackDuration = 0xc;
|
||||||
this->knockbackSpeed = 0x180;
|
this->knockbackSpeed = 0x180;
|
||||||
|
|
|
@ -99,7 +99,7 @@ void OctorokBossProjectile_Action1(OctorokBossProjectileEntity* this) {
|
||||||
if (super->parent->action == 2) {
|
if (super->parent->action == 2) {
|
||||||
DeleteThisEntity();
|
DeleteThisEntity();
|
||||||
}
|
}
|
||||||
if ((super->type2 == 0) && ((super->contactFlags & 0x80) != 0)) {
|
if ((super->type2 == 0) && ((super->contactFlags & CONTACT_TAKE_DAMAGE) != 0)) {
|
||||||
if ((super->contactFlags & 0x7f) == 0) {
|
if ((super->contactFlags & 0x7f) == 0) {
|
||||||
OctorokBossProjectile_Action2(this);
|
OctorokBossProjectile_Action2(this);
|
||||||
}
|
}
|
||||||
|
@ -182,7 +182,7 @@ void OctorokBossProjectile_Action1(OctorokBossProjectileEntity* this) {
|
||||||
if (--*(u32*)&this->unk_78 == -1) {
|
if (--*(u32*)&this->unk_78 == -1) {
|
||||||
OctorokBossProjectile_Action2(this);
|
OctorokBossProjectile_Action2(this);
|
||||||
}
|
}
|
||||||
if ((super->contactFlags & 0x80) == 0) {
|
if ((super->contactFlags & CONTACT_TAKE_DAMAGE) == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
OctorokBossProjectile_Action2(this);
|
OctorokBossProjectile_Action2(this);
|
||||||
|
|
|
@ -41,7 +41,7 @@ void Projectile5_OnCollision(Entity* this) {
|
||||||
if ((((Projectile5Entity*)this->parent)->unk_83 & 0x3f) == 3) {
|
if ((((Projectile5Entity*)this->parent)->unk_83 & 0x3f) == 3) {
|
||||||
if (gPlayerState.hurtBlinkSpeed != 0) {
|
if (gPlayerState.hurtBlinkSpeed != 0) {
|
||||||
if (sub_080B1B44(TILE(this->x.HALF.HI, this->y.HALF.HI), gPlayerEntity.base.collisionLayer) == 0) {
|
if (sub_080B1B44(TILE(this->x.HALF.HI, this->y.HALF.HI), gPlayerEntity.base.collisionLayer) == 0) {
|
||||||
if (this->contactFlags == 0x80) {
|
if (this->contactFlags == CONTACT_TAKE_DAMAGE) {
|
||||||
*pbVar2 = *pbVar2 & 0x7f;
|
*pbVar2 = *pbVar2 & 0x7f;
|
||||||
DeleteThisEntity();
|
DeleteThisEntity();
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,7 +51,7 @@ void RemovableDust_OnTick(RemovableDustEntity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void RemovableDust_OnCollision(RemovableDustEntity* this) {
|
void RemovableDust_OnCollision(RemovableDustEntity* this) {
|
||||||
if (super->contactFlags == 0x96) {
|
if (super->contactFlags == (CONTACT_TAKE_DAMAGE | 0x16)) {
|
||||||
RemovableDust_OnGrabbed(this);
|
RemovableDust_OnGrabbed(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@ void RockProjectile_OnTick(Entity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void RockProjectile_OnCollision(Entity* this) {
|
void RockProjectile_OnCollision(Entity* this) {
|
||||||
if (this->contactFlags == 0x80) {
|
if (this->contactFlags == CONTACT_TAKE_DAMAGE) {
|
||||||
DeleteEntity(this);
|
DeleteEntity(this);
|
||||||
} else {
|
} else {
|
||||||
this->direction = this->knockbackDirection;
|
this->direction = this->knockbackDirection;
|
||||||
|
|
|
@ -64,7 +64,7 @@ void SpiderWeb_OnCollision(SpiderWebEntity* this) {
|
||||||
};
|
};
|
||||||
Entity* object;
|
Entity* object;
|
||||||
|
|
||||||
if (super->contactFlags == 0x87) {
|
if (super->contactFlags == (CONTACT_TAKE_DAMAGE | 0x7)) {
|
||||||
super->action = 3;
|
super->action = 3;
|
||||||
super->timer = 90;
|
super->timer = 90;
|
||||||
COLLISION_OFF(super);
|
COLLISION_OFF(super);
|
||||||
|
|
|
@ -35,7 +35,7 @@ void StalfosProjectile_OnTick(Entity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void StalfosProjectile_OnCollision(Entity* this) {
|
void StalfosProjectile_OnCollision(Entity* this) {
|
||||||
if (this->contactFlags == 0x9d) {
|
if (this->contactFlags == (CONTACT_TAKE_DAMAGE | 0x1d)) {
|
||||||
this->action = 3;
|
this->action = 3;
|
||||||
COLLISION_OFF(this);
|
COLLISION_OFF(this);
|
||||||
this->zVelocity = Q_16_16(2.625);
|
this->zVelocity = Q_16_16(2.625);
|
||||||
|
|
|
@ -43,7 +43,7 @@ void V1DarkMagicProjectile_OnTick(V1DarkMagicProjectileEntity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void V1DarkMagicProjectile_OnCollision(V1DarkMagicProjectileEntity* this) {
|
void V1DarkMagicProjectile_OnCollision(V1DarkMagicProjectileEntity* this) {
|
||||||
if ((super->contactFlags & 0x80) != 0) {
|
if ((super->contactFlags & CONTACT_TAKE_DAMAGE) != 0) {
|
||||||
if (super->type2 == 0) {
|
if (super->type2 == 0) {
|
||||||
if ((super->contactFlags & 0x3f) == 0) {
|
if ((super->contactFlags & 0x3f) == 0) {
|
||||||
super->action = 2;
|
super->action = 2;
|
||||||
|
|
|
@ -31,7 +31,7 @@ void V1FireProjectile_OnTick(V1FireProjectileEntity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void V1FireProjectile_OnCollision(V1FireProjectileEntity* this) {
|
void V1FireProjectile_OnCollision(V1FireProjectileEntity* this) {
|
||||||
if ((super->contactFlags & 0x80) != 0) {
|
if ((super->contactFlags & CONTACT_TAKE_DAMAGE) != 0) {
|
||||||
super->action = 3;
|
super->action = 3;
|
||||||
COLLISION_OFF(super);
|
COLLISION_OFF(super);
|
||||||
InitializeAnimation(super, 0x53);
|
InitializeAnimation(super, 0x53);
|
||||||
|
|
|
@ -43,7 +43,7 @@ void V2Projectile_OnTick(V2ProjectileEntity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void V2Projectile_OnCollision(V2ProjectileEntity* this) {
|
void V2Projectile_OnCollision(V2ProjectileEntity* this) {
|
||||||
if ((super->contactFlags & 0x80) == 0)
|
if ((super->contactFlags & CONTACT_TAKE_DAMAGE) == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
switch (super->type) {
|
switch (super->type) {
|
||||||
|
|
Loading…
Reference in New Issue