muffin v7.38.8
This commit is contained in:
parent
5e2d8f648b
commit
3e10cbbbf2
51 changed files with 2585 additions and 1972 deletions
File diff suppressed because it is too large
Load diff
68
Questionable/Questionable.Data/HuntMobData.cs
Normal file
68
Questionable/Questionable.Data/HuntMobData.cs
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
using System.Collections.Generic;
|
||||
using Dalamud.Plugin.Services;
|
||||
using Lumina.Excel;
|
||||
using Lumina.Excel.Sheets;
|
||||
|
||||
namespace Questionable.Data;
|
||||
|
||||
internal sealed class HuntMobData
|
||||
{
|
||||
private readonly HashSet<uint> _aRankDataIds = new HashSet<uint>();
|
||||
|
||||
private readonly HashSet<uint> _sRankDataIds = new HashSet<uint>();
|
||||
|
||||
private readonly HashSet<uint> _allHuntMobDataIds = new HashSet<uint>();
|
||||
|
||||
public const float SafeDistance = 15f;
|
||||
|
||||
public IReadOnlySet<uint> ARankDataIds => _aRankDataIds;
|
||||
|
||||
public IReadOnlySet<uint> SRankDataIds => _sRankDataIds;
|
||||
|
||||
public IReadOnlySet<uint> AllHuntMobDataIds => _allHuntMobDataIds;
|
||||
|
||||
public HuntMobData(IDataManager dataManager)
|
||||
{
|
||||
ExcelSheet<NotoriousMonster> excelSheet = dataManager.GetExcelSheet<NotoriousMonster>();
|
||||
if (excelSheet == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
foreach (NotoriousMonster item in excelSheet)
|
||||
{
|
||||
byte rank = item.Rank;
|
||||
if ((uint)(rank - 2) > 1u)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
uint rowId = item.BNpcBase.RowId;
|
||||
if (rowId != 0)
|
||||
{
|
||||
_allHuntMobDataIds.Add(rowId);
|
||||
if (item.Rank == 2)
|
||||
{
|
||||
_aRankDataIds.Add(rowId);
|
||||
}
|
||||
else if (item.Rank == 3)
|
||||
{
|
||||
_sRankDataIds.Add(rowId);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsHuntMob(uint dataId)
|
||||
{
|
||||
return _allHuntMobDataIds.Contains(dataId);
|
||||
}
|
||||
|
||||
public bool IsARank(uint dataId)
|
||||
{
|
||||
return _aRankDataIds.Contains(dataId);
|
||||
}
|
||||
|
||||
public bool IsSRank(uint dataId)
|
||||
{
|
||||
return _sRankDataIds.Contains(dataId);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue