Merge branch 'master' into buckle-locker-fix-1262
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
using Content.Server.GameObjects.Components.Strap;
|
||||
using Content.Server.GameObjects.EntitySystems;
|
||||
using Content.Server.Interfaces;
|
||||
using Content.Server.Interfaces.GameObjects.Components.Interaction;
|
||||
using Content.Server.Mobs;
|
||||
using Content.Server.Utility;
|
||||
using Content.Shared.GameObjects;
|
||||
@@ -22,7 +23,7 @@ using Robust.Shared.ViewVariables;
|
||||
namespace Content.Server.GameObjects.Components.Mobs
|
||||
{
|
||||
[RegisterComponent]
|
||||
public class BuckleComponent : SharedBuckleComponent, IInteractHand
|
||||
public class BuckleComponent : SharedBuckleComponent, IInteractHand, IDragDrop
|
||||
{
|
||||
#pragma warning disable 649
|
||||
[Dependency] private readonly IEntitySystemManager _entitySystem = default!;
|
||||
@@ -305,6 +306,11 @@ namespace Content.Server.GameObjects.Components.Mobs
|
||||
return TryUnbuckle(eventArgs.User);
|
||||
}
|
||||
|
||||
bool IDragDrop.DragDrop(DragDropEventArgs eventArgs)
|
||||
{
|
||||
return TryBuckle(eventArgs.User, eventArgs.Target);
|
||||
}
|
||||
|
||||
[Verb]
|
||||
private sealed class BuckleVerb : Verb<BuckleComponent>
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using Content.Server.GameObjects.Components.Mobs;
|
||||
using Content.Server.GameObjects.EntitySystems;
|
||||
using Content.Server.Interfaces.GameObjects.Components.Interaction;
|
||||
using Content.Server.Mobs;
|
||||
using Content.Shared.Audio;
|
||||
using Content.Shared.GameObjects.Components.Mobs;
|
||||
|
||||
@@ -69,21 +69,24 @@ namespace Content.Server.GameObjects
|
||||
statusEffectsComponent?.ChangeStatusEffectIcon(StatusEffect.Health,
|
||||
"/Textures/Mob/UI/Human/human" + modifier + ".png");
|
||||
|
||||
overlayComponent?.ChangeOverlay(ScreenEffects.None);
|
||||
overlayComponent?.RemoveOverlay(OverlayType.GradientCircleMaskOverlay);
|
||||
overlayComponent?.RemoveOverlay(OverlayType.CircleMaskOverlay);
|
||||
|
||||
return;
|
||||
case ThresholdType.Critical:
|
||||
statusEffectsComponent?.ChangeStatusEffectIcon(
|
||||
StatusEffect.Health,
|
||||
"/Textures/Mob/UI/Human/humancrit-0.png");
|
||||
overlayComponent?.ChangeOverlay(ScreenEffects.GradientCircleMask);
|
||||
overlayComponent?.ClearOverlays();
|
||||
overlayComponent?.AddOverlay(OverlayType.GradientCircleMaskOverlay);
|
||||
|
||||
return;
|
||||
case ThresholdType.Death:
|
||||
statusEffectsComponent?.ChangeStatusEffectIcon(
|
||||
StatusEffect.Health,
|
||||
"/Textures/Mob/UI/Human/humandead.png");
|
||||
overlayComponent?.ChangeOverlay(ScreenEffects.CircleMask);
|
||||
overlayComponent?.ClearOverlays();
|
||||
overlayComponent?.AddOverlay(OverlayType.CircleMaskOverlay);
|
||||
|
||||
return;
|
||||
default:
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Content.Server.GameObjects.Components.Observer;
|
||||
using Content.Server.GameObjects.EntitySystems;
|
||||
using Content.Server.GameObjects.EntitySystems.Click;
|
||||
using Content.Server.Interfaces.GameObjects.Components.Interaction;
|
||||
using Content.Server.Interfaces.GameTicking;
|
||||
using Content.Server.Mobs;
|
||||
using Robust.Shared.GameObjects;
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Content.Shared.GameObjects.Components.Mobs;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Timers;
|
||||
using Robust.Shared.ViewVariables;
|
||||
|
||||
namespace Content.Server.GameObjects.Components.Mobs
|
||||
{
|
||||
@@ -7,20 +12,49 @@ namespace Content.Server.GameObjects.Components.Mobs
|
||||
[ComponentReference(typeof(SharedOverlayEffectsComponent))]
|
||||
public sealed class ServerOverlayEffectsComponent : SharedOverlayEffectsComponent
|
||||
{
|
||||
private ScreenEffects _currentOverlay = ScreenEffects.None;
|
||||
private readonly List<OverlayContainer> _currentOverlays = new List<OverlayContainer>();
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
private List<OverlayContainer> ActiveOverlays => _currentOverlays;
|
||||
|
||||
public override ComponentState GetComponentState()
|
||||
{
|
||||
return new OverlayEffectComponentState(_currentOverlay);
|
||||
return new OverlayEffectComponentState(_currentOverlays);
|
||||
}
|
||||
|
||||
public void ChangeOverlay(ScreenEffects effect)
|
||||
public void AddOverlay(OverlayContainer container)
|
||||
{
|
||||
if (effect == _currentOverlay)
|
||||
if (!ActiveOverlays.Contains(container))
|
||||
{
|
||||
return;
|
||||
ActiveOverlays.Add(container);
|
||||
Dirty();
|
||||
}
|
||||
_currentOverlay = effect;
|
||||
}
|
||||
|
||||
public void AddOverlay(string id) => AddOverlay(new OverlayContainer(id));
|
||||
public void AddOverlay(OverlayType type) => AddOverlay(new OverlayContainer(type));
|
||||
|
||||
public void RemoveOverlay(OverlayContainer container)
|
||||
{
|
||||
if (ActiveOverlays.RemoveAll(c => c.Equals(container)) > 0)
|
||||
{
|
||||
Dirty();
|
||||
}
|
||||
}
|
||||
|
||||
public void RemoveOverlay(string id)
|
||||
{
|
||||
if (ActiveOverlays.RemoveAll(container => container.ID == id) > 0)
|
||||
{
|
||||
Dirty();
|
||||
}
|
||||
}
|
||||
|
||||
public void RemoveOverlay(OverlayType type) => RemoveOverlay(type.ToString());
|
||||
|
||||
public void ClearOverlays()
|
||||
{
|
||||
ActiveOverlays.Clear();
|
||||
Dirty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Content.Server.GameObjects.Components.Mobs;
|
||||
using Content.Server.GameObjects.EntitySystems;
|
||||
using Content.Server.Interfaces.GameObjects.Components.Interaction;
|
||||
using Content.Server.Interfaces;
|
||||
using Content.Server.Observer;
|
||||
using Content.Shared.GameObjects;
|
||||
@@ -79,7 +79,7 @@ namespace Content.Server.GameObjects
|
||||
statusEffectsComponent?.RemoveStatusEffect(StatusEffect.Health);
|
||||
|
||||
Owner.TryGetComponent(out ServerOverlayEffectsComponent overlayEffectsComponent);
|
||||
overlayEffectsComponent?.ChangeOverlay(ScreenEffects.None);
|
||||
overlayEffectsComponent?.ClearOverlays();
|
||||
}
|
||||
|
||||
bool IActionBlocker.CanMove()
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
using System;
|
||||
using System.Threading;
|
||||
using Content.Server.GameObjects.Components.Movement;
|
||||
using Content.Server.Interfaces.GameObjects.Components.Interaction;
|
||||
using Content.Server.Interfaces.GameObjects;
|
||||
using Content.Server.GameObjects.EntitySystems;
|
||||
using Content.Server.Mobs;
|
||||
using Content.Shared.Audio;
|
||||
|
||||
Reference in New Issue
Block a user