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

@@ -1,6 +1,7 @@
using System.Linq;
using Content.Client.Gameplay;
using Content.Shared.CombatMode;
using Content.Shared.Effects;
using Content.Shared.Hands.Components;
using Content.Shared.Mobs.Components;
using Content.Shared.StatusEffect;
@@ -37,9 +38,7 @@ public sealed partial class MeleeWeaponSystem : SharedMeleeWeaponSystem
public override void Initialize()
{
base.Initialize();
InitializeEffect();
_overlayManager.AddOverlay(new MeleeWindupOverlay(EntityManager, _timing, _player, _protoManager));
SubscribeAllEvent<DamageEffectEvent>(OnDamageEffect);
SubscribeNetworkEvent<MeleeLungeEvent>(OnMeleeLunge);
UpdatesOutsidePrediction = true;
}
@@ -227,7 +226,7 @@ public sealed partial class MeleeWeaponSystem : SharedMeleeWeaponSystem
{
// Server never sends the event to us for predictiveeevent.
if (_timing.IsFirstTimePredicted)
RaiseLocalEvent(new DamageEffectEvent(Color.Red, targets));
RaiseLocalEvent(new ColorFlashEffectEvent(Color.Red, targets));
}
protected override bool DoDisarm(EntityUid user, DisarmAttackEvent ev, EntityUid meleeUid, MeleeWeaponComponent component, ICommonSession? session)