Make miasma start being visible later (#10128)

This commit is contained in:
Rane
2022-07-28 23:13:56 -04:00
committed by GitHub
parent c621712f49
commit 47e84d9d54
3 changed files with 8 additions and 3 deletions

View File

@@ -149,7 +149,7 @@ namespace Content.Server.Atmos.EntitySystems
if (moles >= gas.GasMolesVisible) if (moles >= gas.GasMolesVisible)
{ {
opacity[i] = (byte) (ContentHelpers.RoundToLevels( opacity[i] = (byte) (ContentHelpers.RoundToLevels(
MathHelper.Clamp01(moles / gas.GasMolesVisibleMax) * 255, byte.MaxValue, _thresholds) * 255 / (_thresholds - 1)); MathHelper.Clamp01((moles - gas.GasMolesVisible) / (gas.GasMolesVisibleMax - gas.GasMolesVisible)) * 255, byte.MaxValue, _thresholds) * 255 / (_thresholds - 1));
} }
i++; i++;
} }
@@ -262,7 +262,7 @@ namespace Content.Server.Atmos.EntitySystems
// Not all grids have atmospheres. // Not all grids have atmospheres.
if (!_overlay.TryGetValue(grid, out var gridData)) if (!_overlay.TryGetValue(grid, out var gridData))
continue; continue;
List<GasOverlayChunk> dataToSend = new(); List<GasOverlayChunk> dataToSend = new();
ev.UpdatedChunks[grid] = dataToSend; ev.UpdatedChunks[grid] = dataToSend;

View File

@@ -44,7 +44,10 @@ namespace Content.Shared.Atmos.Prototypes
/// <summary> /// <summary>
/// Visibility for this gas will be max after this value. /// Visibility for this gas will be max after this value.
/// </summary> /// </summary>
public float GasMolesVisibleMax => GasMolesVisible * Atmospherics.FactorGasVisibleMax; public float GasMolesVisibleMax => GasMolesVisible * GasVisibilityFactor;
[DataField("gasVisbilityFactor")]
public float GasVisibilityFactor = Atmospherics.FactorGasVisibleMax;
/// <summary> /// <summary>
/// If this reagent is in gas form, this is the path to the overlay that will be used to make the gas visible. /// If this reagent is in gas form, this is the path to the overlay that will be used to make the gas visible.

View File

@@ -66,6 +66,8 @@
molarMass: 44 molarMass: 44
gasOverlaySprite: /Textures/Effects/atmospherics.rsi gasOverlaySprite: /Textures/Effects/atmospherics.rsi
gasOverlayState: miasma gasOverlayState: miasma
gasMolesVisible: 2
gasVisbilityFactor: 3.5
color: 56941E color: 56941E
reagent: Miasma reagent: Miasma