Files
tbd-station-14/Content.Server/Temperature/Components/HeatResistanceComponent.cs
2022-02-16 18:23:23 +11:00

24 lines
861 B
C#

using Content.Server.Clothing.Components;
using Content.Shared.Inventory;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
namespace Content.Server.Temperature.Components
{
[RegisterComponent]
public sealed class HeatResistanceComponent : Component
{
public int GetHeatResistance()
{
// TODO: When making into system: Any animal that touches bulb that has no
// InventoryComponent but still would have default heat resistance in the future (maybe)
if (EntitySystem.Get<InventorySystem>().TryGetSlotEntity(Owner, "gloves", out var slotEntity) &&
IoCManager.Resolve<IEntityManager>().TryGetComponent<ClothingComponent>(slotEntity, out var gloves))
{
return gloves.HeatResistance;
}
return int.MinValue;
}
}
}