Skip to content

Commit

Permalink
Added some minor hacks to the hook's animations.
Browse files Browse the repository at this point in the history
  • Loading branch information
MilchRatchet committed Jul 25, 2023
1 parent 9284065 commit 6ef556d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
6 changes: 6 additions & 0 deletions LibReplanetizer/Level Objects/Gameplay/Moby.cs
Original file line number Diff line number Diff line change
Expand Up @@ -793,6 +793,12 @@ public void UpdateRC1(byte[] memory, int offset)
position = new Vector4(X, Y, Z, W);
rotation = new Vector4(rotX, rotY, rotZ, rotW);
color = Color.FromRgb((byte) red, (byte) green, (byte) blue).ToPixel<Rgb24>();

// TODO: Understand this better, this is just a hack for now.
if (oClass == 71 || oClass == 190 || oClass == 192 || oClass == 208 || oClass == 229)
{
rotation = rotation + new Vector4(1.5707964f, 0.0f, 0.0f, 0.0f);
}
}

public void UpdateRC23(byte[] memory, int offset)
Expand Down
11 changes: 11 additions & 0 deletions Replanetizer/Renderer/AnimationRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,17 @@ public override void Render(RendererPayload payload)

int animationFrame = (mob != null && mob.memory != null) ? mob.memory.animationFrame : currentFrameID;

// For Example: RaC 1 bomb glove idles in the last frame of the animation despite the first one being selected.
// TODO: Understand what is happening in these cases.
if (anim != null && mob != null && mob.memory != null && mob.memory.animState == 0)
{
animationFrame--;
if (animationFrame < 0)
{
animationFrame += anim.frames.Count;
}
}

Frame? frame = (anim != null && animationFrame >= 0 && animationFrame < anim.frames.Count) ? anim.frames[animationFrame] : null;

if (anim != null && frame != null)
Expand Down

0 comments on commit 6ef556d

Please sign in to comment.