1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-11-25 09:45:02 +00:00

Use DMG_ defines in code (#1245)

* Use `DMG_` defines for `dmgFlags` when single bits are used

* Pass on several (in code, no colliders)

* Conditional cleanup

* Remove wip comment, just use the flags 4head
This commit is contained in:
Dragorn421 2022-06-03 11:36:04 -07:00 committed by GitHub
parent b2752a6a2e
commit b3b913d33d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
53 changed files with 201 additions and 180 deletions

View file

@ -346,39 +346,38 @@ typedef enum {
#define DMG_ENTRY(damage, effect) ((damage) | ((effect) << 4))
// These flags are not to be used in code until we figure out how we want to format them. They are only here for reference
#define DMG_DEKU_NUT (1 << 0x00)
#define DMG_DEKU_STICK (1 << 0x01)
#define DMG_SLINGSHOT (1 << 0x02)
#define DMG_EXPLOSIVE (1 << 0x03)
#define DMG_BOOMERANG (1 << 0x04)
#define DMG_ARROW_NORMAL (1 << 0x05)
#define DMG_HAMMER_SWING (1 << 0x06)
#define DMG_HOOKSHOT (1 << 0x07)
#define DMG_SLASH_KOKIRI (1 << 0x08)
#define DMG_SLASH_MASTER (1 << 0x09)
#define DMG_SLASH_GIANT (1 << 0x0A)
#define DMG_ARROW_FIRE (1 << 0x0B)
#define DMG_ARROW_ICE (1 << 0x0C)
#define DMG_ARROW_LIGHT (1 << 0x0D)
#define DMG_ARROW_UNK1 (1 << 0x0E)
#define DMG_ARROW_UNK2 (1 << 0x0F)
#define DMG_ARROW_UNK3 (1 << 0x10)
#define DMG_MAGIC_FIRE (1 << 0x11)
#define DMG_MAGIC_ICE (1 << 0x12)
#define DMG_MAGIC_LIGHT (1 << 0x13)
#define DMG_SHIELD (1 << 0x14)
#define DMG_MIR_RAY (1 << 0x15)
#define DMG_SPIN_KOKIRI (1 << 0x16)
#define DMG_SPIN_GIANT (1 << 0x17)
#define DMG_SPIN_MASTER (1 << 0x18)
#define DMG_JUMP_KOKIRI (1 << 0x19)
#define DMG_JUMP_GIANT (1 << 0x1A)
#define DMG_JUMP_MASTER (1 << 0x1B)
#define DMG_UNKNOWN_1 (1 << 0x1C)
#define DMG_UNBLOCKABLE (1 << 0x1D)
#define DMG_HAMMER_JUMP (1 << 0x1E)
#define DMG_UNKNOWN_2 (1 << 0x1F)
#define DMG_DEKU_NUT (1 << 0)
#define DMG_DEKU_STICK (1 << 1)
#define DMG_SLINGSHOT (1 << 2)
#define DMG_EXPLOSIVE (1 << 3)
#define DMG_BOOMERANG (1 << 4)
#define DMG_ARROW_NORMAL (1 << 5)
#define DMG_HAMMER_SWING (1 << 6)
#define DMG_HOOKSHOT (1 << 7)
#define DMG_SLASH_KOKIRI (1 << 8)
#define DMG_SLASH_MASTER (1 << 9)
#define DMG_SLASH_GIANT (1 << 10)
#define DMG_ARROW_FIRE (1 << 11)
#define DMG_ARROW_ICE (1 << 12)
#define DMG_ARROW_LIGHT (1 << 13)
#define DMG_ARROW_UNK1 (1 << 14)
#define DMG_ARROW_UNK2 (1 << 15)
#define DMG_ARROW_UNK3 (1 << 16)
#define DMG_MAGIC_FIRE (1 << 17)
#define DMG_MAGIC_ICE (1 << 18)
#define DMG_MAGIC_LIGHT (1 << 19)
#define DMG_SHIELD (1 << 20)
#define DMG_MIR_RAY (1 << 21)
#define DMG_SPIN_KOKIRI (1 << 22)
#define DMG_SPIN_GIANT (1 << 23)
#define DMG_SPIN_MASTER (1 << 24)
#define DMG_JUMP_KOKIRI (1 << 25)
#define DMG_JUMP_GIANT (1 << 26)
#define DMG_JUMP_MASTER (1 << 27)
#define DMG_UNKNOWN_1 (1 << 28)
#define DMG_UNBLOCKABLE (1 << 29)
#define DMG_HAMMER_JUMP (1 << 30)
#define DMG_UNKNOWN_2 (1 << 31)
#define DMG_SLASH (DMG_SLASH_KOKIRI | DMG_SLASH_MASTER | DMG_SLASH_GIANT)
#define DMG_SPIN_ATTACK (DMG_SPIN_KOKIRI | DMG_SPIN_MASTER | DMG_SPIN_GIANT)

View file

@ -4064,22 +4064,23 @@ u8 Actor_ApplyDamage(Actor* actor) {
void Actor_SetDropFlag(Actor* actor, ColliderInfo* colInfo, s32 freezeFlag) {
if (colInfo->acHitInfo == NULL) {
actor->dropFlag = 0x00;
} else if (freezeFlag && (colInfo->acHitInfo->toucher.dmgFlags & 0x10060000)) {
} else if (freezeFlag &&
(colInfo->acHitInfo->toucher.dmgFlags & (DMG_UNKNOWN_1 | DMG_MAGIC_ICE | DMG_MAGIC_FIRE))) {
actor->freezeTimer = colInfo->acHitInfo->toucher.damage;
actor->dropFlag = 0x00;
} else if (colInfo->acHitInfo->toucher.dmgFlags & 0x0800) {
} else if (colInfo->acHitInfo->toucher.dmgFlags & DMG_ARROW_FIRE) {
actor->dropFlag = 0x01;
} else if (colInfo->acHitInfo->toucher.dmgFlags & 0x1000) {
} else if (colInfo->acHitInfo->toucher.dmgFlags & DMG_ARROW_ICE) {
actor->dropFlag = 0x02;
} else if (colInfo->acHitInfo->toucher.dmgFlags & 0x4000) {
} else if (colInfo->acHitInfo->toucher.dmgFlags & DMG_ARROW_UNK1) {
actor->dropFlag = 0x04;
} else if (colInfo->acHitInfo->toucher.dmgFlags & 0x8000) {
} else if (colInfo->acHitInfo->toucher.dmgFlags & DMG_ARROW_UNK2) {
actor->dropFlag = 0x08;
} else if (colInfo->acHitInfo->toucher.dmgFlags & 0x10000) {
} else if (colInfo->acHitInfo->toucher.dmgFlags & DMG_ARROW_UNK3) {
actor->dropFlag = 0x10;
} else if (colInfo->acHitInfo->toucher.dmgFlags & 0x2000) {
} else if (colInfo->acHitInfo->toucher.dmgFlags & DMG_ARROW_LIGHT) {
actor->dropFlag = 0x20;
} else if (colInfo->acHitInfo->toucher.dmgFlags & 0x80000) {
} else if (colInfo->acHitInfo->toucher.dmgFlags & DMG_MAGIC_LIGHT) {
if (freezeFlag) {
actor->freezeTimer = colInfo->acHitInfo->toucher.damage;
}
@ -4100,22 +4101,23 @@ void Actor_SetDropFlagJntSph(Actor* actor, ColliderJntSph* jntSph, s32 freezeFla
curColInfo = &jntSph->elements[i].info;
if (curColInfo->acHitInfo == NULL) {
flag = 0x00;
} else if (freezeFlag && (curColInfo->acHitInfo->toucher.dmgFlags & 0x10060000)) {
} else if (freezeFlag &&
(curColInfo->acHitInfo->toucher.dmgFlags & (DMG_UNKNOWN_1 | DMG_MAGIC_ICE | DMG_MAGIC_FIRE))) {
actor->freezeTimer = curColInfo->acHitInfo->toucher.damage;
flag = 0x00;
} else if (curColInfo->acHitInfo->toucher.dmgFlags & 0x0800) {
} else if (curColInfo->acHitInfo->toucher.dmgFlags & DMG_ARROW_FIRE) {
flag = 0x01;
} else if (curColInfo->acHitInfo->toucher.dmgFlags & 0x1000) {
} else if (curColInfo->acHitInfo->toucher.dmgFlags & DMG_ARROW_ICE) {
flag = 0x02;
} else if (curColInfo->acHitInfo->toucher.dmgFlags & 0x4000) {
} else if (curColInfo->acHitInfo->toucher.dmgFlags & DMG_ARROW_UNK1) {
flag = 0x04;
} else if (curColInfo->acHitInfo->toucher.dmgFlags & 0x8000) {
} else if (curColInfo->acHitInfo->toucher.dmgFlags & DMG_ARROW_UNK2) {
flag = 0x08;
} else if (curColInfo->acHitInfo->toucher.dmgFlags & 0x10000) {
} else if (curColInfo->acHitInfo->toucher.dmgFlags & DMG_ARROW_UNK3) {
flag = 0x10;
} else if (curColInfo->acHitInfo->toucher.dmgFlags & 0x2000) {
} else if (curColInfo->acHitInfo->toucher.dmgFlags & DMG_ARROW_LIGHT) {
flag = 0x20;
} else if (curColInfo->acHitInfo->toucher.dmgFlags & 0x80000) {
} else if (curColInfo->acHitInfo->toucher.dmgFlags & DMG_MAGIC_LIGHT) {
if (freezeFlag) {
actor->freezeTimer = curColInfo->acHitInfo->toucher.damage;
}

View file

@ -3595,13 +3595,13 @@ s32 CollisionCheck_CylSideVsLineSeg(f32 radius, f32 height, f32 offset, Vec3f* a
u8 CollisionCheck_GetSwordDamage(s32 dmgFlags) {
u8 damage = 0;
if (dmgFlags & 0x00400100) {
if (dmgFlags & (DMG_SPIN_KOKIRI | DMG_SLASH_KOKIRI)) {
damage = 1;
} else if (dmgFlags & 0x03000242) {
} else if (dmgFlags & (DMG_JUMP_KOKIRI | DMG_SPIN_MASTER | DMG_SLASH_MASTER | DMG_HAMMER_SWING | DMG_DEKU_STICK)) {
damage = 2;
} else if (dmgFlags & 0x48800400) {
} else if (dmgFlags & (DMG_HAMMER_JUMP | DMG_JUMP_MASTER | DMG_SPIN_GIANT | DMG_SLASH_GIANT)) {
damage = 4;
} else if (dmgFlags & 0x04000000) {
} else if (dmgFlags & DMG_JUMP_GIANT) {
damage = 8;
}

View file

@ -1241,7 +1241,7 @@ void BossDodongo_UpdateDamage(BossDodongo* this, PlayState* play) {
item1 = this->collider.elements[i].info.acHitInfo;
item2 = item1;
if ((item2->toucher.dmgFlags & 0x10) || (item2->toucher.dmgFlags & 4)) {
if ((item2->toucher.dmgFlags & DMG_BOOMERANG) || (item2->toucher.dmgFlags & DMG_SLINGSHOT)) {
this->collider.elements[i].info.bumperFlags &= ~BUMP_HIT;
this->unk_1C0 = 2;
BossDodongo_SetupWalk(this);

View file

@ -1289,7 +1289,7 @@ void BossFd_CollisionCheck(BossFd* this, PlayState* play) {
headCollider->info.bumperFlags &= ~BUMP_HIT;
hurtbox = headCollider->info.acHitInfo;
this->actor.colChkInfo.health -= 2;
if (hurtbox->toucher.dmgFlags & 0x1000) {
if (hurtbox->toucher.dmgFlags & DMG_ARROW_ICE) {
this->actor.colChkInfo.health -= 2;
}
if ((s8)this->actor.colChkInfo.health <= 2) {

View file

@ -832,7 +832,7 @@ void BossFd2_CollisionCheck(BossFd2* this, PlayState* play) {
hurtbox = this->collider.elements[0].info.acHitInfo;
if (!bossFd->faceExposed) {
if (hurtbox->toucher.dmgFlags & 0x40000040) {
if (hurtbox->toucher.dmgFlags & DMG_HAMMER) {
bossFd->actor.colChkInfo.health -= 2;
if ((s8)bossFd->actor.colChkInfo.health <= 2) {
bossFd->actor.colChkInfo.health = 1;
@ -864,11 +864,11 @@ void BossFd2_CollisionCheck(BossFd2* this, PlayState* play) {
u8 damage;
if ((damage = CollisionCheck_GetSwordDamage(hurtbox->toucher.dmgFlags)) == 0) {
damage = (hurtbox->toucher.dmgFlags & 0x00001000) ? 4 : 2;
damage = (hurtbox->toucher.dmgFlags & DMG_ARROW_ICE) ? 4 : 2;
} else {
canKill = true;
}
if (hurtbox->toucher.dmgFlags & 0x80) {
if (hurtbox->toucher.dmgFlags & DMG_HOOKSHOT) {
damage = 0;
}
if (((s8)bossFd->actor.colChkInfo.health > 2) || canKill) {

View file

@ -2692,14 +2692,14 @@ void BossGanon_UpdateDamage(BossGanon* this, PlayState* play) {
acHitInfo = this->collider.info.acHitInfo;
if ((this->actionFunc == BossGanon_HitByLightBall) || (this->actionFunc == BossGanon_ChargeBigMagic)) {
if (acHitInfo->toucher.dmgFlags & 0x2000) {
if (acHitInfo->toucher.dmgFlags & DMG_ARROW_LIGHT) {
BossGanon_SetupVulnerable(this, play);
this->timers[2] = 0;
Audio_PlayActorSound2(&this->actor, NA_SE_EN_GANON_DAMAGE1);
this->unk_1A6 = 15;
}
} else if ((this->actionFunc == BossGanon_Vulnerable) && (this->unk_1C2 >= 3)) {
if (!(acHitInfo->toucher.dmgFlags & 0x80)) {
if (!(acHitInfo->toucher.dmgFlags & DMG_HOOKSHOT)) {
u8 hitWithSword = false;
u8 damage;
Vec3f sp50;
@ -2747,7 +2747,7 @@ void BossGanon_UpdateDamage(BossGanon* this, PlayState* play) {
sCape->tearTimer = 1;
}
}
} else if (acHitInfo->toucher.dmgFlags & 0x1F8A4) {
} else if (acHitInfo->toucher.dmgFlags & DMG_RANGED) {
Audio_PlayActorSound2(&this->actor, 0);
for (i = 0; i < ARRAY_COUNT(sCape->strands); i++) {
@ -3937,7 +3937,7 @@ void BossGanon_LightBall_Update(Actor* thisx, PlayState* play2) {
this->collider.base.acFlags &= ~AC_HIT;
if ((hitWithBottle == false) && (acHitInfo->toucher.dmgFlags & 0x100000)) {
if ((hitWithBottle == false) && (acHitInfo->toucher.dmgFlags & DMG_SHIELD)) {
spBA = 2;
Audio_PlaySoundGeneral(NA_SE_IT_SHIELD_REFLECT_MG, &player->actor.projectedPos, 4,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
@ -4422,7 +4422,7 @@ void func_808E2544(Actor* thisx, PlayState* play) {
this->collider.base.acFlags &= ~AC_HIT;
if (!(acHitInfo->toucher.dmgFlags & 0x100000) || Player_HasMirrorShieldEquipped(play)) {
if (!(acHitInfo->toucher.dmgFlags & DMG_SHIELD) || Player_HasMirrorShieldEquipped(play)) {
func_800AA000(this->actor.xyzDistToPlayerSq, 0xB4, 0x14, 0x64);
this->unk_1C2 = 0xC;
this->actor.speedXZ = -30.0f;

View file

@ -1896,12 +1896,13 @@ void func_80902524(BossGanon2* this, PlayState* play) {
if (this->unk_424.elements[0].info.bumperFlags & BUMP_HIT) {
this->unk_424.elements[0].info.bumperFlags &= ~BUMP_HIT;
acHitInfo = this->unk_424.elements[0].info.acHitInfo;
if ((acHitInfo->toucher.dmgFlags & 0x2000) && (this->actionFunc != func_80900890)) {
if ((acHitInfo->toucher.dmgFlags & DMG_ARROW_LIGHT) && (this->actionFunc != func_80900890)) {
func_809000A0(this, play);
Audio_PlayActorSound2(&this->actor, NA_SE_EN_FANTOM_HIT_THUNDER);
Audio_PlayActorSound2(&this->actor, NA_SE_EN_MGANON_DAMAGE);
Audio_StopSfxById(NA_SE_EN_MGANON_UNARI);
} else if ((this->actionFunc == func_80900890) && (acHitInfo->toucher.dmgFlags & 0x9000200)) {
} else if ((this->actionFunc == func_80900890) &&
(acHitInfo->toucher.dmgFlags & (DMG_JUMP_MASTER | DMG_SPIN_MASTER | DMG_SLASH_MASTER))) {
this->unk_316 = 60;
this->unk_342 = 5;
Audio_PlayActorSound2(&this->actor, NA_SE_EN_MGANON_DAMAGE);
@ -1933,8 +1934,8 @@ void func_80902524(BossGanon2* this, PlayState* play) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_MGANON_DAMAGE);
Audio_StopSfxById(NA_SE_EN_MGANON_UNARI);
phi_v1_2 = 1;
if (acHitInfo->toucher.dmgFlags & 0x9000200) {
if (acHitInfo->toucher.dmgFlags & 0x8000000) {
if (acHitInfo->toucher.dmgFlags & (DMG_JUMP_MASTER | DMG_SPIN_MASTER | DMG_SLASH_MASTER)) {
if (acHitInfo->toucher.dmgFlags & DMG_JUMP_MASTER) {
phi_v1_2 = 4;
} else {
phi_v1_2 = 2;

View file

@ -1238,7 +1238,7 @@ void BossGanondrof_CollisionCheck(BossGanondrof* this, PlayState* play) {
hurtbox = this->colliderBody.info.acHitInfo;
}
if (this->flyMode != GND_FLY_PAINTING) {
if (acHit && (this->actionFunc != BossGanondrof_Stunned) && (hurtbox->toucher.dmgFlags & 0x0001F8A4)) {
if (acHit && (this->actionFunc != BossGanondrof_Stunned) && (hurtbox->toucher.dmgFlags & DMG_RANGED)) {
Audio_PlayActorSound2(&this->actor, NA_SE_PL_WALK_GROUND - SFX_FLAG);
osSyncPrintf("hit != 0 \n");
} else if (this->actionFunc != BossGanondrof_Charge) {
@ -1247,7 +1247,7 @@ void BossGanondrof_CollisionCheck(BossGanondrof* this, PlayState* play) {
u8 canKill = false;
s32 dmgFlags = hurtbox->toucher.dmgFlags;
if (dmgFlags & 0x80) {
if (dmgFlags & DMG_HOOKSHOT) {
return;
}
dmg = CollisionCheck_GetSwordDamage(dmgFlags);
@ -1272,7 +1272,7 @@ void BossGanondrof_CollisionCheck(BossGanondrof* this, PlayState* play) {
} else {
Audio_PlayActorSound2(&this->actor, NA_SE_PL_WALK_GROUND - SFX_FLAG);
}
} else if (acHit && (hurtbox->toucher.dmgFlags & 0x0001F8A4)) {
} else if (acHit && (hurtbox->toucher.dmgFlags & DMG_RANGED)) {
this->work[GND_INVINC_TIMER] = 10;
this->actor.colChkInfo.health -= 2;
horse->hitTimer = 20;

View file

@ -1831,14 +1831,14 @@ void BossGoma_UpdateHit(BossGoma* this, PlayState* play) {
this->invincibilityFrames = 10;
} else if (this->actionFunc != BossGoma_FloorStunned && this->patienceTimer != 0 &&
(acHitInfo->toucher.dmgFlags & 0x00000005)) {
(acHitInfo->toucher.dmgFlags & (DMG_SLINGSHOT | DMG_DEKU_NUT))) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOMA_DAM2);
Audio_StopSfxById(NA_SE_EN_GOMA_CRY1);
this->invincibilityFrames = 10;
BossGoma_SetupFloorStunned(this);
this->sfxFaintTimer = 100;
if (acHitInfo->toucher.dmgFlags & 1) {
if (acHitInfo->toucher.dmgFlags & DMG_DEKU_NUT) {
this->framesUntilNextAction = 40;
} else {
this->framesUntilNextAction = 90;

View file

@ -1151,14 +1151,15 @@ void BossMo_TentCollisionCheck(BossMo* this, PlayState* play) {
}
hurtbox = this->tentCollider.elements[i1].info.acHitInfo;
this->work[MO_TENT_INVINC_TIMER] = 5;
if (hurtbox->toucher.dmgFlags & 0x00020000) {
if (hurtbox->toucher.dmgFlags & DMG_MAGIC_FIRE) {
func_80078914(&this->tentTipPos, NA_SE_EN_MOFER_CUT);
this->cutIndex = 15;
this->meltIndex = this->cutIndex + 1;
this->work[MO_TENT_ACTION_STATE] = MO_TENT_CUT;
this->timers[0] = 40;
this->cutScale = 1.0f;
} else if (hurtbox->toucher.dmgFlags & 0x0D800600) {
} else if (hurtbox->toucher.dmgFlags & (DMG_JUMP_MASTER | DMG_JUMP_GIANT | DMG_SPIN_MASTER |
DMG_SPIN_GIANT | DMG_SLASH_GIANT | DMG_SLASH_MASTER)) {
this->linkHitTimer = 5;
}
this->tentRippleSize = 0.2f;
@ -1750,7 +1751,7 @@ void BossMo_CoreCollisionCheck(BossMo* this, PlayState* play) {
// "hit!!"
osSyncPrintf("Core_Damage_check 当り!!\n");
this->coreCollider.base.acFlags &= ~AC_HIT;
if ((hurtbox->toucher.dmgFlags & 0x00020000) && (this->work[MO_TENT_ACTION_STATE] == MO_CORE_ATTACK)) {
if ((hurtbox->toucher.dmgFlags & DMG_MAGIC_FIRE) && (this->work[MO_TENT_ACTION_STATE] == MO_CORE_ATTACK)) {
this->work[MO_TENT_ACTION_STATE] = MO_CORE_RETREAT;
}
// "hit 2 !!"
@ -1794,7 +1795,7 @@ void BossMo_CoreCollisionCheck(BossMo* this, PlayState* play) {
}
}
this->work[MO_TENT_INVINC_TIMER] = 10;
} else if (!(hurtbox->toucher.dmgFlags & 0x00100000) && (hurtbox->toucher.dmgFlags & 0x80)) {
} else if (!(hurtbox->toucher.dmgFlags & DMG_SHIELD) && (hurtbox->toucher.dmgFlags & DMG_HOOKSHOT)) {
if (this->work[MO_TENT_ACTION_STATE] >= MO_CORE_ATTACK) {
func_80078914(&sMorphaTent1->tentTipPos, NA_SE_EN_MOFER_CUT);
sMorphaTent1->cutIndex = this->work[MO_CORE_POS_IN_TENT];

View file

@ -863,7 +863,7 @@ void BossSst_HeadStunned(BossSst* this, PlayState* play) {
void BossSst_HeadSetupVulnerable(BossSst* this) {
Animation_MorphToLoop(&this->skelAnime, &gBongoHeadStunnedAnim, -5.0f);
this->colliderCyl.base.acFlags |= AC_ON;
this->colliderCyl.info.bumper.dmgFlags = 0x0FC00702; // Sword-type damage
this->colliderCyl.info.bumper.dmgFlags = DMG_SWORD | DMG_DEKU_STICK;
this->actor.speedXZ = 0.0f;
this->colliderJntSph.elements[10].info.bumperFlags |= (BUMP_ON | BUMP_HOOKABLE);
this->colliderJntSph.elements[0].info.bumperFlags &= ~BUMP_ON;
@ -919,7 +919,7 @@ void BossSst_HeadDamage(BossSst* this, PlayState* play) {
void BossSst_HeadSetupRecover(BossSst* this) {
Animation_MorphToPlayOnce(&this->skelAnime, &gBongoHeadRecoverAnim, -5.0f);
this->colliderCyl.base.acFlags &= ~AC_ON;
this->colliderCyl.info.bumper.dmgFlags = 0xFFCFFFFF;
this->colliderCyl.info.bumper.dmgFlags = DMG_DEFAULT;
this->colliderJntSph.elements[10].info.bumperFlags &= ~(BUMP_ON | BUMP_HOOKABLE);
this->colliderJntSph.elements[0].info.bumperFlags |= BUMP_ON;
this->vVanish = true;

View file

@ -1129,7 +1129,7 @@ void BossVa_BodyPhase2(BossVa* this, PlayState* play) {
Actor_SetColorFilter(&this->actor, 0, 255, 0, 160);
this->actor.colorFilterTimer = this->invincibilityTimer;
} else {
this->colliderBody.info.bumper.dmgFlags = 0x10;
this->colliderBody.info.bumper.dmgFlags = DMG_BOOMERANG;
}
}
@ -1139,7 +1139,7 @@ void BossVa_BodyPhase2(BossVa* this, PlayState* play) {
if (this->colliderBody.base.ac->id == ACTOR_EN_BOOM) {
sPhase2Timer &= 0xFE00;
Actor_SetColorFilter(&this->actor, 0, 255, 0, 160);
this->colliderBody.info.bumper.dmgFlags = 0xFC00712;
this->colliderBody.info.bumper.dmgFlags = DMG_SWORD | DMG_BOOMERANG | DMG_DEKU_STICK;
} else {
sKillBari++;
if ((this->actor.colorFilterTimer != 0) && !(this->actor.colorFilterParams & 0x4000)) {
@ -1217,7 +1217,7 @@ void BossVa_BodyPhase2(BossVa* this, PlayState* play) {
}
void BossVa_SetupBodyPhase3(BossVa* this) {
this->colliderBody.info.bumper.dmgFlags = 0x10;
this->colliderBody.info.bumper.dmgFlags = DMG_BOOMERANG;
this->actor.speedXZ = 0.0f;
sPhase3StopMoving = false;
BossVa_SetupAction(this, BossVa_BodyPhase3);
@ -1421,7 +1421,7 @@ void BossVa_BodyPhase4(BossVa* this, PlayState* play) {
}
Math_SmoothStepToF(&this->actor.speedXZ, ((sFightPhase - PHASE_4 + 1) * 1.5f) + 4.0f, 1.0f, 0.25f, 0.0f);
}
this->colliderBody.info.bumper.dmgFlags = 0x10;
this->colliderBody.info.bumper.dmgFlags = DMG_BOOMERANG;
} else {
Math_SmoothStepToS(&this->vaBodySpinRate, 0, 1, 0x96, 0);
if (this->timer > 0) {
@ -1429,7 +1429,7 @@ void BossVa_BodyPhase4(BossVa* this, PlayState* play) {
this->timer = 35;
}
Math_SmoothStepToF(&this->actor.shape.yOffset, -480.0f, 1.0f, 30.0f, 0.0f);
this->colliderBody.info.bumper.dmgFlags = 0xFC00712;
this->colliderBody.info.bumper.dmgFlags = DMG_SWORD | DMG_BOOMERANG | DMG_DEKU_STICK;
this->timer--;
} else {
if ((player->stateFlags1 & PLAYER_STATE1_26) && (this->timer < -60)) {

View file

@ -422,10 +422,10 @@ void DoorKiller_Wait(DoorKiller* this, PlayState* play) {
if (DoorKiller_IsHit(&this->actor, play)) {
// AC cylinder: wobble if hit by most weapons, die if hit by explosives or hammer
if ((this->colliderCylinder.info.acHitInfo->toucher.dmgFlags & 0x1FFA6) != 0) {
if (this->colliderCylinder.info.acHitInfo->toucher.dmgFlags & (DMG_RANGED | DMG_SLASH | DMG_DEKU_STICK)) {
this->timer = 16;
this->actionFunc = DoorKiller_Wobble;
} else if ((this->colliderCylinder.info.acHitInfo->toucher.dmgFlags & 0x48) != 0) {
} else if (this->colliderCylinder.info.acHitInfo->toucher.dmgFlags & (DMG_HAMMER_SWING | DMG_EXPLOSIVE)) {
DoorKiller_SpawnRubble(&this->actor, play);
this->actionFunc = DoorKiller_Die;
SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 20, NA_SE_EN_KDOOR_BREAK);

View file

@ -113,7 +113,7 @@ void func_809B27D8(EnAnubiceFire* this, PlayState* play) {
Audio_PlayActorSound2(&this->actor, NA_SE_IT_SHIELD_REFLECT_SW);
this->cylinder.base.atFlags &= ~(AT_HIT | AT_BOUNCED | AT_TYPE_ENEMY);
this->cylinder.base.atFlags |= AT_TYPE_PLAYER;
this->cylinder.info.toucher.dmgFlags = 2;
this->cylinder.info.toucher.dmgFlags = DMG_DEKU_STICK;
this->unk_15A = 30;
this->actor.params = 1;
this->actor.velocity.x *= -1.0f;

View file

@ -77,8 +77,8 @@ void EnArrow_Init(Actor* thisx, PlayState* play) {
0, 1, 0, { 255, 255, 170, 255 }, { 255, 255, 0, 0 },
};
static u32 dmgFlags[] = {
0x00000800, 0x00000020, 0x00000020, 0x00000800, 0x00001000,
0x00002000, 0x00010000, 0x00004000, 0x00008000, 0x00000004,
DMG_ARROW_FIRE, DMG_ARROW_NORMAL, DMG_ARROW_NORMAL, DMG_ARROW_FIRE, DMG_ARROW_ICE,
DMG_ARROW_LIGHT, DMG_ARROW_UNK3, DMG_ARROW_UNK1, DMG_ARROW_UNK2, DMG_SLINGSHOT,
};
EnArrow* this = (EnArrow*)thisx;

View file

@ -331,7 +331,7 @@ void EnBb_Init(Actor* thisx, PlayState* play) {
this->flameScaleY = 80.0f;
this->flameScaleX = 100.0f;
this->collider.elements[0].info.toucherFlags = TOUCH_ON | TOUCH_SFX_HARD;
this->collider.elements[0].info.toucher.dmgFlags = 0xFFCFFFFF;
this->collider.elements[0].info.toucher.dmgFlags = DMG_DEFAULT;
this->collider.elements[0].info.toucher.damage = 8;
this->bobSize = this->actionState * 20.0f;
this->flamePrimAlpha = 255;

View file

@ -333,7 +333,7 @@ void func_809BD524(EnBigokuta* this) {
this->unk_19A = 0;
this->cylinder[0].base.atFlags |= AT_ON;
Audio_PlayActorSound2(&this->actor, NA_SE_EN_DAIOCTA_MAHI);
if (this->collider.elements->info.acHitInfo->toucher.dmgFlags & 1) {
if (this->collider.elements->info.acHitInfo->toucher.dmgFlags & DMG_DEKU_NUT) {
this->unk_195 = true;
this->unk_196 = 20;
} else {

View file

@ -586,7 +586,7 @@ void EnBili_UpdateDamage(EnBili* this, PlayState* play) {
EnBili_SetupBurnt(this);
}
if (this->collider.info.acHitInfo->toucher.dmgFlags & 0x1F820) { // DMG_ARROW
if (this->collider.info.acHitInfo->toucher.dmgFlags & DMG_ARROW) {
this->actor.flags |= ACTOR_FLAG_4;
}
}

View file

@ -262,8 +262,8 @@ void EnBrob_Update(Actor* thisx, PlayState* play2) {
acHits[0] = (this->colliders[0].base.acFlags & AC_HIT) != 0;
acHits[1] = (this->colliders[1].base.acFlags & AC_HIT) != 0;
if ((acHits[0] && (this->colliders[0].info.acHitInfo->toucher.dmgFlags & 0x10)) ||
(acHits[1] && (this->colliders[1].info.acHitInfo->toucher.dmgFlags & 0x10))) {
if ((acHits[0] && (this->colliders[0].info.acHitInfo->toucher.dmgFlags & DMG_BOOMERANG)) ||
(acHits[1] && (this->colliders[1].info.acHitInfo->toucher.dmgFlags & DMG_BOOMERANG))) {
for (i = 0; i < 2; i++) {
this->colliders[i].base.atFlags &= ~(AT_HIT | AT_BOUNCED);
@ -272,8 +272,8 @@ void EnBrob_Update(Actor* thisx, PlayState* play2) {
func_809CAEF4(this);
} else if ((this->colliders[0].base.atFlags & AT_HIT) || (this->colliders[1].base.atFlags & AT_HIT) ||
(acHits[0] && (this->colliders[0].info.acHitInfo->toucher.dmgFlags & 0x100)) ||
(acHits[1] && (this->colliders[1].info.acHitInfo->toucher.dmgFlags & 0x100))) {
(acHits[0] && (this->colliders[0].info.acHitInfo->toucher.dmgFlags & DMG_SLASH_KOKIRI)) ||
(acHits[1] && (this->colliders[1].info.acHitInfo->toucher.dmgFlags & DMG_SLASH_KOKIRI))) {
if (this->actionFunc == func_809CB114 && !(this->colliders[0].base.atFlags & AT_BOUNCED) &&
!(this->colliders[1].base.atFlags & AT_BOUNCED)) {

View file

@ -99,7 +99,7 @@ void EnBubble_SetDimensions(EnBubble* this, f32 dim) {
u32 func_809CBCBC(EnBubble* this) {
ColliderInfo* info = &this->colliderSphere.elements[0].info;
info->toucher.dmgFlags = 0x8;
info->toucher.dmgFlags = DMG_EXPLOSIVE;
info->toucher.effect = 0;
info->toucher.damage = 4;
info->toucherFlags = TOUCH_ON;

View file

@ -204,7 +204,7 @@ void EnDekunuts_SetupGasp(EnDekunuts* this) {
void EnDekunuts_SetupBeDamaged(EnDekunuts* this) {
Animation_MorphToPlayOnce(&this->skelAnime, &gDekuNutsDamageAnim, -3.0f);
if ((this->collider.info.acHitInfo->toucher.dmgFlags & 0x1F824) != 0) {
if (this->collider.info.acHitInfo->toucher.dmgFlags & (DMG_ARROW | DMG_SLINGSHOT)) {
this->actor.world.rot.y = this->collider.base.ac->world.rot.y;
} else {
this->actor.world.rot.y = Actor_WorldYawTowardActor(&this->actor, this->collider.base.ac) + 0x8000;

View file

@ -320,7 +320,7 @@ void EnDh_Attack(EnDh* this, PlayState* play) {
if (this->skelAnime.curFrame >= 4.0f) {
this->collider2.base.atFlags = this->collider2.elements[0].info.toucherFlags =
AT_ON | AT_TYPE_ENEMY; // also TOUCH_ON | TOUCH_SFX_WOOD
this->collider2.elements[0].info.toucher.dmgFlags = 0xFFCFFFFF;
this->collider2.elements[0].info.toucher.dmgFlags = DMG_DEFAULT;
this->collider2.elements[0].info.toucher.damage = 8;
}
if (this->collider2.base.atFlags & AT_BOUNCED) {
@ -376,7 +376,7 @@ void EnDh_Burrow(EnDh* this, PlayState* play) {
this->drawDirtWave++;
this->collider1.base.atFlags = this->collider1.info.toucherFlags =
AT_ON | AT_TYPE_ENEMY; // also TOUCH_ON | TOUCH_SFX_WOOD
this->collider1.info.toucher.dmgFlags = 0xFFCFFFFF;
this->collider1.info.toucher.dmgFlags = DMG_DEFAULT;
this->collider1.info.toucher.damage = 4;
FALLTHROUGH;
case 1:

View file

@ -630,7 +630,7 @@ void EnDodongo_SweepTail(EnDodongo* this, PlayState* play) {
this->timer = 18;
this->colliderBody.base.atFlags = this->sphElements[1].info.toucherFlags =
this->sphElements[2].info.toucherFlags = AT_ON | AT_TYPE_ENEMY; // also TOUCH_ON | TOUCH_SFX_WOOD
this->sphElements[1].info.toucher.dmgFlags = this->sphElements[2].info.toucher.dmgFlags = 0xFFCFFFFF;
this->sphElements[1].info.toucher.dmgFlags = this->sphElements[2].info.toucher.dmgFlags = DMG_DEFAULT;
this->sphElements[1].info.toucher.damage = this->sphElements[2].info.toucher.damage = 8;
}
} else if (this->timer > 1) {

View file

@ -178,7 +178,7 @@ void EnEiyer_RotateAroundHome(EnEiyer* this) {
}
void EnEiyer_SetupAppearFromGround(EnEiyer* this) {
this->collider.info.bumper.dmgFlags = 0x19;
this->collider.info.bumper.dmgFlags = DMG_BOOMERANG | DMG_EXPLOSIVE | DMG_DEKU_NUT;
Animation_PlayLoop(&this->skelanime, &gStingerIdleAnim);
this->actor.world.pos.x = this->actor.home.pos.x;
@ -228,7 +228,7 @@ void EnEiyer_SetupInactive(EnEiyer* this) {
void EnEiyer_SetupAmbush(EnEiyer* this, PlayState* play) {
this->actor.speedXZ = 0.0f;
Animation_PlayOnce(&this->skelanime, &gStingerBackflipAnim);
this->collider.info.bumper.dmgFlags = ~0x00300000;
this->collider.info.bumper.dmgFlags = DMG_DEFAULT;
this->basePos = this->actor.world.pos;
this->actor.world.rot.y = this->actor.shape.rot.y;
this->actor.flags |= ACTOR_FLAG_12;
@ -290,14 +290,14 @@ void EnEiyer_SetupDie(EnEiyer* this) {
this->timer = 20;
Actor_SetColorFilter(&this->actor, 0x4000, 200, 0, 40);
if (this->collider.info.bumper.dmgFlags != 0x19) {
if (this->collider.info.bumper.dmgFlags != (DMG_BOOMERANG | DMG_EXPLOSIVE | DMG_DEKU_NUT)) {
this->actor.speedXZ = 6.0f;
Animation_MorphToLoop(&this->skelanime, &gStingerHitAnim, -3.0f);
} else {
this->actor.speedXZ -= 6.0f;
}
this->collider.info.bumper.dmgFlags = ~0x00300000;
this->collider.info.bumper.dmgFlags = DMG_DEFAULT;
this->collider.base.atFlags &= ~AT_ON;
this->collider.base.acFlags &= ~AC_ON;
this->actionFunc = EnEiyer_Die;
@ -612,7 +612,7 @@ void EnEiyer_UpdateDamage(EnEiyer* this, PlayState* play) {
}
// If underground, one hit kill
if (this->collider.info.bumper.dmgFlags == 0x19) {
if (this->collider.info.bumper.dmgFlags == (DMG_BOOMERANG | DMG_EXPLOSIVE | DMG_DEKU_NUT)) {
if (this->actor.colChkInfo.damage == 0) {
EnEiyer_SetupAmbush(this, play);
} else {
@ -687,7 +687,8 @@ s32 EnEiyer_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f*
pos->z += 2500.0f;
}
if (this->collider.info.bumper.dmgFlags == 0x19 && limbIndex != 9 && limbIndex != 10) {
if (this->collider.info.bumper.dmgFlags == (DMG_BOOMERANG | DMG_EXPLOSIVE | DMG_DEKU_NUT) && limbIndex != 9 &&
limbIndex != 10) {
*dList = NULL;
}
return 0;

View file

@ -283,7 +283,7 @@ s32 EnFd_ColliderCheck(EnFd* this, PlayState* play) {
return false;
}
info = &this->collider.elements[0].info;
if (info->acHitInfo != NULL && (info->acHitInfo->toucher.dmgFlags & 0x80)) {
if (info->acHitInfo != NULL && (info->acHitInfo->toucher.dmgFlags & DMG_HOOKSHOT)) {
return false;
}

View file

@ -491,7 +491,7 @@ void EnFhgFire_EnergyBall(EnFhgFire* this, PlayState* play) {
(s16)(Rand_ZeroOne() * 25.0f) + 50, FHGFLASH_LIGHTBALL_GREEN);
}
canBottleReflect2 = canBottleReflect1;
if (!canBottleReflect2 && (hurtbox->toucher.dmgFlags & 0x00100000)) {
if (!canBottleReflect2 && (hurtbox->toucher.dmgFlags & DMG_SHIELD)) {
killMode = BALL_IMPACT;
Audio_PlaySoundGeneral(NA_SE_IT_SHIELD_REFLECT_MG, &player->actor.projectedPos, 4,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,

View file

@ -390,7 +390,7 @@ void EnFloormas_SetupSmWait(EnFloormas* this) {
void EnFloormas_SetupTakeDamage(EnFloormas* this) {
Animation_MorphToPlayOnce(&this->skelAnime, &gWallmasterDamageAnim, -3.0f);
if (this->collider.info.acHitInfo->toucher.dmgFlags & 0x1F824) {
if (this->collider.info.acHitInfo->toucher.dmgFlags & (DMG_ARROW | DMG_SLINGSHOT)) {
this->actor.world.rot.y = this->collider.base.ac->world.rot.y;
} else {
this->actor.world.rot.y = Actor_WorldYawTowardActor(&this->actor, this->collider.base.ac) + 0x8000;
@ -986,7 +986,7 @@ void EnFloormas_ColliderCheck(EnFloormas* this, PlayState* play) {
if (this->actor.scale.x < 0.01f) {
isSmall = 1;
}
if (isSmall && this->collider.info.acHitInfo->toucher.dmgFlags & 0x80) {
if (isSmall && this->collider.info.acHitInfo->toucher.dmgFlags & DMG_HOOKSHOT) {
this->actor.colChkInfo.damage = 2;
this->actor.colChkInfo.damageEffect = 0;
}

View file

@ -139,7 +139,7 @@ s32 EnFw_CheckCollider(EnFw* this, PlayState* play) {
if (this->collider.base.acFlags & AC_HIT) {
info = &this->collider.elements[0].info;
if (info->acHitInfo->toucher.dmgFlags & 0x80) {
if (info->acHitInfo->toucher.dmgFlags & DMG_HOOKSHOT) {
this->lastDmgHook = true;
} else {
this->lastDmgHook = false;

View file

@ -135,7 +135,7 @@ void EnGSwitch_Init(Actor* thisx, PlayState* play) {
this->actor.scale.x = 0.25f;
this->actor.scale.y = 0.45f;
this->actor.scale.z = 0.25f;
this->collider.info.bumper.dmgFlags = 0x1F820;
this->collider.info.bumper.dmgFlags = DMG_ARROW;
this->objId = OBJECT_TSUBO;
this->objIndex = Object_GetIndex(&play->objectCtx, this->objId);
if (this->objIndex < 0) {

View file

@ -554,7 +554,8 @@ void EnGe2_Update(Actor* thisx, PlayState* play) {
if ((this->stateFlags & GE2_STATE_KO) || (this->stateFlags & GE2_STATE_CAPTURING)) {
this->actionFunc(this, play);
} else if (this->collider.base.acFlags & AC_HIT) {
if ((this->collider.info.acHitInfo != NULL) && (this->collider.info.acHitInfo->toucher.dmgFlags & 0x80)) {
if ((this->collider.info.acHitInfo != NULL) &&
(this->collider.info.acHitInfo->toucher.dmgFlags & DMG_HOOKSHOT)) {
Actor_SetColorFilter(&this->actor, 0, 120, 0, 400);
this->actor.update = EnGe2_UpdateStunned;
return;
@ -603,8 +604,8 @@ void EnGe2_UpdateStunned(Actor* thisx, PlayState* play2) {
CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base);
Actor_UpdateBgCheckInfo(play, &this->actor, 40.0f, 25.0f, 40.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2);
if ((this->collider.base.acFlags & AC_HIT) &&
((this->collider.info.acHitInfo == NULL) || !(this->collider.info.acHitInfo->toucher.dmgFlags & 0x80))) {
if ((this->collider.base.acFlags & AC_HIT) && ((this->collider.info.acHitInfo == NULL) ||
!(this->collider.info.acHitInfo->toucher.dmgFlags & DMG_HOOKSHOT))) {
this->actor.colorFilterTimer = 0;
EnGe2_ChangeAction(this, GE2_ACTION_KNOCKEDOUT);
this->timer = 100;

View file

@ -626,7 +626,7 @@ void EnGoma_UpdateHit(EnGoma* this, PlayState* play) {
if (this->gomaType == ENGOMA_NORMAL) {
u32 dmgFlags = acHitInfo->toucher.dmgFlags;
if (dmgFlags & 0x100000) {
if (dmgFlags & DMG_SHIELD) {
if (this->actionFunc == EnGoma_Jump) {
EnGoma_SetupLand(this);
this->actor.velocity.y = 0.0f;
@ -636,7 +636,7 @@ void EnGoma_UpdateHit(EnGoma* this, PlayState* play) {
Matrix_MultVec3f(&sShieldKnockbackVel, &this->shieldKnockbackVel);
this->invincibilityTimer = 5;
}
} else if (dmgFlags & 1) { // stun
} else if (dmgFlags & DMG_DEKU_NUT) { // stun
if (this->actionFunc != EnGoma_Stunned) {
EnGoma_SetupStunned(this, play);
this->hurtTimer = 8;
@ -644,7 +644,7 @@ void EnGoma_UpdateHit(EnGoma* this, PlayState* play) {
} else {
swordDamage = CollisionCheck_GetSwordDamage(dmgFlags);
if (swordDamage) {
if (swordDamage != 0) {
EffectSsSibuki_SpawnBurst(play, &this->actor.focus.pos);
} else {
swordDamage = 1;

View file

@ -356,7 +356,7 @@ void EnIshi_Wait(EnIshi* this, PlayState* play) {
EnIshi_SpawnBugs(this, play);
}
} else if ((this->collider.base.acFlags & AC_HIT) && (type == ROCK_SMALL) &&
this->collider.info.acHitInfo->toucher.dmgFlags & 0x40000048) {
this->collider.info.acHitInfo->toucher.dmgFlags & (DMG_HAMMER | DMG_EXPLOSIVE)) {
EnIshi_DropCollectible(this, play);
SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, sBreakSoundDurations[type],
sBreakSounds[type]);

View file

@ -299,7 +299,7 @@ void EnKanban_Update(Actor* thisx, PlayState* play2) {
s16 yawDiff = this->actor.yawTowardsPlayer - this->actor.shape.rot.y;
u8 i;
if (hitItem->toucher.dmgFlags & 0x700) {
if (hitItem->toucher.dmgFlags & DMG_SLASH) {
this->cutType = sCutTypes[player->meleeWeaponAnimation];
} else {
this->cutType = CUT_POST;

View file

@ -125,7 +125,7 @@ void EnKarebaba_ResetCollider(EnKarebaba* this) {
this->bodyCollider.dim.height = 25;
this->bodyCollider.base.colType = COLTYPE_HARD;
this->bodyCollider.base.acFlags |= AC_HARD;
this->bodyCollider.info.bumper.dmgFlags = ~0x00300000;
this->bodyCollider.info.bumper.dmgFlags = DMG_DEFAULT;
this->headCollider.dim.height = 25;
}
@ -155,7 +155,8 @@ void EnKarebaba_SetupUpright(EnKarebaba* this) {
Actor_SetScale(&this->actor, 0.01f);
this->bodyCollider.base.colType = COLTYPE_HIT6;
this->bodyCollider.base.acFlags &= ~AC_HARD;
this->bodyCollider.info.bumper.dmgFlags = !LINK_IS_ADULT ? 0x07C00710 : 0x0FC00710;
this->bodyCollider.info.bumper.dmgFlags =
!LINK_IS_ADULT ? ((DMG_SWORD | DMG_BOOMERANG) & ~DMG_JUMP_MASTER) : (DMG_SWORD | DMG_BOOMERANG);
this->bodyCollider.dim.radius = 15;
this->bodyCollider.dim.height = 80;
this->headCollider.dim.height = 80;

View file

@ -44,8 +44,8 @@ static ColliderCylinderInit D_80AA0420 = {
{ 200, 200, 0, { 0, 0, 0 } },
};
static u32 D_80AA044C[] = { 0x01000000, 0x00400000, 0x00800000 };
static u32 D_80AA0458[] = { 0x08000000, 0x02000000, 0x04000000 };
static u32 D_80AA044C[] = { DMG_SPIN_MASTER, DMG_SPIN_KOKIRI, DMG_SPIN_GIANT };
static u32 D_80AA0458[] = { DMG_JUMP_MASTER, DMG_JUMP_KOKIRI, DMG_JUMP_GIANT };
static u16 sSfxIds[] = {
NA_SE_IT_ROLLING_CUT_LV2,

View file

@ -296,7 +296,7 @@ void EnMb_Init(Actor* thisx, PlayState* play) {
this->actor.uncullZoneScale = 800.0f;
this->actor.uncullZoneDownward = 1800.0f;
this->playerDetectionRange = 710.0f;
this->attackCollider.info.toucher.dmgFlags = 0x20000000;
this->attackCollider.info.toucher.dmgFlags = DMG_UNBLOCKABLE;
relYawFromPlayer =
this->actor.world.rot.y - Math_Vec3f_Yaw(&this->actor.world.pos, &player->actor.world.pos);

View file

@ -120,7 +120,7 @@ void func_80ABBBA8(EnNutsball* this, PlayState* play) {
this->collider.base.atFlags &= ~AT_TYPE_ENEMY & ~AT_BOUNCED & ~AT_HIT;
this->collider.base.atFlags |= AT_TYPE_PLAYER;
this->collider.info.toucher.dmgFlags = 2;
this->collider.info.toucher.dmgFlags = DMG_DEKU_STICK;
Matrix_MtxFToYXZRotS(&player->shieldMf, &sp4C, 0);
this->actor.world.rot.y = sp4C.y + 0x8000;
this->timer = 30;

View file

@ -490,7 +490,7 @@ void EnOkuta_ProjectileFly(EnOkuta* this, PlayState* play) {
this->collider.base.atFlags & AT_BOUNCED) {
this->collider.base.atFlags &= ~(AT_HIT | AT_BOUNCED | AT_TYPE_ENEMY);
this->collider.base.atFlags |= AT_TYPE_PLAYER;
this->collider.info.toucher.dmgFlags = 2;
this->collider.info.toucher.dmgFlags = DMG_DEKU_STICK;
Matrix_MtxFToYXZRotS(&player->shieldMf, &shieldRot, 0);
this->actor.world.rot.y = shieldRot.y + 0x8000;
this->timer = 30;

View file

@ -231,7 +231,7 @@ void EnPeehat_Init(Actor* thisx, PlayState* play) {
this->colCylinder.dim.radius = 25;
this->colCylinder.dim.height = 15;
this->colCylinder.dim.yShift = -5;
this->colCylinder.info.bumper.dmgFlags = 0x1F824;
this->colCylinder.info.bumper.dmgFlags = DMG_ARROW | DMG_SLINGSHOT;
this->colQuad.base.atFlags = AT_ON | AT_TYPE_ENEMY;
this->colQuad.base.acFlags = AC_ON | AC_TYPE_PLAYER;
this->actor.naviEnemyId = NAVI_ENEMY_PEAHAT_LARVA;

View file

@ -263,7 +263,7 @@ void EnPoField_SetupFlee(EnPoField* this) {
void EnPoField_SetupDamage(EnPoField* this) {
Animation_MorphToPlayOnce(&this->skelAnime, &gPoeFieldDamagedAnim, -6.0f);
if (this->collider.info.acHitInfo->toucher.dmgFlags & 0x1F824) {
if (this->collider.info.acHitInfo->toucher.dmgFlags & (DMG_ARROW | DMG_SLINGSHOT)) {
this->actor.world.rot.y = this->collider.base.ac->world.rot.y;
} else {
this->actor.world.rot.y = Actor_WorldYawTowardActor(&this->actor, this->collider.base.ac) + 0x8000;

View file

@ -210,7 +210,7 @@ void EnPoSisters_Init(Actor* thisx, PlayState* play) {
} else {
this->actor.flags &= ~(ACTOR_FLAG_9 | ACTOR_FLAG_14);
this->collider.info.elemType = ELEMTYPE_UNK4;
this->collider.info.bumper.dmgFlags |= 1;
this->collider.info.bumper.dmgFlags |= DMG_DEKU_NUT;
this->collider.base.ocFlags1 = OC1_NONE;
func_80AD9C24(this, NULL);
}
@ -301,7 +301,7 @@ void func_80AD9568(EnPoSisters* this) {
void func_80AD95D8(EnPoSisters* this) {
Animation_MorphToPlayOnce(&this->skelAnime, &gPoeSistersDamagedAnim, -3.0f);
if (this->collider.base.ac != NULL) {
this->actor.world.rot.y = (this->collider.info.acHitInfo->toucher.dmgFlags & 0x1F824)
this->actor.world.rot.y = (this->collider.info.acHitInfo->toucher.dmgFlags & (DMG_ARROW | DMG_SLINGSHOT))
? this->collider.base.ac->world.rot.y
: Actor_WorldYawTowardActor(&this->actor, this->collider.base.ac) + 0x8000;
}
@ -744,7 +744,7 @@ void func_80ADAD54(EnPoSisters* this, PlayState* play) {
if (SkelAnime_Update(&this->skelAnime)) {
this->unk_22E.a = 0;
this->collider.info.bumper.dmgFlags = 0x00060001;
this->collider.info.bumper.dmgFlags = DMG_MAGIC_ICE | DMG_MAGIC_FIRE | DMG_DEKU_NUT;
func_80AD93C4(this);
} else {
endFrame = this->skelAnime.endFrame;
@ -757,7 +757,8 @@ void func_80ADAE6C(EnPoSisters* this, PlayState* play) {
this->unk_22E.a = 255;
if (this->unk_194 != 0) {
this->unk_199 |= 1;
this->collider.info.bumper.dmgFlags = 0x4FC7FFEA;
this->collider.info.bumper.dmgFlags = (DMG_SWORD | DMG_ARROW | DMG_HAMMER | DMG_MAGIC_ICE | DMG_MAGIC_FIRE |
DMG_HOOKSHOT | DMG_EXPLOSIVE | DMG_DEKU_STICK);
if (this->unk_19A != 0) {
this->unk_19A--;
}

View file

@ -293,7 +293,7 @@ void func_80ADE28C(EnPoh* this) {
} else {
Animation_PlayOnce(&this->skelAnime, &gPoeComposerDamagedAnim);
}
if (this->colliderCyl.info.acHitInfo->toucher.dmgFlags & 0x0001F824) {
if (this->colliderCyl.info.acHitInfo->toucher.dmgFlags & (DMG_ARROW | DMG_SLINGSHOT)) {
this->actor.world.rot.y = this->colliderCyl.base.ac->world.rot.y;
} else {
this->actor.world.rot.y = Actor_WorldYawTowardActor(&this->actor, this->colliderCyl.base.ac) + 0x8000;

View file

@ -200,12 +200,16 @@ void EnSsh_InitColliders(EnSsh* this, PlayState* play) {
Collider_SetCylinder(play, &this->colCylinder[i], &this->actor, cylinders[i]);
}
this->colCylinder[0].info.bumper.dmgFlags = 0x0003F8E9;
this->colCylinder[1].info.bumper.dmgFlags = 0xFFC00716;
this->colCylinder[0].info.bumper.dmgFlags =
DMG_ARROW | DMG_MAGIC_FIRE | DMG_HOOKSHOT | DMG_HAMMER_SWING | DMG_EXPLOSIVE | DMG_DEKU_NUT;
this->colCylinder[1].info.bumper.dmgFlags =
DMG_DEFAULT & ~(DMG_ARROW | DMG_MAGIC_FIRE | DMG_HOOKSHOT | DMG_HAMMER_SWING | DMG_EXPLOSIVE | DMG_DEKU_NUT) &
~(DMG_MAGIC_LIGHT | DMG_MAGIC_ICE);
this->colCylinder[2].base.colType = COLTYPE_METAL;
this->colCylinder[2].info.bumperFlags = BUMP_ON | BUMP_HOOKABLE | BUMP_NO_AT_INFO;
this->colCylinder[2].info.elemType = ELEMTYPE_UNK2;
this->colCylinder[2].info.bumper.dmgFlags = 0xFFCC0716;
this->colCylinder[2].info.bumper.dmgFlags =
DMG_DEFAULT & ~(DMG_ARROW | DMG_MAGIC_FIRE | DMG_HOOKSHOT | DMG_HAMMER_SWING | DMG_EXPLOSIVE | DMG_DEKU_NUT);
CollisionCheck_SetInfo2(&this->actor.colChkInfo, DamageTable_Get(2), &sColChkInfoInit);
@ -434,13 +438,13 @@ void EnSsh_CheckBodyStickHit(EnSsh* this, PlayState* play) {
Player* player = GET_PLAYER(play);
if (player->unk_860 != 0) {
info->bumper.dmgFlags |= 2;
this->colCylinder[1].info.bumper.dmgFlags &= ~2;
this->colCylinder[2].info.bumper.dmgFlags &= ~2;
info->bumper.dmgFlags |= DMG_DEKU_STICK;
this->colCylinder[1].info.bumper.dmgFlags &= ~DMG_DEKU_STICK;
this->colCylinder[2].info.bumper.dmgFlags &= ~DMG_DEKU_STICK;
} else {
info->bumper.dmgFlags &= ~2;
this->colCylinder[1].info.bumper.dmgFlags |= 2;
this->colCylinder[2].info.bumper.dmgFlags |= 2;
info->bumper.dmgFlags &= ~DMG_DEKU_STICK;
this->colCylinder[1].info.bumper.dmgFlags |= DMG_DEKU_STICK;
this->colCylinder[2].info.bumper.dmgFlags |= DMG_DEKU_STICK;
}
}

View file

@ -285,12 +285,18 @@ void EnSt_InitColliders(EnSt* this, PlayState* play) {
Collider_SetCylinder(play, &this->colCylinder[i], &this->actor, cylinders[i]);
}
this->colCylinder[0].info.bumper.dmgFlags = 0x0003F8F9;
this->colCylinder[1].info.bumper.dmgFlags = 0xFFC00706;
this->colCylinder[0].info.bumper.dmgFlags =
DMG_MAGIC_FIRE | DMG_ARROW | DMG_HOOKSHOT | DMG_HAMMER_SWING | DMG_BOOMERANG | DMG_EXPLOSIVE | DMG_DEKU_NUT;
this->colCylinder[1].info.bumper.dmgFlags =
DMG_DEFAULT &
~(DMG_MAGIC_FIRE | DMG_ARROW | DMG_HOOKSHOT | DMG_HAMMER_SWING | DMG_BOOMERANG | DMG_EXPLOSIVE | DMG_DEKU_NUT) &
~(DMG_MAGIC_LIGHT | DMG_MAGIC_ICE);
this->colCylinder[2].base.colType = COLTYPE_METAL;
this->colCylinder[2].info.bumperFlags = BUMP_ON | BUMP_HOOKABLE | BUMP_NO_AT_INFO;
this->colCylinder[2].info.elemType = ELEMTYPE_UNK2;
this->colCylinder[2].info.bumper.dmgFlags = 0xFFCC0706;
this->colCylinder[2].info.bumper.dmgFlags =
DMG_DEFAULT &
~(DMG_MAGIC_FIRE | DMG_ARROW | DMG_HOOKSHOT | DMG_HAMMER_SWING | DMG_BOOMERANG | DMG_EXPLOSIVE | DMG_DEKU_NUT);
CollisionCheck_SetInfo2(&this->actor.colChkInfo, DamageTable_Get(2), &sColChkInit);
@ -303,13 +309,13 @@ void EnSt_CheckBodyStickHit(EnSt* this, PlayState* play) {
Player* player = GET_PLAYER(play);
if (player->unk_860 != 0) {
body->bumper.dmgFlags |= 2;
this->colCylinder[1].info.bumper.dmgFlags &= ~2;
this->colCylinder[2].info.bumper.dmgFlags &= ~2;
body->bumper.dmgFlags |= DMG_DEKU_STICK;
this->colCylinder[1].info.bumper.dmgFlags &= ~DMG_DEKU_STICK;
this->colCylinder[2].info.bumper.dmgFlags &= ~DMG_DEKU_STICK;
} else {
body->bumper.dmgFlags &= ~2;
this->colCylinder[1].info.bumper.dmgFlags |= 2;
this->colCylinder[2].info.bumper.dmgFlags |= 2;
body->bumper.dmgFlags &= ~DMG_DEKU_STICK;
this->colCylinder[1].info.bumper.dmgFlags |= DMG_DEKU_STICK;
this->colCylinder[2].info.bumper.dmgFlags |= DMG_DEKU_STICK;
}
}
@ -419,7 +425,7 @@ s32 EnSt_CheckHitFrontside(EnSt* this) {
s32 EnSt_CheckHitBackside(EnSt* this, PlayState* play) {
ColliderCylinder* cyl = &this->colCylinder[0];
s32 flags = 0; // ac hit flags from colliders 0 and 1
s32 flags = 0; // damage flags from colliders 0 and 1
s32 hit = false;
if (cyl->base.acFlags & AC_HIT) {
@ -465,9 +471,7 @@ s32 EnSt_CheckHitBackside(EnSt* this, PlayState* play) {
this->actor.gravity = -1.0f;
Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALWALL_DEAD);
if (flags & 0x1F820) {
// arrow, fire arrow, ice arrow, light arrow,
// and three unknows, unused arrows?
if (flags & DMG_ARROW) {
EnSt_SetupAction(this, EnSt_Die);
this->finishDeathTimer = 8;
} else {

View file

@ -219,7 +219,7 @@ void EnWallmas_SetupReturnToCeiling(EnWallmas* this) {
void EnWallmas_SetupTakeDamage(EnWallmas* this) {
Animation_MorphToPlayOnce(&this->skelAnime, &gWallmasterDamageAnim, -3.0f);
if (this->collider.info.acHitInfo->toucher.dmgFlags & 0x0001F824) {
if (this->collider.info.acHitInfo->toucher.dmgFlags & (DMG_ARROW | DMG_SLINGSHOT)) {
this->actor.world.rot.y = this->collider.base.ac->world.rot.y;
} else {
this->actor.world.rot.y = Actor_WorldYawTowardActor(&this->actor, this->collider.base.ac) + 0x8000;

View file

@ -102,9 +102,14 @@ void EnWonderItem_DropCollectible(EnWonderItem* this, PlayState* play, s32 autoC
}
void EnWonderItem_Init(Actor* thisx, PlayState* play) {
static u32 collisionTypes[] = {
0x00000702 /* sword slash */, 0x0001F820 /* arrow */, 0x00000040 /* hammer */, 0x00000008 /* bomb */,
0x00000004 /* slingshot */, 0x00000010 /* boomerang */, 0x00000080 /* hookshot */,
static u32 damageFlags[] = {
DMG_SLASH | DMG_DEKU_STICK,
DMG_ARROW,
DMG_HAMMER_SWING,
DMG_EXPLOSIVE,
DMG_SLINGSHOT,
DMG_BOOMERANG,
DMG_HOOKSHOT,
};
s32 pad;
s16 colTypeIndex;
@ -154,7 +159,7 @@ void EnWonderItem_Init(Actor* thisx, PlayState* play) {
colTypeIndex = this->actor.world.rot.z & 0xFF;
Collider_InitCylinder(play, &this->collider);
Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit);
this->collider.info.bumper.dmgFlags = collisionTypes[colTypeIndex];
this->collider.info.bumper.dmgFlags = damageFlags[colTypeIndex];
this->collider.dim.radius = 20;
this->collider.dim.height = 30;
this->updateFunc = EnWonderItem_InteractSwitch;
@ -183,7 +188,7 @@ void EnWonderItem_Init(Actor* thisx, PlayState* play) {
case WONDERITEM_BOMB_SOLDIER:
Collider_InitCylinder(play, &this->collider);
Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit);
this->collider.info.bumper.dmgFlags = 0x00000004; // slingshot
this->collider.info.bumper.dmgFlags = DMG_SLINGSHOT;
this->unkPos = this->actor.world.pos;
this->collider.dim.radius = 35;
this->collider.dim.height = 75;

View file

@ -125,7 +125,7 @@ void ObjBombiwa_Update(Actor* thisx, PlayState* play) {
s32 pad;
if ((func_80033684(play, &this->actor) != NULL) ||
((this->collider.base.acFlags & AC_HIT) && (this->collider.info.acHitInfo->toucher.dmgFlags & 0x40000040))) {
((this->collider.base.acFlags & AC_HIT) && (this->collider.info.acHitInfo->toucher.dmgFlags & DMG_HAMMER))) {
ObjBombiwa_Break(this, play);
Flags_SetSwitch(play, this->actor.params & 0x3F);
SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 80, NA_SE_EV_WALL_BROKEN);

View file

@ -177,7 +177,7 @@ void ObjComb_Wait(ObjComb* this, PlayState* play) {
if (this->collider.base.acFlags & AC_HIT) {
this->collider.base.acFlags &= ~AC_HIT;
dmgFlags = this->collider.elements[0].info.acHitInfo->toucher.dmgFlags;
if (dmgFlags & 0x4001F866) {
if (dmgFlags & (DMG_HAMMER | DMG_ARROW | DMG_SLINGSHOT | DMG_DEKU_STICK)) {
this->unk_1B0 = 1500;
} else {
ObjComb_Break(this, play);

View file

@ -170,7 +170,7 @@ void ObjHamishi_Update(Actor* thisx, PlayState* play) {
ObjHamishi_Shake(this);
if ((this->collider.base.acFlags & AC_HIT) && (this->collider.info.acHitInfo->toucher.dmgFlags & 0x40000040)) {
if ((this->collider.base.acFlags & AC_HIT) && (this->collider.info.acHitInfo->toucher.dmgFlags & DMG_HAMMER)) {
this->collider.base.acFlags &= ~AC_HIT;
this->hitCount++;
if (this->hitCount < 2) {

View file

@ -172,7 +172,7 @@ void ObjSyokudai_Update(Actor* thisx, PlayState* play2) {
}
if (this->colliderFlame.base.acFlags & AC_HIT) {
dmgFlags = this->colliderFlame.info.acHitInfo->toucher.dmgFlags;
if (dmgFlags & 0x20820) {
if (dmgFlags & (DMG_FIRE | DMG_ARROW_NORMAL)) {
interactionType = 1;
}
} else if (player->heldItemActionParam == PLAYER_AP_STICK) {
@ -193,17 +193,17 @@ void ObjSyokudai_Update(Actor* thisx, PlayState* play2) {
} else if (player->unk_860 < 200) {
player->unk_860 = 200;
}
} else if (dmgFlags & 0x20) {
} else if (dmgFlags & DMG_ARROW_NORMAL) {
arrow = (EnArrow*)this->colliderFlame.base.ac;
if ((arrow->actor.update != NULL) && (arrow->actor.id == ACTOR_EN_ARROW)) {
arrow->actor.params = 0;
arrow->collider.info.toucher.dmgFlags = 0x800;
arrow->collider.info.toucher.dmgFlags = DMG_ARROW_FIRE;
}
}
if ((0 <= this->litTimer) && (this->litTimer < (50 * litTimeScale + 100)) && (torchType != 0)) {
this->litTimer = 50 * litTimeScale + 100;
}
} else if ((torchType != 0) && (((interactionType > 0) && (dmgFlags & 0x20800)) ||
} else if ((torchType != 0) && (((interactionType > 0) && (dmgFlags & DMG_FIRE)) ||
((interactionType < 0) && (player->unk_860 != 0)))) {
if ((interactionType < 0) && (player->unk_860 < 200)) {

View file

@ -246,7 +246,8 @@ void ObjTsubo_Idle(ObjTsubo* this, PlayState* play) {
ObjTsubo_SpawnCollectible(this, play);
Actor_Kill(&this->actor);
} else if ((this->collider.base.acFlags & AC_HIT) &&
(this->collider.info.acHitInfo->toucher.dmgFlags & 0x4FC1FFFC)) {
(this->collider.info.acHitInfo->toucher.dmgFlags &
(DMG_SWORD | DMG_RANGED | DMG_HAMMER | DMG_BOOMERANG | DMG_EXPLOSIVE))) {
ObjTsubo_AirBreak(this, play);
ObjTsubo_SpawnCollectible(this, play);
SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 20, NA_SE_EV_POT_BROKEN);

View file

@ -3475,10 +3475,10 @@ s32 func_80837818(Player* this) {
return sp18;
}
void func_80837918(Player* this, s32 quadIndex, u32 flags) {
this->meleeWeaponQuads[quadIndex].info.toucher.dmgFlags = flags;
void func_80837918(Player* this, s32 quadIndex, u32 dmgFlags) {
this->meleeWeaponQuads[quadIndex].info.toucher.dmgFlags = dmgFlags;
if (flags == 2) {
if (dmgFlags == DMG_DEKU_STICK) {
this->meleeWeaponQuads[quadIndex].info.toucherFlags = TOUCH_ON | TOUCH_NEAREST | TOUCH_SFX_WOOD;
} else {
this->meleeWeaponQuads[quadIndex].info.toucherFlags = TOUCH_ON | TOUCH_NEAREST;
@ -3486,13 +3486,13 @@ void func_80837918(Player* this, s32 quadIndex, u32 flags) {
}
static u32 D_80854488[][2] = {
{ 0x00000200, 0x08000000 }, { 0x00000100, 0x02000000 }, { 0x00000400, 0x04000000 },
{ 0x00000002, 0x08000000 }, { 0x00000040, 0x40000000 },
{ DMG_SLASH_MASTER, DMG_JUMP_MASTER }, { DMG_SLASH_KOKIRI, DMG_JUMP_KOKIRI }, { DMG_SLASH_GIANT, DMG_JUMP_GIANT },
{ DMG_DEKU_STICK, DMG_JUMP_MASTER }, { DMG_HAMMER_SWING, DMG_HAMMER_JUMP },
};
void func_80837948(PlayState* play, Player* this, s32 arg2) {
s32 pad;
u32 flags;
u32 dmgFlags;
s32 temp;
func_80835C58(play, this, func_808502D0, 0);
@ -3526,13 +3526,13 @@ void func_80837948(PlayState* play, Player* this, s32 arg2) {
}
if ((arg2 >= PLAYER_MWA_FLIPSLASH_START) && (arg2 <= PLAYER_MWA_JUMPSLASH_FINISH)) {
flags = D_80854488[temp][1];
dmgFlags = D_80854488[temp][1];
} else {
flags = D_80854488[temp][0];
dmgFlags = D_80854488[temp][0];
}
func_80837918(this, 0, flags);
func_80837918(this, 1, flags);
func_80837918(this, 0, dmgFlags);
func_80837918(this, 1, dmgFlags);
}
void func_80837AE0(Player* this, s32 timer) {