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

Upstream sync #1681

Merged
merged 37 commits into from
Dec 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
446b47a
Adding intermediate industrial chems (#22614)
Boaz1111 Dec 24, 2023
16f4572
Minor alert locale (#22926)
lapatison Dec 24, 2023
beb1a4c
Janitor equipment slot locale, vehicle slot (Keys) locale (#22859)
lapatison Dec 24, 2023
fd5a1b2
Nerfed bloodsuckers- They can no longer tank some incoming damage typ…
Warentan Dec 24, 2023
dd2f8de
Increase cigarette count in cig packs (#22919)
UbaserB Dec 24, 2023
a1210ca
Central Command Access, Doors, and Locked Vendor (#22924)
Nairodian Dec 24, 2023
8b781ed
nukie medic chest rig explosion res buff (#22923)
deltanedas Dec 24, 2023
9d37dde
remove max item size from storage implant (#22928)
Emisse Dec 24, 2023
1f0f346
fix fireaxe rotation (#22930)
notquitehadouken Dec 24, 2023
28310a1
Janibelt whitelist fix and update (#21058)
Sirionaut Dec 25, 2023
b20fcf5
Add a 'Copy' button to the fax UI (#22027)
arimah Dec 25, 2023
2ca649e
add limits to steal objectives (#22672)
deltanedas Dec 25, 2023
2b25e00
Make some items goodlooking in inventory (rotate) (#22935)
lzk228 Dec 25, 2023
52532e4
exterminator midround minor antag (#19946)
deltanedas Dec 25, 2023
7835405
Thief pacifist (#22932)
TheShuEd Dec 25, 2023
8587c37
Make some prototypes use frozen collections (#22576)
ElectroJr Dec 25, 2023
0baffe3
Fix closet skeletons spawning in nullspace (#22942)
ElectroJr Dec 25, 2023
ba88a9a
Revert "Add YAML gas reactions (#22803)" (#22939)
mirrorcult Dec 25, 2023
2d213b8
give plasma half of co2 air alarm threshold (#22938)
deltanedas Dec 25, 2023
0081317
Automatic holiday sprites (#22929)
EmoGarbage404 Dec 25, 2023
e10a314
add round time to the ahelp relay (#22937)
LankLTE Dec 25, 2023
9eaa4c3
Make cargo arbitrage test ignore gambling crate (#22943)
ElectroJr Dec 25, 2023
721a445
Fix pulling mispredicts (#22941)
ElectroJr Dec 25, 2023
9a40cf8
Add sprite movement states (#22940)
metalgearsloth Dec 25, 2023
4cd4805
Atmos crab pet: Tropico! (#22773)
revsys413 Dec 25, 2023
82ddf45
change the restart vote to have no effect with admins online (#22945)
LankLTE Dec 25, 2023
213eb75
centcomm update (#22944)
Emisse Dec 25, 2023
0144bbd
nukieplanet update (#22946)
Emisse Dec 25, 2023
789fd89
reduce nuke required floor radius variable (#22947)
Emisse Dec 25, 2023
dd0270a
bagel update (#22948)
Emisse Dec 25, 2023
450414c
Adds gingerbread men to the game (#22927)
Flareguy Dec 25, 2023
742fd74
Thief description & grammar fixes (#22951)
mirrorcult Dec 25, 2023
724cde2
Botany yaml fixing (#22865)
lzk228 Dec 25, 2023
c326e5d
Fix multi-ghosts (#22964)
metalgearsloth Dec 25, 2023
7b46390
Removed senior roles from job supervisor locales (#22972)
LordCarve Dec 25, 2023
918f543
Merge remote-tracking branch 'upstream/master' into upstream-sync
Morb0 Dec 25, 2023
edde2b6
Update locale
Morb0 Dec 25, 2023
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
6 changes: 6 additions & 0 deletions Content.Client/Fax/UI/FaxBoundUi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ protected override void Open()
_window.OpenCentered();

_window.OnClose += Close;
_window.CopyButtonPressed += OnCopyButtonPressed;
_window.SendButtonPressed += OnSendButtonPressed;
_window.RefreshButtonPressed += OnRefreshButtonPressed;
_window.PeerSelected += OnPeerSelected;
Expand All @@ -32,6 +33,11 @@ private void OnSendButtonPressed()
SendMessage(new FaxSendMessage());
}

private void OnCopyButtonPressed()
{
SendMessage(new FaxCopyMessage());
}

private void OnRefreshButtonPressed()
{
SendMessage(new FaxRefreshMessage());
Expand Down
4 changes: 4 additions & 0 deletions Content.Client/Fax/UI/FaxWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
</BoxContainer>
<Control HorizontalExpand="True" MinHeight="20" />
<BoxContainer Orientation="Horizontal" HorizontalExpand="True">
<Button Name="CopyButton"
Text="{Loc 'fax-machine-ui-copy-button'}"
HorizontalExpand="False"
Disabled="True" />
<Button Name="SendButton"
Text="{Loc 'fax-machine-ui-send-button'}"
HorizontalExpand="True"
Expand Down
3 changes: 3 additions & 0 deletions Content.Client/Fax/UI/FaxWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ namespace Content.Client.Fax.UI;
[GenerateTypedNameReferences]
public sealed partial class FaxWindow : DefaultWindow
{
public event Action? CopyButtonPressed;
public event Action? SendButtonPressed;
public event Action? RefreshButtonPressed;
public event Action<string>? PeerSelected;
Expand All @@ -17,6 +18,7 @@ public FaxWindow()
{
RobustXamlLoader.Load(this);

CopyButton.OnPressed += _ => CopyButtonPressed?.Invoke();
SendButton.OnPressed += _ => SendButtonPressed?.Invoke();
RefreshButton.OnPressed += _ => RefreshButtonPressed?.Invoke();
PeerSelector.OnItemSelected += args =>
Expand All @@ -25,6 +27,7 @@ public FaxWindow()

public void UpdateState(FaxUiState state)
{
CopyButton.Disabled = !state.CanCopy;
SendButton.Disabled = !state.CanSend;
FromLabel.Text = state.DeviceName;

Expand Down
14 changes: 14 additions & 0 deletions Content.Client/Holiday/HolidayRsiSwapComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
namespace Content.Client.Holiday;

/// <summary>
/// This is used for a component that swaps an entity's RSI based on HolidayVisuals
/// </summary>
[RegisterComponent]
public sealed partial class HolidayRsiSwapComponent : Component
{
/// <summary>
/// A dictionary of arbitrary visual keys to an rsi to swap the sprite to.
/// </summary>
[DataField]
public Dictionary<string, string> Sprite = new();
}
34 changes: 34 additions & 0 deletions Content.Client/Holiday/HolidaySystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
using Content.Shared.Holiday;
using Content.Shared.Item;
using Robust.Client.GameObjects;
using Robust.Client.Graphics;
using Robust.Client.ResourceManagement;
using Robust.Shared.Serialization.TypeSerializers.Implementations;

namespace Content.Client.Holiday;

public sealed class HolidaySystem : EntitySystem
{
[Dependency] private readonly IResourceCache _rescache = default!;
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;

/// <inheritdoc/>
public override void Initialize()
{
SubscribeLocalEvent<HolidayRsiSwapComponent, AppearanceChangeEvent>(OnAppearanceChange);
}

private void OnAppearanceChange(Entity<HolidayRsiSwapComponent> ent, ref AppearanceChangeEvent args)
{
if (!_appearance.TryGetData<string>(ent, HolidayVisuals.Holiday, out var data, args.Component))
return;

var comp = ent.Comp;
if (!comp.Sprite.TryGetValue(data, out var rsistring) || args.Sprite == null)
return;

var path = SpriteSpecifierSerializer.TextureRoot / rsistring;
if (_rescache.TryGetResource(path, out RSIResource? rsi))
args.Sprite.BaseRSI = rsi.RSI;
}
}
51 changes: 51 additions & 0 deletions Content.Client/Movement/Systems/SpriteMovementSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
using Content.Shared.Movement.Components;
using Content.Shared.Movement.Events;
using Content.Shared.Movement.Systems;
using Robust.Client.GameObjects;
using Robust.Shared.Timing;

namespace Content.Client.Movement.Systems;

/// <summary>
/// Handles setting sprite states based on whether an entity has movement input.
/// </summary>
public sealed class SpriteMovementSystem : EntitySystem
{
[Dependency] private readonly IGameTiming _timing = default!;

private EntityQuery<SpriteComponent> _spriteQuery;

public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<SpriteMovementComponent, MoveInputEvent>(OnSpriteMoveInput);
_spriteQuery = GetEntityQuery<SpriteComponent>();
}

private void OnSpriteMoveInput(EntityUid uid, SpriteMovementComponent component, ref MoveInputEvent args)
{
if (!_timing.IsFirstTimePredicted)
return;

var oldMoving = SharedMoverController.GetNormalizedMovement(args.OldMovement) != MoveButtons.None;
var moving = SharedMoverController.GetNormalizedMovement(args.Component.HeldMoveButtons) != MoveButtons.None;

if (oldMoving == moving || !_spriteQuery.TryGetComponent(uid, out var sprite))
return;

if (moving)
{
foreach (var (layer, state) in component.MovementLayers)
{
sprite.LayerSetData(layer, state);
}
}
else
{
foreach (var (layer, state) in component.NoMovementLayers)
{
sprite.LayerSetData(layer, state);
}
}
}
}
18 changes: 11 additions & 7 deletions Content.IntegrationTests/Tests/CargoTest.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
using Content.Server.Cargo.Components;
Expand All @@ -6,14 +7,19 @@
using Content.Shared.Stacks;
using Robust.Shared.GameObjects;
using Robust.Shared.Map;
using Robust.Shared.Maths;
using Robust.Shared.Prototypes;

namespace Content.IntegrationTests.Tests;

[TestFixture]
public sealed class CargoTest
{
public static HashSet<ProtoId<CargoProductPrototype>> Ignored = new ()
{
// This is ignored because it is explicitly intended to be able to sell for more than it costs.
new("FunCrateGambling")
};

[Test]
public async Task NoCargoOrderArbitrage()
{
Expand All @@ -23,27 +29,25 @@ public async Task NoCargoOrderArbitrage()
var testMap = await pair.CreateTestMap();

var entManager = server.ResolveDependency<IEntityManager>();
var mapManager = server.ResolveDependency<IMapManager>();
var protoManager = server.ResolveDependency<IPrototypeManager>();
var pricing = server.ResolveDependency<IEntitySystemManager>().GetEntitySystem<PricingSystem>();

await server.WaitAssertion(() =>
{
var mapId = testMap.MapId;

Assert.Multiple(() =>
{
foreach (var proto in protoManager.EnumeratePrototypes<CargoProductPrototype>())
{
var ent = entManager.SpawnEntity(proto.Product, new MapCoordinates(Vector2.Zero, mapId));
if (Ignored.Contains(proto.ID))
continue;

var ent = entManager.SpawnEntity(proto.Product, testMap.MapCoords);
var price = pricing.GetPrice(ent);

Assert.That(price, Is.AtMost(proto.PointCost), $"Found arbitrage on {proto.ID} cargo product! Cost is {proto.PointCost} but sell is {price}!");
entManager.DeleteEntity(ent);
}
});

mapManager.DeleteMap(mapId);
});

await pair.CleanReturnAsync();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ private void AddAntagVerbs(GetVerbsEvent<Verb> args)
if (!_minds.TryGetSession(targetMindComp.Mind, out var session))
return;

_thief.MakeThief(session);
_thief.MakeThief(session, false); //Midround add pacific is bad
},
Impact = LogImpact.High,
Message = Loc.GetString("admin-verb-make-thief"),
Expand Down
26 changes: 26 additions & 0 deletions Content.Server/Administration/Systems/AdminVerbSystem.Smites.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
using Content.Server.Storage.EntitySystems;
using Content.Server.Tabletop;
using Content.Server.Tabletop.Components;
using Content.Server.Terminator.Systems;
using Content.Shared.Administration;
using Content.Shared.Administration.Components;
using Content.Shared.Body.Components;
Expand All @@ -30,6 +31,7 @@
using Content.Shared.Electrocution;
using Content.Shared.Interaction.Components;
using Content.Shared.Inventory;
using Content.Shared.Mind.Components;
using Content.Shared.Mobs;
using Content.Shared.Mobs.Components;
using Content.Shared.Mobs.Systems;
Expand Down Expand Up @@ -72,6 +74,7 @@ public sealed partial class AdminVerbSystem
[Dependency] private readonly PopupSystem _popupSystem = default!;
[Dependency] private readonly SharedPhysicsSystem _physics = default!;
[Dependency] private readonly TabletopSystem _tabletopSystem = default!;
[Dependency] private readonly TerminatorSystem _terminator = default!;
[Dependency] private readonly VomitSystem _vomitSystem = default!;
[Dependency] private readonly WeldableSystem _weldableSystem = default!;
[Dependency] private readonly SharedContentEyeSystem _eyeSystem = default!;
Expand Down Expand Up @@ -793,6 +796,7 @@ private void AddSmiteVerbs(GetVerbsEvent<Verb> args)
Message = Loc.GetString("admin-smite-super-speed-description"),
};
args.Verbs.Add(superSpeed);

//Bonk
Verb superBonkLite = new()
{
Expand Down Expand Up @@ -820,5 +824,27 @@ private void AddSmiteVerbs(GetVerbsEvent<Verb> args)
Impact = LogImpact.Extreme,
};
args.Verbs.Add(superBonk);

Verb terminate = new()
{
Text = "Terminate",
Category = VerbCategory.Smite,
Icon = new SpriteSpecifier.Rsi(new ("Mobs/Species/Terminator/parts.rsi"), "skull_icon"),
Act = () =>
{
if (!TryComp<MindContainerComponent>(args.Target, out var mindContainer) || mindContainer.Mind == null)
return;

var coords = Transform(args.Target).Coordinates;
var mindId = mindContainer.Mind.Value;
_terminator.CreateSpawner(coords, mindId);

_popupSystem.PopupEntity(Loc.GetString("admin-smite-terminate-prompt"), args.Target,
args.Target, PopupType.LargeCaution);
},
Impact = LogImpact.Extreme,
Message = Loc.GetString("admin-smite-terminate-description")
};
args.Verbs.Add(terminate);
}
}
12 changes: 7 additions & 5 deletions Content.Server/Administration/Systems/BwoinkSystem.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Linq;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Text.Json;
Expand Down Expand Up @@ -70,7 +70,7 @@ public override void Initialize()
_config.OnValueChanged(CVars.GameHostName, OnServerNameChanged, true);
_config.OnValueChanged(CCVars.AdminAhelpOverrideClientName, OnOverrideChanged, true);
_sawmill = IoCManager.Resolve<ILogManager>().GetSawmill("AHELP");
_maxAdditionalChars = GenerateAHelpMessage("", "", true).Length;
_maxAdditionalChars = GenerateAHelpMessage("", "", true, _timing.CurTime.ToString("hh\\:mm\\:ss"), _gameTicker.RunLevel).Length;
_playerManager.PlayerStatusChanged += OnPlayerStatusChanged;

SubscribeLocalEvent<GameRunLevelChangedEvent>(OnGameRunLevelChanged);
Expand Down Expand Up @@ -471,7 +471,7 @@ protected override void OnBwoinkTextMessage(BwoinkTextMessage message, EntitySes
{
str = str[..(DescriptionMax - _maxAdditionalChars - unameLength)];
}
_messageQueues[msg.UserId].Enqueue(GenerateAHelpMessage(senderSession.Name, str, !personalChannel, admins.Count == 0));
_messageQueues[msg.UserId].Enqueue(GenerateAHelpMessage(senderSession.Name, str, !personalChannel, _timing.CurTime.ToString("hh\\:mm\\:ss"), _gameTicker.RunLevel, admins.Count == 0));
}

if (admins.Count != 0 || sendsWebhook)
Expand All @@ -492,17 +492,19 @@ private IList<INetChannel> GetTargetAdmins()
.ToList();
}

private static string GenerateAHelpMessage(string username, string message, bool admin, bool noReceivers = false)
private static string GenerateAHelpMessage(string username, string message, bool admin, string roundTime, GameRunLevel roundState, bool noReceivers = false)
{
var stringbuilder = new StringBuilder();

if (admin)
stringbuilder.Append(":outbox_tray:");
else if (noReceivers)
stringbuilder.Append(":sos:");
else
stringbuilder.Append(":inbox_tray:");

if(roundTime != string.Empty && roundState == GameRunLevel.InRound)
stringbuilder.Append($" **{roundTime}**");
stringbuilder.Append($" **{username}:** ");
stringbuilder.Append(message);
return stringbuilder.ToString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ namespace Content.Server.Atmos.EntitySystems
public sealed partial class AtmosphereSystem
{
[Dependency] private readonly IPrototypeManager _protoMan = default!;
[Dependency] private readonly GenericGasReactionSystem _reaction = default!;

private GasReactionPrototype[] _gasReactions = Array.Empty<GasReactionPrototype>();
private float[] _gasSpecificHeats = new float[Atmospherics.TotalNumberOfGases];
Expand Down Expand Up @@ -347,7 +346,7 @@ public ReactionResult React(GasMixture mixture, IGasMixtureHolder? holder)
break;
}

return _reaction.ReactAll(GasReactions, mixture, holder);
return reaction;
}

public enum GasCompareResult
Expand Down
Loading
Loading