fish-station/Content.Server/_Sunrise/Objectives/Systems/StoreUnlockerSystem.cs
pacable 558750ab81
Фамильяр библиотекаря + др. изменения из тасктрека минкира (#161)
* Добавил фолиант

* Увеличил количество предметов в торгоматах

* Увеличена ёмкость СМЭС и подстанций

* Добавлены дополнительные солнечные панели для брига дельты.
Удален магистрат с Cluster

* Вернул цель на кражу плутониевого ядра

* Merge branch 'master' into dogbook
2024-07-01 22:45:28 +03:00

34 lines
875 B
C#

using Content.Server.Objectives.Components;
using Content.Shared.Mind;
namespace Content.Server.Objectives.Systems;
/// <summary>
/// Provides api for listings with <c>ObjectiveUnlockRequirement</c> to use.
/// </summary>
public sealed class StoreUnlockerSystem : EntitySystem
{
private EntityQuery<StoreUnlockerComponent> _query;
public override void Initialize()
{
_query = GetEntityQuery<StoreUnlockerComponent>();
}
/// <summary>
/// Returns true if a listing id is unlocked by any objectives on a mind.
/// </summary>
public bool IsUnlocked(MindComponent mind, string id)
{
foreach (var obj in mind.Objectives)
{
if (!_query.TryComp(obj, out var comp))
continue;
if (comp.Listings.Contains(id))
return true;
}
return false;
}
}