Merge remote-tracking branch 'upstream/stable' into ed-21-07-2025-upstream-sync

# Conflicts:
#	Content.Client/Overlays/StencilOverlay.Weather.cs
#	Content.IntegrationTests/Tests/Atmos/AlarmThresholdTest.cs
#	Content.IntegrationTests/Tests/VendingMachineRestockTest.cs
#	Content.Server/Chat/Systems/ChatSystem.cs
#	Content.Server/Fluids/EntitySystems/PuddleSystem.cs
#	Content.Shared/Damage/Systems/SharedStaminaSystem.cs
#	Content.Shared/Fluids/Components/EvaporationComponent.cs
#	Content.Shared/GameTicking/SharedGameTicker.cs
This commit is contained in:
Ed
2025-07-21 11:27:53 +03:00
1242 changed files with 21543 additions and 15530 deletions

View File

@@ -51,7 +51,6 @@ public sealed partial class PuddleSystem : SharedPuddleSystem
[Dependency] private readonly AudioSystem _audio = default!;
[Dependency] private readonly EntityLookupSystem _lookup = default!;
[Dependency] private readonly ReactiveSystem _reactive = default!;
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
[Dependency] private readonly SharedColorFlashEffectSystem _color = default!;
[Dependency] private readonly SharedPopupSystem _popups = default!;
[Dependency] private readonly SharedSolutionContainerSystem _solutionContainerSystem = default!;
@@ -61,17 +60,6 @@ public sealed partial class PuddleSystem : SharedPuddleSystem
[Dependency] private readonly SharedTransformSystem _transform = default!;
[Dependency] private readonly TurfSystem _turf = default!;
[ValidatePrototypeId<ReagentPrototype>]
private const string Blood = "Blood";
[ValidatePrototypeId<ReagentPrototype>]
private const string Slime = "Slime";
[ValidatePrototypeId<ReagentPrototype>]
private const string CopperBlood = "CopperBlood";
private static string[] _standoutReagents = [Blood, Slime, CopperBlood];
// Using local deletion queue instead of the standard queue so that we can easily "undelete" if a puddle
// loses & then gains reagents in a single tick.
private HashSet<EntityUid> _deletionQueue = [];
@@ -92,7 +80,6 @@ public sealed partial class PuddleSystem : SharedPuddleSystem
// Shouldn't need re-anchoring.
SubscribeLocalEvent<PuddleComponent, AnchorStateChangedEvent>(OnAnchorChanged);
SubscribeLocalEvent<PuddleComponent, SolutionContainerChangedEvent>(OnSolutionUpdate);
SubscribeLocalEvent<PuddleComponent, SpreadNeighborsEvent>(OnPuddleSpread);
SubscribeLocalEvent<PuddleComponent, SlipEvent>(OnPuddleSlip);
@@ -325,11 +312,13 @@ public sealed partial class PuddleSystem : SharedPuddleSystem
TickEvaporation();
}
private void OnSolutionUpdate(Entity<PuddleComponent> entity, ref SolutionContainerChangedEvent args)
protected override void OnSolutionUpdate(Entity<PuddleComponent> entity, ref SolutionContainerChangedEvent args)
{
if (args.SolutionId != entity.Comp.SolutionName)
return;
base.OnSolutionUpdate(entity, ref args);
if (args.Solution.Volume <= 0)
{
_deletionQueue.Add(entity);
@@ -340,46 +329,6 @@ public sealed partial class PuddleSystem : SharedPuddleSystem
UpdateSlip((entity, entity.Comp), args.Solution);
UpdateSlow(entity, args.Solution);
//UpdateEvaporation(entity, args.Solution); //CP14 Force evaporation under sky via YML
UpdateAppearance(entity, entity.Comp);
}
private void UpdateAppearance(EntityUid uid, PuddleComponent? puddleComponent = null,
AppearanceComponent? appearance = null)
{
if (!Resolve(uid, ref puddleComponent, ref appearance, false))
{
return;
}
var volume = FixedPoint2.Zero;
Color color = Color.White;
if (_solutionContainerSystem.ResolveSolution(uid, puddleComponent.SolutionName, ref puddleComponent.Solution,
out var solution))
{
volume = solution.Volume / puddleComponent.OverflowVolume;
// Make blood stand out more
// Kinda EH
// Could potentially do alpha per-solution but future problem.
color = solution.GetColorWithout(_prototypeManager, _standoutReagents);
color = color.WithAlpha(0.7f);
foreach (var standout in _standoutReagents)
{
var quantity = solution.GetTotalPrototypeQuantity(standout);
if (quantity <= FixedPoint2.Zero)
continue;
var interpolateValue = quantity.Float() / solution.Volume.Float();
color = Color.InterpolateBetween(color,
_prototypeManager.Index<ReagentPrototype>(standout).SubstanceColor, interpolateValue);
}
}
_appearance.SetData(uid, PuddleVisuals.CurrentVolume, volume.Float(), appearance);
_appearance.SetData(uid, PuddleVisuals.SolutionColor, color, appearance);
}
private void UpdateSlip(Entity<PuddleComponent> entity, Solution solution)
@@ -456,15 +405,15 @@ public sealed partial class PuddleSystem : SharedPuddleSystem
// A puddle with 10 units of lube vs a puddle with 10 of lube and 20 catchup should stun and launch forward the same amount.
if (slipperyUnits > 0)
{
slipComp.SlipData.LaunchForwardsMultiplier = (float)(launchMult/slipperyUnits);
slipComp.SlipData.ParalyzeTime = (stunTimer/(float)slipperyUnits);
slipComp.SlipData.LaunchForwardsMultiplier = (float)(launchMult / slipperyUnits);
slipComp.SlipData.ParalyzeTime = stunTimer / (float)slipperyUnits;
}
// Only make it super slippery if there is enough super slippery units for its own puddle
slipComp.SlipData.SuperSlippery = superSlipperyUnits >= smallPuddleThreshold;
// Lower tile friction based on how slippery it is, lets items slide across a puddle of lube
slipComp.SlipData.SlipFriction = (float)(puddleFriction/solution.Volume);
slipComp.SlipData.SlipFriction = (float)(puddleFriction / solution.Volume);
_tile.SetModifier(entity, slipComp.SlipData.SlipFriction);
Dirty(entity, slipComp);
@@ -754,20 +703,6 @@ public sealed partial class PuddleSystem : SharedPuddleSystem
#endregion
public void DoTileReactions(TileRef tileRef, Solution solution)
{
for (var i = solution.Contents.Count - 1; i >= 0; i--)
{
var (reagent, quantity) = solution.Contents[i];
var proto = _prototypeManager.Index<ReagentPrototype>(reagent.Prototype);
var removed = proto.ReactionTile(tileRef, quantity, EntityManager, reagent.Data);
if (removed <= FixedPoint2.Zero)
continue;
solution.RemoveReagent(reagent, removed);
}
}
/// <summary>
/// Tries to get the relevant puddle entity for a tile.
/// </summary>