summaryrefslogtreecommitdiff
path: root/src/enemy
diff options
context:
space:
mode:
Diffstat (limited to 'src/enemy')
-rw-r--r--src/enemy/acroBandits.c2
-rw-r--r--src/enemy/armos.c10
-rw-r--r--src/enemy/beetle.c4
-rw-r--r--src/enemy/bobomb.c2
-rw-r--r--src/enemy/bowMoblin.c2
-rw-r--r--src/enemy/businessScrub.c4
-rw-r--r--src/enemy/chaser.c2
-rw-r--r--src/enemy/chuchu.c24
-rw-r--r--src/enemy/chuchuBoss.c6
-rw-r--r--src/enemy/cloudPiranha.c2
-rw-r--r--src/enemy/crow.c2
-rw-r--r--src/enemy/darkNut.c3
-rw-r--r--src/enemy/doorMimic.c4
-rw-r--r--src/enemy/enemy50.c8
-rw-r--r--src/enemy/enemy64.c16
-rw-r--r--src/enemy/eyegore.c26
-rw-r--r--src/enemy/flyingPot.c14
-rw-r--r--src/enemy/flyingSkull.c18
-rw-r--r--src/enemy/ghini.c4
-rw-r--r--src/enemy/gibdo.c4
-rw-r--r--src/enemy/gleerok.c4
-rw-r--r--src/enemy/gyorgFemale.c2
-rw-r--r--src/enemy/hangingSeed.c2
-rw-r--r--src/enemy/helmasaur.c4
-rw-r--r--src/enemy/keaton.c2
-rw-r--r--src/enemy/leever.c2
-rw-r--r--src/enemy/likeLike.c4
-rw-r--r--src/enemy/madderpillar.c4
-rw-r--r--src/enemy/mazaalBracelet.c5
-rw-r--r--src/enemy/mazaalMacro.c2
-rw-r--r--src/enemy/moldworm.c6
-rw-r--r--src/enemy/mulldozer.c2
-rw-r--r--src/enemy/octorokGolden.c2
-rw-r--r--src/enemy/peahat.c6
-rw-r--r--src/enemy/pesto.c5
-rw-r--r--src/enemy/rockChuchu.c2
-rw-r--r--src/enemy/rollobite.c6
-rw-r--r--src/enemy/rupeeLike.c2
-rw-r--r--src/enemy/scissorsBeetle.c2
-rw-r--r--src/enemy/spark.c2
-rw-r--r--src/enemy/spearMoblin.c4
-rw-r--r--src/enemy/spinyBeetle.c6
-rw-r--r--src/enemy/spinyChuchu.c2
-rw-r--r--src/enemy/stalfos.c2
-rw-r--r--src/enemy/takkuri.c2
-rw-r--r--src/enemy/tektite.c2
-rw-r--r--src/enemy/tektiteGolden.c2
-rw-r--r--src/enemy/vaatiArm.c6
-rw-r--r--src/enemy/vaatiBall.c2
-rw-r--r--src/enemy/vaatiProjectile.c4
-rw-r--r--src/enemy/vaatiRebornEnemy.c4
-rw-r--r--src/enemy/vaatiTransfigured.c4
-rw-r--r--src/enemy/vaatiTransfiguredEye.c2
-rw-r--r--src/enemy/vaatiWrath.c2
-rw-r--r--src/enemy/wisp.c2
-rw-r--r--src/enemy/wizzrobeFire.c4
-rw-r--r--src/enemy/wizzrobeIce.c6
-rw-r--r--src/enemy/wizzrobeWind.c8
58 files changed, 145 insertions, 142 deletions
diff --git a/src/enemy/acroBandits.c b/src/enemy/acroBandits.c
index ac12c313..73911ecf 100644
--- a/src/enemy/acroBandits.c
+++ b/src/enemy/acroBandits.c
@@ -96,7 +96,7 @@ void AcroBandit_OnTick(AcroBanditEntity* this) {
void AcroBandit_OnCollision(AcroBanditEntity* this) {
Entity* brother;
- if (super->contactFlags != 0x80 && super->contactFlags != 0x81) {
+ if (super->contactFlags != CONTACT_TAKE_DAMAGE && super->contactFlags != (CONTACT_TAKE_DAMAGE | 0x1)) {
if (super->type == 1) {
if (super->action < 7 && super->knockbackDuration != 0) {
brother = super->child;
diff --git a/src/enemy/armos.c b/src/enemy/armos.c
index 2824b950..db597408 100644
--- a/src/enemy/armos.c
+++ b/src/enemy/armos.c
@@ -337,7 +337,7 @@ bool32 sub_080305BC(ArmosEntity* this) {
bool32 sub_08030650(ArmosEntity* this) {
if (super->type == 0) {
- if (super->contactFlags == 0x80) {
+ if (super->contactFlags == CONTACT_TAKE_DAMAGE) {
return 1;
}
} else if (this->unk_80 != 2) {
@@ -403,11 +403,11 @@ void sub_080307D4(ArmosEntity* this) {
void sub_080307EC(ArmosEntity* this) {
u32 position = COORD_TO_TILE(super);
this->unk_78 = GetTileIndex(position, super->collisionLayer);
- SetTile(0x4022, position, (u32)super->collisionLayer);
+ SetBottomTile(0x4022, position, (u32)super->collisionLayer);
}
void sub_08030834(ArmosEntity* this) {
- SetTile(this->unk_78, COORD_TO_TILE(super), super->collisionLayer);
+ SetBottomTile(this->unk_78, COORD_TO_TILE(super), super->collisionLayer);
}
bool32 sub_0803086C(ArmosEntity* this) {
@@ -435,11 +435,11 @@ bool32 sub_0803086C(ArmosEntity* this) {
return TRUE;
}
} else {
- SetTile(0x4022, pos, super->collisionLayer);
+ SetBottomTile(0x4022, pos, super->collisionLayer);
}
} else {
if (CheckPlayerInRegion(centerX, centerY + 6, 2, 5) != 0) {
- SetTile(0x4049, COORD_TO_TILE(super), super->collisionLayer);
+ SetBottomTile(0x4049, COORD_TO_TILE(super), super->collisionLayer);
}
}
}
diff --git a/src/enemy/beetle.c b/src/enemy/beetle.c
index 10263a30..75924746 100644
--- a/src/enemy/beetle.c
+++ b/src/enemy/beetle.c
@@ -35,7 +35,7 @@ void Beetle_OnTick(BeetleEntity* this) {
void Beetle_OnCollision(BeetleEntity* this) {
switch (super->contactFlags) {
- case 0x80:
+ case CONTACT_TAKE_DAMAGE:
if (gPlayerState.framestate == PL_STATE_CLIMB) {
Beetle_OnTick(this);
} else {
@@ -50,7 +50,7 @@ void Beetle_OnCollision(BeetleEntity* this) {
InitializeAnimation(super, 6);
}
break;
- case 0x93:
+ case CONTACT_TAKE_DAMAGE | 0x13:
Beetle_OnTick(this);
break;
}
diff --git a/src/enemy/bobomb.c b/src/enemy/bobomb.c
index f007f779..7dfae72e 100644
--- a/src/enemy/bobomb.c
+++ b/src/enemy/bobomb.c
@@ -38,7 +38,7 @@ void Bobomb_OnTick(BobombEntity* this) {
}
void Bobomb_OnCollision(BobombEntity* this) {
- if (super->contactFlags & 0x80) {
+ if (super->contactFlags & CONTACT_TAKE_DAMAGE) {
switch (super->contactFlags & 0x7f) {
case 0:
case 1:
diff --git a/src/enemy/bowMoblin.c b/src/enemy/bowMoblin.c
index 3a86b016..6a1176ee 100644
--- a/src/enemy/bowMoblin.c
+++ b/src/enemy/bowMoblin.c
@@ -56,7 +56,7 @@ void BowMoblin_OnCollision(BowMoblinEntity* this) {
EnemyCreateFX(super, FX_STARS);
}
EnemyFunctionHandlerAfterCollision(super, (EntityActionArray)BowMoblin_Functions);
- if ((super->contactFlags & 0x80) != 0) {
+ if (super->contactFlags & CONTACT_TAKE_DAMAGE) {
sub_0803C5F0(this);
pEVar1 = super->child;
if (pEVar1 != NULL) {
diff --git a/src/enemy/businessScrub.c b/src/enemy/businessScrub.c
index a770f1d9..5a2f0d9b 100644
--- a/src/enemy/businessScrub.c
+++ b/src/enemy/businessScrub.c
@@ -442,7 +442,7 @@ void sub_08028FFC(BusinessScrubEntity* this) {
super->x.HALF.HI = this->unk_78;
super->y.HALF.HI = this->unk_7a;
InitializeAnimation(super, 0);
- SetTile(0x4022, this->unk_76, super->collisionLayer);
+ SetBottomTile(0x4022, this->unk_76, super->collisionLayer);
}
void sub_08029078(BusinessScrubEntity* this) {
@@ -456,7 +456,7 @@ void sub_08029078(BusinessScrubEntity* this) {
super->spriteIndex = 0xd0;
sub_08028FDC(this);
sub_080290E0(this, 1);
- SetTile(this->unk_74, this->unk_76, super->collisionLayer);
+ SetBottomTile(this->unk_74, this->unk_76, super->collisionLayer);
}
}
diff --git a/src/enemy/chaser.c b/src/enemy/chaser.c
index 9255b1f1..3c374cd4 100644
--- a/src/enemy/chaser.c
+++ b/src/enemy/chaser.c
@@ -43,7 +43,7 @@ void sub_0802B540(Entity* this) {
void sub_0802B56C(Entity* this) {
GetNextFrame(this);
- if (this->contactFlags & 0x80) {
+ if (this->contactFlags & CONTACT_TAKE_DAMAGE) {
this->speed = 0x40;
}
diff --git a/src/enemy/chuchu.c b/src/enemy/chuchu.c
index 41ac71c4..95a08744 100644
--- a/src/enemy/chuchu.c
+++ b/src/enemy/chuchu.c
@@ -34,7 +34,7 @@ void sub_0801FAF8(ChuchuEntity* this);
void sub_0801FB14(ChuchuEntity* this);
void sub_0801FB34(ChuchuEntity* this);
void sub_0801FB68(ChuchuEntity* this);
-u32 sub_0801FBD0(ChuchuEntity* this);
+u32 CheckWaterTile(ChuchuEntity* this);
void Chuchu_JumpAtPlayer(ChuchuEntity* this);
extern void (*const Chuchu_Functions[])(ChuchuEntity*);
@@ -72,7 +72,7 @@ void Chuchu(ChuchuEntity* this) {
/* ... */
break;
case 2:
- sub_080043A8(super);
+ CreateDrownFX(super);
return;
}
}
@@ -196,7 +196,7 @@ void sub_0801F0C8(ChuchuEntity* this) {
}
void sub_0801F12C(ChuchuEntity* this) {
- if (sub_0801FBD0(this)) {
+ if (CheckWaterTile(this)) {
sub_0801F328(this);
} else {
if ((super->subtimer++ & 7) == 0) {
@@ -232,7 +232,7 @@ void sub_0801F1B0(ChuchuEntity* this) {
}
if (super->frame & ANIM_DONE) {
- if (sub_0801FBD0(this)) {
+ if (CheckWaterTile(this)) {
sub_0801F328(this);
} else {
sub_0801F340(this);
@@ -261,7 +261,7 @@ void sub_0801F270(ChuchuEntity* this) {
ProcessMovement5(super);
GetNextFrame(super);
- if (sub_0801FBD0(this))
+ if (CheckWaterTile(this))
return;
if (--super->timer != 0)
@@ -390,7 +390,7 @@ void sub_0801F4EC(ChuchuEntity* this) {
}
void sub_0801F508(ChuchuEntity* this) {
- if (sub_0801FBD0(this)) {
+ if (CheckWaterTile(this)) {
this->unk_83 = 0;
sub_0801F730(this);
} else {
@@ -429,7 +429,7 @@ void sub_0801F584(ChuchuEntity* this) {
}
if (super->frame & ANIM_DONE) {
- if (sub_0801FBD0(this)) {
+ if (CheckWaterTile(this)) {
this->unk_83 = 0;
sub_0801F730(this);
} else {
@@ -464,7 +464,7 @@ void sub_0801F688(ChuchuEntity* this) {
if (this->unk_83)
this->unk_83--;
- if (sub_0801FBD0(this) || this->unk_83) {
+ if (CheckWaterTile(this) || this->unk_83) {
super->direction = sub_08049F84(super, 1);
ProcessMovement5(super);
GetNextFrame(super);
@@ -572,7 +572,7 @@ void sub_0801F884(ChuchuEntity* this) {
}
void sub_0801F8C0(ChuchuEntity* this) {
- if (sub_0801FBD0(this)) {
+ if (CheckWaterTile(this)) {
sub_0801FAE0(this);
} else if (sub_08049FDC(super, 1) == 0) {
sub_0801F730(this);
@@ -605,7 +605,7 @@ void sub_0801F940(ChuchuEntity* this) {
}
if (super->frame & ANIM_DONE) {
- if (sub_0801FBD0(this)) {
+ if (CheckWaterTile(this)) {
sub_0801FAE0(this);
} else {
super->action = 6;
@@ -635,7 +635,7 @@ void sub_0801F9E0(ChuchuEntity* this) {
}
void sub_0801FA30(ChuchuEntity* this) {
- if (sub_0801FBD0(this)) {
+ if (CheckWaterTile(this)) {
super->direction = sub_08049F84(super, 1);
ProcessMovement5(super);
GetNextFrame(super);
@@ -714,7 +714,7 @@ void sub_0801FB68(ChuchuEntity* this) {
super->zVelocity = 0;
}
-u32 sub_0801FBD0(ChuchuEntity* this) {
+u32 CheckWaterTile(ChuchuEntity* this) {
if (GetActTile(super) == 0x10) {
return 1;
} else {
diff --git a/src/enemy/chuchuBoss.c b/src/enemy/chuchuBoss.c
index ca490003..c9ee902c 100644
--- a/src/enemy/chuchuBoss.c
+++ b/src/enemy/chuchuBoss.c
@@ -561,7 +561,7 @@ void sub_080262A8(ChuchuBossEntity* this) {
gPlayerEntity.base.animationState = 0;
gRoomControls.camera_target = super;
gRoomControls.scrollSpeed = 1;
- SetTile(0x4022, 0x2c8, 1);
+ SetBottomTile(0x4022, 0x2c8, 1);
}
}
@@ -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 & 0x80) != 0) {
+ if (super->contactFlags & CONTACT_TAKE_DAMAGE) {
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 & 0x80) == 0) {
+ if ((super->contactFlags & CONTACT_TAKE_DAMAGE) == 0) {
return FALSE;
}
switch (super->contactFlags & 0x7f) {
diff --git a/src/enemy/cloudPiranha.c b/src/enemy/cloudPiranha.c
index 14296cd6..64bf98cc 100644
--- a/src/enemy/cloudPiranha.c
+++ b/src/enemy/cloudPiranha.c
@@ -58,7 +58,7 @@ void CloudPiranha_OnCollision(CloudPiranhaEntity* this) {
EnemyCreateFX(super, FX_STARS);
}
EnemyFunctionHandlerAfterCollision(super, gUnk_080CF4F0);
- if ((super->contactFlags & 0x80) != 0) {
+ if (super->contactFlags & CONTACT_TAKE_DAMAGE) {
if (super->hitType == 0x5a) {
switch (super->contactFlags & 0x3f) {
case 0x14:
diff --git a/src/enemy/crow.c b/src/enemy/crow.c
index 4f0c587b..c540e4ae 100644
--- a/src/enemy/crow.c
+++ b/src/enemy/crow.c
@@ -44,7 +44,7 @@ void Crow_OnTick(CrowEntity* this) {
}
void Crow_OnCollision(CrowEntity* this) {
- if (super->contactFlags & 0x80) {
+ if (super->contactFlags & CONTACT_TAKE_DAMAGE) {
if ((super->contactFlags & 0x3f) == 0) {
COLLISION_OFF(super);
super->subtimer = 16;
diff --git a/src/enemy/darkNut.c b/src/enemy/darkNut.c
index f5d0919e..39820a64 100644
--- a/src/enemy/darkNut.c
+++ b/src/enemy/darkNut.c
@@ -335,7 +335,8 @@ void sub_080210E4(DarkNutEntity* 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);
} else {
if (--this->unk_76 == 0)
diff --git a/src/enemy/doorMimic.c b/src/enemy/doorMimic.c
index 344e284b..b7c57037 100644
--- a/src/enemy/doorMimic.c
+++ b/src/enemy/doorMimic.c
@@ -48,7 +48,7 @@ void DoorMimic_OnCollision(DoorMimicEntity* this) {
}
void DoorMimic_OnDeath(DoorMimicEntity* this) {
- SetTile(this->unk_7c, this->unk_7e, super->collisionLayer);
+ SetBottomTile(this->unk_7c, this->unk_7e, super->collisionLayer);
CreateFx(super, FX_POT_SHATTER, 0);
EnemyDisableRespawn(super);
DeleteThisEntity();
@@ -125,7 +125,7 @@ void sub_080221C0(DoorMimicEntity* this) {
u32 tile = COORD_TO_TILE(super) + gUnk_080B4488[super->type2];
this->unk_7e = tile;
this->unk_7c = GetTileIndex(tile, super->collisionLayer);
- SetTile(gUnk_080CB79C[super->type2], tile, super->collisionLayer);
+ SetBottomTile(gUnk_080CB79C[super->type2], tile, super->collisionLayer);
}
// clang-format off
diff --git a/src/enemy/enemy50.c b/src/enemy/enemy50.c
index 3839aabf..9987ee88 100644
--- a/src/enemy/enemy50.c
+++ b/src/enemy/enemy50.c
@@ -79,15 +79,15 @@ void Enemy50_OnCollision(Enemy50Entity* this) {
sub_08041134(this);
sub_0803F6EC(this);
}
- if (super->hitType == 0x25 && super->contactFlags == 0x80) {
+ if (super->hitType == 0x25 && super->contactFlags == CONTACT_TAKE_DAMAGE) {
super->action = 8;
InitializeAnimation(super, 3);
} else {
- if (super->contactFlags == 0x80) {
+ if (super->contactFlags == CONTACT_TAKE_DAMAGE) {
this->unk_7c = 0x78;
sub_08041128(this);
}
- if (super->contactFlags == 0x9d) {
+ if (super->contactFlags == (CONTACT_TAKE_DAMAGE | 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 == 0x80)) {
+ if ((super->hitType == 0x25) && (super->contactFlags == CONTACT_TAKE_DAMAGE)) {
return TRUE;
} else {
return super->action == 8 || super->action == 9;
diff --git a/src/enemy/enemy64.c b/src/enemy/enemy64.c
index 62bd707b..be47abc9 100644
--- a/src/enemy/enemy64.c
+++ b/src/enemy/enemy64.c
@@ -85,10 +85,10 @@ void Enemy64_Init(Enemy64Entity* this) {
Entity* tail;
if (CheckFlags(0x7c)) {
- SetTile(0x4081, 10, 2);
- SetTile(0x4081, 0x4a, 2);
- SetTile(0x4081, 0x8a, 2);
- SetTile(0x4081, 0xca, 2);
+ SetBottomTile(0x4081, 10, 2);
+ SetBottomTile(0x4081, 0x4a, 2);
+ SetBottomTile(0x4081, 0x8a, 2);
+ SetBottomTile(0x4081, 0xca, 2);
DeleteThisEntity();
} else {
sub_0807B7D8(0x323, 10, 1);
@@ -440,19 +440,19 @@ void Enemy64_Action4_SubAction7(Enemy64Entity* this) {
DeleteThisEntity();
} else if (super->timer == 16) {
sub_0807B7D8(0x36, 0xca, 1);
- SetTile(0x4081, 0xca, 2);
+ SetBottomTile(0x4081, 0xca, 2);
SoundReq(SFX_HEART_GET);
} else if (super->timer == 24) {
sub_0807B7D8(0x36, 0x8a, 1);
- SetTile(0x4081, 0x8a, 2);
+ SetBottomTile(0x4081, 0x8a, 2);
SoundReq(SFX_HEART_GET);
} else if (super->timer == 32) {
sub_0807B7D8(0x36, 0x4a, 1);
- SetTile(0x4081, 0x4a, 2);
+ SetBottomTile(0x4081, 0x4a, 2);
SoundReq(SFX_HEART_GET);
} else if (super->timer == 40) {
sub_0807B7D8(0x36, 10, 1);
- SetTile(0x4081, 10, 2);
+ SetBottomTile(0x4081, 10, 2);
SoundReq(SFX_HEART_GET);
}
}
diff --git a/src/enemy/eyegore.c b/src/enemy/eyegore.c
index 9c8eb9e1..3b4ee58c 100644
--- a/src/enemy/eyegore.c
+++ b/src/enemy/eyegore.c
@@ -82,14 +82,14 @@ void Eyegore_OnTick(EyegoreEntity* this) {
void Eyegore_OnCollision(EyegoreEntity* this) {
u32 tmp;
- if ((super->contactFlags == 0x95) || (super->contactFlags == 0x8e)) {
+ if ((super->contactFlags == (CONTACT_TAKE_DAMAGE | 0x15)) || (super->contactFlags == (CONTACT_TAKE_DAMAGE | 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 == 0x8e) {
+ if (super->contactFlags == (CONTACT_TAKE_DAMAGE | 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 == 0x8e) {
+ if (super->contactFlags == (CONTACT_TAKE_DAMAGE | 0xe)) {
super->health = 0;
} else {
super->health--;
@@ -335,18 +335,18 @@ void sub_08030F00(EyegoreEntity* this) {
this->unk_84 = tileIndex;
tileIndex = GetTileIndex(position + 0x41, super->collisionLayer);
this->unk_86 = tileIndex;
- SetTile(0x4022, position, super->collisionLayer);
- SetTile(0x4022, position + 1, super->collisionLayer);
- SetTile(0x4022, position + 0x40, super->collisionLayer);
- SetTile(0x4022, position + 0x41, super->collisionLayer);
+ SetBottomTile(0x4022, position, super->collisionLayer);
+ SetBottomTile(0x4022, position + 1, super->collisionLayer);
+ SetBottomTile(0x4022, position + 0x40, super->collisionLayer);
+ SetBottomTile(0x4022, position + 0x41, super->collisionLayer);
}
void sub_08030FB4(EyegoreEntity* this) {
u32 position = COORD_TO_TILE_OFFSET(super, 8, 0x14);
- SetTile(this->unk_80, position, super->collisionLayer);
- SetTile(this->unk_82, position + 1, super->collisionLayer);
- SetTile(this->unk_84, position + 0x40, super->collisionLayer);
- SetTile(this->unk_86, position + 0x41, super->collisionLayer);
+ SetBottomTile(this->unk_80, position, super->collisionLayer);
+ SetBottomTile(this->unk_82, position + 1, super->collisionLayer);
+ SetBottomTile(this->unk_84, position + 0x40, super->collisionLayer);
+ SetBottomTile(this->unk_86, position + 0x41, super->collisionLayer);
}
void sub_08031024(EyegoreEntity* this) {
@@ -439,8 +439,8 @@ void sub_08031024(EyegoreEntity* this) {
void sub_08031250(EyegoreEntity* this) {
u32 tmp2;
u32 tmp = (u32)super->animationState * 4;
- sub_08008796(super, 9, super->x.HALF.HI + gUnk_080CE2C0[tmp], super->y.HALF.HI + gUnk_080CE2C0[tmp + 1]);
- sub_08008796(super, 9, super->x.HALF.HI + gUnk_080CE2C0[tmp + 2], super->y.HALF.HI + gUnk_080CE2C0[tmp + 3]);
+ DoTileInteraction(super, 9, super->x.HALF.HI + gUnk_080CE2C0[tmp], super->y.HALF.HI + gUnk_080CE2C0[tmp + 1]);
+ DoTileInteraction(super, 9, super->x.HALF.HI + gUnk_080CE2C0[tmp + 2], super->y.HALF.HI + gUnk_080CE2C0[tmp + 3]);
if (this->unk_79 != 0) {
tmp2 = 0;
if ((super->x.HALF.HI - (u32)this->unk_74) + 2 < 5) {
diff --git a/src/enemy/flyingPot.c b/src/enemy/flyingPot.c
index 8c4159d4..cc868bc0 100644
--- a/src/enemy/flyingPot.c
+++ b/src/enemy/flyingPot.c
@@ -93,13 +93,13 @@ void FlyingPot_OnTick(FlyingPotEntity* this) {
void FlyingPot_OnCollision(FlyingPotEntity* this) {
sub_08037418(this);
- if (super->contactFlags == 0x9D) {
+ if (super->contactFlags == (CONTACT_TAKE_DAMAGE | 0x1d)) {
super->action = FLYING_POT_ACTION_6;
COLLISION_OFF(super);
super->zVelocity = Q_16_16(2.625);
super->spritePriority.b1 = 1;
- SetTile(this->tileIndex, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer);
+ SetBottomTile(this->tileIndex, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer);
} else if (super->z.HALF.HI != 0) {
sub_08037408(this);
}
@@ -145,7 +145,7 @@ void FlyingPot_SubAction2(FlyingPotEntity* this) {
COLLISION_OFF(super);
super->spriteOffsetX = 0;
- SetTile(this->tileIndex, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer);
+ SetBottomTile(this->tileIndex, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer);
}
if (sub_0806F520(super)) {
@@ -177,7 +177,7 @@ void FlyingPot_Init(FlyingPotEntity* this) {
tile = TILE(super->x.HALF.HI, super->y.HALF.HI);
this->tileIndex = GetTileIndex(tile, super->collisionLayer);
- SetTile(0x4000, tile, super->collisionLayer);
+ SetBottomTile(0x4000, tile, super->collisionLayer);
InitializeAnimation(super, 5);
}
@@ -185,7 +185,7 @@ void FlyingPot_Action1(FlyingPotEntity* this) {
sub_08037418(this);
if (GetTileTypeByEntity(super) != 0x4000) {
- SetTile(this->tileIndex, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer);
+ SetBottomTile(this->tileIndex, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer);
sub_08037408(this);
}
@@ -210,7 +210,7 @@ void FlyingPot_Action2(FlyingPotEntity* this) {
super->flags2 = 0xF;
super->hitbox = &gUnk_080FD34C;
- SetTile(this->tileIndex, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer);
+ SetBottomTile(this->tileIndex, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer);
}
}
@@ -257,7 +257,7 @@ void sub_08037418(FlyingPotEntity* this) {
u32 tile = COORD_TO_TILE(super);
if (GetTileIndex(tile, super->collisionLayer) == 0x4067) {
- SetTile(this->tileIndex, tile, super->collisionLayer);
+ SetBottomTile(this->tileIndex, tile, super->collisionLayer);
DeleteThisEntity();
}
}
diff --git a/src/enemy/flyingSkull.c b/src/enemy/flyingSkull.c
index 17c46040..23ba5c87 100644
--- a/src/enemy/flyingSkull.c
+++ b/src/enemy/flyingSkull.c
@@ -45,12 +45,12 @@ void FlyingSkull_OnTick(FlyingSkullEntity* this) {
void FlyingSkull_OnCollision(FlyingSkullEntity* this) {
sub_0803A100(this);
- if (super->contactFlags == 0x9d) {
+ if (super->contactFlags == (CONTACT_TAKE_DAMAGE | 0x1d)) {
super->action = 7;
COLLISION_OFF(super);
super->zVelocity = Q_16_16(2.625);
super->spritePriority.b1 = 1;
- SetTile(this->unk_0x74, COORD_TO_TILE(super), super->collisionLayer);
+ SetBottomTile(this->unk_0x74, COORD_TO_TILE(super), super->collisionLayer);
} else if (super->z.HALF.HI) {
sub_0803A0E0(this);
}
@@ -89,7 +89,7 @@ void sub_08039CE0(FlyingSkullEntity* this) {
super->timer = 1;
super->z.HALF.HI = -1;
super->spriteOffsetX = 0;
- SetTile(this->unk_0x74, COORD_TO_TILE(super), super->collisionLayer);
+ SetBottomTile(this->unk_0x74, COORD_TO_TILE(super), super->collisionLayer);
}
if (sub_0806F520(super)) {
@@ -121,7 +121,7 @@ void sub_08039D74(FlyingSkullEntity* this) {
tmp = COORD_TO_TILE(super);
this->unk_0x74 = GetTileIndex(tmp, super->collisionLayer);
- SetTile(0x4060, tmp, super->collisionLayer);
+ SetBottomTile(0x4060, tmp, super->collisionLayer);
InitializeAnimation(super, 0);
}
@@ -130,7 +130,7 @@ void sub_08039DD8(FlyingSkullEntity* this) {
if (super->type == 0) {
if (GetTileTypeByEntity(super) == 0x4073) {
- SetTile(this->unk_0x74, COORD_TO_TILE(super), super->collisionLayer);
+ SetBottomTile(this->unk_0x74, COORD_TO_TILE(super), super->collisionLayer);
sub_0803A0E0(this);
}
@@ -147,7 +147,7 @@ void sub_08039DD8(FlyingSkullEntity* this) {
if (player != NULL) {
player->type2 = 1;
CopyPosition(super, player);
- SetTile(this->unk_0x74, COORD_TO_TILE(super), super->collisionLayer);
+ SetBottomTile(this->unk_0x74, COORD_TO_TILE(super), super->collisionLayer);
DeleteEntity(super);
}
}
@@ -167,7 +167,7 @@ void sub_08039EE4(FlyingSkullEntity* this) {
super->hitbox = (Hitbox*)&gUnk_080FD340;
gPlayerEntity.base.animationState;
this->unk_0x76 = gPlayerEntity.base.animationState;
- SetTile(this->unk_0x74, COORD_TO_TILE(super), super->collisionLayer);
+ SetBottomTile(this->unk_0x74, COORD_TO_TILE(super), super->collisionLayer);
}
void sub_08039F4C(FlyingSkullEntity* this) {
@@ -200,7 +200,7 @@ void sub_08039FAC(FlyingSkullEntity* this) {
super->hitType = 0xa0;
super->flags2 = 0xf;
super->hitbox = (Hitbox*)&gUnk_080FD34C;
- SetTile(this->unk_0x74, COORD_TO_TILE(super), super->collisionLayer);
+ SetBottomTile(this->unk_0x74, COORD_TO_TILE(super), super->collisionLayer);
}
}
@@ -249,7 +249,7 @@ void sub_0803A0E0(FlyingSkullEntity* this) {
void sub_0803A100(FlyingSkullEntity* this) {
u32 tile = COORD_TO_TILE(super);
if (GetTileIndex(tile, super->collisionLayer) == 0x4067) {
- SetTile(this->unk_0x74, tile, super->collisionLayer);
+ SetBottomTile(this->unk_0x74, tile, super->collisionLayer);
DeleteThisEntity();
}
}
diff --git a/src/enemy/ghini.c b/src/enemy/ghini.c
index e49b8293..87a9c402 100644
--- a/src/enemy/ghini.c
+++ b/src/enemy/ghini.c
@@ -59,11 +59,11 @@ void Ghini_OnCollision(GhiniEntity* this) {
sub_0803F630(this);
sub_0803F6EC(this);
}
- if ((super->hitType == 0x25) && (super->contactFlags == 0x80)) {
+ if ((super->hitType == 0x25) && (super->contactFlags == CONTACT_TAKE_DAMAGE)) {
super->action = 8;
InitializeAnimation(super, 3);
} else {
- if (super->contactFlags == 0x9d) {
+ if (super->contactFlags == (CONTACT_TAKE_DAMAGE | 0x1d)) {
super->zVelocity = 0x18000;
}
if (super->confusedTime != 0) {
diff --git a/src/enemy/gibdo.c b/src/enemy/gibdo.c
index 5da67ddf..0f521e14 100644
--- a/src/enemy/gibdo.c
+++ b/src/enemy/gibdo.c
@@ -52,7 +52,7 @@ void Gibdo_OnTick(GibdoEntity* this) {
}
void Gibdo_OnCollision(GibdoEntity* this) {
- if (super->contactFlags == 0x87) {
+ if (super->contactFlags == (CONTACT_TAKE_DAMAGE | 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 == 0x80) {
+ if (super->hitType == 0x27 && super->contactFlags == CONTACT_TAKE_DAMAGE) {
sub_08037A14(this);
} else {
if ((u8)(super->action - 1) < 2) {
diff --git a/src/enemy/gleerok.c b/src/enemy/gleerok.c
index dfbbd62c..9eb430b9 100644
--- a/src/enemy/gleerok.c
+++ b/src/enemy/gleerok.c
@@ -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) {
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 & 0x80) {
+ if (super->contactFlags & CONTACT_TAKE_DAMAGE) {
if (super->iframes > 0) {
SoundReq(SFX_BOSS_HIT);
}
diff --git a/src/enemy/gyorgFemale.c b/src/enemy/gyorgFemale.c
index fbc0a222..baa1105b 100644
--- a/src/enemy/gyorgFemale.c
+++ b/src/enemy/gyorgFemale.c
@@ -250,7 +250,7 @@ void sub_080464C0(GyorgFemaleEntity* this) {
void sub_08046518(void) {
u16* ptr = gMapTop.metatileTypes;
u16* sl = &gMapTop.mapData[sub_08046518_offset];
- u16* stack1 = &gMapTop.mapDataClone[sub_08046518_offset];
+ u16* stack1 = &gMapTop.mapDataOriginal[sub_08046518_offset];
u8* stack2 = &gMapTop.unkData3[sub_08046518_offset];
u8* r6 = &gMapTop.collisionData[sub_08046518_offset];
u32 i;
diff --git a/src/enemy/hangingSeed.c b/src/enemy/hangingSeed.c
index 1a383efb..dfdcae96 100644
--- a/src/enemy/hangingSeed.c
+++ b/src/enemy/hangingSeed.c
@@ -20,7 +20,7 @@ void HangingSeed_OnTick(Entity* this) {
}
void HangingSeed_OnCollision(Entity* this) {
- if (this->contactFlags & 0x80) {
+ if (this->contactFlags & CONTACT_TAKE_DAMAGE) {
CreateFx(this, FX_BUSH, 0x80);
DeleteThisEntity();
}
diff --git a/src/enemy/helmasaur.c b/src/enemy/helmasaur.c
index 4a43753e..ab1437cc 100644
--- a/src/enemy/helmasaur.c
+++ b/src/enemy/helmasaur.c
@@ -373,8 +373,8 @@ void sub_0802C1C0(HelmasaurEntity* this) {
void sub_0802C1CC(HelmasaurEntity* this) {
const s8* ptr = &gUnk_080CD464[super->animationState << 2];
- sub_08008796(super, 9, super->x.HALF.HI + ptr[0], super->y.HALF.HI + ptr[1]);
- sub_08008796(super, 9, super->x.HALF.HI + ptr[2], super->y.HALF.HI + ptr[3]);
+ DoTileInteraction(super, 9, super->x.HALF.HI + ptr[0], super->y.HALF.HI + ptr[1]);
+ DoTileInteraction(super, 9, super->x.HALF.HI + ptr[2], super->y.HALF.HI + ptr[3]);
}
void sub_0802C218(HelmasaurEntity* this) {
diff --git a/src/enemy/keaton.c b/src/enemy/keaton.c
index d499adad..348d7e25 100644
--- a/src/enemy/keaton.c
+++ b/src/enemy/keaton.c
@@ -143,7 +143,7 @@ void Keaton_Action3(KeatonEntity* this) {
}
void Keaton_Action4(KeatonEntity* this) {
- if (super->child && (super->child->contactFlags & 0x80)) {
+ if (super->child && (super->child->contactFlags & CONTACT_TAKE_DAMAGE)) {
sub_0803275C(this);
return;
}
diff --git a/src/enemy/leever.c b/src/enemy/leever.c
index 3f8937b3..4bdc4253 100644
--- a/src/enemy/leever.c
+++ b/src/enemy/leever.c
@@ -47,7 +47,7 @@ void Leever_OnTick(LeeverEntity* this) {
}
void Leever_OnCollision(LeeverEntity* this) {
- if (super->contactFlags == 0x80) {
+ if (super->contactFlags == CONTACT_TAKE_DAMAGE) {
if (super->action == 3) {
this->unk_74 = 1;
}
diff --git a/src/enemy/likeLike.c b/src/enemy/likeLike.c
index 85919220..373953f6 100644
--- a/src/enemy/likeLike.c
+++ b/src/enemy/likeLike.c
@@ -46,8 +46,8 @@ void LikeLike_OnCollision(LikeLikeEntity* this) {
} else {
if (super->action == 7) {
LikeLike_ReleasePlayer(this);
- } else if (super->contactFlags & 0x80) {
- u8 tmp = super->contactFlags & ~0x80;
+ } else if (super->contactFlags & CONTACT_TAKE_DAMAGE) {
+ u8 tmp = super->contactFlags & ~CONTACT_TAKE_DAMAGE;
if (tmp == 0) {
super->action = 7;
super->timer = 95;
diff --git a/src/enemy/madderpillar.c b/src/enemy/madderpillar.c
index 4dda2643..39d929c9 100644
--- a/src/enemy/madderpillar.c
+++ b/src/enemy/madderpillar.c
@@ -518,7 +518,7 @@ void sub_0802A098(MadderpillarEntity* this) {
void sub_0802A0F8(MadderpillarEntity* this) {
if (super->health != 0) {
- if ((super->contactFlags & 0x80) && super->iframes != 0) {
+ if ((super->contactFlags & CONTACT_TAKE_DAMAGE) && 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 & 0x80) {
+ if (super->contactFlags & CONTACT_TAKE_DAMAGE) {
switch (super->contactFlags & 0x7f) {
case 0:
case 1:
diff --git a/src/enemy/mazaalBracelet.c b/src/enemy/mazaalBracelet.c
index c2afcae9..15e84846 100644
--- a/src/enemy/mazaalBracelet.c
+++ b/src/enemy/mazaalBracelet.c
@@ -167,7 +167,8 @@ void MazaalBracelet_OnCollision(MazaalBraceletEntity* this) {
if (super->type < 2) {
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;
COLLISION_OFF(super);
entity = (MazaalBraceletEntity*)super->parent;
@@ -1299,7 +1300,7 @@ u32 sub_0803B870(MazaalBraceletEntity* this) {
Entity* entity;
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->timer = 68;
super->spriteSettings.draw = 0;
diff --git a/src/enemy/mazaalMacro.c b/src/enemy/mazaalMacro.c
index a404cbdc..ef417421 100644
--- a/src/enemy/mazaalMacro.c
+++ b/src/enemy/mazaalMacro.c
@@ -96,7 +96,7 @@ void sub_08034CC4(MazaalMacroEntity* this) {
this->unk_78 = 0x4b0;
sub_08034F70(this);
InitializeAnimation(super, super->type);
- SetTile(0x4022, COORD_TO_TILE(super), super->collisionLayer);
+ SetBottomTile(0x4022, COORD_TO_TILE(super), super->collisionLayer);
entity = CreateEnemy(MAZAAL_MACRO, 2);
if (entity != NULL) {
super->child = entity;
diff --git a/src/enemy/moldworm.c b/src/enemy/moldworm.c
index acb85509..ef1650f7 100644
--- a/src/enemy/moldworm.c
+++ b/src/enemy/moldworm.c
@@ -101,7 +101,7 @@ void Moldworm_OnCollision(MoldwormEntity* this) {
super->iframes = -8;
this->unk_7f = 0;
this->unk_7b = 0;
- if (super->contactFlags == 0x80 || super->contactFlags == 0x9e) {
+ if (super->contactFlags == CONTACT_TAKE_DAMAGE || super->contactFlags == (CONTACT_TAKE_DAMAGE | 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 & 0x80) {
+ if (super->contactFlags & CONTACT_TAKE_DAMAGE) {
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 & 0x80) {
+ if (ent->contactFlags & CONTACT_TAKE_DAMAGE) {
u8 bVar2 = 0xff - ent->health;
if (bVar2 != 0) {
u32 tmp;
diff --git a/src/enemy/mulldozer.c b/src/enemy/mulldozer.c
index b9911272..8af9198a 100644
--- a/src/enemy/mulldozer.c
+++ b/src/enemy/mulldozer.c
@@ -55,7 +55,7 @@ void Mulldozer_OnCollision(MulldozerEntity* this) {
EnemyCreateFX(super, 0x1c);
}
EnemyFunctionHandlerAfterCollision(super, Mulldozer_Functions);
- if ((super->contactFlags & 0x80) != 0) {
+ if ((super->contactFlags & CONTACT_TAKE_DAMAGE) != 0) {
switch (super->contactFlags & 0x3f) {
case 2:
case 3:
diff --git a/src/enemy/octorokGolden.c b/src/enemy/octorokGolden.c
index 82bb3c8f..0d6e6ddf 100644
--- a/src/enemy/octorokGolden.c
+++ b/src/enemy/octorokGolden.c
@@ -117,7 +117,7 @@ void sub_08037E14(Entity* this) {
s32 x, y;
this->timer = 8;
dir = (GetFacingDirection(this, &gPlayerEntity.base) + 4) & 0x18;
- layer = (u8*)GetLayerByIndex(this->collisionLayer)->collisionData;
+ layer = (u8*)GetTileBuffer(this->collisionLayer)->collisionData;
ptr = gUnk_080CF498 + (dir >> 2);
x = this->x.HALF.HI + *ptr;
y = this->y.HALF.HI + *(ptr + 1);
diff --git a/src/enemy/peahat.c b/src/enemy/peahat.c
index d4c0e3d8..c3250c60 100644
--- a/src/enemy/peahat.c
+++ b/src/enemy/peahat.c
@@ -61,7 +61,7 @@ void Peahat_OnTick(PeahatEntity* this) {
void Peahat_OnCollision(PeahatEntity* this) {
if (this->unk_82) {
- if (super->contactFlags == 0x94) {
+ if (super->contactFlags == (CONTACT_TAKE_DAMAGE | 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 == 0x9b) {
+ } else if (super->contactFlags == (CONTACT_TAKE_DAMAGE | 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 == 0x80) {
+ } else if (super->contactFlags == CONTACT_TAKE_DAMAGE) {
if (super->animationState == PeahatAnimation_Flying) {
super->action = 1;
super->timer = 30;
diff --git a/src/enemy/pesto.c b/src/enemy/pesto.c
index b3f6cfdc..e386d4b6 100644
--- a/src/enemy/pesto.c
+++ b/src/enemy/pesto.c
@@ -65,7 +65,7 @@ void Pesto_OnTick(PestoEntity* this) {
void Pesto_OnCollision(PestoEntity* this) {
if (super->hitType != 0x6e) {
- if (super->contactFlags == 0x80) {
+ if (super->contactFlags == CONTACT_TAKE_DAMAGE) {
this->unk_86 = 0x30;
if ((this->unk_83 & 0xf) == 3 && super->action == 6) {
@@ -446,7 +446,8 @@ void sub_080244E8(PestoEntity* this) {
super->timer = 12;
this->unk_83 &= ~0x80;
entity = super->child;
- SetTile(((PestoEntity*)entity)->unk_70, COORD_TO_TILE(entity), entity->collisionLayer);
+ SetBottomTile(((PestoEntity*)entity)->unk_70, COORD_TO_TILE(entity),
+ entity->collisionLayer);
DeleteEntity(entity);
super->z.HALF.HI -= 0xe;
this->unk_78 -= 0xe;
diff --git a/src/enemy/rockChuchu.c b/src/enemy/rockChuchu.c
index f6eba66d..4b760d66 100644
--- a/src/enemy/rockChuchu.c
+++ b/src/enemy/rockChuchu.c
@@ -100,7 +100,7 @@ void sub_080223E4(Entity* this) {
entity = this->child;
if (entity != NULL) {
- entity->contactFlags = 0x94;
+ entity->contactFlags = (CONTACT_TAKE_DAMAGE | 0x14);
entity->iframes = 0x10;
#ifndef EU
entity->knockbackDuration = 0xc;
diff --git a/src/enemy/rollobite.c b/src/enemy/rollobite.c
index 7d297f8d..db6233e1 100644
--- a/src/enemy/rollobite.c
+++ b/src/enemy/rollobite.c
@@ -51,7 +51,7 @@ void Rollobite_OnCollision(RollobiteEntity* this) {
InitializeAnimation(super, super->animationState + 8);
}
- if (super->contactFlags != 0x80) {
+ if (super->contactFlags != CONTACT_TAKE_DAMAGE) {
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 == 0x93)
+ if (super->contactFlags == (CONTACT_TAKE_DAMAGE | 0x13))
Rollobite_OnTick(this);
}
@@ -276,7 +276,7 @@ bool32 Rollobite_TryToHoleUp(RollobiteEntity* this) {
super->y.HALF.HI += 13;
super->zVelocity = Q_16_16(2.0);
InitializeAnimation(super, super->animationState + 0x14);
- SetTile(0x4034, tile, super->collisionLayer);
+ SetBottomTile(0x4034, tile, super->collisionLayer);
return TRUE;
}
}
diff --git a/src/enemy/rupeeLike.c b/src/enemy/rupeeLike.c
index 4831bf3b..7ebff811 100644
--- a/src/enemy/rupeeLike.c
+++ b/src/enemy/rupeeLike.c
@@ -40,7 +40,7 @@ void RupeeLike(RupeeLikeEntity* this) {
u32 uVar1;
if (super->type2 == 0) {
- uVar1 = (u8)sub_080043E8(super);
+ uVar1 = (u8)GetTileHazardType(super);
if (uVar1 != 0) {
if (super->action == 4) {
sub_080296D8(this);
diff --git a/src/enemy/scissorsBeetle.c b/src/enemy/scissorsBeetle.c
index 34aca2b2..bbd7f223 100644
--- a/src/enemy/scissorsBeetle.c
+++ b/src/enemy/scissorsBeetle.c
@@ -44,7 +44,7 @@ void ScissorsBeetle_OnCollision(ScissorsBeetleEntity* this) {
}
EnemyFunctionHandlerAfterCollision(super, ScissorsBeetle_Functions);
- if ((super->contactFlags & 0x80) && super->action != 4) {
+ if ((super->contactFlags & CONTACT_TAKE_DAMAGE) && super->action != 4) {
u32 knockbackDir;
child = super->child;
child->iframes = super->iframes;
diff --git a/src/enemy/spark.c b/src/enemy/spark.c
index e135424b..7006c8b9 100644
--- a/src/enemy/spark.c
+++ b/src/enemy/spark.c
@@ -22,7 +22,7 @@ void Spark_OnTick(Entity* this) {
void Spark_OnCollision(Entity* this) {
Entity* entity;
- if (this->contactFlags & 0x80) {
+ if (this->contactFlags & CONTACT_TAKE_DAMAGE) {
if ((this->contactFlags & 0x7f) == 0x14) {
COLLISION_OFF(this);
this->iframes = 0;
diff --git a/src/enemy/spearMoblin.c b/src/enemy/spearMoblin.c
index ac61f57e..97d5850b 100644
--- a/src/enemy/spearMoblin.c
+++ b/src/enemy/spearMoblin.c
@@ -57,7 +57,7 @@ void SpearMoblin_OnCollision(SpearMoblinEntity* this) {
EnemyCreateFX(super, FX_STARS);
EnemyFunctionHandlerAfterCollision(super, SpearMoblin_Functions);
- if (super->contactFlags & 0x80) {
+ if (super->contactFlags & CONTACT_TAKE_DAMAGE) {
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 & 0x80)) {
+ if ((entity != NULL) && (entity->contactFlags & CONTACT_TAKE_DAMAGE)) {
super->knockbackDirection = entity->knockbackDirection;
super->iframes = -entity->iframes;
super->knockbackSpeed = entity->knockbackSpeed;
diff --git a/src/enemy/spinyBeetle.c b/src/enemy/spinyBeetle.c
index ebaa6322..297b3b51 100644
--- a/src/enemy/spinyBeetle.c
+++ b/src/enemy/spinyBeetle.c
@@ -49,7 +49,7 @@ void SpinyBeetle_OnCollision(SpinyBeetleEntity* this) {
}
EnemyFunctionHandlerAfterCollision(super, SpinyBeetle_Functions);
- if (super->contactFlags & 0x80) {
+ if (super->contactFlags & CONTACT_TAKE_DAMAGE) {
if (super->iframes > 0 && super->child) {
sub_08033E1C(this);
}
@@ -94,7 +94,7 @@ void SpinyBeetle_Init(SpinyBeetleEntity* this) {
this->unk_7b = 0;
this->tile = COORD_TO_TILE(super);
this->tileIndex = GetTileIndex(this->tile, super->collisionLayer);
- SetTile(0x4022, this->tile, super->collisionLayer);
+ SetBottomTile(0x4022, this->tile, super->collisionLayer);
obj = CreateObject(OBJECT_ON_BEETLE, super->type, 0);
if (obj == NULL) {
@@ -259,7 +259,7 @@ void sub_08033B44(SpinyBeetleEntity* this) {
}
}
- SetTile(0x4022, this->tile, super->collisionLayer);
+ SetBottomTile(0x4022, this->tile, super->collisionLayer);
InitializeAnimation(super, 0);
}
diff --git a/src/enemy/spinyChuchu.c b/src/enemy/spinyChuchu.c
index 0028054f..d736b8e0 100644
--- a/src/enemy/spinyChuchu.c
+++ b/src/enemy/spinyChuchu.c
@@ -60,7 +60,7 @@ void SpinyChuchu_OnCollision(SpinyChuchuEntity* this) {
super->hitType = 0x5c;
InitializeAnimation(super, 1);
}
- } else if (super->contactFlags == 0x94) {
+ } else if (super->contactFlags == (CONTACT_TAKE_DAMAGE | 0x14)) {
EnemyCreateFX(super, FX_STARS);
super->action = 5;
InitializeAnimation(super, 1);
diff --git a/src/enemy/stalfos.c b/src/enemy/stalfos.c
index 6c86aa18..b4a26dfb 100644
--- a/src/enemy/stalfos.c
+++ b/src/enemy/stalfos.c
@@ -437,7 +437,7 @@ void sub_08039AD4(StalfosEntity* this) {
super->action = 0xb;
super->child = projectile;
InitAnimationForceUpdate(super, super->animationState + 0x18);
- SetTile(0x4067, position, super->collisionLayer);
+ SetBottomTile(0x4067, position, super->collisionLayer);
return;
}
}
diff --git a/src/enemy/takkuri.c b/src/enemy/takkuri.c
index 20dd168a..38aa602f 100644
--- a/src/enemy/takkuri.c
+++ b/src/enemy/takkuri.c
@@ -46,7 +46,7 @@ void Takkuri_OnTick(TakkuriEntity* this) {
}
void Takkuri_OnCollision(TakkuriEntity* this) {
- if (super->contactFlags & 0x80) {
+ if (super->contactFlags & CONTACT_TAKE_DAMAGE) {
if ((super->contactFlags & 0x7f) == 0) {
u32 direction;
sub_0803C0AC(super);
diff --git a/src/enemy/tektite.c b/src/enemy/tektite.c
index 803ebd47..0cc625b3 100644
--- a/src/enemy/tektite.c
+++ b/src/enemy/tektite.c
@@ -63,7 +63,7 @@ void Tektite_OnCollision(TektiteEntity* this) {
EnemyCreateFX(super, FX_STARS);
}
EnemyFunctionHandlerAfterCollision(super, Tektite_Functions);
- if ((super->contactFlags & 0x80) != 0) {
+ if ((super->contactFlags & CONTACT_TAKE_DAMAGE) != 0) {
switch (super->contactFlags & 0x3f) {
case 0x14:
super->action = 1;
diff --git a/src/enemy/tektiteGolden.c b/src/enemy/tektiteGolden.c
index 22184e0d..c6af233a 100644
--- a/src/enemy/tektiteGolden.c
+++ b/src/enemy/tektiteGolden.c
@@ -51,7 +51,7 @@ void TektiteGolden_OnCollision(TektiteGoldenEntity* this) {
EnemyCreateFX(super, FX_STARS);
}
EnemyFunctionHandlerAfterCollision(super, TektiteGolden_Functions);
- if (super->contactFlags == 0x94) {
+ if (super->contactFlags == (CONTACT_TAKE_DAMAGE | 0x14)) {
super->action = 1;
super->subAction = 0;
super->timer = 20;
diff --git a/src/enemy/vaatiArm.c b/src/enemy/vaatiArm.c
index 65ace01e..b94db4e5 100644
--- a/src/enemy/vaatiArm.c
+++ b/src/enemy/vaatiArm.c
@@ -1401,7 +1401,7 @@ static void sub_08043C40(VaatiArmEntity* this, VaatiArm_HeapStruct1* heapStruct)
static bool32 sub_08043C98(VaatiArmEntity* this) {
#if defined EU || defined JP
Entity* e1 = &((VaatiArm_HeapStruct*)super->myHeap)->entities[3]->base;
- if ((e1->contactFlags == 0x9d)) {
+ if ((e1->contactFlags == (CONTACT_TAKE_DAMAGE | 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 == 0x9d) || (e2->contactFlags == 0x9d)) {
+ if ((e1->contactFlags == (CONTACT_TAKE_DAMAGE | 0x1d)) || (e2->contactFlags == (CONTACT_TAKE_DAMAGE | 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 == 0x9d) {
+ if (((VaatiArm_HeapStruct*)super->myHeap)->entities[i]->base.contactFlags == (CONTACT_TAKE_DAMAGE | 0x1d)) {
this->unk_7c = 0x78;
this->unk_7d = i;
return;
diff --git a/src/enemy/vaatiBall.c b/src/enemy/vaatiBall.c
index 485749b5..a32eb624 100644
--- a/src/enemy/vaatiBall.c
+++ b/src/enemy/vaatiBall.c
@@ -58,7 +58,7 @@ void VaatiBall(VaatiBallEntity* this) {
super->health = -1;
}
- if (super->contactFlags & 0x80) {
+ if (super->contactFlags & CONTACT_TAKE_DAMAGE) {
if ((super->contactFlags & 0x3f) == 0 && super->action == 6) {
ModHealth(-2);
}
diff --git a/src/enemy/vaatiProjectile.c b/src/enemy/vaatiProjectile.c
index a202f9a3..3df5abe6 100644
--- a/src/enemy/vaatiProjectile.c
+++ b/src/enemy/vaatiProjectile.c
@@ -66,7 +66,7 @@ void VaatiProjectile_OnTick(VaatiProjectileEntity* this) {
void VaatiProjectile_OnCollision(VaatiProjectileEntity* this) {
Entity* entity;
- if (super->contactFlags == 0x80) {
+ if (super->contactFlags == CONTACT_TAKE_DAMAGE) {
#ifndef EU
if (super->health != 0) {
#endif
@@ -285,6 +285,6 @@ void sub_0803E4D8(VaatiProjectileEntity* this) {
tile = TILE(super->x.HALF.HI, super->y.HALF.HI + 8);
if (sub_080B1B44(tile, gPlayerEntity.base.collisionLayer) != 0xff) {
- SetTile(0x4074, tile, gPlayerEntity.base.collisionLayer);
+ SetBottomTile(0x4074, tile, gPlayerEntity.base.collisionLayer);
}
}
diff --git a/src/enemy/vaatiRebornEnemy.c b/src/enemy/vaatiRebornEnemy.c
index 83fcbc65..28586549 100644
--- a/src/enemy/vaatiRebornEnemy.c
+++ b/src/enemy/vaatiRebornEnemy.c
@@ -539,7 +539,7 @@ void VaatiRebornEnemyType1Action1(VaatiRebornEnemyEntity* this) {
super->hitType = 0x2f;
InitAnimationForceUpdate(super, this->unk_74);
} else {
- if (((super->contactFlags & 0x80) != 0) && (0 < super->iframes)) {
+ if (((super->contactFlags & CONTACT_TAKE_DAMAGE) != 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 & 0x80) != 0) {
+ if ((super->contactFlags & CONTACT_TAKE_DAMAGE) != 0) {
if (gUnk_080D04D0[((VaatiRebornEnemyEntity*)parent)->unk_86] > super->health) {
if (2 < ++((VaatiRebornEnemyEntity*)parent)->unk_86) {
COLLISION_OFF(super);
diff --git a/src/enemy/vaatiTransfigured.c b/src/enemy/vaatiTransfigured.c
index e04bd547..9d8f7158 100644
--- a/src/enemy/vaatiTransfigured.c
+++ b/src/enemy/vaatiTransfigured.c
@@ -1097,11 +1097,11 @@ void sub_080409B0(VaatiTransfiguredEntity* this) {
Knockback1(super);
}
} else {
- if (((super->contactFlags & 0x80) != 0) && (0 < super->iframes)) {
+ if (((super->contactFlags & CONTACT_TAKE_DAMAGE) != 0) && (0 < super->iframes)) {
InitScreenShake(12, 1);
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;
}
}
diff --git a/src/enemy/vaatiTransfiguredEye.c b/src/enemy/vaatiTransfiguredEye.c
index e417c2fd..74e0a522 100644
--- a/src/enemy/vaatiTransfiguredEye.c
+++ b/src/enemy/vaatiTransfiguredEye.c
@@ -72,7 +72,7 @@ void VaatiTransfiguredEye_OnCollision(VaatiTransfiguredEyeEntity* this) {
if (super->type != 0) {
pEVar4 = super->parent->parent;
- if ((super->contactFlags & 0x80) != 0) {
+ if ((super->contactFlags & CONTACT_TAKE_DAMAGE) != 0) {
bVar1 = super->contactFlags & 0x3f;
if ((bVar1 == 0xe) || (bVar1 == 0x15)) {
diff --git a/src/enemy/vaatiWrath.c b/src/enemy/vaatiWrath.c
index b8bd9b20..cac6435c 100644
--- a/src/enemy/vaatiWrath.c
+++ b/src/enemy/vaatiWrath.c
@@ -101,7 +101,7 @@ const s8 gUnk_080D0EB0[] = { 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x0
0xfd, 0xfd, 0xfd, 0xfd, 0xfd, 0xfd, 0xfd, 0xfd, 0xfd, 0xfd };
void VaatiWrath(VaatiWrathEntity* this) {
- if (((super->type == 0) && ((super->contactFlags & 0x80) != 0)) && (super->health == 0)) {
+ if (((super->type == 0) && ((super->contactFlags & CONTACT_TAKE_DAMAGE) != 0)) && (super->health == 0)) {
COLLISION_ON(super);
super->health = 0xff;
if (--this->unk_84 == 0) {
diff --git a/src/enemy/wisp.c b/src/enemy/wisp.c
index 1ed368b6..88125bcf 100644
--- a/src/enemy/wisp.c
+++ b/src/enemy/wisp.c
@@ -57,7 +57,7 @@ void Wisp_OnCollision(WispEntity* this) {
Entity* entity;
bits = super->contactFlags;
- if ((bits & 0x80) == 0) {
+ if ((bits & CONTACT_TAKE_DAMAGE) == 0) {
return;
}
diff --git a/src/enemy/wizzrobeFire.c b/src/enemy/wizzrobeFire.c
index 0253a142..b4c6656c 100644
--- a/src/enemy/wizzrobeFire.c
+++ b/src/enemy/wizzrobeFire.c
@@ -26,7 +26,7 @@ void WizzrobeFire_OnCollision(WizzrobeEntity* this) {
}
EnemyFunctionHandlerAfterCollision(super, WizzrobeFire_Functions);
if (super->health == 0) {
- SetTile(this->tileIndex, this->tilePosition, super->collisionLayer);
+ SetBottomTile(this->tileIndex, this->tilePosition, super->collisionLayer);
}
}
@@ -111,7 +111,7 @@ void WizzrobeFire_Action2(WizzrobeEntity* this) {
super->timer = 40;
super->subtimer = 0;
super->flags &= ~0x80;
- SetTile(this->tileIndex, this->tilePosition, super->collisionLayer);
+ SetBottomTile(this->tileIndex, this->tilePosition, super->collisionLayer);
EnqueueSFX(SFX_156);
InitializeAnimation(super, super->direction >> 3);
}
diff --git a/src/enemy/wizzrobeIce.c b/src/enemy/wizzrobeIce.c
index 84fe790e..ae2dbcfe 100644
--- a/src/enemy/wizzrobeIce.c
+++ b/src/enemy/wizzrobeIce.c
@@ -26,7 +26,7 @@ void WizzrobeIce_OnCollision(WizzrobeEntity* this) {
EnemyCreateFX(super, FX_STARS);
}
EnemyFunctionHandlerAfterCollision(super, WizzrobeIce_Functions);
- if (super->contactFlags == 0x87) {
+ if (super->contactFlags == (CONTACT_TAKE_DAMAGE | 0x7)) {
Entity* obj = CreateObject(FLAME, 3, 0);
if (obj != NULL) {
obj->spritePriority.b0 = 3;
@@ -35,7 +35,7 @@ void WizzrobeIce_OnCollision(WizzrobeEntity* this) {
}
}
if (super->health == 0) {
- SetTile(this->tileIndex, this->tilePosition, super->collisionLayer);
+ SetBottomTile(this->tileIndex, this->tilePosition, super->collisionLayer);
}
}
@@ -118,7 +118,7 @@ void WizzrobeIce_Action2(WizzrobeEntity* this) {
super->timer = 40;
super->subtimer = 0;
super->flags &= ~0x80;
- SetTile(this->tileIndex, this->tilePosition, super->collisionLayer);
+ SetBottomTile(this->tileIndex, this->tilePosition, super->collisionLayer);
EnqueueSFX(SFX_156);
InitializeAnimation(super, super->direction >> 3);
}
diff --git a/src/enemy/wizzrobeWind.c b/src/enemy/wizzrobeWind.c
index 8f23e3da..18ee7116 100644
--- a/src/enemy/wizzrobeWind.c
+++ b/src/enemy/wizzrobeWind.c
@@ -33,7 +33,7 @@ void WizzrobeWind_OnCollision(WizzrobeEntity* this) {
EnemyCreateFX(super, FX_STARS);
}
EnemyFunctionHandlerAfterCollision(super, WizzrobeWind_Functions);
- if (super->contactFlags == 0x87) {
+ if (super->contactFlags == (CONTACT_TAKE_DAMAGE | 0x7)) {
Entity* obj = CreateObject(FLAME, 3, 0);
if (obj != NULL) {
obj->spritePriority.b0 = 3;
@@ -42,7 +42,7 @@ void WizzrobeWind_OnCollision(WizzrobeEntity* this) {
}
}
if (super->health == 0) {
- SetTile(this->tileIndex, this->tilePosition, super->collisionLayer);
+ SetBottomTile(this->tileIndex, this->tilePosition, super->collisionLayer);
}
}
@@ -135,7 +135,7 @@ void WizzrobeWind_Action2(WizzrobeEntity* this) {
super->subtimer = 0;
super->flags &= ~0x80;
EnqueueSFX(SFX_156);
- SetTile(this->tileIndex, this->tilePosition, super->collisionLayer);
+ SetBottomTile(this->tileIndex, this->tilePosition, super->collisionLayer);
InitializeAnimation(super, super->direction >> 3);
}
break;
@@ -208,7 +208,7 @@ void sub_0802F888(WizzrobeEntity* this) {
super->direction = (sub_08049F84(super, 3) + 4) & 0x18;
this->tilePosition = COORD_TO_TILE(super);
this->tileIndex = GetTileIndex(this->tilePosition, super->collisionLayer);
- SetTile(0x4071, this->tilePosition, super->collisionLayer);
+ SetBottomTile(0x4071, this->tilePosition, super->collisionLayer);
}
void sub_0802F8E4(WizzrobeEntity* this) {