* refactor: move puddle evaporation + absorbents to shared * refactor: move SolutionRegeneration to shared * refactor: make AbsorbentSystem visuals clientside * style: general formatting/cleanup on touched files - Few logical simplifications - Add field for hard-coded sparkle effect ent - Switch stuff to Entity<T> No actual prediction fixes in this commit (though in retrospect I should've done this commit last). * fix: use predicted variants for predicted code * fix: average out evaporation rates in mixtures * refactor: move SolutionPurge to shared * style: Basic SolutionPurgeComponent field cleanup * fix: general prediction + timing + networking fixes - Moves client side visuals back to shared because other players exist - Don't accumulate CurTime in Purge/RegenerationSystem - Network the next update field in Purge/RegenerationSystem to deal with UI mispredictions??? * fix: add udder bug workaround Not needed for SolutionPurgeSystem which doesn't resolve solutions (probably fine that SolutionPurgeSystem doesn't cache since it's much rarer, though it probably should), and likely not needed for AbsorbentSystem since it only resolves against puddles which, I don't think can be in containers. * fix: don't divide by zero for evaporation speed = 0. * refactor: revert evaporation changes Will cherry-pick these out in another PR. Also reverting the evaporation speed bugfix since it's easier to revert all at once. :) * fix: component cleanup; autopause fields, use ProtoID * fix: remove unused AbsorbentComponentState * fix: ProtoId is not string * refactor: move PuddleSystem.UpdateAppearance to shared * style: general PuddleSystem.UpdateAppearance tweaks - Switch to Entity<T> - Use ProtoIds - Minor simplifications * fix: add udderly silly PVS workaround * cleanup * fix --------- Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
60 lines
2.2 KiB
C#
60 lines
2.2 KiB
C#
using Content.Shared.Audio;
|
|
using Content.Shared.FixedPoint;
|
|
using Robust.Shared.Audio;
|
|
using Robust.Shared.GameStates;
|
|
using Robust.Shared.Prototypes;
|
|
|
|
namespace Content.Shared.Fluids;
|
|
|
|
/// <summary>
|
|
/// For entities that can clean up puddles
|
|
/// </summary>
|
|
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
|
|
public sealed partial class AbsorbentComponent : Component
|
|
{
|
|
/// <summary>
|
|
/// Used by the client to display a bar showing the reagents contained when held.
|
|
/// Has to still be networked in case the item is given to someone who didn't see a mop in PVS.
|
|
/// </summary>
|
|
[DataField, AutoNetworkedField]
|
|
public Dictionary<Color, float> Progress = [];
|
|
|
|
/// <summary>
|
|
/// Name for solution container, that should be used for absorbed solution storage and as source of absorber solution.
|
|
/// Default is 'absorbed'.
|
|
/// </summary>
|
|
[DataField]
|
|
public string SolutionName = "absorbed";
|
|
|
|
/// <summary>
|
|
/// How much solution we can transfer in one interaction.
|
|
/// </summary>
|
|
[DataField]
|
|
public FixedPoint2 PickupAmount = FixedPoint2.New(100);
|
|
|
|
/// <summary>
|
|
/// The effect spawned when the puddle fully evaporates.
|
|
/// </summary>
|
|
[DataField]
|
|
public EntProtoId MoppedEffect = "PuddleSparkle";
|
|
|
|
[DataField]
|
|
public SoundSpecifier PickupSound = new SoundPathSpecifier("/Audio/Effects/Fluids/watersplash.ogg",
|
|
AudioParams.Default.WithVariation(SharedContentAudioSystem.DefaultVariation));
|
|
|
|
[DataField]
|
|
public SoundSpecifier TransferSound = new SoundPathSpecifier("/Audio/Effects/Fluids/slosh.ogg",
|
|
AudioParams.Default.WithVariation(SharedContentAudioSystem.DefaultVariation).WithVolume(-3f));
|
|
|
|
public static readonly SoundSpecifier DefaultTransferSound =
|
|
new SoundPathSpecifier("/Audio/Effects/Fluids/slosh.ogg",
|
|
AudioParams.Default.WithVariation(SharedContentAudioSystem.DefaultVariation).WithVolume(-3f));
|
|
|
|
/// <summary>
|
|
/// Marker that absorbent component owner should try to use 'absorber solution' to replace solution to be absorbed.
|
|
/// Target solution will be simply consumed into container if set to false.
|
|
/// </summary>
|
|
[DataField]
|
|
public bool UseAbsorberSolution = true;
|
|
}
|