plutonium core steal objective (#26786)
* add textures * add SealingCabinet system * add StoreUnlocker/ObjectiveUnlock system * add plutonium core and nuke core container * make nuke deconstructable * add steal core objective * add core extraction toolbox to new category * typo ops wrench fuel * use queries and resolve, have it resolve instead of using Comp --------- Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
21
Content.Server/Store/Conditions/ObjectiveUnlockCondition.cs
Normal file
21
Content.Server/Store/Conditions/ObjectiveUnlockCondition.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user