using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using RoR2;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyCompany("NoEquipmentDrones")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("NoEquipmentDrones")]
[assembly: AssemblyTitle("NoEquipmentDrones")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace NoEquipmentDrones;
[BepInPlugin("amiticus.equipmentdroneremover", "Equipment Drone Remover", "1.0.0")]
public class NoEquipmentDronesPlugin : BaseUnityPlugin
{
public void Awake()
{
SceneDirector.onGenerateInteractableCardSelection += FilterDrones;
}
private void FilterDrones(SceneDirector director, DirectorCardCategorySelection dccs)
{
//IL_0028: Unknown result type (might be due to invalid IL or missing references)
//IL_002d: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Unknown result type (might be due to invalid IL or missing references)
//IL_003f: Unknown result type (might be due to invalid IL or missing references)
//IL_007a: Unknown result type (might be due to invalid IL or missing references)
//IL_007b: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)dccs == (Object)null || dccs.categories == null)
{
return;
}
for (int i = 0; i < dccs.categories.Length; i++)
{
Category val = dccs.categories[i];
if (val.cards == null)
{
continue;
}
val.cards = val.cards.Where(delegate(DirectorCard card)
{
SpawnCard obj = card?.spawnCard;
InteractableSpawnCard val2 = (InteractableSpawnCard)(object)((obj is InteractableSpawnCard) ? obj : null);
if (val2 != null)
{
GameObject prefab = ((SpawnCard)val2).prefab;
if ((Object)(object)prefab != (Object)null)
{
bool flag = ((Object)prefab).name.ToLower().Contains("equipmentdrone");
return !flag;
}
}
return true;
}).ToArray();
dccs.categories[i] = val;
}
}
}