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

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

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

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

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

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

21 lines
683 B
C#

using Content.Shared.Mind;
using Content.Shared.Store;
using Content.Server.Objectives.Systems;
namespace Content.Server.Store.Conditions;
/// <summary>
/// Requires that the buyer have an objective that unlocks this listing.
/// </summary>
public sealed partial class ObjectiveUnlockCondition : ListingCondition
{
public override bool Condition(ListingConditionArgs args)
{
var minds = args.EntityManager.System<SharedMindSystem>();
if (!minds.TryGetMind(args.Buyer, out _, out var mind))
return false;
var unlocker = args.EntityManager.System<StoreUnlockerSystem>();
return unlocker.IsUnlocked(mind, args.Listing.ID);
}
}