mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-02-21 15:27:43 +01:00
Job Gauge update
This commit is contained in:
parent
409ce984da
commit
a5cccf8a76
53 changed files with 1216 additions and 1006 deletions
23
Dalamud/Game/ClientState/JobGauge/Enums/BOTDState.cs
Normal file
23
Dalamud/Game/ClientState/JobGauge/Enums/BOTDState.cs
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
namespace Dalamud.Game.ClientState.JobGauge.Enums
|
||||
{
|
||||
/// <summary>
|
||||
/// DRG Blood of the Dragon state types.
|
||||
/// </summary>
|
||||
public enum BOTDState : byte
|
||||
{
|
||||
/// <summary>
|
||||
/// Inactive type.
|
||||
/// </summary>
|
||||
NONE = 0,
|
||||
|
||||
/// <summary>
|
||||
/// Blood of the Dragon is active.
|
||||
/// </summary>
|
||||
BOTD = 1,
|
||||
|
||||
/// <summary>
|
||||
/// Life of the Dragon is active.
|
||||
/// </summary>
|
||||
LOTD = 2,
|
||||
}
|
||||
}
|
||||
53
Dalamud/Game/ClientState/JobGauge/Enums/CardType.cs
Normal file
53
Dalamud/Game/ClientState/JobGauge/Enums/CardType.cs
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
namespace Dalamud.Game.ClientState.JobGauge.Enums
|
||||
{
|
||||
/// <summary>
|
||||
/// AST Arcanum (card) types.
|
||||
/// </summary>
|
||||
public enum CardType : byte
|
||||
{
|
||||
/// <summary>
|
||||
/// No card.
|
||||
/// </summary>
|
||||
NONE = 0,
|
||||
|
||||
/// <summary>
|
||||
/// The Balance card.
|
||||
/// </summary>
|
||||
BALANCE = 1,
|
||||
|
||||
/// <summary>
|
||||
/// The Bole card.
|
||||
/// </summary>
|
||||
BOLE = 2,
|
||||
|
||||
/// <summary>
|
||||
/// The Arrow card.
|
||||
/// </summary>
|
||||
ARROW = 3,
|
||||
|
||||
/// <summary>
|
||||
/// The Spear card.
|
||||
/// </summary>
|
||||
SPEAR = 4,
|
||||
|
||||
/// <summary>
|
||||
/// The Ewer card.
|
||||
/// </summary>
|
||||
EWER = 5,
|
||||
|
||||
/// <summary>
|
||||
/// The Spire card.
|
||||
/// </summary>
|
||||
SPIRE = 6,
|
||||
|
||||
/// <summary>
|
||||
/// The Lord of Crowns card.
|
||||
/// </summary>
|
||||
LORD = 0x70,
|
||||
|
||||
/// <summary>
|
||||
/// The Lady of Crowns card.
|
||||
/// </summary>
|
||||
LADY = 0x80,
|
||||
}
|
||||
}
|
||||
18
Dalamud/Game/ClientState/JobGauge/Enums/DismissedFairy.cs
Normal file
18
Dalamud/Game/ClientState/JobGauge/Enums/DismissedFairy.cs
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
namespace Dalamud.Game.ClientState.JobGauge.Enums
|
||||
{
|
||||
/// <summary>
|
||||
/// SCH Dismissed fairy types.
|
||||
/// </summary>
|
||||
public enum DismissedFairy : byte
|
||||
{
|
||||
/// <summary>
|
||||
/// Dismissed fairy is Eos.
|
||||
/// </summary>
|
||||
EOS = 6,
|
||||
|
||||
/// <summary>
|
||||
/// Dismissed fairy is Selene.
|
||||
/// </summary>
|
||||
SELENE = 7,
|
||||
}
|
||||
}
|
||||
23
Dalamud/Game/ClientState/JobGauge/Enums/Mudras.cs
Normal file
23
Dalamud/Game/ClientState/JobGauge/Enums/Mudras.cs
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
namespace Dalamud.Game.ClientState.JobGauge.Enums
|
||||
{
|
||||
/// <summary>
|
||||
/// NIN Mudra types.
|
||||
/// </summary>
|
||||
public enum Mudras : byte
|
||||
{
|
||||
/// <summary>
|
||||
/// Ten mudra.
|
||||
/// </summary>
|
||||
TEN = 1,
|
||||
|
||||
/// <summary>
|
||||
/// Chi mudra.
|
||||
/// </summary>
|
||||
CHI = 2,
|
||||
|
||||
/// <summary>
|
||||
/// Jin mudra.
|
||||
/// </summary>
|
||||
JIN = 3,
|
||||
}
|
||||
}
|
||||
28
Dalamud/Game/ClientState/JobGauge/Enums/PetGlam.cs
Normal file
28
Dalamud/Game/ClientState/JobGauge/Enums/PetGlam.cs
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
namespace Dalamud.Game.ClientState.JobGauge.Enums
|
||||
{
|
||||
/// <summary>
|
||||
/// SMN summoned pet glam types.
|
||||
/// </summary>
|
||||
public enum PetGlam : byte
|
||||
{
|
||||
/// <summary>
|
||||
/// No pet glam.
|
||||
/// </summary>
|
||||
NONE = 0,
|
||||
|
||||
/// <summary>
|
||||
/// Emerald carbuncle pet glam.
|
||||
/// </summary>
|
||||
EMERALD = 1,
|
||||
|
||||
/// <summary>
|
||||
/// Topaz carbuncle pet glam.
|
||||
/// </summary>
|
||||
TOPAZ = 2,
|
||||
|
||||
/// <summary>
|
||||
/// Ruby carbuncle pet glam.
|
||||
/// </summary>
|
||||
RUBY = 3,
|
||||
}
|
||||
}
|
||||
28
Dalamud/Game/ClientState/JobGauge/Enums/SealType.cs
Normal file
28
Dalamud/Game/ClientState/JobGauge/Enums/SealType.cs
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
namespace Dalamud.Game.ClientState.JobGauge.Enums
|
||||
{
|
||||
/// <summary>
|
||||
/// AST Divination seal types.
|
||||
/// </summary>
|
||||
public enum SealType : byte
|
||||
{
|
||||
/// <summary>
|
||||
/// No seal.
|
||||
/// </summary>
|
||||
NONE = 0,
|
||||
|
||||
/// <summary>
|
||||
/// Sun seal.
|
||||
/// </summary>
|
||||
SUN = 1,
|
||||
|
||||
/// <summary>
|
||||
/// Moon seal.
|
||||
/// </summary>
|
||||
MOON = 2,
|
||||
|
||||
/// <summary>
|
||||
/// Celestial seal.
|
||||
/// </summary>
|
||||
CELESTIAL = 3,
|
||||
}
|
||||
}
|
||||
31
Dalamud/Game/ClientState/JobGauge/Enums/Sen.cs
Normal file
31
Dalamud/Game/ClientState/JobGauge/Enums/Sen.cs
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
using System;
|
||||
|
||||
namespace Dalamud.Game.ClientState.JobGauge.Enums
|
||||
{
|
||||
/// <summary>
|
||||
/// Samurai Sen types.
|
||||
/// </summary>
|
||||
[Flags]
|
||||
public enum Sen : byte
|
||||
{
|
||||
/// <summary>
|
||||
/// No Sen.
|
||||
/// </summary>
|
||||
NONE = 0,
|
||||
|
||||
/// <summary>
|
||||
/// Setsu Sen type.
|
||||
/// </summary>
|
||||
SETSU = 1 << 0,
|
||||
|
||||
/// <summary>
|
||||
/// Getsu Sen type.
|
||||
/// </summary>
|
||||
GETSU = 1 << 1,
|
||||
|
||||
/// <summary>
|
||||
/// Ka Sen type.
|
||||
/// </summary>
|
||||
KA = 1 << 2,
|
||||
}
|
||||
}
|
||||
28
Dalamud/Game/ClientState/JobGauge/Enums/Song.cs
Normal file
28
Dalamud/Game/ClientState/JobGauge/Enums/Song.cs
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
namespace Dalamud.Game.ClientState.JobGauge.Enums
|
||||
{
|
||||
/// <summary>
|
||||
/// BRD Song types.
|
||||
/// </summary>
|
||||
public enum Song : byte
|
||||
{
|
||||
/// <summary>
|
||||
/// No song is active type.
|
||||
/// </summary>
|
||||
NONE = 0,
|
||||
|
||||
/// <summary>
|
||||
/// Mage's Ballad type.
|
||||
/// </summary>
|
||||
MAGE = 5,
|
||||
|
||||
/// <summary>
|
||||
/// Army's Paeon type.
|
||||
/// </summary>
|
||||
ARMY = 10,
|
||||
|
||||
/// <summary>
|
||||
/// The Wanderer's Minuet type.
|
||||
/// </summary>
|
||||
WANDERER = 15,
|
||||
}
|
||||
}
|
||||
28
Dalamud/Game/ClientState/JobGauge/Enums/SummonPet.cs
Normal file
28
Dalamud/Game/ClientState/JobGauge/Enums/SummonPet.cs
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
namespace Dalamud.Game.ClientState.JobGauge.Enums
|
||||
{
|
||||
/// <summary>
|
||||
/// SMN summoned pet types.
|
||||
/// </summary>
|
||||
public enum SummonPet : byte
|
||||
{
|
||||
/// <summary>
|
||||
/// No pet.
|
||||
/// </summary>
|
||||
NONE = 0,
|
||||
|
||||
/// <summary>
|
||||
/// The summoned pet Ifrit.
|
||||
/// </summary>
|
||||
IFRIT = 3,
|
||||
|
||||
/// <summary>
|
||||
/// The summoned pet Titan.
|
||||
/// </summary>
|
||||
TITAN = 4,
|
||||
|
||||
/// <summary>
|
||||
/// The summoned pet Garuda.
|
||||
/// </summary>
|
||||
GARUDA = 5,
|
||||
}
|
||||
}
|
||||
50
Dalamud/Game/ClientState/JobGauge/JobGauges.cs
Normal file
50
Dalamud/Game/ClientState/JobGauge/JobGauges.cs
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
|
||||
using Dalamud.Game.ClientState.JobGauge.Types;
|
||||
using Serilog;
|
||||
|
||||
namespace Dalamud.Game.ClientState.JobGauge
|
||||
{
|
||||
/// <summary>
|
||||
/// This class converts in-memory Job gauge data to structs.
|
||||
/// </summary>
|
||||
public class JobGauges
|
||||
{
|
||||
private Dictionary<Type, JobGaugeBase> cache = new();
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="JobGauges"/> class.
|
||||
/// </summary>
|
||||
/// <param name="addressResolver">Address resolver with the JobGauge memory location(s).</param>
|
||||
public JobGauges(ClientStateAddressResolver addressResolver)
|
||||
{
|
||||
this.Address = addressResolver.JobGaugeData;
|
||||
|
||||
Log.Verbose($"JobGaugeData address 0x{this.Address.ToInt64():X}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the address of the JobGauge data.
|
||||
/// </summary>
|
||||
public IntPtr Address { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Get the JobGauge for a given job.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">A JobGauge struct from ClientState.Structs.JobGauge.</typeparam>
|
||||
/// <returns>A JobGauge.</returns>
|
||||
public T Get<T>() where T : JobGaugeBase
|
||||
{
|
||||
// This is cached to mitigate the effects of using activator for instantiation.
|
||||
// Since the gauge itself reads from live memory, there isn't much downside to doing this.
|
||||
if (!this.cache.TryGetValue(typeof(T), out var gauge))
|
||||
{
|
||||
gauge = this.cache[typeof(T)] = (T)Activator.CreateInstance(typeof(T), BindingFlags.NonPublic | BindingFlags.Instance, null, new object[] { this.Address }, null);
|
||||
}
|
||||
|
||||
return (T)gauge;
|
||||
}
|
||||
}
|
||||
}
|
||||
40
Dalamud/Game/ClientState/JobGauge/Types/ASTGauge.cs
Normal file
40
Dalamud/Game/ClientState/JobGauge/Types/ASTGauge.cs
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
using System;
|
||||
|
||||
using Dalamud.Game.ClientState.JobGauge.Enums;
|
||||
|
||||
namespace Dalamud.Game.ClientState.JobGauge.Types
|
||||
{
|
||||
/// <summary>
|
||||
/// In-memory AST job gauge.
|
||||
/// </summary>
|
||||
public unsafe class ASTGauge : JobGaugeBase<FFXIVClientStructs.FFXIV.Client.Game.Gauge.AstrologianGauge>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ASTGauge"/> class.
|
||||
/// </summary>
|
||||
/// <param name="address">Address of the job gauge.</param>
|
||||
internal ASTGauge(IntPtr address)
|
||||
: base(address)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the currently drawn <see cref="CardType"/>.
|
||||
/// </summary>
|
||||
/// <returns>Currently drawn <see cref="CardType"/>.</returns>
|
||||
public CardType DrawnCard => (CardType)this.Struct->Card;
|
||||
|
||||
/// <summary>
|
||||
/// Check if a <see cref="SealType"/> is currently active on the divination gauge.
|
||||
/// </summary>
|
||||
/// <param name="seal">The <see cref="SealType"/> to check for.</param>
|
||||
/// <returns>If the given Seal is currently divined.</returns>
|
||||
public unsafe bool ContainsSeal(SealType seal)
|
||||
{
|
||||
if (this.Struct->Seals[0] == (byte)seal) return true;
|
||||
if (this.Struct->Seals[1] == (byte)seal) return true;
|
||||
if (this.Struct->Seals[2] == (byte)seal) return true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
67
Dalamud/Game/ClientState/JobGauge/Types/BLMGauge.cs
Normal file
67
Dalamud/Game/ClientState/JobGauge/Types/BLMGauge.cs
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
using System;
|
||||
|
||||
namespace Dalamud.Game.ClientState.JobGauge.Types
|
||||
{
|
||||
/// <summary>
|
||||
/// In-memory BLM job gauge.
|
||||
/// </summary>
|
||||
public unsafe class BLMGauge : JobGaugeBase<FFXIVClientStructs.FFXIV.Client.Game.Gauge.BlackMageGauge>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="BLMGauge"/> class.
|
||||
/// </summary>
|
||||
/// <param name="address">Address of the job gauge.</param>
|
||||
internal BLMGauge(IntPtr address)
|
||||
: base(address)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the time remaining for the Enochian time in milliseconds.
|
||||
/// </summary>
|
||||
public short EnochianTimer => this.Struct->EnochianTimer;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the time remaining for Astral Fire or Umbral Ice in milliseconds.
|
||||
/// </summary>
|
||||
public short ElementTimeRemaining => this.Struct->ElementTimeRemaining;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the number of Polyglot stacks remaining.
|
||||
/// </summary>
|
||||
public byte PolyglotStacks => this.Struct->PolyglotStacks;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the number of Umbral Hearts remaining.
|
||||
/// </summary>
|
||||
public byte UmbralHearts => this.Struct->UmbralHearts;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the amount of Umbral Ice stacks.
|
||||
/// </summary>
|
||||
public byte UmbralIceStacks => (byte)(this.InUmbralIce ? -this.Struct->ElementStance : 0);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the amount of Astral Fire stacks.
|
||||
/// </summary>
|
||||
public byte AstralFireStacks => (byte)(this.InAstralFire ? this.Struct->ElementStance : 0);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether if the player is in Umbral Ice.
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> or <c>false</c>.</returns>
|
||||
public bool InUmbralIce => this.Struct->ElementStance < 0;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether if the player is in Astral fire.
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> or <c>false</c>.</returns>
|
||||
public bool InAstralFire => this.Struct->ElementStance > 0;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether if Enochian is active.
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> or <c>false</c>.</returns>
|
||||
public bool IsEnochianActive => this.Struct->Enochian != 0;
|
||||
}
|
||||
}
|
||||
41
Dalamud/Game/ClientState/JobGauge/Types/BRDGauge.cs
Normal file
41
Dalamud/Game/ClientState/JobGauge/Types/BRDGauge.cs
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
using System;
|
||||
|
||||
using Dalamud.Game.ClientState.JobGauge.Enums;
|
||||
|
||||
namespace Dalamud.Game.ClientState.JobGauge.Types
|
||||
{
|
||||
/// <summary>
|
||||
/// In-memory BRD job gauge.
|
||||
/// </summary>
|
||||
public unsafe class BRDGauge : JobGaugeBase<FFXIVClientStructs.FFXIV.Client.Game.Gauge.BardGauge>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="BRDGauge"/> class.
|
||||
/// </summary>
|
||||
/// <param name="address">Address of the job gauge.</param>
|
||||
internal BRDGauge(IntPtr address)
|
||||
: base(address)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the current song timer in milliseconds.
|
||||
/// </summary>
|
||||
public short SongTimer => this.Struct->SongTimer;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the amount of Repertoire accumulated.
|
||||
/// </summary>
|
||||
public byte Repertoire => this.Struct->Repertoire;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the amount of Soul Voice accumulated.
|
||||
/// </summary>
|
||||
public byte SoulVoice => this.Struct->SoulVoice;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the type of song that is active.
|
||||
/// </summary>
|
||||
public Song Song => (Song)this.Struct->Song;
|
||||
}
|
||||
}
|
||||
46
Dalamud/Game/ClientState/JobGauge/Types/DNCGauge.cs
Normal file
46
Dalamud/Game/ClientState/JobGauge/Types/DNCGauge.cs
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
using System;
|
||||
|
||||
namespace Dalamud.Game.ClientState.JobGauge.Types
|
||||
{
|
||||
/// <summary>
|
||||
/// In-memory DNC job gauge.
|
||||
/// </summary>
|
||||
public unsafe class DNCGauge : JobGaugeBase<FFXIVClientStructs.FFXIV.Client.Game.Gauge.DancerGauge>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="DNCGauge"/> class.
|
||||
/// </summary>
|
||||
/// <param name="address">Address of the job gauge.</param>
|
||||
internal DNCGauge(IntPtr address)
|
||||
: base(address)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the number of feathers available.
|
||||
/// </summary>
|
||||
public byte Feathers => this.Struct->Feathers;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the amount of Espirit available.
|
||||
/// </summary>
|
||||
public byte Esprit => this.Struct->Esprit;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the number of steps completed for the current dance.
|
||||
/// </summary>
|
||||
public byte CompletedSteps => this.Struct->StepIndex;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the next step in the current dance.
|
||||
/// </summary>
|
||||
/// <returns>The next dance step action ID.</returns>
|
||||
public ulong NextStep => (ulong)(15999 + this.Struct->DanceSteps[this.Struct->StepIndex] - 1);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether the player is dancing or not.
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> or <c>false</c>.</returns>
|
||||
public bool IsDancing => this.Struct->DanceSteps[0] != 0;
|
||||
}
|
||||
}
|
||||
36
Dalamud/Game/ClientState/JobGauge/Types/DRGGauge.cs
Normal file
36
Dalamud/Game/ClientState/JobGauge/Types/DRGGauge.cs
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
using System;
|
||||
|
||||
using Dalamud.Game.ClientState.JobGauge.Enums;
|
||||
|
||||
namespace Dalamud.Game.ClientState.JobGauge.Types
|
||||
{
|
||||
/// <summary>
|
||||
/// In-memory DRG job gauge.
|
||||
/// </summary>
|
||||
public unsafe class DRGGauge : JobGaugeBase<FFXIVClientStructs.FFXIV.Client.Game.Gauge.DragoonGauge>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="DRGGauge"/> class.
|
||||
/// </summary>
|
||||
/// <param name="address">Address of the job gauge.</param>
|
||||
internal DRGGauge(IntPtr address)
|
||||
: base(address)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the time remaining for Blood of the Dragon in milliseconds.
|
||||
/// </summary>
|
||||
public short BOTDTimer => this.Struct->BotdTimer;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the current state of Blood of the Dragon.
|
||||
/// </summary>
|
||||
public BOTDState BOTDState => (BOTDState)this.Struct->BotdState;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the count of eyes opened during Blood of the Dragon.
|
||||
/// </summary>
|
||||
public byte EyeCount => this.Struct->EyeCount;
|
||||
}
|
||||
}
|
||||
40
Dalamud/Game/ClientState/JobGauge/Types/DRKGauge.cs
Normal file
40
Dalamud/Game/ClientState/JobGauge/Types/DRKGauge.cs
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
using System;
|
||||
|
||||
namespace Dalamud.Game.ClientState.JobGauge.Types
|
||||
{
|
||||
/// <summary>
|
||||
/// In-memory DRK job gauge.
|
||||
/// </summary>
|
||||
public unsafe class DRKGauge : JobGaugeBase<FFXIVClientStructs.FFXIV.Client.Game.Gauge.DarkKnightGauge>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="DRKGauge"/> class.
|
||||
/// </summary>
|
||||
/// <param name="address">Address of the job gauge.</param>
|
||||
internal DRKGauge(IntPtr address)
|
||||
: base(address)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the amount of blood accumulated.
|
||||
/// </summary>
|
||||
public byte Blood => this.Struct->Blood;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the Darkside time remaining in milliseconds.
|
||||
/// </summary>
|
||||
public ushort DarksideTimeRemaining => this.Struct->DarksideTimer;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the Shadow time remaining in milliseconds.
|
||||
/// </summary>
|
||||
public ushort ShadowTimeRemaining => this.Struct->ShadowTimer;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether the player has Dark Arts or not.
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> or <c>false</c>.</returns>
|
||||
public bool HasDarkArts => this.Struct->DarkArtsState > 0;
|
||||
}
|
||||
}
|
||||
34
Dalamud/Game/ClientState/JobGauge/Types/GNBGauge.cs
Normal file
34
Dalamud/Game/ClientState/JobGauge/Types/GNBGauge.cs
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
using System;
|
||||
|
||||
namespace Dalamud.Game.ClientState.JobGauge.Types
|
||||
{
|
||||
/// <summary>
|
||||
/// In-memory GNB job gauge.
|
||||
/// </summary>
|
||||
public unsafe class GNBGauge : JobGaugeBase<FFXIVClientStructs.FFXIV.Client.Game.Gauge.GunbreakerGauge>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="GNBGauge"/> class.
|
||||
/// </summary>
|
||||
/// <param name="address">Address of the job gauge.</param>
|
||||
internal GNBGauge(IntPtr address)
|
||||
: base(address)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the amount of ammo available.
|
||||
/// </summary>
|
||||
public byte Ammo => this.Struct->Ammo;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the max combo time of the Gnashing Fang combo.
|
||||
/// </summary>
|
||||
public short MaxTimerDuration => this.Struct->MaxTimerDuration;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the current step of the Gnashing Fang combo.
|
||||
/// </summary>
|
||||
public byte AmmoComboStep => this.Struct->AmmoComboStep;
|
||||
}
|
||||
}
|
||||
24
Dalamud/Game/ClientState/JobGauge/Types/JobGaugeBase.cs
Normal file
24
Dalamud/Game/ClientState/JobGauge/Types/JobGaugeBase.cs
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
using System;
|
||||
|
||||
namespace Dalamud.Game.ClientState.JobGauge.Types
|
||||
{
|
||||
/// <summary>
|
||||
/// Base job gauge class.
|
||||
/// </summary>
|
||||
public abstract unsafe class JobGaugeBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="JobGaugeBase"/> class.
|
||||
/// </summary>
|
||||
/// <param name="address">Address of the job gauge.</param>
|
||||
internal JobGaugeBase(IntPtr address)
|
||||
{
|
||||
this.Address = address;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the address of this job gauge in memory.
|
||||
/// </summary>
|
||||
public IntPtr Address { get; }
|
||||
}
|
||||
}
|
||||
25
Dalamud/Game/ClientState/JobGauge/Types/JobGaugeBase{T}.cs
Normal file
25
Dalamud/Game/ClientState/JobGauge/Types/JobGaugeBase{T}.cs
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
using System;
|
||||
|
||||
namespace Dalamud.Game.ClientState.JobGauge.Types
|
||||
{
|
||||
/// <summary>
|
||||
/// Base job gauge class.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The underlying FFXIVClientStructs type.</typeparam>
|
||||
public unsafe class JobGaugeBase<T> : JobGaugeBase where T : unmanaged
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="JobGaugeBase{T}"/> class.
|
||||
/// </summary>
|
||||
/// <param name="address">Address of the job gauge.</param>
|
||||
internal JobGaugeBase(IntPtr address)
|
||||
: base(address)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets an unsafe struct pointer of this job gauge.
|
||||
/// </summary>
|
||||
private protected T* Struct => (T*)this.Address;
|
||||
}
|
||||
}
|
||||
56
Dalamud/Game/ClientState/JobGauge/Types/MCHGauge.cs
Normal file
56
Dalamud/Game/ClientState/JobGauge/Types/MCHGauge.cs
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
using System;
|
||||
|
||||
namespace Dalamud.Game.ClientState.JobGauge.Types
|
||||
{
|
||||
/// <summary>
|
||||
/// In-memory MCH job gauge.
|
||||
/// </summary>
|
||||
public unsafe class MCHGauge : JobGaugeBase<FFXIVClientStructs.FFXIV.Client.Game.Gauge.MachinistGauge>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="MCHGauge"/> class.
|
||||
/// </summary>
|
||||
/// <param name="address">Address of the job gauge.</param>
|
||||
internal MCHGauge(IntPtr address)
|
||||
: base(address)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the time time remaining for Overheat in milliseconds.
|
||||
/// </summary>
|
||||
public short OverheatTimeRemaining => this.Struct->OverheatTimeRemaining;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the time remaining for the Rook or Queen in milliseconds.
|
||||
/// </summary>
|
||||
public short SummonTimeRemaining => this.Struct->SummonTimeRemaining;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the current Heat level.
|
||||
/// </summary>
|
||||
public byte Heat => this.Struct->Heat;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the current Battery level.
|
||||
/// </summary>
|
||||
public byte Battery => this.Struct->Battery;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the battery level of the last summon (robot).
|
||||
/// </summary>
|
||||
public byte LastSummonBatteryPower => this.Struct->LastSummonBatteryPower;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether the player is currently Overheated.
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> or <c>false</c>.</returns>
|
||||
public bool IsOverheated => (this.Struct->TimerActive & 1) != 0;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether the player has an active Robot.
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> or <c>false</c>.</returns>
|
||||
public bool IsRobotActive => (this.Struct->TimerActive & 2) != 0;
|
||||
}
|
||||
}
|
||||
24
Dalamud/Game/ClientState/JobGauge/Types/MNKGauge.cs
Normal file
24
Dalamud/Game/ClientState/JobGauge/Types/MNKGauge.cs
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
using System;
|
||||
|
||||
namespace Dalamud.Game.ClientState.JobGauge.Types
|
||||
{
|
||||
/// <summary>
|
||||
/// In-memory MNK job gauge.
|
||||
/// </summary>
|
||||
public unsafe class MNKGauge : JobGaugeBase<FFXIVClientStructs.FFXIV.Client.Game.Gauge.MonkGauge>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="MNKGauge"/> class.
|
||||
/// </summary>
|
||||
/// <param name="address">Address of the job gauge.</param>
|
||||
internal MNKGauge(IntPtr address)
|
||||
: base(address)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the number of Chakra available.
|
||||
/// </summary>
|
||||
public byte Chakra => this.Struct->Chakra;
|
||||
}
|
||||
}
|
||||
34
Dalamud/Game/ClientState/JobGauge/Types/NINGauge.cs
Normal file
34
Dalamud/Game/ClientState/JobGauge/Types/NINGauge.cs
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
using System;
|
||||
|
||||
namespace Dalamud.Game.ClientState.JobGauge.Types
|
||||
{
|
||||
/// <summary>
|
||||
/// In-memory NIN job gauge.
|
||||
/// </summary>
|
||||
public unsafe class NINGauge : JobGaugeBase<FFXIVClientStructs.FFXIV.Client.Game.Gauge.NinjaGauge>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="NINGauge"/> class.
|
||||
/// </summary>
|
||||
/// <param name="address">The address of the gauge.</param>
|
||||
internal NINGauge(IntPtr address)
|
||||
: base(address)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the time left on Huton in milliseconds.
|
||||
/// </summary>
|
||||
public int HutonTimer => this.Struct->HutonTimer;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the amount of Ninki available.
|
||||
/// </summary>
|
||||
public byte Ninki => this.Struct->Ninki;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the number of times Huton has been cast manually.
|
||||
/// </summary>
|
||||
public byte HutonManualCasts => this.Struct->HutonManualCasts;
|
||||
}
|
||||
}
|
||||
24
Dalamud/Game/ClientState/JobGauge/Types/PLDGauge.cs
Normal file
24
Dalamud/Game/ClientState/JobGauge/Types/PLDGauge.cs
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
using System;
|
||||
|
||||
namespace Dalamud.Game.ClientState.JobGauge.Types
|
||||
{
|
||||
/// <summary>
|
||||
/// In-memory PLD job gauge.
|
||||
/// </summary>
|
||||
public unsafe class PLDGauge : JobGaugeBase<FFXIVClientStructs.FFXIV.Client.Game.Gauge.PaladinGauge>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="PLDGauge"/> class.
|
||||
/// </summary>
|
||||
/// <param name="address">Address of the job gauge.</param>
|
||||
internal PLDGauge(IntPtr address)
|
||||
: base(address)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the current level of the Oath gauge.
|
||||
/// </summary>
|
||||
public byte OathGauge => this.Struct->OathGauge;
|
||||
}
|
||||
}
|
||||
29
Dalamud/Game/ClientState/JobGauge/Types/RDMGauge.cs
Normal file
29
Dalamud/Game/ClientState/JobGauge/Types/RDMGauge.cs
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
using System;
|
||||
|
||||
namespace Dalamud.Game.ClientState.JobGauge.Types
|
||||
{
|
||||
/// <summary>
|
||||
/// In-memory RDM job gauge.
|
||||
/// </summary>
|
||||
public unsafe class RDMGauge : JobGaugeBase<FFXIVClientStructs.FFXIV.Client.Game.Gauge.RedMageGauge>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="RDMGauge"/> class.
|
||||
/// </summary>
|
||||
/// <param name="address">Address of the job gauge.</param>
|
||||
internal RDMGauge(IntPtr address)
|
||||
: base(address)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the level of the White gauge.
|
||||
/// </summary>
|
||||
public byte WhiteMana => this.Struct->WhiteMana;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the level of the Black gauge.
|
||||
/// </summary>
|
||||
public byte BlackMana => this.Struct->BlackMana;
|
||||
}
|
||||
}
|
||||
54
Dalamud/Game/ClientState/JobGauge/Types/SAMGauge.cs
Normal file
54
Dalamud/Game/ClientState/JobGauge/Types/SAMGauge.cs
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
using System;
|
||||
|
||||
using Dalamud.Game.ClientState.JobGauge.Enums;
|
||||
|
||||
namespace Dalamud.Game.ClientState.JobGauge.Types
|
||||
{
|
||||
/// <summary>
|
||||
/// In-memory SAM job gauge.
|
||||
/// </summary>
|
||||
public unsafe class SAMGauge : JobGaugeBase<FFXIVClientStructs.FFXIV.Client.Game.Gauge.SamuraiGauge>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SAMGauge"/> class.
|
||||
/// </summary>
|
||||
/// <param name="address">Address of the job gauge.</param>
|
||||
internal SAMGauge(IntPtr address)
|
||||
: base(address)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the current amount of Kenki available.
|
||||
/// </summary>
|
||||
public byte Kenki => this.Struct->Kenki;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the amount of Meditation stacks.
|
||||
/// </summary>
|
||||
public byte MeditationStacks => this.Struct->MeditationStacks;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the active Sen.
|
||||
/// </summary>
|
||||
public Sen Sen => (Sen)this.Struct->SenFlags;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether the Setsu Sen is active.
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> or <c>false</c>.</returns>
|
||||
public bool HasSetsu => (this.Sen & Sen.SETSU) != 0;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether the Getsu Sen is active.
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> or <c>false</c>.</returns>
|
||||
public bool HasGetsu => (this.Sen & Sen.GETSU) != 0;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether the Ka Sen is active.
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> or <c>false</c>.</returns>
|
||||
public bool HasKa => (this.Sen & Sen.KA) != 0;
|
||||
}
|
||||
}
|
||||
41
Dalamud/Game/ClientState/JobGauge/Types/SCHGauge.cs
Normal file
41
Dalamud/Game/ClientState/JobGauge/Types/SCHGauge.cs
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
using System;
|
||||
|
||||
using Dalamud.Game.ClientState.JobGauge.Enums;
|
||||
|
||||
namespace Dalamud.Game.ClientState.JobGauge.Types
|
||||
{
|
||||
/// <summary>
|
||||
/// In-memory SCH job gauge.
|
||||
/// </summary>
|
||||
public unsafe class SCHGauge : JobGaugeBase<FFXIVClientStructs.FFXIV.Client.Game.Gauge.ScholarGauge>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SCHGauge"/> class.
|
||||
/// </summary>
|
||||
/// <param name="address">Address of the job gauge.</param>
|
||||
internal SCHGauge(IntPtr address)
|
||||
: base(address)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the amount of Aetherflow stacks available.
|
||||
/// </summary>
|
||||
public byte Aetherflow => this.Struct->Aetherflow;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the current level of the Fairy Gauge.
|
||||
/// </summary>
|
||||
public byte FairyGauge => this.Struct->FairyGauge;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the Seraph time remaiSCHg in milliseconds.
|
||||
/// </summary>
|
||||
public short SeraphTimer => this.Struct->SeraphTimer;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the last dismissed fairy.
|
||||
/// </summary>
|
||||
public DismissedFairy DismissedFairy => (DismissedFairy)this.Struct->DismissedFairy;
|
||||
}
|
||||
}
|
||||
60
Dalamud/Game/ClientState/JobGauge/Types/SMNGauge.cs
Normal file
60
Dalamud/Game/ClientState/JobGauge/Types/SMNGauge.cs
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
using System;
|
||||
|
||||
using Dalamud.Game.ClientState.JobGauge.Enums;
|
||||
|
||||
namespace Dalamud.Game.ClientState.JobGauge.Types
|
||||
{
|
||||
/// <summary>
|
||||
/// In-memory SMN job gauge.
|
||||
/// </summary>
|
||||
public unsafe class SMNGauge : JobGaugeBase<FFXIVClientStructs.FFXIV.Client.Game.Gauge.SummonerGauge>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SMNGauge"/> class.
|
||||
/// </summary>
|
||||
/// <param name="address">Address of the job gauge.</param>
|
||||
internal SMNGauge(IntPtr address)
|
||||
: base(address)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the time remaining for the current summon.
|
||||
/// </summary>
|
||||
public short TimerRemaining => this.Struct->TimerRemaining;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the summon that will return after the current summon expires.
|
||||
/// </summary>
|
||||
public SummonPet ReturnSummon => (SummonPet)this.Struct->ReturnSummon;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the summon glam for the <see cref="ReturnSummon"/>.
|
||||
/// </summary>
|
||||
public PetGlam ReturnSummonGlam => (PetGlam)this.Struct->ReturnSummonGlam;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the current aether flags.
|
||||
/// Use the summon accessors instead.
|
||||
/// </summary>
|
||||
public byte AetherFlags => this.Struct->AetherFlags;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether if Phoenix is ready to be summoned.
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> or <c>false</c>.</returns>
|
||||
public bool IsPhoenixReady => (this.AetherFlags & 0x10) > 0;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether Bahamut is ready to be summoned.
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> or <c>false</c>.</returns>
|
||||
public bool IsBahamutReady => (this.AetherFlags & 8) > 0;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether there are any Aetherflow stacks available.
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> or <c>false</c>.</returns>
|
||||
public bool HasAetherflowStacks => (this.AetherFlags & 3) > 0;
|
||||
}
|
||||
}
|
||||
24
Dalamud/Game/ClientState/JobGauge/Types/WARGauge.cs
Normal file
24
Dalamud/Game/ClientState/JobGauge/Types/WARGauge.cs
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
using System;
|
||||
|
||||
namespace Dalamud.Game.ClientState.JobGauge.Types
|
||||
{
|
||||
/// <summary>
|
||||
/// In-memory WAR job gauge.
|
||||
/// </summary>
|
||||
public unsafe class WARGauge : JobGaugeBase<FFXIVClientStructs.FFXIV.Client.Game.Gauge.WarriorGauge>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="WARGauge"/> class.
|
||||
/// </summary>
|
||||
/// <param name="address">Address of the job gauge.</param>
|
||||
internal WARGauge(IntPtr address)
|
||||
: base(address)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the amount of wrath in the Beast gauge.
|
||||
/// </summary>
|
||||
public byte BeastGauge => this.Struct->BeastGauge;
|
||||
}
|
||||
}
|
||||
34
Dalamud/Game/ClientState/JobGauge/Types/WHMGauge.cs
Normal file
34
Dalamud/Game/ClientState/JobGauge/Types/WHMGauge.cs
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
using System;
|
||||
|
||||
namespace Dalamud.Game.ClientState.JobGauge.Types
|
||||
{
|
||||
/// <summary>
|
||||
/// In-memory WHM job gauge.
|
||||
/// </summary>
|
||||
public unsafe class WHMGauge : JobGaugeBase<FFXIVClientStructs.FFXIV.Client.Game.Gauge.WhiteMageGauge>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="WHMGauge"/> class.
|
||||
/// </summary>
|
||||
/// <param name="address">Address of the job gauge.</param>
|
||||
internal WHMGauge(IntPtr address)
|
||||
: base(address)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the time to next lily in milliseconds.
|
||||
/// </summary>
|
||||
public short LilyTimer => this.Struct->LilyTimer;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the number of Lilies.
|
||||
/// </summary>
|
||||
public byte Lily => this.Struct->Lily;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the number of times the blood lily has been nourished.
|
||||
/// </summary>
|
||||
public byte BloodLily => this.Struct->BloodLily;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue