1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-21 22:41:14 +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

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