Skip to content

Commit 0591fe8

Browse files
committed
Merge branch 'master' of https://github.com/SerbiaStrong-220/space-station-14 into Axioma0.1
2 parents fb5394b + 9c0a6d5 commit 0591fe8

File tree

271 files changed

+417384
-526
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

271 files changed

+417384
-526
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
// © SS220, An EULA/CLA with a hosting restriction, full text: https://raw.githubusercontent.com/SerbiaStrong-220/space-station-14/master/CLA.txt
2+
using System.Numerics;
3+
using Content.Shared.SS220.ForcefieldGenerator;
4+
using Robust.Client.Graphics;
5+
using Robust.Shared.Enums;
6+
using Robust.Shared.Prototypes;
7+
8+
namespace Content.Client.SS220.ForcefieldGenerator;
9+
10+
public sealed class ForcefieldOverlay : Overlay
11+
{
12+
private EntityManager _entity;
13+
private SharedTransformSystem _transform;
14+
private IPrototypeManager _prototype = default!;
15+
16+
public override OverlaySpace Space => OverlaySpace.WorldSpaceEntities;
17+
public override bool RequestScreenTexture => true;
18+
19+
private readonly ShaderInstance _shader;
20+
private readonly ShaderInstance _shader_unshaded;
21+
22+
public ForcefieldOverlay(EntityManager entMan, IPrototypeManager protoMan)
23+
{
24+
_entity = entMan;
25+
_transform = entMan.EntitySysManager.GetEntitySystem<SharedTransformSystem>();
26+
_prototype = protoMan;
27+
_shader_unshaded = _prototype.Index<ShaderPrototype>("unshaded").InstanceUnique();
28+
_shader = _prototype.Index<ShaderPrototype>("Stealth").InstanceUnique();
29+
30+
ZIndex = (int) Shared.DrawDepth.DrawDepth.Overdoors;
31+
}
32+
33+
protected override void Draw(in OverlayDrawArgs args)
34+
{
35+
if (ScreenTexture == null)
36+
return;
37+
38+
var handle = args.WorldHandle;
39+
var queryEnum = _entity.EntityQueryEnumerator<ForcefieldSS220Component>();
40+
41+
while (queryEnum.MoveNext(out var uid, out var fieldComp))
42+
{
43+
if (fieldComp.Generator is not { } generator || !_entity.EntityExists(generator))
44+
{
45+
continue;
46+
}
47+
48+
if (!_entity.TryGetComponent<ForcefieldGeneratorSS220Component>(generator, out var generatorComp))
49+
{
50+
continue;
51+
}
52+
53+
var boxToRender = new Box2(
54+
new Vector2(-generatorComp.FieldLength / 2, -generatorComp.FieldThickness / 2),
55+
new Vector2(generatorComp.FieldLength / 2, generatorComp.FieldThickness / 2)
56+
);
57+
58+
var (position, rotation) = _transform.GetWorldPositionRotation(uid);
59+
60+
var reference = args.Viewport.WorldToLocal(position);
61+
reference.X = -reference.X;
62+
63+
_shader.SetParameter("SCREEN_TEXTURE", ScreenTexture);
64+
_shader.SetParameter("reference", reference);
65+
var finalVisibility = Math.Clamp(generatorComp.FieldVisibility, -1f, 1f);
66+
_shader.SetParameter("visibility", finalVisibility);
67+
68+
handle.SetTransform(position, rotation);
69+
handle.UseShader(_shader);
70+
handle.DrawRect(boxToRender, generatorComp.FieldColor);
71+
}
72+
73+
handle.UseShader(null);
74+
handle.SetTransform(Matrix3.Identity);
75+
}
76+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// © SS220, An EULA/CLA with a hosting restriction, full text: https://raw.githubusercontent.com/SerbiaStrong-220/space-station-14/master/CLA.txt
2+
using Robust.Client.Graphics;
3+
using Robust.Shared.Prototypes;
4+
5+
namespace Content.Client.SS220.ForcefieldGenerator;
6+
7+
public sealed class ForcefieldOverlaySystem : EntitySystem
8+
{
9+
[Dependency] private readonly IOverlayManager _overlayManager = default!;
10+
[Dependency] private readonly IPrototypeManager _prototype = default!;
11+
12+
private ForcefieldOverlay _overlay = default!;
13+
14+
public override void Initialize()
15+
{
16+
base.Initialize();
17+
18+
_overlay = new(this.EntityManager, _prototype);
19+
_overlayManager.AddOverlay(_overlay);
20+
}
21+
22+
public override void Shutdown()
23+
{
24+
base.Shutdown();
25+
_overlayManager.RemoveOverlay(_overlay);
26+
}
27+
}

Content.IntegrationTests/Tests/PostMapInitTest.cs

+2
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ public sealed class PostMapInitTest
7676
"220Avrite",
7777
"220Marathon",
7878
"220Hive",
79+
"VoidZone",
80+
"NTvsSSSP"
7981
};
8082

