Температурные пушки (#90)

* - add: Temperature guns.

* - tweak: Change cryo sting slowdown.

* - tweak: Tempgun tweaks.

* - add: Hardsuit temperature adjustment system.
This commit is contained in:
Aviu00
2024-02-18 17:28:18 +09:00
committed by GitHub
parent 0b6fd195a7
commit 9caa5a408b
42 changed files with 383 additions and 9 deletions

View File

@@ -0,0 +1,23 @@
using Content.Shared.Inventory;
using Content.Shared.Temperature;
namespace Content.Server._White.ChangeTemperatureOnCollide;
public sealed class ClothingTemperatureAdjustSystem : EntitySystem
{
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<ClothingTemperatureAdjustComponent, InventoryRelayedEvent<AdjustTemperatureEvent>>(
OnAdjustTemperature);
}
private void OnAdjustTemperature(Entity<ClothingTemperatureAdjustComponent> ent,
ref InventoryRelayedEvent<AdjustTemperatureEvent> args)
{
var delta = ent.Comp.TargetTemperature - args.Args.Temperature;
var rate = Math.Min(ent.Comp.Rate, Math.Abs(delta));
args.Args.Temperature += Math.Sign(delta) * rate;
}
}