OverlayManager refactor and Flash (#1218)
* Flash component, overlay and shader Add BeginDraw method to Overlay.cs * Add flash icons, sounds * Progress * Multiple overlays without enums * This is probably the worst way to do this IDK * Remove nullable reference type * Add AttackEventArgs as parameter to OnHitEntities MeleeWeaponComponent.Attack now continues when OnHitEntities returns true (it hit something) Add OverlayType enum so client and server can agree on overlay ids Move IConfigurable to its own file Add AoE flash with shorter duration Flashing someone slows them down * Add arc to flash Set item size to something reasonable Remove chat log message when flash burns out * Remove unused interface
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System.Text;
|
||||
using Content.Server.GameObjects.Components.Mobs;
|
||||
using Content.Server.Mobs.Roles;
|
||||
using Content.Server.Players;
|
||||
using Content.Shared.Jobs;
|
||||
@@ -117,4 +118,52 @@ namespace Content.Server.Mobs
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class AddOverlayCommand : IClientCommand
|
||||
{
|
||||
public string Command => "addoverlay";
|
||||
public string Description => "Adds an overlay by its ID";
|
||||
public string Help => "addoverlay <id>";
|
||||
|
||||
public void Execute(IConsoleShell shell, IPlayerSession player, string[] args)
|
||||
{
|
||||
if (args.Length != 1)
|
||||
{
|
||||
shell.SendText(player, "Expected 1 argument.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (player?.AttachedEntity != null)
|
||||
{
|
||||
if (player.AttachedEntity.TryGetComponent(out ServerOverlayEffectsComponent overlayEffectsComponent))
|
||||
{
|
||||
overlayEffectsComponent.AddOverlay(args[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class RemoveOverlayCommand : IClientCommand
|
||||
{
|
||||
public string Command => "rmoverlay";
|
||||
public string Description => "Removes an overlay by its ID";
|
||||
public string Help => "rmoverlay <id>";
|
||||
|
||||
public void Execute(IConsoleShell shell, IPlayerSession player, string[] args)
|
||||
{
|
||||
if (args.Length != 1)
|
||||
{
|
||||
shell.SendText(player, "Expected 1 argument.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (player?.AttachedEntity != null)
|
||||
{
|
||||
if (player.AttachedEntity.TryGetComponent(out ServerOverlayEffectsComponent overlayEffectsComponent))
|
||||
{
|
||||
overlayEffectsComponent.RemoveOverlay(args[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user