8183
/// <summary>

Content.Server/Administration/Commands/GarbageClearUpCommand.cs

+8-7
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,15 @@ public sealed partial class GarbageClearUpCommand : IConsoleCommand
1212
{
1313
[Dependency] private readonly IEntityManager _entMan = default!;
1414

15-
public string Command => "ClearUpGarbage";
16-
public string Description => "Removes all objects with a tag 'trash' from the map";
17-
public string Help => "Surgery tommorow";
15+
//SS220-clearupgarbage
16+
public string Command => "clearupgarbage";
17+
public string Description => "Удаляет весь мусор с карты (применимо к объектам с тегом 'trash')";
18+
public string Help => $"Usage: {Command} ... surgery tommorow";
1819

1920
public void Execute(IConsoleShell shell, string argStr, string[] args)
2021
{
2122
var _containerSystem = _entMan.System<SharedContainerSystem>();
22-
int cnt = 0;
23+
int processed = 0;
2324
foreach (var ent in _entMan.GetEntities())
2425
{
2526
if (!_entMan.TryGetComponent<TagComponent>(ent, out var component))
@@ -28,9 +29,9 @@ public void Execute(IConsoleShell shell, string argStr, string[] args)
2829
continue;
2930

3031
_entMan.DeleteEntity(ent);
31-
cnt++;
32+
processed++;
3233
}
33-
shell.WriteLine($"Карта очищена от {cnt} объектов мусора!");
34+
shell.WriteLine($"Удалено {processed} энтити.");
3435
}
3536
}
36-
}
37+
}

Content.Server/Kitchen/Components/MicrowaveComponent.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public sealed partial class MicrowaveComponent : Component
7373
public Container Storage = default!;
7474

7575
[DataField, ViewVariables(VVAccess.ReadWrite)]
76-
public int Capacity = 10;
76+
public int Capacity = 15; // SS220 - microwave fix 10 -> 15
7777

7878
[DataField, ViewVariables(VVAccess.ReadWrite)]
7979
public ProtoId<ItemSizePrototype> MaxItemSize = "Normal";

Content.Server/Kitchen/EntitySystems/MicrowaveSystem.cs

+4
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ private void OnCookStop(Entity<ActiveMicrowaveComponent> ent, ref ComponentShutd
9999
{
100100
if (!TryComp<MicrowaveComponent>(ent, out var microwaveComponent))
101101
return;
102+
foreach (var item in microwaveComponent.Storage.ContainedEntities)
103+
{
104+
RemComp<ActivelyMicrowavedComponent>(item);
105+
};
102106
SetAppearance(ent.Owner, MicrowaveVisualState.Idle, microwaveComponent);
103107

104108
microwaveComponent.PlayingStream = _audio.Stop(microwaveComponent.PlayingStream);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// © SS220, An EULA/CLA with a hosting restriction, full text: https://raw.githubusercontent.com/SerbiaStrong-220/space-station-14/master/CLA.txt
2+
using Content.Server.Administration;
3+
using Content.Shared.Administration;
4+
using Content.Shared.Weapons.Ranged.Components;
5+
using Robust.Shared.Console;
6+
7+
namespace Content.Server.SS220.Commands.Helpers;
8+
9+
[AdminCommand(AdminFlags.Admin)]
10+
public sealed class ClearSpentAmmoCommand : IConsoleCommand
11+
{
12+
[Dependency] private readonly IEntityManager _entManager = default!;
13+
14+
// ReSharper disable once StringLiteralTypo
15+
public string Command => "clearspentammo";
16+
public string Description => "Удаляет все отстрелянные патроны в игре";
17+
public string Help => $"Usage: {Command}";
18+
19+
public void Execute(IConsoleShell shell, string argsOther, string[] args)
20+
{
21+
var processed = 0;
22+
var query = _entManager.AllEntityQueryEnumerator<CartridgeAmmoComponent>();
23+
while (query.MoveNext(out var entity, out var comp))
24+
{
25+
if (comp.Spent)
26+
{
27+
_entManager.QueueDeleteEntity(entity);
28+
processed++;
29+
}
30+
}
31+
32+
shell.WriteLine($"Удалено {processed} энтити.");
33+
}
34+
}

0 commit comments

Comments
 (0)