Merge branch 'master' into 2020-08-19-firelocks
# Conflicts: # Content.Server/GameObjects/Components/Atmos/AirtightComponent.cs # Content.Server/GameObjects/Components/Atmos/GridAtmosphereComponent.cs # SpaceStation14.sln.DotSettings
This commit is contained in:
89
Content.Shared/Atmos/AtmosDirection.cs
Normal file
89
Content.Shared/Atmos/AtmosDirection.cs
Normal file
@@ -0,0 +1,89 @@
|
||||
using System;
|
||||
using Robust.Shared.Maths;
|
||||
|
||||
namespace Content.Shared.Atmos
|
||||
{
|
||||
/// <summary>
|
||||
/// The reason we use this over <see cref="Direction"/> is that we are going to do some heavy bitflag usage.
|
||||
/// </summary>
|
||||
[Flags]
|
||||
public enum AtmosDirection : byte
|
||||
{
|
||||
Invalid = 0,
|
||||
North = 1 << 0,
|
||||
South = 1 << 1,
|
||||
East = 1 << 2,
|
||||
West = 1 << 3,
|
||||
|
||||
NorthEast = North | East,
|
||||
NorthWest = North | West,
|
||||
SouthEast = South | East,
|
||||
SouthWest = South | West,
|
||||
|
||||
All = North | South | East | West,
|
||||
}
|
||||
|
||||
public static class AtmosDirectionHelpers
|
||||
{
|
||||
public static AtmosDirection GetOpposite(this AtmosDirection direction)
|
||||
{
|
||||
return direction switch
|
||||
{
|
||||
AtmosDirection.North => AtmosDirection.South,
|
||||
AtmosDirection.South => AtmosDirection.North,
|
||||
AtmosDirection.East => AtmosDirection.West,
|
||||
AtmosDirection.West => AtmosDirection.East,
|
||||
AtmosDirection.NorthEast => AtmosDirection.SouthWest,
|
||||
AtmosDirection.NorthWest => AtmosDirection.SouthEast,
|
||||
AtmosDirection.SouthEast => AtmosDirection.NorthWest,
|
||||
AtmosDirection.SouthWest => AtmosDirection.NorthEast,
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(direction))
|
||||
};
|
||||
}
|
||||
|
||||
public static Direction ToDirection(this AtmosDirection direction)
|
||||
{
|
||||
return direction switch
|
||||
{
|
||||
AtmosDirection.North => Direction.North,
|
||||
AtmosDirection.South => Direction.South,
|
||||
AtmosDirection.East => Direction.East,
|
||||
AtmosDirection.West => Direction.West,
|
||||
AtmosDirection.NorthEast => Direction.NorthEast,
|
||||
AtmosDirection.NorthWest => Direction.NorthWest,
|
||||
AtmosDirection.SouthEast => Direction.SouthEast,
|
||||
AtmosDirection.SouthWest => Direction.SouthWest,
|
||||
AtmosDirection.Invalid => Direction.Invalid,
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(direction))
|
||||
};
|
||||
}
|
||||
|
||||
public static AtmosDirection ToAtmosDirection(this Direction direction)
|
||||
{
|
||||
return direction switch
|
||||
{
|
||||
Direction.North => AtmosDirection.North,
|
||||
Direction.South => AtmosDirection.South,
|
||||
Direction.East => AtmosDirection.East,
|
||||
Direction.West => AtmosDirection.West,
|
||||
Direction.NorthEast => AtmosDirection.NorthEast,
|
||||
Direction.NorthWest => AtmosDirection.NorthWest,
|
||||
Direction.SouthEast => AtmosDirection.SouthEast,
|
||||
Direction.SouthWest => AtmosDirection.SouthWest,
|
||||
Direction.Invalid => AtmosDirection.Invalid,
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(direction))
|
||||
};
|
||||
}
|
||||
|
||||
public static int ToIndex(this AtmosDirection direction)
|
||||
{
|
||||
// This will throw if you pass an invalid direction. Not this method's fault, but yours!
|
||||
return (int) Math.Log2((int) direction);
|
||||
}
|
||||
|
||||
public static AtmosDirection WithFlag(this AtmosDirection direction, AtmosDirection other)
|
||||
{
|
||||
return direction | other;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,45 +1,10 @@
|
||||
using System.Collections.Generic;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
namespace Content.Shared.Atmos
|
||||
namespace Content.Shared.Atmos
|
||||
{
|
||||
/// <summary>
|
||||
/// Class to store atmos constants.
|
||||
/// </summary>
|
||||
public static class Atmospherics
|
||||
public class Atmospherics
|
||||
{
|
||||
static Atmospherics()
|
||||
{
|
||||
var protoMan = IoCManager.Resolve<IPrototypeManager>();
|
||||
|
||||
GasPrototypes = new GasPrototype[TotalNumberOfGases];
|
||||
GasOverlays = new SpriteSpecifier[TotalNumberOfGases];
|
||||
|
||||
for (var i = 0; i < TotalNumberOfGases; i++)
|
||||
{
|
||||
var gasPrototype = protoMan.Index<GasPrototype>(i.ToString());
|
||||
GasPrototypes[i] = gasPrototype;
|
||||
|
||||
if(string.IsNullOrEmpty(gasPrototype.GasOverlaySprite) && !string.IsNullOrEmpty(gasPrototype.GasOverlayTexture))
|
||||
GasOverlays[i] = new SpriteSpecifier.Texture(new ResourcePath(gasPrototype.GasOverlayTexture));
|
||||
|
||||
if(!string.IsNullOrEmpty(gasPrototype.GasOverlaySprite) && !string.IsNullOrEmpty(gasPrototype.GasOverlayState))
|
||||
GasOverlays[i] = new SpriteSpecifier.Rsi(new ResourcePath(gasPrototype.GasOverlaySprite), gasPrototype.GasOverlayState);
|
||||
}
|
||||
}
|
||||
|
||||
private static readonly GasPrototype[] GasPrototypes;
|
||||
|
||||
public static GasPrototype GetGas(int gasId) => GasPrototypes[gasId];
|
||||
public static GasPrototype GetGas(Gas gasId) => GasPrototypes[(int) gasId];
|
||||
public static IEnumerable<GasPrototype> Gases => GasPrototypes;
|
||||
|
||||
private static readonly SpriteSpecifier[] GasOverlays;
|
||||
|
||||
public static SpriteSpecifier GetOverlay(int overlayId) => GasOverlays[overlayId];
|
||||
|
||||
#region ATMOS
|
||||
/// <summary>
|
||||
/// The universal gas constant, in kPa*L/(K*mol)
|
||||
@@ -246,6 +211,12 @@ namespace Content.Shared.Atmos
|
||||
public const int LowPressureDamage = 4;
|
||||
|
||||
public const float WindowHeatTransferCoefficient = 0.1f;
|
||||
|
||||
/// <summary>
|
||||
/// Directions that atmos currently supports. Modify in case of multi-z.
|
||||
/// See <see cref="AtmosDirection"/> on the server.
|
||||
/// </summary>
|
||||
public const int Directions = 4;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -14,9 +14,7 @@ namespace Content.Shared.Chemistry
|
||||
{
|
||||
private const float CelsiusToKelvin = 273.15f;
|
||||
|
||||
#pragma warning disable 649
|
||||
[Dependency] private readonly IModuleManager _moduleManager;
|
||||
#pragma warning restore 649
|
||||
[Dependency] private readonly IModuleManager _moduleManager = default!;
|
||||
|
||||
private string _id;
|
||||
private string _name;
|
||||
|
||||
@@ -16,11 +16,9 @@ namespace Content.Shared
|
||||
// If you want to change your codebase's language, do it here.
|
||||
private const string Culture = "en-US";
|
||||
|
||||
#pragma warning disable 649
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager;
|
||||
[Dependency] private readonly ITileDefinitionManager _tileDefinitionManager;
|
||||
[Dependency] private readonly ILocalizationManager _localizationManager;
|
||||
#pragma warning restore 649
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||
[Dependency] private readonly ITileDefinitionManager _tileDefinitionManager = default!;
|
||||
[Dependency] private readonly ILocalizationManager _localizationManager = default!;
|
||||
|
||||
public override void PreInit()
|
||||
{
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
using Content.Shared.GameObjects.EntitySystems;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Serialization;
|
||||
using Robust.Shared.Maths;
|
||||
using Robust.Shared.ViewVariables;
|
||||
using System;
|
||||
|
||||
namespace Content.Shared.GameObjects.Components.ActionBlocking
|
||||
{
|
||||
public class SharedCuffableComponent : Component, IActionBlocker
|
||||
{
|
||||
public override string Name => "Cuffable";
|
||||
public override uint? NetID => ContentNetIDs.CUFFED;
|
||||
|
||||
[ViewVariables]
|
||||
public bool CanStillInteract = true;
|
||||
|
||||
#region ActionBlockers
|
||||
|
||||
bool IActionBlocker.CanInteract() => CanStillInteract;
|
||||
bool IActionBlocker.CanUse() => CanStillInteract;
|
||||
bool IActionBlocker.CanPickup() => CanStillInteract;
|
||||
bool IActionBlocker.CanDrop() => CanStillInteract;
|
||||
bool IActionBlocker.CanAttack() => CanStillInteract;
|
||||
bool IActionBlocker.CanEquip() => CanStillInteract;
|
||||
bool IActionBlocker.CanUnequip() => CanStillInteract;
|
||||
|
||||
#endregion
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
protected sealed class CuffableComponentState : ComponentState
|
||||
{
|
||||
public bool CanStillInteract { get; }
|
||||
public int NumHandsCuffed { get; }
|
||||
public string RSI { get; }
|
||||
public string IconState { get; }
|
||||
public Color Color { get; }
|
||||
|
||||
public CuffableComponentState(int numHandsCuffed, bool canStillInteract, string rsiPath, string iconState, Color color) : base(ContentNetIDs.CUFFED)
|
||||
{
|
||||
NumHandsCuffed = numHandsCuffed;
|
||||
CanStillInteract = canStillInteract;
|
||||
RSI = rsiPath;
|
||||
IconState = iconState;
|
||||
Color = color;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Serialization;
|
||||
using System;
|
||||
|
||||
namespace Content.Shared.GameObjects.Components.ActionBlocking
|
||||
{
|
||||
public class SharedHandcuffComponent : Component
|
||||
{
|
||||
public override string Name => "Handcuff";
|
||||
public override uint? NetID => ContentNetIDs.HANDCUFFS;
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
protected sealed class HandcuffedComponentState : ComponentState
|
||||
{
|
||||
public string IconState { get; }
|
||||
|
||||
public HandcuffedComponentState(string iconState) : base(ContentNetIDs.HANDCUFFS)
|
||||
{
|
||||
IconState = iconState;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Content.Shared.GameObjects.Components.Damage;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Serialization;
|
||||
@@ -11,15 +10,6 @@ namespace Content.Shared.GameObjects.Components.Body
|
||||
public override string Name => "BodyManager";
|
||||
|
||||
public override uint? NetID => ContentNetIDs.BODY_MANAGER;
|
||||
|
||||
public override List<DamageState> SupportedDamageStates => new List<DamageState> {DamageState.Alive, DamageState.Critical, DamageState.Dead};
|
||||
|
||||
public override DamageState CurrentDamageState =>
|
||||
CurrentDamageState = TotalDamage > 200
|
||||
? DamageState.Dead
|
||||
: TotalDamage > 100
|
||||
? DamageState.Critical
|
||||
: DamageState.Alive;
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
|
||||
@@ -9,15 +9,12 @@ namespace Content.Shared.GameObjects.Components.Cargo
|
||||
{
|
||||
public class SharedCargoConsoleComponent : Component
|
||||
{
|
||||
#pragma warning disable CS0649
|
||||
[Dependency]
|
||||
protected IPrototypeManager _prototypeManager;
|
||||
#pragma warning restore
|
||||
[Dependency] protected readonly IPrototypeManager PrototypeManager = default!;
|
||||
|
||||
public sealed override string Name => "CargoConsole";
|
||||
|
||||
/// <summary>
|
||||
/// Sends away or requests shuttle
|
||||
/// Sends away or requests shuttle
|
||||
/// </summary>
|
||||
[Serializable, NetSerializable]
|
||||
public class CargoConsoleShuttleMessage : BoundUserInterfaceMessage
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using Robust.Shared.Interfaces.GameObjects;
|
||||
using System;
|
||||
using Robust.Shared.Interfaces.GameObjects;
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared.GameObjects.Components.Damage
|
||||
{
|
||||
@@ -11,6 +13,7 @@ namespace Content.Shared.GameObjects.Components.Damage
|
||||
/// <see cref="DamageState.Alive"/> and <see cref="DamageState.Dead"/>,
|
||||
/// as inanimate objects don't go into crit.
|
||||
/// </summary>
|
||||
[Serializable, NetSerializable]
|
||||
public enum DamageState
|
||||
{
|
||||
Alive,
|
||||
|
||||
@@ -21,21 +21,66 @@ namespace Content.Shared.GameObjects.Components.Damage
|
||||
[ComponentReference(typeof(IDamageableComponent))]
|
||||
public class DamageableComponent : Component, IDamageableComponent
|
||||
{
|
||||
#pragma warning disable 649
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||
#pragma warning restore 649
|
||||
|
||||
public override string Name => "Damageable";
|
||||
|
||||
public event Action<HealthChangedEventArgs> HealthChangedEvent = default!;
|
||||
private DamageState _currentDamageState;
|
||||
|
||||
public event Action<HealthChangedEventArgs>? HealthChangedEvent;
|
||||
|
||||
/// <summary>
|
||||
/// The threshold of damage, if any, above which the entity enters crit.
|
||||
/// -1 means that this entity cannot go into crit.
|
||||
/// </summary>
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public int? CriticalThreshold { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The threshold of damage, if any, above which the entity dies.
|
||||
/// -1 means that this entity cannot die.
|
||||
/// </summary>
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public int? DeadThreshold { get; set; }
|
||||
|
||||
[ViewVariables] private ResistanceSet Resistance { get; set; } = default!;
|
||||
|
||||
[ViewVariables] private DamageContainer Damage { get; set; } = default!;
|
||||
|
||||
public virtual List<DamageState> SupportedDamageStates => new List<DamageState> {DamageState.Alive};
|
||||
public virtual List<DamageState> SupportedDamageStates
|
||||
{
|
||||
get
|
||||
{
|
||||
var states = new List<DamageState> {DamageState.Alive};
|
||||
|
||||
public virtual DamageState CurrentDamageState { get; protected set; } = DamageState.Alive;
|
||||
if (CriticalThreshold != null)
|
||||
{
|
||||
states.Add(DamageState.Critical);
|
||||
}
|
||||
|
||||
if (DeadThreshold != null)
|
||||
{
|
||||
states.Add(DamageState.Dead);
|
||||
}
|
||||
|
||||
return states;
|
||||
}
|
||||
}
|
||||
|
||||
public virtual DamageState CurrentDamageState
|
||||
{
|
||||
get => _currentDamageState;
|
||||
set
|
||||
{
|
||||
var old = _currentDamageState;
|
||||
_currentDamageState = value;
|
||||
|
||||
if (old != value)
|
||||
{
|
||||
EnterState(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[ViewVariables] public int TotalDamage => Damage.TotalDamage;
|
||||
|
||||
@@ -47,6 +92,18 @@ namespace Content.Shared.GameObjects.Components.Damage
|
||||
{
|
||||
base.ExposeData(serializer);
|
||||
|
||||
serializer.DataReadWriteFunction(
|
||||
"criticalThreshold",
|
||||
-1,
|
||||
t => CriticalThreshold = t == -1 ? (int?) null : t,
|
||||
() => CriticalThreshold ?? -1);
|
||||
|
||||
serializer.DataReadWriteFunction(
|
||||
"deadThreshold",
|
||||
-1,
|
||||
t => DeadThreshold = t == -1 ? (int?) null : t,
|
||||
() => DeadThreshold ?? -1);
|
||||
|
||||
if (serializer.Reading)
|
||||
{
|
||||
// Doesn't write to file, TODO?
|
||||
@@ -75,6 +132,16 @@ namespace Content.Shared.GameObjects.Components.Damage
|
||||
}
|
||||
}
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
foreach (var behavior in Owner.GetAllComponents<IOnHealthChangedBehavior>())
|
||||
{
|
||||
HealthChangedEvent += behavior.OnHealthChanged;
|
||||
}
|
||||
}
|
||||
|
||||
public bool TryGetDamage(DamageType type, out int damage)
|
||||
{
|
||||
return Damage.TryGetDamageValue(type, out damage);
|
||||
@@ -218,10 +285,26 @@ namespace Content.Shared.GameObjects.Components.Damage
|
||||
OnHealthChanged(args);
|
||||
}
|
||||
|
||||
protected virtual void EnterState(DamageState state) { }
|
||||
|
||||
protected virtual void OnHealthChanged(HealthChangedEventArgs e)
|
||||
{
|
||||
if (DeadThreshold != -1 && TotalDamage > DeadThreshold)
|
||||
{
|
||||
CurrentDamageState = DamageState.Dead;
|
||||
}
|
||||
else if (CriticalThreshold != -1 && TotalDamage > CriticalThreshold)
|
||||
{
|
||||
CurrentDamageState = DamageState.Critical;
|
||||
}
|
||||
else
|
||||
{
|
||||
CurrentDamageState = DamageState.Alive;
|
||||
}
|
||||
|
||||
Owner.EntityManager.EventBus.RaiseEvent(EventSource.Local, e);
|
||||
HealthChangedEvent?.Invoke(e);
|
||||
|
||||
Dirty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.GameObjects.Components;
|
||||
using Robust.Shared.GameObjects.Components.UserInterface;
|
||||
using Robust.Shared.Interfaces.GameObjects;
|
||||
using Robust.Shared.Interfaces.GameObjects.Components;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Physics;
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared.GameObjects.Components.Disposal
|
||||
{
|
||||
public abstract class SharedDisposalUnitComponent : Component
|
||||
public abstract class SharedDisposalUnitComponent : Component, ICollideSpecial
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||
|
||||
public override string Name => "DisposalUnit";
|
||||
|
||||
private readonly List<IEntity> _intersecting = new List<IEntity>();
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public enum Visuals
|
||||
{
|
||||
@@ -57,8 +68,48 @@ namespace Content.Shared.GameObjects.Components.Disposal
|
||||
Pressurizing
|
||||
}
|
||||
|
||||
bool ICollideSpecial.PreventCollide(IPhysBody collided)
|
||||
{
|
||||
if (IsExiting(collided.Entity)) return true;
|
||||
if (!Owner.TryGetComponent(out IContainerManager manager)) return false;
|
||||
|
||||
if (manager.ContainsEntity(collided.Entity))
|
||||
{
|
||||
if (!_intersecting.Contains(collided.Entity))
|
||||
{
|
||||
_intersecting.Add(collided.Entity);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public virtual void Update(float frameTime)
|
||||
{
|
||||
UpdateIntersecting();
|
||||
}
|
||||
|
||||
private bool IsExiting(IEntity entity)
|
||||
{
|
||||
return _intersecting.Contains(entity);
|
||||
}
|
||||
|
||||
private void UpdateIntersecting()
|
||||
{
|
||||
if(_intersecting.Count == 0) return;
|
||||
|
||||
var intersectingEntities = _entityManager.GetEntitiesIntersecting(Owner);
|
||||
for (var i = _intersecting.Count - 1; i >= 0; i--)
|
||||
{
|
||||
if (!intersectingEntities.Contains(_intersecting[i]))
|
||||
{
|
||||
_intersecting.RemoveAt(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public class DisposalUnitBoundUserInterfaceState : BoundUserInterfaceState
|
||||
public class DisposalUnitBoundUserInterfaceState : BoundUserInterfaceState, IEquatable<DisposalUnitBoundUserInterfaceState>
|
||||
{
|
||||
public readonly string UnitName;
|
||||
public readonly string UnitState;
|
||||
@@ -75,6 +126,17 @@ namespace Content.Shared.GameObjects.Components.Disposal
|
||||
Powered = powered;
|
||||
Engaged = engaged;
|
||||
}
|
||||
|
||||
public bool Equals(DisposalUnitBoundUserInterfaceState other)
|
||||
{
|
||||
if (ReferenceEquals(null, other)) return false;
|
||||
if (ReferenceEquals(this, other)) return true;
|
||||
return UnitName == other.UnitName &&
|
||||
UnitState == other.UnitState &&
|
||||
Powered == other.Powered &&
|
||||
Engaged == other.Engaged &&
|
||||
Pressure.Equals(other.Pressure);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -41,16 +41,29 @@ namespace Content.Shared.GameObjects.Components.GUI
|
||||
}
|
||||
}
|
||||
|
||||
[NetSerializable, Serializable]
|
||||
public class StrippingHandcuffButtonPressed : BoundUserInterfaceMessage
|
||||
{
|
||||
public EntityUid Handcuff { get; }
|
||||
|
||||
public StrippingHandcuffButtonPressed(EntityUid handcuff)
|
||||
{
|
||||
Handcuff = handcuff;
|
||||
}
|
||||
}
|
||||
|
||||
[NetSerializable, Serializable]
|
||||
public class StrippingBoundUserInterfaceState : BoundUserInterfaceState
|
||||
{
|
||||
public Dictionary<Slots, string> Inventory { get; }
|
||||
public Dictionary<string, string> Hands { get; }
|
||||
public Dictionary<EntityUid, string> Handcuffs { get; }
|
||||
|
||||
public StrippingBoundUserInterfaceState(Dictionary<Slots, string> inventory, Dictionary<string, string> hands)
|
||||
public StrippingBoundUserInterfaceState(Dictionary<Slots, string> inventory, Dictionary<string, string> hands, Dictionary<EntityUid, string> handcuffs)
|
||||
{
|
||||
Inventory = inventory;
|
||||
Hands = hands;
|
||||
Handcuffs = handcuffs;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,12 +8,4 @@ namespace Content.Shared.GameObjects.Components.Mobs
|
||||
{
|
||||
State
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public enum DamageStateVisualData
|
||||
{
|
||||
Normal,
|
||||
Crit,
|
||||
Dead
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Serialization;
|
||||
@@ -58,6 +58,7 @@ namespace Content.Shared.GameObjects.Components.Mobs
|
||||
Thirst,
|
||||
Pressure,
|
||||
Stun,
|
||||
Cuffed,
|
||||
Buckled,
|
||||
Piloting,
|
||||
Pulling,
|
||||
|
||||
@@ -14,9 +14,7 @@ namespace Content.Shared.GameObjects.Components.Mobs
|
||||
{
|
||||
public abstract class SharedStunnableComponent : Component, IMoveSpeedModifier, IActionBlocker, IInteractHand
|
||||
{
|
||||
#pragma warning disable 649
|
||||
[Dependency] private IGameTiming _gameTiming;
|
||||
#pragma warning restore 649
|
||||
[Dependency] private readonly IGameTiming _gameTiming = default!;
|
||||
|
||||
public sealed override string Name => "Stunnable";
|
||||
public override uint? NetID => ContentNetIDs.STUNNABLE;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Content.Shared.GameObjects.Components.Mobs;
|
||||
using Content.Shared.GameObjects.EntitySystems;
|
||||
using Content.Shared.Physics;
|
||||
@@ -7,6 +8,7 @@ using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.GameObjects.Components;
|
||||
using Robust.Shared.Interfaces.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Physics;
|
||||
using Robust.Shared.Serialization;
|
||||
using Robust.Shared.ViewVariables;
|
||||
|
||||
@@ -14,9 +16,7 @@ namespace Content.Shared.GameObjects.Components.Movement
|
||||
{
|
||||
public abstract class SharedSlipperyComponent : Component, ICollideBehavior
|
||||
{
|
||||
#pragma warning disable 649
|
||||
[Dependency] private readonly IEntityManager _entityManager;
|
||||
#pragma warning restore 649
|
||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||
|
||||
public sealed override string Name => "Slippery";
|
||||
|
||||
@@ -116,12 +116,18 @@ namespace Content.Shared.GameObjects.Components.Movement
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
var collidable = Owner.GetComponent<ICollidableComponent>();
|
||||
|
||||
var collidable = Owner.EnsureComponent<CollidableComponent>();
|
||||
|
||||
collidable.Hard = false;
|
||||
var shape = collidable.PhysicsShapes[0];
|
||||
shape.CollisionLayer |= (int) CollisionGroup.SmallImpassable;
|
||||
shape.CollisionMask = (int)CollisionGroup.None;
|
||||
|
||||
var shape = collidable.PhysicsShapes.FirstOrDefault();
|
||||
|
||||
if (shape != null)
|
||||
{
|
||||
shape.CollisionLayer |= (int) CollisionGroup.SmallImpassable;
|
||||
shape.CollisionMask = (int) CollisionGroup.None;
|
||||
}
|
||||
}
|
||||
|
||||
public override void ExposeData(ObjectSerializer serializer)
|
||||
|
||||
@@ -30,7 +30,6 @@ namespace Content.Shared.GameObjects.Components.PDA
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public class PDAUBoundUserInterfaceState : BoundUserInterfaceState
|
||||
{
|
||||
@@ -70,10 +69,11 @@ namespace Content.Shared.GameObjects.Components.PDA
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class PDAUplinkBuyListingMessage : BoundUserInterfaceMessage
|
||||
{
|
||||
public UplinkListingData ListingToBuy;
|
||||
public PDAUplinkBuyListingMessage(UplinkListingData itemToBuy)
|
||||
public string ItemId;
|
||||
|
||||
public PDAUplinkBuyListingMessage(string itemId)
|
||||
{
|
||||
ListingToBuy = itemToBuy;
|
||||
ItemId = itemId;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,8 +96,7 @@ namespace Content.Shared.GameObjects.Components.PDA
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[NetSerializable, Serializable]
|
||||
[Serializable, NetSerializable]
|
||||
public struct PDAIdInfoText
|
||||
{
|
||||
public string ActualOwnerName;
|
||||
@@ -105,13 +104,13 @@ namespace Content.Shared.GameObjects.Components.PDA
|
||||
public string JobTitle;
|
||||
}
|
||||
|
||||
[NetSerializable, Serializable]
|
||||
[Serializable, NetSerializable]
|
||||
public enum PDAVisuals
|
||||
{
|
||||
FlashlightLit,
|
||||
}
|
||||
|
||||
[NetSerializable, Serializable]
|
||||
[Serializable, NetSerializable]
|
||||
public enum PDAUiKey
|
||||
{
|
||||
Key
|
||||
@@ -142,7 +141,7 @@ namespace Content.Shared.GameObjects.Components.PDA
|
||||
}
|
||||
}
|
||||
|
||||
[NetSerializable, Serializable]
|
||||
[Serializable, NetSerializable]
|
||||
public class UplinkAccountData
|
||||
{
|
||||
public EntityUid DataAccountHolder;
|
||||
@@ -155,7 +154,7 @@ namespace Content.Shared.GameObjects.Components.PDA
|
||||
}
|
||||
}
|
||||
|
||||
[NetSerializable, Serializable]
|
||||
[Serializable, NetSerializable]
|
||||
public class UplinkListingData : ComponentState, IEquatable<UplinkListingData>
|
||||
{
|
||||
public string ItemId;
|
||||
@@ -185,5 +184,4 @@ namespace Content.Shared.GameObjects.Components.PDA
|
||||
return ItemId == other.ItemId;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -11,14 +11,11 @@ namespace Content.Shared.GameObjects.Components.Research
|
||||
{
|
||||
public class SharedLatheComponent : Component
|
||||
{
|
||||
[Dependency] protected readonly IPrototypeManager PrototypeManager = default!;
|
||||
|
||||
public override string Name => "Lathe";
|
||||
public override uint? NetID => ContentNetIDs.LATHE;
|
||||
|
||||
#pragma warning disable CS0649
|
||||
[Dependency]
|
||||
protected IPrototypeManager _prototypeManager;
|
||||
#pragma warning restore
|
||||
|
||||
public bool CanProduce(LatheRecipePrototype recipe, int quantity = 1)
|
||||
{
|
||||
if (!Owner.TryGetComponent(out SharedMaterialStorageComponent storage)
|
||||
@@ -36,7 +33,7 @@ namespace Content.Shared.GameObjects.Components.Research
|
||||
|
||||
public bool CanProduce(string ID, int quantity = 1)
|
||||
{
|
||||
return _prototypeManager.TryIndex(ID, out LatheRecipePrototype recipe) && CanProduce(recipe, quantity);
|
||||
return PrototypeManager.TryIndex(ID, out LatheRecipePrototype recipe) && CanProduce(recipe, quantity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -9,15 +9,36 @@ namespace Content.Shared.GameObjects.Components
|
||||
public sealed override string Name => "HandheldLight";
|
||||
public sealed override uint? NetID => ContentNetIDs.HANDHELD_LIGHT;
|
||||
|
||||
protected abstract bool HasCell { get; }
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
protected sealed class HandheldLightComponentState : ComponentState
|
||||
{
|
||||
public HandheldLightComponentState(float? charge) : base(ContentNetIDs.HANDHELD_LIGHT)
|
||||
public HandheldLightComponentState(float? charge, bool hasCell) : base(ContentNetIDs.HANDHELD_LIGHT)
|
||||
{
|
||||
Charge = charge;
|
||||
HasCell = hasCell;
|
||||
}
|
||||
|
||||
public float? Charge { get; }
|
||||
|
||||
public bool HasCell { get; }
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public enum HandheldLightVisuals
|
||||
{
|
||||
Power
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public enum HandheldLightPowerStates
|
||||
{
|
||||
FullPower,
|
||||
LowPower,
|
||||
Dying,
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
#nullable enable
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared.GameObjects.Components.Suspicion
|
||||
{
|
||||
public abstract class SharedSuspicionRoleComponent : Component
|
||||
{
|
||||
public sealed override string Name => "SuspicionRole";
|
||||
public sealed override uint? NetID => ContentNetIDs.SUSPICION_ROLE;
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public class SuspicionRoleComponentState : ComponentState
|
||||
{
|
||||
public readonly string? Role;
|
||||
public readonly bool? Antagonist;
|
||||
|
||||
public SuspicionRoleComponentState(string? role, bool? antagonist) : base(ContentNetIDs.SUSPICION_ROLE)
|
||||
{
|
||||
Role = role;
|
||||
Antagonist = antagonist;
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public class SuspicionAlliesMessage : ComponentMessage
|
||||
{
|
||||
public readonly HashSet<EntityUid> Allies;
|
||||
|
||||
public SuspicionAlliesMessage(HashSet<EntityUid> allies)
|
||||
{
|
||||
Directed = true;
|
||||
Allies = allies;
|
||||
}
|
||||
|
||||
public SuspicionAlliesMessage(IEnumerable<EntityUid> allies) : this(allies.ToHashSet()) { }
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public class SuspicionAllyAddedMessage : ComponentMessage
|
||||
{
|
||||
public readonly EntityUid Ally;
|
||||
|
||||
public SuspicionAllyAddedMessage(EntityUid ally)
|
||||
{
|
||||
Directed = true;
|
||||
Ally = ally;
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public class SuspicionAllyRemovedMessage : ComponentMessage
|
||||
{
|
||||
public readonly EntityUid Ally;
|
||||
|
||||
public SuspicionAllyRemovedMessage(EntityUid ally)
|
||||
{
|
||||
Directed = true;
|
||||
Ally = ally;
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public class SuspicionAlliesClearedMessage : ComponentMessage
|
||||
{
|
||||
public SuspicionAlliesClearedMessage()
|
||||
{
|
||||
Directed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Serialization;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Content.Shared.GameObjects.Components.Weapons.Ranged.Barrels
|
||||
{
|
||||
[Serializable, NetSerializable]
|
||||
public class BatteryBarrelComponentState : ComponentState
|
||||
{
|
||||
public FireRateSelector FireRateSelector { get; }
|
||||
public (int count, int max)? Magazine { get; }
|
||||
|
||||
public BatteryBarrelComponentState(
|
||||
FireRateSelector fireRateSelector,
|
||||
(int count, int max)? magazine) :
|
||||
base(ContentNetIDs.BATTERY_BARREL)
|
||||
{
|
||||
FireRateSelector = fireRateSelector;
|
||||
Magazine = magazine;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Serialization;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Content.Shared.GameObjects.Components.Weapons.Ranged.Barrels
|
||||
{
|
||||
[Serializable, NetSerializable]
|
||||
public class BoltActionBarrelComponentState : ComponentState
|
||||
{
|
||||
public (bool chambered, bool spent) Chamber { get; }
|
||||
public FireRateSelector FireRateSelector { get; }
|
||||
public (int count, int max)? Magazine { get; }
|
||||
public string SoundGunshot { get; }
|
||||
|
||||
public BoltActionBarrelComponentState(
|
||||
(bool chambered, bool spent) chamber,
|
||||
FireRateSelector fireRateSelector,
|
||||
(int count, int max)? magazine,
|
||||
string soundGunshot) :
|
||||
base(ContentNetIDs.BOLTACTION_BARREL)
|
||||
{
|
||||
Chamber = chamber;
|
||||
FireRateSelector = fireRateSelector;
|
||||
Magazine = magazine;
|
||||
SoundGunshot = soundGunshot;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Serialization;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Content.Shared.GameObjects.Components.Weapons.Ranged.Barrels
|
||||
{
|
||||
[Serializable, NetSerializable]
|
||||
public class PumpBarrelComponentState : ComponentState
|
||||
{
|
||||
public (bool chambered, bool spent) Chamber { get; }
|
||||
public FireRateSelector FireRateSelector { get; }
|
||||
public (int count, int max)? Magazine { get; }
|
||||
public string SoundGunshot { get; }
|
||||
|
||||
public PumpBarrelComponentState(
|
||||
(bool chambered, bool spent) chamber,
|
||||
FireRateSelector fireRateSelector,
|
||||
(int count, int max)? magazine,
|
||||
string soundGunshot) :
|
||||
base(ContentNetIDs.PUMP_BARREL)
|
||||
{
|
||||
Chamber = chamber;
|
||||
FireRateSelector = fireRateSelector;
|
||||
Magazine = magazine;
|
||||
SoundGunshot = soundGunshot;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Serialization;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Content.Shared.GameObjects.Components.Weapons.Ranged.Barrels
|
||||
{
|
||||
[Serializable, NetSerializable]
|
||||
public class RevolverBarrelComponentState : ComponentState
|
||||
{
|
||||
public int CurrentSlot { get; }
|
||||
public FireRateSelector FireRateSelector { get; }
|
||||
public bool?[] Bullets { get; }
|
||||
public string SoundGunshot { get; }
|
||||
|
||||
public RevolverBarrelComponentState(
|
||||
int currentSlot,
|
||||
FireRateSelector fireRateSelector,
|
||||
bool?[] bullets,
|
||||
string soundGunshot) :
|
||||
base(ContentNetIDs.REVOLVER_BARREL)
|
||||
{
|
||||
CurrentSlot = currentSlot;
|
||||
FireRateSelector = fireRateSelector;
|
||||
Bullets = bullets;
|
||||
SoundGunshot = soundGunshot;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -65,6 +65,13 @@
|
||||
public const uint RADIATION_PULSE = 1059;
|
||||
public const uint BODY_MANAGER = 1060;
|
||||
public const uint CLIMBING = 1061;
|
||||
public const uint BOLTACTION_BARREL = 1062;
|
||||
public const uint PUMP_BARREL = 1063;
|
||||
public const uint REVOLVER_BARREL = 1064;
|
||||
public const uint CUFFED = 1065;
|
||||
public const uint HANDCUFFS = 1066;
|
||||
public const uint BATTERY_BARREL = 1067;
|
||||
public const uint SUSPICION_ROLE = 1068;
|
||||
|
||||
// Net IDs for integration tests.
|
||||
public const uint PREDICTION_TEST = 10001;
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
using System.Collections.Generic;
|
||||
using Content.Shared.Atmos;
|
||||
using Robust.Shared.GameObjects.Systems;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
namespace Content.Shared.GameObjects.EntitySystems.Atmos
|
||||
{
|
||||
public class SharedAtmosphereSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||
|
||||
private readonly GasPrototype[] GasPrototypes = new GasPrototype[Atmospherics.TotalNumberOfGases];
|
||||
|
||||
private readonly SpriteSpecifier[] GasOverlays = new SpriteSpecifier[Atmospherics.TotalNumberOfGases];
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
for (var i = 0; i < Atmospherics.TotalNumberOfGases; i++)
|
||||
{
|
||||
var gasPrototype = _prototypeManager.Index<GasPrototype>(i.ToString());
|
||||
GasPrototypes[i] = gasPrototype;
|
||||
|
||||
if(string.IsNullOrEmpty(gasPrototype.GasOverlaySprite) && !string.IsNullOrEmpty(gasPrototype.GasOverlayTexture))
|
||||
GasOverlays[i] = new SpriteSpecifier.Texture(new ResourcePath(gasPrototype.GasOverlayTexture));
|
||||
|
||||
if(!string.IsNullOrEmpty(gasPrototype.GasOverlaySprite) && !string.IsNullOrEmpty(gasPrototype.GasOverlayState))
|
||||
GasOverlays[i] = new SpriteSpecifier.Rsi(new ResourcePath(gasPrototype.GasOverlaySprite), gasPrototype.GasOverlayState);
|
||||
}
|
||||
}
|
||||
|
||||
public GasPrototype GetGas(int gasId) => GasPrototypes[gasId];
|
||||
|
||||
public GasPrototype GetGas(Gas gasId) => GasPrototypes[(int) gasId];
|
||||
|
||||
public IEnumerable<GasPrototype> Gases => GasPrototypes;
|
||||
|
||||
public SpriteSpecifier GetOverlay(int overlayId) => GasOverlays[overlayId];
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.GameObjects.Systems;
|
||||
using Robust.Shared.Map;
|
||||
@@ -18,7 +17,7 @@ namespace Content.Shared.GameObjects.EntitySystems.Atmos
|
||||
{
|
||||
return new MapIndices((int) Math.Floor((float) indices.X / ChunkSize) * ChunkSize, (int) MathF.Floor((float) indices.Y / ChunkSize) * ChunkSize);
|
||||
}
|
||||
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public struct GasData
|
||||
{
|
||||
@@ -59,9 +58,9 @@ namespace Content.Shared.GameObjects.EntitySystems.Atmos
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
DebugTools.Assert(other.Gas != null);
|
||||
|
||||
|
||||
for (var i = 0; i < Gas.Length; i++)
|
||||
{
|
||||
var thisGas = Gas[i];
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
using Content.Shared.Construction;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.GameObjects.Systems;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Localization;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Maths;
|
||||
@@ -13,9 +12,6 @@ namespace Content.Shared.GameObjects.EntitySystems
|
||||
{
|
||||
public class SharedConstructionSystem : EntitySystem
|
||||
{
|
||||
#pragma warning disable 649
|
||||
[Dependency] private readonly ILocalizationManager _loc;
|
||||
#pragma warning restore 649
|
||||
/// <summary>
|
||||
/// Sent client -> server to to tell the server that we started building
|
||||
/// a structure-construction.
|
||||
@@ -90,7 +86,7 @@ namespace Content.Shared.GameObjects.EntitySystems
|
||||
if (curStage.Backward != null && curStage.Backward is ConstructionStepTool)
|
||||
{
|
||||
var backward = (ConstructionStepTool) curStage.Backward;
|
||||
message.AddText(_loc.GetString("To deconstruct: {0}x {1} Tool", backward.Amount, backward.ToolQuality));
|
||||
message.AddText(Loc.GetString("To deconstruct: {0}x {1} Tool", backward.Amount, backward.ToolQuality));
|
||||
}
|
||||
if (curStage.Forward != null && curStage.Forward is ConstructionStepMaterial)
|
||||
{
|
||||
@@ -99,7 +95,7 @@ namespace Content.Shared.GameObjects.EntitySystems
|
||||
message.AddText("\n");
|
||||
}
|
||||
var forward = (ConstructionStepMaterial) curStage.Forward;
|
||||
message.AddText(_loc.GetString("To construct: {0}x {1}", forward.Amount, forward.Material));
|
||||
message.AddText(Loc.GetString("To construct: {0}x {1}", forward.Amount, forward.Material));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
using Content.Shared.GameObjects.Components.Disposal;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.GameObjects.Systems;
|
||||
|
||||
namespace Content.Shared.GameObjects.EntitySystems
|
||||
{
|
||||
[UsedImplicitly]
|
||||
public sealed class SharedDisposalUnitSystem : EntitySystem
|
||||
{
|
||||
public override void Update(float frameTime)
|
||||
{
|
||||
foreach (var comp in ComponentManager.EntityQuery<SharedDisposalUnitComponent>())
|
||||
{
|
||||
comp.Update(frameTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -17,9 +17,7 @@ namespace Content.Shared.GameObjects.EntitySystems
|
||||
[UsedImplicitly]
|
||||
public class SharedInteractionSystem : EntitySystem
|
||||
{
|
||||
#pragma warning disable 649
|
||||
[Dependency] private readonly IPhysicsManager _physicsManager;
|
||||
#pragma warning restore 649
|
||||
[Dependency] private readonly IPhysicsManager _physicsManager = default!;
|
||||
|
||||
public const float InteractionRange = 2;
|
||||
public const float InteractionRangeSquared = InteractionRange * InteractionRange;
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
namespace Content.Shared.GameObjects
|
||||
{
|
||||
/// <summary>
|
||||
/// Contains physical constants used in calculations.
|
||||
/// </summary>
|
||||
class PhysicalConstants
|
||||
{
|
||||
public const float ZERO_CELCIUS = 273.15f;
|
||||
}
|
||||
}
|
||||
@@ -29,6 +29,7 @@ namespace Content.Shared.Input
|
||||
public static readonly BoundKeyFunction OpenEntitySpawnWindow = "OpenEntitySpawnWindow";
|
||||
public static readonly BoundKeyFunction OpenSandboxWindow = "OpenSandboxWindow";
|
||||
public static readonly BoundKeyFunction OpenTileSpawnWindow = "OpenTileSpawnWindow";
|
||||
public static readonly BoundKeyFunction OpenAdminMenu = "OpenAdminMenu";
|
||||
public static readonly BoundKeyFunction TakeScreenshot = "TakeScreenshot";
|
||||
public static readonly BoundKeyFunction TakeScreenshotNoUI = "TakeScreenshotNoUI";
|
||||
public static readonly BoundKeyFunction Point = "Point";
|
||||
|
||||
@@ -5,12 +5,10 @@ using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Shared.Kitchen
|
||||
{
|
||||
|
||||
public class RecipeManager
|
||||
{
|
||||
#pragma warning disable 649
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager;
|
||||
#pragma warning restore 649
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||
|
||||
public List<FoodRecipePrototype> Recipes { get; private set; }
|
||||
|
||||
public void Initialize()
|
||||
|
||||
@@ -10,12 +10,14 @@ namespace Content.Shared.Physics
|
||||
{
|
||||
public class MoverController : VirtualController
|
||||
{
|
||||
[Dependency] private readonly IPhysicsManager _physicsManager = default!;
|
||||
|
||||
public override ICollidableComponent? ControlledComponent { protected get; set; }
|
||||
|
||||
public void Move(Vector2 velocityDirection, float speed)
|
||||
{
|
||||
if (ControlledComponent?.Owner.HasComponent<MovementIgnoreGravityComponent>() == false
|
||||
&& IoCManager.Resolve<IPhysicsManager>().IsWeightless(ControlledComponent.Owner.Transform.GridPosition))
|
||||
&& _physicsManager.IsWeightless(ControlledComponent.Owner.Transform.GridPosition))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -6,9 +6,7 @@ namespace Content.Shared.Physics
|
||||
{
|
||||
public class SlipController : VirtualController
|
||||
{
|
||||
#pragma warning disable 649
|
||||
[Dependency] private readonly IPhysicsManager _physicsManager;
|
||||
#pragma warning restore 649
|
||||
[Dependency] private readonly IPhysicsManager _physicsManager = default!;
|
||||
|
||||
public SlipController()
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared.Preferences.Appearance
|
||||
@@ -19,6 +19,7 @@ namespace Content.Shared.Preferences.Appearance
|
||||
LLeg,
|
||||
RFoot,
|
||||
LFoot,
|
||||
Handcuffs,
|
||||
StencilMask
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace Content.Shared.Preferences
|
||||
private readonly Dictionary<string, JobPriority> _jobPriorities;
|
||||
private readonly List<string> _antagPreferences;
|
||||
public static int MinimumAge = 18;
|
||||
public static int MaximumAge = 90;
|
||||
public static int MaximumAge = 120;
|
||||
|
||||
private HumanoidCharacterProfile(
|
||||
string name,
|
||||
@@ -69,7 +69,7 @@ namespace Content.Shared.Preferences
|
||||
|
||||
public HumanoidCharacterProfile WithAge(int age)
|
||||
{
|
||||
return new HumanoidCharacterProfile(Name, age, Sex, Appearance, _jobPriorities, PreferenceUnavailable, _antagPreferences);
|
||||
return new HumanoidCharacterProfile(Name, Math.Clamp(age, MinimumAge, MaximumAge), Sex, Appearance, _jobPriorities, PreferenceUnavailable, _antagPreferences);
|
||||
}
|
||||
|
||||
public HumanoidCharacterProfile WithSex(Sex sex)
|
||||
|
||||
@@ -238,6 +238,7 @@ namespace Content.Shared
|
||||
public string PlayerICName;
|
||||
public string Role;
|
||||
public bool Antag;
|
||||
public bool Observer;
|
||||
}
|
||||
|
||||
protected class MsgRoundEndMessage : NetMessage
|
||||
@@ -279,7 +280,8 @@ namespace Content.Shared
|
||||
PlayerOOCName = buffer.ReadString(),
|
||||
PlayerICName = buffer.ReadString(),
|
||||
Role = buffer.ReadString(),
|
||||
Antag = buffer.ReadBoolean()
|
||||
Antag = buffer.ReadBoolean(),
|
||||
Observer = buffer.ReadBoolean(),
|
||||
};
|
||||
|
||||
AllPlayersEndInfo.Add(readPlayerData);
|
||||
@@ -303,6 +305,7 @@ namespace Content.Shared
|
||||
buffer.Write(playerEndInfo.PlayerICName);
|
||||
buffer.Write(playerEndInfo.Role);
|
||||
buffer.Write(playerEndInfo.Antag);
|
||||
buffer.Write(playerEndInfo.Observer);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user