mirror of
https://github.com/MonsterDruide1/OdysseyDecomp
synced 2026-04-23 09:04:21 +00:00
Review fixes
This commit is contained in:
parent
ffdd1b828e
commit
310b1eae65
|
|
@ -66,23 +66,21 @@ void BossRaidElectric::init(const al::ActorInitInfo& info) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void BossRaidElectric::attackSensor(al::HitSensor* self, al::HitSensor* other) {
|
void BossRaidElectric::attackSensor(al::HitSensor* self, al::HitSensor* other) {
|
||||||
if (!al::isNerve(this, &Wait))
|
if (al::isNerve(this, &Wait) && al::isHitCylinderSensor(other, _12c, mFrontDir, 50.0f))
|
||||||
return;
|
|
||||||
if (al::isHitCylinderSensor(other, _12c, mFrontDir, 50.0f))
|
|
||||||
al::sendMsgEnemyAttack(other, self);
|
al::sendMsgEnemyAttack(other, self);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BossRaidElectric::shot(const sead::Vector3f& pos, const sead::Vector3f& dir,
|
void BossRaidElectric::shot(const sead::Vector3f& pos, const sead::Vector3f& vel,
|
||||||
BossRaidElectric* prevBullet,
|
BossRaidElectric* nextBullet,
|
||||||
al::DeriveActorGroup<BossRaidElectric>* actorGroup) {
|
al::DeriveActorGroup<BossRaidElectric>* actorGroup) {
|
||||||
al::setModelAlphaMask(this, 1.0f);
|
al::setModelAlphaMask(this, 1.0f);
|
||||||
al::showModelIfHide(this);
|
al::showModelIfHide(this);
|
||||||
al::resetPosition(this, pos);
|
al::resetPosition(this, pos);
|
||||||
mMoveDir.set(dir);
|
mVelocity.set(vel);
|
||||||
mNextBullet = prevBullet;
|
mNextBullet = nextBullet;
|
||||||
if (prevBullet != nullptr) {
|
if (nextBullet != nullptr) {
|
||||||
al::showModelIfHide(this);
|
al::showModelIfHide(this);
|
||||||
prevBullet->mPrevBullet = this;
|
nextBullet->mPrevBullet = this;
|
||||||
} else {
|
} else {
|
||||||
al::hideModelIfShow(this);
|
al::hideModelIfShow(this);
|
||||||
}
|
}
|
||||||
|
|
@ -94,22 +92,17 @@ void BossRaidElectric::shot(const sead::Vector3f& pos, const sead::Vector3f& dir
|
||||||
}
|
}
|
||||||
|
|
||||||
void BossRaidElectric::updatePosition() {
|
void BossRaidElectric::updatePosition() {
|
||||||
sead::Vector3f* trans = al::getTransPtr(this);
|
*al::getTransPtr(this) += mVelocity;
|
||||||
*trans += mMoveDir;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void BossRaidElectric::exeWait() {
|
void BossRaidElectric::exeWait() {
|
||||||
if (al::isFirstStep(this))
|
if (al::isFirstStep(this))
|
||||||
al::startAction(this, mNextBullet != nullptr ? "Wait" : "Hide");
|
al::startAction(this, mNextBullet ? "Wait" : "Hide");
|
||||||
|
|
||||||
updateAnimAndJoint();
|
updateAnimAndJoint();
|
||||||
if (_148) {
|
if (_148) {
|
||||||
if (al::isInAreaObj(this, "BossRaidElectricArea", al::getTrans(this))) {
|
if (!al::isInAreaObj(this, "BossRaidElectricArea", al::getTrans(this)))
|
||||||
if (_148)
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
_148 = false;
|
_148 = false;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (isAirAll())
|
if (isAirAll())
|
||||||
al::setNerve(this, &Disappear);
|
al::setNerve(this, &Disappear);
|
||||||
|
|
@ -117,13 +110,11 @@ void BossRaidElectric::exeWait() {
|
||||||
|
|
||||||
void BossRaidElectric::updateAnimAndJoint() {
|
void BossRaidElectric::updateAnimAndJoint() {
|
||||||
_144 = -500.0f;
|
_144 = -500.0f;
|
||||||
if (mNextBullet == nullptr) {
|
if (!mNextBullet) {
|
||||||
_12c = al::getTrans(this);
|
_12c = al::getTrans(this);
|
||||||
al::setSensorRadius(this, "Attack", 50.0f);
|
al::setSensorRadius(this, "Attack", 50.0f);
|
||||||
|
|
||||||
sead::Vector3f scale(1.0f, 1.0f, 1.0f);
|
updateEffectScale(100.0f);
|
||||||
al::setEffectEmitterVolumeScale(this, "Spark", scale);
|
|
||||||
al::setEffectParticleScale(this, "Body", scale);
|
|
||||||
|
|
||||||
mFrontDir.set(sead::Vector3f::ez);
|
mFrontDir.set(sead::Vector3f::ez);
|
||||||
return;
|
return;
|
||||||
|
|
@ -166,31 +157,18 @@ void BossRaidElectric::exeDisappear() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void BossRaidElectric::exeHide() {
|
void BossRaidElectric::exeHide() {
|
||||||
if (!al::isNerve(this, &Hide))
|
if (isHideAll())
|
||||||
return;
|
makeActorDead();
|
||||||
|
|
||||||
BossRaidElectric* next = mNextBullet;
|
|
||||||
if (next == nullptr || al::isNerve(next, &Hide)) {
|
|
||||||
BossRaidElectric* prev = mPrevBullet;
|
|
||||||
if (prev == nullptr) {
|
|
||||||
makeActorDead();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (al::isNerve(prev, &Hide))
|
|
||||||
makeActorDead();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BossRaidElectric::isHideAll() const {
|
bool BossRaidElectric::isHideAll() const {
|
||||||
if (!isHide())
|
if (!isHide())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
BossRaidElectric* next = mNextBullet;
|
if (mNextBullet && !mNextBullet->isHide())
|
||||||
if (next != nullptr && !next->isHide())
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
BossRaidElectric* prev = mPrevBullet;
|
if (mPrevBullet && !mPrevBullet->isHide())
|
||||||
if (prev != nullptr && !prev->isHide())
|
|
||||||
return false;
|
return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
@ -206,13 +184,10 @@ void BossRaidElectric::updateEffectScale(f32 scale) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void BossRaidElectric::calcNearPos(sead::Vector3f* outPos, const sead::Vector3f& targetPos) const {
|
void BossRaidElectric::calcNearPos(sead::Vector3f* outPos, const sead::Vector3f& targetPos) const {
|
||||||
BossRaidElectric* next = mNextBullet;
|
if (mNextBullet) {
|
||||||
const sead::Vector3f& thisTrans = al::getTrans(this);
|
al::calcClosestSegmentPoint(outPos, al::getTrans(this), al::getTrans(mNextBullet),
|
||||||
|
targetPos);
|
||||||
if (next != nullptr) {
|
|
||||||
const sead::Vector3f& nextTrans = al::getTrans(mNextBullet);
|
|
||||||
al::calcClosestSegmentPoint(outPos, thisTrans, nextTrans, targetPos);
|
|
||||||
} else {
|
} else {
|
||||||
outPos->set(thisTrans);
|
outPos->set(al::getTrans(this));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ public:
|
||||||
void setPrevBullet(BossRaidElectric* bullet);
|
void setPrevBullet(BossRaidElectric* bullet);
|
||||||
void setNextBullet(BossRaidElectric* bullet);
|
void setNextBullet(BossRaidElectric* bullet);
|
||||||
|
|
||||||
void shot(const sead::Vector3f& pos, const sead::Vector3f& dir, BossRaidElectric* prevBullet,
|
void shot(const sead::Vector3f& pos, const sead::Vector3f& vel, BossRaidElectric* nextBullet,
|
||||||
al::DeriveActorGroup<BossRaidElectric>* actorGroup);
|
al::DeriveActorGroup<BossRaidElectric>* actorGroup);
|
||||||
void updatePosition();
|
void updatePosition();
|
||||||
void exeWait();
|
void exeWait();
|
||||||
|
|
@ -38,7 +38,7 @@ private:
|
||||||
BossRaidElectric* mPrevBullet = nullptr;
|
BossRaidElectric* mPrevBullet = nullptr;
|
||||||
sead::Vector3f mFrontDir = sead::Vector3f::ez;
|
sead::Vector3f mFrontDir = sead::Vector3f::ez;
|
||||||
sead::Vector3f _12c = sead::Vector3f::zero;
|
sead::Vector3f _12c = sead::Vector3f::zero;
|
||||||
sead::Vector3f mMoveDir = sead::Vector3f::zero;
|
sead::Vector3f mVelocity = sead::Vector3f::zero;
|
||||||
f32 _144 = 0.0f;
|
f32 _144 = 0.0f;
|
||||||
bool _148 = true;
|
bool _148 = true;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue