示例#1
0
    private bool HasClothingItem(RegisterPlayer onPlayer, ItemSlot infoToSlot)
    {
        var equipment = onPlayer.GetComponent <Equipment>();

        if (equipment == null)
        {
            return(false);
        }
        if (infoToSlot.SlotIdentifier.SlotIdentifierType != SlotIdentifierType.Named)
        {
            return(false);
        }

        return(equipment.GetClothingItem(infoToSlot.NamedSlot.GetValueOrDefault(NamedSlot.none)) != null);
    }
        private bool DiskLost()
        {
            if (((gameObject.AssumedWorldPosServer() - MatrixManager.MainStationMatrix.GameObject.AssumedWorldPosServer())
                 .magnitude < boundRadius))
            {
                return(false);
            }

            if (escapeShuttle != null && escapeShuttle.Status != EscapeShuttleStatus.DockedCentcom)
            {
                var matrixInfo = escapeShuttle.MatrixInfo;
                if (matrixInfo == null || BoundsExtensions.Contains(matrixInfo.LocalBounds, registerTile.WorldPositionServer))
                {
                    return(false);
                }
            }
            else
            {
                ItemSlot slot = pick.ItemSlot;
                if (slot == null)
                {
                    return(true);
                }

                RegisterPlayer player = slot.Player;
                if (player == null)
                {
                    return(true);
                }

                if (player.GetComponent <PlayerHealthV2>().IsDead)
                {
                    return(true);
                }

                var checkPlayer = PlayerList.Instance.Get(player.gameObject, true);
                if (checkPlayer.Equals(ConnectedPlayer.Invalid))
                {
                    return(true);
                }

                if (PlayerList.Instance.AntagPlayers.Contains(checkPlayer) == false)
                {
                    return(true);
                }
            }
            return(false);
        }
示例#3
0
    private bool DiskLost()
    {
        if (((gameObject.AssumedWorldPosServer() - MatrixManager.MainStationMatrix.GameObject.AssumedWorldPosServer())
             .magnitude < boundRadius))
        {
            return(false);
        }

        if (escapeShuttle != null && escapeShuttle.Status != ShuttleStatus.DockedCentcom)
        {
            if (escapeShuttle.MatrixInfo.Bounds.Contains(registerItem.WorldPositionServer))
            {
                return(false);
            }
        }
        else
        {
            ItemSlot slot = pick.ItemSlot;
            if (slot == null)
            {
                return(true);
            }
            RegisterPlayer player = slot.Player;
            if (player == null)
            {
                return(true);
            }
            if (player.GetComponent <PlayerHealth>().IsDead)
            {
                return(true);
            }
            var checkPlayer = PlayerList.Instance.Get(player.gameObject);
            if (checkPlayer == null)
            {
                return(true);
            }
            if (!PlayerList.Instance.AntagPlayers.Contains(checkPlayer))
            {
                return(true);
            }
        }
        return(false);
    }