Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Work In Progress] Frankenstein (SS220 Box) #124

Merged
merged 80 commits into from
Aug 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
5e409de
Started mapping
TheArturZh Jun 28, 2023
e107433
Frankenstein: Mapping stage 1 - bridge
TheArturZh Jul 3, 2023
32b5ccd
Frankenstein: fixed map proto
TheArturZh Jul 3, 2023
c695d02
Frankenstein: Mapping stage 1.5 - below bridge
TheArturZh Jul 4, 2023
f7b1981
Frankenstein: Mapping stage 1.5 - added ss220 signs
TheArturZh Jul 4, 2023
aa80b93
Frankenstein: Mapping stage 1.5 - added benches and psych bed
TheArturZh Jul 4, 2023
479f807
Oh shit oh god what have I done
TheArturZh Jul 9, 2023
0691655
Frankenstein: Content additions
TheArturZh Jul 12, 2023
26d95ff
Frankenstein: added mic stand
TheArturZh Jul 12, 2023
fe469aa
Frankenstein: added new lockers
TheArturZh Jul 13, 2023
15e03b1
Frankenstein: added stairs
TheArturZh Jul 13, 2023
c6240fb
Frankenstein: added stairs construction recipes
TheArturZh Jul 13, 2023
15df956
Frankenstein: added blueshields hardsuit
TheArturZh Jul 13, 2023
9c681d3
Frankenstein: Mapping stage 2 - bar remap
TheArturZh Jul 14, 2023
31925d1
Frankenstein: Implemented InteractonRangeComponent
TheArturZh Jul 14, 2023
7c86cbd
Frankenstein: dorm and bar remap
TheArturZh Jul 15, 2023
3e646cf
Frankenstein: Resaved
TheArturZh Jul 15, 2023
dbe4fdb
Frankenstein: Mapping stage 3 beginning - brig
TheArturZh Jul 19, 2023
30a8092
Frankenstein: Mapping stage 3
TheArturZh Jul 20, 2023
8021da7
Frankenstein: bug fixes
TheArturZh Jul 21, 2023
3c6d86e
Frankenstein: added tv studio sign
TheArturZh Jul 21, 2023
5df8921
Tweaked blueshield rig light color
TheArturZh Jul 21, 2023
d2efd80
Frankenstein: added bar mini sign
TheArturZh Jul 21, 2023
8793d06
Blueshield's gun safe now requires blueshield access
TheArturZh Jul 22, 2023
39420e8
Fixed clown's airlock
TheArturZh Jul 22, 2023
4f438dc
Fixed wall chargers
TheArturZh Jul 22, 2023
3afa97b
Added more stuff to psych locker
TheArturZh Jul 22, 2023
854606d
Frankenstein: added north-western dock to brig
TheArturZh Jul 23, 2023
f9e46d1
Migrated Frankenstein
TheArturZh Jul 25, 2023
910a28e
Frankenstein: migration and small fixes
TheArturZh Jul 28, 2023
6da7d84
Frankenstein: Replaced spawners and fixes
TheArturZh Jul 30, 2023
07ac1e3
Tweaked blinds to prevent lag
TheArturZh Jul 30, 2023
5c2eb4d
Frankenstein: Sec dock access change & extra disposal units
TheArturZh Jul 30, 2023
7b48bac
Added blinds construction graph
TheArturZh Jul 30, 2023
f413afc
Frankenstein: small changes
TheArturZh Jul 30, 2023
3f70361
Added construction graphs and recipes for sofas and benches
TheArturZh Jul 30, 2023
e85f27a
Psych bed construction graph
TheArturZh Jul 30, 2023
392329c
Frankenstein: added Open sign
TheArturZh Jul 31, 2023
c7da5fa
Frankenstein: Departure remap
TheArturZh Aug 1, 2023
808bdbd
Fixed licenses in RSIs
TheArturZh Aug 3, 2023
467ec07
Frankenstein: small tweaks and fixes
TheArturZh Aug 4, 2023
4dd56e4
Update open sign texture
TheArturZh Aug 4, 2023
13a32c5
Frankenstein: fix kitchen disposals
TheArturZh Aug 4, 2023
003cba0
Frankenstein: added TabletopGame for tacmap
TheArturZh Aug 5, 2023
dcf3bc7
Frankenstein: added PDA message server
TheArturZh Aug 6, 2023
2d3f180
Frankenstein statue locale
TheArturZh Aug 6, 2023
1c8abf6
Fix tests
TheArturZh Aug 6, 2023
2b8b5e5
Fix attributions
TheArturZh Aug 6, 2023
cca710b
Fix sofa prices
TheArturZh Aug 6, 2023
7e61b57
Fix canCollide on spawn
TheArturZh Aug 6, 2023
8381360
Add Frankenstein to test pool
TheArturZh Aug 7, 2023
108e2b5
Frankenstein: engineering remap 1
TheArturZh Aug 8, 2023
e41b7d3
Evidence board sprite improvements
TheArturZh Aug 8, 2023
a5d8a1d
Frankenstein: batch fixes
TheArturZh Aug 9, 2023
e581964
DAW is not tabletop
TheArturZh Aug 9, 2023
e06fc30
Fixed outline not working properly with InteractionRange
TheArturZh Aug 9, 2023
1cb9e16
Frankenstein: added new signs
TheArturZh Aug 9, 2023
b9aba08
Frankenstein: map fixes, expand CMO office, restore palette
TheArturZh Aug 10, 2023
f8193ac
Frankenstein: added On Air sign, arrivals docks are always powered
TheArturZh Aug 10, 2023
8d5b69b
Frankenstein: small update and resave
TheArturZh Aug 11, 2023
c24ada6
Wall maps le great beginning
TheArturZh Aug 12, 2023
8c9bf22
Wall map development
TheArturZh Aug 13, 2023
b58992f
Frankenstein: pet parrot, borg chargers and teg improvements
TheArturZh Aug 13, 2023
5a5f2d8
Update map pool
TheArturZh Aug 13, 2023
d444e9c
Frankenstein: new parallax from Crovax Delta
TheArturZh Aug 13, 2023
2ae83e2
Frankenstein: added medical bed to sec
TheArturZh Aug 13, 2023
fa5c682
Fix blueshield goal stamp
TheArturZh Aug 14, 2023
cadee47
Fixed construction graphs
TheArturZh Aug 15, 2023
5b344fc
Fixed operating table rotation
TheArturZh Aug 15, 2023
a0acd2f
Update Frankenstein to work with upstream
TheArturZh Aug 17, 2023
30c0299
Increase blinds activation range
TheArturZh Aug 17, 2023
0928329
Ported changes from official box
TheArturZh Aug 17, 2023
019c0dc
Frankenstein: small fixes
TheArturZh Aug 20, 2023
84c2fa7
Frankenstein: little teg improvements
TheArturZh Aug 20, 2023
3b7ba01
Frankenstein: move prototype & tweak
TheArturZh Aug 20, 2023
42a0938
Frankenstein: added desks
TheArturZh Aug 20, 2023
92d83c4
Sprite adjustments
TheArturZh Aug 20, 2023
43c192d
carpet dithering
TheArturZh Aug 20, 2023
bc16f1f
Frankenstein: departure tweaks
TheArturZh Aug 21, 2023
ae586f5
Frankenstein: fixes & removed from default pool
TheArturZh Aug 21, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 7 additions & 1 deletion Content.Client/Outline/InteractionOutlineSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Content.Client.Viewport;
using Content.Shared.CCVar;
using Content.Shared.Interaction;
using Content.Shared.SS220.Interaction;
using Robust.Client.GameObjects;
using Robust.Client.Graphics;
using Robust.Client.Input;
Expand Down Expand Up @@ -138,7 +139,12 @@ public override void FrameUpdate(float frameTime)
var inRange = false;
if (localPlayer.ControlledEntity != null && !Deleted(entityToClick))
{
inRange = _interactionSystem.InRangeUnobstructed(localPlayer.ControlledEntity.Value, entityToClick.Value);
var range = SharedInteractionSystem.InteractionRange;

if (TryComp<InteractionRangeComponent>(entityToClick.Value, out var rangeComp))
range = rangeComp.Range;

inRange = _interactionSystem.InRangeUnobstructed(localPlayer.ControlledEntity.Value, entityToClick.Value, range: range);
}

