Files
tbd-station-14/Content.Shared/EntityEffects/EntityEffectCondition.cs
pathetic meowmeow bf41de18aa Move entity effects definitions to shared (#35614)
* Move entity effects to shared

* relocate spawning to server

* Generic version of EntityEffect for just raising event.

* genericise everything

* oops forgot to push you

* some condensation

* finish rebas

* unwhite the space

* oops forgot nuke

* bad rebase fix

* useless annotations begone

---------

Co-authored-by: EmoGarbage404 <retron404@gmail.com>
2025-05-23 12:32:22 -04:00

30 lines
870 B
C#

using System.Text.Json.Serialization;
using JetBrains.Annotations;
using Robust.Shared.Prototypes;
namespace Content.Shared.EntityEffects;
[ImplicitDataDefinitionForInheritors]
[MeansImplicitUse]
public abstract partial class EntityEffectCondition
{
[JsonPropertyName("id")] private protected string _id => this.GetType().Name;
public abstract bool Condition(EntityEffectBaseArgs args);
/// <summary>
/// Effect explanations are of the form "[chance to] [action] when [condition] and [condition]"
/// </summary>
/// <param name="prototype"></param>
/// <returns></returns>
public abstract string GuidebookExplanation(IPrototypeManager prototype);
}
[ByRefEvent]
public struct CheckEntityEffectConditionEvent<T> where T : EntityEffectCondition
{
public T Condition;
public EntityEffectBaseArgs Args;
public bool Result;
}