Merge branch 'master' into ed-17-07-2024-dungenagain
This commit is contained in:
@@ -155,7 +155,12 @@ public sealed class AccessReaderSystem : EntitySystem
|
||||
return IsAllowedInternal(access, stationKeys, reader);
|
||||
|
||||
if (!_containerSystem.TryGetContainer(target, reader.ContainerAccessProvider, out var container))
|
||||
return Paused(target); // when mapping, containers with electronics arent spawned
|
||||
return false;
|
||||
|
||||
// If entity is paused then always allow it at this point.
|
||||
// Door electronics is kind of a mess but yeah, it should only be an unpaused ent interacting with it
|
||||
if (Paused(target))
|
||||
return true;
|
||||
|
||||
foreach (var entity in container.ContainedEntities)
|
||||
{
|
||||
|
||||
@@ -25,7 +25,6 @@ public abstract class SharedActionsSystem : EntitySystem
|
||||
[Dependency] private readonly ISharedAdminLogManager _adminLogger = default!;
|
||||
[Dependency] private readonly SharedInteractionSystem _interactionSystem = default!;
|
||||
[Dependency] private readonly ActionBlockerSystem _actionBlockerSystem = default!;
|
||||
[Dependency] private readonly SharedContainerSystem _containerSystem = default!;
|
||||
[Dependency] private readonly RotateToFaceSystem _rotateToFaceSystem = default!;
|
||||
[Dependency] private readonly SharedAudioSystem _audio = default!;
|
||||
[Dependency] private readonly SharedTransformSystem _transformSystem = default!;
|
||||
|
||||
@@ -12,8 +12,6 @@ namespace Content.Shared.Beeper.Systems;
|
||||
/// </summary>
|
||||
public sealed class ProximityBeeperSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
[Dependency] private readonly ProximityDetectionSystem _proximity = default!;
|
||||
[Dependency] private readonly BeeperSystem _beeper = default!;
|
||||
|
||||
/// <inheritdoc/>
|
||||
|
||||
@@ -14,13 +14,10 @@ namespace Content.Shared.Clothing;
|
||||
|
||||
public sealed class ClothingSpeedModifierSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
[Dependency] private readonly ClothingSpeedModifierSystem _clothingSpeedModifier = default!;
|
||||
[Dependency] private readonly SharedContainerSystem _container = default!;
|
||||
[Dependency] private readonly ExamineSystemShared _examine = default!;
|
||||
[Dependency] private readonly MovementSpeedModifierSystem _movementSpeed = default!;
|
||||
[Dependency] private readonly ItemToggleSystem _toggle = default!;
|
||||
[Dependency] private readonly SharedPowerCellSystem _powerCell = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
|
||||
@@ -192,6 +192,11 @@ public sealed partial class StaminaSystem : EntitySystem
|
||||
|
||||
private void OnCollide(EntityUid uid, StaminaDamageOnCollideComponent component, EntityUid target)
|
||||
{
|
||||
// you can't inflict stamina damage on things with no stamina component
|
||||
// this prevents stun batons from using up charges when throwing it at lockers or lights
|
||||
if (!HasComp<StaminaComponent>(target))
|
||||
return;
|
||||
|
||||
var ev = new StaminaDamageOnHitAttemptEvent();
|
||||
RaiseLocalEvent(uid, ref ev);
|
||||
if (ev.Cancelled)
|
||||
|
||||
16
Content.Shared/IconSmoothing/RandomIconSmoothComponent.cs
Normal file
16
Content.Shared/IconSmoothing/RandomIconSmoothComponent.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using Robust.Shared.GameStates;
|
||||
|
||||
namespace Content.Shared.IconSmoothing;
|
||||
|
||||
/// <summary>
|
||||
/// Allow randomize StateBase of IconSmoothComponent for random visual variation
|
||||
/// </summary>
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
public sealed partial class RandomIconSmoothComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// StateBase will be randomly selected from this list. Allows to randomize the visual.
|
||||
/// </summary>
|
||||
[DataField(required: true)]
|
||||
public List<string> RandomStates = new();
|
||||
}
|
||||
12
Content.Shared/IconSmoothing/SharedRandomIconSmoothSystem.cs
Normal file
12
Content.Shared/IconSmoothing/SharedRandomIconSmoothSystem.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared.IconSmoothing;
|
||||
|
||||
public abstract class SharedRandomIconSmoothSystem : EntitySystem
|
||||
{
|
||||
}
|
||||
[Serializable, NetSerializable]
|
||||
public enum RandomIconSmoothState : byte
|
||||
{
|
||||
State
|
||||
}
|
||||
@@ -38,8 +38,6 @@ using Robust.Shared.Serialization;
|
||||
using Robust.Shared.Timing;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
#pragma warning disable 618
|
||||
|
||||
namespace Content.Shared.Interaction
|
||||
{
|
||||
/// <summary>
|
||||
@@ -522,11 +520,11 @@ namespace Content.Shared.Interaction
|
||||
protected bool ValidateInteractAndFace(EntityUid user, EntityCoordinates coordinates)
|
||||
{
|
||||
// Verify user is on the same map as the entity they clicked on
|
||||
if (coordinates.GetMapId(EntityManager) != Transform(user).MapID)
|
||||
if (_transform.GetMapId(coordinates) != Transform(user).MapID)
|
||||
return false;
|
||||
|
||||
if (!HasComp<NoRotateOnInteractComponent>(user))
|
||||
_rotateToFaceSystem.TryFaceCoordinates(user, coordinates.ToMapPos(EntityManager, _transform));
|
||||
_rotateToFaceSystem.TryFaceCoordinates(user, _transform.ToMapCoordinates(coordinates).Position);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -859,7 +857,7 @@ namespace Content.Shared.Interaction
|
||||
Ignored? predicate = null,
|
||||
bool popup = false)
|
||||
{
|
||||
return InRangeUnobstructed(origin, other.ToMap(EntityManager, _transform), range, collisionMask, predicate, popup);
|
||||
return InRangeUnobstructed(origin, _transform.ToMapCoordinates(other), range, collisionMask, predicate, popup);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -966,7 +964,7 @@ namespace Content.Shared.Interaction
|
||||
/// </summary>
|
||||
public void InteractDoAfter(EntityUid user, EntityUid used, EntityUid? target, EntityCoordinates clickLocation, bool canReach)
|
||||
{
|
||||
if (target is {Valid: false})
|
||||
if (target is { Valid: false })
|
||||
target = null;
|
||||
|
||||
var afterInteractEvent = new AfterInteractEvent(user, used, target, clickLocation, canReach);
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace Content.Shared.Localizations
|
||||
[Dependency] private readonly ILocalizationManager _loc = default!;
|
||||
|
||||
// If you want to change your codebase's language, do it here.
|
||||
private const string Culture = "en-US"; // CrystallPunk-Localization. "ru-RU" or "en-US"
|
||||
private const string Culture = "ru-RU"; // CrystallPunk-Localization. "ru-RU" or "en-US"
|
||||
|
||||
/// <summary>
|
||||
/// Custom format strings used for parsing and displaying minutes:seconds timespans.
|
||||
@@ -26,8 +26,14 @@ namespace Content.Shared.Localizations
|
||||
public void Initialize()
|
||||
{
|
||||
var culture = new CultureInfo(Culture);
|
||||
|
||||
// Uncomment for Ru localization
|
||||
_loc.LoadCulture(culture);
|
||||
|
||||
var fallbackCulture = new CultureInfo("en-US");
|
||||
_loc.LoadCulture(fallbackCulture);
|
||||
_loc.SetFallbackCluture(fallbackCulture);
|
||||
//
|
||||
|
||||
_loc.AddFunction(culture, "PRESSURE", FormatPressure);
|
||||
_loc.AddFunction(culture, "POWERWATTS", FormatPowerWatts);
|
||||
_loc.AddFunction(culture, "POWERJOULES", FormatPowerJoules);
|
||||
|
||||
@@ -43,7 +43,6 @@ public sealed class PullingSystem : EntitySystem
|
||||
[Dependency] private readonly SharedHandsSystem _handsSystem = default!;
|
||||
[Dependency] private readonly SharedInteractionSystem _interaction = default!;
|
||||
[Dependency] private readonly SharedPhysicsSystem _physics = default!;
|
||||
[Dependency] private readonly SharedPopupSystem _popup = default!;
|
||||
[Dependency] private readonly HeldSpeedModifierSystem _clothingMoveSpeed = default!;
|
||||
|
||||
public override void Initialize()
|
||||
|
||||
@@ -18,7 +18,6 @@ public sealed class DashAbilitySystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly ActionContainerSystem _actionContainer = default!;
|
||||
[Dependency] private readonly IGameTiming _timing = default!;
|
||||
[Dependency] private readonly SharedAudioSystem _audio = default!;
|
||||
[Dependency] private readonly SharedChargesSystem _charges = default!;
|
||||
[Dependency] private readonly SharedHandsSystem _hands = default!;
|
||||
[Dependency] private readonly ExamineSystemShared _examine = default!;
|
||||
|
||||
@@ -150,8 +150,19 @@ public sealed class SwapTeleporterSystem : EntitySystem
|
||||
return;
|
||||
}
|
||||
|
||||
var teleEnt = GetTeleportingEntity((uid, xform));
|
||||
var otherTeleEnt = GetTeleportingEntity((linkedEnt, Transform(linkedEnt)));
|
||||
var (teleEnt, cont) = GetTeleportingEntity((uid, xform));
|
||||
var (otherTeleEnt, otherCont) = GetTeleportingEntity((linkedEnt, Transform(linkedEnt)));
|
||||
|
||||
if (otherCont != null && !_container.CanInsert(teleEnt, otherCont) ||
|
||||
cont != null && !_container.CanInsert(otherTeleEnt, cont))
|
||||
{
|
||||
_popup.PopupEntity(Loc.GetString("swap-teleporter-popup-teleport-fail",
|
||||
("entity", Identity.Entity(linkedEnt, EntityManager))),
|
||||
teleEnt,
|
||||
teleEnt,
|
||||
PopupType.MediumCaution);
|
||||
return;
|
||||
}
|
||||
|
||||
_popup.PopupEntity(Loc.GetString("swap-teleporter-popup-teleport-other",
|
||||
("entity", Identity.Entity(linkedEnt, EntityManager))),
|
||||
@@ -184,20 +195,20 @@ public sealed class SwapTeleporterSystem : EntitySystem
|
||||
DestroyLink(linked, user); // the linked one is shown globally
|
||||
}
|
||||
|
||||
private EntityUid GetTeleportingEntity(Entity<TransformComponent> ent)
|
||||
private (EntityUid, BaseContainer?) GetTeleportingEntity(Entity<TransformComponent> ent)
|
||||
{
|
||||
var parent = ent.Comp.ParentUid;
|
||||
if (_container.TryGetOuterContainer(ent, ent, out var container))
|
||||
parent = container.Owner;
|
||||
|
||||
if (HasComp<MapGridComponent>(parent) || HasComp<MapComponent>(parent))
|
||||
return ent;
|
||||
return (ent, container);
|
||||
|
||||
if (!_xformQuery.TryGetComponent(parent, out var parentXform) || parentXform.Anchored)
|
||||
return ent;
|
||||
return (ent, container);
|
||||
|
||||
if (!TryComp<PhysicsComponent>(parent, out var body) || body.BodyType == BodyType.Static)
|
||||
return ent;
|
||||
return (ent, container);
|
||||
|
||||
return GetTeleportingEntity((parent, parentXform));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user