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
+1 -1
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;
+3 -3
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) {
+2 -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;
}
+1 -1
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:
+1 -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) {
+1 -1
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;
}
+4 -4
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) {
+1 -1
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:
+1 -1
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;
+1 -1
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)
+4 -4
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;
+3 -3
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--;
+2 -2
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);
+2 -2
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);
}
+2 -2
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) {
+4 -4
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;
+4 -4
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);
}
+1 -1
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();
}
+1 -1
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);
+1 -1
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;
}
+1 -1
View File
@@ -342,7 +342,7 @@ void sub_0803CBAC(LakituEntity* this) {
super->spritePriority.b1 = 1;
super->flags2 &= 0x7b;
super->collisionMask &= 0x7b;
super->hitType = 0x42;
+1 -1
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;
}
+5 -5
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;
}
+2 -2
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:
+3 -3
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;
+3 -3
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;
+1 -1
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:
+3 -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;
+3 -3
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;
+1 -1
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;
+2 -2
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);
}
+2 -2
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;
}
+1 -1
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;
+1 -1
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;
+2 -2
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;
+1 -1
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);
}
+1 -1
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);
+3 -3
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;
}
}
+1 -1
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);
+1 -1
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;
+1 -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;
+3 -3
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;
+1 -1
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);
}
+2 -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);
}
+2 -2
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);
+2 -2
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;
}
}
+1 -1
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)) {
+1 -1
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) {
+1 -1
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;
}
+1 -1
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;
+1 -1
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;