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>
/// Gets position of this <see cref="Actor" />.
/// Gets the position of this <see cref="Actor" />.
/// </summary>
public Position3 Position => this.ActorStruct.Position;
/// <summary>
/// Gets rotation of this <see cref="Actor" />.
/// Gets the rotation of this <see cref="Actor" />.
/// This ranges from -pi to pi radians.
/// </summary>
public float Rotation => this.ActorStruct.Rotation;
/// <summary>
/// Gets displayname of this <see cref="Actor" />.
/// Gets the displayname of this <see cref="Actor" />.
/// </summary>
public string Name => this.ActorStruct.Name;
/// <summary>
/// Gets actor ID of this <see cref="Actor" />.
/// Gets the actor ID of this <see cref="Actor" />.
/// </summary>
public int ActorId => this.ActorStruct.ActorId;
/// <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.
/// </summary>
public ObjectKind ObjectKind => this.ActorStruct.ObjectKind;
@ -71,7 +76,7 @@ namespace Dalamud.Game.ClientState.Actors.Types
public virtual int TargetActorID => 0;
/// <summary>
/// Gets status Effects.
/// Gets status Effects.
/// </summary>
public StatusEffect[] StatusEffects => this.ActorStruct.UIStatusEffects;

View file

@ -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;

View file

@ -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;
}
}

View file

@ -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;
}
}