Merge pull request #315 from daemitus/master

Actor.HitboxRadius, MNK/NINGauge updates + StyleCop
This commit is contained in:
goaaats 2021-04-14 16:27:29 +02:00 committed by GitHub
commit 3c1ec83a04
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 37 additions and 27 deletions

View file

@ -29,28 +29,33 @@ namespace Dalamud.Game.ClientState.Actors.Types
} }
/// <summary> /// <summary>
/// Gets position of this <see cref="Actor" />. /// Gets the position of this <see cref="Actor" />.
/// </summary> /// </summary>
public Position3 Position => this.ActorStruct.Position; public Position3 Position => this.ActorStruct.Position;
/// <summary> /// <summary>
/// Gets rotation of this <see cref="Actor" />. /// Gets the rotation of this <see cref="Actor" />.
/// This ranges from -pi to pi radians. /// This ranges from -pi to pi radians.
/// </summary> /// </summary>
public float Rotation => this.ActorStruct.Rotation; public float Rotation => this.ActorStruct.Rotation;
/// <summary> /// <summary>
/// Gets displayname of this <see cref="Actor" />. /// Gets the displayname of this <see cref="Actor" />.
/// </summary> /// </summary>
public string Name => this.ActorStruct.Name; public string Name => this.ActorStruct.Name;
/// <summary> /// <summary>
/// Gets actor ID of this <see cref="Actor" />. /// Gets the actor ID of this <see cref="Actor" />.
/// </summary> /// </summary>
public int ActorId => this.ActorStruct.ActorId; public int ActorId => this.ActorStruct.ActorId;
/// <summary> /// <summary>
/// Gets entity kind of this <see cref="Actor" />. /// Gets the hitbox radius of this <see cref="Actor" />.
/// </summary>
public float HitboxRadius => this.ActorStruct.HitboxRadius;
/// <summary>
/// Gets the entity kind of this <see cref="Actor" />.
/// See <see cref="ObjectKind">the ObjectKind enum</see> for possible values. /// See <see cref="ObjectKind">the ObjectKind enum</see> for possible values.
/// </summary> /// </summary>
public ObjectKind ObjectKind => this.ActorStruct.ObjectKind; public ObjectKind ObjectKind => this.ActorStruct.ObjectKind;

View file

@ -20,6 +20,7 @@ namespace Dalamud.Game.ClientState.Structs
public const int YalmDistanceFromPlayerY = 146; // 0x0092 Distance public const int YalmDistanceFromPlayerY = 146; // 0x0092 Distance
public const int Position = 160; // 0x00A0 (X,Z,Y) public const int Position = 160; // 0x00A0 (X,Z,Y)
public const int Rotation = 176; // 0x00B0 Heading public const int Rotation = 176; // 0x00B0 Heading
public const int HitboxRadius = 190;
public const int CurrentHp = 452; // 0x01C4 HPCurrent public const int CurrentHp = 452; // 0x01C4 HPCurrent
public const int MaxHp = 456; // 0x01C8 HPMax public const int MaxHp = 456; // 0x01C8 HPMax
public const int CurrentMp = 460; // 0x01CC MPCurrent 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.YalmDistanceFromPlayerY)] public byte YalmDistanceFromPlayerY; // and the other is z distance
[FieldOffset(ActorOffsets.Position)] public Position3 Position; [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.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.CurrentHp)] public int CurrentHp;
[FieldOffset(ActorOffsets.MaxHp)] public int MaxHp; [FieldOffset(ActorOffsets.MaxHp)] public int MaxHp;
[FieldOffset(ActorOffsets.CurrentMp)] public int CurrentMp; [FieldOffset(ActorOffsets.CurrentMp)] public int CurrentMp;

View file

@ -1,21 +1,23 @@
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices; 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)] [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; [FieldOffset(0)] public byte GLTimer;
[Obsolete("GL has been removed from the game")]
[FieldOffset(2)] public byte NumGLStacks; [FieldOffset(2)] public byte NumGLStacks;
[FieldOffset(3)] public byte NumChakra;
[Obsolete("GL has been removed from the game")]
[FieldOffset(4)] private byte GLTimerFreezeState; [FieldOffset(4)] private byte GLTimerFreezeState;
public bool IsGLTimerFroze() { [Obsolete("GL has been removed from the game")]
return GLTimerFreezeState > 0; public bool IsGLTimerFroze() => false;
}
} }
} }

View file

@ -1,17 +1,18 @@
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices; 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)] [StructLayout(LayoutKind.Explicit)]
public struct NINGauge { public struct NINGauge
{
[FieldOffset(0)] public int HutonTimeLeft; [FieldOffset(0)] public int HutonTimeLeft;
[FieldOffset(4)] public byte TCJMudrasUsed; //some sort of mask [FieldOffset(4)] public byte Ninki;
[FieldOffset(5)] public byte Ninki;
[FieldOffset(6)] public byte NumHutonManualCasts; //wtf [Obsolete("Does not appear to be used")]
[FieldOffset(4)] public byte TCJMudrasUsed;
[Obsolete("Does not appear to be used")]
[FieldOffset(6)] public byte NumHutonManualCasts;
} }
} }