Add code to track the current map tile the player is in
This commit is contained in:
parent
a2757aca15
commit
e9d51f06e6
@ -6,6 +6,28 @@ using System.Text;
|
|||||||
|
|
||||||
namespace rabi_splitter_WPF
|
namespace rabi_splitter_WPF
|
||||||
{
|
{
|
||||||
|
public struct MapTileCoordinate
|
||||||
|
{
|
||||||
|
public readonly int x;
|
||||||
|
public readonly int y;
|
||||||
|
|
||||||
|
public MapTileCoordinate(int x, int y)
|
||||||
|
{
|
||||||
|
this.x = x;
|
||||||
|
this.y = y;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static MapTileCoordinate FromWorldPosition(int mapid, float px, float py)
|
||||||
|
{
|
||||||
|
// Note: a game-tile is 64x64
|
||||||
|
// A map-tile is 1280x720. (20 x 11.25 game tiles)
|
||||||
|
int x = (int)(px / 1280) + mapid * 25;
|
||||||
|
int y = (int)(py / 720);
|
||||||
|
|
||||||
|
return new MapTileCoordinate(x, y);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public struct BossStats
|
public struct BossStats
|
||||||
{
|
{
|
||||||
public int entityArrayIndex;
|
public int entityArrayIndex;
|
||||||
@ -36,6 +58,7 @@ namespace rabi_splitter_WPF
|
|||||||
|
|
||||||
public readonly float px;
|
public readonly float px;
|
||||||
public readonly float py;
|
public readonly float py;
|
||||||
|
public readonly MapTileCoordinate mapTile;
|
||||||
|
|
||||||
public readonly int entityArrayPtr;
|
public readonly int entityArrayPtr;
|
||||||
public readonly int entityArraySize;
|
public readonly int entityArraySize;
|
||||||
@ -93,7 +116,7 @@ namespace rabi_splitter_WPF
|
|||||||
|
|
||||||
px = memoryHelper.GetMemoryValue<float>(entityArrayPtr + 0xC, false);
|
px = memoryHelper.GetMemoryValue<float>(entityArrayPtr + 0xC, false);
|
||||||
py = memoryHelper.GetMemoryValue<float>(entityArrayPtr + 0x10, false);
|
py = memoryHelper.GetMemoryValue<float>(entityArrayPtr + 0x10, false);
|
||||||
|
mapTile = MapTileCoordinate.FromWorldPosition(mapid, px, py);
|
||||||
|
|
||||||
// Read Entity Array and Search for boss data
|
// Read Entity Array and Search for boss data
|
||||||
bossList = new List<BossStats>();
|
bossList = new List<BossStats>();
|
||||||
|
@ -235,6 +235,8 @@ namespace rabi_splitter_WPF
|
|||||||
|
|
||||||
mainContext.Text14 = $"PLAYTIME: {snapshot.playtime}";
|
mainContext.Text14 = $"PLAYTIME: {snapshot.playtime}";
|
||||||
|
|
||||||
|
mainContext.Text15 = $"Map Tile: ({snapshot.mapTile.x}, {snapshot.mapTile.y})";
|
||||||
|
|
||||||
{
|
{
|
||||||
string bosstext = "Boss Fight: " + (inGameState.currentActivity == InGameActivity.BOSS_BATTLE) + "\n";
|
string bosstext = "Boss Fight: " + (inGameState.currentActivity == InGameActivity.BOSS_BATTLE) + "\n";
|
||||||
bosstext += "Bosses: " + snapshot.bossList.Count + "\n";
|
bosstext += "Bosses: " + snapshot.bossList.Count + "\n";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user