Artifact glue reagent (#38670)
* a * Revert "a" This reverts commit 2b9ba4ea67a9395d30b7ab37c8065f627f1a961a. * f * dev it * a? * ad * forgor * Revert "f" This reverts commit 39228c7cbe4d28ba43b73580b55e01c3979eb869. * derandomisation! * reviv * flavor * fixe * dwwasdwasdwa * dwasdwasdwas * fuck you
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
using Content.Shared.Xenoarchaeology.Artifact.Components;
|
||||
using Content.Shared.Xenoarchaeology.Artifact;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Shared.EntityEffects.Effects;
|
||||
|
||||
/// <summary>
|
||||
/// Restores durability in active artefact nodes.
|
||||
/// </summary>
|
||||
public sealed partial class ArtifactDurabilityRestore : EntityEffect
|
||||
{
|
||||
/// <summary>
|
||||
/// Amount of durability that will be restored per effect interaction.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public int RestoredDurability = 1;
|
||||
|
||||
public override void Effect(EntityEffectBaseArgs args)
|
||||
{
|
||||
var entMan = args.EntityManager;
|
||||
var xenoArtifactSys = entMan.System<SharedXenoArtifactSystem>();
|
||||
|
||||
if (!entMan.TryGetComponent<XenoArtifactComponent>(args.TargetEntity, out var xenoArtifact))
|
||||
return;
|
||||
|
||||
foreach (var node in xenoArtifactSys.GetActiveNodes((args.TargetEntity, xenoArtifact)))
|
||||
{
|
||||
xenoArtifactSys.AdjustNodeDurability(node.Owner, RestoredDurability);
|
||||
}
|
||||
}
|
||||
|
||||
protected override string ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
|
||||
{
|
||||
return Loc.GetString("reagent-effect-guidebook-artifact-durability-restore", ("restored", RestoredDurability));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user