Add some animals basic mechanics (#5132)

Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
FoLoKe
2021-11-13 04:48:05 +03:00
committed by GitHub
parent 2353d340d0
commit 5f3ae602ed
49 changed files with 522 additions and 163 deletions

View File

@@ -1,4 +1,4 @@
using Content.Server.Clothing.Components;
using Content.Server.Clothing.Components;
using Content.Server.Inventory.Components;
using Content.Shared.Inventory;
using Robust.Shared.GameObjects;
@@ -12,7 +12,15 @@ namespace Content.Server.Temperature.Components
public int GetHeatResistance()
{
if (Owner.GetComponent<InventoryComponent>().TryGetSlotItem(EquipmentSlotDefines.Slots.GLOVES, out ClothingComponent? gloves))
// 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 (!Owner.TryGetComponent<InventoryComponent>(out var inventoryComp))
{
// Magical number just copied from below
return int.MinValue;
}
if (inventoryComp.TryGetSlotItem(EquipmentSlotDefines.Slots.GLOVES, out ClothingComponent? gloves))
{
return gloves?.HeatResistance ?? int.MinValue;
}