Ejemplo n.º 1
0
 private void OnCrayonDropped(EntityUid uid, CrayonComponent component, DroppedEvent args)
 {
     if (TryComp <ActorComponent>(args.User, out var actor))
     {
         component.UserInterface?.Close(actor.PlayerSession);
     }
 }
Ejemplo n.º 2
0
        public void drop(DropReason reason)
        {
            bool didDrop = false;

            if (!dropped)
            {
                dropped = true;
                didDrop = true;
                DroppedEvent?.Invoke(this, reason);
            }

            if (didDrop)
            {
                transport.close();
            }
        }
        /// <summary>
        ///     Calls Dropped on all components that implement the IDropped interface
        ///     on an entity that has been dropped.
        /// </summary>
        public void DroppedInteraction(IEntity user, IEntity item, bool intentional)
        {
            var dropMsg = new DroppedEvent(user, item, intentional);

            RaiseLocalEvent(item.Uid, dropMsg);
            if (dropMsg.Handled)
            {
                return;
            }

            item.Transform.LocalRotation = intentional ? Angle.Zero : (_random.Next(0, 100) / 100f) * MathHelper.TwoPi;

            var comps = item.GetAllComponents <IDropped>().ToList();

            // Call Land on all components that implement the interface
            foreach (var comp in comps)
            {
                comp.Dropped(new DroppedEventArgs(user, intentional));
            }
        }
 private void OnDropped(EntityUid uid, FireExtinguisherComponent component, DroppedEvent args)
 {
     // idk why this has to be done??????????
     UpdateAppearance(uid, component);
 }
 private void HandlePullerDropped(EntityUid uid, HandVirtualPullComponent component, DroppedEvent args)
 {
     MaybeDelete(component, args.User);
 }
Ejemplo n.º 6
0
 private void HandleItemDropped(EntityUid uid, HandVirtualItemComponent component, DroppedEvent args)
 {
     Delete(component, args.User.Uid);
 }
Ejemplo n.º 7
0
 remove => RemoveHandler(DroppedEvent, value);
Ejemplo n.º 8
0
 add => AddHandler(DroppedEvent, value);
 private void OnJetpackDropped(EntityUid uid, JetpackComponent component, DroppedEvent args)
 {
     SetEnabled(component, false, args.User);
 }
Ejemplo n.º 10
0
 private void OnDropped(EntityUid uid, GasTankComponent component, DroppedEvent args)
 {
     DisconnectFromInternals(component, args.User);
 }