Ejemplo n.º 1
0
    /// <summary>
    /// Clientside method.
    /// Checks if player has proper internals equipment (Oxygen Tank and Mask)
    /// equipped in the correct inventory slots (suitStorage and mask)
    /// </summary>
    public bool HasInternalsEquipped()
    {
        var item = maskSlot?.Item;

        if (item == null)
        {
            return(false);
        }
        var itemAttrs = item.GetComponent <ItemAttributesV2>();

        if (itemAttrs == null)
        {
            return(false);
        }

        if (itemAttrs.HasTrait(CommonTraits.Instance.Mask))
        {
            foreach (var gasSlot in itemStorage.GetGasSlots())
            {
                if (gasSlot.Item && gasSlot.Item.GetComponent <GasContainer>())
                {
                    return(true);
                }
            }
        }

        return(false);
    }