2023-10-03 09:08:38 +00:00
|
|
|
|
using Dalamud.Game.ClientState.Conditions;
|
|
|
|
|
using Dalamud.Plugin.Services;
|
2023-02-15 22:17:19 +00:00
|
|
|
|
using Pal.Common;
|
|
|
|
|
|
2023-03-30 20:01:43 +00:00
|
|
|
|
namespace Pal.Client.Floors;
|
|
|
|
|
|
|
|
|
|
public sealed class TerritoryState
|
2023-02-15 22:17:19 +00:00
|
|
|
|
{
|
2023-10-03 09:08:38 +00:00
|
|
|
|
private readonly IClientState _clientState;
|
|
|
|
|
private readonly ICondition _condition;
|
2023-02-15 22:17:19 +00:00
|
|
|
|
|
2023-10-03 09:08:38 +00:00
|
|
|
|
public TerritoryState(IClientState clientState, ICondition condition)
|
2023-03-30 20:01:43 +00:00
|
|
|
|
{
|
|
|
|
|
_clientState = clientState;
|
|
|
|
|
_condition = condition;
|
|
|
|
|
}
|
2023-02-15 22:17:19 +00:00
|
|
|
|
|
2023-03-30 20:01:43 +00:00
|
|
|
|
public ushort LastTerritory { get; set; }
|
|
|
|
|
public PomanderState PomanderOfSight { get; set; } = PomanderState.Inactive;
|
|
|
|
|
public PomanderState PomanderOfIntuition { get; set; } = PomanderState.Inactive;
|
2023-02-15 22:17:19 +00:00
|
|
|
|
|
2023-03-30 20:01:43 +00:00
|
|
|
|
public bool IsInDeepDungeon() =>
|
|
|
|
|
_clientState.IsLoggedIn
|
|
|
|
|
&& _condition[ConditionFlag.InDeepDungeon]
|
|
|
|
|
&& typeof(ETerritoryType).IsEnumDefined(_clientState.TerritoryType);
|
|
|
|
|
}
|
2023-02-15 22:17:19 +00:00
|
|
|
|
|
2023-03-30 20:01:43 +00:00
|
|
|
|
public enum PomanderState
|
|
|
|
|
{
|
|
|
|
|
Inactive,
|
|
|
|
|
Active,
|
|
|
|
|
FoundOnCurrentFloor,
|
|
|
|
|
PomanderOfSafetyUsed,
|
2023-02-15 22:17:19 +00:00
|
|
|
|
}
|