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 #688

Merged
merged 79 commits into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from 78 commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
24c47c8
Fire Axe resprite 45 degrees v3 (#28866)
AndreyCamper Jul 5, 2024
84ff5e3
nuke biochem (#29751)
laok233 Jul 5, 2024
4c5c6a8
Shuttle map button tweaks (#29757)
metalgearsloth Jul 6, 2024
12edad8
Automatic changelog update
PJBot Jul 6, 2024
7b99d1f
Don't allow toggling internals while asleep (#29753)
themias Jul 6, 2024
7ae3e35
You no longer get deleted when cuffed and buckled (#29718)
Killerqu00 Jul 6, 2024
34f3666
Fixes a minor typo for the base gingerbread body part (#29717)
MFMessage Jul 6, 2024
b418338
Phoronman 1984 (#29747)
Errant-4 Jul 6, 2024
5cd7cf1
Added cryosleep UnitSpawner and UnitSpawnerLate to the map Origin (#2…
JIPDawg Jul 6, 2024
fa6d680
Automatic changelog update
PJBot Jul 6, 2024
60ef784
Fix wielding while pulling (#29781)
themias Jul 7, 2024
0098d71
Update Credits (#29784)
github-actions[bot] Jul 7, 2024
18df27d
Spilling reagents on mutliple entities at once fix (#29763)
beck-thompson Jul 7, 2024
d9be666
Automatic changelog update
PJBot Jul 7, 2024
23887d5
Improve buckling's interactions with standing state (#29741)
Tayrtahn Jul 7, 2024
336f264
Automatic changelog update
PJBot Jul 7, 2024
c9c721b
Add supplybot moving states (#29795)
lzk228 Jul 7, 2024
f50488d
Raise ratking migration minimum players to 30 from 15 (#29737)
Simyon264 Jul 7, 2024
063c5de
Automatic changelog update
PJBot Jul 7, 2024
0e9ed36
Intercom buffs and fixes (#29580)
EmoGarbage404 Jul 7, 2024
71b7ddd
Automatic changelog update
PJBot Jul 7, 2024
13b8487
Bartending+: Shaking and Stirring (#29243)
Vermidia Jul 7, 2024
437f6f4
Slicing food with Swords (#29005)
NotSoDana Jul 7, 2024
70b5613
fix(hardsuits): Give the carp suit and hardsuit a suit storage slot (…
Brandon-Huu Jul 7, 2024
ff93070
Automatic changelog update
PJBot Jul 7, 2024
21d0f85
metal foam grenades (#29428)
EmoGarbage404 Jul 7, 2024
ed7f006
The real AME nerf (#29587)
EmoGarbage404 Jul 7, 2024
04249e8
Removes max damage threshold on healing for hyperzine (#29712)
Plykiya Jul 7, 2024
eab93cb
Automatic changelog update
PJBot Jul 7, 2024
8c3e72c
Silence ringtones on admin PDAs (#29801)
Tayrtahn Jul 8, 2024
f6d093e
Automatic changelog update
PJBot Jul 8, 2024
c8a87ce
Fixed the guide book entry for Diona's blood type (#29805)
JIPDawg Jul 8, 2024
92e2980
Improve throwing precision (#29726)
slarticodefast Jul 8, 2024
d6c4ebd
Automatic changelog update
PJBot Jul 8, 2024
40f735a
Don't treat vgroid as station grid (#29811)
metalgearsloth Jul 8, 2024
149b6a8
Vox guidebook entry (#29713)
Errant-4 Jul 9, 2024
f12b395
Automatic changelog update
PJBot Jul 9, 2024
c7f752d
Restore a panic bunker cvar in wizardsDen.toml (#29832)
Chief-Engineer Jul 9, 2024
8dde49d
all toggle light actions have a 1 second use delay (#29833)
QuietlyWhisper Jul 9, 2024
8bd8787
Automatic changelog update
PJBot Jul 9, 2024
08b12f3
Fix Shotgun Spam Loading (#29827)
Cojoke-dot Jul 9, 2024
9bf3c33
Automatic changelog update
PJBot Jul 9, 2024
74d9ac7
Add popup for healing target (#29804)
lzk228 Jul 9, 2024
061ec43
Add popup for health analyzer target (#29803)
lzk228 Jul 9, 2024
f3342c5
localization and change of appearance of the phrase about the remaini…
chavonadelal Jul 9, 2024
04cb265
Action menu localization (#29839)
chavonadelal Jul 9, 2024
7e087a6
fix passive vent sprite in construction menu (#29820)
slarticodefast Jul 9, 2024
7bf77be
Automatic changelog update
PJBot Jul 9, 2024
62d8665
Let Pacifists Use Certain Guns(Foam Weapons) (#29835)
Cojoke-dot Jul 9, 2024
8c59879
Automatic changelog update
PJBot Jul 9, 2024
245c99c
Fix lobby time typo (#29841)
lzk228 Jul 9, 2024
c9be1ef
Localization of the threat level in an emergency lamp (#29847)
chavonadelal Jul 9, 2024
b511d8e
Nozzle Direction Localization (#29849)
chavonadelal Jul 9, 2024
49128ba
Aghosts can now /ghost (#29360)
Errant-4 Jul 9, 2024
bb82b4c
Change Cluster evac (#29828)
lzk228 Jul 9, 2024
742290c
Update map changes labeler (#29858)
lzk228 Jul 9, 2024
2349fb4
Stop eating food if you drop it (#29854)
Plykiya Jul 9, 2024
edf8c6c
Automatic changelog update
PJBot Jul 9, 2024
93197b6
Fix colornetwork desc and help (#29856)
lzk228 Jul 9, 2024
d3495fc
made the guitars be able to be worn on suitstorage (#29048)
Boaz1111 Jul 9, 2024
7a66da3
Automatic changelog update
PJBot Jul 9, 2024
c57009b
Fix borg's popup spam (#29861)
Winkarst-cpu Jul 9, 2024
d3642c7
Automatic changelog update
PJBot Jul 9, 2024
eef6f92
Steal Objective Condition now support stacks (#29843)
TheShuEd Jul 10, 2024
3f2793c
fixed missing characters in OwO accent (#29047)
Moomoobeef Jul 10, 2024
a016577
Add scarf to warm clothing bounty (#29779)
lokachop Jul 10, 2024
8d48096
Automatic changelog update
PJBot Jul 10, 2024
e8b3042
Add an option to the admin fax menu to lock papers such that they can…
dffdff2423 Jul 10, 2024
a1f2df0
Automatic changelog update
PJBot Jul 10, 2024
56fb8c8
books bag tabletop (#29863)
Ghagliiarghii Jul 10, 2024
91740ef
Fix typing indicators! (#29492)
beck-thompson Jul 10, 2024
a5ec017
Crafting pizza boxes. (#29680)
saga3152 Jul 10, 2024
8aecd66
Automatic changelog update
PJBot Jul 10, 2024
ee59ae9
Custom solution transfer volume popup and item status panel fix (#29852)
Winkarst-cpu Jul 10, 2024
6f6bc38
Automatic changelog update
PJBot Jul 10, 2024
939f0f4
Fixed jobwhitelist locale (#29878)
Tunguso4ka Jul 10, 2024
44acf2c
Merge remote-tracking branch 'wizard/master' into upstream-sync
KayzelW Jul 10, 2024
d6b4fff
fix
KayzelW Jul 10, 2024
6180371
Update intercomFULL.yml
KayzelW Jul 11, 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
4 changes: 2 additions & 2 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"Changes: Map":
- changed-files:
- any-glob-to-any-file:
- 'Resources/Maps/*.yml'
- 'Resources/Prototypes/Maps/*.yml'
- 'Resources/Maps/**/*.yml'
- 'Resources/Prototypes/Maps/**/*.yml'
- 'Resources/Prototypes/Corvax/Maps/*.yml'

"Changes: UI":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ private void ClientUpdateTyping() // Corvax-TypingIndicator
state = _isClientTyping ? TypingIndicatorState.Typing : TypingIndicatorState.Idle;
// Corvax-TypingIndicator-End
// send a networked event to server
RaisePredictiveEvent(new TypingChangedEvent(state)); // Corvax-TypingIndicator
RaisePredictiveEvent((TypingChangedEvent)state); // Corvax-TypingIndicator
}

private void OnShowTypingChanged(bool showTyping)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,36 @@
using Robust.Client.GameObjects;
using Robust.Client.Graphics;
using Robust.Shared.Prototypes;
using Content.Shared.Inventory;

namespace Content.Client.Chat.TypingIndicator;

public sealed class TypingIndicatorVisualizerSystem : VisualizerSystem<TypingIndicatorComponent>
{
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly InventorySystem _inventory = default!;


protected override void OnAppearanceChange(EntityUid uid, TypingIndicatorComponent component, ref AppearanceChangeEvent args)
{
if (args.Sprite == null)
return;

if (!_prototypeManager.TryIndex<TypingIndicatorPrototype>(component.Prototype, out var proto))
var currentTypingIndicator = component.TypingIndicatorPrototype;

var evt = new BeforeShowTypingIndicatorEvent();

if (TryComp<InventoryComponent>(uid, out var inventoryComp))
_inventory.RelayEvent((uid, inventoryComp), ref evt);

var overrideIndicator = evt.GetMostRecentIndicator();

if (overrideIndicator != null)
currentTypingIndicator = overrideIndicator.Value;

if (!_prototypeManager.TryIndex(currentTypingIndicator, out var proto))
{
Log.Error($"Unknown typing indicator id: {component.Prototype}");
Log.Error($"Unknown typing indicator id: {component.TypingIndicatorPrototype}");
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ public void UpdateCountdown()
}

EmergencyShuttleButton.Text = Loc.GetString("comms-console-menu-recall-shuttle");
CountdownLabel.SetMessage($"Time remaining\n{Owner.Countdown.ToString()}s");
var infoText = Loc.GetString($"comms-console-menu-time-remaining",
("time", Owner.Countdown.ToString()));
CountdownLabel.SetMessage(infoText);
}

public override void Close()
Expand Down
2 changes: 1 addition & 1 deletion Content.Client/Fax/AdminUI/AdminFaxEui.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public AdminFaxEui()
_window.OnClose += () => SendMessage(new AdminFaxEuiMsg.Close());
_window.OnFollowFax += entity => SendMessage(new AdminFaxEuiMsg.Follow(entity));
_window.OnMessageSend += args => SendMessage(new AdminFaxEuiMsg.Send(args.entity, args.title,
args.stampedBy, args.message, args.stampSprite, args.stampColor));
args.stampedBy, args.message, args.stampSprite, args.stampColor, args.locked));
}

public override void Opened()
Expand Down
4 changes: 2 additions & 2 deletions Content.Client/Fax/AdminUI/AdminFaxWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
</BoxContainer>
<Label Text="{Loc admin-fax-stamp-color}" />
<ColorSelectorSliders Margin="12 0 0 0" Name="StampColorSelector" Color="#BB3232"/>
<Control MinHeight="10" />
<Button Name="SendButton" Text="{Loc admin-fax-send}"></Button>
<CheckBox Name="LockPageCheckbox" Text="{Loc admin-fax-lock-page}" ToolTip="{Loc admin-fax-lock-page-tooltip}"/>
<Button Name="SendButton" Text="{Loc admin-fax-send}" Margin="0 10 0 0" />
</BoxContainer>
</DefaultWindow>
5 changes: 3 additions & 2 deletions Content.Client/Fax/AdminUI/AdminFaxWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public sealed partial class AdminFaxWindow : DefaultWindow
{
private const string StampsRsiPath = "/Textures/Objects/Misc/bureaucracy.rsi";

public Action<(NetEntity entity, string title, string stampedBy, string message, string stampSprite, Color stampColor)>? OnMessageSend;
public Action<(NetEntity entity, string title, string stampedBy, string message, string stampSprite, Color stampColor, bool locked)>? OnMessageSend;
public Action<NetEntity>? OnFollowFax;

[Dependency] private readonly IResourceCache _resCache = default!;
Expand Down Expand Up @@ -98,6 +98,7 @@ private void SendMessage(BaseButton.ButtonEventArgs obj)

var from = FromEdit.Text;
var stampColor = StampColorSelector.Color;
OnMessageSend?.Invoke((faxEntity.Value, title, from, message, stamp, stampColor));
var locked = LockPageCheckbox.Pressed;
OnMessageSend?.Invoke((faxEntity.Value, title, from, message, stamp, stampColor, locked));
}
}
23 changes: 23 additions & 0 deletions Content.Client/Radio/EntitySystems/RadioDeviceSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using Content.Client.Radio.Ui;
using Content.Shared.Radio;
using Content.Shared.Radio.Components;
using Robust.Client.GameObjects;

namespace Content.Client.Radio.EntitySystems;

public sealed class RadioDeviceSystem : EntitySystem
{
[Dependency] private readonly UserInterfaceSystem _ui = default!;

/// <inheritdoc/>
public override void Initialize()
{
SubscribeLocalEvent<IntercomComponent, AfterAutoHandleStateEvent>(OnAfterHandleState);
}

private void OnAfterHandleState(Entity<IntercomComponent> ent, ref AfterAutoHandleStateEvent args)
{
if (_ui.TryGetOpenUi<IntercomBoundUserInterface>(ent.Owner, IntercomUiKey.Key, out var bui))
bui.Update(ent);
}
}
15 changes: 6 additions & 9 deletions Content.Client/Radio/Ui/IntercomBoundUserInterface.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Content.Shared.Radio;
using Content.Shared.Radio.Components;
using JetBrains.Annotations;
using Robust.Client.GameObjects;

namespace Content.Client.Radio.Ui;

Expand All @@ -19,7 +19,9 @@ protected override void Open()
{
base.Open();

_menu = new();
var comp = EntMan.GetComponent<IntercomComponent>(Owner);

_menu = new((Owner, comp));

_menu.OnMicPressed += enabled =>
{
Expand All @@ -46,13 +48,8 @@ protected override void Dispose(bool disposing)
_menu?.Close();
}

protected override void UpdateState(BoundUserInterfaceState state)
public void Update(Entity<IntercomComponent> ent)
{
base.UpdateState(state);

if (state is not IntercomBoundUIState msg)
return;

_menu?.Update(msg);
_menu?.Update(ent);
}
}
37 changes: 27 additions & 10 deletions Content.Client/Radio/Ui/IntercomMenu.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
using Content.Client.UserInterface.Controls;
using Content.Shared.Radio;
using Content.Shared.Radio.Components;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Prototypes;
using Robust.Shared.Utility;

namespace Content.Client.Radio.Ui;

Expand All @@ -17,38 +18,54 @@ public sealed partial class IntercomMenu : FancyWindow

private readonly List<string> _channels = new();

public IntercomMenu()
public IntercomMenu(Entity<IntercomComponent> entity)
{
RobustXamlLoader.Load(this);
IoCManager.InjectDependencies(this);

MicButton.OnPressed += args => OnMicPressed?.Invoke(args.Button.Pressed);
SpeakerButton.OnPressed += args => OnSpeakerPressed?.Invoke(args.Button.Pressed);

Update(entity);
}

public void Update(IntercomBoundUIState state)
public void Update(Entity<IntercomComponent> entity)
{
MicButton.Pressed = state.MicEnabled;
SpeakerButton.Pressed = state.SpeakerEnabled;
MicButton.Pressed = entity.Comp.MicrophoneEnabled;
SpeakerButton.Pressed = entity.Comp.SpeakerEnabled;

MicButton.Disabled = entity.Comp.SupportedChannels.Count == 0;
SpeakerButton.Disabled = entity.Comp.SupportedChannels.Count == 0;
ChannelOptions.Disabled = entity.Comp.SupportedChannels.Count == 0;

ChannelOptions.Clear();
_channels.Clear();
for (var i = 0; i < state.AvailableChannels.Count; i++)
for (var i = 0; i < entity.Comp.SupportedChannels.Count; i++)
{
var channel = state.AvailableChannels[i];
if (!_prototype.TryIndex<RadioChannelPrototype>(channel, out var prototype))
var channel = entity.Comp.SupportedChannels[i];
if (!_prototype.TryIndex(channel, out var prototype))
continue;

_channels.Add(channel);
ChannelOptions.AddItem(Loc.GetString(prototype.Name), i);

if (channel == state.SelectedChannel)
if (channel == entity.Comp.CurrentChannel)
ChannelOptions.Select(i);
}

if (entity.Comp.SupportedChannels.Count == 0)
{
ChannelOptions.AddItem(Loc.GetString("intercom-options-none"), 0);
ChannelOptions.Select(0);
}

ChannelOptions.OnItemSelected += args =>
{
if (!_channels.TryGetValue(args.Id, out var proto))
return;

ChannelOptions.SelectId(args.Id);
OnChannelSelected?.Invoke(_channels[args.Id]);
OnChannelSelected?.Invoke(proto);
};
}
}
Expand Down
17 changes: 11 additions & 6 deletions Content.Client/Shuttles/UI/MapScreen.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ private void RebuildMapObjects()
ourMap = shuttleXform.MapID;
}

while (mapComps.MoveNext(out var mapComp, out var mapXform, out var mapMetadata))
while (mapComps.MoveNext(out var mapUid, out var mapComp, out var mapXform, out var mapMetadata))
{
if (_console != null && !_shuttles.CanFTLTo(_shuttleEntity.Value, mapComp.MapId, _console.Value))
{
Expand Down Expand Up @@ -327,20 +327,28 @@ private void RebuildMapObjects()
{
AddMapObject(mapComp.MapId, gridObj);
}
else if (!_shuttles.IsBeaconMap(_mapManager.GetMapEntityId(mapComp.MapId)) && (iffComp == null ||
(iffComp.Flags & IFFFlags.Hide) == 0x0))
// If we can show it then add it to pending.
else if (!_shuttles.IsBeaconMap(mapUid) && (iffComp == null ||
(iffComp.Flags & IFFFlags.Hide) == 0x0) &&
!gridObj.HideButton)
{
_pendingMapObjects.Add((mapComp.MapId, gridObj));
}
}

foreach (var (beacon, _) in _shuttles.GetExclusions(mapComp.MapId, _exclusions))
{
if (beacon.HideButton)
continue;

_pendingMapObjects.Add((mapComp.MapId, beacon));
}

foreach (var (beacon, _) in _shuttles.GetBeacons(mapComp.MapId, _beacons))
{
if (beacon.HideButton)
continue;

_pendingMapObjects.Add((mapComp.MapId, beacon));
}

Expand Down Expand Up @@ -425,9 +433,6 @@ private void AddMapObject(MapId mapId, IMapObject mapObj)
var existing = _mapObjects.GetOrNew(mapId);
existing.Add(mapObj);

if (mapObj.HideButton)
return;

var gridContents = _mapHeadings[mapId];

var gridButton = new Button()
Expand Down
1 change: 0 additions & 1 deletion Content.Client/Throwing/ThrownItemVisualizerSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ private void OnShutdown(EntityUid uid, ThrownItemComponent component, ComponentS
if (length <= TimeSpan.Zero)
return null;

length += TimeSpan.FromSeconds(ThrowingSystem.FlyTime);
var scale = ent.Comp2.Scale;
var lenFloat = (float) length.TotalSeconds;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xmlns:windows="clr-namespace:Content.Client.UserInterface.Systems.Actions.Windows"
Name="ActionsList"
HorizontalExpand="True"
Title="Actions"
Title="{Loc ui-actionmenu-title}"
VerticalExpand="True"
Resizable="True"
MinHeight="300"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public ActionsWindow()

foreach (var filter in Enum.GetValues<Filters>())
{
FilterButton.AddItem(filter.ToString(), filter);
FilterButton.AddItem(Loc.GetString($"ui-actionmenu-{filter.ToString().ToLower()}"), filter);
}
}

Expand Down
27 changes: 9 additions & 18 deletions Content.Server/Ame/AmeNodeGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,22 +134,11 @@ public float InjectFuel(int fuel, out bool overloading)
// The AME is being overloaded.
// Note about these maths: I would assume the general idea here is to make larger engines less safe to overload.
// In other words, yes, those are supposed to be CoreCount, not safeFuelLimit.
var instability = 0;
var overloadVsSizeResult = fuel - CoreCount;

// fuel > safeFuelLimit: Slow damage. Can safely run at this level for burst periods if the engine is small and someone is keeping an eye on it.
if (_random.Prob(0.5f))
instability = 1;
// overloadVsSizeResult > 5:
if (overloadVsSizeResult > 5)
instability = 3;
// overloadVsSizeResult > 10: This will explode in at most 20 injections.
if (overloadVsSizeResult > 10)
instability = 5;

// Apply calculated instability
if (instability == 0)
return powerOutput;
var instability = overloadVsSizeResult / CoreCount;
var fuzz = _random.Next(-1, 2); // -1 to 1
instability += fuzz; // fuzz the values a tiny bit.

overloading = true;
var integrityCheck = 100;
Expand Down Expand Up @@ -179,10 +168,12 @@ public float InjectFuel(int fuel, out bool overloading)
/// </summary>
public float CalculatePower(int fuel, int cores)
{
// Fuel is squared so more fuel vastly increases power and efficiency
// We divide by the number of cores so a larger AME is less efficient at the same fuel settings
// this results in all AMEs having the same efficiency at the same fuel-per-core setting
return 20000f * fuel * fuel / cores;
// Balanced around a single core AME with injection level 2 producing 120KW.
// Overclocking yields diminishing returns until it evens out at around 360KW.

// The adjustment for cores make it so that a 1 core AME at 2 injections is better than a 2 core AME at 2 injections.
// However, for the relative amounts for each (1 core at 2 and 2 core at 4), more cores has more output.
return 200000f * MathF.Log10(fuel * fuel) * MathF.Pow(0.75f, cores - 1);
}

public int GetTotalStability()
Expand Down
20 changes: 15 additions & 5 deletions Content.Server/Ame/EntitySystems/AmeControllerSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,9 @@ public void SetInjectionAmount(EntityUid uid, int value, EntityUid? user = null,
At the time of editing, players regularly "overclock" the AME and those cases require no admin attention.

// Admin alert
var safeLimit = 0;
var safeLimit = int.MaxValue;
if (TryGetAMENodeGroup(uid, out var group))
safeLimit = group.CoreCount * 2;
safeLimit = group.CoreCount * 4;

if (oldValue <= safeLimit && value > safeLimit)
{
Expand All @@ -291,10 +291,20 @@ public void SetInjectionAmount(EntityUid uid, int value, EntityUid? user = null,
*/
}

public void AdjustInjectionAmount(EntityUid uid, int delta, int min = 0, int max = int.MaxValue, EntityUid? user = null, AmeControllerComponent? controller = null)
public void AdjustInjectionAmount(EntityUid uid, int delta, EntityUid? user = null, AmeControllerComponent? controller = null)
{
if (Resolve(uid, ref controller))
SetInjectionAmount(uid, MathHelper.Clamp(controller.InjectionAmount + delta, min, max), user, controller);
if (!Resolve(uid, ref controller))
return;

var max = GetMaxInjectionAmount((uid, controller));
SetInjectionAmount(uid, MathHelper.Clamp(controller.InjectionAmount + delta, 0, max), user, controller);
}

public int GetMaxInjectionAmount(Entity<AmeControllerComponent> ent)
{
if (!TryGetAMENodeGroup(ent, out var group))
return 0;
return group.CoreCount * 8;
}

private void UpdateDisplay(EntityUid uid, int stability, AmeControllerComponent? controller = null, AppearanceComponent? appearance = null)
Expand Down
Loading
Loading