Undo effect logging changes (#40919)
* Undo effect logging changes * remove ShouldLog
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
using Robust.Shared.Prototypes;
|
using Content.Shared.Database;
|
||||||
|
using Robust.Shared.Prototypes;
|
||||||
|
|
||||||
namespace Content.Shared.EntityEffects.Effects.Atmos;
|
namespace Content.Shared.EntityEffects.Effects.Atmos;
|
||||||
|
|
||||||
@@ -24,5 +25,5 @@ public sealed partial class Flammable : EntityEffectBase<Flammable>
|
|||||||
public override string EntityEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
|
public override string EntityEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
|
||||||
=> Loc.GetString("entity-effect-guidebook-flammable-reaction", ("chance", Probability));
|
=> Loc.GetString("entity-effect-guidebook-flammable-reaction", ("chance", Probability));
|
||||||
|
|
||||||
public override bool ShouldLog => true;
|
public override LogImpact? Impact => LogImpact.Low;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,5 @@ public sealed partial class Ignite : EntityEffectBase<Ignite>
|
|||||||
public override string EntityEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) =>
|
public override string EntityEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) =>
|
||||||
Loc.GetString("entity-effect-guidebook-ignite", ("chance", Probability));
|
Loc.GetString("entity-effect-guidebook-ignite", ("chance", Probability));
|
||||||
|
|
||||||
public override bool ShouldLog => true;
|
public override LogImpact? Impact => LogImpact.Medium;
|
||||||
|
|
||||||
public override LogImpact LogImpact => LogImpact.Medium;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,5 @@ public sealed partial class AreaReactionEffect : EntityEffectBase<AreaReactionEf
|
|||||||
("duration", Duration)
|
("duration", Duration)
|
||||||
);
|
);
|
||||||
|
|
||||||
public override bool ShouldLog => true;
|
public override LogImpact? Impact => LogImpact.High;
|
||||||
|
|
||||||
public override LogImpact LogImpact => LogImpact.High;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,7 +52,5 @@ public sealed partial class Emp : EntityEffectBase<Emp>
|
|||||||
public override string EntityEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
|
public override string EntityEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
|
||||||
=> Loc.GetString("entity-effect-guidebook-emp-reaction-effect", ("chance", Probability));
|
=> Loc.GetString("entity-effect-guidebook-emp-reaction-effect", ("chance", Probability));
|
||||||
|
|
||||||
public override bool ShouldLog => true;
|
public override LogImpact? Impact => LogImpact.Medium;
|
||||||
|
|
||||||
public override LogImpact LogImpact => LogImpact.Medium;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,7 +52,5 @@ public sealed partial class ExplosionEffect : EntityEffectBase<ExplosionEffect>
|
|||||||
public override string EntityEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
|
public override string EntityEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
|
||||||
=> Loc.GetString("entity-effect-guidebook-explosion-reaction-effect", ("chance", Probability));
|
=> Loc.GetString("entity-effect-guidebook-explosion-reaction-effect", ("chance", Probability));
|
||||||
|
|
||||||
public override bool ShouldLog => true;
|
public override LogImpact? Impact => LogImpact.High;
|
||||||
|
|
||||||
public override LogImpact LogImpact => LogImpact.High;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
using System.Linq;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
using Content.Shared.Administration.Logs;
|
using Content.Shared.Administration.Logs;
|
||||||
using Content.Shared.Chemistry;
|
using Content.Shared.Chemistry;
|
||||||
using Content.Shared.Chemistry.Reaction;
|
using Content.Shared.Chemistry.Reaction;
|
||||||
using Content.Shared.Database;
|
using Content.Shared.Database;
|
||||||
using Content.Shared.EntityConditions;
|
using Content.Shared.EntityConditions;
|
||||||
using Content.Shared.Localizations;
|
|
||||||
using Content.Shared.Random.Helpers;
|
using Content.Shared.Random.Helpers;
|
||||||
using Robust.Shared.Prototypes;
|
using Robust.Shared.Prototypes;
|
||||||
using Robust.Shared.Random;
|
using Robust.Shared.Random;
|
||||||
@@ -119,11 +118,11 @@ public sealed partial class SharedEntityEffectsSystem : EntitySystem, IEntityEff
|
|||||||
if (!effect.Scaling)
|
if (!effect.Scaling)
|
||||||
scale = Math.Min(scale, 1f);
|
scale = Math.Min(scale, 1f);
|
||||||
|
|
||||||
if (effect.ShouldLog)
|
if (effect.Impact is {} level)
|
||||||
{
|
{
|
||||||
_adminLog.Add(
|
_adminLog.Add(
|
||||||
LogType.EntityEffect,
|
effect.LogType,
|
||||||
effect.LogImpact,
|
level,
|
||||||
$"Entity effect {effect.GetType().Name:effect}"
|
$"Entity effect {effect.GetType().Name:effect}"
|
||||||
+ $" applied on entity {target:entity}"
|
+ $" applied on entity {target:entity}"
|
||||||
+ $" at {Transform(target).Coordinates:coordinates}"
|
+ $" at {Transform(target).Coordinates:coordinates}"
|
||||||
@@ -213,22 +212,16 @@ public abstract partial class EntityEffect
|
|||||||
[DataField]
|
[DataField]
|
||||||
public float Probability = 1.0f;
|
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;
|
public virtual string? EntityEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) => null;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Whether this effect should be logged in admin logs.
|
|
||||||
/// </summary>
|
|
||||||
[ViewVariables]
|
|
||||||
public virtual bool ShouldLog => true;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// If this effect is logged, how important is the log?
|
/// If this effect is logged, how important is the log?
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[ViewVariables]
|
[ViewVariables]
|
||||||
public virtual LogImpact LogImpact => LogImpact.Low;
|
public virtual LogImpact? Impact => null;
|
||||||
|
|
||||||
|
[ViewVariables]
|
||||||
|
public virtual LogType LogType => LogType.EntityEffect;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user