Merge branch 'master-upstream' into expl_int_analyzer
# Conflicts: # Content.Server/GameObjects/Components/Body/Part/BodyPartComponent.cs # Content.Server/GameObjects/Components/Botany/PlantHolderComponent.cs # Content.Server/GameObjects/Components/Chemistry/PillComponent.cs # Content.Server/GameObjects/Components/Interactable/TilePryingComponent.cs # Content.Server/GameObjects/Components/Items/FloorTileItemComponent.cs # Content.Server/GameObjects/Components/Items/RCD/RCDAmmoComponent.cs # Content.Server/GameObjects/Components/Items/RCD/RCDComponent.cs # Content.Server/GameObjects/Components/Medical/HealingComponent.cs # Content.Server/GameObjects/Components/Power/WirePlacerComponent.cs # Content.Shared/Chemistry/Solution.cs
This commit is contained in:
@@ -4,13 +4,17 @@ using Content.Shared.GameObjects.Components.Mobs;
|
||||
using Content.Shared.GameObjects.EntitySystems;
|
||||
using Content.Shared.Interfaces;
|
||||
using Content.Shared.Interfaces.GameObjects.Components;
|
||||
using Content.Shared.Network.NetMessages;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Server.GameObjects.EntitySystems;
|
||||
using Robust.Server.Interfaces.Player;
|
||||
using Robust.Server.Interfaces.GameObjects;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.GameObjects.Components.Timers;
|
||||
using Robust.Shared.GameObjects.Systems;
|
||||
using Robust.Shared.Interfaces.GameObjects;
|
||||
using Robust.Shared.Interfaces.Network;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Localization;
|
||||
using Robust.Shared.Serialization;
|
||||
@@ -128,22 +132,12 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee
|
||||
}
|
||||
|
||||
// TODO: Check if target can be flashed (e.g. things like sunglasses would block a flash)
|
||||
// TODO: Merge with the code in FlashableComponent
|
||||
private void Flash(IEntity entity, IEntity user, int flashDuration)
|
||||
{
|
||||
if (entity.TryGetComponent(out ServerOverlayEffectsComponent overlayEffectsComponent))
|
||||
if (entity.TryGetComponent(out FlashableComponent flashable))
|
||||
{
|
||||
if (!overlayEffectsComponent.TryModifyOverlay(nameof(SharedOverlayID.FlashOverlay),
|
||||
overlay =>
|
||||
{
|
||||
if (overlay.TryGetOverlayParameter<TimedOverlayParameter>(out var timed))
|
||||
{
|
||||
timed.Length += flashDuration;
|
||||
}
|
||||
}))
|
||||
{
|
||||
var container = new OverlayContainer(SharedOverlayID.FlashOverlay, new TimedOverlayParameter(flashDuration));
|
||||
overlayEffectsComponent.AddOverlay(container);
|
||||
}
|
||||
flashable.Flash(flashDuration / 1000d);
|
||||
}
|
||||
|
||||
if (entity.TryGetComponent(out StunnableComponent stunnableComponent))
|
||||
|
||||
Reference in New Issue
Block a user