Undo effect logging changes (#40919)
* Undo effect logging changes * remove ShouldLog
This commit is contained in:
parent
e92b48c1fa
commit
c83b8c2cf8
6 changed files with 15 additions and 29 deletions
|
|
@ -1,4 +1,5 @@
|
|||
using Robust.Shared.Prototypes;
|
||||
using Content.Shared.Database;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
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)
|
||||
=> 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) =>
|
||||
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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,7 +33,5 @@ public sealed partial class AreaReactionEffect : EntityEffectBase<AreaReactionEf
|
|||
("duration", Duration)
|
||||
);
|
||||
|
||||
public override bool ShouldLog => true;
|
||||
|
||||
public override LogImpact LogImpact => LogImpact.High;
|
||||
public override LogImpact? Impact => LogImpact.High;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,7 +52,5 @@ public sealed partial class Emp : EntityEffectBase<Emp>
|
|||
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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,7 +52,5 @@ public sealed partial class ExplosionEffect : EntityEffectBase<ExplosionEffect>
|
|||
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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,9 @@
|
|||
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;
|
||||
|
|
@ -119,11 +118,11 @@ public sealed partial class SharedEntityEffectsSystem : EntitySystem, IEntityEff
|
|||
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}"
|
||||
|
|
@ -213,22 +212,16 @@ public abstract partial class EntityEffect
|
|||
[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.
|
||||
/// </summary>
|
||||
[ViewVariables]
|
||||
public virtual bool ShouldLog => true;
|
||||
|
||||
/// <summary>
|
||||
/// If this effect is logged, how important is the log?
|
||||
/// </summary>
|
||||
[ViewVariables]
|
||||
public virtual LogImpact LogImpact => LogImpact.Low;
|
||||
public virtual LogImpact? Impact => null;
|
||||
|
||||
[ViewVariables]
|
||||
public virtual LogType LogType => LogType.EntityEffect;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue