-using Robust.Shared.Prototypes;
+using Content.Shared.Database;
+using Robust.Shared.Prototypes;
namespace Content.Shared.EntityEffects.Effects.Atmos;
public override string EntityEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
=> Loc.GetString("entity-effect-guidebook-flammable-reaction", ("chance", Probability));
- public override bool ShouldLog => true;
+ public override LogImpact? Impact => LogImpact.Low;
}
public override string EntityEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) =>
Loc.GetString("entity-effect-guidebook-ignite", ("chance", Probability));
- public override bool ShouldLog => true;
-
- public override LogImpact LogImpact => LogImpact.Medium;
+ public override LogImpact? Impact => LogImpact.Medium;
}
public override string EntityEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
=> Loc.GetString("entity-effect-guidebook-emp-reaction-effect", ("chance", Probability));
- public override bool ShouldLog => true;
-
- public override LogImpact LogImpact => LogImpact.Medium;
+ public override LogImpact? Impact => LogImpact.Medium;
}
public override string EntityEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
=> Loc.GetString("entity-effect-guidebook-explosion-reaction-effect", ("chance", Probability));
- public override bool ShouldLog => true;
-
- public override LogImpact LogImpact => LogImpact.High;
+ public override LogImpact? Impact => LogImpact.High;
}
-using System.Linq;
+using System.Diagnostics.CodeAnalysis;
using Content.Shared.Administration.Logs;
using Content.Shared.Chemistry;
using Content.Shared.Chemistry.Reaction;
using Content.Shared.Database;
using Content.Shared.EntityConditions;
-using Content.Shared.Localizations;
using Content.Shared.Random.Helpers;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
if (!effect.Scaling)
scale = Math.Min(scale, 1f);
- if (effect.ShouldLog)
+ if (effect.Impact is {} level)
{
_adminLog.Add(
- LogType.EntityEffect,
- effect.LogImpact,
+ effect.LogType,
+ level,
$"Entity effect {effect.GetType().Name:effect}"
+ $" applied on entity {target:entity}"
+ $" at {Transform(target).Coordinates:coordinates}"
[DataField]
public float Probability = 1.0f;
- /// <summary>
- /// The description of this entity effect that shows in guidebooks.
- /// </summary>
public virtual string? EntityEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) => null;
/// <summary>
- /// Whether this effect should be logged in admin logs.
+ /// If this effect is logged, how important is the log?
/// </summary>
[ViewVariables]
- public virtual bool ShouldLog => true;
+ public virtual LogImpact? Impact => null;
- /// <summary>
- /// If this effect is logged, how important is the log?
- /// </summary>
[ViewVariables]
- public virtual LogImpact LogImpact => LogImpact.Low;
+ public virtual LogType LogType => LogType.EntityEffect;
}
/// <summary>