@@ -1,5 +1,4 @@
|
||||
using Content.Server.Administration.Commands;
|
||||
using Content.Server.Administration.Systems;
|
||||
using Content.Shared.Administration.Systems;
|
||||
using Content.Shared.Damage;
|
||||
using Content.Shared.Damage.Prototypes;
|
||||
using Content.Shared.FixedPoint;
|
||||
|
||||
@@ -2,10 +2,10 @@ using System.Linq;
|
||||
using Content.Server.Administration.Logs;
|
||||
using Content.Server.Administration.Managers;
|
||||
using Content.Server.Administration.Notes;
|
||||
using Content.Server.Administration.Systems;
|
||||
using Content.Server.Database;
|
||||
using Content.Server.EUI;
|
||||
using Content.Shared.Administration;
|
||||
using Content.Shared.Administration.Systems;
|
||||
using Content.Shared.Database;
|
||||
using Content.Shared.Eui;
|
||||
using Content.Shared.Follower;
|
||||
|
||||
@@ -9,6 +9,7 @@ using Content.Server.Prayer;
|
||||
using Content.Server.Silicons.Laws;
|
||||
using Content.Server.Station.Systems;
|
||||
using Content.Shared.Administration;
|
||||
using Content.Shared.Administration.Systems;
|
||||
using Content.Shared.Chemistry.Components.SolutionManager;
|
||||
using Content.Shared.Chemistry.EntitySystems;
|
||||
using Content.Shared.Configurable;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using Content.Server.Administration.Systems;
|
||||
using Content.Shared.Administration;
|
||||
using Content.Shared.Administration;
|
||||
using Content.Shared.Administration.Systems;
|
||||
using Robust.Shared.Toolshed;
|
||||
using Robust.Shared.Toolshed.Errors;
|
||||
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
using Content.Shared.Rejuvenate;
|
||||
|
||||
namespace Content.Server.Administration.Systems;
|
||||
namespace Content.Shared.Administration.Systems;
|
||||
|
||||
public sealed class RejuvenateSystem : EntitySystem
|
||||
{
|
||||
/// <summary>
|
||||
/// Fully heals the target, removing all damage, debuffs or other negative status effects.
|
||||
/// </summary>
|
||||
public void PerformRejuvenate(EntityUid target)
|
||||
{
|
||||
RaiseLocalEvent(target, new RejuvenateEvent());
|
||||
@@ -1,5 +1,9 @@
|
||||
namespace Content.Shared.Rejuvenate;
|
||||
|
||||
public sealed class RejuvenateEvent : EntityEventArgs
|
||||
{
|
||||
}
|
||||
/// <summary>
|
||||
/// Raised when an entity is supposed to be rejuvenated,
|
||||
/// meaning it should heal all damage, debuffs or other negative status effects.
|
||||
/// Systems should handle healing the entity in a subscription to this event.
|
||||
/// Used for the Rejuvenate admin verb.
|
||||
/// </summary>
|
||||
public sealed class RejuvenateEvent : EntityEventArgs;
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
using Content.Shared.EntityEffects;
|
||||
using Robust.Shared.GameStates;
|
||||
|
||||
namespace Content.Shared.Trigger.Components.Effects;
|
||||
|
||||
/// <summary>
|
||||
/// Applies a list of entity effects to the owning entity when triggered.
|
||||
/// If TargetUser is true then they will be applied to the user instead.
|
||||
/// </summary>
|
||||
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
|
||||
public sealed partial class EntityEffectOnTriggerComponent : BaseXOnTriggerComponent
|
||||
{
|
||||
/// <summary>
|
||||
/// The effects to apply.
|
||||
/// </summary>
|
||||
[DataField, AutoNetworkedField]
|
||||
public EntityEffect[] Effects;
|
||||
|
||||
/// <summary>
|
||||
/// Optional scale multiplier for the effects.
|
||||
/// </summary>
|
||||
[DataField, AutoNetworkedField]
|
||||
public float Scale = 1f;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using Robust.Shared.GameStates;
|
||||
|
||||
namespace Content.Shared.Trigger.Components.Effects;
|
||||
|
||||
/// <summary>
|
||||
/// Rejuvenates the entity when triggered, which fully heals them, removing all damage, debuffs or other negative status effects.
|
||||
/// If TargetUser is true then the user will be rejuvenated instead.
|
||||
/// </summary>
|
||||
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
|
||||
public sealed partial class RejuvenateOnTriggerComponent : BaseXOnTriggerComponent;
|
||||
@@ -0,0 +1,30 @@
|
||||
using Content.Shared.EntityEffects;
|
||||
using Content.Shared.Trigger.Components.Effects;
|
||||
|
||||
namespace Content.Shared.Trigger.Systems;
|
||||
|
||||
public sealed class EntityEffectOnTriggerSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly SharedEntityEffectsSystem _effects = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<EntityEffectOnTriggerComponent, TriggerEvent>(OnTrigger);
|
||||
}
|
||||
|
||||
private void OnTrigger(Entity<EntityEffectOnTriggerComponent> ent, ref TriggerEvent args)
|
||||
{
|
||||
if (args.Key != null && !ent.Comp.KeysIn.Contains(args.Key))
|
||||
return;
|
||||
|
||||
var target = ent.Comp.TargetUser ? args.User : ent.Owner;
|
||||
|
||||
if (target == null)
|
||||
return;
|
||||
|
||||
_effects.ApplyEffects(target.Value, ent.Comp.Effects, ent.Comp.Scale);
|
||||
args.Handled = true;
|
||||
}
|
||||
}
|
||||
30
Content.Shared/Trigger/Systems/RejuvenateOnTriggerSystem.cs
Normal file
30
Content.Shared/Trigger/Systems/RejuvenateOnTriggerSystem.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using Content.Shared.Administration.Systems;
|
||||
using Content.Shared.Trigger.Components.Effects;
|
||||
|
||||
namespace Content.Shared.Trigger.Systems;
|
||||
|
||||
public sealed class RejuvenateOnTriggerSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly RejuvenateSystem _rejuvenate = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<RejuvenateOnTriggerComponent, TriggerEvent>(OnTrigger);
|
||||
}
|
||||
|
||||
private void OnTrigger(Entity<RejuvenateOnTriggerComponent> ent, ref TriggerEvent args)
|
||||
{
|
||||
if (args.Key != null && !ent.Comp.KeysIn.Contains(args.Key))
|
||||
return;
|
||||
|
||||
var target = ent.Comp.TargetUser ? args.User : ent.Owner;
|
||||
|
||||
if (target == null)
|
||||
return;
|
||||
|
||||
_rejuvenate.PerformRejuvenate(target.Value);
|
||||
args.Handled = true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user