mirror of
https://github.com/zeldaret/oot.git
synced 2025-08-21 14:31:17 +00:00
Cleanup z_collision_check
1 (#1427)
* Cleanup `z_collision_check.c` and structs
* Revert `other*` names to master, split to other pr
* WIP/experimental: `ColliderCylinderElement`
* Revert "WIP/experimental: `ColliderCylinderElement`"
This reverts commit cfc8c32ace
.
* ac/atHitInfo -> HitElem
* rename some collider elements to "elem" (instead of item, info, hurtbox...)
* cut down on more "hitbox" usage
* name all `ColliderElement*` temps properly
* rearrange colcheck structs
* add collider shape name descriptions
* reword collider shape descriptions
* jntsph first again
---------
Co-authored-by: fig02 <fig02srl@gmail.com>
This commit is contained in:
parent
f02d012ce7
commit
1a8772e540
93 changed files with 1725 additions and 1601 deletions
|
@ -1139,25 +1139,25 @@ void BossMo_TentCollisionCheck(BossMo* this, PlayState* play) {
|
|||
s16 i1;
|
||||
|
||||
for (i1 = 0; i1 < ARRAY_COUNT(this->tentElements); i1++) {
|
||||
if (this->tentCollider.elements[i1].info.bumperFlags & BUMP_HIT) {
|
||||
if (this->tentCollider.elements[i1].base.bumperFlags & BUMP_HIT) {
|
||||
s16 i2;
|
||||
ColliderInfo* hurtbox;
|
||||
ColliderElement* acHitElem;
|
||||
|
||||
for (i2 = 0; i2 < 19; i2++) {
|
||||
this->tentCollider.elements[i2].info.bumperFlags &= ~BUMP_HIT;
|
||||
this->tentCollider.elements[i2].info.toucherFlags &= ~TOUCH_HIT;
|
||||
this->tentCollider.elements[i2].base.bumperFlags &= ~BUMP_HIT;
|
||||
this->tentCollider.elements[i2].base.toucherFlags &= ~TOUCH_HIT;
|
||||
}
|
||||
hurtbox = this->tentCollider.elements[i1].info.acHitInfo;
|
||||
acHitElem = this->tentCollider.elements[i1].base.acHitElem;
|
||||
this->work[MO_TENT_INVINC_TIMER] = 5;
|
||||
if (hurtbox->toucher.dmgFlags & DMG_MAGIC_FIRE) {
|
||||
if (acHitElem->toucher.dmgFlags & DMG_MAGIC_FIRE) {
|
||||
Sfx_PlaySfxAtPos(&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 & (DMG_JUMP_MASTER | DMG_JUMP_GIANT | DMG_SPIN_MASTER |
|
||||
DMG_SPIN_GIANT | DMG_SLASH_GIANT | DMG_SLASH_MASTER)) {
|
||||
} else if (acHitElem->toucher.dmgFlags & (DMG_JUMP_MASTER | DMG_JUMP_GIANT | DMG_SPIN_MASTER |
|
||||
DMG_SPIN_GIANT | DMG_SLASH_GIANT | DMG_SLASH_MASTER)) {
|
||||
this->playerHitTimer = 5;
|
||||
}
|
||||
this->tentRippleSize = 0.2f;
|
||||
|
@ -1175,8 +1175,8 @@ void BossMo_TentCollisionCheck(BossMo* this, PlayState* play) {
|
|||
Rand_ZeroFloat(0.08f) + 0.13f);
|
||||
}
|
||||
break;
|
||||
} else if (this->tentCollider.elements[i1].info.toucherFlags & TOUCH_HIT) {
|
||||
this->tentCollider.elements[i1].info.toucherFlags &= ~TOUCH_HIT;
|
||||
} else if (this->tentCollider.elements[i1].base.toucherFlags & TOUCH_HIT) {
|
||||
this->tentCollider.elements[i1].base.toucherFlags &= ~TOUCH_HIT;
|
||||
this->playerHitTimer = 5;
|
||||
break;
|
||||
}
|
||||
|
@ -1745,17 +1745,17 @@ void BossMo_CoreCollisionCheck(BossMo* this, PlayState* play) {
|
|||
}
|
||||
}
|
||||
if (this->coreCollider.base.acFlags & AC_HIT) {
|
||||
ColliderInfo* hurtbox = this->coreCollider.info.acHitInfo;
|
||||
ColliderElement* acHitElem = this->coreCollider.elem.acHitElem;
|
||||
// "hit!!"
|
||||
osSyncPrintf("Core_Damage_check 当り!!\n");
|
||||
this->coreCollider.base.acFlags &= ~AC_HIT;
|
||||
if ((hurtbox->toucher.dmgFlags & DMG_MAGIC_FIRE) && (this->work[MO_TENT_ACTION_STATE] == MO_CORE_ATTACK)) {
|
||||
if ((acHitElem->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 !!"
|
||||
osSyncPrintf("Core_Damage_check 当り 2 !!\n");
|
||||
if ((this->work[MO_TENT_ACTION_STATE] != MO_CORE_UNDERWATER) && (this->work[MO_TENT_INVINC_TIMER] == 0)) {
|
||||
u8 damage = CollisionCheck_GetSwordDamage(hurtbox->toucher.dmgFlags);
|
||||
u8 damage = CollisionCheck_GetSwordDamage(acHitElem->toucher.dmgFlags);
|
||||
|
||||
if ((damage != 0) && (this->work[MO_TENT_ACTION_STATE] < MO_CORE_ATTACK)) {
|
||||
// "sword hit !!"
|
||||
|
@ -1793,7 +1793,7 @@ void BossMo_CoreCollisionCheck(BossMo* this, PlayState* play) {
|
|||
}
|
||||
}
|
||||
this->work[MO_TENT_INVINC_TIMER] = 10;
|
||||
} else if (!(hurtbox->toucher.dmgFlags & DMG_SHIELD) && (hurtbox->toucher.dmgFlags & DMG_HOOKSHOT)) {
|
||||
} else if (!(acHitElem->toucher.dmgFlags & DMG_SHIELD) && (acHitElem->toucher.dmgFlags & DMG_HOOKSHOT)) {
|
||||
if (this->work[MO_TENT_ACTION_STATE] >= MO_CORE_ATTACK) {
|
||||
Sfx_PlaySfxAtPos(&sMorphaTent1->tentTipPos, NA_SE_EN_MOFER_CUT);
|
||||
sMorphaTent1->cutIndex = this->work[MO_CORE_POS_IN_TENT];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue