Revert "Explosion refactor TEST MERG (#6995)" (#7005)

This commit is contained in:
Leon Friedrich
2022-03-06 06:02:34 +13:00
committed by GitHub
parent cd1902cdf2
commit c95516e5b2
71 changed files with 766 additions and 3964 deletions

View File

@@ -25,7 +25,7 @@ namespace Content.Shared.Damage
[RegisterComponent]
[NetworkedComponent()]
[Friend(typeof(DamageableSystem))]
public sealed class DamageableComponent : Component, IRadiationAct
public sealed class DamageableComponent : Component, IRadiationAct, IExAct
{
/// <summary>
/// This <see cref="DamageContainerPrototype"/> specifies what damage types are supported by this component.
@@ -92,6 +92,27 @@ namespace Content.Shared.Damage
EntitySystem.Get<DamageableSystem>().TryChangeDamage(Owner, damage);
}
// TODO EXPLOSION Remove this.
void IExAct.OnExplosion(ExplosionEventArgs eventArgs)
{
var damageValue = eventArgs.Severity switch
{
ExplosionSeverity.Light => FixedPoint2.New(20),
ExplosionSeverity.Heavy => FixedPoint2.New(60),
ExplosionSeverity.Destruction => FixedPoint2.New(250),
_ => throw new ArgumentOutOfRangeException()
};
// Explosion should really just be a damage group instead of a list of types.
DamageSpecifier damage = new();
foreach (var typeID in ExplosionDamageTypeIDs)
{
damage.DamageDict.Add(typeID, damageValue);
}
EntitySystem.Get<DamageableSystem>().TryChangeDamage(Owner, damage);
}
}
[Serializable, NetSerializable]