using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using On.RoR2;
using R2API.Utils;
using RoR2;
using RoR2.UI;
using UnityEngine;
using UnityEngine.Networking;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("ScannerPlusOne")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("ScannerPlusOne")]
[assembly: AssemblyTitle("ScannerPlusOne")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace ScannerPlusOne;
public static class Reflection
{
private static readonly BindingFlags _defaultFlags = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy;
public static TReturn GetFieldValue<TReturn>(this object instance, string fieldName)
{
return (TReturn)instance.GetType().GetField(fieldName, _defaultFlags | BindingFlags.Instance).GetValue(instance);
}
public static TReturn GetFieldValue<TClass, TReturn>(string fieldName)
{
return typeof(TClass).GetFieldValue<TReturn>(fieldName);
}
public static TReturn GetFieldValue<TReturn>(this Type type, string fieldName)
{
return (TReturn)type.GetField(fieldName, _defaultFlags | BindingFlags.Static).GetValue(null);
}
public static void SetFieldValue(this object instance, string fieldName, object value)
{
instance.GetType().GetField(fieldName, _defaultFlags | BindingFlags.Instance).SetValue(instance, value);
}
public static void SetFieldValue<TClass>(string fieldName, object value)
{
typeof(TClass).SetFieldValue(fieldName, value);
}
public static void SetFieldValue(this Type type, string fieldName, object value)
{
type.GetField(fieldName, _defaultFlags | BindingFlags.Static).SetValue(null, value);
}
public static TReturn GetPropertyValue<TReturn>(this object instance, string propName)
{
return (TReturn)instance.GetType().GetProperty(propName, _defaultFlags | BindingFlags.Instance).GetValue(instance);
}
public static TReturn GetPropertyValue<TClass, TReturn>(string propName)
{
return typeof(TClass).GetPropertyValue<TReturn>(propName);
}
public static TReturn GetPropertyValue<TReturn>(this Type type, string propName)
{
return (TReturn)type.GetProperty(propName, _defaultFlags | BindingFlags.Static).GetValue(null);
}
public static void SetPropertyValue(this object instance, string propName, object value)
{
instance.GetType().GetProperty(propName, _defaultFlags | BindingFlags.Instance).SetValue(instance, value);
}
public static void SetPropertyValue<TClass>(string propName, object value)
{
typeof(TClass).SetPropertyValue(propName, value);
}
public static void SetPropertyValue(this Type type, string propName, object value)
{
type.GetProperty(propName, _defaultFlags | BindingFlags.Static).SetValue(null, value);
}
public static TReturn InvokeMethod<TReturn>(this object instance, string methodName, params object[] methodParams)
{
return (TReturn)instance.GetType().GetMethod(methodName, _defaultFlags | BindingFlags.Instance).Invoke(instance, methodParams);
}
public static TReturn InvokeMethod<TClass, TReturn>(string methodName, params object[] methodParams)
{
return typeof(TClass).InvokeMethod<TReturn>(methodName, methodParams);
}
public static TReturn InvokeMethod<TReturn>(this Type type, string methodName, params object[] methodParams)
{
return (TReturn)type.GetMethod(methodName, _defaultFlags | BindingFlags.Static).Invoke(null, methodParams);
}
public static void InvokeMethod(this object instance, string methodName, params object[] methodParams)
{
instance.InvokeMethod<object>(methodName, methodParams);
}
public static void InvokeMethod<TClass>(string methodName, params object[] methodParams)
{
InvokeMethod<TClass, object>(methodName, methodParams);
}
public static void InvokeMethod(this Type type, string methodName, params object[] methodParams)
{
InvokeMethod<object>(methodName, methodParams);
}
public static Type GetNestedType<TParent>(string name)
{
return GetNestedType(typeof(TParent), name);
}
public static Type GetNestedType(this Type parentType, string name)
{
return parentType.GetNestedType(name, BindingFlags.Public | BindingFlags.NonPublic);
}
public static object Instantiate(this Type type)
{
return Activator.CreateInstance(type, nonPublic: true);
}
public static object InstantiateGeneric<TClass>(Type typeArgument)
{
return typeof(TClass).InstantiateGeneric(typeArgument);
}
public static object InstantiateGeneric(this Type genericType, Type typeArgument)
{
return genericType.MakeGenericType(typeArgument).Instantiate();
}
public static object InstantiateGeneric<TClass>(Type[] typeArguments)
{
return typeof(TClass).InstantiateGeneric(typeArguments);
}
public static object InstantiateGeneric(this Type genericType, Type[] typeArguments)
{
return genericType.MakeGenericType(typeArguments).Instantiate();
}
public static IList InstantiateList(this Type type)
{
return (IList)typeof(List<>).MakeGenericType(type).Instantiate();
}
}
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInPlugin("com.MagnusMagnuson.ScannerPlusOne", "ScannerPlusOne", "2.7.1")]
[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
public class ScannerPlusOne : BaseUnityPlugin
{
private List<PendingRevealInteractable> interactableList = new List<PendingRevealInteractable>();
public static ConfigWrapper<bool> UseScannerChat;
public static ConfigWrapper<bool> UseScannerIcons;
public static ConfigWrapper<bool> ShowQuestionMarks;
public static ConfigWrapper<int> IconTransparency;
public static ConfigWrapper<bool> ShowBarrels;
public static ConfigWrapper<string> BarrelColor;
public static ConfigWrapper<bool> ShowChests;
public static ConfigWrapper<string> ChestColor;
public static ConfigWrapper<bool> ShowEquipment;
public static ConfigWrapper<string> EquipmentColor;
public static ConfigWrapper<bool> ShowLunarChests;
public static ConfigWrapper<string> LunarChestColor;
public static ConfigWrapper<bool> ShowShrines;
public static ConfigWrapper<string> ShrineColor;
public static ConfigWrapper<bool> ShowChanceShrines;
public static ConfigWrapper<string> ChanceShrineColor;
public static ConfigWrapper<bool> ShowIndividualShrines;
public static ConfigWrapper<bool> ShowBloodShrines;
public static ConfigWrapper<string> BloodShrineColor;
public static ConfigWrapper<bool> ShowCombatShrines;
public static ConfigWrapper<string> CombatShrineColor;
public static ConfigWrapper<bool> ShowMountainShrines;
public static ConfigWrapper<string> MountainShrineColor;
public static ConfigWrapper<bool> ShowGoldShrines;
public static ConfigWrapper<string> GoldShrineColor;
public static ConfigWrapper<bool> ShowWoodShrines;
public static ConfigWrapper<string> WoodShrineColor;
public static ConfigWrapper<bool> ShowOrderShrines;
public static ConfigWrapper<string> OrderShrineColor;
public static ConfigWrapper<bool> ShowCleanseShrines;
public static ConfigWrapper<string> CleanseShrineColor;
public static ConfigWrapper<bool> ShowDrones;
public static ConfigWrapper<string> DroneColor;
public static ConfigWrapper<bool> ShowTurrets;
public static ConfigWrapper<string> TurretColor;
public static ConfigWrapper<bool> ShowDuplicator;
public static ConfigWrapper<string> DuplicatorColor;
public static ConfigWrapper<bool> ShowCategoryChestDamage;
public static ConfigWrapper<string> CategoryChestDamageColor;
public static ConfigWrapper<bool> ShowCategoryChestHealing;
public static ConfigWrapper<string> CategoryChestHealingColor;
public static ConfigWrapper<bool> ShowCategoryChestUtility;
public static ConfigWrapper<string> CategoryChestUtilityColor;
public static ConfigWrapper<bool> ShowRusty;
public static ConfigWrapper<string> RustyColor;
public static ConfigWrapper<bool> ShowNewtAltar;
public static ConfigWrapper<string> NewtAltarColor;
public static ConfigWrapper<bool> ShowTeleporter;
public static ConfigWrapper<string> TeleporterColor;
public static ConfigWrapper<bool> ShowScrapper;
public static ConfigWrapper<string> ScrapperColor;
public static ConfigWrapper<string> VoidChestColor;
public static ConfigWrapper<string> VoidBarrelColor;
public static ConfigWrapper<bool> LegacyMode;
public static ConfigWrapper<bool> ShowBarrelsChat;
public static ConfigWrapper<bool> ShowChestsChat;
public static ConfigWrapper<bool> ShowEquipmentChat;
public static ConfigWrapper<bool> ShowLunarChestsChat;
public static ConfigWrapper<bool> ShowShrinesChat;
public static ConfigWrapper<bool> ShowIndividualShrinesChat;
public static ConfigWrapper<bool> ShowChanceShrinesChat;
public static ConfigWrapper<bool> ShowBloodShrinesChat;
public static ConfigWrapper<bool> ShowCombatShrinesChat;
public static ConfigWrapper<bool> ShowMountainShrinesChat;
public static ConfigWrapper<bool> ShowGoldShrinesChat;
public static ConfigWrapper<bool> ShowWoodShrinesChat;
public static ConfigWrapper<bool> ShowOrderShrinesChat;
public static ConfigWrapper<bool> ShowCleanseShrinesChat;
public static ConfigWrapper<bool> ShowDronesAndTurretsChat;
public static ConfigWrapper<bool> ShowDuplicatorChat;
public static ConfigWrapper<bool> ShowCategoryChestDamageChat;
public static ConfigWrapper<bool> ShowCategoryChestHealingChat;
public static ConfigWrapper<bool> ShowCategoryChestUtilityChat;
public static ConfigWrapper<bool> ShowRustyChat;
public static ConfigWrapper<bool> ShowNewtAltarChat;
public static ConfigWrapper<bool> ShowScrapperChat;
public void InitConfig()
{
UseScannerChat = ((BaseUnityPlugin)this).Config.Wrap<bool>("1. Turn on/off components", "UseScannerChat", "The scanner tells you in the chat how many gold purchaseables (chests, equipment barrels and chance shrines) and lunar chests are left.", true);
UseScannerIcons = ((BaseUnityPlugin)this).Config.Wrap<bool>("1. Turn on/off components", "UseScannerIcons", "Instead of question marks, the scanner reveals what kind of interactable (e.g. chest, duplicator, teleporter etc) there really are.", true);
ShowQuestionMarks = ((BaseUnityPlugin)this).Config.Wrap<bool>("3. ScannerIcons", "ShowQuestionMarks", "If this is turned on, hidden scanner icons will not simply be gone, but instead appear as question marks.", true);
IconTransparency = ((BaseUnityPlugin)this).Config.Wrap<int>("3. ScannerIcons", "IconTransparency", "Determine the transparency of the scanner icons. Valid values range from 0 to 255. O being fully transparent and 255 being fully opaque.", 122);
ShowBarrels = ((BaseUnityPlugin)this).Config.Wrap<bool>("3. ScannerIcons", "ShowBarrels", "Whether money barrels should show up on the scanner.", false);
BarrelColor = ((BaseUnityPlugin)this).Config.Wrap<string>("3. ScannerIcons", "BarrelColor", "Color for the money barrel icon (chest) that shows up on the scanner.", "#05cea5");
ShowChests = ((BaseUnityPlugin)this).Config.Wrap<bool>("3. ScannerIcons", "ShowChests", "Whether money chests should show up on the scanner.", true);
ChestColor = ((BaseUnityPlugin)this).Config.Wrap<string>("3. ScannerIcons", "ChestColor", "Color for the chest icon (chest) that shows up on the scanner.", "#f9da0c");
ShowEquipment = ((BaseUnityPlugin)this).Config.Wrap<bool>("3. ScannerIcons", "ShowEquipment", "Whether equipment barrels should show up on the scanner.", true);
EquipmentColor = ((BaseUnityPlugin)this).Config.Wrap<string>("3. ScannerIcons", "EquipmentColor", "Color for the equipment barrel icon (chest) that shows up on the scanner.", "#ff8019");
ShowLunarChests = ((BaseUnityPlugin)this).Config.Wrap<bool>("3. ScannerIcons", "ShowLunarChests", "Whether lunar chests should show up on the scanner.", true);
LunarChestColor = ((BaseUnityPlugin)this).Config.Wrap<string>("3. ScannerIcons", "LunarChestColor", "Color for the lunar chest icon (chest) that shows up on the scanner.", "#1822ad");
ShowShrines = ((BaseUnityPlugin)this).Config.Wrap<bool>("3. ScannerIcons", "ShowShrines", "Whether shrines should show up on the scanner.", true);
ShrineColor = ((BaseUnityPlugin)this).Config.Wrap<string>("3. ScannerIcons", "ShrineColor", "Color for the shrine icon (shrine) that shows up on the scanner.", "#6d523b");
ShowIndividualShrines = ((BaseUnityPlugin)this).Config.Wrap<bool>("3. ScannerIcons", "ShowIndividualShrines", "Whether shrines should use individual config when showing up on the scanner.", true);
ShowChanceShrines = ((BaseUnityPlugin)this).Config.Wrap<bool>("3. ScannerIcons", "ShowChanceShrines", "(Only matters if ShowIndividualShrines is set to true) Whether chance shrines should show up on the scanner.", true);
ChanceShrineColor = ((BaseUnityPlugin)this).Config.Wrap<string>("3. ScannerIcons", "ChanceShrineColor", "Color for the chance shrine icon (shrine) that shows up on the scanner.", "#c4f743");
ShowBloodShrines = ((BaseUnityPlugin)this).Config.Wrap<bool>("3. ScannerIcons", "ShowBloodShrines", "(Only matters if ShowIndividualShrines is set to true) Whether blood shrines should show up on the scanner.", true);
BloodShrineColor = ((BaseUnityPlugin)this).Config.Wrap<string>("3. ScannerIcons", "BloodShrineColor", "Color for the blood shrine icon (shrine) that shows up on the scanner.", "#f76363");
ShowCombatShrines = ((BaseUnityPlugin)this).Config.Wrap<bool>("3. ScannerIcons", "ShowCombatShrines", "(Only matters if ShowIndividualShrines is set to true) Whether combat shrines should show up on the scanner.", true);
CombatShrineColor = ((BaseUnityPlugin)this).Config.Wrap<string>("3. ScannerIcons", "CombatShrineColor", "Color for the combat shrine icon (shrine) that shows up on the scanner.", "#fab8ff");
ShowMountainShrines = ((BaseUnityPlugin)this).Config.Wrap<bool>("3. ScannerIcons", "ShowMountainShrines", "(Only matters if ShowIndividualShrines is set to true) Whether mountain shrines should show up on the scanner.", true);
MountainShrineColor = ((BaseUnityPlugin)this).Config.Wrap<string>("3. ScannerIcons", "MountainShrineColor", "Color for the mountain shrine icon (shrine) that shows up on the scanner.", "#4dc3ff");
ShowGoldShrines = ((BaseUnityPlugin)this).Config.Wrap<bool>("3. ScannerIcons", "ShowGoldShrines", "(Only matters if ShowIndividualShrines is set to true) Whether gold shrines should show up on the scanner.", true);
GoldShrineColor = ((BaseUnityPlugin)this).Config.Wrap<string>("3. ScannerIcons", "GoldShrineColor", "Color for the gold shrine icon (shrine) that shows up on the scanner.", "#b5b507");
ShowWoodShrines = ((BaseUnityPlugin)this).Config.Wrap<bool>("3. ScannerIcons", "ShowWoodShrines", "(Only matters if ShowIndividualShrines is set to true) Whether wood shrines should show up on the scanner.", true);
WoodShrineColor = ((BaseUnityPlugin)this).Config.Wrap<string>("3. ScannerIcons", "WoodShrineColor", "Color for the wood shrine icon (shrine) that shows up on the scanner.", "#006e0d");
ShowOrderShrines = ((BaseUnityPlugin)this).Config.Wrap<bool>("3. ScannerIcons", "ShowOrderShrines", "(Only matters if ShowIndividualShrines is set to true) Whether order shrines should show up on the scanner.", true);
OrderShrineColor = ((BaseUnityPlugin)this).Config.Wrap<string>("3. ScannerIcons", "OrderShrineColor", "Color for the order shrine icon (shrine) that shows up on the scanner.", "#dbf7ff");
ShowCleanseShrines = ((BaseUnityPlugin)this).Config.Wrap<bool>("3. ScannerIcons", "ShowCleanseShrines", "(Only matters if ShowIndividualShrines is set to true) Whether cleansing pool should show up on the scanner.", true);
CleanseShrineColor = ((BaseUnityPlugin)this).Config.Wrap<string>("3. ScannerIcons", "CleanseShrineColor", "Color for the cleansing pool icon (shrine) that shows up on the scanner.", "#0033cc");
ShowDrones = ((BaseUnityPlugin)this).Config.Wrap<bool>("3. ScannerIcons", "ShowDrones", "Whether drones should show up on the scanner.", true);
DroneColor = ((BaseUnityPlugin)this).Config.Wrap<string>("3. ScannerIcons", "DroneColor", "Color for the drone icon (drone) that shows up on the scanner.", "#005919");
ShowTurrets = ((BaseUnityPlugin)this).Config.Wrap<bool>("3. ScannerIcons", "ShowTurrets", "Whether turrets should show up on the scanner.", true);
TurretColor = ((BaseUnityPlugin)this).Config.Wrap<string>("3. ScannerIcons", "TurretColor", "Color for the turret icon (drone) that shows up on the scanner.", "#005919");
ShowDuplicator = ((BaseUnityPlugin)this).Config.Wrap<bool>("3. ScannerIcons", "ShowDuplicator", "Whether duplicators should show up on the scanner.", true);
DuplicatorColor = ((BaseUnityPlugin)this).Config.Wrap<string>("3. ScannerIcons", "DuplicatorColor", "Color for the duplicator icon (chest) that shows up on the scanner.", "#538daa");
ShowScrapper = ((BaseUnityPlugin)this).Config.Wrap<bool>("3. ScannerIcons", "ShowScrapper", "Whether scrappers should show up on the scanner.", true);
ScrapperColor = ((BaseUnityPlugin)this).Config.Wrap<string>("3. ScannerIcons", "ScrapperColor", "Color for the scrapper icon (bag) that shows up on the scanner.", "#48f542");
ShowCategoryChestDamage = ((BaseUnityPlugin)this).Config.Wrap<bool>("3. ScannerIcons", "ShowCategoryChestDamage", "Whether the new Damage Chest should show up on the scanner.", true);
CategoryChestDamageColor = ((BaseUnityPlugin)this).Config.Wrap<string>("3. ScannerIcons", "CategoryChestDamageColor", "Color for the new Damage Chest that shows up on the scanner.", "#8a3226");
ShowCategoryChestHealing = ((BaseUnityPlugin)this).Config.Wrap<bool>("3. ScannerIcons", "ShowCategoryChestHealing", "Whether the new Healing Chest should show up on the scanner.", true);
CategoryChestHealingColor = ((BaseUnityPlugin)this).Config.Wrap<string>("3. ScannerIcons", "CategoryChestHealingColor", "Color for the new Healing Chest that shows up on the scanner.", "#2e9348");
ShowCategoryChestUtility = ((BaseUnityPlugin)this).Config.Wrap<bool>("3. ScannerIcons", "ShowCategoryChestUtility", "Whether the new Utility Chest should show up on the scanner.", true);
CategoryChestUtilityColor = ((BaseUnityPlugin)this).Config.Wrap<string>("3. ScannerIcons", "CategoryChestUtilityColor", "Color for the new Utility Chest that shows up on the scanner.", "#843e87");
ShowRusty = ((BaseUnityPlugin)this).Config.Wrap<bool>("3. ScannerIcons", "ShowRusty", "Whether Rusty Boxes should show up on the scanner.", true);
RustyColor = ((BaseUnityPlugin)this).Config.Wrap<string>("3. ScannerIcons", "RustyColor", "Color for the Rusty Lockbox icon (chest) that shows up on the scanner.", "#eaeaea");
ShowNewtAltar = ((BaseUnityPlugin)this).Config.Wrap<bool>("3. ScannerIcons", "ShowNewtAltar", "Whether newt altars should show up on the scanner.", false);
NewtAltarColor = ((BaseUnityPlugin)this).Config.Wrap<string>("3. ScannerIcons", "NewtAltarColor", "Color for the newt altar icon (teleporter icon, because too many chest icons and it basically is a teleporter) that shows up on the scanner.", "#1139ff");
ShowTeleporter = ((BaseUnityPlugin)this).Config.Wrap<bool>("3. ScannerIcons", "ShowTeleporter", "Whether the teleporter should show up on the scanner.", true);
TeleporterColor = ((BaseUnityPlugin)this).Config.Wrap<string>("3. ScannerIcons", "TeleporterColor", "Color for the Teleporter icon (teleporter) that shows up on the scanner.", "#590808");
VoidChestColor = ((BaseUnityPlugin)this).Config.Wrap<string>("3. ScannerIcons", "VoidChestColor", "Color for the void chest icon (chest) that shows up on the scanner.", "#964092");
VoidBarrelColor = ((BaseUnityPlugin)this).Config.Wrap<string>("3. ScannerIcons", "VoidBarrelColor", "Color for the void money barrel icon (chest) that shows up on the scanner.", "#964092");
LegacyMode = ((BaseUnityPlugin)this).Config.Wrap<bool>("2. ScannerChat", "LegacyMode", "Whether to use the Scanner's chat message settings from before v2.0.0", false);
ShowBarrelsChat = ((BaseUnityPlugin)this).Config.Wrap<bool>("2. ScannerChat", "ShowBarrelsChat", "Whether to add money barrels to the scanner chat notification.", false);
ShowChestsChat = ((BaseUnityPlugin)this).Config.Wrap<bool>("2. ScannerChat", "ShowChestsChat", "Whether to add chests to the scanner chat notification.", true);
ShowEquipmentChat = ((BaseUnityPlugin)this).Config.Wrap<bool>("2. ScannerChat", "ShowEquipmentChat", "Whether to add equipment barrels to the scanner chat notification.", true);
ShowLunarChestsChat = ((BaseUnityPlugin)this).Config.Wrap<bool>("2. ScannerChat", "ShowLunarChestsChat", "Whether to add lunar chests to the scanner chat notification.", false);
ShowShrinesChat = ((BaseUnityPlugin)this).Config.Wrap<bool>("2. ScannerChat", "ShowShrinesChat", "Whether to add shrines to the scanner chat notification.", true);
ShowIndividualShrinesChat = ((BaseUnityPlugin)this).Config.Wrap<bool>("2. ScannerChat", "ShowIndividualShrinesChat", "Whether to list the individual shrine types, rather than summing them up, in the chat notification.", true);
ShowChanceShrinesChat = ((BaseUnityPlugin)this).Config.Wrap<bool>("2. ScannerChat", "ShowChanceShrinesChat", "(Only matters if you set ShowIndividualShrinesChat to true) Whether to add chance shrines to the scanner chat notification.", true);
ShowBloodShrinesChat = ((BaseUnityPlugin)this).Config.Wrap<bool>("2. ScannerChat", "ShowBloodShrinesChat", "(Only matters if you set ShowIndividualShrinesChat to true) Whether to add blood shrines to the scanner chat notification.", true);
ShowCombatShrinesChat = ((BaseUnityPlugin)this).Config.Wrap<bool>("2. ScannerChat", "ShowCombatShrinesChat", "(Only matters if you set ShowIndividualShrinesChat to true) Whether to add combat shrines to the scanner chat notification.", true);
ShowMountainShrinesChat = ((BaseUnityPlugin)this).Config.Wrap<bool>("2. ScannerChat", "ShowMountainShrinesChat", "(Only matters if you set ShowIndividualShrinesChat to true) Whether to add mountain shrines to the scanner chat notification.", true);
ShowGoldShrinesChat = ((BaseUnityPlugin)this).Config.Wrap<bool>("2. ScannerChat", "ShowGoldShrinesChat", "(Only matters if you set ShowIndividualShrinesChat to true) Whether to add gold shrines to the scanner chat notification.", true);
ShowWoodShrinesChat = ((BaseUnityPlugin)this).Config.Wrap<bool>("2. ScannerChat", "ShowWoodShrinesChat", "(Only matters if you set ShowIndividualShrinesChat to true) Whether to add wood shrines to the scanner chat notification.", true);
ShowOrderShrinesChat = ((BaseUnityPlugin)this).Config.Wrap<bool>("2. ScannerChat", "ShowOrderShrinesChat", "(Only matters if you set ShowIndividualShrinesChat to true) Whether to add order shrines to the scanner chat notification.", true);
ShowCleanseShrinesChat = ((BaseUnityPlugin)this).Config.Wrap<bool>("2. ScannerChat", "ShowCleanseShrinesChat", "(Only matters if you set ShowIndividualShrinesChat to true) Whether to add cleansing pool to the scanner chat notification.", true);
ShowDronesAndTurretsChat = ((BaseUnityPlugin)this).Config.Wrap<bool>("2. ScannerChat", "ShowDronesAndTurretsChat", "Whether to add drones and turrets to the scanner chat notification.", true);
ShowDuplicatorChat = ((BaseUnityPlugin)this).Config.Wrap<bool>("2. ScannerChat", "ShowDuplicatorChat", "Whether to add duplicators to the scanner chat notification.", false);
ShowScrapperChat = ((BaseUnityPlugin)this).Config.Wrap<bool>("2. ScannerChat", "ShowScrapperChat", "Whether to add scrappers to the scanner chat notification.", false);
ShowCategoryChestDamageChat = ((BaseUnityPlugin)this).Config.Wrap<bool>("2. ScannerChat", "ShowCategoryChestDamageChat", "Whether to add the new Damage Chest to the scanner chat notification.", true);
ShowCategoryChestHealingChat = ((BaseUnityPlugin)this).Config.Wrap<bool>("2. ScannerChat", "ShowCategoryChestHealingChat", "Whether to add the new Healing Chest to the scanner chat notification.", true);
ShowCategoryChestUtilityChat = ((BaseUnityPlugin)this).Config.Wrap<bool>("2. ScannerChat", "ShowCategoryChestUtilityChat", "Whether to add the new Utility Chest to the scanner chat notification.", true);
ShowRustyChat = ((BaseUnityPlugin)this).Config.Wrap<bool>("2. ScannerChat", "ShowRustyChat", "Whether to add rusty lockbox to the scanner chat notification.", false);
ShowNewtAltarChat = ((BaseUnityPlugin)this).Config.Wrap<bool>("2. ScannerChat", "ShowNewtAltarChat", "Whether to add newt altars to the scanner chat notification.", false);
}
public void Awake()
{
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_0017: Expected O, but got Unknown
//IL_001e: Unknown result type (might be due to invalid IL or missing references)
//IL_0028: Expected O, but got Unknown
InitConfig();
ChestRevealer.FixedUpdate += (hook_FixedUpdate)delegate(orig_FixedUpdate orig, ChestRevealer self)
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
//IL_001c: Unknown result type (might be due to invalid IL or missing references)
//IL_0027: Unknown result type (might be due to invalid IL or missing references)
//IL_0057: Unknown result type (might be due to invalid IL or missing references)
//IL_005c: 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_00de: Unknown result type (might be due to invalid IL or missing references)
//IL_00e8: Expected O, but got Unknown
//IL_0198: Unknown result type (might be due to invalid IL or missing references)
//IL_019d: Unknown result type (might be due to invalid IL or missing references)
//IL_019e: Unknown result type (might be due to invalid IL or missing references)
//IL_01a3: Unknown result type (might be due to invalid IL or missing references)
//IL_01d9: Unknown result type (might be due to invalid IL or missing references)
//IL_01e0: Unknown result type (might be due to invalid IL or missing references)
FixedTimeStamp fieldValue = self.GetFieldValue<FixedTimeStamp>("nextPulse");
if (((FixedTimeStamp)(ref fieldValue)).hasPassed)
{
self.SetFieldValue("nextPulse", FixedTimeStamp.now + self.pulseInterval);
ChatTreasureInfo cti = new ChatTreasureInfo();
interactableList = new List<PendingRevealInteractable>();
Vector3 footPosition = CameraRigController.readOnlyInstancesList[0].targetBody.footPosition;
Type[] array = (from t in typeof(ChestRevealer).Assembly.GetTypes()
where typeof(IInteractable).IsAssignableFrom(t)
select t).ToArray();
string text = "";
int num = 0;
for (int i = 0; i < array.Length; i++)
{
foreach (MonoBehaviour item2 in InstanceTracker.FindInstancesEnumerable(array[i]))
{
if (((IInteractable)item2).ShouldShowOnScanner())
{
string text2 = ((object)(IInteractable)item2).ToString().ToLower();
text = text + text2.Split(' ')[0] + " ";
num++;
if (num == 5)
{
num = 0;
text += "\n";
}
if (UseScannerChat.Value)
{
if (LegacyMode.Value)
{
addTreasureInfoLegacy(cti, text2);
}
else
{
addTreasureInfo(cti, text2);
}
}
if (UseScannerIcons.Value)
{
PendingRevealInteractable.ItemType itemType = PendingRevealInteractable.GetItemType(text2);
if (skipInstance(itemType, text2))
{
if (ShowQuestionMarks.Value)
{
addQuestionMark(self, ((Component)item2).transform);
}
}
else
{
Vector3 val = ((Component)item2).transform.position - footPosition;
float sqrMagnitude = ((Vector3)(ref val)).sqrMagnitude;
_ = self.radius;
_ = self.radius;
float num2 = 1f / self.pulseTravelSpeed;
float num3 = Mathf.Sqrt(sqrMagnitude) * num2;
PendingRevealInteractable item = new PendingRevealInteractable(((Component)item2).gameObject, FixedTimeStamp.now + num3, itemType);
interactableList.Add(item);
}
}
}
}
}
if (UseScannerIcons.Value)
{
Pulse(self, array);
}
else
{
self.Pulse();
}
if (UseScannerChat.Value)
{
printChatTreasureInfo(cti);
}
}
};
ChestRevealer.StaticFixedUpdate += (hook_StaticFixedUpdate)delegate(orig_StaticFixedUpdate orig)
{
//IL_002d: Unknown result type (might be due to invalid IL or missing references)
orig.Invoke();
if (CameraRigController.readOnlyInstancesList.Count > 0)
{
CharacterBody targetBody = CameraRigController.readOnlyInstancesList[0].targetBody;
if (Object.op_Implicit((Object)(object)targetBody))
{
_ = targetBody.footPosition;
interactableList.Sort();
while (interactableList.Count > 0)
{
PendingRevealInteractable pendingRevealInteractable = interactableList[0];
if (!((FixedTimeStamp)(ref pendingRevealInteractable.time)).hasPassed)
{
break;
}
if (Object.op_Implicit((Object)(object)pendingRevealInteractable.gameObject))
{
createPingIndicator(pendingRevealInteractable);
}
interactableList.RemoveAt(0);
}
}
}
};
}
private bool skipSpecificShrine(string item)
{
if (item.Contains("chance"))
{
return !ShowChanceShrines.Value;
}
if (item.Contains("blood"))
{
return !ShowBloodShrines.Value;
}
if (item.Contains("combat"))
{
return !ShowChanceShrines.Value;
}
if (item.Contains("boss"))
{
return !ShowMountainShrines.Value;
}
if (item.Contains("gold"))
{
return !ShowGoldShrines.Value;
}
if (item.Contains("healing"))
{
return !ShowWoodShrines.Value;
}
if (item.Contains("restack"))
{
return !ShowOrderShrines.Value;
}
if (item.Contains("cleanse"))
{
return !ShowCleanseShrines.Value;
}
return true;
}
private void addQuestionMark(ChestRevealer self, Transform revealableTransform)
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
//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_0033: Unknown result type (might be due to invalid IL or missing references)
//IL_0078: Unknown result type (might be due to invalid IL or missing references)
//IL_007e: Unknown result type (might be due to invalid IL or missing references)
Vector3 position = ((Component)self).transform.position;
_ = self.radius;
_ = self.radius;
float num = 1f / self.pulseTravelSpeed;
Vector3 val = revealableTransform.position - position;
float num2 = Mathf.Sqrt(((Vector3)(ref val)).sqrMagnitude) * num;
object obj = Activator.CreateInstance(typeof(ChestRevealer).GetNestedType("PendingReveal", BindingFlags.NonPublic), nonPublic: true);
obj.SetFieldValue("gameObject", ((Component)revealableTransform).gameObject);
obj.SetFieldValue("time", FixedTimeStamp.now + num2);
obj.SetFieldValue("duration", self.revealDuration);
BindingFlags bindingAttr = BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic;
typeof(ChestRevealer).GetField("pendingReveals", bindingAttr).GetValue(null).InvokeMethod("Add", obj);
}
private void addTreasureInfo(ChatTreasureInfo cti, string item)
{
if (item.Contains("voidtriple"))
{
cti.voidmultishopCount++;
return;
}
if (item.Contains("multi"))
{
cti.multishopCount++;
return;
}
switch (PendingRevealInteractable.GetItemType(item))
{
case PendingRevealInteractable.ItemType.Barrel:
cti.moneyBarrelsCount++;
break;
case PendingRevealInteractable.ItemType.ItemChest:
cti.itemTreasureCount++;
break;
case PendingRevealInteractable.ItemType.EquipmentChest:
cti.equipmentTreasureCount++;
break;
case PendingRevealInteractable.ItemType.Drone:
cti.dronesCount++;
break;
case PendingRevealInteractable.ItemType.Turret:
cti.turretsCount++;
break;
case PendingRevealInteractable.ItemType.LunarChest:
cti.lunarTreasureCount++;
break;
case PendingRevealInteractable.ItemType.Rusty:
cti.rustyCount++;
break;
case PendingRevealInteractable.ItemType.Shrine:
cti.shrineCount++;
if (ShowIndividualShrinesChat.Value)
{
countSpecificShrine(cti, item);
}
break;
case PendingRevealInteractable.ItemType.Duplicator:
cti.duplicatorCount++;
break;
case PendingRevealInteractable.ItemType.CategoryChestDamage:
cti.damageChestCount++;
break;
case PendingRevealInteractable.ItemType.CategoryChestHealing:
cti.healingChestCount++;
break;
case PendingRevealInteractable.ItemType.CategoryChestUtility:
cti.utilityChestCount++;
break;
case PendingRevealInteractable.ItemType.NewtAltar:
cti.newtAltarCount++;
break;
case PendingRevealInteractable.ItemType.Scrapper:
cti.scrapperCount++;
break;
case PendingRevealInteractable.ItemType.VoidChest:
cti.itemTreasureCount++;
break;
case PendingRevealInteractable.ItemType.VoidBarrel:
cti.moneyBarrelsCount++;
break;
case PendingRevealInteractable.ItemType.Multi:
case PendingRevealInteractable.ItemType.Teleporter:
case PendingRevealInteractable.ItemType.Invalid:
break;
}
}
private void countSpecificShrine(ChatTreasureInfo cti, string item)
{
if (item.Contains("chance"))
{
cti.chanceShrineCount++;
}
else if (item.Contains("blood"))
{
cti.bloodShrineCount++;
}
else if (item.Contains("combat"))
{
cti.combatShrineCount++;
}
else if (item.Contains("boss"))
{
cti.mountainShrineCount++;
}
else if (item.Contains("gold"))
{
cti.goldShrineCount++;
}
else if (item.Contains("healing"))
{
cti.woodShrineCount++;
}
else if (item.Contains("restack"))
{
cti.orderShrineCount++;
}
else if (item.Contains("cleanse"))
{
cti.cleanseShrineCount++;
}
}
private bool skipInstance(PendingRevealInteractable.ItemType itemType, string item)
{
switch (itemType)
{
case PendingRevealInteractable.ItemType.Barrel:
return !ShowBarrels.Value;
case PendingRevealInteractable.ItemType.VoidBarrel:
return !ShowBarrels.Value;
case PendingRevealInteractable.ItemType.ItemChest:
return !ShowChests.Value;
case PendingRevealInteractable.ItemType.VoidChest:
return !ShowChests.Value;
case PendingRevealInteractable.ItemType.EquipmentChest:
return !ShowEquipment.Value;
case PendingRevealInteractable.ItemType.Drone:
return !ShowDrones.Value;
case PendingRevealInteractable.ItemType.Turret:
return !ShowTurrets.Value;
case PendingRevealInteractable.ItemType.LunarChest:
return !ShowLunarChests.Value;
case PendingRevealInteractable.ItemType.Multi:
return !ShowChests.Value;
case PendingRevealInteractable.ItemType.Rusty:
return !ShowRusty.Value;
case PendingRevealInteractable.ItemType.Shrine:
if (ShowShrines.Value && ShowIndividualShrines.Value)
{
return skipSpecificShrine(item);
}
return !ShowShrines.Value;
case PendingRevealInteractable.ItemType.Duplicator:
return !ShowDuplicator.Value;
case PendingRevealInteractable.ItemType.Scrapper:
return !ShowScrapper.Value;
case PendingRevealInteractable.ItemType.CategoryChestDamage:
return !ShowCategoryChestDamage.Value;
case PendingRevealInteractable.ItemType.CategoryChestHealing:
return !ShowCategoryChestHealing.Value;
case PendingRevealInteractable.ItemType.CategoryChestUtility:
return !ShowCategoryChestUtility.Value;
case PendingRevealInteractable.ItemType.NewtAltar:
return !ShowNewtAltar.Value;
case PendingRevealInteractable.ItemType.Teleporter:
return !ShowTeleporter.Value;
case PendingRevealInteractable.ItemType.Invalid:
return true;
default:
return true;
}
}
private void createPingIndicator(PendingRevealInteractable pending)
{
//IL_000e: 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_0041: Unknown result type (might be due to invalid IL or missing references)
//IL_0042: Unknown result type (might be due to invalid IL or missing references)
//IL_0052: Unknown result type (might be due to invalid IL or missing references)
//IL_0088: Unknown result type (might be due to invalid IL or missing references)
//IL_0089: Unknown result type (might be due to invalid IL or missing references)
NetworkIdentity component = pending.gameObject.GetComponent<NetworkIdentity>();
PingInfo val = default(PingInfo);
val.active = true;
val.targetNetworkIdentity = component;
val.origin = ((Component)component).transform.TransformPoint(((Component)component).transform.position);
PingInfo val2 = val;
PingIndicator component2 = ((GameObject)Object.Instantiate(Resources.Load("Prefabs/PingIndicator"))).GetComponent<PingIndicator>();
component2.pingOwner = ((Component)CharacterMaster.readOnlyInstancesList.First()).gameObject;
component2.SetFieldValue("pingDuration", 1f);
component2.pingOrigin = val2.origin;
component2.pingTarget = ((PingInfo)(ref val2)).targetGameObject;
RebuildPingOwn(component2);
}
public void RebuildPingOwn(PingIndicator pingIndicator)
{
//IL_0032: Unknown result type (might be due to invalid IL or missing references)
//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
//IL_00c9: Expected O, but got Unknown
//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
//IL_00f4: Invalid comparison between Unknown and I4
//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
//IL_0100: Unknown result type (might be due to invalid IL or missing references)
//IL_0163: Unknown result type (might be due to invalid IL or missing references)
//IL_0168: Unknown result type (might be due to invalid IL or missing references)
//IL_0203: Unknown result type (might be due to invalid IL or missing references)
//IL_023b: Unknown result type (might be due to invalid IL or missing references)
//IL_0273: Unknown result type (might be due to invalid IL or missing references)
//IL_02dd: Unknown result type (might be due to invalid IL or missing references)
//IL_02f9: Unknown result type (might be due to invalid IL or missing references)
//IL_029a: Unknown result type (might be due to invalid IL or missing references)
//IL_02c1: Unknown result type (might be due to invalid IL or missing references)
//IL_0362: Unknown result type (might be due to invalid IL or missing references)
//IL_037e: Unknown result type (might be due to invalid IL or missing references)
//IL_039a: Unknown result type (might be due to invalid IL or missing references)
//IL_03b6: Unknown result type (might be due to invalid IL or missing references)
//IL_03fe: Unknown result type (might be due to invalid IL or missing references)
//IL_03da: Unknown result type (might be due to invalid IL or missing references)
//IL_0422: Unknown result type (might be due to invalid IL or missing references)
//IL_0257: Unknown result type (might be due to invalid IL or missing references)
//IL_021f: Unknown result type (might be due to invalid IL or missing references)
//IL_0346: Unknown result type (might be due to invalid IL or missing references)
//IL_032c: Unknown result type (might be due to invalid IL or missing references)
pingIndicator.positionIndicator.targetTransform = (Object.op_Implicit((Object)(object)pingIndicator.pingTarget) ? pingIndicator.pingTarget.transform : null);
pingIndicator.positionIndicator.defaultPosition = ((Component)this).transform.position;
IDisplayNameProvider componentInParent = ((Component)this).GetComponentInParent<IDisplayNameProvider>();
pingIndicator.SetFieldValue("pingType", (object)(PingType)2);
((Behaviour)pingIndicator.pingObjectScaleCurve).enabled = false;
((Behaviour)pingIndicator.pingObjectScaleCurve).enabled = true;
GameObject[] defaultPingGameObjects = pingIndicator.defaultPingGameObjects;
defaultPingGameObjects = pingIndicator.interactablePingGameObjects;
for (int i = 0; i < defaultPingGameObjects.Length; i++)
{
defaultPingGameObjects[i].SetActive(false);
}
if (Object.op_Implicit((Object)(object)pingIndicator.pingTarget))
{
pingIndicator.pingTarget.GetComponent<ModelLocator>();
if (componentInParent != null)
{
pingIndicator.SetFieldValue("pingType", (object)(PingType)2);
}
}
if (Object.op_Implicit((Object)(MonoBehaviour)componentInParent))
{
Util.GetBestBodyName(((Component)(MonoBehaviour)componentInParent).gameObject);
}
((Behaviour)pingIndicator.pingText).enabled = false;
if ((int)pingIndicator.GetFieldValue<PingType>("pingType") == 2)
{
pingIndicator.SetFieldValue("pingColor", pingIndicator.interactablePingColor);
pingIndicator.SetFieldValue("pingDuration", 10f);
pingIndicator.SetFieldValue("pingTargetPurchaseInteraction", pingIndicator.pingTarget.GetComponent<PurchaseInteraction>());
Sprite sprite = Resources.Load<Sprite>("Textures/MiscIcons/texInventoryIconOutlined");
SpriteRenderer component = pingIndicator.interactablePingGameObjects[0].GetComponent<SpriteRenderer>();
component.color = Color32.op_Implicit(new Color32((byte)206, (byte)6, (byte)166, (byte)122));
pingIndicator.pingTarget.GetComponent<ShopTerminalBehavior>();
string text = ((Object)pingIndicator.pingTarget.gameObject).name.ToLower();
switch (PendingRevealInteractable.GetItemType(text))
{
case PendingRevealInteractable.ItemType.Barrel:
component.color = getColorFromHex(BarrelColor.Value);
break;
case PendingRevealInteractable.ItemType.VoidBarrel:
component.color = getColorFromHex(VoidBarrelColor.Value);
break;
case PendingRevealInteractable.ItemType.ItemChest:
component.color = getColorFromHex(ChestColor.Value);
break;
case PendingRevealInteractable.ItemType.VoidChest:
component.color = getColorFromHex(VoidChestColor.Value);
break;
case PendingRevealInteractable.ItemType.EquipmentChest:
component.color = getColorFromHex(EquipmentColor.Value);
break;
case PendingRevealInteractable.ItemType.Drone:
sprite = Resources.Load<Sprite>("Textures/MiscIcons/texDroneIconOutlined");
component.color = getColorFromHex(DroneColor.Value);
break;
case PendingRevealInteractable.ItemType.Turret:
sprite = Resources.Load<Sprite>("Textures/MiscIcons/texDroneIconOutlined");
component.color = getColorFromHex(TurretColor.Value);
break;
case PendingRevealInteractable.ItemType.LunarChest:
component.color = getColorFromHex(LunarChestColor.Value);
break;
case PendingRevealInteractable.ItemType.Rusty:
component.color = getColorFromHex(RustyColor.Value);
break;
case PendingRevealInteractable.ItemType.Shrine:
sprite = Resources.Load<Sprite>("Textures/MiscIcons/texShrineIconOutlined");
if (!ShowIndividualShrines.Value)
{
component.color = getColorFromHex(ShrineColor.Value);
}
else
{
component.color = getColorFromHex(getSpecificShrineColor(text));
}
break;
case PendingRevealInteractable.ItemType.Duplicator:
component.color = getColorFromHex(DuplicatorColor.Value);
break;
case PendingRevealInteractable.ItemType.CategoryChestDamage:
component.color = getColorFromHex(CategoryChestDamageColor.Value);
break;
case PendingRevealInteractable.ItemType.CategoryChestHealing:
component.color = getColorFromHex(CategoryChestHealingColor.Value);
break;
case PendingRevealInteractable.ItemType.CategoryChestUtility:
component.color = getColorFromHex(CategoryChestUtilityColor.Value);
break;
case PendingRevealInteractable.ItemType.NewtAltar:
sprite = Resources.Load<Sprite>("Textures/MiscIcons/texTeleporterIconOutlined");
component.color = getColorFromHex(NewtAltarColor.Value);
break;
case PendingRevealInteractable.ItemType.Teleporter:
sprite = Resources.Load<Sprite>("Textures/MiscIcons/texTeleporterIconOutlined");
component.color = getColorFromHex(TeleporterColor.Value);
break;
case PendingRevealInteractable.ItemType.Scrapper:
sprite = Resources.Load<Sprite>("Textures/MiscIcons/texLootIconOutlined");
component.color = getColorFromHex(ScrapperColor.Value);
break;
}
defaultPingGameObjects = pingIndicator.interactablePingGameObjects;
for (int j = 0; j < defaultPingGameObjects.Length; j++)
{
defaultPingGameObjects[j].SetActive(true);
}
component.sprite = sprite;
}
pingIndicator.SetFieldValue("fixedTimer", pingIndicator.GetFieldValue<float>("pingDuration"));
}
private string getSpecificShrineColor(string interactableName)
{
if (interactableName.Contains("chance"))
{
return ChanceShrineColor.Value;
}
if (interactableName.Contains("blood"))
{
return BloodShrineColor.Value;
}
if (interactableName.Contains("combat"))
{
return CombatShrineColor.Value;
}
if (interactableName.Contains("boss"))
{
return MountainShrineColor.Value;
}
if (interactableName.Contains("gold"))
{
return GoldShrineColor.Value;
}
if (interactableName.Contains("healing"))
{
return WoodShrineColor.Value;
}
if (interactableName.Contains("restack"))
{
return OrderShrineColor.Value;
}
if (interactableName.Contains("cleanse"))
{
return CleanseShrineColor.Value;
}
return "#ff9900";
}
public void Pulse(ChestRevealer self, Type[] arr)
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000b: 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_0039: Unknown result type (might be due to invalid IL or missing references)
//IL_0052: Expected O, but got Unknown
Vector3 position = ((Component)self).transform.position;
_ = self.radius;
_ = self.radius;
_ = 1f / self.pulseTravelSpeed;
EffectManager.SpawnEffect(self.pulseEffectPrefab, new EffectData
{
origin = position,
scale = self.radius * self.pulseEffectScale
}, false);
}
private Color getColorFromHex(string hexColor)
{
//IL_0056: Unknown result type (might be due to invalid IL or missing references)
Color result = default(Color);
((Color)(ref result))..ctor(0f, 0f, 0f, 1f);
if (!hexColor.StartsWith("#"))
{
hexColor = "#" + hexColor;
}
ColorUtility.TryParseHtmlString(hexColor, ref result);
result.a = (float)IconTransparency.Value / 255f;
return result;
}
private void addTreasureInfoLegacy(ChatTreasureInfo cti, string purchaseable)
{
if (purchaseable.StartsWith("chest") || purchaseable.StartsWith("voidchest") || purchaseable.Contains("shrinechance") || purchaseable.Contains("goldchest") || purchaseable.Contains("casino"))
{
cti.goldTreasureCount++;
}
else if (purchaseable.Contains("lunarchest"))
{
cti.lunarTreasureCount++;
}
else if (purchaseable.Contains("multishop"))
{
cti.multishopCount++;
}
else if (purchaseable.Contains("voidtriple"))
{
cti.voidmultishopCount++;
}
else if (purchaseable.Contains("equipment"))
{
cti.goldTreasureCount++;
cti.equipmentTreasureCount++;
}
}
private void printChatTreasureInfo(ChatTreasureInfo cti)
{
if (LegacyMode.Value)
{
if (cti.multishopCount + cti.voidmultishopCount != 0)
{
cti.goldTreasureCount += cti.multishopCount / 3 + cti.voidmultishopCount;
}
Chat.AddMessage(constructTreasuresLeftStringLegacy(cti.goldTreasureCount, cti.equipmentTreasureCount, cti.lunarTreasureCount));
}
else
{
if (cti.multishopCount + cti.voidmultishopCount != 0)
{
cti.multishopCount = cti.multishopCount / 3 + cti.voidmultishopCount;
}
Chat.AddMessage(constructTreasuresLeftString(cti));
}
}
private string constructTreasuresLeftString(ChatTreasureInfo cti)
{
string text = "";
string text2 = "";
if (ShowBarrelsChat.Value && cti.moneyBarrelsCount != 0)
{
text = ((cti.moneyBarrelsCount != 1) ? "s" : "");
text2 = text2 + "<color=" + BarrelColor.Value + ">" + cti.moneyBarrelsCount + " money barrel" + text + "</color> left.\n";
}
if (ShowChestsChat.Value && (cti.itemTreasureCount != 0 || cti.multishopCount != 0))
{
text = ((cti.itemTreasureCount != 1) ? "s" : "");
string text3 = ((cti.multishopCount != 1) ? "s" : "");
bool flag = true;
if (cti.itemTreasureCount != 0)
{
text2 = text2 + "<color=" + ChestColor.Value + ">" + cti.itemTreasureCount + " chest" + text + "</color>";
flag = false;
}
if (cti.multishopCount != 0)
{
string text4 = ((cti.itemTreasureCount == 0) ? "" : " and ");
text2 = text2 + text4 + "<color=" + ChestColor.Value + ">" + cti.multishopCount + " multishop" + text3 + "</color>";
flag = false;
}
if (!flag)
{
text2 += " left.\n";
}
}
if (ShowEquipmentChat.Value && cti.equipmentTreasureCount != 0)
{
text = ((cti.equipmentTreasureCount != 1) ? "s" : "");
text2 = text2 + "<color=" + EquipmentColor.Value + ">" + cti.equipmentTreasureCount + " equipment barrel" + text + "</color> left.\n";
}
if (ShowLunarChestsChat.Value && cti.lunarTreasureCount != 0)
{
text = ((cti.lunarTreasureCount != 1) ? "s" : "");
text2 = text2 + "<color=" + LunarChestColor.Value + ">" + cti.lunarTreasureCount + " lunar chest" + text + "</color> left.\n";
}
if (!ShowIndividualShrinesChat.Value)
{
if (ShowShrinesChat.Value && cti.shrineCount != 0)
{
text = ((cti.shrineCount != 1) ? "s" : "");
text2 = text2 + "<color=" + ShrineColor.Value + ">" + cti.shrineCount + " shrine" + text + "</color> left.\n";
}
}
else if (ShowShrinesChat.Value && cti.shrineCount != 0)
{
bool flag2 = false;
if (ShowChanceShrinesChat.Value && cti.chanceShrineCount != 0)
{
text = ((cti.chanceShrineCount != 1) ? "s" : "");
text2 = text2 + "<color=" + ChanceShrineColor.Value + ">" + cti.chanceShrineCount + " chance shrine" + text + "</color>";
flag2 = true;
}
if (ShowBloodShrinesChat.Value && cti.bloodShrineCount != 0)
{
text = ((cti.bloodShrineCount != 1) ? "s" : "");
if (flag2)
{
text2 += ", ";
}
text2 = text2 + "<color=" + BloodShrineColor.Value + ">" + cti.bloodShrineCount + " blood shrine" + text + "</color>";
flag2 = true;
}
if (ShowCombatShrinesChat.Value && cti.combatShrineCount != 0)
{
text = ((cti.combatShrineCount != 1) ? "s" : "");
if (flag2)
{
text2 += ", ";
}
text2 = text2 + "<color=" + CombatShrineColor.Value + ">" + cti.combatShrineCount + " combat shrine" + text + "</color>";
flag2 = true;
}
if (ShowMountainShrinesChat.Value && cti.mountainShrineCount != 0)
{
text = ((cti.mountainShrineCount != 1) ? "s" : "");
if (flag2)
{
text2 += ", ";
}
text2 = text2 + "<color=" + MountainShrineColor.Value + ">" + cti.mountainShrineCount + " mountain shrine" + text + "</color>";
flag2 = true;
}
if (ShowGoldShrinesChat.Value && cti.goldShrineCount != 0)
{
text = ((cti.goldShrineCount != 1) ? "s" : "");
if (flag2)
{
text2 += ", ";
}
text2 = text2 + "<color=" + GoldShrineColor.Value + ">" + cti.goldShrineCount + " gold shrine" + text + "</color>";
flag2 = true;
}
if (ShowWoodShrinesChat.Value && cti.woodShrineCount != 0)
{
text = ((cti.woodShrineCount != 1) ? "s" : "");
if (flag2)
{
text2 += ", ";
}
text2 = text2 + "<color=" + WoodShrineColor.Value + ">" + cti.woodShrineCount + " wood shrine" + text + "</color>";
flag2 = true;
}
if (ShowOrderShrinesChat.Value && cti.orderShrineCount != 0)
{
text = ((cti.orderShrineCount != 1) ? "s" : "");
if (flag2)
{
text2 += ", ";
}
text2 = text2 + "<color=" + OrderShrineColor.Value + ">" + cti.orderShrineCount + " order shrine" + text + "</color>";
flag2 = true;
}
if (ShowCleanseShrinesChat.Value && cti.cleanseShrineCount != 0)
{
text = ((cti.cleanseShrineCount != 1) ? "s" : "");
if (flag2)
{
text2 += ", ";
}
text2 = text2 + "<color=" + CleanseShrineColor.Value + ">" + cti.cleanseShrineCount + " cleansing pool" + text + "</color>";
flag2 = true;
}
if (flag2)
{
text2 += " left.\n";
}
}
if (ShowDronesAndTurretsChat.Value && (cti.dronesCount != 0 || cti.turretsCount != 0))
{
text = ((cti.dronesCount != 1) ? "s" : "");
string text5 = ((cti.turretsCount != 1) ? "s" : "");
text2 = text2 + "<color=" + DroneColor.Value + ">" + cti.dronesCount + " drone" + text + "</color> and <color=" + TurretColor.Value + ">" + cti.turretsCount + " turret" + text5 + "</color> left.\n";
}
bool flag3 = false;
if ((ShowDuplicatorChat.Value || ShowScrapperChat.Value) && (cti.duplicatorCount != 0 || cti.scrapperCount != 0))
{
if (ShowDuplicatorChat.Value && cti.duplicatorCount != 0)
{
text = ((cti.duplicatorCount != 1) ? "s" : "");
text2 = text2 + "<color=" + DuplicatorColor.Value + ">" + cti.duplicatorCount + " duplicator" + text + "</color>";
flag3 = true;
}
if (ShowScrapperChat.Value && cti.scrapperCount != 0)
{
text = ((cti.scrapperCount != 1) ? "s" : "");
if (flag3)
{
text2 += ", ";
}
text2 = text2 + "<color=" + ScrapperColor.Value + ">" + cti.scrapperCount + " scrapper" + text + "</color>";
flag3 = true;
}
if (flag3)
{
text2 += ".\n";
}
}
flag3 = false;
if (ShowCategoryChestDamageChat.Value && cti.damageChestCount != 0)
{
text = ((cti.damageChestCount != 1) ? "s" : "");
text2 = text2 + "<color=" + CategoryChestDamageColor.Value + ">" + cti.damageChestCount + " damage Chest" + text + "</color>";
flag3 = true;
}
if (ShowCategoryChestHealingChat.Value && cti.healingChestCount != 0)
{
text = ((cti.healingChestCount != 1) ? "s" : "");
if (flag3)
{
text2 += ", ";
}
text2 = text2 + "<color=" + CategoryChestHealingColor.Value + ">" + cti.healingChestCount + " healing Chest" + text + "</color>";
flag3 = true;
}
if (ShowCategoryChestUtilityChat.Value && cti.utilityChestCount != 0)
{
text = ((cti.utilityChestCount != 1) ? "s" : "");
if (flag3)
{
text2 += ", ";
}
text2 = text2 + "<color=" + CategoryChestUtilityColor.Value + ">" + cti.utilityChestCount + " utility Chest" + text + "</color>";
flag3 = true;
}
if (flag3)
{
text2 += " left.\n";
}
if (ShowRustyChat.Value && cti.rustyCount != 0)
{
text = ((cti.rustyCount != 1) ? "s" : "");
text2 = text2 + "<color=" + RustyColor.Value + ">" + cti.rustyCount + " rusty lockbox" + text + "</color> left.\n";
}
if (ShowNewtAltarChat.Value && cti.newtAltarCount != 0)
{
text = ((cti.newtAltarCount != 1) ? "s" : "");
text2 = text2 + "<color=" + NewtAltarColor.Value + ">" + cti.newtAltarCount + " newt altar" + text + "</color> left.\n";
}
text2 = ((text2.Length != 0) ? text2[..text2.LastIndexOf("\n")] : (text2 + "There's nothing left you want."));
return "<color=#8296ae>" + text2 + "</color>";
}
private string constructTreasuresLeftStringLegacy(int goldTreasureCount, int equipmentTreasureCount, int lunarTreasureCount)
{
string text = "<color=#8296ae>";
if (goldTreasureCount == 0)
{
text += "No <color=#827e3d>gold</color> treasures";
}
else
{
text = text + "<color=#dbd451>" + goldTreasureCount + " gold</color> treasure";
if (goldTreasureCount > 1)
{
text += "s";
}
}
text += " left";
if (equipmentTreasureCount > 0)
{
text = text + " (of those <color=#ff7f00>" + equipmentTreasureCount + " equipment</color> barrel";
if (equipmentTreasureCount > 1)
{
text += "s";
}
text += ")";
}
text += ".";
if (lunarTreasureCount > 0)
{
text = text + "\n<color=#5d60cc>" + lunarTreasureCount + " lunar</color> treasure";
if (lunarTreasureCount > 1)
{
text += "s";
}
text += " left.";
}
return text + "</color>";
}
}
public class ChatTreasureInfo
{
public int goldTreasureCount;
public int equipmentTreasureCount;
public int lunarTreasureCount;
public int multishopCount;
public int voidmultishopCount;
public int itemTreasureCount;
public int dronesCount;
public int turretsCount;
public int moneyBarrelsCount;
public int shrineCount;
public int newtAltarCount;
public int duplicatorCount;
public int damageChestCount;
public int healingChestCount;
public int utilityChestCount;
public int rustyCount;
public int chanceShrineCount;
public int bloodShrineCount;
public int combatShrineCount;
public int mountainShrineCount;
public int goldShrineCount;
public int woodShrineCount;
public int orderShrineCount;
public int cleanseShrineCount;
public int scrapperCount;
public ChatTreasureInfo()
{
goldTreasureCount = 0;
equipmentTreasureCount = 0;
lunarTreasureCount = 0;
multishopCount = 0;
voidmultishopCount = 0;
itemTreasureCount = 0;
dronesCount = 0;
turretsCount = 0;
moneyBarrelsCount = 0;
shrineCount = 0;
newtAltarCount = 0;
duplicatorCount = 0;
scrapperCount = 0;
damageChestCount = 0;
healingChestCount = 0;
utilityChestCount = 0;
rustyCount = 0;
chanceShrineCount = 0;
bloodShrineCount = 0;
combatShrineCount = 0;
mountainShrineCount = 0;
goldShrineCount = 0;
woodShrineCount = 0;
orderShrineCount = 0;
cleanseShrineCount = 0;
}
}
public class PendingRevealInteractable : IComparable<PendingRevealInteractable>
{
public enum ItemType
{
Barrel,
ItemChest,
EquipmentChest,
LunarChest,
Multi,
Rusty,
Shrine,
Drone,
Turret,
Duplicator,
CategoryChestDamage,
CategoryChestHealing,
CategoryChestUtility,
Teleporter,
NewtAltar,
Invalid,
Scrapper,
VoidChest,
VoidBarrel
}
public GameObject gameObject;
public FixedTimeStamp time;
public ItemType itemType;
public PendingRevealInteractable(GameObject gameObject, FixedTimeStamp time, ItemType itemType)
{
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
this.gameObject = gameObject;
this.time = time;
this.itemType = itemType;
}
public int CompareTo(PendingRevealInteractable other)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
return ((FixedTimeStamp)(ref time)).CompareTo(other.time);
}
internal static ItemType GetItemType(string item)
{
if (item.StartsWith("chest") || item.StartsWith("voidchest") || item.Contains("goldchest") || item.Contains("multishop") || item.Contains("casino"))
{
return ItemType.ItemChest;
}
if (item.Contains("lunarchest"))
{
return ItemType.LunarChest;
}
if (item.Contains("drone"))
{
return ItemType.Drone;
}
if (item.Contains("turret"))
{
return ItemType.Turret;
}
if (item.Contains("equipment"))
{
return ItemType.EquipmentChest;
}
if (item.Contains("shrine"))
{
return ItemType.Shrine;
}
if (item.StartsWith("barrel") || item.StartsWith("voidcoinbarrel"))
{
return ItemType.Barrel;
}
if (item.Contains("duplicator"))
{
return ItemType.Duplicator;
}
if (item.Contains("categorychestdamage"))
{
return ItemType.CategoryChestDamage;
}
if (item.Contains("categorychesthealing"))
{
return ItemType.CategoryChestHealing;
}
if (item.Contains("categorychestutility"))
{
return ItemType.CategoryChestUtility;
}
if (item.Contains("lockbox"))
{
return ItemType.Rusty;
}
if (item.Contains("newt"))
{
return ItemType.NewtAltar;
}
if (item.Contains("teleporter"))
{
return ItemType.Teleporter;
}
if (item.Contains("scrapper"))
{
return ItemType.Scrapper;
}
return ItemType.Invalid;
}
}