Skip to content

Commit

Permalink
3.11.0 Added option for R2 to remove death+respawn animations
Browse files Browse the repository at this point in the history
  • Loading branch information
rtsonneveld committed Jan 14, 2024
1 parent e2ad8e8 commit dd28ce3
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 1 deletion.
Expand Up @@ -30,7 +30,7 @@ public Rayman2CheckpointExtra(Rayman2GameManager gameManager, CheckpointMode mod
RespawnPersoPointer = 0x4B7308;
RespawnPersoPointerPath = new int[] {0xC, 0, 0x4, 0x1C, 0xA90 };

Tooltip = "⚠ Warning: these actions modify the program's executable memory and require a game restart to undo!";
Tooltip = "⚠ Warning: these actions require a game restart to undo!";
}

public CheckpointMode Mode { get; set; }
Expand Down
Expand Up @@ -40,6 +40,7 @@ public Rayman2GameManager()
new Rayman2ProgressArrayExtra(this),
new Rayman2CheckpointExtra(this, Rayman2CheckpointExtra.CheckpointMode.CurrentPosition),
new Rayman2CheckpointExtra(this, Rayman2CheckpointExtra.CheckpointMode.SavedPosition),
new Rayman2RespawnAnimRemover(this),
};

//Levels
Expand Down
@@ -0,0 +1,28 @@
using System;
using System.Threading;

namespace OpenSpaceToolbox
{
public class Rayman2RespawnAnimRemover : OpenspaceExtraAction {

public Rayman2RespawnAnimRemover(Rayman2GameManager gameManager) : base(gameManager)
{
Name = ShortName = $"⚠ Remove death+respawn animations";

Tooltip = "⚠ Warning: these actions require a game restart to undo!";
}

public override void Action()
{
int processHandle = GameManager.GetProcessHandle();
if (processHandle < 0)
return;

int[] pathDeathAnimNumFrames = new int[] { 0x44, 0x8, 0x0, 0xC, 0x4, 0x20, 0x80 };
int[] pathSpawnAnimNumFrames = new int[] { 0x3C, 0x0, 0x58, 0x4, 0x38, 0x0, 0x184};

GameManager.WriteBytes(new byte[1] { 1 }, 0x500560, pathDeathAnimNumFrames);
GameManager.WriteBytes(new byte[1] { 1 }, 0x500560, pathSpawnAnimNumFrames);
}
}
}
1 change: 1 addition & 0 deletions OpenSpaceToolbox/OpenSpaceToolbox.csproj
Expand Up @@ -98,6 +98,7 @@
<Compile Include="DataModels\GameItem.cs" />
<Compile Include="DataModels\GameList.cs" />
<Compile Include="GameManager\Games\Generic\GenericSpeedMonitorExtra.cs" />
<Compile Include="GameManager\Games\Rayman2\Rayman2RespawnAnimRemover.cs" />
<Compile Include="GameManager\Games\Rayman2\Rayman2MaxHpExtra.cs" />
<Compile Include="GameManager\Games\Rayman2\Rayman2ProgressArrayExtra.cs" />
<Compile Include="GameManager\Games\Rayman2\Rayman2CheckpointExtra.cs" />
Expand Down

0 comments on commit dd28ce3

Please sign in to comment.