Merge branch 'master' into buckle-locker-fix-1262

This commit is contained in:
DrSmugleaf
2020-07-07 00:20:07 +02:00
267 changed files with 3520 additions and 1075 deletions

View File

@@ -1,6 +1,14 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using JetBrains.Annotations;
using Robust.Shared.GameObjects;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
using Robust.Shared.Timers;
using Robust.Shared.ViewVariables;
using YamlDotNet.RepresentationModel;
using Component = Robust.Shared.GameObjects.Component;
namespace Content.Shared.GameObjects.Components.Mobs
{
@@ -13,21 +21,72 @@ namespace Content.Shared.GameObjects.Components.Mobs
public sealed override uint? NetID => ContentNetIDs.OVERLAYEFFECTS;
}
public enum ScreenEffects
[Serializable, NetSerializable]
public class OverlayContainer
{
None,
CircleMask,
GradientCircleMask,
[ViewVariables(VVAccess.ReadOnly)]
public string ID { get; }
public OverlayContainer([NotNull] string id)
{
ID = id;
}
public OverlayContainer(OverlayType type) : this(type.ToString())
{
}
public override bool Equals(object obj)
{
if (obj is OverlayContainer container)
{
return container.ID == ID;
}
if (obj is string idString)
{
return idString == ID;
}
return base.Equals(obj);
}
public override int GetHashCode()
{
return (ID != null ? ID.GetHashCode() : 0);
}
}
[Serializable, NetSerializable]
public class OverlayEffectComponentState : ComponentState
{
public ScreenEffects ScreenEffect;
public List<OverlayContainer> Overlays;
public OverlayEffectComponentState(ScreenEffects screenEffect) : base(ContentNetIDs.OVERLAYEFFECTS)
public OverlayEffectComponentState(List<OverlayContainer> overlays) : base(ContentNetIDs.OVERLAYEFFECTS)
{
ScreenEffect = screenEffect;
Overlays = overlays;
}
}
[Serializable, NetSerializable]
public class TimedOverlayContainer : OverlayContainer
{
[ViewVariables(VVAccess.ReadOnly)]
public int Length { get; }
public TimedOverlayContainer(string id, int length) : base(id)
{
Length = length;
}
public void StartTimer(Action finished) => Timer.Spawn(Length, finished);
}
public enum OverlayType
{
GradientCircleMaskOverlay,
CircleMaskOverlay,
FlashOverlay
}
}

View File

@@ -45,7 +45,7 @@ namespace Content.Shared.GameObjects.Components.Movement
/// <summary>
/// Toggles one of the four cardinal directions. Each of the four directions are
/// composed into a single direction vector, <see cref="PlayerInputMoverComponent.VelocityDir"/>. Enabling
/// composed into a single direction vector, <see cref="SharedPlayerInputMoverComponent.VelocityDir"/>. Enabling
/// opposite directions will cancel each other out, resulting in no direction.
/// </summary>
/// <param name="direction">Direction to toggle.</param>

View File

@@ -0,0 +1,9 @@
using Robust.Shared.GameObjects;
namespace Content.Shared.GameObjects.Components
{
public abstract class SharedPlaceableSurfaceComponent : Component
{
public override string Name => "PlaceableSurface";
}
}

View File

@@ -26,12 +26,27 @@ namespace Content.Shared.GameObjects.Components.Strap
{
public sealed override string Name => "Strap";
public virtual StrapPosition Position { get; set; }
public sealed override uint? NetID => ContentNetIDs.STRAP;
[Serializable, NetSerializable]
public enum StrapVisuals
public abstract StrapPosition Position { get; protected set; }
}
[Serializable, NetSerializable]
public sealed class StrapComponentState : ComponentState
{
public readonly StrapPosition Position;
public StrapComponentState(StrapPosition position) : base(ContentNetIDs.BUCKLE)
{
RotationAngle
Position = position;
}
public bool Buckled { get; }
}
[Serializable, NetSerializable]
public enum StrapVisuals
{
RotationAngle
}
}