Add CVar for disabling/enabling excited groups.
This commit is contained in:
@@ -15,6 +15,7 @@ namespace Content.Server.Atmos.EntitySystems
|
|||||||
public bool MonstermosRipTiles { get; private set; }
|
public bool MonstermosRipTiles { get; private set; }
|
||||||
public bool GridImpulse { get; private set; }
|
public bool GridImpulse { get; private set; }
|
||||||
public bool Superconduction { get; private set; }
|
public bool Superconduction { get; private set; }
|
||||||
|
public bool ExcitedGroups { get; private set; }
|
||||||
public bool ExcitedGroupsSpaceIsAllConsuming { get; private set; }
|
public bool ExcitedGroupsSpaceIsAllConsuming { get; private set; }
|
||||||
public float AtmosMaxProcessTime { get; private set; }
|
public float AtmosMaxProcessTime { get; private set; }
|
||||||
public float AtmosTickRate { get; private set; }
|
public float AtmosTickRate { get; private set; }
|
||||||
@@ -31,6 +32,7 @@ namespace Content.Server.Atmos.EntitySystems
|
|||||||
_cfg.OnValueChanged(CCVars.Superconduction, value => Superconduction = value, true);
|
_cfg.OnValueChanged(CCVars.Superconduction, value => Superconduction = value, true);
|
||||||
_cfg.OnValueChanged(CCVars.AtmosMaxProcessTime, value => AtmosMaxProcessTime = value, true);
|
_cfg.OnValueChanged(CCVars.AtmosMaxProcessTime, value => AtmosMaxProcessTime = value, true);
|
||||||
_cfg.OnValueChanged(CCVars.AtmosTickRate, value => AtmosTickRate = value, true);
|
_cfg.OnValueChanged(CCVars.AtmosTickRate, value => AtmosTickRate = value, true);
|
||||||
|
_cfg.OnValueChanged(CCVars.ExcitedGroups, value => ExcitedGroups = value, true);
|
||||||
_cfg.OnValueChanged(CCVars.ExcitedGroupsSpaceIsAllConsuming, value => ExcitedGroupsSpaceIsAllConsuming = value, true);
|
_cfg.OnValueChanged(CCVars.ExcitedGroupsSpaceIsAllConsuming, value => ExcitedGroupsSpaceIsAllConsuming = value, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ namespace Content.Server.Atmos.EntitySystems
|
|||||||
|
|
||||||
var shouldShareAir = false;
|
var shouldShareAir = false;
|
||||||
|
|
||||||
if (tile.ExcitedGroup != null && enemyTile.ExcitedGroup != null)
|
if (ExcitedGroups && tile.ExcitedGroup != null && enemyTile.ExcitedGroup != null)
|
||||||
{
|
{
|
||||||
if (tile.ExcitedGroup != enemyTile.ExcitedGroup)
|
if (tile.ExcitedGroup != enemyTile.ExcitedGroup)
|
||||||
{
|
{
|
||||||
@@ -53,21 +53,24 @@ namespace Content.Server.Atmos.EntitySystems
|
|||||||
AddActiveTile(gridAtmosphere, enemyTile);
|
AddActiveTile(gridAtmosphere, enemyTile);
|
||||||
}
|
}
|
||||||
|
|
||||||
var excitedGroup = tile.ExcitedGroup;
|
if (ExcitedGroups)
|
||||||
excitedGroup ??= enemyTile.ExcitedGroup;
|
|
||||||
|
|
||||||
if (excitedGroup == null)
|
|
||||||
{
|
{
|
||||||
excitedGroup = new ExcitedGroup();
|
var excitedGroup = tile.ExcitedGroup;
|
||||||
gridAtmosphere.ExcitedGroups.Add(excitedGroup);
|
excitedGroup ??= enemyTile.ExcitedGroup;
|
||||||
|
|
||||||
|
if (excitedGroup == null)
|
||||||
|
{
|
||||||
|
excitedGroup = new ExcitedGroup();
|
||||||
|
gridAtmosphere.ExcitedGroups.Add(excitedGroup);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tile.ExcitedGroup == null)
|
||||||
|
ExcitedGroupAddTile(excitedGroup, tile);
|
||||||
|
|
||||||
|
if(enemyTile.ExcitedGroup == null)
|
||||||
|
ExcitedGroupAddTile(excitedGroup, enemyTile);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tile.ExcitedGroup == null)
|
|
||||||
ExcitedGroupAddTile(excitedGroup, tile);
|
|
||||||
|
|
||||||
if(enemyTile.ExcitedGroup == null)
|
|
||||||
ExcitedGroupAddTile(excitedGroup, enemyTile);
|
|
||||||
|
|
||||||
shouldShareAir = true;
|
shouldShareAir = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -102,7 +105,7 @@ namespace Content.Server.Atmos.EntitySystems
|
|||||||
if (ConsiderSuperconductivity(gridAtmosphere, tile, true))
|
if (ConsiderSuperconductivity(gridAtmosphere, tile, true))
|
||||||
remove = false;
|
remove = false;
|
||||||
|
|
||||||
if(tile.ExcitedGroup == null && remove)
|
if(ExcitedGroups && tile.ExcitedGroup == null && remove)
|
||||||
RemoveActiveTile(gridAtmosphere, tile);
|
RemoveActiveTile(gridAtmosphere, tile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -281,7 +281,8 @@ namespace Content.Server.Atmos.EntitySystems
|
|||||||
}
|
}
|
||||||
|
|
||||||
atmosphere.ProcessingPaused = false;
|
atmosphere.ProcessingPaused = false;
|
||||||
atmosphere.State = AtmosphereProcessingState.ExcitedGroups;
|
// Next state depends on whether excited groups are enabled or not.
|
||||||
|
atmosphere.State = ExcitedGroups ? AtmosphereProcessingState.ExcitedGroups : AtmosphereProcessingState.HighPressureDelta;
|
||||||
continue;
|
continue;
|
||||||
case AtmosphereProcessingState.ExcitedGroups:
|
case AtmosphereProcessingState.ExcitedGroups:
|
||||||
if (!ProcessExcitedGroups(atmosphere))
|
if (!ProcessExcitedGroups(atmosphere))
|
||||||
|
|||||||
@@ -291,7 +291,6 @@ namespace Content.Shared.CCVar
|
|||||||
public static readonly CVarDef<bool> AtmosGridImpulse =
|
public static readonly CVarDef<bool> AtmosGridImpulse =
|
||||||
CVarDef.Create("atmos.grid_impulse", false, CVar.SERVERONLY);
|
CVarDef.Create("atmos.grid_impulse", false, CVar.SERVERONLY);
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether atmos superconduction is enabled.
|
/// Whether atmos superconduction is enabled.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -299,10 +298,17 @@ namespace Content.Shared.CCVar
|
|||||||
public static readonly CVarDef<bool> Superconduction =
|
public static readonly CVarDef<bool> Superconduction =
|
||||||
CVarDef.Create("atmos.superconduction", false, CVar.SERVERONLY);
|
CVarDef.Create("atmos.superconduction", false, CVar.SERVERONLY);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Whether excited groups will be processed and created.
|
||||||
|
/// </summary>
|
||||||
|
public static readonly CVarDef<bool> ExcitedGroups =
|
||||||
|
CVarDef.Create("atmos.excited_groups", true, CVar.SERVERONLY);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether all tiles in an excited group will clear themselves once being exposed to space.
|
/// Whether all tiles in an excited group will clear themselves once being exposed to space.
|
||||||
/// Similar to <see cref="MonstermosDepressurization"/>, without none of the tile ripping or
|
/// Similar to <see cref="MonstermosDepressurization"/>, without none of the tile ripping or
|
||||||
/// things being thrown around very violently.
|
/// things being thrown around very violently.
|
||||||
|
/// Needs <see cref="ExcitedGroups"/> to be enabled to work.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static readonly CVarDef<bool> ExcitedGroupsSpaceIsAllConsuming =
|
public static readonly CVarDef<bool> ExcitedGroupsSpaceIsAllConsuming =
|
||||||
CVarDef.Create("atmos.excited_groups_space_is_all_consuming", false, CVar.SERVERONLY);
|
CVarDef.Create("atmos.excited_groups_space_is_all_consuming", false, CVar.SERVERONLY);
|
||||||
|
|||||||
Reference in New Issue
Block a user