Skip to content

Commit

Permalink
Merge pull request #1020 from TGRCdev/vaporizer-fixes
Browse files Browse the repository at this point in the history
Fixes and improvements for vaporizer visuals
  • Loading branch information
Darkmajia authored Dec 14, 2024
2 parents e6a0cce + 6feca0e commit 5ba71f2
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 67 deletions.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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)
Expand Down
6 changes: 0 additions & 6 deletions Content.Shared/_Impstation/Decapoids/VaporizerState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@ namespace Content.Shared._Impstation.Decapoids;

[Serializable, NetSerializable]
public enum VaporizerVisuals : byte
{
VisualState,
}

[Serializable, NetSerializable]
public enum VaporizerVisualLayers : byte
{
Indicator,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -177,6 +185,6 @@
solution: waterTank
- type: Vaporizer
- type: SolutionContainerVisuals
maxFillLevels: 4
maxFillLevels: 5
fillBaseName: fill-
solutionName: waterTank
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
{
"name": "fill-4"
},
{
"name": "fill-5"
},
{
"name": "equipped-BACKPACK",
"directions": 4
Expand Down

0 comments on commit 5ba71f2

Please sign in to comment.