Move and rename damage effect to color flash effect (#18263)

* move damage effect to different package

* rename to ColorFlashEffect

* renaming some other things
This commit is contained in:
Slava0135
2023-08-01 19:02:54 +03:00
committed by GitHub
parent 5978c7f5b2
commit d4c8065e8a
12 changed files with 158 additions and 154 deletions

View File

@@ -8,6 +8,7 @@ using Content.Shared.Cuffs.Components;
using Content.Shared.Damage;
using Content.Shared.Database;
using Content.Shared.DoAfter;
using Content.Shared.Effects;
using Content.Shared.Hands;
using Content.Shared.Hands.Components;
using Content.Shared.Hands.EntitySystems;
@@ -26,7 +27,6 @@ using Content.Shared.Pulling.Events;
using Content.Shared.Rejuvenate;
using Content.Shared.Stunnable;
using Content.Shared.Verbs;
using Content.Shared.Weapons.Melee;
using Content.Shared.Weapons.Melee.Events;
using Robust.Shared.Containers;
using Robust.Shared.Network;
@@ -592,7 +592,7 @@ namespace Content.Shared.Cuffs
if (target == user)
{
RaiseNetworkEvent(new DamageEffectEvent(Color.Red, new List<EntityUid>() { user }));
RaiseNetworkEvent(new ColorFlashEffectEvent(Color.Red, new List<EntityUid>() { user }));
_popup.PopupEntity(Loc.GetString("cuffable-component-start-uncuffing-self"), user, user);
}
else

View File

@@ -0,0 +1,11 @@
namespace Content.Shared.Effects;
/// <summary>
/// Stores the original sprite color for flashing entity to be able to restore it later.
/// </summary>
[RegisterComponent]
public sealed class ColorFlashEffectComponent : Component
{
[ViewVariables]
public Color Color = Color.White;
}

View File

@@ -0,0 +1,23 @@
using Robust.Shared.Serialization;
namespace Content.Shared.Effects;
/// <summary>
/// Raised on the server and sent to a client to play the color flash animation.
/// </summary>
[Serializable, NetSerializable]
public sealed class ColorFlashEffectEvent : EntityEventArgs
{
/// <summary>
/// Color to play for the flash.
/// </summary>
public Color Color;
public List<EntityUid> Entities;
public ColorFlashEffectEvent(Color color, List<EntityUid> entities)
{
Color = color;
Entities = entities;
}
}

View File

@@ -1,11 +0,0 @@
namespace Content.Shared.Weapons;
/// <summary>
/// Stores the original sprite color for a damaged entity to be able to restore it later.
/// </summary>
[RegisterComponent]
public sealed class DamageEffectComponent : Component
{
[ViewVariables]
public Color Color = Color.White;
}

View File

@@ -1,23 +0,0 @@
using Robust.Shared.Serialization;
namespace Content.Shared.Weapons.Melee;
/// <summary>
/// Raised on the server and sent to a client to play the damage animation.
/// </summary>
[Serializable, NetSerializable]
public sealed class DamageEffectEvent : EntityEventArgs
{
/// <summary>
/// Color to play for the damage flash.
/// </summary>
public Color Color;
public List<EntityUid> Entities;
public DamageEffectEvent(Color color, List<EntityUid> entities)
{
Color = color;
Entities = entities;
}
}