2021-11-13 04:48:05 +03:00
|
|
|
using Content.Server.Clothing.Components;
|
2021-06-09 22:19:39 +02:00
|
|
|
using Content.Shared.Inventory;
|
2019-07-31 15:02:36 +02:00
|
|
|
using Robust.Shared.GameObjects;
|
2021-12-03 14:17:01 +01:00
|
|
|
using Robust.Shared.IoC;
|
2019-04-06 17:11:51 +02:00
|
|
|
|
2021-06-09 22:19:39 +02:00
|
|
|
namespace Content.Server.Temperature.Components
|
2019-04-06 17:11:51 +02:00
|
|
|
{
|
2019-07-31 15:02:36 +02:00
|
|
|
[RegisterComponent]
|
2022-02-16 00:23:23 -07:00
|
|
|
public sealed class HeatResistanceComponent : Component
|
2019-04-06 17:11:51 +02:00
|
|
|
{
|
|
|
|
|
public int GetHeatResistance()
|
|
|
|
|
{
|
2021-11-13 04:48:05 +03:00
|
|
|
// 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)
|
2021-12-30 22:56:10 +01:00
|
|
|
if (EntitySystem.Get<InventorySystem>().TryGetSlotEntity(Owner, "gloves", out var slotEntity) &&
|
|
|
|
|
IoCManager.Resolve<IEntityManager>().TryGetComponent<ClothingComponent>(slotEntity, out var gloves))
|
2021-11-13 04:48:05 +03:00
|
|
|
{
|
2021-12-30 22:56:10 +01:00
|
|
|
return gloves.HeatResistance;
|
2019-04-06 17:11:51 +02:00
|
|
|
}
|
|
|
|
|
return int.MinValue;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|