Example #1
0
        void OnEntityBuilt(HeldEntity heldentity, GameObject gameobject)
        {
            if (!serverInitialized)
            {
                return;
            }

            var block = gameobject.GetComponent <BuildingBlock>();

            if (block == null)
            {
                return;
            }

            var player = heldentity.GetOwnerPlayer();

            if (player == null)
            {
                return;
            }

            var blockdata = FindBlockData(block);

            if (blockdata is string)
            {
                return;
            }

            SetBlockData(block, player.userID.ToString());
        }
        void OnHealingItemUse(HeldEntity item, BasePlayer target)
        {
            var player = item.GetOwnerPlayer();

            if (player == null)
            {
                return;
            }
            if (player != target && configData.ActiveChallengeTypes[CTypes.Healed.ToString()])
            {
                AddPoints(player, CTypes.Healed, 1);
            }
        }
Example #3
0
        private void OnHealingItemUse(HeldEntity item, BasePlayer target)
        {
            var player = item.GetOwnerPlayer();

            if (player == null || player is NPCPlayer)
            {
                return;
            }
            if (player != target && configData.ChallengeSettings[Challenges.PlayersHealed].Enabled)
            {
                AddPoints(player, Challenges.PlayersHealed, 1);
            }
        }
Example #4
0
        public static bool ShouldNetworkToInvisible(BaseNetworkable net, BasePlayer player)
        {
            BasePlayer basePlayer;

            if ((basePlayer = (net as BasePlayer)) == null)
            {
                HeldEntity heldEntity = net as HeldEntity;
                basePlayer = ((heldEntity != null) ? heldEntity.GetOwnerPlayer() : null);
            }
            BasePlayer basePlayer2 = basePlayer;

            return(basePlayer2 == null || player == null || basePlayer2 == player || player.IsAdmin || !basePlayer2.IsInvisible);
        }
        void OnEntityBuilt(HeldEntity heldentity, GameObject gameobject)
        {
            if (!serverInitialized) return;

            var block = gameobject.GetComponent<BuildingBlock>();
            if (block == null) return;

            var player = heldentity.GetOwnerPlayer();
            if (player == null) return;

            var blockdata = FindBlockData(block);
            if (blockdata is string) return;

            SetBlockData(block, player.userID.ToString());
        }
Example #6
0
        void OnEntityBuilt(HeldEntity heldentity, GameObject obj)
        {
            var player = heldentity.GetOwnerPlayer();

            if (player.CanBuild())
            {
                return;
            }

            var entity = obj.GetComponent <BaseCombatEntity>();

            if (!entity || !entity.ShortPrefabName.StartsWith(ladderPrefabs))
            {
                return;
            }

            if (Physics.CheckSphere(entity.transform.position, 1.2f, layerMasks))
            {
                entity.Kill(BaseNetworkable.DestroyMode.Gib);
                player.ChatMessage(lang.GetMessage("BuildingBlocked", this, player.UserIDString));
                TryReturnLadder(player, entity);
            }
        }
 object CanNetworkTo(HeldEntity entity, BasePlayer target)
 {
     return(entity == null ? null : CanNetworkTo(entity.GetOwnerPlayer(), target));
 }