Explosion resistance is now predicted! (#30654)

* First commit

* Added Network and access
This commit is contained in:
beck-thompson
2024-08-04 20:15:07 -07:00
committed by GitHub
parent 84a9253b10
commit 490de1de4e
10 changed files with 53 additions and 30 deletions

View File

@@ -16,6 +16,8 @@ using Content.Shared.GameTicking;
using Content.Shared.Inventory;
using Content.Shared.Projectiles;
using Content.Shared.Throwing;
using Content.Shared.Explosion.Components;
using Content.Shared.Explosion.EntitySystems;
using Robust.Server.GameStates;
using Robust.Server.Player;
using Robust.Shared.Audio.Systems;
@@ -29,7 +31,7 @@ using Robust.Shared.Utility;
namespace Content.Server.Explosion.EntitySystems;
public sealed partial class ExplosionSystem : EntitySystem
public sealed partial class ExplosionSystem : SharedExplosionSystem
{
[Dependency] private readonly IMapManager _mapManager = default!;
[Dependency] private readonly IRobustRandom _robustRandom = default!;
@@ -92,8 +94,6 @@ public sealed partial class ExplosionSystem : EntitySystem
SubscribeLocalEvent<RoundRestartCleanupEvent>(OnReset);
SubscribeLocalEvent<ExplosionResistanceComponent, ArmorExamineEvent>(OnArmorExamine);
// Handled by ExplosionSystem.Processing.cs
SubscribeLocalEvent<MapChangedEvent>(OnMapChanged);
@@ -418,15 +418,4 @@ public sealed partial class ExplosionSystem : EntitySystem
_recoilSystem.KickCamera(uid, -delta.Normalized() * effect);
}
}
private void OnArmorExamine(EntityUid uid, ExplosionResistanceComponent component, ref ArmorExamineEvent args)
{
var value = MathF.Round((1f - component.DamageCoefficient) * 100, 1);
if (value == 0)
return;
args.Msg.PushNewline();
args.Msg.AddMarkupOrThrow(Loc.GetString(component.Examine, ("value", value)));
}
}