diff --git a/Content.Client/_Impstation/Decapoids/Components/VaporizerComponent.cs b/Content.Client/_Impstation/Decapoids/Components/VaporizerComponent.cs deleted file mode 100644 index cb88e1ea0eefe4..00000000000000 --- a/Content.Client/_Impstation/Decapoids/Components/VaporizerComponent.cs +++ /dev/null @@ -1,9 +0,0 @@ -using Content.Shared._Impstation.Decapoids; -using Robust.Shared.GameStates; - -namespace Content.Client._Impstation.Decapoids.Components; - -[RegisterComponent, NetworkedComponent] -public sealed partial class VaporizerComponent : Component -{ -} diff --git a/Content.Client/_Impstation/Decapoids/EntitySystems/VaporizerSystem.cs b/Content.Client/_Impstation/Decapoids/EntitySystems/VaporizerSystem.cs deleted file mode 100644 index a86145de3e9d17..00000000000000 --- a/Content.Client/_Impstation/Decapoids/EntitySystems/VaporizerSystem.cs +++ /dev/null @@ -1,42 +0,0 @@ -using Content.Client._Impstation.Decapoids.Components; -using Content.Shared._Impstation.Decapoids; -using Robust.Client.GameObjects; - -namespace Content.Client._Impstation.Decapoids.EntitySystems; - -public sealed partial class VaporizerSystem : EntitySystem -{ - public override void Initialize() - { - base.Initialize(); - - SubscribeLocalEvent(OnAppearance); - } - - private void OnAppearance(EntityUid uid, VaporizerComponent comp, AppearanceChangeEvent args) - { - if (!args.AppearanceData.TryGetValue(VaporizerVisuals.VisualState, out var state)) - return; - - if (args.Sprite == null) - return; - - var layer = args.Sprite.LayerMapReserveBlank(VaporizerVisualLayers.Indicator); - - switch (state) - { - case VaporizerState.Normal: - args.Sprite.LayerSetState(layer, "normal"); - break; - case VaporizerState.BadSolution: - args.Sprite.LayerSetState(layer, "bad"); - break; - case VaporizerState.LowSolution: - args.Sprite.LayerSetState(layer, "low"); - break; - case VaporizerState.Empty: - args.Sprite.LayerSetState(layer, "empty"); - break; - } - } -} diff --git a/Content.Server/_Impstation/Decapoids/Components/VaporizerComponent.cs b/Content.Server/_Impstation/Decapoids/Components/VaporizerComponent.cs index 2e6931e05127e0..31a19b854feb9d 100644 --- a/Content.Server/_Impstation/Decapoids/Components/VaporizerComponent.cs +++ b/Content.Server/_Impstation/Decapoids/Components/VaporizerComponent.cs @@ -2,12 +2,11 @@ using Content.Shared.Atmos; using Content.Shared.Chemistry.Reagent; using Content.Shared.FixedPoint; -using Robust.Shared.GameStates; using Robust.Shared.Prototypes; namespace Content.Server.Decapoids.Components; -[RegisterComponent, NetworkedComponent] +[RegisterComponent] [AutoGenerateComponentPause] public sealed partial class VaporizerComponent : Component { diff --git a/Content.Server/_Impstation/Decapoids/EntitySystems/VaporizerSystem.cs b/Content.Server/_Impstation/Decapoids/EntitySystems/VaporizerSystem.cs index 915c0af75224fa..aedcc112ef4171 100644 --- a/Content.Server/_Impstation/Decapoids/EntitySystems/VaporizerSystem.cs +++ b/Content.Server/_Impstation/Decapoids/EntitySystems/VaporizerSystem.cs @@ -77,14 +77,13 @@ private void ProcessVaporizerTank(EntityUid uid, VaporizerComponent vaporizer, G if ( gasTank.Air.Pressure < vaporizer.MaxPressure && ( - state == VaporizerState.Empty || + state == VaporizerState.LowSolution || state == VaporizerState.Normal ) ) { - var reagentConsumed = solution.RemoveReagent(new ReagentQuantity(vaporizer.ExpectedReagent, vaporizer.ReagentPerSecond * vaporizer.ProcessDelay.TotalSeconds)); - gasTank.Air.AdjustMoles((int)vaporizer.OutputGas, (float)reagentConsumed * vaporizer.ReagentToMoles); - Dirty(solutionEnt.Value); + var reagentConsumed = _solution.SplitSolution(solutionEnt.Value, vaporizer.ReagentPerSecond * vaporizer.ProcessDelay.TotalSeconds); + gasTank.Air.AdjustMoles((int)vaporizer.OutputGas, (float)reagentConsumed.Volume * vaporizer.ReagentToMoles); } UpdateVisualState(uid, state); @@ -95,7 +94,7 @@ private void UpdateVisualState(EntityUid uid, VaporizerState state, AppearanceCo if (!Resolve(uid, ref appearance)) return; - _appearance.SetData(uid, VaporizerVisuals.VisualState, state); + _appearance.SetData(uid, VaporizerVisuals.Indicator, state); } public override void Update(float frameTime) diff --git a/Content.Shared/_Impstation/Decapoids/VaporizerState.cs b/Content.Shared/_Impstation/Decapoids/VaporizerState.cs index d7d5e7def51f26..695b72228c6a1d 100644 --- a/Content.Shared/_Impstation/Decapoids/VaporizerState.cs +++ b/Content.Shared/_Impstation/Decapoids/VaporizerState.cs @@ -4,12 +4,6 @@ namespace Content.Shared._Impstation.Decapoids; [Serializable, NetSerializable] public enum VaporizerVisuals : byte -{ - VisualState, -} - -[Serializable, NetSerializable] -public enum VaporizerVisualLayers : byte { Indicator, } diff --git a/Resources/Prototypes/_Impstation/Entities/Objects/Decapoid/decapoid_items.yml b/Resources/Prototypes/_Impstation/Entities/Objects/Decapoid/decapoid_items.yml index b85e386b7634d9..6d742f9c812eb7 100644 --- a/Resources/Prototypes/_Impstation/Entities/Objects/Decapoid/decapoid_items.yml +++ b/Resources/Prototypes/_Impstation/Entities/Objects/Decapoid/decapoid_items.yml @@ -111,7 +111,7 @@ parent: GasTankRoundBase id: DecapoidVaporTank description: 'An alien contraption consisting of two tanks. The smaller tank takes in water and converts it into vapor, which is stored in the larger tank. It can hold 5 L of gas, and 30u of fluid.' - components: # todo: some way of knowing that there's an invalid solution + components: - type: Sprite sprite: _Impstation/Objects/Tanks/vapor.rsi layers: @@ -120,7 +120,15 @@ map: [ "enum.SolutionContainerLayers.Fill" ] visible: false - state: normal - map: [ "enum.VaporizerVisualLayers.Indicator" ] + map: [ "indicator" ] + - type: GenericVisualizer + visuals: + enum.VaporizerVisuals.Indicator: + indicator: + Normal: { state: "normal" } + BadSolution: { state: "bad" } + LowSolution: { state: "low" } + Empty: { state: "empty" } - type: Appearance - type: Item size: Normal @@ -177,6 +185,6 @@ solution: waterTank - type: Vaporizer - type: SolutionContainerVisuals - maxFillLevels: 4 + maxFillLevels: 5 fillBaseName: fill- solutionName: waterTank diff --git a/Resources/Textures/_Impstation/Objects/Tanks/vapor.rsi/fill-5.png b/Resources/Textures/_Impstation/Objects/Tanks/vapor.rsi/fill-5.png new file mode 100644 index 00000000000000..8179acc4589198 Binary files /dev/null and b/Resources/Textures/_Impstation/Objects/Tanks/vapor.rsi/fill-5.png differ diff --git a/Resources/Textures/_Impstation/Objects/Tanks/vapor.rsi/meta.json b/Resources/Textures/_Impstation/Objects/Tanks/vapor.rsi/meta.json index 3dae439d9841ef..5b6a3a276ce59d 100644 --- a/Resources/Textures/_Impstation/Objects/Tanks/vapor.rsi/meta.json +++ b/Resources/Textures/_Impstation/Objects/Tanks/vapor.rsi/meta.json @@ -22,6 +22,9 @@ { "name": "fill-4" }, + { + "name": "fill-5" + }, { "name": "equipped-BACKPACK", "directions": 4