Add backpack bombing (#1156)
* Change exploding storages to explode their contents as well * Change storages to only trigger content explosions when the severity is heavy or destruction * Make inventories explode their contents as well * Change InventoryComponent IExAct into an explicit implementation * Change chain explosions to only trigger for explosion severities larger than or equal to heavy
This commit is contained in:
@@ -32,7 +32,7 @@ namespace Content.Server.GameObjects
|
||||
[RegisterComponent]
|
||||
[ComponentReference(typeof(IActivate))]
|
||||
[ComponentReference(typeof(IStorageComponent))]
|
||||
public class ServerStorageComponent : SharedStorageComponent, IInteractUsing, IUse, IActivate, IStorageComponent, IDestroyAct
|
||||
public class ServerStorageComponent : SharedStorageComponent, IInteractUsing, IUse, IActivate, IStorageComponent, IDestroyAct, IExAct
|
||||
{
|
||||
#pragma warning disable 649
|
||||
[Dependency] private readonly IMapManager _mapManager;
|
||||
@@ -364,6 +364,24 @@ namespace Content.Server.GameObjects
|
||||
}
|
||||
}
|
||||
|
||||
void IExAct.OnExplosion(ExplosionEventArgs eventArgs)
|
||||
{
|
||||
if (eventArgs.Severity < ExplosionSeverity.Heavy)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var storedEntities = storage.ContainedEntities.ToList();
|
||||
foreach (var entity in storedEntities)
|
||||
{
|
||||
var exActs = entity.GetAllComponents<IExAct>();
|
||||
foreach (var exAct in exActs)
|
||||
{
|
||||
exAct.OnExplosion(eventArgs);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Inserts an entity into the storage component from the players active hand.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user