The Pyro Update (#5575)
This commit is contained in:
36
Content.Server/Chemistry/ReagentEffects/CreateGas.cs
Normal file
36
Content.Server/Chemistry/ReagentEffects/CreateGas.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using Content.Server.Atmos.EntitySystems;
|
||||
using Content.Shared.Atmos;
|
||||
using Content.Shared.Chemistry.Reagent;
|
||||
using Content.Shared.Database;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
|
||||
namespace Content.Server.Chemistry.ReagentEffects;
|
||||
|
||||
public class CreateGas : ReagentEffect
|
||||
{
|
||||
[DataField("gas", required: true)]
|
||||
public Gas Gas = default!;
|
||||
|
||||
/// <summary>
|
||||
/// For each unit consumed, how many moles of gas should be created?
|
||||
/// </summary>
|
||||
[DataField("multiplier")]
|
||||
public float Multiplier = 3f;
|
||||
|
||||
public override bool ShouldLog => true;
|
||||
public override LogImpact LogImpact => LogImpact.High;
|
||||
|
||||
public override void Effect(ReagentEffectArgs args)
|
||||
{
|
||||
var atmosSys = EntitySystem.Get<AtmosphereSystem>();
|
||||
|
||||
var xform = args.EntityManager.GetComponent<TransformComponent>(args.SolutionEntity);
|
||||
var tileMix = atmosSys.GetTileMixture(xform.Coordinates);
|
||||
|
||||
if (tileMix != null)
|
||||
{
|
||||
tileMix.AdjustMoles(Gas, args.Quantity.Float() * Multiplier);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -16,6 +16,9 @@ namespace Content.Server.Chemistry.ReagentEffects
|
||||
[UsedImplicitly]
|
||||
public class FlammableReaction : ReagentEffect
|
||||
{
|
||||
[DataField("multiplier")]
|
||||
public float Multiplier = 0.05f;
|
||||
|
||||
public override bool ShouldLog => true;
|
||||
public override LogImpact LogImpact => LogImpact.Medium;
|
||||
|
||||
@@ -23,7 +26,7 @@ namespace Content.Server.Chemistry.ReagentEffects
|
||||
{
|
||||
if (!args.EntityManager.TryGetComponent(args.SolutionEntity, out FlammableComponent? flammable)) return;
|
||||
|
||||
EntitySystem.Get<FlammableSystem>().AdjustFireStacks(args.SolutionEntity, args.Quantity.Float() / 5f, flammable);
|
||||
EntitySystem.Get<FlammableSystem>().AdjustFireStacks(args.SolutionEntity, args.Quantity.Float() * Multiplier, flammable);
|
||||
args.Source?.RemoveReagent(args.Reagent.ID, args.Quantity);
|
||||
}
|
||||
}
|
||||
|
||||
21
Content.Server/Chemistry/ReagentEffects/Ignite.cs
Normal file
21
Content.Server/Chemistry/ReagentEffects/Ignite.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using Content.Server.Atmos.EntitySystems;
|
||||
using Content.Shared.Chemistry.Reagent;
|
||||
using Content.Shared.Database;
|
||||
using Robust.Shared.GameObjects;
|
||||
|
||||
namespace Content.Server.Chemistry.ReagentEffects;
|
||||
|
||||
/// <summary>
|
||||
/// Ignites a mob.
|
||||
/// </summary>
|
||||
public class Ignite : ReagentEffect
|
||||
{
|
||||
public override bool ShouldLog => true;
|
||||
public override LogImpact LogImpact => LogImpact.Medium;
|
||||
|
||||
public override void Effect(ReagentEffectArgs args)
|
||||
{
|
||||
var flamSys = EntitySystem.Get<FlammableSystem>();
|
||||
flamSys.Ignite(args.SolutionEntity);
|
||||
}
|
||||
}
|
||||
20
Content.Server/Chemistry/TileReactions/PryTileReaction.cs
Normal file
20
Content.Server/Chemistry/TileReactions/PryTileReaction.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using Content.Shared.Chemistry.Reaction;
|
||||
using Content.Shared.Chemistry.Reagent;
|
||||
using Content.Shared.FixedPoint;
|
||||
using Content.Shared.Maps;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
|
||||
namespace Content.Server.Chemistry.TileReactions;
|
||||
|
||||
[UsedImplicitly]
|
||||
[DataDefinition]
|
||||
public class PryTileReaction : ITileReaction
|
||||
{
|
||||
public FixedPoint2 TileReact(TileRef tile, ReagentPrototype reagent, FixedPoint2 reactVolume)
|
||||
{
|
||||
tile.PryTile();
|
||||
return reactVolume;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user