Merge remote-tracking branch 'upstream/stable' into ed-30-04-2025-upstream-sync
# Conflicts: # Content.Client/Parallax/ParallaxControl.cs # Content.Client/UserInterface/Systems/Storage/Controls/ItemGridPiece.cs # Content.IntegrationTests/Tests/PostMapInitTest.cs # Content.Server/Chat/Managers/ChatManager.cs # Content.Server/Fluids/EntitySystems/PuddleSystem.Evaporation.cs # Content.Server/Labels/Label/LabelSystem.cs # Content.Shared/Actions/SharedActionsSystem.cs # Content.Shared/Fluids/Components/EvaporationComponent.cs # Content.Shared/Labels/EntitySystems/SharedLabelSystem.cs # README.md # Resources/Prototypes/Entities/Mobs/Player/admin_ghost.yml # Resources/Prototypes/Maps/Pools/deathmatch.yml # Resources/Prototypes/Maps/arenas.yml
This commit is contained in:
@@ -18,10 +18,10 @@ public sealed partial class EvaporationComponent : Component
|
||||
public TimeSpan NextTick = TimeSpan.Zero;
|
||||
|
||||
/// <summary>
|
||||
/// How much evaporation per second.
|
||||
/// Evaporation factor. Multiplied by the evaporating speed of the reagent.
|
||||
/// </summary>
|
||||
[DataField("evaporationAmount")]
|
||||
public FixedPoint2 EvaporationAmount = FixedPoint2.New(0.3);
|
||||
public FixedPoint2 EvaporationAmount = FixedPoint2.New(1);
|
||||
|
||||
/// <summary>
|
||||
/// forcibly vaporizes ALL the chemicals
|
||||
|
||||
@@ -19,6 +19,12 @@ namespace Content.Shared.Fluids.Components
|
||||
|
||||
[DataField("solution")] public string SolutionName = "puddle";
|
||||
|
||||
/// <summary>
|
||||
/// Default minimum speed someone must be moving to slip for all reagents.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public float DefaultSlippery = 5.5f;
|
||||
|
||||
[ViewVariables]
|
||||
public Entity<SolutionComponent>? Solution;
|
||||
}
|
||||
|
||||
@@ -1,17 +1,52 @@
|
||||
using Content.Shared.Chemistry.Components;
|
||||
using Content.Shared.Chemistry.Reagent;
|
||||
using Content.Shared.FixedPoint;
|
||||
|
||||
namespace Content.Shared.Fluids;
|
||||
|
||||
public abstract partial class SharedPuddleSystem
|
||||
{
|
||||
[ValidatePrototypeId<ReagentPrototype>]
|
||||
private const string Water = "Water";
|
||||
public string[] GetEvaporatingReagents(Solution solution)
|
||||
{
|
||||
var evaporatingReagents = new List<string>();
|
||||
foreach (ReagentPrototype solProto in solution.GetReagentPrototypes(_prototypeManager).Keys)
|
||||
{
|
||||
if (solProto.EvaporationSpeed > FixedPoint2.Zero)
|
||||
evaporatingReagents.Add(solProto.ID);
|
||||
}
|
||||
return evaporatingReagents.ToArray();
|
||||
}
|
||||
|
||||
public static readonly string[] EvaporationReagents = [Water];
|
||||
public string[] GetAbsorbentReagents(Solution solution)
|
||||
{
|
||||
var absorbentReagents = new List<string>();
|
||||
foreach (ReagentPrototype solProto in solution.GetReagentPrototypes(_prototypeManager).Keys)
|
||||
{
|
||||
if (solProto.Absorbent)
|
||||
absorbentReagents.Add(solProto.ID);
|
||||
}
|
||||
return absorbentReagents.ToArray();
|
||||
}
|
||||
|
||||
public bool CanFullyEvaporate(Solution solution)
|
||||
{
|
||||
return solution.GetTotalPrototypeQuantity(EvaporationReagents) == solution.Volume;
|
||||
return solution.GetTotalPrototypeQuantity(GetEvaporatingReagents(solution)) == solution.Volume;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the evaporating speed of the reagents within a solution.
|
||||
/// The speed at which a solution evaporates is the sum of the speed of all evaporating reagents in it.
|
||||
/// </summary>
|
||||
public Dictionary<string, FixedPoint2> GetEvaporationSpeeds(Solution solution)
|
||||
{
|
||||
var evaporatingSpeeds = new Dictionary<string, FixedPoint2>();
|
||||
foreach (ReagentPrototype solProto in solution.GetReagentPrototypes(_prototypeManager).Keys)
|
||||
{
|
||||
if (solProto.EvaporationSpeed > FixedPoint2.Zero)
|
||||
{
|
||||
evaporatingSpeeds.Add(solProto.ID, solProto.EvaporationSpeed);
|
||||
}
|
||||
}
|
||||
return evaporatingSpeeds;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ public abstract partial class SharedPuddleSystem : EntitySystem
|
||||
{
|
||||
if (CanFullyEvaporate(solution))
|
||||
args.PushMarkup(Loc.GetString("puddle-component-examine-evaporating"));
|
||||
else if (solution.GetTotalPrototypeQuantity(EvaporationReagents) > FixedPoint2.Zero)
|
||||
else if (solution.GetTotalPrototypeQuantity(GetEvaporatingReagents(solution)) > FixedPoint2.Zero)
|
||||
args.PushMarkup(Loc.GetString("puddle-component-examine-evaporating-partial"));
|
||||
else
|
||||
args.PushMarkup(Loc.GetString("puddle-component-examine-evaporating-no"));
|
||||
|
||||
Reference in New Issue
Block a user