Skip to content

Commit

Permalink
bit more pikistate
Browse files Browse the repository at this point in the history
PikiFlyingState::exec and PikiDrownState::exec should now be logically equivalent
  • Loading branch information
pish-pish committed Dec 23, 2024
1 parent 1f4421d commit b48a51d
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/plugProjectKandoU/pikiState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -850,16 +850,14 @@ void PikiFountainonState::exec(Piki* piki)

// regswaps here
f32 p1 = mTargetDist * 0.4f;
f32 val = p1 * mTimer * mTimer;
f32 p2 = -50.0f / SQUARE(mTargetDist);
f32 otherFactor = 50.0f + val;
f32 otherFactor = 50.0f + p2 * SQUARE(mTimer);

if (mTimer >= p1) {
f32 factor = 50.0f + p2 * p1 * p1 + (mTimer - p1);
f32 factor = 50.0f + p2 * SQUARE(p1) + (mTimer - p1);
position = mPosDiff * p1 + mAvgPosition;
position.y += factor;
mTimer += sys->mDeltaTime * 400.0f;

} else {
position = mPosDiff * mTimer + mAvgPosition;
position.y += otherFactor;
Expand Down Expand Up @@ -3745,7 +3743,8 @@ void PikiFlyingState::exec(Piki* piki)
mVelocityDirection.y = 0.0f;
mVelocityDirection.z = piki->mVelocity.z;

f32 throwMagnitude = landingTime * 0.5f / (-fallFactor + heightOffset) / flowerFallFactor;
f32 heightFactor = -fallFactor + heightOffset;
f32 throwMagnitude = landingTime * 0.5f / (heightFactor / flowerFallFactor);

mVelocityDirection.normalise();

Expand Down

0 comments on commit b48a51d

Please sign in to comment.