I recommend reorganizing this block to reduce the number of trait queries:
```csharp
// Destroy all resources in range, not just the outer shell:
if (warhead.DestroyResources)
	foreach (var cell in allCells)
		resLayer.Destroy(cell);

// Splatter resources:
if (!string.IsNullOrEmpty(warhead.AddsResourceType))
{
	var resourceType = world.WorldActor.TraitsImplementing<ResourceType>()
		.FirstOrDefault(t => t.Info.Name == warhead.AddsResourceType);

	if (resourceType == null)
		throw new InvalidOperationException("Warhead defines an invalid resource type '{1}'".F(warhead.AddsResourceType));

	foreach (var cell in allCells)
	{
		var maxSplash = resourceType.Info.MaxDensity - resLayer.GetResourceDensity(cell);
		if (maxSplash < 1)
			continue;

		if (resLayer.GetResource(cell) == resourceType || (resLayer.GetResource(cell) == null && resLayer.AllowResourceAt(resourceType, cell)))
			resLayer.AddResource(resourceType, cell, maxSplash > 1 ? world.SharedRandom.Next(1, maxSplash) : 1);
	}
}
```