From 7d83ac126fee6f82cf7f3cc669f3353f2d098da4 Mon Sep 17 00:00:00 2001 From: Raymond Lynch Date: Tue, 13 Apr 2021 22:42:50 -0400 Subject: [PATCH] Actor.HitboxRadius, MNK/NINGauge updates As requested by illion --- .../Game/ClientState/Actors/Types/Actor.cs | 17 ++++++++----- Dalamud/Game/ClientState/Structs/Actor.cs | 2 ++ .../ClientState/Structs/JobGauge/MNKGauge.cs | 24 ++++++++++--------- .../ClientState/Structs/JobGauge/NINGauge.cs | 21 ++++++++-------- 4 files changed, 37 insertions(+), 27 deletions(-) diff --git a/Dalamud/Game/ClientState/Actors/Types/Actor.cs b/Dalamud/Game/ClientState/Actors/Types/Actor.cs index 6470f5136..0c095bfb4 100644 --- a/Dalamud/Game/ClientState/Actors/Types/Actor.cs +++ b/Dalamud/Game/ClientState/Actors/Types/Actor.cs @@ -29,28 +29,33 @@ namespace Dalamud.Game.ClientState.Actors.Types } /// - /// Gets position of this . + /// Gets the position of this . /// public Position3 Position => this.ActorStruct.Position; /// - /// Gets rotation of this . + /// Gets the rotation of this . /// This ranges from -pi to pi radians. /// public float Rotation => this.ActorStruct.Rotation; /// - /// Gets displayname of this . + /// Gets the displayname of this . /// public string Name => this.ActorStruct.Name; /// - /// Gets actor ID of this . + /// Gets the actor ID of this . /// public int ActorId => this.ActorStruct.ActorId; /// - /// Gets entity kind of this . + /// Gets the hitbox radius of this . + /// + public float HitboxRadius => this.ActorStruct.HitboxRadius; + + /// + /// Gets the entity kind of this . /// See the ObjectKind enum for possible values. /// public ObjectKind ObjectKind => this.ActorStruct.ObjectKind; @@ -71,7 +76,7 @@ namespace Dalamud.Game.ClientState.Actors.Types public virtual int TargetActorID => 0; /// - /// Gets status Effects. + /// Gets status Effects. /// public StatusEffect[] StatusEffects => this.ActorStruct.UIStatusEffects; diff --git a/Dalamud/Game/ClientState/Structs/Actor.cs b/Dalamud/Game/ClientState/Structs/Actor.cs index 5cd9ee019..d926b98e5 100644 --- a/Dalamud/Game/ClientState/Structs/Actor.cs +++ b/Dalamud/Game/ClientState/Structs/Actor.cs @@ -20,6 +20,7 @@ namespace Dalamud.Game.ClientState.Structs public const int YalmDistanceFromPlayerY = 146; // 0x0092 Distance public const int Position = 160; // 0x00A0 (X,Z,Y) public const int Rotation = 176; // 0x00B0 Heading + public const int HitboxRadius = 190; public const int CurrentHp = 452; // 0x01C4 HPCurrent public const int MaxHp = 456; // 0x01C8 HPMax public const int CurrentMp = 460; // 0x01CC MPCurrent @@ -66,6 +67,7 @@ namespace Dalamud.Game.ClientState.Structs [FieldOffset(ActorOffsets.YalmDistanceFromPlayerY)] public byte YalmDistanceFromPlayerY; // and the other is z distance [FieldOffset(ActorOffsets.Position)] public Position3 Position; [FieldOffset(ActorOffsets.Rotation)] public float Rotation; // Rotation around the vertical axis (yaw), from -pi to pi radians + [FieldOffset(ActorOffsets.HitboxRadius)] public float HitboxRadius; [FieldOffset(ActorOffsets.CurrentHp)] public int CurrentHp; [FieldOffset(ActorOffsets.MaxHp)] public int MaxHp; [FieldOffset(ActorOffsets.CurrentMp)] public int CurrentMp; diff --git a/Dalamud/Game/ClientState/Structs/JobGauge/MNKGauge.cs b/Dalamud/Game/ClientState/Structs/JobGauge/MNKGauge.cs index 0d40ee780..1d46346ec 100644 --- a/Dalamud/Game/ClientState/Structs/JobGauge/MNKGauge.cs +++ b/Dalamud/Game/ClientState/Structs/JobGauge/MNKGauge.cs @@ -1,21 +1,23 @@ using System; -using System.Collections.Generic; -using System.Linq; using System.Runtime.InteropServices; -using System.Text; -using System.Threading.Tasks; - -namespace Dalamud.Game.ClientState.Structs.JobGauge { +namespace Dalamud.Game.ClientState.Structs.JobGauge +{ [StructLayout(LayoutKind.Explicit)] - public struct MNKGauge { + public struct MNKGauge + { + [FieldOffset(0)] public byte NumChakra; + + [Obsolete("GL has been removed from the game")] [FieldOffset(0)] public byte GLTimer; + + [Obsolete("GL has been removed from the game")] [FieldOffset(2)] public byte NumGLStacks; - [FieldOffset(3)] public byte NumChakra; + + [Obsolete("GL has been removed from the game")] [FieldOffset(4)] private byte GLTimerFreezeState; - public bool IsGLTimerFroze() { - return GLTimerFreezeState > 0; - } + [Obsolete("GL has been removed from the game")] + public bool IsGLTimerFroze() => false; } } diff --git a/Dalamud/Game/ClientState/Structs/JobGauge/NINGauge.cs b/Dalamud/Game/ClientState/Structs/JobGauge/NINGauge.cs index 672e27b81..36f9bb268 100644 --- a/Dalamud/Game/ClientState/Structs/JobGauge/NINGauge.cs +++ b/Dalamud/Game/ClientState/Structs/JobGauge/NINGauge.cs @@ -1,17 +1,18 @@ using System; -using System.Collections.Generic; -using System.Linq; using System.Runtime.InteropServices; -using System.Text; -using System.Threading.Tasks; - -namespace Dalamud.Game.ClientState.Structs.JobGauge { +namespace Dalamud.Game.ClientState.Structs.JobGauge +{ [StructLayout(LayoutKind.Explicit)] - public struct NINGauge { + public struct NINGauge + { [FieldOffset(0)] public int HutonTimeLeft; - [FieldOffset(4)] public byte TCJMudrasUsed; //some sort of mask - [FieldOffset(5)] public byte Ninki; - [FieldOffset(6)] public byte NumHutonManualCasts; //wtf + [FieldOffset(4)] public byte Ninki; + + [Obsolete("Does not appear to be used")] + [FieldOffset(4)] public byte TCJMudrasUsed; + + [Obsolete("Does not appear to be used")] + [FieldOffset(6)] public byte NumHutonManualCasts; } }