Exemplo n.º 1
0
 private void OnRelayMoveInput(EntityUid uid, BodyComponent component, RelayMoveInputEvent args)
 {
     if (EntityManager.TryGetComponent <IMobStateComponent>(uid, out var mobState) &&
         mobState.IsDead() &&
         EntityManager.TryGetComponent <MindComponent>(uid, out var mind) &&
         mind.HasMind)
     {
         _ticker.OnGhostAttempt(mind.Mind !, true);
     }
 }
Exemplo n.º 2
0
        private void OnRelayMoveInput(EntityUid uid, GhostOnMoveComponent component, RelayMoveInputEvent args)
        {
            // Let's not ghost if our mind is visiting...
            if (EntityManager.HasComponent <VisitingMindComponent>(uid))
            {
                return;
            }
            if (!EntityManager.TryGetComponent <MindComponent>(uid, out var mind) || !mind.HasMind || mind.Mind !.IsVisitingEntity)
            {
                return;
            }

            _ticker.OnGhostAttempt(mind.Mind !, component.CanReturn);
        }
Exemplo n.º 3
0
        private void OnRelayMoveInput(EntityUid uid, BodyComponent component, RelayMoveInputEvent args)
        {
            if (EntityManager.TryGetComponent <MobStateComponent>(uid, out var mobState) &&
                mobState.IsDead() &&
                EntityManager.TryGetComponent <MindComponent>(uid, out var mind) &&
                mind.HasMind)
            {
                if (!mind.Mind !.TimeOfDeath.HasValue)
                {
                    mind.Mind.TimeOfDeath = _gameTiming.RealTime;
                }

                _ticker.OnGhostAttempt(mind.Mind !, true);
            }
        }
Exemplo n.º 4
0
        private void OnRelayMoveInput(EntityUid uid, SharedPullableComponent component, RelayMoveInputEvent args)
        {
            var entity = args.Session.AttachedEntity;

            if (entity == null || !_blocker.CanMove(entity.Value))
            {
                return;
            }
            _pullSystem.TryStopPull(component);
        }
 private void OnFollowerMove(EntityUid uid, FollowerComponent component, RelayMoveInputEvent args)
 {
     StopFollowingEntity(uid, component.Following);
 }
    private void OnRelayMovement(EntityUid uid, CanEscapeInventoryComponent component, RelayMoveInputEvent args)
    {
        //Prevents the user from creating multiple DoAfters if they're already resisting.
        if (component.IsResisting == true)
        {
            return;
        }

        if (_containerSystem.TryGetContainingContainer(uid, out var container) &&
            (HasComp <SharedStorageComponent>(container.Owner) || HasComp <InventoryComponent>(container.Owner) || HasComp <SharedHandsComponent>(container.Owner)))
        {
            if (_actionBlockerSystem.CanInteract(uid, container.Owner))
            {
                AttemptEscape(uid, container.Owner, component);
            }
        }
    }
Exemplo n.º 7
0
        private void OnRelayMoveInput(EntityUid uid, SharedPullableComponent component, RelayMoveInputEvent args)
        {
            var entity = args.Session.AttachedEntity;

            if (entity == null || !_blocker.CanMove(entity.Value))
            {
                return;
            }
            if (TryComp <MobStateComponent>(component.Owner, out var mobState) && mobState.IsIncapacitated())
            {
                return;
            }
            _pullSystem.TryStopPull(component);
        }