Files
crystall-punk-14/Content.Server/_CP14/Chemistry/ReagentEffect/CP14AffectSolutionTemperature.cs
2024-06-30 11:49:51 +03:00

39 lines
1.1 KiB
C#

using Content.Shared.EntityEffects;
using JetBrains.Annotations;
using Robust.Shared.Prototypes;
namespace Content.Server._CP14.Chemistry.ReagentEffect;
[UsedImplicitly]
[DataDefinition]
public sealed partial class CP14AffectSolutionTemperature : EntityEffect
{
/// <summary>
/// Temperature added to the solution. If negative, the solution is cooling.
/// </summary>
[DataField]
private float AddTemperature = -300f;
protected override string? ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
{
return Loc.GetString("cp14-reagent-effect-guidebook-temp-affect",
("chance", Probability),
("temperature", AddTemperature));
}
public override void Effect(EntityEffectBaseArgs args)
{
if (args is EntityEffectReagentArgs reagentArgs)
{
if (reagentArgs.Source != null)
reagentArgs.Source.Temperature += AddTemperature;
return;
}
// TODO: Someone needs to figure out how to do this for non-reagent effects.
throw new NotImplementedException();
}
}