Add mentor states

This commit is contained in:
Haselnussbomber 2025-10-05 14:37:22 +02:00
parent c2fc04c3a8
commit 153870a053
No known key found for this signature in database
GPG key ID: BB905BB49E7295D1
2 changed files with 43 additions and 0 deletions

View file

@ -151,6 +151,21 @@ internal unsafe class PlayerState : IServiceType, IPlayerState
/// <inheritdoc/> /// <inheritdoc/>
public MentorVersion MentorVersion => this.IsLoaded ? (MentorVersion)CSPlayerState.Instance()->MentorVersion : default; public MentorVersion MentorVersion => this.IsLoaded ? (MentorVersion)CSPlayerState.Instance()->MentorVersion : default;
/// <inheritdoc/>
public bool IsMentor => this.IsLoaded && CSPlayerState.Instance()->IsMentor();
/// <inheritdoc/>
public bool IsBattleMentor => this.IsLoaded && CSPlayerState.Instance()->IsBattleMentor();
/// <inheritdoc/>
public bool IsTradeMentor => this.IsLoaded && CSPlayerState.Instance()->IsTradeMentor();
/// <inheritdoc/>
public bool IsNovice => this.IsLoaded && CSPlayerState.Instance()->IsNovice();
/// <inheritdoc/>
public bool IsReturner => this.IsLoaded && CSPlayerState.Instance()->IsReturner();
/// <inheritdoc/> /// <inheritdoc/>
public int GetAttribute(PlayerAttribute attribute) => this.IsLoaded ? CSPlayerState.Instance()->Attributes[(int)attribute] : default; public int GetAttribute(PlayerAttribute attribute) => this.IsLoaded ? CSPlayerState.Instance()->Attributes[(int)attribute] : default;

View file

@ -176,6 +176,34 @@ public interface IPlayerState
/// </summary> /// </summary>
MentorVersion MentorVersion { get; } MentorVersion MentorVersion { get; }
/// <summary>
/// Gets a value indicating whether the local player is any kind of Mentor (Battle or Trade Mentor).
/// </summary>
bool IsMentor { get; }
/// <summary>
/// Gets a value indicating whether the local player is a Battle Mentor.
/// </summary>
bool IsBattleMentor { get; }
/// <summary>
/// Gets a value indicating whether the local player is a Trade Mentor.
/// </summary>
bool IsTradeMentor { get; }
/// <summary>
/// Gets a value indicating whether the local player is a novice (aka. Sprout or New Adventurer).
/// </summary>
/// <remarks>
/// Can be <see langword="false"/> if <c>/nastatus</c> was used to deactivate it.
/// </remarks>
bool IsNovice { get; }
/// <summary>
/// Gets a value indicating whether the local player is a returner.
/// </summary>
bool IsReturner { get; }
/// <summary> /// <summary>
/// Gets the value of an attribute of the local character. /// Gets the value of an attribute of the local character.
/// </summary> /// </summary>