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:
deltanedas
2026-06-29 12:44:00 +02:00
committed by Coryler
co-authored by deltanedas
parent 74c336597d
commit f0b4c6ef2a
7 changed files with 193 additions and 1 deletions
@@ -0,0 +1,21 @@
using Robust.Shared.Prototypes;
namespace Content.Shared.EntityEffects;
/// <summary>
/// Entity effects API counterparts using <see cref="EntityEffectPrototype"/> instead of <see cref="EntityEffect"/>.
// </summary>
public sealed partial class SharedEntityEffectsSystem
{
[Dependency] private readonly IPrototypeManager _proto = default!;
/// <summary>
/// <c>TryApplyEffect</c> overload using a <see cref="EntityEffectPrototype"/> instead of <see cref="EntityEffect"/>.
/// </summary>
public void TryApplyEffect(EntityUid target, [ForbidLiteral] ProtoId<EntityEffectPrototype> id, float scale = 1f, EntityUid? user = null)
{
var proto = _proto.Index(id);
if (_condition.TryConditions(target, proto.Conditions))
ApplyEffects(target, proto.Effects, scale, user);
}
}