mirror of
https://github.com/DeltaV-Station/Delta-v.git
synced 2026-09-29 23:57:29 +00:00
add nested entity effects+conditions (#42341)
* add nested effect * add nested condition * move api to the main systems and improve effect guidebook text gen --------- Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
committed by
Coryler
co-authored by
deltanedas
parent
74c336597d
commit
f0b4c6ef2a
@@ -0,0 +1,20 @@
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Shared.EntityConditions;
|
||||
|
||||
/// <summary>
|
||||
/// Entity condition API counterpart using <see cref="EntityConditionPrototype"/> instead of <see cref="EntityCondition"/>.
|
||||
/// </summary>
|
||||
public sealed partial class SharedEntityConditionsSystem
|
||||
{
|
||||
[Dependency] private readonly IPrototypeManager _proto = default!;
|
||||
|
||||
/// <summary>
|
||||
/// <c>TryCondition</c> overload that uses a <see cref="EntityConditionPrototype"/> instead of <see cref="EntityCondition"/>.
|
||||
/// </summary>
|
||||
public bool TryCondition(EntityUid target, [ForbidLiteral] ProtoId<EntityConditionPrototype> id)
|
||||
{
|
||||
var proto = _proto.Index(id);
|
||||
return TryCondition(target, proto.Condition);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user