pet dehydrated fish to make him nice to you (#14709)
* petting fish to make him nice to you * fix fishe, refactor a bit * fishe * pro * feedback, for now * refactor * pro --------- Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
33
Content.Server/NPC/Systems/FactionExceptionSystem.cs
Normal file
33
Content.Server/NPC/Systems/FactionExceptionSystem.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using Content.Server.NPC.Components;
|
||||
|
||||
namespace Content.Server.NPC.Systems;
|
||||
|
||||
/// <summary>
|
||||
/// Prevents an NPC from attacking some entities from an enemy faction.
|
||||
/// </summary>
|
||||
public sealed class FactionExceptionSystem : EntitySystem
|
||||
{
|
||||
/// <summary>
|
||||
/// Returns whether the entity from an enemy faction won't be attacked
|
||||
/// </summary>
|
||||
public bool IsIgnored(FactionExceptionComponent comp, EntityUid target)
|
||||
{
|
||||
return comp.Ignored.Contains(target);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Prevents an entity from an enemy faction from being attacked
|
||||
/// </summary>
|
||||
public void IgnoreEntity(FactionExceptionComponent comp, EntityUid target)
|
||||
{
|
||||
comp.Ignored.Add(target);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Prevents a list of entities from an enemy faction from being attacked
|
||||
/// </summary>
|
||||
public void IgnoreEntities(FactionExceptionComponent comp, IEnumerable<EntityUid> ignored)
|
||||
{
|
||||
comp.Ignored.UnionWith(ignored);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user