CatStation/Content.Shared/EntityEffects/Effects/AdjustTemperatureEntityEffectsSystem.cs
Princess Cheeseballs 2e9c4c0103
IHeatContainers for TemperatureComponent (#42785)
* Hope I'm not forgetting anything...

* They call me the sender the way I'm sending it.

* remove commented out YAML

* last of the slop

* fix test fails

* first batch of test fails

* no more test fails

* make cryo pods work again.

* Make cryo work better-er

* I didn't like that a firesuit helmet was so effective on its own so I decided to be a dick about it.

* review.com

* oop

* actually real quick do this

* fix YAML issues

* IHeatContainer my beloved <3

* borger

* not networked :(

* jackets

* burgeewqjfrwjkhaskfjfsahjkfsahjkfsahjkfsajhkfsa

* utter yaml nonsense

* phishing

---------

Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com>
2026-07-26 07:56:44 +00:00

37 lines
1.4 KiB
C#

using Content.Shared.Temperature.Components;
using Content.Shared.Temperature.Systems;
using Robust.Shared.Prototypes;
namespace Content.Shared.EntityEffects.Effects;
// TODO: When we get a proper temperature/energy struct combine this with the solution temperature effect!!!
/// <summary>
/// Adjusts the temperature of this entity.
/// </summary>
/// <inheritdoc cref="EntityEffectSystem{T,TEffect}"/>
public sealed partial class AdjustTemperatureEntityEffectSystem : EntityEffectSystem<TemperatureComponent, AdjustTemperature>
{
[Dependency] private SharedTemperatureSystem _temperature = default!;
protected override void Effect(Entity<TemperatureComponent> entity, ref EntityEffectEvent<AdjustTemperature> args)
{
var amount = args.Effect.Amount * args.Scale;
_temperature.ChangeHeat(entity.AsNullable(), amount, true);
}
}
/// <inheritdoc cref="EntityEffect"/>
public sealed partial class AdjustTemperature : EntityEffectBase<AdjustTemperature>
{
/// <summary>
/// Amount we're adjusting temperature by.
/// </summary>
[DataField]
public float Amount;
public override string EntityEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
=> Loc.GetString("entity-effect-guidebook-adjust-temperature",
("chance", Probability),
("deltasign", MathF.Sign(Amount)),
("amount", Amount));
}