using System;
using System.Collections.Generic;
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 System.Text.RegularExpressions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using HG.Reflection;
using IL.RoR2;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using On.RoR2;
using RoR2;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: OptIn]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
internal static class log
{
private static ManualLogSource logger;
internal static void start(ManualLogSource logSource)
{
logger = logSource;
}
internal static void start(string name)
{
logger = Logger.CreateLogSource(name);
}
internal static void info(object data)
{
logger.LogInfo(data);
}
internal static void message(object data)
{
logger.LogMessage(data);
}
internal static void warning(object data)
{
logger.LogWarning(data);
}
internal static void error(object data)
{
logger.LogError(data);
}
internal static void fatal(object data)
{
logger.LogFatal(data);
}
}
namespace ItemBlacklist;
internal class BossItemBlacklist
{
internal static void DoBossHooks()
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_0011: Expected O, but got Unknown
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
//IL_0022: Expected O, but got Unknown
BossGroup.DropRewards += new hook_DropRewards(DropRewards_On);
EquipmentSlot.FireBossHunter += new Manipulator(HunterReplace_IL);
}
private static void DropRewards_On(orig_DropRewards orig, BossGroup self)
{
//IL_0036: Unknown result type (might be due to invalid IL or missing references)
//IL_003c: Expected O, but got Unknown
//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
//IL_0061: Unknown result type (might be due to invalid IL or missing references)
//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
if (!Object.op_Implicit((Object)(object)Run.instance))
{
log.warning("No Run instance");
orig.Invoke(self);
return;
}
if (self.bossDropTables != null)
{
int num = 0;
while (num < self.bossDropTables.Count)
{
ExplicitPickupDropTable val = (ExplicitPickupDropTable)self.bossDropTables[num];
Object pickupDef = val.pickupEntries[0].pickupDef;
ItemDef val2 = (ItemDef)(object)((pickupDef is ItemDef) ? pickupDef : null);
if (Object.op_Implicit((Object)(object)val2) && !Run.instance.IsItemAvailable(val2.itemIndex))
{
self.bossDropTables.Remove((PickupDropTable)(object)val);
}
else
{
num++;
}
}
}
if (self.bossDrops != null)
{
int num2 = 0;
while (num2 < self.bossDrops.Count)
{
PickupIndex val3 = self.bossDrops[num2];
log.info("Removed bossdrop " + Language.GetString(PickupCatalog.GetPickupDef(val3).nameToken));
if (!Run.instance.IsPickupAvailable(val3))
{
self.bossDrops.Remove(val3);
}
else
{
num2++;
}
}
}
orig.Invoke(self);
}
private static void HunterReplace_IL(ILContext il)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Expected O, but got Unknown
ILCursor val = new ILCursor(il);
val.GotoNext((MoveType)2, new Func<Instruction, bool>[4]
{
(Instruction a) => ILPatternMatchingExt.MatchLdfld<DeathRewards>(a, "bossDropTable"),
(Instruction a) => ILPatternMatchingExt.MatchLdarg(a, 0),
(Instruction a) => ILPatternMatchingExt.MatchLdfld<EquipmentSlot>(a, "rng"),
(Instruction a) => ILPatternMatchingExt.MatchCallOrCallvirt<PickupDropTable>(a, "GenerateDrop")
});
val.EmitDelegate<Func<PickupIndex, PickupIndex>>((Func<PickupIndex, PickupIndex>)delegate(PickupIndex pickupIndex)
{
//IL_0005: 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_0032: Unknown result type (might be due to invalid IL or missing references)
//IL_0033: Unknown result type (might be due to invalid IL or missing references)
//IL_0034: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_0051: Unknown result type (might be due to invalid IL or missing references)
//IL_0056: Unknown result type (might be due to invalid IL or missing references)
//IL_0040: Unknown result type (might be due to invalid IL or missing references)
if (Run.instance.IsPickupAvailable(pickupIndex))
{
return pickupIndex;
}
BasicPickupDropTable obj = LegacyResourcesAPI.Load<BasicPickupDropTable>("DropTables/dtDuplicatorWild");
log.info("Replacing banned boss drop with a random boss item");
PickupIndex val2 = ((PickupDropTable)obj).GenerateDrop(Run.instance.treasureRng);
if (val2 != PickupIndex.none)
{
return val2;
}
log.info("No pickup found, dropping pearl instead");
return PickupCatalog.FindPickupIndex(Items.ShinyPearl.itemIndex);
});
}
}
internal class IBConfig
{
private static ConfigFile ibconfigFile { get; set; }
public static ConfigEntry<string> ibItemDefaults { get; set; }
public static ConfigEntry<string> ibEquipDefaults { get; set; }
internal static void DoConfig()
{
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
//IL_001a: Expected O, but got Unknown
ibconfigFile = new ConfigFile(Paths.ConfigPath + "//ItemBlacklist.cfg", true);
ibItemDefaults = ibconfigFile.Bind<string>("Default blacklist", "Items", "Old Guillotine, will-o,gesture, ShieldOnly", "Items listed here will be disabled by default. Case insensitive, partial names allowed, seperated by ', ' or ','. If using internal item names they must match fully, use the item_list command to view them");
ibEquipDefaults = ibconfigFile.Bind<string>("Default blacklist", "Equipments", "", "Equipments listed here will be disabled by default. Case insensitive, seperated by ', ' or ','");
}
}
[BepInPlugin("dolso.ItemBlacklist", "ItemBlacklist", "1.1.5")]
public class ItemBlacklist : BaseUnityPlugin
{
[Serializable]
[CompilerGenerated]
private sealed class <>c
{
public static readonly <>c <>9 = new <>c();
public static hook_HiddenTestItemsConvar <>9__0_0;
internal bool <Awake>b__0_0(orig_HiddenTestItemsConvar self)
{
return false;
}
}
private void Awake()
{
//IL_003b: Unknown result type (might be due to invalid IL or missing references)
//IL_0045: Expected O, but got Unknown
//IL_004c: Unknown result type (might be due to invalid IL or missing references)
//IL_0056: Expected O, but got Unknown
//IL_005d: Unknown result type (might be due to invalid IL or missing references)
//IL_0067: Expected O, but got Unknown
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_002f: Expected O, but got Unknown
log.start(((BaseUnityPlugin)this).Logger);
IBConfig.DoConfig();
object obj = <>c.<>9__0_0;
if (obj == null)
{
hook_HiddenTestItemsConvar val = (orig_HiddenTestItemsConvar self) => false;
<>c.<>9__0_0 = val;
obj = (object)val;
}
RuleCatalog.HiddenTestItemsConvar += (hook_HiddenTestItemsConvar)obj;
RuleDef.FromItem += new hook_FromItem(FixItemRules_On);
RuleDef.FromEquipment += new hook_FromEquipment(FixEquipRules_On);
LocalUserBallotPersistenceManager.OnLocalUserSignIn += new hook_OnLocalUserSignIn(SignedIn_On);
BossItemBlacklist.DoBossHooks();
OnRun.DoHooks();
log.info("ItemBlacklist Loaded");
}
private void SignedIn_On(orig_OnLocalUserSignIn orig, LocalUser localUser)
{
orig.Invoke(localUser);
Vote[] array = PreGameRuleVoteController.CreateBallot();
foreach (string item in FindItemDefs().Concat(FindEquipDefs()))
{
RuleDef val = RuleCatalog.FindRuleDef(item);
if (val != null)
{
((Vote)(ref array[val.globalIndex])).choiceValue = 1;
}
}
LocalUserBallotPersistenceManager.votesCache[localUser] = array;
}
private List<string> FindItemDefs()
{
List<string> list = new List<string>();
string[] array = CreateStringArray(IBConfig.ibItemDefaults.Value);
foreach (string text in array)
{
if (text == null)
{
continue;
}
bool flag = false;
ItemDef[] itemDefs = ItemCatalog.itemDefs;
foreach (ItemDef val in itemDefs)
{
if (ReformatString(((Object)val).name) == text)
{
flag = true;
list.Add("Items." + ((Object)val).name);
break;
}
}
if (flag)
{
continue;
}
itemDefs = ItemCatalog.itemDefs;
foreach (ItemDef val2 in itemDefs)
{
if (ReformatString(Language.GetString(val2.nameToken)).Contains(text))
{
list.Add("Items." + ((Object)val2).name);
break;
}
}
}
return list;
}
private List<string> FindEquipDefs()
{
List<string> list = new List<string>();
string[] array = CreateStringArray(IBConfig.ibEquipDefaults.Value);
foreach (string text in array)
{
if (text == null)
{
continue;
}
bool flag = false;
EquipmentDef[] equipmentDefs = EquipmentCatalog.equipmentDefs;
foreach (EquipmentDef val in equipmentDefs)
{
if (ReformatString(((Object)val).name) == text)
{
flag = true;
list.Add("Equipment." + ((Object)val).name);
break;
}
}
if (flag)
{
continue;
}
equipmentDefs = EquipmentCatalog.equipmentDefs;
foreach (EquipmentDef val2 in equipmentDefs)
{
if (ReformatString(Language.GetString(val2.nameToken)).Contains(text))
{
list.Add("Equipment." + ((Object)val2).name);
break;
}
}
}
return list;
}
private RuleDef FixItemRules_On(orig_FromItem orig, ItemIndex itemIndex)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
//IL_0019: Unknown result type (might be due to invalid IL or missing references)
//IL_001e: Unknown result type (might be due to invalid IL or missing references)
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Unknown result type (might be due to invalid IL or missing references)
//IL_0037: Unknown result type (might be due to invalid IL or missing references)
//IL_004e: Unknown result type (might be due to invalid IL or missing references)
//IL_004f: Unknown result type (might be due to invalid IL or missing references)
RuleDef obj = orig.Invoke(itemIndex);
ItemDef itemDef = ItemCatalog.GetItemDef(itemIndex);
string pickupToken = itemDef.pickupToken;
Color tooltipNameColor = Color32.op_Implicit(ColorCatalog.GetColor(itemDef.darkColorIndex));
RuleChoiceDef obj2 = obj.FindChoice("On");
obj2.tooltipBodyToken = pickupToken;
obj2.tooltipNameColor = tooltipNameColor;
RuleChoiceDef obj3 = obj.FindChoice("Off");
obj3.tooltipBodyToken = pickupToken;
obj3.tooltipNameColor = tooltipNameColor;
return obj;
}
private RuleDef FixEquipRules_On(orig_FromEquipment orig, EquipmentIndex equipIndex)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
//IL_0019: Unknown result type (might be due to invalid IL or missing references)
//IL_001e: Unknown result type (might be due to invalid IL or missing references)
//IL_0032: Unknown result type (might be due to invalid IL or missing references)
//IL_0037: Unknown result type (might be due to invalid IL or missing references)
//IL_003c: Unknown result type (might be due to invalid IL or missing references)
//IL_004f: Unknown result type (might be due to invalid IL or missing references)
//IL_0050: Unknown result type (might be due to invalid IL or missing references)
//IL_0072: Unknown result type (might be due to invalid IL or missing references)
//IL_0073: Unknown result type (might be due to invalid IL or missing references)
RuleDef obj = orig.Invoke(equipIndex);
EquipmentDef equipmentDef = EquipmentCatalog.GetEquipmentDef(equipIndex);
string pickupToken = equipmentDef.pickupToken;
Color tooltipNameColor = Color32.op_Implicit(ColorCatalog.GetColor(equipmentDef.colorIndex)) * new Color(0.75f, 0.75f, 0.75f);
RuleChoiceDef obj2 = obj.FindChoice("On");
obj2.tooltipBodyToken = pickupToken;
obj2.tooltipNameColor = tooltipNameColor;
RuleChoiceDef obj3 = obj.FindChoice("Off");
obj3.spritePath = "Textures/MiscIcons/texUnlockIcon";
obj3.tooltipBodyToken = pickupToken;
obj3.tooltipNameColor = tooltipNameColor;
return obj;
}
private string[] CreateStringArray(string text)
{
string[] array = text.Split(new string[2] { ", ", "," }, StringSplitOptions.None);
for (int i = 0; i < array.Length; i++)
{
if (array[i] == "")
{
array[i] = null;
}
else
{
array[i] = ReformatString(array[i]);
}
}
return array;
}
internal static string ReformatString(string input)
{
return Regex.Replace(input, "[ '_.,-]", string.Empty).ToLower();
}
}
internal class OnRun
{
internal static void DoHooks()
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_0011: Expected O, but got Unknown
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
//IL_0022: Expected O, but got Unknown
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_0033: Expected O, but got Unknown
Run.EnableItemDrop += new Manipulator(EnableItemDrop_IL);
Run.DisableItemDrop += new Manipulator(DisableItemDrop_IL);
Run.EnableEquipmentDrop += new Manipulator(EnableEquipmentDrop_IL);
}
private static void EnableItemDrop_IL(ILContext il)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Expected O, but got Unknown
//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
//IL_015a: Unknown result type (might be due to invalid IL or missing references)
//IL_0166: Unknown result type (might be due to invalid IL or missing references)
//IL_0186: Unknown result type (might be due to invalid IL or missing references)
//IL_0192: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
int flag = 1;
val.GotoNext((MoveType)2, new Func<Instruction, bool>[2]
{
(Instruction a) => ILPatternMatchingExt.MatchLdcI4(a, 0),
(Instruction a) => ILPatternMatchingExt.MatchStloc(a, ref flag)
});
int num3 = default(int);
val.GotoNext((MoveType)2, new Func<Instruction, bool>[3]
{
(Instruction a) => ILPatternMatchingExt.MatchLdarg(a, 0),
(Instruction a) => ILPatternMatchingExt.MatchLdfld<Run>(a, "availableLunarItemDropList"),
(Instruction a) => ILPatternMatchingExt.MatchStloc(a, ref num3)
});
val.Emit(OpCodes.Ldc_I4_1);
val.Emit(OpCodes.Stloc, flag);
int num2 = default(int);
int num = default(int);
val.GotoNext((MoveType)2, new Func<Instruction, bool>[3]
{
(Instruction a) => ILPatternMatchingExt.MatchLdloc(a, ref num2),
(Instruction a) => ILPatternMatchingExt.MatchLdloc(a, ref num),
(Instruction a) => ILPatternMatchingExt.MatchCallOrCallvirt(a, (MethodBase)typeof(List<PickupIndex>).GetMethod("Add"))
});
val.Emit(OpCodes.Ldarg_0);
val.Emit(OpCodes.Ldfld, typeof(Run).GetField("availableItems"));
val.Emit(OpCodes.Ldarg_1);
val.Emit(OpCodes.Callvirt, (MethodBase)typeof(ItemMask).GetMethod("Add"));
}
private static void DisableItemDrop_IL(ILContext il)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Expected O, but got Unknown
//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
//IL_017c: Unknown result type (might be due to invalid IL or missing references)
//IL_0188: Unknown result type (might be due to invalid IL or missing references)
//IL_01a8: Unknown result type (might be due to invalid IL or missing references)
//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
//IL_01d4: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
int flag = 1;
val.GotoNext((MoveType)2, new Func<Instruction, bool>[2]
{
(Instruction a) => ILPatternMatchingExt.MatchLdcI4(a, 0),
(Instruction a) => ILPatternMatchingExt.MatchStloc(a, ref flag)
});
int num3 = default(int);
val.GotoNext((MoveType)2, new Func<Instruction, bool>[3]
{
(Instruction a) => ILPatternMatchingExt.MatchLdarg(a, 0),
(Instruction a) => ILPatternMatchingExt.MatchLdfld<Run>(a, "availableLunarItemDropList"),
(Instruction a) => ILPatternMatchingExt.MatchStloc(a, ref num3)
});
val.Emit(OpCodes.Ldc_I4_1);
val.Emit(OpCodes.Stloc, flag);
int num2 = default(int);
int num = default(int);
val.GotoNext((MoveType)2, new Func<Instruction, bool>[4]
{
(Instruction a) => ILPatternMatchingExt.MatchLdloc(a, ref num2),
(Instruction a) => ILPatternMatchingExt.MatchLdloc(a, ref num),
(Instruction a) => ILPatternMatchingExt.MatchCallOrCallvirt(a, (MethodBase)typeof(List<PickupIndex>).GetMethod("Remove")),
(Instruction a) => ILPatternMatchingExt.MatchPop(a)
});
val.Emit(OpCodes.Ldarg_0);
val.Emit(OpCodes.Ldfld, typeof(Run).GetField("availableItems"));
val.Emit(OpCodes.Ldarg_1);
val.Emit(OpCodes.Callvirt, (MethodBase)typeof(ItemMask).GetMethod("Remove"));
val.Emit(OpCodes.Pop);
}
private static void EnableEquipmentDrop_IL(ILContext il)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Expected O, but got Unknown
//IL_013c: Unknown result type (might be due to invalid IL or missing references)
//IL_0148: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
int flag = 2;
int num2 = default(int);
val.GotoNext((MoveType)2, new Func<Instruction, bool>[4]
{
(Instruction a) => ILPatternMatchingExt.MatchLdnull(a),
(Instruction a) => ILPatternMatchingExt.MatchStloc(a, ref num2),
(Instruction a) => ILPatternMatchingExt.MatchLdcI4(a, 0),
(Instruction a) => ILPatternMatchingExt.MatchStloc(a, ref flag)
});
int num = default(int);
ILLabel val2 = default(ILLabel);
val.GotoNext((MoveType)2, new Func<Instruction, bool>[4]
{
(Instruction a) => ILPatternMatchingExt.MatchLdarg(a, 0),
(Instruction a) => ILPatternMatchingExt.MatchLdfld<Run>(a, "availableLunarEquipmentDropList"),
(Instruction a) => ILPatternMatchingExt.MatchStloc(a, ref num),
(Instruction a) => ILPatternMatchingExt.MatchBr(a, ref val2)
});
val.Index -= 1;
val.Emit(OpCodes.Ldc_I4_1);
val.Emit(OpCodes.Stloc, flag);
}
[ConCommand(/*Could not decode attribute arguments.*/)]
private static void IBWhitelist(ConCommandArgs args)
{
//IL_0088: Unknown result type (might be due to invalid IL or missing references)
if (!Object.op_Implicit((Object)(object)Run.instance))
{
Debug.LogError((object)"Must be in a run");
return;
}
if (((ConCommandArgs)(ref args)).Count == 0)
{
Debug.LogError((object)"Requires at least 1 argument: whitelistitem {item name}");
return;
}
string text = "";
for (int i = 0; i < ((ConCommandArgs)(ref args)).Count; i++)
{
text += ((ConCommandArgs)(ref args))[i];
}
text = ItemBlacklist.ReformatString(text);
ItemDef[] itemDefs = ItemCatalog.itemDefs;
foreach (ItemDef val in itemDefs)
{
if (ItemBlacklist.ReformatString(Language.GetString(val.nameToken)).Contains(text))
{
Run.instance.EnableItemDrop(val.itemIndex);
Debug.Log((object)("Enabled: " + Language.GetString(val.nameToken)));
break;
}
}
}
[ConCommand(/*Could not decode attribute arguments.*/)]
private static void IBBlacklist(ConCommandArgs args)
{
//IL_0088: Unknown result type (might be due to invalid IL or missing references)
if (!Object.op_Implicit((Object)(object)Run.instance))
{
Debug.LogError((object)"Must be in a run");
return;
}
if (((ConCommandArgs)(ref args)).Count == 0)
{
Debug.LogError((object)"Requires at least 1 argument: blacklistitem {item name}");
return;
}
string text = "";
for (int i = 0; i < ((ConCommandArgs)(ref args)).Count; i++)
{
text += ((ConCommandArgs)(ref args))[i];
}
text = ItemBlacklist.ReformatString(text);
ItemDef[] itemDefs = ItemCatalog.itemDefs;
foreach (ItemDef val in itemDefs)
{
if (ItemBlacklist.ReformatString(Language.GetString(val.nameToken)).Contains(text))
{
Run.instance.DisableItemDrop(val.itemIndex);
Debug.Log((object)("Disabled: " + Language.GetString(val.nameToken)));
break;
}
}
}
[ConCommand(/*Could not decode attribute arguments.*/)]
private static void EBWhitelist(ConCommandArgs args)
{
//IL_0088: Unknown result type (might be due to invalid IL or missing references)
if (!Object.op_Implicit((Object)(object)Run.instance))
{
Debug.LogError((object)"Must be in a run");
return;
}
if (((ConCommandArgs)(ref args)).Count == 0)
{
Debug.LogError((object)"Requires at least 1 argument: whitelistequip {equip name}");
return;
}
string text = "";
for (int i = 0; i < ((ConCommandArgs)(ref args)).Count; i++)
{
text += ((ConCommandArgs)(ref args))[i];
}
text = ItemBlacklist.ReformatString(text);
EquipmentDef[] equipmentDefs = EquipmentCatalog.equipmentDefs;
foreach (EquipmentDef val in equipmentDefs)
{
if (ItemBlacklist.ReformatString(Language.GetString(val.nameToken)).Contains(text))
{
Run.instance.EnableEquipmentDrop(val.equipmentIndex);
Debug.Log((object)("Enabled: " + Language.GetString(val.nameToken)));
break;
}
}
}
[ConCommand(/*Could not decode attribute arguments.*/)]
private static void EBBlacklist(ConCommandArgs args)
{
//IL_0088: Unknown result type (might be due to invalid IL or missing references)
if (!Object.op_Implicit((Object)(object)Run.instance))
{
Debug.LogError((object)"Must be in a run");
return;
}
if (((ConCommandArgs)(ref args)).Count == 0)
{
Debug.LogError((object)"Requires at least 1 argument: blacklistequip {equip name}");
return;
}
string text = "";
for (int i = 0; i < ((ConCommandArgs)(ref args)).Count; i++)
{
text += ((ConCommandArgs)(ref args))[i];
}
text = ItemBlacklist.ReformatString(text);
EquipmentDef[] equipmentDefs = EquipmentCatalog.equipmentDefs;
foreach (EquipmentDef val in equipmentDefs)
{
if (ItemBlacklist.ReformatString(Language.GetString(val.nameToken)).Contains(text))
{
Run.instance.DisableEquipmentDrop(val.equipmentIndex);
Debug.Log((object)("Disabled: " + Language.GetString(val.nameToken)));
break;
}
}
}
}