Add utility verbs (#6473)
This commit is contained in:
@@ -47,16 +47,16 @@ namespace Content.Shared.Verbs
|
||||
/// Raises a number of events in order to get all verbs of the given type(s) defined in local systems. This
|
||||
/// does not request verbs from the server.
|
||||
/// </summary>
|
||||
public SortedSet<Verb> GetLocalVerbs(EntityUid target, EntityUid user, Type type, bool force = false, bool all = false)
|
||||
public SortedSet<Verb> GetLocalVerbs(EntityUid target, EntityUid user, Type type, bool force = false)
|
||||
{
|
||||
return GetLocalVerbs(target, user, new List<Type>() { type }, force, all);
|
||||
return GetLocalVerbs(target, user, new List<Type>() { type }, force);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Raises a number of events in order to get all verbs of the given type(s) defined in local systems. This
|
||||
/// does not request verbs from the server.
|
||||
/// </summary>
|
||||
public SortedSet<Verb> GetLocalVerbs(EntityUid target, EntityUid user, List<Type> types, bool force = false, bool all = false)
|
||||
public SortedSet<Verb> GetLocalVerbs(EntityUid target, EntityUid user, List<Type> types, bool force = false)
|
||||
{
|
||||
SortedSet<Verb> verbs = new();
|
||||
|
||||
@@ -99,6 +99,15 @@ namespace Content.Shared.Verbs
|
||||
verbs.UnionWith(verbEvent.Verbs);
|
||||
}
|
||||
|
||||
if (types.Contains(typeof(UtilityVerb))
|
||||
&& @using != null
|
||||
&& @using != target)
|
||||
{
|
||||
var verbEvent = new GetVerbsEvent<UtilityVerb>(user, target, @using, hands, canInteract, canAccess);
|
||||
RaiseLocalEvent(@using.Value, verbEvent); // directed at used, not at target
|
||||
verbs.UnionWith(verbEvent.Verbs);
|
||||
}
|
||||
|
||||
if (types.Contains(typeof(AlternativeVerb)))
|
||||
{
|
||||
var verbEvent = new GetVerbsEvent<AlternativeVerb>(user, target, @using, hands, canInteract, canAccess);
|
||||
|
||||
Reference in New Issue
Block a user