Пример #1
0
        // TODO: Predicted
        void IThrown.Thrown(ThrownEventArgs eventArgs)
        {
            if (!Owner.TryGetComponent(out PhysicsComponent physicsComponent))
            {
                return;
            }

            foreach (var fixture in physicsComponent.Fixtures)
            {
                fixture.CollisionLayer |= (int)CollisionGroup.MobImpassable;
            }
        }
        /// <summary>
        ///     Calls Thrown on all components that implement the IThrown interface
        ///     on an entity that has been thrown.
        /// </summary>
        public void ThrownInteraction(IEntity user, IEntity thrown)
        {
            var throwMsg = new ThrownEvent(user, thrown);

            RaiseLocalEvent(thrown.Uid, throwMsg);
            if (throwMsg.Handled)
            {
                return;
            }

            var comps = thrown.GetAllComponents <IThrown>().ToList();
            var args  = new ThrownEventArgs(user);

            // Call Thrown on all components that implement the interface
            foreach (var comp in comps)
            {
                comp.Thrown(args);
            }
        }
Пример #3
0
        /// <summary>
        ///     Calls Thrown on all components that implement the IThrown interface
        ///     on an entity that has been thrown.
        /// </summary>
        public void ThrownInteraction(EntityUid user, EntityUid thrown)
        {
            var throwMsg = new ThrownEvent(user, thrown);

            RaiseLocalEvent(thrown, throwMsg);
            if (throwMsg.Handled)
            {
                _adminLogSystem.Add(LogType.Throw, LogImpact.Low, $"{user} threw {thrown}");
                return;
            }

            var comps = EntityManager.GetComponents <IThrown>(thrown).ToList();
            var args  = new ThrownEventArgs(user);

            // Call Thrown on all components that implement the interface
            foreach (var comp in comps)
            {
                comp.Thrown(args);
            }
            _adminLogSystem.Add(LogType.Throw, LogImpact.Low, $"{user} threw {thrown}");
        }
Пример #4
0
 public void Thrown(ThrownEventArgs eventArgs)
 {
     SendNetworkMessage(new InstrumentStopMidiMessage());
     _instrumentPlayer = null;
     _userInterface.CloseAll();
 }