From 153870a053252f19e759301ead3a79fcc6b7a72e Mon Sep 17 00:00:00 2001 From: Haselnussbomber Date: Sun, 5 Oct 2025 14:37:22 +0200 Subject: [PATCH] Add mentor states --- Dalamud/Game/PlayerState/PlayerState.cs | 15 +++++++++++++ Dalamud/Plugin/Services/IPlayerState.cs | 28 +++++++++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/Dalamud/Game/PlayerState/PlayerState.cs b/Dalamud/Game/PlayerState/PlayerState.cs index 5e5528eca..7af067119 100644 --- a/Dalamud/Game/PlayerState/PlayerState.cs +++ b/Dalamud/Game/PlayerState/PlayerState.cs @@ -151,6 +151,21 @@ internal unsafe class PlayerState : IServiceType, IPlayerState /// public MentorVersion MentorVersion => this.IsLoaded ? (MentorVersion)CSPlayerState.Instance()->MentorVersion : default; + /// + public bool IsMentor => this.IsLoaded && CSPlayerState.Instance()->IsMentor(); + + /// + public bool IsBattleMentor => this.IsLoaded && CSPlayerState.Instance()->IsBattleMentor(); + + /// + public bool IsTradeMentor => this.IsLoaded && CSPlayerState.Instance()->IsTradeMentor(); + + /// + public bool IsNovice => this.IsLoaded && CSPlayerState.Instance()->IsNovice(); + + /// + public bool IsReturner => this.IsLoaded && CSPlayerState.Instance()->IsReturner(); + /// public int GetAttribute(PlayerAttribute attribute) => this.IsLoaded ? CSPlayerState.Instance()->Attributes[(int)attribute] : default; diff --git a/Dalamud/Plugin/Services/IPlayerState.cs b/Dalamud/Plugin/Services/IPlayerState.cs index a119f231b..98b0c36da 100644 --- a/Dalamud/Plugin/Services/IPlayerState.cs +++ b/Dalamud/Plugin/Services/IPlayerState.cs @@ -176,6 +176,34 @@ public interface IPlayerState /// MentorVersion MentorVersion { get; } + /// + /// Gets a value indicating whether the local player is any kind of Mentor (Battle or Trade Mentor). + /// + bool IsMentor { get; } + + /// + /// Gets a value indicating whether the local player is a Battle Mentor. + /// + bool IsBattleMentor { get; } + + /// + /// Gets a value indicating whether the local player is a Trade Mentor. + /// + bool IsTradeMentor { get; } + + /// + /// Gets a value indicating whether the local player is a novice (aka. Sprout or New Adventurer). + /// + /// + /// Can be if /nastatus was used to deactivate it. + /// + bool IsNovice { get; } + + /// + /// Gets a value indicating whether the local player is a returner. + /// + bool IsReturner { get; } + /// /// Gets the value of an attribute of the local character. ///