Merge branch 'master' into DecimalReagents
80
Content.Client/Command/CommunicationsConsoleMenu.cs
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
using System.Threading;
|
||||||
|
using Content.Client.GameObjects.Components.Command;
|
||||||
|
using Robust.Client.UserInterface;
|
||||||
|
using Robust.Client.UserInterface.Controls;
|
||||||
|
using Robust.Client.UserInterface.CustomControls;
|
||||||
|
using Robust.Shared.IoC;
|
||||||
|
using Robust.Shared.Localization;
|
||||||
|
using Robust.Shared.Log;
|
||||||
|
using Robust.Shared.Maths;
|
||||||
|
using Timer = Robust.Shared.Timers.Timer;
|
||||||
|
|
||||||
|
namespace Content.Client.Command
|
||||||
|
{
|
||||||
|
public class CommunicationsConsoleMenu : SS14Window
|
||||||
|
{
|
||||||
|
#pragma warning disable 649
|
||||||
|
[Dependency] private readonly ILocalizationManager _localizationManager;
|
||||||
|
#pragma warning restore 649
|
||||||
|
|
||||||
|
protected override Vector2? CustomSize => new Vector2(600, 400);
|
||||||
|
|
||||||
|
private CommunicationsConsoleBoundUserInterface Owner { get; set; }
|
||||||
|
private readonly CancellationTokenSource _timerCancelTokenSource = new CancellationTokenSource();
|
||||||
|
private readonly Button _emergencyShuttleButton;
|
||||||
|
private readonly RichTextLabel _countdownLabel;
|
||||||
|
|
||||||
|
public CommunicationsConsoleMenu(CommunicationsConsoleBoundUserInterface owner)
|
||||||
|
{
|
||||||
|
IoCManager.InjectDependencies(this);
|
||||||
|
|
||||||
|
Title = _localizationManager.GetString("Communications Console");
|
||||||
|
Owner = owner;
|
||||||
|
|
||||||
|
_countdownLabel = new RichTextLabel(){CustomMinimumSize = new Vector2(0, 200)};
|
||||||
|
_emergencyShuttleButton = new Button();
|
||||||
|
_emergencyShuttleButton.OnPressed += (e) => Owner.EmergencyShuttleButtonPressed();
|
||||||
|
|
||||||
|
var vbox = new VBoxContainer() {SizeFlagsHorizontal = SizeFlags.FillExpand, SizeFlagsVertical = SizeFlags.FillExpand};
|
||||||
|
|
||||||
|
vbox.AddChild(_countdownLabel);
|
||||||
|
vbox.AddChild(_emergencyShuttleButton);
|
||||||
|
|
||||||
|
var hbox = new HBoxContainer() {SizeFlagsHorizontal = SizeFlags.FillExpand, SizeFlagsVertical = SizeFlags.FillExpand};
|
||||||
|
hbox.AddChild(new Control(){CustomMinimumSize = new Vector2(100,0), SizeFlagsHorizontal = SizeFlags.FillExpand});
|
||||||
|
hbox.AddChild(vbox);
|
||||||
|
hbox.AddChild(new Control(){CustomMinimumSize = new Vector2(100,0), SizeFlagsHorizontal = SizeFlags.FillExpand});
|
||||||
|
|
||||||
|
Contents.AddChild(hbox);
|
||||||
|
|
||||||
|
UpdateCountdown();
|
||||||
|
Timer.SpawnRepeating(1000, UpdateCountdown, _timerCancelTokenSource.Token);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UpdateCountdown()
|
||||||
|
{
|
||||||
|
if (!Owner.CountdownStarted)
|
||||||
|
{
|
||||||
|
_countdownLabel.SetMessage("");
|
||||||
|
_emergencyShuttleButton.Text = _localizationManager.GetString("Call emergency shuttle");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_emergencyShuttleButton.Text = _localizationManager.GetString("Recall emergency shuttle");
|
||||||
|
_countdownLabel.SetMessage($"Time remaining\n{Owner.Countdown.ToString()}s");
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Close()
|
||||||
|
{
|
||||||
|
base.Close();
|
||||||
|
|
||||||
|
_timerCancelTokenSource.Cancel();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if(disposing)
|
||||||
|
_timerCancelTokenSource.Cancel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -134,6 +134,7 @@ namespace Content.Client
|
|||||||
"Paper",
|
"Paper",
|
||||||
"Write",
|
"Write",
|
||||||
"Bloodstream",
|
"Bloodstream",
|
||||||
|
"TransformableContainer",
|
||||||
"Mind",
|
"Mind",
|
||||||
"MovementSpeedModifier",
|
"MovementSpeedModifier",
|
||||||
"StorageFill"
|
"StorageFill"
|
||||||
@@ -148,7 +149,7 @@ namespace Content.Client
|
|||||||
factory.Register<SharedLatheComponent>();
|
factory.Register<SharedLatheComponent>();
|
||||||
factory.Register<SharedSpawnPointComponent>();
|
factory.Register<SharedSpawnPointComponent>();
|
||||||
|
|
||||||
factory.Register<SolutionComponent>();
|
factory.Register<SharedSolutionComponent>();
|
||||||
|
|
||||||
factory.Register<SharedVendingMachineComponent>();
|
factory.Register<SharedVendingMachineComponent>();
|
||||||
factory.Register<SharedWiresComponent>();
|
factory.Register<SharedWiresComponent>();
|
||||||
|
|||||||
@@ -0,0 +1,83 @@
|
|||||||
|
using System;
|
||||||
|
using Content.Client.Command;
|
||||||
|
using Content.Shared.GameObjects.Components.Command;
|
||||||
|
using Robust.Client.GameObjects.Components.UserInterface;
|
||||||
|
using Robust.Shared.GameObjects.Components.UserInterface;
|
||||||
|
using Robust.Shared.Interfaces.Timing;
|
||||||
|
using Robust.Shared.IoC;
|
||||||
|
using Robust.Shared.ViewVariables;
|
||||||
|
|
||||||
|
namespace Content.Client.GameObjects.Components.Command
|
||||||
|
{
|
||||||
|
public class CommunicationsConsoleBoundUserInterface : BoundUserInterface
|
||||||
|
{
|
||||||
|
[ViewVariables]
|
||||||
|
private CommunicationsConsoleMenu _menu;
|
||||||
|
|
||||||
|
[Dependency] private IGameTiming _gameTiming;
|
||||||
|
|
||||||
|
public bool CountdownStarted { get; private set; }
|
||||||
|
|
||||||
|
public int Countdown => _expectedCountdownTime == null
|
||||||
|
? 0 : Math.Max((int)_expectedCountdownTime.Value.Subtract(_gameTiming.CurTime).TotalSeconds, 0);
|
||||||
|
private TimeSpan? _expectedCountdownTime;
|
||||||
|
|
||||||
|
public CommunicationsConsoleBoundUserInterface(ClientUserInterfaceComponent owner, object uiKey) : base(owner, uiKey)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Open()
|
||||||
|
{
|
||||||
|
base.Open();
|
||||||
|
|
||||||
|
_menu = new CommunicationsConsoleMenu(this);
|
||||||
|
|
||||||
|
_menu.OnClose += Close;
|
||||||
|
|
||||||
|
_menu.OpenCentered();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void EmergencyShuttleButtonPressed()
|
||||||
|
{
|
||||||
|
if(CountdownStarted)
|
||||||
|
RecallShuttle();
|
||||||
|
else
|
||||||
|
CallShuttle();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void CallShuttle()
|
||||||
|
{
|
||||||
|
SendMessage(new CommunicationsConsoleCallEmergencyShuttleMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RecallShuttle()
|
||||||
|
{
|
||||||
|
SendMessage(new CommunicationsConsoleRecallEmergencyShuttleMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void ReceiveMessage(BoundUserInterfaceMessage message)
|
||||||
|
{
|
||||||
|
switch (message)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void UpdateState(BoundUserInterfaceState state)
|
||||||
|
{
|
||||||
|
if (!(state is CommunicationsConsoleInterfaceState commsState))
|
||||||
|
return;
|
||||||
|
|
||||||
|
_expectedCountdownTime = commsState.ExpectedCountdownEnd;
|
||||||
|
CountdownStarted = commsState.CountdownStarted;
|
||||||
|
_menu?.UpdateCountdown();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
base.Dispose(disposing);
|
||||||
|
if (!disposing) return;
|
||||||
|
_menu?.Dispose();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -17,9 +17,9 @@ namespace Content.Client.GameObjects.Components.Research
|
|||||||
private IPrototypeManager _prototypeManager;
|
private IPrototypeManager _prototypeManager;
|
||||||
#pragma warning restore
|
#pragma warning restore
|
||||||
[ViewVariables]
|
[ViewVariables]
|
||||||
private LatheMenu menu;
|
private LatheMenu _menu;
|
||||||
[ViewVariables]
|
[ViewVariables]
|
||||||
private LatheQueueMenu queueMenu;
|
private LatheQueueMenu _queueMenu;
|
||||||
|
|
||||||
public MaterialStorageComponent Storage { get; private set; }
|
public MaterialStorageComponent Storage { get; private set; }
|
||||||
public SharedLatheComponent Lathe { get; private set; }
|
public SharedLatheComponent Lathe { get; private set; }
|
||||||
@@ -48,30 +48,30 @@ namespace Content.Client.GameObjects.Components.Research
|
|||||||
Lathe = lathe;
|
Lathe = lathe;
|
||||||
Database = database;
|
Database = database;
|
||||||
|
|
||||||
menu = new LatheMenu(this);
|
_menu = new LatheMenu(this);
|
||||||
queueMenu = new LatheQueueMenu { Owner = this };
|
_queueMenu = new LatheQueueMenu { Owner = this };
|
||||||
|
|
||||||
menu.OnClose += Close;
|
_menu.OnClose += Close;
|
||||||
|
|
||||||
menu.Populate();
|
_menu.Populate();
|
||||||
menu.PopulateMaterials();
|
_menu.PopulateMaterials();
|
||||||
|
|
||||||
menu.QueueButton.OnPressed += (args) => { queueMenu.OpenCentered(); };
|
_menu.QueueButton.OnPressed += (args) => { _queueMenu.OpenCentered(); };
|
||||||
|
|
||||||
menu.ServerConnectButton.OnPressed += (args) =>
|
_menu.ServerConnectButton.OnPressed += (args) =>
|
||||||
{
|
{
|
||||||
SendMessage(new SharedLatheComponent.LatheServerSelectionMessage());
|
SendMessage(new SharedLatheComponent.LatheServerSelectionMessage());
|
||||||
};
|
};
|
||||||
|
|
||||||
menu.ServerSyncButton.OnPressed += (args) =>
|
_menu.ServerSyncButton.OnPressed += (args) =>
|
||||||
{
|
{
|
||||||
SendMessage(new SharedLatheComponent.LatheServerSyncMessage());
|
SendMessage(new SharedLatheComponent.LatheServerSyncMessage());
|
||||||
};
|
};
|
||||||
|
|
||||||
storage.OnMaterialStorageChanged += menu.PopulateDisabled;
|
storage.OnMaterialStorageChanged += _menu.PopulateDisabled;
|
||||||
storage.OnMaterialStorageChanged += menu.PopulateMaterials;
|
storage.OnMaterialStorageChanged += _menu.PopulateMaterials;
|
||||||
|
|
||||||
menu.OpenCentered();
|
_menu.OpenCentered();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Queue(LatheRecipePrototype recipe, int quantity = 1)
|
public void Queue(LatheRecipePrototype recipe, int quantity = 1)
|
||||||
@@ -85,10 +85,10 @@ namespace Content.Client.GameObjects.Components.Research
|
|||||||
{
|
{
|
||||||
case SharedLatheComponent.LatheProducingRecipeMessage msg:
|
case SharedLatheComponent.LatheProducingRecipeMessage msg:
|
||||||
if (!_prototypeManager.TryIndex(msg.ID, out LatheRecipePrototype recipe)) break;
|
if (!_prototypeManager.TryIndex(msg.ID, out LatheRecipePrototype recipe)) break;
|
||||||
queueMenu?.SetInfo(recipe);
|
_queueMenu?.SetInfo(recipe);
|
||||||
break;
|
break;
|
||||||
case SharedLatheComponent.LatheStoppedProducingRecipeMessage _:
|
case SharedLatheComponent.LatheStoppedProducingRecipeMessage _:
|
||||||
queueMenu?.ClearInfo();
|
_queueMenu?.ClearInfo();
|
||||||
break;
|
break;
|
||||||
case SharedLatheComponent.LatheFullQueueMessage msg:
|
case SharedLatheComponent.LatheFullQueueMessage msg:
|
||||||
_queuedRecipes.Clear();
|
_queuedRecipes.Clear();
|
||||||
@@ -97,7 +97,7 @@ namespace Content.Client.GameObjects.Components.Research
|
|||||||
if (!_prototypeManager.TryIndex(id, out LatheRecipePrototype recipePrototype)) break;
|
if (!_prototypeManager.TryIndex(id, out LatheRecipePrototype recipePrototype)) break;
|
||||||
_queuedRecipes.Enqueue(recipePrototype);
|
_queuedRecipes.Enqueue(recipePrototype);
|
||||||
}
|
}
|
||||||
queueMenu?.PopulateList();
|
_queueMenu?.PopulateList();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -106,8 +106,8 @@ namespace Content.Client.GameObjects.Components.Research
|
|||||||
{
|
{
|
||||||
base.Dispose(disposing);
|
base.Dispose(disposing);
|
||||||
if (!disposing) return;
|
if (!disposing) return;
|
||||||
menu?.Dispose();
|
_menu?.Dispose();
|
||||||
queueMenu?.Dispose();
|
_queueMenu?.Dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,19 +65,11 @@ namespace Content.Server.GameObjects.Components.Chemistry
|
|||||||
serializer.DataField(ref _initialMaxVolume, "initialMaxVolume", ReagentUnit.New(15));
|
serializer.DataField(ref _initialMaxVolume, "initialMaxVolume", ReagentUnit.New(15));
|
||||||
serializer.DataField(ref _transferAmount, "transferAmount", ReagentUnit.New(5));
|
serializer.DataField(ref _transferAmount, "transferAmount", ReagentUnit.New(5));
|
||||||
}
|
}
|
||||||
|
protected override void Startup()
|
||||||
public override void Initialize()
|
|
||||||
{
|
{
|
||||||
base.Initialize();
|
base.Startup();
|
||||||
|
_internalContents = Owner.GetComponent<SolutionComponent>();
|
||||||
//Create and setup internal storage
|
|
||||||
_internalContents = new SolutionComponent();
|
|
||||||
_internalContents.InitializeFromPrototype();
|
|
||||||
_internalContents.Init();
|
|
||||||
_internalContents.MaxVolume = _initialMaxVolume;
|
|
||||||
_internalContents.Owner = Owner; //Manually set owner to avoid crash when VV'ing this
|
|
||||||
_internalContents.Capabilities |= SolutionCaps.Injector;
|
_internalContents.Capabilities |= SolutionCaps.Injector;
|
||||||
|
|
||||||
//Set _toggleState based on prototype
|
//Set _toggleState based on prototype
|
||||||
_toggleState = _injectOnly ? InjectorToggleMode.Inject : InjectorToggleMode.Draw;
|
_toggleState = _injectOnly ? InjectorToggleMode.Inject : InjectorToggleMode.Draw;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ namespace Content.Server.GameObjects.Components.Chemistry
|
|||||||
[RegisterComponent]
|
[RegisterComponent]
|
||||||
[ComponentReference(typeof(IActivate))]
|
[ComponentReference(typeof(IActivate))]
|
||||||
[ComponentReference(typeof(IAttackBy))]
|
[ComponentReference(typeof(IAttackBy))]
|
||||||
public class ReagentDispenserComponent : SharedReagentDispenserComponent, IActivate, IAttackBy
|
public class ReagentDispenserComponent : SharedReagentDispenserComponent, IActivate, IAttackBy, ISolutionChange
|
||||||
{
|
{
|
||||||
#pragma warning disable 649
|
#pragma warning disable 649
|
||||||
[Dependency] private readonly IServerNotifyManager _notifyManager;
|
[Dependency] private readonly IServerNotifyManager _notifyManager;
|
||||||
@@ -207,7 +207,6 @@ namespace Content.Server.GameObjects.Components.Chemistry
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
var beaker = _beakerContainer.ContainedEntity;
|
var beaker = _beakerContainer.ContainedEntity;
|
||||||
Solution.SolutionChanged -= HandleSolutionChangedEvent;
|
|
||||||
_beakerContainer.Remove(_beakerContainer.ContainedEntity);
|
_beakerContainer.Remove(_beakerContainer.ContainedEntity);
|
||||||
UpdateUserInterface();
|
UpdateUserInterface();
|
||||||
|
|
||||||
@@ -304,7 +303,6 @@ namespace Content.Server.GameObjects.Components.Chemistry
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
_beakerContainer.Insert(activeHandEntity);
|
_beakerContainer.Insert(activeHandEntity);
|
||||||
Solution.SolutionChanged += HandleSolutionChangedEvent;
|
|
||||||
UpdateUserInterface();
|
UpdateUserInterface();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -317,10 +315,7 @@ namespace Content.Server.GameObjects.Components.Chemistry
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void HandleSolutionChangedEvent()
|
void ISolutionChange.SolutionChanged(SolutionChangeEventArgs eventArgs) => UpdateUserInterface();
|
||||||
{
|
|
||||||
UpdateUserInterface();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ClickSound()
|
private void ClickSound()
|
||||||
{
|
{
|
||||||
@@ -329,5 +324,7 @@ namespace Content.Server.GameObjects.Components.Chemistry
|
|||||||
sound.Play("/Audio/machines/machine_switch.ogg", AudioParams.Default.WithVolume(-2f));
|
sound.Play("/Audio/machines/machine_switch.ogg", AudioParams.Default.WithVolume(-2f));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,25 +1,37 @@
|
|||||||
using Content.Server.Chemistry;
|
using Content.Server.Chemistry;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel.Design;
|
||||||
|
using System.Linq;
|
||||||
|
using Content.Server.Chemistry;
|
||||||
|
using Content.Shared.GameObjects.Components.Chemistry;
|
||||||
|
using Content.Server.GameObjects.Components.Nutrition;
|
||||||
using Content.Server.GameObjects.EntitySystems;
|
using Content.Server.GameObjects.EntitySystems;
|
||||||
using Content.Shared.Chemistry;
|
using Content.Shared.Chemistry;
|
||||||
using Content.Shared.GameObjects;
|
using Content.Shared.GameObjects;
|
||||||
using Content.Shared.Interfaces.Chemistry;
|
using Content.Shared.Interfaces.Chemistry;
|
||||||
|
using Content.Shared.Utility;
|
||||||
|
using Robust.Server.GameObjects;
|
||||||
using Robust.Server.GameObjects.EntitySystems;
|
using Robust.Server.GameObjects.EntitySystems;
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
using Robust.Shared.Interfaces.GameObjects;
|
using Robust.Shared.Interfaces.GameObjects;
|
||||||
using Robust.Shared.IoC;
|
using Robust.Shared.IoC;
|
||||||
using Robust.Shared.Localization;
|
using Robust.Shared.Localization;
|
||||||
|
using Robust.Shared.Maths;
|
||||||
using Robust.Shared.Prototypes;
|
using Robust.Shared.Prototypes;
|
||||||
|
using Robust.Shared.Serialization;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using Robust.Shared.ViewVariables;
|
||||||
|
|
||||||
namespace Content.Server.GameObjects.Components.Chemistry
|
namespace Content.Server.GameObjects.Components.Chemistry
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Shared ECS component that manages a liquid solution of reagents.
|
/// ECS component that manages a liquid solution of reagents.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[RegisterComponent]
|
[RegisterComponent]
|
||||||
internal class SolutionComponent : Shared.GameObjects.Components.Chemistry.SolutionComponent, IExamine
|
internal class SolutionComponent : SharedSolutionComponent, IExamine
|
||||||
{
|
{
|
||||||
#pragma warning disable 649
|
#pragma warning disable 649
|
||||||
[Dependency] private readonly IPrototypeManager _prototypeManager;
|
[Dependency] private readonly IPrototypeManager _prototypeManager;
|
||||||
@@ -29,27 +41,178 @@ namespace Content.Server.GameObjects.Components.Chemistry
|
|||||||
|
|
||||||
private IEnumerable<ReactionPrototype> _reactions;
|
private IEnumerable<ReactionPrototype> _reactions;
|
||||||
private AudioSystem _audioSystem;
|
private AudioSystem _audioSystem;
|
||||||
|
private ChemistrySystem _chemistrySystem;
|
||||||
|
|
||||||
|
private SpriteComponent _spriteComponent;
|
||||||
|
|
||||||
|
private Solution _containedSolution = new Solution();
|
||||||
|
private int _maxVolume;
|
||||||
|
private SolutionCaps _capabilities;
|
||||||
|
private string _fillInitState;
|
||||||
|
private int _fillInitSteps;
|
||||||
|
private string _fillPathString = "Objects/Chemistry/fillings.rsi";
|
||||||
|
private ResourcePath _fillPath;
|
||||||
|
private SpriteSpecifier _fillSprite;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The maximum volume of the container.
|
||||||
|
/// </summary>
|
||||||
|
[ViewVariables(VVAccess.ReadWrite)]
|
||||||
|
public int MaxVolume
|
||||||
|
{
|
||||||
|
get => _maxVolume;
|
||||||
|
set => _maxVolume = value; // Note that the contents won't spill out if the capacity is reduced.
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The total volume of all the of the reagents in the container.
|
||||||
|
/// </summary>
|
||||||
|
[ViewVariables]
|
||||||
|
public int CurrentVolume => _containedSolution.TotalVolume;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The volume without reagents remaining in the container.
|
||||||
|
/// </summary>
|
||||||
|
[ViewVariables]
|
||||||
|
public int EmptyVolume => MaxVolume - CurrentVolume;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The current blended color of all the reagents in the container.
|
||||||
|
/// </summary>
|
||||||
|
[ViewVariables(VVAccess.ReadWrite)]
|
||||||
|
public Color SubstanceColor { get; private set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The current capabilities of this container (is the top open to pour? can I inject it into another object?).
|
||||||
|
/// </summary>
|
||||||
|
[ViewVariables(VVAccess.ReadWrite)]
|
||||||
|
public SolutionCaps Capabilities
|
||||||
|
{
|
||||||
|
get => _capabilities;
|
||||||
|
set => _capabilities = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
[ViewVariables]
|
||||||
|
public Solution Solution
|
||||||
|
{
|
||||||
|
get => _containedSolution;
|
||||||
|
set => _containedSolution = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public IReadOnlyList<Solution.ReagentQuantity> ReagentList => _containedSolution.Contents;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Shortcut for Capabilities PourIn flag to avoid binary operators.
|
||||||
|
/// </summary>
|
||||||
|
public bool CanPourIn => (Capabilities & SolutionCaps.PourIn) != 0;
|
||||||
|
/// <summary>
|
||||||
|
/// Shortcut for Capabilities PourOut flag to avoid binary operators.
|
||||||
|
/// </summary>
|
||||||
|
public bool CanPourOut => (Capabilities & SolutionCaps.PourOut) != 0;
|
||||||
|
/// <summary>
|
||||||
|
/// Shortcut for Capabilities Injectable flag
|
||||||
|
/// </summary>
|
||||||
|
public bool Injectable => (Capabilities & SolutionCaps.Injectable) != 0;
|
||||||
|
/// <summary>
|
||||||
|
/// Shortcut for Capabilities Injector flag
|
||||||
|
/// </summary>
|
||||||
|
public bool Injector => (Capabilities & SolutionCaps.Injector) != 0;
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override void ExposeData(ObjectSerializer serializer)
|
||||||
|
{
|
||||||
|
base.ExposeData(serializer);
|
||||||
|
|
||||||
|
serializer.DataField(ref _maxVolume, "maxVol", 0);
|
||||||
|
serializer.DataField(ref _containedSolution, "contents", _containedSolution);
|
||||||
|
serializer.DataField(ref _capabilities, "caps", SolutionCaps.None);
|
||||||
|
serializer.DataField(ref _fillInitState, "fillingState", "");
|
||||||
|
serializer.DataField(ref _fillInitSteps, "fillingSteps", 7);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Initialize()
|
||||||
|
{
|
||||||
|
base.Initialize();
|
||||||
|
_audioSystem = _entitySystemManager.GetEntitySystem<AudioSystem>();
|
||||||
|
_chemistrySystem = _entitySystemManager.GetEntitySystem<ChemistrySystem>();
|
||||||
|
_reactions = _prototypeManager.EnumeratePrototypes<ReactionPrototype>();
|
||||||
|
}
|
||||||
|
|
||||||
protected override void Startup()
|
protected override void Startup()
|
||||||
{
|
{
|
||||||
base.Startup();
|
base.Startup();
|
||||||
Init();
|
RecalculateColor();
|
||||||
|
if (!string.IsNullOrEmpty(_fillInitState))
|
||||||
|
{
|
||||||
|
_spriteComponent = Owner.GetComponent<SpriteComponent>();
|
||||||
|
_fillPath = new ResourcePath(_fillPathString);
|
||||||
|
_fillSprite = new SpriteSpecifier.Rsi(_fillPath, _fillInitState + (_fillInitSteps - 1));
|
||||||
|
_spriteComponent.AddLayerWithSprite(_fillSprite);
|
||||||
|
UpdateFillIcon();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Init()
|
public void RemoveAllSolution()
|
||||||
{
|
{
|
||||||
_reactions = _prototypeManager.EnumeratePrototypes<ReactionPrototype>();
|
_containedSolution.RemoveAllSolution();
|
||||||
_audioSystem = _entitySystemManager.GetEntitySystem<AudioSystem>();
|
OnSolutionChanged(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool TryRemoveReagent(string reagentId, int quantity)
|
||||||
|
{
|
||||||
|
if (!ContainsReagent(reagentId, out var currentQuantity)) return false;
|
||||||
|
|
||||||
|
_containedSolution.RemoveReagent(reagentId, quantity);
|
||||||
|
OnSolutionChanged(false);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes the SolutionComponent if it doesn't have an owner
|
/// Attempt to remove the specified quantity from this solution
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void InitializeFromPrototype()
|
/// <param name="quantity">Quantity of this solution to remove</param>
|
||||||
|
/// <returns>Whether or not the solution was successfully removed</returns>
|
||||||
|
public bool TryRemoveSolution(int quantity)
|
||||||
{
|
{
|
||||||
// Because Initialize needs an Owner, Startup isn't called, etc.
|
if (CurrentVolume == 0)
|
||||||
IoCManager.InjectDependencies(this);
|
return false;
|
||||||
_reactions = _prototypeManager.EnumeratePrototypes<ReactionPrototype>();
|
|
||||||
|
_containedSolution.RemoveSolution(quantity);
|
||||||
|
OnSolutionChanged(false);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Solution SplitSolution(int quantity)
|
||||||
|
{
|
||||||
|
var solutionSplit = _containedSolution.SplitSolution(quantity);
|
||||||
|
OnSolutionChanged(false);
|
||||||
|
return solutionSplit;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void RecalculateColor()
|
||||||
|
{
|
||||||
|
if (_containedSolution.TotalVolume == 0)
|
||||||
|
{
|
||||||
|
SubstanceColor = Color.Transparent;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Color mixColor = default;
|
||||||
|
float runningTotalQuantity = 0;
|
||||||
|
|
||||||
|
foreach (var reagent in _containedSolution)
|
||||||
|
{
|
||||||
|
runningTotalQuantity += reagent.Quantity;
|
||||||
|
|
||||||
|
if(!_prototypeManager.TryIndex(reagent.ReagentId, out ReagentPrototype proto))
|
||||||
|
continue;
|
||||||
|
if (mixColor == default)
|
||||||
|
mixColor = proto.SubstanceColor;
|
||||||
|
mixColor = Color.InterpolateBetween(mixColor, proto.SubstanceColor,
|
||||||
|
(1 / runningTotalQuantity) * reagent.Quantity);
|
||||||
|
}
|
||||||
|
|
||||||
|
SubstanceColor = mixColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -118,6 +281,10 @@ namespace Content.Server.GameObjects.Components.Chemistry
|
|||||||
void IExamine.Examine(FormattedMessage message)
|
void IExamine.Examine(FormattedMessage message)
|
||||||
{
|
{
|
||||||
message.AddText(_loc.GetString("Contains:\n"));
|
message.AddText(_loc.GetString("Contains:\n"));
|
||||||
|
if (ReagentList.Count == 0)
|
||||||
|
{
|
||||||
|
message.AddText("Nothing.\n");
|
||||||
|
}
|
||||||
foreach (var reagent in ReagentList)
|
foreach (var reagent in ReagentList)
|
||||||
{
|
{
|
||||||
if (_prototypeManager.TryIndex(reagent.ReagentId, out ReagentPrototype proto))
|
if (_prototypeManager.TryIndex(reagent.ReagentId, out ReagentPrototype proto))
|
||||||
@@ -239,7 +406,7 @@ namespace Content.Server.GameObjects.Components.Chemistry
|
|||||||
}
|
}
|
||||||
if(!skipReactionCheck)
|
if(!skipReactionCheck)
|
||||||
CheckForReaction();
|
CheckForReaction();
|
||||||
OnSolutionChanged();
|
OnSolutionChanged(skipColor);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -254,7 +421,7 @@ namespace Content.Server.GameObjects.Components.Chemistry
|
|||||||
}
|
}
|
||||||
if(!skipReactionCheck)
|
if(!skipReactionCheck)
|
||||||
CheckForReaction();
|
CheckForReaction();
|
||||||
OnSolutionChanged();
|
OnSolutionChanged(skipColor);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -322,5 +489,63 @@ namespace Content.Server.GameObjects.Components.Chemistry
|
|||||||
//Play reaction sound client-side
|
//Play reaction sound client-side
|
||||||
_audioSystem.Play("/Audio/effects/chemistry/bubbles.ogg", Owner.Transform.GridPosition);
|
_audioSystem.Play("/Audio/effects/chemistry/bubbles.ogg", Owner.Transform.GridPosition);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Check if the solution contains the specified reagent.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="reagentId">The reagent to check for.</param>
|
||||||
|
/// <param name="quantity">Output the quantity of the reagent if it is contained, 0 if it isn't.</param>
|
||||||
|
/// <returns>Return true if the solution contains the reagent.</returns>
|
||||||
|
public bool ContainsReagent(string reagentId, out int quantity)
|
||||||
|
{
|
||||||
|
foreach (var reagent in _containedSolution.Contents)
|
||||||
|
{
|
||||||
|
if (reagent.ReagentId == reagentId)
|
||||||
|
{
|
||||||
|
quantity = reagent.Quantity;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
quantity = 0;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public string GetMajorReagentId()
|
||||||
|
{
|
||||||
|
if (_containedSolution.Contents.Count == 0)
|
||||||
|
{
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
var majorReagent = _containedSolution.Contents.OrderByDescending(reagent => reagent.Quantity).First();;
|
||||||
|
return majorReagent.ReagentId;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void UpdateFillIcon()
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(_fillInitState)) return;
|
||||||
|
|
||||||
|
var percentage = (double)CurrentVolume / MaxVolume;
|
||||||
|
var level = ContentHelpers.RoundToLevels(percentage * 100, 100, _fillInitSteps);
|
||||||
|
|
||||||
|
//Transformed glass uses special fancy sprites so we don't bother
|
||||||
|
if (level == 0 || Owner.TryGetComponent<TransformableContainerComponent>(out var transformableContainerComponent)
|
||||||
|
&& transformableContainerComponent.Transformed)
|
||||||
|
{
|
||||||
|
_spriteComponent.LayerSetColor(1, Color.Transparent);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_fillSprite = new SpriteSpecifier.Rsi(_fillPath, _fillInitState+level);
|
||||||
|
_spriteComponent.LayerSetSprite(1, _fillSprite);
|
||||||
|
_spriteComponent.LayerSetColor(1,SubstanceColor);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected virtual void OnSolutionChanged(bool skipColor)
|
||||||
|
{
|
||||||
|
if (!skipColor)
|
||||||
|
RecalculateColor();
|
||||||
|
|
||||||
|
UpdateFillIcon();
|
||||||
|
_chemistrySystem.HandleSolutionChange(Owner);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,90 @@
|
|||||||
|
using Content.Server.GameObjects.EntitySystems;
|
||||||
|
using Content.Shared.Chemistry;
|
||||||
|
using ICSharpCode.SharpZipLib.Zip.Compression;
|
||||||
|
using Robust.Server.GameObjects;
|
||||||
|
using Robust.Shared.GameObjects;
|
||||||
|
using Robust.Shared.Interfaces.GameObjects;
|
||||||
|
using Robust.Shared.Interfaces.GameObjects.Components;
|
||||||
|
using Robust.Shared.IoC;
|
||||||
|
using Robust.Shared.Prototypes;
|
||||||
|
using Robust.Shared.Utility;
|
||||||
|
|
||||||
|
namespace Content.Server.GameObjects.Components.Chemistry
|
||||||
|
{
|
||||||
|
[RegisterComponent]
|
||||||
|
public class TransformableContainerComponent : Component, ISolutionChange
|
||||||
|
{
|
||||||
|
#pragma warning disable 649
|
||||||
|
[Dependency] private readonly IPrototypeManager _prototypeManager;
|
||||||
|
#pragma warning restore 649
|
||||||
|
|
||||||
|
public override string Name => "TransformableContainer";
|
||||||
|
|
||||||
|
private bool _transformed = false;
|
||||||
|
public bool Transformed { get => _transformed; }
|
||||||
|
|
||||||
|
private SpriteSpecifier _initialSprite;
|
||||||
|
private string _initialName;
|
||||||
|
private string _initialDescription;
|
||||||
|
private SpriteComponent _sprite;
|
||||||
|
|
||||||
|
private ReagentPrototype _currentReagent;
|
||||||
|
|
||||||
|
public override void Initialize()
|
||||||
|
{
|
||||||
|
base.Initialize();
|
||||||
|
|
||||||
|
_sprite = Owner.GetComponent<SpriteComponent>();
|
||||||
|
_initialSprite = new SpriteSpecifier.Rsi(new ResourcePath(_sprite.BaseRSIPath), "icon");
|
||||||
|
_initialName = Owner.Name;
|
||||||
|
_initialDescription = Owner.Description;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Startup()
|
||||||
|
{
|
||||||
|
base.Startup();
|
||||||
|
Owner.GetComponent<SolutionComponent>().Capabilities |= SolutionCaps.FitsInDispenser;;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void CancelTransformation()
|
||||||
|
{
|
||||||
|
_currentReagent = null;
|
||||||
|
_transformed = false;
|
||||||
|
_sprite.LayerSetSprite(0, _initialSprite);
|
||||||
|
Owner.Name = _initialName;
|
||||||
|
Owner.Description = _initialDescription;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ISolutionChange.SolutionChanged(SolutionChangeEventArgs eventArgs)
|
||||||
|
{
|
||||||
|
var solution = eventArgs.Owner.GetComponent<SolutionComponent>();
|
||||||
|
//Transform container into initial state when emptied
|
||||||
|
if (_currentReagent != null && solution.ReagentList.Count == 0)
|
||||||
|
{
|
||||||
|
CancelTransformation();
|
||||||
|
}
|
||||||
|
|
||||||
|
//the biggest reagent in the solution decides the appearance
|
||||||
|
var reagentId = solution.GetMajorReagentId();
|
||||||
|
|
||||||
|
//If biggest reagent didn't changed - don't change anything at all
|
||||||
|
if (_currentReagent != null && _currentReagent.ID == reagentId)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Only reagents with spritePath property can change appearance of transformable containers!
|
||||||
|
if (!string.IsNullOrWhiteSpace(reagentId) &&
|
||||||
|
_prototypeManager.TryIndex(reagentId, out ReagentPrototype proto) &&
|
||||||
|
!string.IsNullOrWhiteSpace(proto.SpriteReplacementPath))
|
||||||
|
{
|
||||||
|
var spriteSpec = new SpriteSpecifier.Rsi(new ResourcePath("Objects/Drinks/" + proto.SpriteReplacementPath),"icon");
|
||||||
|
_sprite.LayerSetSprite(0, spriteSpec);
|
||||||
|
Owner.Name = proto.Name + " glass";
|
||||||
|
Owner.Description = proto.Description;
|
||||||
|
_currentReagent = proto;
|
||||||
|
_transformed = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,76 @@
|
|||||||
|
using Content.Server.GameObjects.Components.Power;
|
||||||
|
using Content.Server.GameObjects.EntitySystems;
|
||||||
|
using Content.Server.Interfaces.GameTicking;
|
||||||
|
using Content.Shared.GameObjects.Components.Command;
|
||||||
|
using Robust.Server.GameObjects.Components.UserInterface;
|
||||||
|
using Robust.Server.Interfaces.GameObjects;
|
||||||
|
using Robust.Server.Interfaces.Player;
|
||||||
|
using Robust.Shared.GameObjects;
|
||||||
|
using Robust.Shared.Interfaces.GameObjects;
|
||||||
|
using Robust.Shared.IoC;
|
||||||
|
|
||||||
|
namespace Content.Server.GameObjects.Components.Command
|
||||||
|
{
|
||||||
|
[RegisterComponent]
|
||||||
|
[ComponentReference(typeof(IActivate))]
|
||||||
|
public class CommunicationsConsoleComponent : SharedCommunicationsConsoleComponent, IActivate
|
||||||
|
{
|
||||||
|
#pragma warning disable 649
|
||||||
|
[Dependency] private IEntitySystemManager _entitySystemManager;
|
||||||
|
#pragma warning restore 649
|
||||||
|
|
||||||
|
private BoundUserInterface _userInterface;
|
||||||
|
private PowerDeviceComponent _powerDevice;
|
||||||
|
private bool Powered => _powerDevice.Powered;
|
||||||
|
private RoundEndSystem RoundEndSystem => _entitySystemManager.GetEntitySystem<RoundEndSystem>();
|
||||||
|
|
||||||
|
public override void Initialize()
|
||||||
|
{
|
||||||
|
base.Initialize();
|
||||||
|
|
||||||
|
_userInterface = Owner.GetComponent<ServerUserInterfaceComponent>().GetBoundUserInterface(CommunicationsConsoleUiKey.Key);
|
||||||
|
_userInterface.OnReceiveMessage += UserInterfaceOnOnReceiveMessage;
|
||||||
|
_powerDevice = Owner.GetComponent<PowerDeviceComponent>();
|
||||||
|
|
||||||
|
RoundEndSystem.OnRoundEndCountdownStarted += UpdateBoundInterface;
|
||||||
|
RoundEndSystem.OnRoundEndCountdownCancelled += UpdateBoundInterface;
|
||||||
|
RoundEndSystem.OnRoundEndCountdownFinished += UpdateBoundInterface;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void UpdateBoundInterface()
|
||||||
|
{
|
||||||
|
_userInterface.SetState(new CommunicationsConsoleInterfaceState(RoundEndSystem.ExpectedCountdownEnd));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void UserInterfaceOnOnReceiveMessage(ServerBoundUserInterfaceMessage obj)
|
||||||
|
{
|
||||||
|
switch (obj.Message)
|
||||||
|
{
|
||||||
|
case CommunicationsConsoleCallEmergencyShuttleMessage _:
|
||||||
|
RoundEndSystem.RequestRoundEnd();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case CommunicationsConsoleRecallEmergencyShuttleMessage _:
|
||||||
|
RoundEndSystem.CancelRoundEndCountdown();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OpenUserInterface(IPlayerSession session)
|
||||||
|
{
|
||||||
|
_userInterface.Open(session);
|
||||||
|
}
|
||||||
|
|
||||||
|
void IActivate.Activate(ActivateEventArgs eventArgs)
|
||||||
|
{
|
||||||
|
if (!eventArgs.User.TryGetComponent(out IActorComponent actor))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!Powered)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
OpenUserInterface(actor.playerSession);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -47,16 +47,11 @@ namespace Content.Server.GameObjects.Components.Metabolism
|
|||||||
serializer.DataField(ref _initialMaxVolume, "maxVolume", ReagentUnit.New(250));
|
serializer.DataField(ref _initialMaxVolume, "maxVolume", ReagentUnit.New(250));
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Initialize()
|
protected override void Startup()
|
||||||
{
|
{
|
||||||
base.Initialize();
|
base.Startup();
|
||||||
|
_internalSolution = Owner.GetComponent<SolutionComponent>();
|
||||||
//Create and setup internal solution storage
|
|
||||||
_internalSolution = new SolutionComponent();
|
|
||||||
_internalSolution.InitializeFromPrototype();
|
|
||||||
_internalSolution.Init();
|
|
||||||
_internalSolution.MaxVolume = _initialMaxVolume;
|
_internalSolution.MaxVolume = _initialMaxVolume;
|
||||||
_internalSolution.Owner = Owner; //Manually set owner to avoid crash when VV'ing this
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -43,9 +43,6 @@ namespace Content.Server.GameObjects.Components.Nutrition
|
|||||||
set => _contents.MaxVolume = value;
|
set => _contents.MaxVolume = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Solution _initialContents; // This is just for loading from yaml
|
|
||||||
private ReagentUnit _maxVolume;
|
|
||||||
|
|
||||||
private bool _despawnOnFinish;
|
private bool _despawnOnFinish;
|
||||||
|
|
||||||
private bool _drinking;
|
private bool _drinking;
|
||||||
@@ -64,53 +61,21 @@ namespace Content.Server.GameObjects.Components.Nutrition
|
|||||||
public override void ExposeData(ObjectSerializer serializer)
|
public override void ExposeData(ObjectSerializer serializer)
|
||||||
{
|
{
|
||||||
base.ExposeData(serializer);
|
base.ExposeData(serializer);
|
||||||
serializer.DataField(ref _initialContents, "contents", null);
|
|
||||||
serializer.DataField(ref _maxVolume, "max_volume", ReagentUnit.New(0));
|
|
||||||
serializer.DataField(ref _useSound, "use_sound", "/Audio/items/drink.ogg");
|
serializer.DataField(ref _useSound, "use_sound", "/Audio/items/drink.ogg");
|
||||||
// E.g. cola can when done or clear bottle, whatever
|
// E.g. cola can when done or clear bottle, whatever
|
||||||
// Currently this will enforce it has the same volume but this may change.
|
// Currently this will enforce it has the same volume but this may change. - TODO: this should be implemented in a separate component
|
||||||
serializer.DataField(ref _despawnOnFinish, "despawn_empty", true);
|
serializer.DataField(ref _despawnOnFinish, "despawn_empty", false);
|
||||||
serializer.DataField(ref _finishPrototype, "spawn_on_finish", null);
|
serializer.DataField(ref _finishPrototype, "spawn_on_finish", null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Initialize()
|
|
||||||
{
|
|
||||||
base.Initialize();
|
|
||||||
if (_contents == null)
|
|
||||||
{
|
|
||||||
if (Owner.TryGetComponent(out SolutionComponent solutionComponent))
|
|
||||||
{
|
|
||||||
_contents = solutionComponent;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_contents = Owner.AddComponent<SolutionComponent>();
|
|
||||||
//Ensure SolutionComponent supports click transferring if custom one not set
|
|
||||||
_contents.Capabilities = SolutionCaps.PourIn
|
|
||||||
| SolutionCaps.PourOut
|
|
||||||
| SolutionCaps.Injectable;
|
|
||||||
|
|
||||||
var pourable = Owner.AddComponent<PourableComponent>();
|
|
||||||
pourable.TransferAmount = ReagentUnit.New(5);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
_drinking = false;
|
|
||||||
if (_maxVolume != 0)
|
|
||||||
_contents.MaxVolume = _maxVolume;
|
|
||||||
else
|
|
||||||
_contents.MaxVolume = _initialContents.TotalVolume;
|
|
||||||
_contents.SolutionChanged += HandleSolutionChangedEvent;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void Startup()
|
protected override void Startup()
|
||||||
{
|
{
|
||||||
base.Startup();
|
base.Startup();
|
||||||
if (_initialContents != null)
|
_contents = Owner.GetComponent<SolutionComponent>();
|
||||||
{
|
_contents.Capabilities = SolutionCaps.PourIn
|
||||||
_contents.TryAddSolution(_initialContents, true, true);
|
| SolutionCaps.PourOut
|
||||||
}
|
| SolutionCaps.Injectable;
|
||||||
_initialContents = null;
|
_drinking = false;
|
||||||
Owner.TryGetComponent(out AppearanceComponent appearance);
|
Owner.TryGetComponent(out AppearanceComponent appearance);
|
||||||
_appearanceComponent = appearance;
|
_appearanceComponent = appearance;
|
||||||
_appearanceComponent?.SetData(SharedFoodComponent.FoodVisuals.MaxUses, MaxVolume);
|
_appearanceComponent?.SetData(SharedFoodComponent.FoodVisuals.MaxUses, MaxVolume);
|
||||||
@@ -168,54 +133,6 @@ namespace Content.Server.GameObjects.Components.Nutrition
|
|||||||
}
|
}
|
||||||
_drinking = false;
|
_drinking = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Finish(user);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Trigger finish behavior in the drink if applicable.
|
|
||||||
/// Depending on the drink this will either delete it,
|
|
||||||
/// or convert it to another entity, like an empty variant.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="user">The entity that is using the drink</param>
|
|
||||||
public void Finish(IEntity user)
|
|
||||||
{
|
|
||||||
// Drink containers are mostly transient.
|
|
||||||
if (_drinking || !_despawnOnFinish || UsesLeft() > 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
var gridPos = Owner.Transform.GridPosition;
|
|
||||||
_contents.SolutionChanged -= HandleSolutionChangedEvent;
|
|
||||||
Owner.Delete();
|
|
||||||
|
|
||||||
if (_finishPrototype == null || user == null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
var finisher = Owner.EntityManager.SpawnEntity(_finishPrototype, Owner.Transform.GridPosition);
|
|
||||||
if (user.TryGetComponent(out HandsComponent handsComponent) && finisher.TryGetComponent(out ItemComponent itemComponent))
|
|
||||||
{
|
|
||||||
if (handsComponent.CanPutInHand(itemComponent))
|
|
||||||
{
|
|
||||||
handsComponent.PutInHand(itemComponent);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
finisher.Transform.GridPosition = gridPos;
|
|
||||||
if (finisher.TryGetComponent(out DrinkComponent drinkComponent))
|
|
||||||
{
|
|
||||||
drinkComponent.MaxVolume = MaxVolume;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Updates drink state when the solution is changed by something other
|
|
||||||
/// than this component. Without this some drinks won't properly delete
|
|
||||||
/// themselves without additional clicks/uses after them being emptied.
|
|
||||||
/// </summary>
|
|
||||||
private void HandleSolutionChangedEvent()
|
|
||||||
{
|
|
||||||
Finish(null);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,17 +68,10 @@ namespace Content.Server.GameObjects.Components.Nutrition
|
|||||||
serializer.DataField(ref _digestionDelay, "digestionDelay", 20);
|
serializer.DataField(ref _digestionDelay, "digestionDelay", 20);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void Startup()
|
||||||
public override void Initialize()
|
|
||||||
{
|
{
|
||||||
base.Initialize();
|
_stomachContents = Owner.GetComponent<SolutionComponent>();
|
||||||
//Doesn't use Owner.AddComponent<>() to avoid cross-contamination (e.g. with blood or whatever they holds other solutions)
|
|
||||||
_stomachContents = new SolutionComponent();
|
|
||||||
_stomachContents.InitializeFromPrototype();
|
|
||||||
_stomachContents.MaxVolume = _initialMaxVolume;
|
_stomachContents.MaxVolume = _initialMaxVolume;
|
||||||
_stomachContents.Owner = Owner; //Manually set owner to avoid crash when VV'ing this
|
|
||||||
|
|
||||||
//Ensure bloodstream in present
|
|
||||||
if (!Owner.TryGetComponent<BloodstreamComponent>(out _bloodstream))
|
if (!Owner.TryGetComponent<BloodstreamComponent>(out _bloodstream))
|
||||||
{
|
{
|
||||||
Logger.Warning(_localizationManager.GetString(
|
Logger.Warning(_localizationManager.GetString(
|
||||||
|
|||||||
42
Content.Server/GameObjects/EntitySystems/ChemistrySystem.cs
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
using System;
|
||||||
|
using System.Linq;
|
||||||
|
using JetBrains.Annotations;
|
||||||
|
using Robust.Shared.GameObjects.Systems;
|
||||||
|
using Robust.Shared.Interfaces.GameObjects;
|
||||||
|
|
||||||
|
namespace Content.Server.GameObjects.EntitySystems
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// This interface gives components behavior on whether entities solution (implying SolutionComponent is in place) is changed
|
||||||
|
/// </summary>
|
||||||
|
public interface ISolutionChange
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Called when solution is mixed with some other solution, or when some part of the solution is removed
|
||||||
|
/// </summary>
|
||||||
|
void SolutionChanged(SolutionChangeEventArgs eventArgs);
|
||||||
|
}
|
||||||
|
|
||||||
|
public class SolutionChangeEventArgs : EventArgs
|
||||||
|
{
|
||||||
|
public IEntity Owner { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
[UsedImplicitly]
|
||||||
|
public class ChemistrySystem : EntitySystem
|
||||||
|
{
|
||||||
|
public void HandleSolutionChange(IEntity owner)
|
||||||
|
{
|
||||||
|
var eventArgs = new SolutionChangeEventArgs
|
||||||
|
{
|
||||||
|
Owner = owner,
|
||||||
|
};
|
||||||
|
var solutionChangeArgs = owner.GetAllComponents<ISolutionChange>().ToList();
|
||||||
|
|
||||||
|
foreach (var solutionChangeArg in solutionChangeArgs)
|
||||||
|
{
|
||||||
|
solutionChangeArg.SolutionChanged(eventArgs);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
65
Content.Server/GameObjects/EntitySystems/RoundEndSystem.cs
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
using System;
|
||||||
|
using System.Threading;
|
||||||
|
using Content.Server.Interfaces.GameTicking;
|
||||||
|
using Robust.Shared.GameObjects.Systems;
|
||||||
|
using Robust.Shared.Interfaces.Timing;
|
||||||
|
using Robust.Shared.IoC;
|
||||||
|
using Timer = Robust.Shared.Timers.Timer;
|
||||||
|
|
||||||
|
namespace Content.Server.GameObjects.EntitySystems
|
||||||
|
{
|
||||||
|
public class RoundEndSystem : EntitySystem
|
||||||
|
{
|
||||||
|
#pragma warning disable 649
|
||||||
|
[Dependency] private IGameTicker _gameTicker;
|
||||||
|
[Dependency] private IGameTiming _gameTiming;
|
||||||
|
#pragma warning restore 649
|
||||||
|
|
||||||
|
private CancellationTokenSource _roundEndCancellationTokenSource = new CancellationTokenSource();
|
||||||
|
public bool IsRoundEndCountdownStarted { get; private set; }
|
||||||
|
public TimeSpan RoundEndCountdownTime { get; set; } = TimeSpan.FromMinutes(4);
|
||||||
|
public TimeSpan? ExpectedCountdownEnd = null;
|
||||||
|
|
||||||
|
public delegate void RoundEndCountdownStarted();
|
||||||
|
public event RoundEndCountdownStarted OnRoundEndCountdownStarted;
|
||||||
|
|
||||||
|
public delegate void RoundEndCountdownCancelled();
|
||||||
|
public event RoundEndCountdownCancelled OnRoundEndCountdownCancelled;
|
||||||
|
|
||||||
|
public delegate void RoundEndCountdownFinished();
|
||||||
|
public event RoundEndCountdownFinished OnRoundEndCountdownFinished;
|
||||||
|
|
||||||
|
public void RequestRoundEnd()
|
||||||
|
{
|
||||||
|
if (IsRoundEndCountdownStarted)
|
||||||
|
return;
|
||||||
|
|
||||||
|
IsRoundEndCountdownStarted = true;
|
||||||
|
|
||||||
|
ExpectedCountdownEnd = _gameTiming.CurTime + RoundEndCountdownTime;
|
||||||
|
Timer.Spawn(RoundEndCountdownTime, EndRound, _roundEndCancellationTokenSource.Token);
|
||||||
|
OnRoundEndCountdownStarted?.Invoke();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void CancelRoundEndCountdown()
|
||||||
|
{
|
||||||
|
if (!IsRoundEndCountdownStarted)
|
||||||
|
return;
|
||||||
|
|
||||||
|
IsRoundEndCountdownStarted = false;
|
||||||
|
|
||||||
|
_roundEndCancellationTokenSource.Cancel();
|
||||||
|
_roundEndCancellationTokenSource = new CancellationTokenSource();
|
||||||
|
|
||||||
|
ExpectedCountdownEnd = null;
|
||||||
|
|
||||||
|
OnRoundEndCountdownCancelled?.Invoke();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void EndRound()
|
||||||
|
{
|
||||||
|
OnRoundEndCountdownFinished?.Invoke();
|
||||||
|
_gameTicker.EndRound();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -13,6 +13,7 @@ using Content.Server.Mobs;
|
|||||||
using Content.Server.Mobs.Roles;
|
using Content.Server.Mobs.Roles;
|
||||||
using Content.Server.Players;
|
using Content.Server.Players;
|
||||||
using Content.Shared;
|
using Content.Shared;
|
||||||
|
using Content.Shared.Chat;
|
||||||
using Content.Shared.Jobs;
|
using Content.Shared.Jobs;
|
||||||
using Content.Shared.Preferences;
|
using Content.Shared.Preferences;
|
||||||
using Robust.Server.Interfaces.Maps;
|
using Robust.Server.Interfaces.Maps;
|
||||||
@@ -123,6 +124,8 @@ namespace Content.Server.GameTicking
|
|||||||
{
|
{
|
||||||
Logger.InfoS("ticker", "Restarting round!");
|
Logger.InfoS("ticker", "Restarting round!");
|
||||||
|
|
||||||
|
SendServerMessage("Restarting round...");
|
||||||
|
|
||||||
RunLevel = GameRunLevel.PreRoundLobby;
|
RunLevel = GameRunLevel.PreRoundLobby;
|
||||||
_resettingCleanup();
|
_resettingCleanup();
|
||||||
_preRoundSetup();
|
_preRoundSetup();
|
||||||
@@ -147,6 +150,8 @@ namespace Content.Server.GameTicking
|
|||||||
DebugTools.Assert(RunLevel == GameRunLevel.PreRoundLobby);
|
DebugTools.Assert(RunLevel == GameRunLevel.PreRoundLobby);
|
||||||
Logger.InfoS("ticker", "Starting round!");
|
Logger.InfoS("ticker", "Starting round!");
|
||||||
|
|
||||||
|
SendServerMessage("The round is starting now...");
|
||||||
|
|
||||||
RunLevel = GameRunLevel.InRound;
|
RunLevel = GameRunLevel.InRound;
|
||||||
|
|
||||||
var preset = MakeGamePreset();
|
var preset = MakeGamePreset();
|
||||||
@@ -191,6 +196,14 @@ namespace Content.Server.GameTicking
|
|||||||
_sendStatusToAll();
|
_sendStatusToAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void SendServerMessage(string message)
|
||||||
|
{
|
||||||
|
var msg = _netManager.CreateNetMessage<MsgChatMessage>();
|
||||||
|
msg.Channel = ChatChannel.Server;
|
||||||
|
msg.Message = message;
|
||||||
|
IoCManager.Resolve<IServerNetManager>().ServerSendToAll(msg);
|
||||||
|
}
|
||||||
|
|
||||||
private HumanoidCharacterProfile GetPlayerProfile(IPlayerSession p) =>
|
private HumanoidCharacterProfile GetPlayerProfile(IPlayerSession p) =>
|
||||||
(HumanoidCharacterProfile) _prefsManager.GetPreferences(p.SessionId.Username).SelectedCharacter;
|
(HumanoidCharacterProfile) _prefsManager.GetPreferences(p.SessionId.Username).SelectedCharacter;
|
||||||
|
|
||||||
@@ -200,6 +213,8 @@ namespace Content.Server.GameTicking
|
|||||||
Logger.InfoS("ticker", "Ending round!");
|
Logger.InfoS("ticker", "Ending round!");
|
||||||
|
|
||||||
RunLevel = GameRunLevel.PostRound;
|
RunLevel = GameRunLevel.PostRound;
|
||||||
|
|
||||||
|
SendServerMessage("The round has ended!");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Respawn(IPlayerSession targetPlayer)
|
public void Respawn(IPlayerSession targetPlayer)
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ namespace Content.Shared.Chemistry
|
|||||||
private string _description;
|
private string _description;
|
||||||
private Color _substanceColor;
|
private Color _substanceColor;
|
||||||
private List<IMetabolizable> _metabolism;
|
private List<IMetabolizable> _metabolism;
|
||||||
|
private string _spritePath;
|
||||||
|
|
||||||
public string ID => _id;
|
public string ID => _id;
|
||||||
public string Name => _name;
|
public string Name => _name;
|
||||||
@@ -29,6 +30,8 @@ namespace Content.Shared.Chemistry
|
|||||||
//List of metabolism effects this reagent has, should really only be used server-side.
|
//List of metabolism effects this reagent has, should really only be used server-side.
|
||||||
public List<IMetabolizable> Metabolism => _metabolism;
|
public List<IMetabolizable> Metabolism => _metabolism;
|
||||||
|
|
||||||
|
public string SpriteReplacementPath => _spritePath;
|
||||||
|
|
||||||
public ReagentPrototype()
|
public ReagentPrototype()
|
||||||
{
|
{
|
||||||
IoCManager.InjectDependencies(this);
|
IoCManager.InjectDependencies(this);
|
||||||
@@ -42,6 +45,7 @@ namespace Content.Shared.Chemistry
|
|||||||
serializer.DataField(ref _name, "name", string.Empty);
|
serializer.DataField(ref _name, "name", string.Empty);
|
||||||
serializer.DataField(ref _description, "desc", string.Empty);
|
serializer.DataField(ref _description, "desc", string.Empty);
|
||||||
serializer.DataField(ref _substanceColor, "color", Color.White);
|
serializer.DataField(ref _substanceColor, "color", Color.White);
|
||||||
|
serializer.DataField(ref _spritePath, "spritePath", string.Empty);
|
||||||
|
|
||||||
if (_moduleManager.IsServerModule)
|
if (_moduleManager.IsServerModule)
|
||||||
serializer.DataField(ref _metabolism, "metabolism", new List<IMetabolizable> {new DefaultMetabolizable()});
|
serializer.DataField(ref _metabolism, "metabolism", new List<IMetabolizable> {new DefaultMetabolizable()});
|
||||||
|
|||||||
@@ -0,0 +1,46 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using Content.Shared.Chemistry;
|
||||||
|
using Robust.Shared.GameObjects;
|
||||||
|
using Robust.Shared.IoC;
|
||||||
|
using Robust.Shared.Maths;
|
||||||
|
using Robust.Shared.Prototypes;
|
||||||
|
using Robust.Shared.Serialization;
|
||||||
|
using Robust.Shared.ViewVariables;
|
||||||
|
|
||||||
|
namespace Content.Shared.GameObjects.Components.Chemistry
|
||||||
|
{
|
||||||
|
public class SharedSolutionComponent : Component
|
||||||
|
{
|
||||||
|
public override string Name => "Solution";
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public sealed override uint? NetID => ContentNetIDs.SOLUTION;
|
||||||
|
|
||||||
|
[Serializable, NetSerializable]
|
||||||
|
public class SolutionComponentState : ComponentState
|
||||||
|
{
|
||||||
|
public SolutionComponentState() : base(ContentNetIDs.SOLUTION) { }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override ComponentState GetComponentState()
|
||||||
|
{
|
||||||
|
return new SolutionComponentState();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override void HandleComponentState(ComponentState curState, ComponentState nextState)
|
||||||
|
{
|
||||||
|
base.HandleComponentState(curState, nextState);
|
||||||
|
|
||||||
|
if(curState == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
var compState = (SolutionComponentState)curState;
|
||||||
|
|
||||||
|
//TODO: Make me work!
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,243 +0,0 @@
|
|||||||
using Content.Shared.Chemistry;
|
|
||||||
using Robust.Shared.GameObjects;
|
|
||||||
using Robust.Shared.IoC;
|
|
||||||
using Robust.Shared.Maths;
|
|
||||||
using Robust.Shared.Prototypes;
|
|
||||||
using Robust.Shared.Serialization;
|
|
||||||
using Robust.Shared.ViewVariables;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
namespace Content.Shared.GameObjects.Components.Chemistry
|
|
||||||
{
|
|
||||||
public class SolutionComponent : Component
|
|
||||||
{
|
|
||||||
#pragma warning disable 649
|
|
||||||
[Dependency] private readonly IPrototypeManager _prototypeManager;
|
|
||||||
#pragma warning restore 649
|
|
||||||
|
|
||||||
[ViewVariables]
|
|
||||||
protected Solution ContainedSolution = new Solution();
|
|
||||||
private ReagentUnit _maxVolume;
|
|
||||||
private SolutionCaps _capabilities;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Triggered when the solution contents change.
|
|
||||||
/// </summary>
|
|
||||||
public event Action SolutionChanged;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The maximum volume of the container.
|
|
||||||
/// </summary>
|
|
||||||
[ViewVariables(VVAccess.ReadWrite)]
|
|
||||||
public ReagentUnit MaxVolume
|
|
||||||
{
|
|
||||||
get => _maxVolume;
|
|
||||||
set => _maxVolume = value; // Note that the contents won't spill out if the capacity is reduced.
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The total volume of all the of the reagents in the container.
|
|
||||||
/// </summary>
|
|
||||||
[ViewVariables]
|
|
||||||
public ReagentUnit CurrentVolume => ContainedSolution.TotalVolume;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The volume without reagents remaining in the container.
|
|
||||||
/// </summary>
|
|
||||||
[ViewVariables]
|
|
||||||
public ReagentUnit EmptyVolume => MaxVolume - CurrentVolume;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The current blended color of all the reagents in the container.
|
|
||||||
/// </summary>
|
|
||||||
[ViewVariables(VVAccess.ReadWrite)]
|
|
||||||
public Color SubstanceColor { get; private set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The current capabilities of this container (is the top open to pour? can I inject it into another object?).
|
|
||||||
/// </summary>
|
|
||||||
[ViewVariables(VVAccess.ReadWrite)]
|
|
||||||
public SolutionCaps Capabilities
|
|
||||||
{
|
|
||||||
get => _capabilities;
|
|
||||||
set => _capabilities = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public IReadOnlyList<Solution.ReagentQuantity> ReagentList => ContainedSolution.Contents;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Shortcut for Capabilities PourIn flag to avoid binary operators.
|
|
||||||
/// </summary>
|
|
||||||
public bool CanPourIn => (Capabilities & SolutionCaps.PourIn) != 0;
|
|
||||||
/// <summary>
|
|
||||||
/// Shortcut for Capabilities PourOut flag to avoid binary operators.
|
|
||||||
/// </summary>
|
|
||||||
public bool CanPourOut => (Capabilities & SolutionCaps.PourOut) != 0;
|
|
||||||
/// <summary>
|
|
||||||
/// Shortcut for Capabilities Injectable flag
|
|
||||||
/// </summary>
|
|
||||||
public bool Injectable => (Capabilities & SolutionCaps.Injectable) != 0;
|
|
||||||
/// <summary>
|
|
||||||
/// Shortcut for Capabilities Injector flag
|
|
||||||
/// </summary>
|
|
||||||
public bool Injector => (Capabilities & SolutionCaps.Injector) != 0;
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
public override string Name => "Solution";
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
public sealed override uint? NetID => ContentNetIDs.SOLUTION;
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
public override void ExposeData(ObjectSerializer serializer)
|
|
||||||
{
|
|
||||||
base.ExposeData(serializer);
|
|
||||||
|
|
||||||
serializer.DataField(ref _maxVolume, "maxVol", ReagentUnit.New(0M));
|
|
||||||
serializer.DataField(ref ContainedSolution, "contents", new Solution());
|
|
||||||
serializer.DataField(ref _capabilities, "caps", SolutionCaps.None);
|
|
||||||
}
|
|
||||||
|
|
||||||
public virtual void Init()
|
|
||||||
{
|
|
||||||
ContainedSolution = new Solution();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Startup()
|
|
||||||
{
|
|
||||||
base.Startup();
|
|
||||||
|
|
||||||
RecalculateColor();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Shutdown()
|
|
||||||
{
|
|
||||||
base.Shutdown();
|
|
||||||
|
|
||||||
ContainedSolution.RemoveAllSolution();
|
|
||||||
ContainedSolution = new Solution();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void RemoveAllSolution()
|
|
||||||
{
|
|
||||||
ContainedSolution.RemoveAllSolution();
|
|
||||||
OnSolutionChanged();
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool TryRemoveReagent(string reagentId, ReagentUnit quantity)
|
|
||||||
{
|
|
||||||
if (!ContainsReagent(reagentId, out var currentQuantity)) return false;
|
|
||||||
|
|
||||||
ContainedSolution.RemoveReagent(reagentId, quantity);
|
|
||||||
OnSolutionChanged();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Attempt to remove the specified quantity from this solution
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="quantity">Quantity of this solution to remove</param>
|
|
||||||
/// <returns>Whether or not the solution was successfully removed</returns>
|
|
||||||
public bool TryRemoveSolution(ReagentUnit quantity)
|
|
||||||
{
|
|
||||||
if (CurrentVolume == 0)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
ContainedSolution.RemoveSolution(quantity);
|
|
||||||
OnSolutionChanged();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Solution SplitSolution(ReagentUnit quantity)
|
|
||||||
{
|
|
||||||
var solutionSplit = ContainedSolution.SplitSolution(quantity);
|
|
||||||
OnSolutionChanged();
|
|
||||||
return solutionSplit;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void RecalculateColor()
|
|
||||||
{
|
|
||||||
if(ContainedSolution.TotalVolume == 0)
|
|
||||||
SubstanceColor = Color.White;
|
|
||||||
|
|
||||||
Color mixColor = default;
|
|
||||||
var runningTotalQuantity = ReagentUnit.New(0M);
|
|
||||||
|
|
||||||
foreach (var reagent in ContainedSolution)
|
|
||||||
{
|
|
||||||
runningTotalQuantity += reagent.Quantity;
|
|
||||||
|
|
||||||
if(!_prototypeManager.TryIndex(reagent.ReagentId, out ReagentPrototype proto))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (mixColor == default)
|
|
||||||
mixColor = proto.SubstanceColor;
|
|
||||||
|
|
||||||
mixColor = BlendRGB(mixColor, proto.SubstanceColor, reagent.Quantity.Float() / runningTotalQuantity.Float());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private Color BlendRGB(Color rgb1, Color rgb2, float amount)
|
|
||||||
{
|
|
||||||
var r = (float)Math.Round(rgb1.R + (rgb2.R - rgb1.R) * amount, 1);
|
|
||||||
var g = (float)Math.Round(rgb1.G + (rgb2.G - rgb1.G) * amount, 1);
|
|
||||||
var b = (float)Math.Round(rgb1.B + (rgb2.B - rgb1.B) * amount, 1);
|
|
||||||
var alpha = (float)Math.Round(rgb1.A + (rgb2.A - rgb1.A) * amount, 1);
|
|
||||||
|
|
||||||
return new Color(r, g, b, alpha);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
public override ComponentState GetComponentState()
|
|
||||||
{
|
|
||||||
return new SolutionComponentState();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
public override void HandleComponentState(ComponentState curState, ComponentState nextState)
|
|
||||||
{
|
|
||||||
base.HandleComponentState(curState, nextState);
|
|
||||||
|
|
||||||
if(curState == null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
var compState = (SolutionComponentState)curState;
|
|
||||||
|
|
||||||
//TODO: Make me work!
|
|
||||||
}
|
|
||||||
|
|
||||||
[Serializable, NetSerializable]
|
|
||||||
public class SolutionComponentState : ComponentState
|
|
||||||
{
|
|
||||||
public SolutionComponentState() : base(ContentNetIDs.SOLUTION) { }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Check if the solution contains the specified reagent.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="reagentId">The reagent to check for.</param>
|
|
||||||
/// <param name="quantity">Output the quantity of the reagent if it is contained, 0 if it isn't.</param>
|
|
||||||
/// <returns>Return true if the solution contains the reagent.</returns>
|
|
||||||
public bool ContainsReagent(string reagentId, out ReagentUnit quantity)
|
|
||||||
{
|
|
||||||
foreach (var reagent in ContainedSolution.Contents)
|
|
||||||
{
|
|
||||||
if (reagent.ReagentId == reagentId)
|
|
||||||
{
|
|
||||||
quantity = reagent.Quantity;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
quantity = ReagentUnit.New(0);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected virtual void OnSolutionChanged()
|
|
||||||
{
|
|
||||||
SolutionChanged?.Invoke();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
using System;
|
||||||
|
using Robust.Shared.GameObjects;
|
||||||
|
using Robust.Shared.GameObjects.Components.UserInterface;
|
||||||
|
using Robust.Shared.Serialization;
|
||||||
|
|
||||||
|
namespace Content.Shared.GameObjects.Components.Command
|
||||||
|
{
|
||||||
|
public class SharedCommunicationsConsoleComponent : Component
|
||||||
|
{
|
||||||
|
public override string Name => "CommunicationsConsole";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
[Serializable, NetSerializable]
|
||||||
|
public class CommunicationsConsoleInterfaceState : BoundUserInterfaceState
|
||||||
|
{
|
||||||
|
public readonly TimeSpan? ExpectedCountdownEnd;
|
||||||
|
public readonly bool CountdownStarted;
|
||||||
|
|
||||||
|
public CommunicationsConsoleInterfaceState(TimeSpan? expectedCountdownEnd = null)
|
||||||
|
{
|
||||||
|
ExpectedCountdownEnd = expectedCountdownEnd;
|
||||||
|
CountdownStarted = expectedCountdownEnd != null;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[Serializable, NetSerializable]
|
||||||
|
public class CommunicationsConsoleCallEmergencyShuttleMessage : BoundUserInterfaceMessage
|
||||||
|
{
|
||||||
|
public CommunicationsConsoleCallEmergencyShuttleMessage()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[Serializable, NetSerializable]
|
||||||
|
public class CommunicationsConsoleRecallEmergencyShuttleMessage : BoundUserInterfaceMessage
|
||||||
|
{
|
||||||
|
public CommunicationsConsoleRecallEmergencyShuttleMessage()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[Serializable, NetSerializable]
|
||||||
|
public enum CommunicationsConsoleUiKey
|
||||||
|
{
|
||||||
|
Key
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -18,3 +18,7 @@
|
|||||||
- chem.Ale
|
- chem.Ale
|
||||||
- chem.Wine
|
- chem.Wine
|
||||||
- chem.Ice
|
- chem.Ice
|
||||||
|
- chem.Beer
|
||||||
|
- chem.Vodka
|
||||||
|
- chem.Cognac
|
||||||
|
- chem.Kahlua
|
||||||
|
|||||||
@@ -37,3 +37,4 @@
|
|||||||
- chem.K
|
- chem.K
|
||||||
- chem.Ra
|
- chem.Ra
|
||||||
- chem.Na
|
- chem.Na
|
||||||
|
- chem.U
|
||||||
|
|||||||
@@ -176,3 +176,8 @@
|
|||||||
- type: ComputerVisualizer2D
|
- type: ComputerVisualizer2D
|
||||||
key: generic_key
|
key: generic_key
|
||||||
screen: comm
|
screen: comm
|
||||||
|
- type: CommunicationsConsole
|
||||||
|
- type: UserInterface
|
||||||
|
interfaces:
|
||||||
|
- key: enum.CommunicationsConsoleUiKey.Key
|
||||||
|
type: CommunicationsConsoleBoundUserInterface
|
||||||
|
|||||||
@@ -19,3 +19,4 @@
|
|||||||
- chem.Tea
|
- chem.Tea
|
||||||
- chem.Ice
|
- chem.Ice
|
||||||
- chem.H2O
|
- chem.H2O
|
||||||
|
- chem.Cream
|
||||||
|
|||||||
@@ -5,12 +5,6 @@
|
|||||||
description: One sip of this and you just know you're gonna have a good time.
|
description: One sip of this and you just know you're gonna have a good time.
|
||||||
components:
|
components:
|
||||||
- type: Drink
|
- type: Drink
|
||||||
max_volume: 10
|
|
||||||
spawn_on_finish: DrinkBottleAbsinthe
|
|
||||||
contents:
|
|
||||||
reagents:
|
|
||||||
- ReagentId: chem.H2O
|
|
||||||
Quantity: 10
|
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Objects/Drinks/absinthebottle.rsi
|
sprite: Objects/Drinks/absinthebottle.rsi
|
||||||
- type: Icon
|
- type: Icon
|
||||||
@@ -23,12 +17,6 @@
|
|||||||
description: A bottle of 46 proof Emeraldine Melon Liquor. Sweet and light.
|
description: A bottle of 46 proof Emeraldine Melon Liquor. Sweet and light.
|
||||||
components:
|
components:
|
||||||
- type: Drink
|
- type: Drink
|
||||||
max_volume: 10
|
|
||||||
spawn_on_finish: DrinkBottleAlcoClear
|
|
||||||
contents:
|
|
||||||
reagents:
|
|
||||||
- ReagentId: chem.H2O
|
|
||||||
Quantity: 10
|
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Objects/Drinks/alco-green.rsi
|
sprite: Objects/Drinks/alco-green.rsi
|
||||||
- type: Icon
|
- type: Icon
|
||||||
@@ -40,13 +28,12 @@
|
|||||||
name: Magm-Ale
|
name: Magm-Ale
|
||||||
description: A true dorf's drink of choice.
|
description: A true dorf's drink of choice.
|
||||||
components:
|
components:
|
||||||
- type: Drink
|
- type: Solution
|
||||||
max_volume: 10
|
maxVol: 80
|
||||||
spawn_on_finish: DrinkBottleAle
|
|
||||||
contents:
|
contents:
|
||||||
reagents:
|
reagents:
|
||||||
- ReagentId: chem.H2O
|
- ReagentId: chem.Ale
|
||||||
Quantity: 10
|
Quantity: 80
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Objects/Drinks/alebottle.rsi
|
sprite: Objects/Drinks/alebottle.rsi
|
||||||
- type: Icon
|
- type: Icon
|
||||||
@@ -59,12 +46,6 @@
|
|||||||
description: A bottle filled with nothing
|
description: A bottle filled with nothing
|
||||||
components:
|
components:
|
||||||
- type: Drink
|
- type: Drink
|
||||||
max_volume: 10
|
|
||||||
spawn_on_finish: DrinkBottleAlcoClear
|
|
||||||
contents:
|
|
||||||
reagents:
|
|
||||||
- ReagentId: chem.H2O
|
|
||||||
Quantity: 10
|
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Objects/Drinks/bottleofnothing.rsi
|
sprite: Objects/Drinks/bottleofnothing.rsi
|
||||||
- type: Icon
|
- type: Icon
|
||||||
@@ -76,13 +57,12 @@
|
|||||||
name: Cognac bottle
|
name: Cognac bottle
|
||||||
description: A sweet and strongly alchoholic drink, made after numerous distillations and years of maturing. You might as well not scream 'SHITCURITY' this time.
|
description: A sweet and strongly alchoholic drink, made after numerous distillations and years of maturing. You might as well not scream 'SHITCURITY' this time.
|
||||||
components:
|
components:
|
||||||
- type: Drink
|
- type: Solution
|
||||||
max_volume: 10
|
maxVol: 80
|
||||||
spawn_on_finish: DrinkBottleCognac
|
|
||||||
contents:
|
contents:
|
||||||
reagents:
|
reagents:
|
||||||
- ReagentId: chem.H2O
|
- ReagentId: chem.Cognac
|
||||||
Quantity: 10
|
Quantity: 80
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Objects/Drinks/cognacbottle.rsi
|
sprite: Objects/Drinks/cognacbottle.rsi
|
||||||
- type: Icon
|
- type: Icon
|
||||||
@@ -95,12 +75,6 @@
|
|||||||
description: A bottle of high quality gin, produced in the New London Space Station.
|
description: A bottle of high quality gin, produced in the New London Space Station.
|
||||||
components:
|
components:
|
||||||
- type: Drink
|
- type: Drink
|
||||||
max_volume: 10
|
|
||||||
spawn_on_finish: DrinkBottleGin
|
|
||||||
contents:
|
|
||||||
reagents:
|
|
||||||
- ReagentId: chem.H2O
|
|
||||||
Quantity: 10
|
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Objects/Drinks/ginbottle.rsi
|
sprite: Objects/Drinks/ginbottle.rsi
|
||||||
- type: Icon
|
- type: Icon
|
||||||
@@ -113,12 +87,6 @@
|
|||||||
description: 100 proof cinnamon schnapps, made for alcoholic teen girls on spring break.
|
description: 100 proof cinnamon schnapps, made for alcoholic teen girls on spring break.
|
||||||
components:
|
components:
|
||||||
- type: Drink
|
- type: Drink
|
||||||
max_volume: 10
|
|
||||||
spawn_on_finish: DrinkBottleGoldschlager
|
|
||||||
contents:
|
|
||||||
reagents:
|
|
||||||
- ReagentId: chem.H2O
|
|
||||||
Quantity: 10
|
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Objects/Drinks/goldschlagerbottle.rsi
|
sprite: Objects/Drinks/goldschlagerbottle.rsi
|
||||||
- type: Icon
|
- type: Icon
|
||||||
@@ -130,13 +98,12 @@
|
|||||||
name: Kahlua bottle
|
name: Kahlua bottle
|
||||||
description: A widely known, Mexican coffee-flavoured liqueur. In production since 1936, HONK
|
description: A widely known, Mexican coffee-flavoured liqueur. In production since 1936, HONK
|
||||||
components:
|
components:
|
||||||
- type: Drink
|
- type: Solution
|
||||||
max_volume: 10
|
maxVol: 80
|
||||||
spawn_on_finish: DrinkBottleKahlua
|
|
||||||
contents:
|
contents:
|
||||||
reagents:
|
reagents:
|
||||||
- ReagentId: chem.H2O
|
- ReagentId: chem.H2O
|
||||||
Quantity: 10
|
Quantity: 80
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Objects/Drinks/kahluabottle.rsi
|
sprite: Objects/Drinks/kahluabottle.rsi
|
||||||
- type: Icon
|
- type: Icon
|
||||||
@@ -149,12 +116,6 @@
|
|||||||
description: Silver laced tequilla, served in space night clubs across the galaxy.
|
description: Silver laced tequilla, served in space night clubs across the galaxy.
|
||||||
components:
|
components:
|
||||||
- type: Drink
|
- type: Drink
|
||||||
max_volume: 10
|
|
||||||
spawn_on_finish: DrinkBottlePatron
|
|
||||||
contents:
|
|
||||||
reagents:
|
|
||||||
- ReagentId: chem.H2O
|
|
||||||
Quantity: 10
|
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Objects/Drinks/patronbottle.rsi
|
sprite: Objects/Drinks/patronbottle.rsi
|
||||||
- type: Icon
|
- type: Icon
|
||||||
@@ -167,12 +128,6 @@
|
|||||||
description: What a delightful packaging for a surely high quality wine! The vintage must be amazing!
|
description: What a delightful packaging for a surely high quality wine! The vintage must be amazing!
|
||||||
components:
|
components:
|
||||||
- type: Drink
|
- type: Drink
|
||||||
max_volume: 10
|
|
||||||
spawn_on_finish: DrinkBottlePoisonWine
|
|
||||||
contents:
|
|
||||||
reagents:
|
|
||||||
- ReagentId: chem.H2O
|
|
||||||
Quantity: 10
|
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Objects/Drinks/pwinebottle.rsi
|
sprite: Objects/Drinks/pwinebottle.rsi
|
||||||
- type: Icon
|
- type: Icon
|
||||||
@@ -185,12 +140,6 @@
|
|||||||
description: This isn't just rum, oh no. It's practically GRIFF in a bottle.
|
description: This isn't just rum, oh no. It's practically GRIFF in a bottle.
|
||||||
components:
|
components:
|
||||||
- type: Drink
|
- type: Drink
|
||||||
max_volume: 10
|
|
||||||
spawn_on_finish: DrinkBottleRum
|
|
||||||
contents:
|
|
||||||
reagents:
|
|
||||||
- ReagentId: chem.H2O
|
|
||||||
Quantity: 10
|
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Objects/Drinks/rumbottle.rsi
|
sprite: Objects/Drinks/rumbottle.rsi
|
||||||
- type: Icon
|
- type: Icon
|
||||||
@@ -203,12 +152,6 @@
|
|||||||
description: Made from premium petroleum distillates, pure thalidomide and other fine quality ingredients!
|
description: Made from premium petroleum distillates, pure thalidomide and other fine quality ingredients!
|
||||||
components:
|
components:
|
||||||
- type: Drink
|
- type: Drink
|
||||||
max_volume: 10
|
|
||||||
spawn_on_finish: DrinkBottleTequila
|
|
||||||
contents:
|
|
||||||
reagents:
|
|
||||||
- ReagentId: chem.H2O
|
|
||||||
Quantity: 10
|
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Objects/Drinks/tequillabottle.rsi
|
sprite: Objects/Drinks/tequillabottle.rsi
|
||||||
- type: Icon
|
- type: Icon
|
||||||
@@ -221,12 +164,6 @@
|
|||||||
description: Sweet, sweet dryness~
|
description: Sweet, sweet dryness~
|
||||||
components:
|
components:
|
||||||
- type: Drink
|
- type: Drink
|
||||||
max_volume: 10
|
|
||||||
spawn_on_finish: DrinkBottleVermouth
|
|
||||||
contents:
|
|
||||||
reagents:
|
|
||||||
- ReagentId: chem.H2O
|
|
||||||
Quantity: 10
|
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Objects/Drinks/vermouthbottle.rsi
|
sprite: Objects/Drinks/vermouthbottle.rsi
|
||||||
- type: Icon
|
- type: Icon
|
||||||
@@ -238,13 +175,12 @@
|
|||||||
name: Vodka bottle
|
name: Vodka bottle
|
||||||
description: Aah, vodka. Prime choice of drink AND fuel by Russians worldwide.
|
description: Aah, vodka. Prime choice of drink AND fuel by Russians worldwide.
|
||||||
components:
|
components:
|
||||||
- type: Drink
|
- type: Solution
|
||||||
max_volume: 10
|
maxVol: 80
|
||||||
spawn_on_finish: DrinkBottleVodka
|
|
||||||
contents:
|
contents:
|
||||||
reagents:
|
reagents:
|
||||||
- ReagentId: chem.H2O
|
- ReagentId: chem.Vodka
|
||||||
Quantity: 10
|
Quantity: 80
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Objects/Drinks/vodkabottle.rsi
|
sprite: Objects/Drinks/vodkabottle.rsi
|
||||||
- type: Icon
|
- type: Icon
|
||||||
@@ -256,13 +192,12 @@
|
|||||||
name: Uncle Git's special reserve
|
name: Uncle Git's special reserve
|
||||||
description: A premium single-malt whiskey, gently matured inside the tunnels of a nuclear shelter. TUNNEL WHISKEY RULES.
|
description: A premium single-malt whiskey, gently matured inside the tunnels of a nuclear shelter. TUNNEL WHISKEY RULES.
|
||||||
components:
|
components:
|
||||||
- type: Drink
|
- type: Solution
|
||||||
max_volume: 10
|
maxVol: 80
|
||||||
spawn_on_finish: DrinkBottleWhiskey
|
|
||||||
contents:
|
contents:
|
||||||
reagents:
|
reagents:
|
||||||
- ReagentId: chem.H2O
|
- ReagentId: chem.Whiskey
|
||||||
Quantity: 10
|
Quantity: 80
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Objects/Drinks/whiskeybottle.rsi
|
sprite: Objects/Drinks/whiskeybottle.rsi
|
||||||
- type: Icon
|
- type: Icon
|
||||||
@@ -274,13 +209,12 @@
|
|||||||
name: Doublebearded bearded special wine bottle
|
name: Doublebearded bearded special wine bottle
|
||||||
description: A faint aura of unease and asspainery surrounds the bottle.
|
description: A faint aura of unease and asspainery surrounds the bottle.
|
||||||
components:
|
components:
|
||||||
- type: Drink
|
- type: Solution
|
||||||
max_volume: 10
|
maxVol: 80
|
||||||
spawn_on_finish: DrinkBottleWine
|
|
||||||
contents:
|
contents:
|
||||||
reagents:
|
reagents:
|
||||||
- ReagentId: chem.H2O
|
- ReagentId: chem.Wine
|
||||||
Quantity: 10
|
Quantity: 80
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Objects/Drinks/winebottle.rsi
|
sprite: Objects/Drinks/winebottle.rsi
|
||||||
- type: Icon
|
- type: Icon
|
||||||
|
|||||||
@@ -30,11 +30,12 @@
|
|||||||
name: Space cola
|
name: Space cola
|
||||||
description: A refreshing beverage.
|
description: A refreshing beverage.
|
||||||
components:
|
components:
|
||||||
- type: Drink
|
- type: Solution
|
||||||
|
maxVol: 20
|
||||||
contents:
|
contents:
|
||||||
reagents:
|
reagents:
|
||||||
- ReagentId: chem.H2O
|
- ReagentId: chem.Cola
|
||||||
Quantity: 4
|
Quantity: 20
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Objects/Drinks/cola.rsi
|
sprite: Objects/Drinks/cola.rsi
|
||||||
- type: Icon
|
- type: Icon
|
||||||
@@ -62,10 +63,6 @@
|
|||||||
description: ''
|
description: ''
|
||||||
components:
|
components:
|
||||||
- type: Drink
|
- type: Drink
|
||||||
contents:
|
|
||||||
reagents:
|
|
||||||
- ReagentId: chem.H2O
|
|
||||||
Quantity: 4
|
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Objects/Drinks/ice_tea_can.rsi
|
sprite: Objects/Drinks/ice_tea_can.rsi
|
||||||
- type: Icon
|
- type: Icon
|
||||||
@@ -93,10 +90,6 @@
|
|||||||
description: You wanted ORANGE. It gave you Lemon Lime.
|
description: You wanted ORANGE. It gave you Lemon Lime.
|
||||||
components:
|
components:
|
||||||
- type: Drink
|
- type: Drink
|
||||||
contents:
|
|
||||||
reagents:
|
|
||||||
- ReagentId: chem.H2O
|
|
||||||
Quantity: 4
|
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Objects/Drinks/lemon-lime.rsi
|
sprite: Objects/Drinks/lemon-lime.rsi
|
||||||
- type: Icon
|
- type: Icon
|
||||||
@@ -124,10 +117,6 @@
|
|||||||
description: ''
|
description: ''
|
||||||
components:
|
components:
|
||||||
- type: Drink
|
- type: Drink
|
||||||
contents:
|
|
||||||
reagents:
|
|
||||||
- ReagentId: chem.H2O
|
|
||||||
Quantity: 4
|
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Objects/Drinks/purple_can.rsi
|
sprite: Objects/Drinks/purple_can.rsi
|
||||||
- type: Icon
|
- type: Icon
|
||||||
@@ -155,10 +144,6 @@
|
|||||||
description: Blows right through you like a space wind.
|
description: Blows right through you like a space wind.
|
||||||
components:
|
components:
|
||||||
- type: Drink
|
- type: Drink
|
||||||
contents:
|
|
||||||
reagents:
|
|
||||||
- ReagentId: chem.H2O
|
|
||||||
Quantity: 4
|
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Objects/Drinks/space_mountain_wind.rsi
|
sprite: Objects/Drinks/space_mountain_wind.rsi
|
||||||
- type: Icon
|
- type: Icon
|
||||||
@@ -186,10 +171,6 @@
|
|||||||
description: Tastes like a hull breach in your mouth.
|
description: Tastes like a hull breach in your mouth.
|
||||||
components:
|
components:
|
||||||
- type: Drink
|
- type: Drink
|
||||||
contents:
|
|
||||||
reagents:
|
|
||||||
- ReagentId: chem.H2O
|
|
||||||
Quantity: 4
|
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Objects/Drinks/space-up.rsi
|
sprite: Objects/Drinks/space-up.rsi
|
||||||
- type: Icon
|
- type: Icon
|
||||||
@@ -217,10 +198,6 @@
|
|||||||
description: The taste of a star in liquid form. And, a bit of tuna...?
|
description: The taste of a star in liquid form. And, a bit of tuna...?
|
||||||
components:
|
components:
|
||||||
- type: Drink
|
- type: Drink
|
||||||
contents:
|
|
||||||
reagents:
|
|
||||||
- ReagentId: chem.H2O
|
|
||||||
Quantity: 4
|
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Objects/Drinks/starkist.rsi
|
sprite: Objects/Drinks/starkist.rsi
|
||||||
- type: Icon
|
- type: Icon
|
||||||
@@ -248,10 +225,6 @@
|
|||||||
description: The MBO has advised crew members that consumption of Thirteen Loko may result in seizures, blindness, drunkeness, or even death. Please Drink Responsibly.
|
description: The MBO has advised crew members that consumption of Thirteen Loko may result in seizures, blindness, drunkeness, or even death. Please Drink Responsibly.
|
||||||
components:
|
components:
|
||||||
- type: Drink
|
- type: Drink
|
||||||
contents:
|
|
||||||
reagents:
|
|
||||||
- ReagentId: chem.H2O
|
|
||||||
Quantity: 4
|
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Objects/Drinks/thirteen_loko.rsi
|
sprite: Objects/Drinks/thirteen_loko.rsi
|
||||||
- type: Icon
|
- type: Icon
|
||||||
|
|||||||
@@ -5,8 +5,11 @@
|
|||||||
name: Base cup
|
name: Base cup
|
||||||
abstract: true
|
abstract: true
|
||||||
components:
|
components:
|
||||||
|
- type: Solution
|
||||||
|
maxVol: 20
|
||||||
|
- type: Pourable
|
||||||
|
transferAmount: 5
|
||||||
- type: Drink
|
- type: Drink
|
||||||
max_volume: 4
|
|
||||||
despawn_empty: false
|
despawn_empty: false
|
||||||
- type: Sound
|
- type: Sound
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
@@ -20,8 +23,8 @@
|
|||||||
name: Golden cup
|
name: Golden cup
|
||||||
description: A golden cup
|
description: A golden cup
|
||||||
components:
|
components:
|
||||||
- type: Drink
|
- type: Solution
|
||||||
max_volume: 10
|
maxVol: 10
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Objects/Drinks/golden_cup.rsi
|
sprite: Objects/Drinks/golden_cup.rsi
|
||||||
- type: Icon
|
- type: Icon
|
||||||
@@ -33,8 +36,8 @@
|
|||||||
name: Insulated pitcher
|
name: Insulated pitcher
|
||||||
description: A stainless steel insulated pitcher. Everyone's best friend in the morning.
|
description: A stainless steel insulated pitcher. Everyone's best friend in the morning.
|
||||||
components:
|
components:
|
||||||
- type: Drink
|
- type: Solution
|
||||||
max_volume: 15
|
maxVol: 15
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Objects/Drinks/pitcher.rsi
|
sprite: Objects/Drinks/pitcher.rsi
|
||||||
state: icon-6
|
state: icon-6
|
||||||
@@ -52,8 +55,8 @@
|
|||||||
name: Mug
|
name: Mug
|
||||||
description: A plain white mug.
|
description: A plain white mug.
|
||||||
components:
|
components:
|
||||||
- type: Drink
|
- type: Solution
|
||||||
max_volume: 4
|
maxVol: 10
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Objects/Drinks/mug.rsi
|
sprite: Objects/Drinks/mug.rsi
|
||||||
state: icon-3
|
state: icon-3
|
||||||
@@ -71,8 +74,8 @@
|
|||||||
name: Mug Black
|
name: Mug Black
|
||||||
description: A sleek black mug.
|
description: A sleek black mug.
|
||||||
components:
|
components:
|
||||||
- type: Drink
|
- type: Solution
|
||||||
max_volume: 4
|
maxVol: 10
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Objects/Drinks/mug_black.rsi
|
sprite: Objects/Drinks/mug_black.rsi
|
||||||
state: icon-3
|
state: icon-3
|
||||||
@@ -90,8 +93,8 @@
|
|||||||
name: Mug Blue
|
name: Mug Blue
|
||||||
description: A blue and black mug.
|
description: A blue and black mug.
|
||||||
components:
|
components:
|
||||||
- type: Drink
|
- type: Solution
|
||||||
max_volume: 4
|
maxVol: 10
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Objects/Drinks/mug_blue.rsi
|
sprite: Objects/Drinks/mug_blue.rsi
|
||||||
state: icon-3
|
state: icon-3
|
||||||
@@ -109,8 +112,8 @@
|
|||||||
name: Mug Green
|
name: Mug Green
|
||||||
description: A pale green and pink mug.
|
description: A pale green and pink mug.
|
||||||
components:
|
components:
|
||||||
- type: Drink
|
- type: Solution
|
||||||
max_volume: 4
|
maxVol: 10
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Objects/Drinks/mug_green.rsi
|
sprite: Objects/Drinks/mug_green.rsi
|
||||||
state: icon-3
|
state: icon-3
|
||||||
@@ -128,8 +131,8 @@
|
|||||||
name: Mug Heart
|
name: Mug Heart
|
||||||
description: A white mug, it prominently features a red heart.
|
description: A white mug, it prominently features a red heart.
|
||||||
components:
|
components:
|
||||||
- type: Drink
|
- type: Solution
|
||||||
max_volume: 4
|
maxVol: 10
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Objects/Drinks/mug_heart.rsi
|
sprite: Objects/Drinks/mug_heart.rsi
|
||||||
state: icon-3
|
state: icon-3
|
||||||
@@ -147,8 +150,8 @@
|
|||||||
name: Mug Metal
|
name: Mug Metal
|
||||||
description: A metal mug. You're not sure which metal.
|
description: A metal mug. You're not sure which metal.
|
||||||
components:
|
components:
|
||||||
- type: Drink
|
- type: Solution
|
||||||
max_volume: 4
|
maxVol: 10
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Objects/Drinks/mug_metal.rsi
|
sprite: Objects/Drinks/mug_metal.rsi
|
||||||
state: icon-3
|
state: icon-3
|
||||||
@@ -166,8 +169,8 @@
|
|||||||
name: Mug Moebius
|
name: Mug Moebius
|
||||||
description: A mug with a Moebius Laboratories logo on it. Not even your morning coffee is safe from corporate advertising.
|
description: A mug with a Moebius Laboratories logo on it. Not even your morning coffee is safe from corporate advertising.
|
||||||
components:
|
components:
|
||||||
- type: Drink
|
- type: Solution
|
||||||
max_volume: 4
|
maxVol: 10
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Objects/Drinks/mug_moebius.rsi
|
sprite: Objects/Drinks/mug_moebius.rsi
|
||||||
state: icon-3
|
state: icon-3
|
||||||
@@ -185,8 +188,8 @@
|
|||||||
name: "#1 mug"
|
name: "#1 mug"
|
||||||
description: "A white mug, it prominently features a #1."
|
description: "A white mug, it prominently features a #1."
|
||||||
components:
|
components:
|
||||||
- type: Drink
|
- type: Solution
|
||||||
max_volume: 4
|
maxVol: 10
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Objects/Drinks/mug_one.rsi
|
sprite: Objects/Drinks/mug_one.rsi
|
||||||
state: icon-3
|
state: icon-3
|
||||||
@@ -204,8 +207,8 @@
|
|||||||
name: Mug Rainbow
|
name: Mug Rainbow
|
||||||
description: A rainbow mug. The colors are almost as blinding as a welder.
|
description: A rainbow mug. The colors are almost as blinding as a welder.
|
||||||
components:
|
components:
|
||||||
- type: Drink
|
- type: Solution
|
||||||
max_volume: 4
|
maxVol: 10
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Objects/Drinks/mug_rainbow.rsi
|
sprite: Objects/Drinks/mug_rainbow.rsi
|
||||||
state: icon-3
|
state: icon-3
|
||||||
@@ -223,8 +226,8 @@
|
|||||||
name: Mug Red
|
name: Mug Red
|
||||||
description: A red and black mug.
|
description: A red and black mug.
|
||||||
components:
|
components:
|
||||||
- type: Drink
|
- type: Solution
|
||||||
max_volume: 4
|
maxVol: 10
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Objects/Drinks/mug_red.rsi
|
sprite: Objects/Drinks/mug_red.rsi
|
||||||
state: icon-3
|
state: icon-3
|
||||||
|
|||||||
@@ -10,13 +10,12 @@
|
|||||||
state: icon
|
state: icon
|
||||||
- type: Icon
|
- type: Icon
|
||||||
state: icon
|
state: icon
|
||||||
|
- type: Solution
|
||||||
|
maxVol: 10
|
||||||
|
- type: Pourable
|
||||||
|
transferAmount: 5
|
||||||
- type: Drink
|
- type: Drink
|
||||||
despawn_empty: false
|
despawn_empty: false
|
||||||
max_volume: 10
|
|
||||||
contents:
|
|
||||||
reagents:
|
|
||||||
- ReagentId: chem.H2O
|
|
||||||
Quantity: 0
|
|
||||||
|
|
||||||
# Containers
|
# Containers
|
||||||
- type: entity
|
- type: entity
|
||||||
@@ -89,19 +88,6 @@
|
|||||||
- type: Icon
|
- type: Icon
|
||||||
sprite: Objects/TrashDrinks/ginbottle_empty.rsi
|
sprite: Objects/TrashDrinks/ginbottle_empty.rsi
|
||||||
|
|
||||||
# Couldn't think of a nice place to put this
|
|
||||||
- type: entity
|
|
||||||
name: Empty glass
|
|
||||||
parent: DrinkBottleBase
|
|
||||||
id: DrinkEmptyGlass
|
|
||||||
components:
|
|
||||||
- type: Sprite
|
|
||||||
sprite: Objects/TrashDrinks/alebottle_empty.rsi
|
|
||||||
- type: Icon
|
|
||||||
sprite: Objects/TrashDrinks/alebottle_empty.rsi
|
|
||||||
- type: Solution
|
|
||||||
max_volume: 4
|
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
name: Goldschlager bottle
|
name: Goldschlager bottle
|
||||||
parent: DrinkBottleBase
|
parent: DrinkBottleBase
|
||||||
|
|||||||
@@ -9,7 +9,8 @@
|
|||||||
- type: Icon
|
- type: Icon
|
||||||
texture: Objects/Chemistry/chemicals.rsi/beaker.png
|
texture: Objects/Chemistry/chemicals.rsi/beaker.png
|
||||||
- type: Solution
|
- type: Solution
|
||||||
maxVol: 50.0
|
fillingState: beaker
|
||||||
|
maxVol: 50
|
||||||
caps: 27
|
caps: 27
|
||||||
- type: Pourable
|
- type: Pourable
|
||||||
transferAmount: 5.0
|
transferAmount: 5.0
|
||||||
@@ -25,7 +26,8 @@
|
|||||||
- type: Icon
|
- type: Icon
|
||||||
texture: Objects/Chemistry/chemicals.rsi/beakerlarge.png
|
texture: Objects/Chemistry/chemicals.rsi/beakerlarge.png
|
||||||
- type: Solution
|
- type: Solution
|
||||||
maxVol: 100.0
|
fillingState: beakerlarge
|
||||||
|
maxVol: 100
|
||||||
caps: 27
|
caps: 27
|
||||||
- type: Pourable
|
- type: Pourable
|
||||||
transferAmount: 5.0
|
transferAmount: 5.0
|
||||||
@@ -41,7 +43,9 @@
|
|||||||
- type: Icon
|
- type: Icon
|
||||||
texture: Objects/Chemistry/chemicals.rsi/dropper.png
|
texture: Objects/Chemistry/chemicals.rsi/dropper.png
|
||||||
- type: Solution
|
- type: Solution
|
||||||
maxVol: 5.0
|
fillingState: dropper
|
||||||
|
fillingSteps: 2
|
||||||
|
maxVol: 5
|
||||||
caps: 19
|
caps: 19
|
||||||
- type: Pourable
|
- type: Pourable
|
||||||
transferAmount: 5.0
|
transferAmount: 5.0
|
||||||
@@ -53,11 +57,13 @@
|
|||||||
id: Syringe
|
id: Syringe
|
||||||
components:
|
components:
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
texture: Objects/Chemistry/chemicals.rsi/syringeproj.png
|
texture: Objects/Chemistry/syringe.rsi/0.png
|
||||||
- type: Icon
|
- type: Icon
|
||||||
texture: Objects/Chemistry/chemicals.rsi/syringeproj.png
|
texture: Objects/Chemistry/syringe.rsi/0.png
|
||||||
- type: Solution
|
- type: Solution
|
||||||
maxVol: 15.0
|
fillingState: syringe
|
||||||
|
fillingSteps: 5
|
||||||
|
maxVol: 15
|
||||||
caps: 19
|
caps: 19
|
||||||
- type: Injector
|
- type: Injector
|
||||||
injectOnly: false
|
injectOnly: false
|
||||||
|
|||||||
@@ -14,11 +14,14 @@
|
|||||||
- type: Hunger
|
- type: Hunger
|
||||||
- type: Thirst
|
- type: Thirst
|
||||||
# Organs
|
# Organs
|
||||||
- type: Stomach
|
- type: Solution
|
||||||
maxVolume: 100
|
maxVol: 250
|
||||||
digestionDelay: 20
|
|
||||||
- type: Bloodstream
|
- type: Bloodstream
|
||||||
maxVolume: 250
|
max_volume: 100
|
||||||
|
- type: Stomach
|
||||||
|
max_volume: 250
|
||||||
|
digestionDelay: 20
|
||||||
|
|
||||||
|
|
||||||
- type: Inventory
|
- type: Inventory
|
||||||
- type: Constructor
|
- type: Constructor
|
||||||
@@ -147,8 +150,6 @@
|
|||||||
hands:
|
hands:
|
||||||
- left
|
- left
|
||||||
- right
|
- right
|
||||||
# Organs
|
|
||||||
- type: Stomach
|
|
||||||
|
|
||||||
- type: Inventory
|
- type: Inventory
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
|
|||||||
103
Resources/Prototypes/Reactions/drinks.yml
Normal file
@@ -0,0 +1,103 @@
|
|||||||
|
- type: reaction
|
||||||
|
id: react.ManlyDorf
|
||||||
|
reactants:
|
||||||
|
chem.Beer:
|
||||||
|
amount: 1
|
||||||
|
chem.Ale:
|
||||||
|
amount: 2
|
||||||
|
products:
|
||||||
|
chem.ManlyDorf: 3
|
||||||
|
|
||||||
|
- type: reaction
|
||||||
|
id: react.CubaLibre
|
||||||
|
reactants:
|
||||||
|
chem.Cola:
|
||||||
|
amount: 1
|
||||||
|
chem.Rum:
|
||||||
|
amount: 2
|
||||||
|
products:
|
||||||
|
chem.CubaLibre: 3
|
||||||
|
|
||||||
|
- type: reaction
|
||||||
|
id: react.IrishCream
|
||||||
|
reactants:
|
||||||
|
chem.Cream:
|
||||||
|
amount: 1
|
||||||
|
chem.Whiskey:
|
||||||
|
amount: 2
|
||||||
|
products:
|
||||||
|
chem.IrishCream: 3
|
||||||
|
|
||||||
|
- type: reaction
|
||||||
|
id: react.IrishCoffee
|
||||||
|
reactants:
|
||||||
|
chem.IrishCream:
|
||||||
|
amount: 2
|
||||||
|
chem.Coffee:
|
||||||
|
amount: 2
|
||||||
|
products:
|
||||||
|
chem.IrishCoffee: 4
|
||||||
|
|
||||||
|
- type: reaction
|
||||||
|
id: react.IrishCarBomb
|
||||||
|
reactants:
|
||||||
|
chem.IrishCream:
|
||||||
|
amount: 1
|
||||||
|
chem.Ale:
|
||||||
|
amount: 1
|
||||||
|
products:
|
||||||
|
chem.IrishCarBomb: 2
|
||||||
|
|
||||||
|
- type: reaction
|
||||||
|
id: react.B52
|
||||||
|
reactants:
|
||||||
|
chem.IrishCarBomb:
|
||||||
|
amount: 1
|
||||||
|
chem.Kahlua:
|
||||||
|
amount: 1
|
||||||
|
chem.Cognac:
|
||||||
|
amount: 1
|
||||||
|
products:
|
||||||
|
chem.B52: 3
|
||||||
|
|
||||||
|
- type: reaction
|
||||||
|
id: react.AtomicBomb
|
||||||
|
reactants:
|
||||||
|
chem.B52:
|
||||||
|
amount: 10
|
||||||
|
chem.U:
|
||||||
|
amount: 1
|
||||||
|
products:
|
||||||
|
chem.AtomicBomb: 11
|
||||||
|
|
||||||
|
- type: reaction
|
||||||
|
id: react.WhiskeyCola
|
||||||
|
reactants:
|
||||||
|
chem.Whiskey:
|
||||||
|
amount: 2
|
||||||
|
chem.Cola:
|
||||||
|
amount: 1
|
||||||
|
products:
|
||||||
|
chem.WhiskeyCola: 3
|
||||||
|
|
||||||
|
- type: reaction
|
||||||
|
id: react.SyndicateBomb
|
||||||
|
reactants:
|
||||||
|
chem.WhiskeyCola:
|
||||||
|
amount: 1
|
||||||
|
chem.Beer:
|
||||||
|
amount: 1
|
||||||
|
products:
|
||||||
|
chem.SyndicateBomb: 2
|
||||||
|
|
||||||
|
- type: reaction
|
||||||
|
id: react.Antifreeze
|
||||||
|
reactants:
|
||||||
|
chem.Vodka:
|
||||||
|
amount: 2
|
||||||
|
chem.Cream:
|
||||||
|
amount: 1
|
||||||
|
chem.Ice:
|
||||||
|
amount: 1
|
||||||
|
products:
|
||||||
|
chem.Antifreeze: 4
|
||||||
@@ -2,6 +2,7 @@
|
|||||||
id: chem.Nutriment
|
id: chem.Nutriment
|
||||||
name: Nutriment
|
name: Nutriment
|
||||||
desc: Generic nutrition
|
desc: Generic nutrition
|
||||||
|
color: "#664330"
|
||||||
metabolism:
|
metabolism:
|
||||||
- !type:DefaultFood
|
- !type:DefaultFood
|
||||||
rate: 1
|
rate: 1
|
||||||
@@ -10,11 +11,13 @@
|
|||||||
id: chem.H2SO4
|
id: chem.H2SO4
|
||||||
name: Sulfuric Acid
|
name: Sulfuric Acid
|
||||||
desc: A highly corrosive, oily, colorless liquid.
|
desc: A highly corrosive, oily, colorless liquid.
|
||||||
|
color: "#BF8C00"
|
||||||
|
|
||||||
- type: reagent
|
- type: reagent
|
||||||
id: chem.H2O
|
id: chem.H2O
|
||||||
name: Water
|
name: Water
|
||||||
desc: A tasty colorless liquid.
|
desc: A tasty colorless liquid.
|
||||||
|
color: "#808080"
|
||||||
metabolism:
|
metabolism:
|
||||||
- !type:DefaultDrink
|
- !type:DefaultDrink
|
||||||
rate: 1
|
rate: 1
|
||||||
@@ -29,6 +32,7 @@
|
|||||||
id: chem.Plasma
|
id: chem.Plasma
|
||||||
name: Plasma
|
name: Plasma
|
||||||
desc: Funky, space-magic pixie dust. You probably shouldn't eat this, but we both know you will anyways.
|
desc: Funky, space-magic pixie dust. You probably shouldn't eat this, but we both know you will anyways.
|
||||||
|
color: "#500064"
|
||||||
|
|
||||||
- type: reagent
|
- type: reagent
|
||||||
id: chem.Ethanol
|
id: chem.Ethanol
|
||||||
|
|||||||
@@ -2,21 +2,126 @@
|
|||||||
id: chem.Whiskey
|
id: chem.Whiskey
|
||||||
name: Whiskey
|
name: Whiskey
|
||||||
desc: An alcoholic beverage made from fermented grain mash
|
desc: An alcoholic beverage made from fermented grain mash
|
||||||
|
color: "#664300"
|
||||||
|
spritePath: whiskeyglass.rsi
|
||||||
|
|
||||||
- type: reagent
|
- type: reagent
|
||||||
id: chem.Ale
|
id: chem.Ale
|
||||||
name: Ale
|
name: Ale
|
||||||
desc: A type of beer brewed using a warm fermentation method, resulting in a sweet, full-bodied and fruity taste.
|
desc: A type of beer brewed using a warm fermentation method, resulting in a sweet, full-bodied and fruity taste.
|
||||||
|
color: "#664300"
|
||||||
|
spritePath: aleglass.rsi
|
||||||
|
|
||||||
- type: reagent
|
- type: reagent
|
||||||
id: chem.Wine
|
id: chem.Wine
|
||||||
name: Wine
|
name: Wine
|
||||||
desc: An alcoholic drink made from fermented grapes
|
desc: An alcoholic drink made from fermented grapes
|
||||||
|
color: "#7E4043"
|
||||||
|
spritePath: wineglass.rsi
|
||||||
|
|
||||||
|
- type: reagent
|
||||||
|
id: chem.Beer
|
||||||
|
name: Beer
|
||||||
|
desc: A cold pint of pale lager.
|
||||||
|
color: "#664300"
|
||||||
|
spritePath: beerglass.rsi
|
||||||
|
|
||||||
|
- type: reagent
|
||||||
|
id: chem.Vodka
|
||||||
|
name: Vodka
|
||||||
|
desc: The glass contain wodka. Xynta.
|
||||||
|
color: "#664300"
|
||||||
|
|
||||||
|
- type: reagent
|
||||||
|
id: chem.Kahlua
|
||||||
|
name: Kahlua
|
||||||
|
desc: A widely known, Mexican coffee-flavoured liqueur. In production since 1936!
|
||||||
|
color: "#664300"
|
||||||
|
spritePath: kahluaglass.rsi
|
||||||
|
|
||||||
|
- type: reagent
|
||||||
|
id: chem.Cognac
|
||||||
|
name: Cognac
|
||||||
|
desc: A sweet and strongly alcoholic drink, twice distilled and left to mature for several years. Classy as fornication.
|
||||||
|
color: "#AB3C05"
|
||||||
|
spritePath: cognacglass.rsi
|
||||||
|
|
||||||
|
- type: reagent
|
||||||
|
id: chem.ManlyDorf
|
||||||
|
name: Manly Dorf
|
||||||
|
desc: A dwarfy concoction made from ale and beer. Intended for stout dwarves only.
|
||||||
|
color: "#664300"
|
||||||
|
spritePath: manlydorfglass.rsi
|
||||||
|
|
||||||
|
- type: reagent
|
||||||
|
id: chem.CubaLibre
|
||||||
|
name: Cuba Libre
|
||||||
|
desc: A classic mix of rum and cola.
|
||||||
|
color: "#3E1B00"
|
||||||
|
spritePath: cubalibreglass.rsi
|
||||||
|
|
||||||
|
- type: reagent
|
||||||
|
id: chem.IrishCarBomb
|
||||||
|
name: Irish Car Bomb
|
||||||
|
desc: A troubling mixture of irish cream and ale.
|
||||||
|
color: "#2E6671"
|
||||||
|
spritePath: irishcarbomb.rsi
|
||||||
|
|
||||||
|
- type: reagent
|
||||||
|
id: chem.IrishCoffee
|
||||||
|
name: Irish Coffee
|
||||||
|
desc: Coffee served with irish cream. Regular cream just isn't the same!
|
||||||
|
color: "#664300"
|
||||||
|
spritePath: irishcoffeeglass.rsi
|
||||||
|
|
||||||
|
- type: reagent
|
||||||
|
id: chem.IrishCream
|
||||||
|
name: Irish Cream
|
||||||
|
desc: Whiskey-imbued cream. What else could you expect from the Irish.
|
||||||
|
color: "#664300"
|
||||||
|
spritePath: irishcreamglass.rsi
|
||||||
|
|
||||||
|
- type: reagent
|
||||||
|
id: chem.B52
|
||||||
|
name: B-52
|
||||||
|
desc: Coffee, irish cream, and cognac. You will get bombed.
|
||||||
|
color: "#664300"
|
||||||
|
spritePath: b52glass.rsi
|
||||||
|
|
||||||
|
- type: reagent
|
||||||
|
id: chem.AtomicBomb
|
||||||
|
name: Atomic Bomb
|
||||||
|
desc: Nuclear proliferation never tasted so good.
|
||||||
|
color: "#666300"
|
||||||
|
spritePath: atomicbombglass.rsi
|
||||||
|
|
||||||
|
- type: reagent
|
||||||
|
id: chem.WhiskeyCola
|
||||||
|
name: Whiskey Cola
|
||||||
|
desc: An innocent-looking mixture of cola and whiskey. Delicious.
|
||||||
|
color: "#3E1B00"
|
||||||
|
spritePath: whiskeycolaglass.rsi
|
||||||
|
|
||||||
|
- type: reagent
|
||||||
|
id: chem.SyndicateBomb
|
||||||
|
name: Syndicate Bomb
|
||||||
|
desc: Somebody set us up the bomb!
|
||||||
|
color: "#2E6671"
|
||||||
|
spritePath: syndicatebomb.rsi
|
||||||
|
|
||||||
|
- type: reagent
|
||||||
|
id: chem.Antifreeze
|
||||||
|
name: Antifreeze
|
||||||
|
desc: The ultimate refreshment.
|
||||||
|
color: "#664300"
|
||||||
|
spritePath: antifreeze.rsi
|
||||||
|
|
||||||
|
|
||||||
- type: reagent
|
- type: reagent
|
||||||
id: chem.Cola
|
id: chem.Cola
|
||||||
name: Cola
|
name: Cola
|
||||||
desc: A sweet, carbonated soft drink. Caffeine free.
|
desc: A sweet, carbonated soft drink. Caffeine free.
|
||||||
|
color: "#100800"
|
||||||
metabolism:
|
metabolism:
|
||||||
- !type:DefaultDrink
|
- !type:DefaultDrink
|
||||||
rate: 1
|
rate: 1
|
||||||
@@ -25,6 +130,7 @@
|
|||||||
id: chem.Coffee
|
id: chem.Coffee
|
||||||
name: Coffee
|
name: Coffee
|
||||||
desc: A drink made from brewed coffee beans. Contains a moderate amount of caffeine.
|
desc: A drink made from brewed coffee beans. Contains a moderate amount of caffeine.
|
||||||
|
color: "#664300"
|
||||||
metabolism:
|
metabolism:
|
||||||
- !type:DefaultDrink
|
- !type:DefaultDrink
|
||||||
rate: 1
|
rate: 1
|
||||||
@@ -33,6 +139,25 @@
|
|||||||
id: chem.Tea
|
id: chem.Tea
|
||||||
name: Tea
|
name: Tea
|
||||||
desc: A made by boiling leaves of the tea tree, Camellia sinensis.
|
desc: A made by boiling leaves of the tea tree, Camellia sinensis.
|
||||||
|
color: "#101000"
|
||||||
|
metabolism:
|
||||||
|
- !type:DefaultDrink
|
||||||
|
rate: 1
|
||||||
|
|
||||||
|
- type: reagent
|
||||||
|
id: chem.Cream
|
||||||
|
name: Cream
|
||||||
|
desc: The fatty, still liquid part of milk. Why don't you mix this with sum scotch, eh?
|
||||||
|
color: "#DFD7AF"
|
||||||
|
metabolism:
|
||||||
|
- !type:DefaultDrink
|
||||||
|
rate: 1
|
||||||
|
|
||||||
|
- type: reagent
|
||||||
|
id: chem.Milk
|
||||||
|
name: Milk
|
||||||
|
desc: An opaque white liquid produced by the mammary glands of mammals.
|
||||||
|
color: "#DFDFDF"
|
||||||
metabolism:
|
metabolism:
|
||||||
- !type:DefaultDrink
|
- !type:DefaultDrink
|
||||||
rate: 1
|
rate: 1
|
||||||
@@ -2,11 +2,13 @@
|
|||||||
id: chem.H
|
id: chem.H
|
||||||
name: Hydrogen
|
name: Hydrogen
|
||||||
desc: A light, flammable gas.
|
desc: A light, flammable gas.
|
||||||
|
color: "#808080"
|
||||||
|
|
||||||
- type: reagent
|
- type: reagent
|
||||||
id: chem.O
|
id: chem.O
|
||||||
name: Oxygen
|
name: Oxygen
|
||||||
desc: An oxidizing, colorless gas.
|
desc: An oxidizing, colorless gas.
|
||||||
|
color: "#808080"
|
||||||
|
|
||||||
- type: reagent
|
- type: reagent
|
||||||
id: chem.S
|
id: chem.S
|
||||||
@@ -36,6 +38,7 @@
|
|||||||
id: chem.N
|
id: chem.N
|
||||||
name: Nitrogen
|
name: Nitrogen
|
||||||
desc: A colorless, odorless unreactive gas. Highly stable.
|
desc: A colorless, odorless unreactive gas. Highly stable.
|
||||||
|
color: "#808080"
|
||||||
|
|
||||||
- type: reagent
|
- type: reagent
|
||||||
id: chem.Fe
|
id: chem.Fe
|
||||||
@@ -47,6 +50,7 @@
|
|||||||
id: chem.F
|
id: chem.F
|
||||||
name: Fluorine
|
name: Fluorine
|
||||||
desc: A highly toxic pale yellow gas. Extremely reactive.
|
desc: A highly toxic pale yellow gas. Extremely reactive.
|
||||||
|
color: "#808080"
|
||||||
|
|
||||||
- type: reagent
|
- type: reagent
|
||||||
id: chem.Si
|
id: chem.Si
|
||||||
@@ -95,3 +99,9 @@
|
|||||||
name: Sodium
|
name: Sodium
|
||||||
desc: A silvery-white alkali metal. Highly reactive in it's pure form.
|
desc: A silvery-white alkali metal. Highly reactive in it's pure form.
|
||||||
color: "#c6c8cc"
|
color: "#c6c8cc"
|
||||||
|
|
||||||
|
- type: reagent
|
||||||
|
id: chem.U
|
||||||
|
name: Uranium
|
||||||
|
desc: A silvery-white metallic chemical element in the actinide series, weakly radioactive.
|
||||||
|
color: "#00ff06"
|
||||||
BIN
Resources/Textures/Objects/Chemistry/fillings.rsi/backpack1.png
Normal file
|
After Width: | Height: | Size: 127 B |
BIN
Resources/Textures/Objects/Chemistry/fillings.rsi/backpack2.png
Normal file
|
After Width: | Height: | Size: 149 B |
|
After Width: | Height: | Size: 164 B |
|
After Width: | Height: | Size: 173 B |
BIN
Resources/Textures/Objects/Chemistry/fillings.rsi/beaker1.png
Normal file
|
After Width: | Height: | Size: 137 B |
BIN
Resources/Textures/Objects/Chemistry/fillings.rsi/beaker2.png
Normal file
|
After Width: | Height: | Size: 145 B |
BIN
Resources/Textures/Objects/Chemistry/fillings.rsi/beaker3.png
Normal file
|
After Width: | Height: | Size: 151 B |
BIN
Resources/Textures/Objects/Chemistry/fillings.rsi/beaker4.png
Normal file
|
After Width: | Height: | Size: 162 B |
BIN
Resources/Textures/Objects/Chemistry/fillings.rsi/beaker5.png
Normal file
|
After Width: | Height: | Size: 160 B |
BIN
Resources/Textures/Objects/Chemistry/fillings.rsi/beaker6.png
Normal file
|
After Width: | Height: | Size: 167 B |
|
After Width: | Height: | Size: 129 B |
|
After Width: | Height: | Size: 146 B |
|
After Width: | Height: | Size: 166 B |
|
After Width: | Height: | Size: 164 B |
|
After Width: | Height: | Size: 171 B |
|
After Width: | Height: | Size: 164 B |
BIN
Resources/Textures/Objects/Chemistry/fillings.rsi/bottle-1-1.png
Normal file
|
After Width: | Height: | Size: 109 B |
BIN
Resources/Textures/Objects/Chemistry/fillings.rsi/bottle-1-2.png
Normal file
|
After Width: | Height: | Size: 121 B |
BIN
Resources/Textures/Objects/Chemistry/fillings.rsi/bottle-1-3.png
Normal file
|
After Width: | Height: | Size: 134 B |
BIN
Resources/Textures/Objects/Chemistry/fillings.rsi/bottle-1-4.png
Normal file
|
After Width: | Height: | Size: 136 B |
BIN
Resources/Textures/Objects/Chemistry/fillings.rsi/bottle-1-5.png
Normal file
|
After Width: | Height: | Size: 136 B |
BIN
Resources/Textures/Objects/Chemistry/fillings.rsi/bottle-1-6.png
Normal file
|
After Width: | Height: | Size: 142 B |
BIN
Resources/Textures/Objects/Chemistry/fillings.rsi/bottle-2-1.png
Normal file
|
After Width: | Height: | Size: 109 B |
BIN
Resources/Textures/Objects/Chemistry/fillings.rsi/bottle-2-2.png
Normal file
|
After Width: | Height: | Size: 126 B |
BIN
Resources/Textures/Objects/Chemistry/fillings.rsi/bottle-2-3.png
Normal file
|
After Width: | Height: | Size: 126 B |
BIN
Resources/Textures/Objects/Chemistry/fillings.rsi/bottle-2-4.png
Normal file
|
After Width: | Height: | Size: 134 B |
BIN
Resources/Textures/Objects/Chemistry/fillings.rsi/bottle-2-5.png
Normal file
|
After Width: | Height: | Size: 153 B |
BIN
Resources/Textures/Objects/Chemistry/fillings.rsi/bottle-2-6.png
Normal file
|
After Width: | Height: | Size: 151 B |
BIN
Resources/Textures/Objects/Chemistry/fillings.rsi/bottle-3-1.png
Normal file
|
After Width: | Height: | Size: 109 B |
BIN
Resources/Textures/Objects/Chemistry/fillings.rsi/bottle-3-2.png
Normal file
|
After Width: | Height: | Size: 101 B |
BIN
Resources/Textures/Objects/Chemistry/fillings.rsi/bottle-3-3.png
Normal file
|
After Width: | Height: | Size: 109 B |
BIN
Resources/Textures/Objects/Chemistry/fillings.rsi/bottle-3-4.png
Normal file
|
After Width: | Height: | Size: 112 B |
BIN
Resources/Textures/Objects/Chemistry/fillings.rsi/bottle-3-5.png
Normal file
|
After Width: | Height: | Size: 127 B |
BIN
Resources/Textures/Objects/Chemistry/fillings.rsi/bottle-3-6.png
Normal file
|
After Width: | Height: | Size: 124 B |
BIN
Resources/Textures/Objects/Chemistry/fillings.rsi/bottle-4-1.png
Normal file
|
After Width: | Height: | Size: 109 B |
BIN
Resources/Textures/Objects/Chemistry/fillings.rsi/bottle-4-2.png
Normal file
|
After Width: | Height: | Size: 125 B |
BIN
Resources/Textures/Objects/Chemistry/fillings.rsi/bottle-4-3.png
Normal file
|
After Width: | Height: | Size: 142 B |
BIN
Resources/Textures/Objects/Chemistry/fillings.rsi/bottle-4-4.png
Normal file
|
After Width: | Height: | Size: 147 B |
BIN
Resources/Textures/Objects/Chemistry/fillings.rsi/bottle-4-5.png
Normal file
|
After Width: | Height: | Size: 146 B |
BIN
Resources/Textures/Objects/Chemistry/fillings.rsi/bottle-4-6.png
Normal file
|
After Width: | Height: | Size: 155 B |
BIN
Resources/Textures/Objects/Chemistry/fillings.rsi/dropper1.png
Normal file
|
After Width: | Height: | Size: 113 B |
BIN
Resources/Textures/Objects/Chemistry/fillings.rsi/glass1.png
Normal file
|
After Width: | Height: | Size: 131 B |
BIN
Resources/Textures/Objects/Chemistry/fillings.rsi/glass2.png
Normal file
|
After Width: | Height: | Size: 152 B |
BIN
Resources/Textures/Objects/Chemistry/fillings.rsi/glass3.png
Normal file
|
After Width: | Height: | Size: 152 B |
BIN
Resources/Textures/Objects/Chemistry/fillings.rsi/glass4.png
Normal file
|
After Width: | Height: | Size: 164 B |
BIN
Resources/Textures/Objects/Chemistry/fillings.rsi/glass5.png
Normal file
|
After Width: | Height: | Size: 155 B |
BIN
Resources/Textures/Objects/Chemistry/fillings.rsi/glass6.png
Normal file
|
After Width: | Height: | Size: 154 B |
|
After Width: | Height: | Size: 141 B |
|
After Width: | Height: | Size: 168 B |
|
After Width: | Height: | Size: 177 B |
|
After Width: | Height: | Size: 180 B |
|
After Width: | Height: | Size: 193 B |
|
After Width: | Height: | Size: 213 B |
@@ -0,0 +1 @@
|
|||||||
|
{"version": 1, "size": {"x": 32, "y": 32}, "states": [{"name": "backpack1", "directions": 1, "delays": [[1.0]]}, {"name": "backpack2", "directions": 1, "delays": [[1.0]]}, {"name": "backpackmob1", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}, {"name": "backpackmob2", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}, {"name": "beaker1", "directions": 1, "delays": [[1.0]]}, {"name": "beaker2", "directions": 1, "delays": [[1.0]]}, {"name": "beaker3", "directions": 1, "delays": [[1.0]]}, {"name": "beaker4", "directions": 1, "delays": [[1.0]]}, {"name": "beaker5", "directions": 1, "delays": [[1.0]]}, {"name": "beaker6", "directions": 1, "delays": [[1.0]]}, {"name": "beakerlarge1", "directions": 1, "delays": [[1.0]]}, {"name": "beakerlarge2", "directions": 1, "delays": [[1.0]]}, {"name": "beakerlarge3", "directions": 1, "delays": [[1.0]]}, {"name": "beakerlarge4", "directions": 1, "delays": [[1.0]]}, {"name": "beakerlarge5", "directions": 1, "delays": [[1.0]]}, {"name": "beakerlarge6", "directions": 1, "delays": [[1.0]]}, {"name": "bottle-1-1", "directions": 1, "delays": [[1.0]]}, {"name": "bottle-1-2", "directions": 1, "delays": [[1.0]]}, {"name": "bottle-1-3", "directions": 1, "delays": [[1.0]]}, {"name": "bottle-1-4", "directions": 1, "delays": [[1.0]]}, {"name": "bottle-1-5", "directions": 1, "delays": [[1.0]]}, {"name": "bottle-1-6", "directions": 1, "delays": [[1.0]]}, {"name": "bottle-2-1", "directions": 1, "delays": [[1.0]]}, {"name": "bottle-2-2", "directions": 1, "delays": [[1.0]]}, {"name": "bottle-2-3", "directions": 1, "delays": [[1.0]]}, {"name": "bottle-2-4", "directions": 1, "delays": [[1.0]]}, {"name": "bottle-2-5", "directions": 1, "delays": [[1.0]]}, {"name": "bottle-2-6", "directions": 1, "delays": [[1.0]]}, {"name": "bottle-3-1", "directions": 1, "delays": [[1.0]]}, {"name": "bottle-3-2", "directions": 1, "delays": [[1.0]]}, {"name": "bottle-3-3", "directions": 1, "delays": [[1.0]]}, {"name": "bottle-3-4", "directions": 1, "delays": [[1.0]]}, {"name": "bottle-3-5", "directions": 1, "delays": [[1.0]]}, {"name": "bottle-3-6", "directions": 1, "delays": [[1.0]]}, {"name": "bottle-4-1", "directions": 1, "delays": [[1.0]]}, {"name": "bottle-4-2", "directions": 1, "delays": [[1.0]]}, {"name": "bottle-4-3", "directions": 1, "delays": [[1.0]]}, {"name": "bottle-4-4", "directions": 1, "delays": [[1.0]]}, {"name": "bottle-4-5", "directions": 1, "delays": [[1.0]]}, {"name": "bottle-4-6", "directions": 1, "delays": [[1.0]]}, {"name": "dropper1", "directions": 1, "delays": [[1.0]]}, {"name": "glass1", "directions": 1, "delays": [[1.0]]}, {"name": "glass2", "directions": 1, "delays": [[1.0]]}, {"name": "glass3", "directions": 1, "delays": [[1.0]]}, {"name": "glass4", "directions": 1, "delays": [[1.0]]}, {"name": "glass5", "directions": 1, "delays": [[1.0]]}, {"name": "glass6", "directions": 1, "delays": [[1.0]]}, {"name": "largebottle1", "directions": 1, "delays": [[1.0]]}, {"name": "largebottle2", "directions": 1, "delays": [[1.0]]}, {"name": "largebottle3", "directions": 1, "delays": [[1.0]]}, {"name": "largebottle4", "directions": 1, "delays": [[1.0]]}, {"name": "largebottle5", "directions": 1, "delays": [[1.0]]}, {"name": "largebottle6", "directions": 1, "delays": [[1.0]]}, {"name": "smallbottle1", "directions": 1, "delays": [[1.0]]}, {"name": "smallbottle2", "directions": 1, "delays": [[1.0]]}, {"name": "smallbottle3", "directions": 1, "delays": [[1.0]]}, {"name": "smallbottle4", "directions": 1, "delays": [[1.0]]}, {"name": "smallbottle5", "directions": 1, "delays": [[1.0]]}, {"name": "smallbottle6", "directions": 1, "delays": [[1.0]]}, {"name": "syringe1", "directions": 1, "delays": [[1.0]]}, {"name": "syringe2", "directions": 1, "delays": [[1.0]]}, {"name": "syringe3", "directions": 1, "delays": [[1.0]]}, {"name": "syringe4", "directions": 1, "delays": [[1.0]]}, {"name": "vial1", "directions": 1, "delays": [[1.0]]}, {"name": "vial2", "directions": 1, "delays": [[1.0]]}, {"name": "vial3", "directions": 1, "delays": [[1.0]]}, {"name": "vial4", "directions": 1, "delays": [[1.0]]}, {"name": "vial5", "directions": 1, "delays": [[1.0]]}, {"name": "vial6", "directions": 1, "delays": [[1.0]]}]}
|
||||||
|
After Width: | Height: | Size: 123 B |
|
After Width: | Height: | Size: 144 B |
|
After Width: | Height: | Size: 163 B |
|
After Width: | Height: | Size: 165 B |
|
After Width: | Height: | Size: 160 B |
|
After Width: | Height: | Size: 163 B |
BIN
Resources/Textures/Objects/Chemistry/fillings.rsi/syringe1.png
Normal file
|
After Width: | Height: | Size: 131 B |
BIN
Resources/Textures/Objects/Chemistry/fillings.rsi/syringe2.png
Normal file
|
After Width: | Height: | Size: 131 B |
BIN
Resources/Textures/Objects/Chemistry/fillings.rsi/syringe3.png
Normal file
|
After Width: | Height: | Size: 131 B |
BIN
Resources/Textures/Objects/Chemistry/fillings.rsi/syringe4.png
Normal file
|
After Width: | Height: | Size: 153 B |
BIN
Resources/Textures/Objects/Chemistry/fillings.rsi/vial1.png
Normal file
|
After Width: | Height: | Size: 102 B |
BIN
Resources/Textures/Objects/Chemistry/fillings.rsi/vial2.png
Normal file
|
After Width: | Height: | Size: 104 B |