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 09.09 #80

Merged
merged 98 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
98 commits
Select commit Hold shift + click to select a range
511d759
A kit to help new botanists discover chemistry (#31738)
drakewill-CRL Sep 5, 2024
461ebca
Automatic changelog update
PJBot Sep 5, 2024
a1dc48c
Board for the AI upload console (#31867)
Nimfar11 Sep 5, 2024
14932bc
Automatic changelog update
PJBot Sep 5, 2024
44d3e3c
Fix typo in agri-chem manual (#31869)
perryprog Sep 5, 2024
0b6516e
Cleanup books.yml (#31838)
lzk228 Sep 6, 2024
1b1d63f
Vox sign/N2 locker update (#31845)
PJB3005 Sep 6, 2024
bd3a642
Automatic changelog update
PJBot Sep 6, 2024
2b455b1
Pizza boxes now have a chance to contain cotton pizza (#31883)
Ekkosangen Sep 6, 2024
4bc8d8e
Automatic changelog update
PJBot Sep 6, 2024
1a4d588
Tech Anomaly (#31764)
TheShuEd Sep 6, 2024
c9cb5af
Automatic changelog update
PJBot Sep 6, 2024
73520b0
Fixed throngler name inconsistencies (#31889)
Chubbicous Sep 6, 2024
582a644
I have spent more time today cleaning up garbage than coding new shit…
PJB3005 Sep 6, 2024
8599251
Mineral Scanner (#31390)
EmoGarbage404 Sep 6, 2024
12ac605
Automatic changelog update
PJBot Sep 6, 2024
bda9a4b
Fix ai upload console itemslot whitelist (#31900)
lzk228 Sep 6, 2024
17cdb17
Automatic changelog update
PJBot Sep 6, 2024
2b0f227
improved vox laugh (#31798)
Errant-4 Sep 6, 2024
45b252e
fix pump shotgun wielded sprite (#31885)
ps3moira Sep 6, 2024
53deec9
fix: Snail event wasnt tabled (#31884)
IProduceWidgets Sep 6, 2024
c7077bb
Automatic changelog update
PJBot Sep 6, 2024
44cf326
Force stop pulling when fall asleep (#31893)
godisdeadLOL Sep 6, 2024
8178fa6
Automatic changelog update
PJBot Sep 6, 2024
2acee53
Energy Shotgun Change 2 - Narrow Nerf + instances from NoSpawn --> ca…
Boaz1111 Sep 7, 2024
e854a3d
Automatic changelog update
PJBot Sep 7, 2024
f49d83a
Add justice helm (#31905)
themias Sep 7, 2024
0165a30
Automatic changelog update
PJBot Sep 7, 2024
cadda4e
Delete RDs binary encryption key (#31909)
Futuristic-OK Sep 7, 2024
9ba59d9
Automatic changelog update
PJBot Sep 7, 2024
a197baa
split temperature protection into heating and cooling (#30662)
EmoGarbage404 Sep 7, 2024
407dd98
Automatic changelog update
PJBot Sep 7, 2024
3a3a5fb
makes the maple wing marking have a primary and a secondary color (#3…
Boaz1111 Sep 7, 2024
dff19b8
Automatic changelog update
PJBot Sep 7, 2024
9680c1d
Remake bottles and syringes names to use labels (#29956)
lzk228 Sep 7, 2024
4e1915f
Automatic changelog update
PJBot Sep 7, 2024
9989f5b
guide on agrichem and botanicals guidebook update (#31896)
Ian321 Sep 7, 2024
ff49332
Automatic changelog update
PJBot Sep 7, 2024
849366f
bagel update (#31911)
Emisse Sep 7, 2024
be94aff
Remove Antimov and Overlord law boards from maps (#31908)
LankLTE Sep 7, 2024
484af4b
Automatic changelog update
PJBot Sep 7, 2024
d57faf5
Lost evac pod thing tiny fan (#31915)
Emisse Sep 7, 2024
932ff66
fix paper label whitelist (#31919)
lzk228 Sep 7, 2024
ab1c60d
Automatic changelog update
PJBot Sep 7, 2024
1fab9bc
Update box disposals (jani rejoice) (#31917)
lzk228 Sep 7, 2024
53be041
Update fland disposals (jani rejoice) (#31918)
lzk228 Sep 7, 2024
719e5a8
Updated cog (Maints edition) (#31935)
Spessmann Sep 7, 2024
66f3b78
uranium ammo mag being called rubber ammo mag fixed (#31934)
Boaz1111 Sep 7, 2024
6158bab
fix wall closet storage range (#31933)
qwerltaz Sep 7, 2024
447e9c2
fix flammable reagents deigniting you (#31930)
Ilya246 Sep 7, 2024
58d2201
Automatic changelog update
PJBot Sep 7, 2024
c5f19fd
Damaged by contact fix (#31921)
Kirus59 Sep 7, 2024
b51d938
Returned functionality to industrial reagent grinders (#31903)
LucasTheDrgn Sep 7, 2024
b61402c
Automatic changelog update
PJBot Sep 7, 2024
e2bbd59
Update Credits (#31937)
github-actions[bot] Sep 8, 2024
6fcb5cf
Update core (#31942)
UbaserB Sep 8, 2024
efe54e0
Biogenerator (#30694)
EmoGarbage404 Sep 8, 2024
680b9c9
Automatic changelog update
PJBot Sep 8, 2024
230ea9b
Metamorphosis - FoodSequence 3 (#31012)
TheShuEd Sep 8, 2024
4b152d1
Automatic changelog update
PJBot Sep 8, 2024
5b6e075
bagel update (#31944)
Emisse Sep 8, 2024
070f38f
box update (#31945)
Emisse Sep 8, 2024
937276d
fland update (#31946)
Emisse Sep 8, 2024
35f50f2
marathon update (#31947)
Emisse Sep 8, 2024
5f6dac6
meta update (#31948)
Emisse Sep 8, 2024
b6019cf
omega update (#31949)
Emisse Sep 8, 2024
b2007bc
packed update (#31950)
Emisse Sep 8, 2024
4b8beda
Add completions to addobjective and localize it (#30456)
nikthechampiongr Sep 8, 2024
5edbd3d
Automatic changelog update
PJBot Sep 8, 2024
e93c3ff
Update submodule to 233.1.0 (#31954)
metalgearsloth Sep 8, 2024
f7a87b5
FTL + AI fixes (#31952)
metalgearsloth Sep 8, 2024
ef54ea7
Automatic changelog update
PJBot Sep 8, 2024
0e99ddb
Fixes being able to craft the justice helmet with a justice helmet (#…
PopGamer45 Sep 8, 2024
1a3a686
Automatic changelog update
PJBot Sep 8, 2024
c7b9895
some securiby contra fixes (#31956)
Killerqu00 Sep 8, 2024
3d4a811
Automatic changelog update
PJBot Sep 8, 2024
713abf6
Make random sentience actually happen (#31953)
Psychpsyo Sep 8, 2024
2de0858
Automatic changelog update
PJBot Sep 8, 2024
a1b27db
remove HatBase (#31971)
lzk228 Sep 8, 2024
c46a4ab
Revert "FTL + AI fixes (#31952)" (#31968)
slarticodefast Sep 8, 2024
eab318e
Rings now give a small amout of gold / silver when scrapped (#31847)
beck-thompson Sep 8, 2024
dbb5da1
Automatic changelog update
PJBot Sep 8, 2024
d5b9151
Update PULL_REQUEST_TEMPLATE.md (#31046)
lzk228 Sep 8, 2024
7eb5c0a
Radiation blocker values for directional plasma and uranium windows (…
K-Dynamic Sep 8, 2024
e6f1492
Automatic changelog update
PJBot Sep 8, 2024
f2615f0
Corrects some typos in the uplink catalog, adjusts grammar (#31989)
HerCoyote23 Sep 8, 2024
ca1bfbf
Add SetEntity(Owner) so can view APC sprite in UI (Bug fix) (#31962)
jamessimo Sep 8, 2024
69be5d0
Cog update (#31986)
Spessmann Sep 9, 2024
1dc8a86
fix moffra antennae (#31981)
Sadie-silly Sep 9, 2024
6fb5ad5
Set Salamander Max Pop to 80 (#31907)
Nairodian Sep 9, 2024
fb47889
make laid power cables more visible (#32000)
qwerltaz Sep 9, 2024
d5c69b5
Automatic changelog update
PJBot Sep 9, 2024
8894e32
Budget insuls leaves behind frayed insulative fibers instead of insul…
ArtisticRoomba Sep 9, 2024
82464da
Automatic changelog update
PJBot Sep 9, 2024
b7453d1
Merge branch 'master' of https://github.com/space-wizards/space-stati…
Sep 9, 2024
33f982e
locale upstream
Sep 9, 2024
294f4fb
map upstream
Sep 9, 2024
9d4c16e
maps add AI role
Sep 9, 2024
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
96 changes: 96 additions & 0 deletions Content.Client/Mining/MiningOverlay.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
using System.Numerics;
using Content.Shared.Mining.Components;
using Robust.Client.GameObjects;
using Robust.Client.Graphics;
using Robust.Client.Player;
using Robust.Shared.Enums;
using Robust.Shared.Timing;
using Robust.Shared.Utility;

namespace Content.Client.Mining;

public sealed class MiningOverlay : Overlay
{
[Dependency] private readonly IEntityManager _entityManager = default!;
[Dependency] private readonly IGameTiming _timing = default!;
[Dependency] private readonly IPlayerManager _player = default!;
private readonly EntityLookupSystem _lookup;
private readonly SpriteSystem _sprite;
private readonly TransformSystem _xform;

private readonly EntityQuery<SpriteComponent> _spriteQuery;
private readonly EntityQuery<TransformComponent> _xformQuery;

public override OverlaySpace Space => OverlaySpace.WorldSpace;
public override bool RequestScreenTexture => false;

private readonly HashSet<Entity<MiningScannerViewableComponent>> _viewableEnts = new();

public MiningOverlay()
{
IoCManager.InjectDependencies(this);

_lookup = _entityManager.System<EntityLookupSystem>();
_sprite = _entityManager.System<SpriteSystem>();
_xform = _entityManager.System<TransformSystem>();

_spriteQuery = _entityManager.GetEntityQuery<SpriteComponent>();
_xformQuery = _entityManager.GetEntityQuery<TransformComponent>();
}

protected override void Draw(in OverlayDrawArgs args)
{
var handle = args.WorldHandle;

if (_player.LocalEntity is not { } localEntity ||
!_entityManager.TryGetComponent<MiningScannerViewerComponent>(localEntity, out var viewerComp))
return;

if (viewerComp.LastPingLocation == null)
return;

var scaleMatrix = Matrix3Helpers.CreateScale(Vector2.One);

_viewableEnts.Clear();
_lookup.GetEntitiesInRange(viewerComp.LastPingLocation.Value, viewerComp.ViewRange, _viewableEnts);
foreach (var ore in _viewableEnts)
{
if (!_xformQuery.TryComp(ore, out var xform) ||
!_spriteQuery.TryComp(ore, out var sprite))
continue;

if (xform.MapID != args.MapId || !sprite.Visible)
continue;

if (!sprite.LayerMapTryGet(MiningScannerVisualLayers.Overlay, out var idx))
continue;
var layer = sprite[idx];

if (layer.ActualRsi?.Path == null || layer.RsiState.Name == null)
continue;

var gridRot = xform.GridUid == null ? 0 : _xformQuery.CompOrNull(xform.GridUid.Value)?.LocalRotation ?? 0;
var rotationMatrix = Matrix3Helpers.CreateRotation(gridRot);

var worldMatrix = Matrix3Helpers.CreateTranslation(_xform.GetWorldPosition(xform));
var scaledWorld = Matrix3x2.Multiply(scaleMatrix, worldMatrix);
var matty = Matrix3x2.Multiply(rotationMatrix, scaledWorld);
handle.SetTransform(matty);

var spriteSpec = new SpriteSpecifier.Rsi(layer.ActualRsi.Path, layer.RsiState.Name);
var texture = _sprite.GetFrame(spriteSpec, TimeSpan.FromSeconds(layer.AnimationTime));

var animTime = (viewerComp.NextPingTime - _timing.CurTime).TotalSeconds;


var alpha = animTime < viewerComp.AnimationDuration
? 0
: (float) Math.Clamp((animTime - viewerComp.AnimationDuration) / viewerComp.AnimationDuration, 0f, 1f);
var color = Color.White.WithAlpha(alpha);

handle.DrawTexture(texture, -(Vector2) texture.Size / 2f / EyeManager.PixelsPerMeter, layer.Rotation, modulate: color);

}
handle.SetTransform(Matrix3x2.Identity);
}
}
54 changes: 54 additions & 0 deletions Content.Client/Mining/MiningOverlaySystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
using Content.Shared.Mining.Components;
using Robust.Client.Graphics;
using Robust.Client.Player;
using Robust.Shared.Player;

namespace Content.Client.Mining;

/// <summary>
/// This handles the lifetime of the <see cref="MiningOverlay"/> for a given entity.
/// </summary>
public sealed class MiningOverlaySystem : EntitySystem
{
[Dependency] private readonly IPlayerManager _player = default!;
[Dependency] private readonly IOverlayManager _overlayMan = default!;

private MiningOverlay _overlay = default!;

/// <inheritdoc/>
public override void Initialize()
{
SubscribeLocalEvent<MiningScannerViewerComponent, ComponentInit>(OnInit);
SubscribeLocalEvent<MiningScannerViewerComponent, ComponentShutdown>(OnShutdown);
SubscribeLocalEvent<MiningScannerViewerComponent, LocalPlayerAttachedEvent>(OnPlayerAttached);
SubscribeLocalEvent<MiningScannerViewerComponent, LocalPlayerDetachedEvent>(OnPlayerDetached);

_overlay = new();
}

private void OnPlayerAttached(Entity<MiningScannerViewerComponent> ent, ref LocalPlayerAttachedEvent args)
{
_overlayMan.AddOverlay(_overlay);
}

private void OnPlayerDetached(Entity<MiningScannerViewerComponent> ent, ref LocalPlayerDetachedEvent args)
{
_overlayMan.RemoveOverlay(_overlay);
}

private void OnInit(Entity<MiningScannerViewerComponent> ent, ref ComponentInit args)
{
if (_player.LocalEntity == ent)
{
_overlayMan.AddOverlay(_overlay);
}
}

private void OnShutdown(Entity<MiningScannerViewerComponent> ent, ref ComponentShutdown args)
{
if (_player.LocalEntity == ent)
{
_overlayMan.RemoveOverlay(_overlay);
}
}
}
6 changes: 0 additions & 6 deletions Content.Client/Mining/OreVeinVisualsComponent.cs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using Content.Shared.Nutrition.Components;
using Content.Shared.Nutrition.EntitySystems;
using Robust.Client.GameObjects;
using Robust.Shared.Utility;

namespace Content.Client.Nutrition.EntitySystems;

Expand Down Expand Up @@ -50,6 +49,7 @@ private void UpdateFoodVisuals(Entity<FoodSequenceStartPointComponent> start, Sp
sprite.AddBlankLayer(index);
sprite.LayerMapSet(keyCode, index);
sprite.LayerSetSprite(index, state.Sprite);
sprite.LayerSetScale(index, state.Scale);

//Offset the layer
var layerPos = start.Comp.StartPosition;
Expand Down
2 changes: 1 addition & 1 deletion Content.Client/Power/APC/ApcBoundUserInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ public ApcBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
protected override void Open()
{
base.Open();

_menu = this.CreateWindow<ApcMenu>();
_menu.SetEntity(Owner);
_menu.OnBreaker += BreakerPressed;
}

Expand Down
61 changes: 61 additions & 0 deletions Content.Server/Anomaly/Components/TechAnomalyComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
using Content.Server.Anomaly.Effects;
using Content.Shared.Destructible.Thresholds;
using Content.Shared.DeviceLinking;
using Robust.Shared.Prototypes;

namespace Content.Server.Anomaly.Components;

[RegisterComponent, AutoGenerateComponentPause, Access(typeof(TechAnomalySystem))]
public sealed partial class TechAnomalyComponent : Component
{
/// <summary>
/// the distance at which random ports will bind to the anomaly. Scales with severity.
/// </summary>
[DataField]
public MinMax LinkRadius = new(5, 10);

/// <summary>
/// the maximum number of entities with which an anomaly is associated during pulsing. Scales with severity
/// </summary>
[DataField]
public MinMax LinkCountPerPulse = new(2, 8);

/// <summary>
/// Number of linkable pairs. when supercrit, the anomaly will link random devices in the radius to each other in pairs.
/// </summary>
[DataField]
public int LinkCountSupercritical = 30;

/// <summary>
/// port activated by pulsation of the anomaly
/// </summary>
[DataField]
public ProtoId<SourcePortPrototype> PulsePort = "Pulse";

/// <summary>
/// A port that activates every few seconds of an anomaly's lifetime
/// </summary>
[DataField]
public ProtoId<SourcePortPrototype> TimerPort = "Timer";

/// <summary>
/// Chance of emag the device, when supercrit
/// </summary>
[DataField]
public float EmagSupercritProbability = 0.4f;

/// <summary>
/// A prototype beam shot into devices when pulsed
/// </summary>
[DataField]
public EntProtoId LinkBeamProto = "AnomalyTechBeam";

/// <summary>
/// time until the next activation of the timer ports
/// </summary>
[DataField, AutoPausedField]
public TimeSpan NextTimer = TimeSpan.Zero;

[DataField]
public float TimerFrequency = 3f;
}
125 changes: 125 additions & 0 deletions Content.Server/Anomaly/Effects/TechAnomalySystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
using Content.Server.Anomaly.Components;
using Content.Server.Beam;
using Content.Server.DeviceLinking.Systems;
using Content.Shared.Anomaly.Components;
using Content.Shared.DeviceLinking;
using Content.Shared.Emag.Systems;
using Robust.Shared.Random;
using Robust.Shared.Timing;

namespace Content.Server.Anomaly.Effects;

public sealed class TechAnomalySystem : EntitySystem
{
[Dependency] private readonly DeviceLinkSystem _signal = default!;
[Dependency] private readonly EntityLookupSystem _lookup = default!;
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly BeamSystem _beam = default!;
[Dependency] private readonly IGameTiming _timing = default!;
[Dependency] private readonly EmagSystem _emag = default!;

public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<TechAnomalyComponent, AnomalyPulseEvent>(OnPulse);
SubscribeLocalEvent<TechAnomalyComponent, AnomalySupercriticalEvent>(OnSupercritical);
SubscribeLocalEvent<TechAnomalyComponent, AnomalyStabilityChangedEvent>(OnStabilityChanged);
}

public override void Update(float frameTime)
{
base.Update(frameTime);

var query = EntityQueryEnumerator<TechAnomalyComponent, AnomalyComponent>();
while (query.MoveNext(out var uid, out var tech, out var anom))
{
if (_timing.CurTime < tech.NextTimer)
return;

tech.NextTimer = _timing.CurTime + TimeSpan.FromSeconds(tech.TimerFrequency * anom.Stability);

_signal.InvokePort(uid, tech.TimerPort);
}
}

private void OnStabilityChanged(Entity<TechAnomalyComponent> tech, ref AnomalyStabilityChangedEvent args)
{
var links = MathHelper.Lerp(tech.Comp.LinkCountPerPulse.Min, tech.Comp.LinkCountPerPulse.Max, args.Severity);
CreateNewRandomLink(tech, (int)links);
}

private void CreateNewRandomLink(Entity<TechAnomalyComponent> tech, int count)
{
if (!TryComp<AnomalyComponent>(tech, out var anomaly))
return;
if (!TryComp<DeviceLinkSourceComponent>(tech, out var sourceComp))
return;

var range = MathHelper.Lerp(tech.Comp.LinkRadius.Min, tech.Comp.LinkRadius.Max, anomaly.Severity);

var devices = _lookup.GetEntitiesInRange<DeviceLinkSinkComponent>(Transform(tech).Coordinates, range);
if (devices.Count < 1)
return;

for (var i = 0; i < count; i++)
{
var device = _random.Pick(devices);
CreateNewLink(tech, (tech, sourceComp), device);
}
}

private void CreateNewLink(Entity<TechAnomalyComponent> tech, Entity<DeviceLinkSourceComponent> source, Entity<DeviceLinkSinkComponent> target)
{
var sourcePort = _random.Pick(source.Comp.Ports);
var sinkPort = _random.Pick(target.Comp.Ports);

_signal.SaveLinks(null, source, target,new()
{
(sourcePort, sinkPort),
});
_beam.TryCreateBeam(source, target, tech.Comp.LinkBeamProto);
}

private void OnSupercritical(Entity<TechAnomalyComponent> tech, ref AnomalySupercriticalEvent args)
{
// We remove the component so that the anomaly does not bind itself to other devices before self destroy.
RemComp<DeviceLinkSourceComponent>(tech);

var sources =
_lookup.GetEntitiesInRange<DeviceLinkSourceComponent>(Transform(tech).Coordinates,
tech.Comp.LinkRadius.Max);

var sinks =
_lookup.GetEntitiesInRange<DeviceLinkSinkComponent>(Transform(tech).Coordinates,
tech.Comp.LinkRadius.Max);

for (var i = 0; i < tech.Comp.LinkCountSupercritical; i++)
{
if (sources.Count < 1)
return;

if (sinks.Count < 1)
return;

var source = _random.Pick(sources);
sources.Remove(source);

var sink = _random.Pick(sinks);
sinks.Remove(sink);

if (_random.Prob(tech.Comp.EmagSupercritProbability))
{
_emag.DoEmagEffect(tech, source);
_emag.DoEmagEffect(tech, sink);
}

CreateNewLink(tech, source, sink);
}
}

private void OnPulse(Entity<TechAnomalyComponent> tech, ref AnomalyPulseEvent args)
{
_signal.InvokePort(tech, tech.Comp.PulsePort);
}
}
2 changes: 1 addition & 1 deletion Content.Server/Atmos/EntitySystems/FlammableSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ public void SetFireStacks(EntityUid uid, float stacks, FlammableComponent? flamm
}
else
{
flammable.OnFire = ignite;
flammable.OnFire |= ignite;
UpdateAppearance(uid, flammable);
}
}
Expand Down
4 changes: 2 additions & 2 deletions Content.Server/Discord/DiscordWebhook.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ private string GetUrl(WebhookIdentifier identifier)
{
return await _http.GetFromJsonAsync<WebhookData>(url);
}
catch
catch (Exception e)
{
_sawmill.Error($"Error getting discord webhook data. Stack trace:\n{Environment.StackTrace}");
_sawmill.Error($"Error getting discord webhook data.\n{e}");
return null;
}
}
Expand Down
Loading
Loading