Example #1
0
 private void OnShutdown(EntityUid uid, VocalComponent component, ComponentShutdown args)
 {
     if (component.ScreamAction != null)
     {
         _actions.RemoveAction(uid, component.ScreamAction);
     }
 }
Example #2
0
    private void OnActionPerform(EntityUid uid, VocalComponent component, ScreamActionEvent args)
    {
        if (args.Handled)
        {
            return;
        }

        args.Handled = TryScream(uid, component);
    }
Example #3
0
    private void OnStartup(EntityUid uid, VocalComponent component, ComponentStartup args)
    {
        if (component.ScreamAction == null &&
            _proto.TryIndex(component.ActionId, out InstantActionPrototype? act))
        {
            component.ScreamAction = new(act);
        }

        if (component.ScreamAction != null)
        {
            _actions.AddAction(uid, component.ScreamAction, null);
        }
    }
Example #4
0
 private void OnShutdown(EntityUid uid, VocalComponent component, ComponentShutdown args)
 {
     _actions.RemoveAction(uid, component.Action);
 }
Example #5
0
 private void OnStartup(EntityUid uid, VocalComponent component, ComponentStartup args)
 {
     _actions.AddAction(uid, component.Action, null);
 }