Skip to content
Draft
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using Content.Shared._Scp.ComplexElevator;
using Robust.Client.GameObjects;

namespace Content.Client._Scp.ComplexElevator.Visualizers;

public sealed class ElevatorButtonVisualizerSystem : VisualizerSystem<ElevatorButtonVisualsComponent>
{
protected override void OnAppearanceChange(EntityUid uid, ElevatorButtonVisualsComponent comp, ref AppearanceChangeEvent args)
{
if (args.Sprite == null)
return;

if (!AppearanceSystem.TryGetData<ElevatorButtonState>(uid, ElevatorButtonVisuals.ButtonState, out var state, args.Component))
return;

if (comp.SpriteStateMap.TryGetValue(state, out var spriteState))
SpriteSystem.LayerSetRsiState((uid, args.Sprite), ElevatorButtonLayers.Base, spriteState);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using Content.Shared._Scp.ComplexElevator;

namespace Content.Client._Scp.ComplexElevator.Visualizers;

[RegisterComponent]
public sealed partial class ElevatorButtonVisualsComponent : Component
{
/// <summary>
/// A map of the sprite states used by this visualizer indexed by the button state they correspond to.
/// </summary>
[DataField("spriteStateMap")]
[ViewVariables(VVAccess.ReadOnly)]
public Dictionary<ElevatorButtonState, string> SpriteStateMap = new()
{
[ElevatorButtonState.ElevatorHere] = "elevator_here",
[ElevatorButtonState.ElevatorMoving] = "elevator_moving",
[ElevatorButtonState.ElevatorElsewhere] = "elevator_elsewhere",
};
}
13 changes: 13 additions & 0 deletions Content.Server/Atmos/EntitySystems/AtmosphereSystem.API.cs
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,19 @@ public float GetTileHeatCapacity(Entity<GridAtmosphereComponent?>? grid, Entity<
{
return GetHeatCapacity(GetTileMixture(grid, map, tile) ?? GasMixture.SpaceGas);
}
// fire added
public void SetTileMixture(Entity<GridAtmosphereComponent?, GasTileOverlayComponent?>? grid, Entity<MapAtmosphereComponent?>? map, Vector2i gridTile, GasMixture mixture)
{
if (grid is {} gridEnt
&& Resolve(gridEnt, ref gridEnt.Comp1, false)
&& gridEnt.Comp1.Tiles.TryGetValue(gridTile, out var tile))
{
tile.Air = mixture;
AddActiveTile(gridEnt.Comp1, tile);
InvalidateVisuals((gridEnt.Owner, gridEnt.Comp2), gridTile);
}
}
// fire end

public TileMixtureEnumerator GetAdjacentTileMixtures(Entity<GridAtmosphereComponent?> grid, Vector2i tile, bool includeBlocked = false, bool excite = false)
{
Expand Down
17 changes: 16 additions & 1 deletion Content.Server/Construction/ConstructionSystem.Initial.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Linq;
using System.Threading.Tasks;
using Content.Server.Construction.Components;
using Content.Shared._Scp.Construction;
using Content.Shared._Sunrise.UnbuildableGrid;
using Content.Shared.ActionBlocker;
using Content.Shared.Construction;
Expand All @@ -18,6 +19,7 @@
using Content.Shared.Whitelist;
using Robust.Shared.Containers;
using Robust.Shared.Map;
using Robust.Shared.Map.Components;
using Robust.Shared.Player;
using Robust.Shared.Timing;

Expand Down Expand Up @@ -494,12 +496,25 @@ void Cleanup()
var mapPos = _transformSystem.ToMapCoordinates(location);
var predicate = GetPredicate(constructionPrototype.CanBuildInImpassable, mapPos);

// fire added
var gridUid = _transformSystem.GetGrid(location);
if (TryComp<MapGridComponent>(gridUid, out var mapGrid))
{
var anchored = _map.GetAnchoredEntities((gridUid.Value, mapGrid), mapPos);
if (anchored.Any(e => HasComp<ConstructionBlockerComponent>(e)))
{
_popup.PopupEntity(Loc.GetString("construction-system-construct-marker-block"), user, user);
Cleanup();
return;
}
}
// fire end

if (!_interactionSystem.InRangeUnobstructed(user, mapPos, predicate: predicate))
{
Cleanup();
return;
}

if (pathFind == null)
throw new InvalidDataException($"Can't find path from starting node to target node in construction! Recipe: {ev.PrototypeName}");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,19 @@ public sealed partial class ComplexElevatorComponent : Component
public SoundSpecifier ArrivalSound = new SoundPathSpecifier("/Audio/_Scp/Machines/Elevator/Beep-elevator.ogg");

[DataField]
public float DoorBlockCheckRange = 0.6f;
public SoundSpecifier AlarmSound = new SoundPathSpecifier("/Audio/_Scp/Effects/announcement.ogg");

[DataField]
public float DoorBlockCheckRange = 0.59f;

[DataField]
public int MaxEntitiesToTeleport = 60;

[DataField]
public bool TransferGases = false;

[DataField]
public bool ClearGases = true;

public bool IsMoving = false;
}
Loading
Loading