diff --git a/TF2.CT b/TF2.CT index 49bf7a7..a0582c7 100644 --- a/TF2.CT +++ b/TF2.CT @@ -208,7 +208,6 @@ 47 "UPDATE: Neither of these were the current tick number" - 1 @@ -228,7 +227,6 @@ 77 "Potential current tick values. Look for increments of 20 or 60 per second" - 1 @@ -302,7 +300,6 @@ 78 "These ones set themselves to 1 when the match gets out" - 1 @@ -352,7 +349,6 @@ 79 "These ones set themselves to 0 when the match gets out" - 1 @@ -384,7 +380,6 @@ 80 "These ones seem to be incrementing by 20" - 1 @@ -438,7 +433,7 @@ 84 - "Currently equpped titan (engine.dll+7A7429)" + "Currently equipped titan (engine.dll+7A7429)" Byte
engine.dll+7A7429
diff --git a/titanfall2-rp/GameDetailsProvider.cs b/titanfall2-rp/GameDetailsProvider.cs index e0e6eac..46a5b79 100644 --- a/titanfall2-rp/GameDetailsProvider.cs +++ b/titanfall2-rp/GameDetailsProvider.cs @@ -24,12 +24,13 @@ public static (string, string, Timestamps?, Assets? assets) GetMultiplayerDetail string gameDetails = tf2Api.GetGameMode().ToFriendlyString(); string gameState = $"{mpStats.GetTeam1Score()}:{mpStats.GetTeam2Score()}"; var timestamps = new Timestamps(gameOpenTimestamp); + var playerInTitan = tf2Api.IsPlayerInTitan(); var assets = new Assets { LargeImageKey = tf2Api.GetMultiplayerMapName(), LargeImageText = tf2Api.GetFriendlyMapName(), - SmallImageKey = tf2Api.GetMultiPlayerGameStats().GetCurrentFaction().GetAssetName(), - SmallImageText = tf2Api.GetMultiPlayerGameStats().GetCurrentFaction().ToFriendlyString(), + SmallImageKey = playerInTitan ? tf2Api.GetTitan().GetAssetName() : tf2Api.GetMultiPlayerGameStats().GetCurrentFaction().GetAssetName(), + SmallImageText = playerInTitan ? tf2Api.GetTitan().ToFriendlyString() : tf2Api.GetMultiPlayerGameStats().GetCurrentFaction().ToFriendlyString(), }; return (gameDetails, gameState, timestamps, assets); } diff --git a/titanfall2-rp/Titanfall2API.cs b/titanfall2-rp/Titanfall2API.cs index 5c8c639..96aaf13 100644 --- a/titanfall2-rp/Titanfall2API.cs +++ b/titanfall2-rp/Titanfall2API.cs @@ -32,6 +32,57 @@ public int GetPlayerHealth() return _sharp!.Memory.Read(EngineDllBaseAddress + 0x1122A8DC); } + /// + /// Here's the list of addresses that all reflected the pilot being inside a titan: + /// engine.dll+111E18DC + /// engine.dll+111E18E0 + /// engine.dll+111E1CB8 + /// engine.dll+111E1D10 + /// engine.dll+111E1D34 + /// engine.dll+111E1DAC + /// engine.dll+111E1DB8 + /// engine.dll+111E1DC4 + /// engine.dll+1128D850 + /// engine.dll+112910F4 + /// client.dll+21720D7 + /// client.dll+22BFEC9 + /// client.dll+22BFED5 + /// client.dll+22BFEE5 + /// client.dll+22BFF01 + /// client.dll+22BFF0D + /// client.dll+22BFF1D + /// client.dll+22BFF39 + /// client.dll+22BFF45 + /// client.dll+22BFF55 + /// client.dll+22C75E5 + /// client.dll+22C7605 + /// client.dll+22C7780 + /// client.dll+22C78A0 + /// client.dll+23F5B48 + /// client.dll+23F5B68 + /// client.dll+23F5B88 + /// client.dll+23F5BA8 + /// client.dll+23F5BC8 + /// client.dll+23F5BE8 + /// client.dll+23F5C08 + /// client.dll+23F5C28 + /// client.dll+23F5C48 + /// materialsystem_dx11.dll+1A98090 + /// + /// true if the pilot is in a titan; else false + /// This shit ain't stable, chief + public bool IsPlayerInTitan() + { + _ensureInit(); + return _sharp!.Memory.Read(EngineDllBaseAddress + 0x111E18DC) != 0; + } + + public Titan GetTitan() + { + _ensureInit(); + return TitanMethods.GetTitan(_sharp!.Memory.Read(EngineDllBaseAddress + 0x7A7429, 1)[0]); + } + public int GetPlayerVelocity() { _ensureInit(); diff --git a/titanfall2-rp/enums/Titan.cs b/titanfall2-rp/enums/Titan.cs new file mode 100644 index 0000000..f2e9780 --- /dev/null +++ b/titanfall2-rp/enums/Titan.cs @@ -0,0 +1,32 @@ +namespace titanfall2_rp.enums +{ + public enum Titan + { + Ion, + Scorch, + Northstar, + // ReSharper disable once IdentifierTypo + Ronin, + Tone, + Legion, + Monarch, + } + + internal static class TitanMethods + { + public static Titan GetTitan(int titanValue) + { + return (Titan)titanValue; + } + + public static string ToFriendlyString(this Titan titan) + { + return titan.ToString(); + } + + public static string GetAssetName(this Titan titan) + { + return titan.ToString().ToLower(); + } + } +} \ No newline at end of file