InteractionOutlineComponent? outline;
Expand Down
15 changes: 15 additions & 0 deletions Content.Client/SS220/PictureViewer/PictureViewer.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Control xmlns="https://spacestation14.io"
MouseFilter="Stop"
MinSize="100 100">

<Label
Name="NoImageLabel" Text="{Loc 'image-viewer-no-image'}"
HorizontalAlignment="Center"
VerticalAlignment="Center"
MouseFilter="Ignore"/>

<TextureRect
Name="Picture"
Stretch="KeepCentered"
MouseFilter="Ignore"/>
</Control>
106 changes: 106 additions & 0 deletions Content.Client/SS220/PictureViewer/PictureViewer.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
using System.Numerics;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Input;
using Robust.Shared.Utility;

namespace Content.Client.SS220.PictureViewer;

[GenerateTypedNameReferences]
public sealed partial class PictureViewer : Control
{
private ResPath _viewedPicture;

private const float ScrollSensitivity = 0.1f;
private const float MaxZoom = 10f;

private float _zoom = 1f;
private bool _draggin = false;
private Vector2 _offset = Vector2.Zero;

public ResPath ViewedPicture
{
get => _viewedPicture;
set
{
_viewedPicture = value;
Picture.TexturePath = value.ToString();
}
}

private void UpdateZoom()
{
var invZoom = 1 / _zoom;
Picture.TextureScale = new Vector2(invZoom, invZoom);
}

private void UpdateOffset()
{
//Picture.Margin = new Thickness(_offset.X, _offset.Y);
var position = _offset;
var rect = UIBox2.FromDimensions(position, this.Size);
Picture.Arrange(rect);
}

protected override void MouseWheel(GUIMouseWheelEventArgs args)
{
base.MouseWheel(args);
_zoom -= args.Delta.Y * ScrollSensitivity;
_zoom = float.Clamp(_zoom, 1, MaxZoom);
Logger.DebugS("ZOOM: ", _zoom.ToString());
UpdateZoom();
UpdateOffset();

args.Handle();
}

protected override void KeyBindDown(GUIBoundKeyEventArgs args)
{
base.KeyBindDown(args);

if (args.Function == EngineKeyFunctions.Use)
{
_draggin = true;
}
}

protected override void KeyBindUp(GUIBoundKeyEventArgs args)
{
base.KeyBindUp(args);

if (args.Function == EngineKeyFunctions.Use)
{
_draggin = false;
}
}

protected override void MouseMove(GUIMouseMoveEventArgs args)
{
base.MouseMove(args);

if (!_draggin)
return;

//_recentering = false;
_offset += new Vector2(args.Relative.X, args.Relative.Y);
Logger.DebugS("OFFSET: ", _offset.ToString());
UpdateOffset();

/*
if (_offset != Vector2.Zero)
{
_recenter.Disabled = false;
}
else
{
_recenter.Disabled = true;
}
*/
}

public PictureViewer()
{
RobustXamlLoader.Load(this);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<DefaultWindow xmlns="https://spacestation14.io"
xmlns:pv="clr-namespace:Content.Client.SS220.PictureViewer"
Title="{Loc 'viewable-station-map-ui-window-title'}"
MinSize="300 300"
SetSize="725 725">
<pv:PictureViewer Name="Viewer"/>
</DefaultWindow>
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Utility;

namespace Content.Client.SS220.ViewableStationMap.UI;

[GenerateTypedNameReferences]
public sealed partial class ViewableStationMapWindow : DefaultWindow
{
public ResPath ViewedMap
{
get => Viewer.ViewedPicture;
set => Viewer.ViewedPicture = value;
}

public ViewableStationMapWindow()
{
RobustXamlLoader.Load(this);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
using Robust.Client.GameObjects;
using Robust.Shared.Serialization.TypeSerializers.Implementations;
using Content.Client.SS220.ViewableStationMap.UI;
using Content.Shared.SS220.ViewableStationMap;
using JetBrains.Annotations;

namespace Content.Client.SS220.ViewableStationMap;

[UsedImplicitly]
public sealed class StationViewableMapBoundUserInterface : BoundUserInterface
{
[Dependency] private readonly IEntityManager _entMan = default!;

private ViewableStationMapWindow? _window;

public StationViewableMapBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
{
}

/// <inheritdoc/>
protected override void Open()
{
base.Open();

_window = new ViewableStationMapWindow();
_window.OpenCentered();

_window.OnClose += Close;

if (_entMan.TryGetComponent(Owner, out ViewableStationMapComponent? comp))
_window.ViewedMap = SpriteSpecifierSerializer.TextureRoot/comp.MapTexture;
}

protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
if (disposing)
_window?.Dispose();
}
}
2 changes: 2 additions & 0 deletions Content.Client/Tabletop/TabletopSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ private void OnTabletopPlay(TabletopPlayEvent msg)
Title = msg.Title
};

_window.SetSize = new Vector2(msg.WindowSize.X, msg.WindowSize.Y);

_window.OnClose += OnWindowClose;
}

Expand Down
3 changes: 2 additions & 1 deletion Content.IntegrationTests/Tests/PostMapInitTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ public sealed class PostMapInitTest
"CorvaxAvrite",
"CorvaxDelta",
"CorvaxIshimura",
"220Delta"
"220Delta",
"Frankenstein"
};

