Make GetExplosionResistance event a struct (#20274)

Also fixed a typo.
This commit is contained in:
metalgearsloth
2023-09-17 19:04:04 +10:00
committed by GitHub
parent 3be88f4680
commit e5d6d7f1eb
6 changed files with 34 additions and 16 deletions

View File

@@ -8,19 +8,15 @@ namespace Content.Shared.Explosion;
/// Raised directed at an entity to determine its explosion resistance, probably right before it is about to be
/// damaged by one.
/// </summary>
public sealed class GetExplosionResistanceEvent : EntityEventArgs, IInventoryRelayEvent
[ByRefEvent]
public record struct GetExplosionResistanceEvent(string ExplosionPrototype) : IInventoryRelayEvent
{
/// <summary>
/// A coefficient applied to overall explosive damage.
/// </summary>
public float DamageCoefficient = 1;
public readonly string ExplotionPrototype;
public readonly string ExplosionPrototype = ExplosionPrototype;
SlotFlags IInventoryRelayEvent.TargetSlots => ~SlotFlags.POCKET;
public GetExplosionResistanceEvent(string id)
{
ExplotionPrototype = id;
}
}