Remove ILand (#4582)
* Remove ILand * Make land not handleable * Rename ILand
This commit is contained in:
@@ -12,15 +12,12 @@ using Content.Shared.Interaction.Helpers;
|
||||
using Content.Shared.Notification.Managers;
|
||||
using Content.Shared.Nutrition.Components;
|
||||
using Content.Shared.Sound;
|
||||
using Content.Shared.Throwing;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Localization;
|
||||
using Robust.Shared.Player;
|
||||
using Robust.Shared.Random;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
using Robust.Shared.Utility;
|
||||
using Robust.Shared.ViewVariables;
|
||||
@@ -28,10 +25,8 @@ using Robust.Shared.ViewVariables;
|
||||
namespace Content.Server.Nutrition.Components
|
||||
{
|
||||
[RegisterComponent]
|
||||
public class DrinkComponent : Component, IUse, IAfterInteract, IExamine, ILand
|
||||
public class DrinkComponent : Component, IUse, IAfterInteract, IExamine
|
||||
{
|
||||
[Dependency] private readonly IRobustRandom _random = default!;
|
||||
|
||||
[DataField("solution")]
|
||||
public string SolutionName { get; set; } = DefaultSolutionName;
|
||||
public const string DefaultSolutionName = "drink";
|
||||
@@ -81,10 +76,10 @@ namespace Content.Server.Nutrition.Components
|
||||
|
||||
[DataField("openSounds")]
|
||||
private SoundSpecifier _openSounds = new SoundCollectionSpecifier("canOpenSounds");
|
||||
[DataField("pressurized")]
|
||||
private bool _pressurized = default;
|
||||
[DataField("burstSound")]
|
||||
private SoundSpecifier _burstSound = new SoundPathSpecifier("/Audio/Effects/flash_bang.ogg");
|
||||
|
||||
[DataField("pressurized")] public bool Pressurized;
|
||||
|
||||
[DataField("burstSound")] public SoundSpecifier BurstSound = new SoundPathSpecifier("/Audio/Effects/flash_bang.ogg");
|
||||
|
||||
private void OpenedChanged()
|
||||
{
|
||||
@@ -233,22 +228,5 @@ namespace Content.Server.Nutrition.Components
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void ILand.Land(LandEventArgs eventArgs)
|
||||
{
|
||||
if (_pressurized &&
|
||||
!Opened &&
|
||||
_random.Prob(0.25f) &&
|
||||
EntitySystem.Get<SolutionContainerSystem>().TryGetDrainableSolution(Owner.Uid, out var interactions))
|
||||
{
|
||||
Opened = true;
|
||||
|
||||
var solution = EntitySystem.Get<SolutionContainerSystem>()
|
||||
.Drain(Owner.Uid, interactions, interactions.DrainAvailable);
|
||||
solution.SpillAt(Owner, "PuddleSmear");
|
||||
|
||||
SoundSystem.Play(Filter.Pvs(Owner), _burstSound.GetSound(), Owner, AudioParams.Default.WithVolume(-4));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user