/// <summary>
Expand Down
98 changes: 98 additions & 0 deletions Content.Server/SS220/Blinds/BlindsSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
// © SS220, An EULA/CLA with a hosting restriction, full text: https://raw.githubusercontent.com/SerbiaStrong-220/space-station-14/master/CLA.txt

using Content.Shared.Interaction;
using Content.Shared.SS220.Blinds;
using Robust.Server.GameObjects;
using Robust.Shared.Map;
using Robust.Shared.Map.Enumerators;

namespace Content.Server.SS220.Blinds;

public sealed class BlindsSystem : EntitySystem
{
[Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly AppearanceSystem _appearance = default!;
[Dependency] private readonly OccluderSystem _occluder = default!;
[Dependency] private readonly IMapManager _mapManager = default!;

private const int MaxConnectedBlinds = 64;

// <inheritdoc/>
public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<BlindsComponent, ComponentInit>(OnInit);
SubscribeLocalEvent<BlindsComponent, ActivateInWorldEvent>(OnActivated);
}

public void SetOpen(EntityUid uid, BlindsComponent component, bool state)
{
component.IsOpen = state;
UpdateState(uid, component);
}

private void TrySetOpenAnchoredEntities(bool state, AnchoredEntitiesEnumerator entities, HashSet<EntityUid> processedEntities)
{
while (entities.MoveNext(out var entity))
{
if (processedEntities.Contains(entity.Value))
continue;

TrySetOpenAllConnected(entity.Value, state, processedEntities);
}
}

public void TrySetOpenAllConnected(EntityUid uid, bool state, HashSet<EntityUid>? processedEntities = null)
{
// No lagging the server with a shitton of connected blinds
if (processedEntities is not null && processedEntities.Count >= MaxConnectedBlinds)
return;

if (!TryComp<BlindsComponent>(uid, out var component))
return;

SetOpen(uid, component, state);

processedEntities ??= new HashSet<EntityUid>();
processedEntities.Add(uid);

// Make connected blinds change their state as well
if (!TryComp<TransformComponent>(uid, out var transform))
return;

if (transform.Anchored && _mapManager.TryGetGrid(transform.GridUid, out var grid))
{
var pos = grid.CoordinatesToTile(transform.Coordinates);

TrySetOpenAnchoredEntities(component.IsOpen, grid.GetAnchoredEntitiesEnumerator(pos + new Vector2i(1, 0)), processedEntities);
TrySetOpenAnchoredEntities(component.IsOpen, grid.GetAnchoredEntitiesEnumerator(pos + new Vector2i(-1, 0)), processedEntities);
TrySetOpenAnchoredEntities(component.IsOpen, grid.GetAnchoredEntitiesEnumerator(pos + new Vector2i(0, 1)), processedEntities);
TrySetOpenAnchoredEntities(component.IsOpen, grid.GetAnchoredEntitiesEnumerator(pos + new Vector2i(0, -1)), processedEntities);
}
}

private void OnInit(EntityUid uid, BlindsComponent component, ComponentInit args)
{
UpdateState(uid, component);
}

private void UpdateState(EntityUid uid, BlindsComponent component)
{
_appearance.SetData(uid, BlindsVisualState.State, component.IsOpen);
if (TryComp<OccluderComponent>(uid, out var occluder))
_occluder.SetEnabled(uid, !component.IsOpen, occluder);
}

private void OnActivated(EntityUid uid, BlindsComponent component, ActivateInWorldEvent args)
{
if (args.Handled)
return;

TrySetOpenAllConnected(uid, !component.IsOpen);
var soundToPlay = component.IsOpen ? component.OpenSound : component.CloseSound;
_audio.PlayPvs(soundToPlay, args.User);

args.Handled = true;
}
}
37 changes: 37 additions & 0 deletions Content.Server/SS220/Clocks/PhysicalClockSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// © SS220, An EULA/CLA with a hosting restriction, full text: https://raw.githubusercontent.com/SerbiaStrong-220/space-station-14/master/CLA.txt

using Content.Server.GameTicking;
using Content.Shared.Examine;
using Robust.Shared.Timing;
using Content.Shared.SS220.Clocks;

namespace Content.Server.SS220.Clocks;

/// <summary>
/// This system makes clocks state time when examined.
/// </summary>
public sealed class PhysicalClockSystem : EntitySystem
{
[Dependency] private readonly IGameTiming _gameTiming = default!;
[Dependency] private readonly IEntitySystemManager _entitySystem = default!;

// <inheritdoc/>
public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<PhysicalClockComponent, ExaminedEvent>(OnExamine);
}

private void OnExamine(EntityUid uid, PhysicalClockComponent component, ExaminedEvent args)
{
if (!component.Enabled)
return;

var gameTicker = _entitySystem.GetEntitySystem<GameTicker>();
var stationTime = gameTicker.RoundDuration();

args.PushMarkup(Loc.GetString("comp-clocks-time-description",
("time", stationTime.ToString("hh\\:mm\\:ss"))));
}
}
Loading