Explosion refactor TEST MERG (#6995)

* Explosions

* fix yaml typo

and prevent silly UI inputs

* oop

Co-authored-by: ElectroJr <leonsfriedrich@gmail.com>
This commit is contained in:
Moony
2022-03-04 13:48:01 -06:00
committed by GitHub
parent 4e203f49d2
commit 4a466f4927
71 changed files with 3958 additions and 760 deletions

View File

@@ -0,0 +1,30 @@
using Content.Server.Explosion.EntitySystems;
using Content.Shared.Explosion;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Dictionary;
namespace Content.Server.Explosion.Components;
/// <summary>
/// Component that provides entities with explosion resistance.
/// </summary>
/// <remarks>
/// This is desirable over just using damage modifier sets, given that equipment like bomb-suits need to
/// significantly reduce the damage, but shouldn't be silly overpowered in regular combat.
/// </remarks>
[RegisterComponent]
[Friend(typeof(ExplosionSystem))]
public sealed class ExplosionResistanceComponent : Component
{
/// <summary>
/// The resistance values for this component, This fraction is added to the total resistance.
/// </summary>
[DataField("resistance")]
public float GlobalResistance = 0;
/// <summary>
/// Like <see cref="GlobalResistance"/>, but specified specific to each explosion type for more customizability.
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
[DataField("resistances", customTypeSerializer: typeof(PrototypeIdDictionarySerializer<float, ExplosionPrototype>))]
public Dictionary<string, float> Resistances = new();
}