using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using Pigeon;
using Pigeon.Movement;
using TMPro;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETFramework,Version=v4.6.2", FrameworkDisplayName = ".NET Framework 4.6.2")]
[assembly: AssemblyCompany("Hellmod")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("Turn Mycopunk into a roguelike with brutal difficulty")]
[assembly: AssemblyFileVersion("1.0.2.0")]
[assembly: AssemblyInformationalVersion("1.0.2+6f316c30a56ff2fa8b011fc6ec2aabe7183f1191")]
[assembly: AssemblyProduct("Hellmod")]
[assembly: AssemblyTitle("Hellmod")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.2.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
internal sealed class RefSafetyRulesAttribute : Attribute
{
public readonly int Version;
public RefSafetyRulesAttribute(int P_0)
{
Version = P_0;
}
}
}
namespace Hellmod
{
[BepInPlugin("Hellmod", "Hellmod", "1.0.2")]
public class Plugin : BaseUnityPlugin
{
[HarmonyPatch(typeof(GearData), "AddXP")]
public static class Patch_AddXP_ConditionalSkillPoints
{
private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions)
{
//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
//IL_00c4: Expected O, but got Unknown
//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
//IL_00db: Expected O, but got Unknown
List<CodeInstruction> list = new List<CodeInstruction>(instructions);
MethodInfo methodInfo = AccessTools.Method(typeof(PlayerData), "AddResource", (Type[])null, (Type[])null);
for (int i = 0; i < list.Count; i++)
{
if (list[i].opcode == OpCodes.Callvirt && list[i].operand == methodInfo)
{
Label label = ((list[i].labels.Count > 0) ? list[i].labels[0] : default(Label));
list[i].labels.Clear();
List<CodeInstruction> list2 = new List<CodeInstruction>();
list2.Add(new CodeInstruction(OpCodes.Call, (object)AccessTools.Method(typeof(Plugin), "ProfileCheck", (Type[])null, (Type[])null)));
list2.Add(new CodeInstruction(OpCodes.Brtrue_S, (object)label));
list2.Add(list[i]);
list2[list2.Count - 1].labels.Add(label);
list.RemoveAt(i);
list.InsertRange(i, list2);
break;
}
}
return list.AsEnumerable();
}
}
[HarmonyPatch(typeof(Global), "Initialize")]
public class Patch_Global_Initialize
{
private static void Postfix(Global __instance)
{
if (ProfileCheck() && (Object)(object)__instance == (Object)null)
{
Logger.LogWarning((object)"[BigMonoLobby] Global instance was null in Start");
}
}
}
[HarmonyPatch(typeof(PlayerData), "OnMissionFailed")]
public class Patch_PlayerData_OnMissionFailed
{
private static void Postfix()
{
//IL_0187: Unknown result type (might be due to invalid IL or missing references)
//IL_018d: Unknown result type (might be due to invalid IL or missing references)
if (!ProfileCheck())
{
return;
}
Logger.LogWarning((object)"YOU FAILLED GET RECKT");
GearInfo[] array = Resources.FindObjectsOfTypeAll<GearInfo>();
UpgradeEnumerator val2 = default(UpgradeEnumerator);
EquippedUpgradeEnumerator val3 = default(EquippedUpgradeEnumerator);
SkinEnumerator val4 = default(SkinEnumerator);
EquippedSkinEnumerator val5 = default(EquippedSkinEnumerator);
foreach (GearInfo val in array)
{
if ((Object)(object)val == (Object)null)
{
Logger.LogWarning((object)"Null GearInfo item found.");
continue;
}
Logger.LogDebug((object)("GearInfo: " + val.Name));
GearData gearData = PlayerData.GetGearData(val);
if (gearData == null)
{
Logger.LogWarning((object)("GearData is null for " + val.Name));
continue;
}
gearData.Reset();
gearData.UnequipAllUpgrades();
IUpgradable gear = gearData.Gear;
Logger.LogDebug((object)$"Gear: {gear}");
if (gear == null)
{
continue;
}
((UpgradeEnumerator)(ref val2))..ctor(gear);
((UpgradeEnumerator)(ref val2)).Reset();
((EquippedUpgradeEnumerator)(ref val3))..ctor(gear);
((EquippedUpgradeEnumerator)(ref val3)).Reset();
((SkinEnumerator)(ref val4))..ctor(gear);
((SkinEnumerator)(ref val4)).Reset();
((EquippedSkinEnumerator)(ref val5))..ctor(gear);
((EquippedSkinEnumerator)(ref val5)).Reset();
List<UpgradeInfo> allUpgrades = PlayerData.GetAllUpgrades(gear);
if (allUpgrades == null)
{
Logger.LogWarning((object)$"Upgrades is null for Gear {gear}");
continue;
}
Logger.LogDebug((object)$"Found {allUpgrades.Count} upgrades for {gear}");
foreach (UpgradeInfo item in allUpgrades)
{
if (item == null)
{
Logger.LogWarning((object)$"Null UpgradeInfo in upgrade list for {gear}");
continue;
}
item.Clear();
if ((item.Upgrade.Flags & 2) != 0)
{
Logger.LogWarning((object)$"Skill Tree Upgrade for {item}");
continue;
}
FieldInfo field = typeof(UpgradeInfo).GetField("totalInstancesCollected", BindingFlags.Instance | BindingFlags.NonPublic);
if (field != null)
{
Logger.LogDebug((object)$"Setting totalInstancesCollected = 10 for {item}");
field.SetValue(item, 10);
}
else
{
Logger.LogError((object)"Field totalInstancesCollected not found via reflection.");
}
}
}
for (int j = 0; j < Global.Instance.PlayerResources.Length; j++)
{
if (PlayerData.Instance.GetResource(Global.Instance.PlayerResources[j]) > 0)
{
PlayerData.Instance.TryRemoveResource(Global.Instance.PlayerResources[j], PlayerData.Instance.GetResource(Global.Instance.PlayerResources[j]));
}
}
PlayerData.Instance.TotalSkillPointsSpent = 0;
PlayerData.Instance.dropPodDoorNumber = 0;
}
}
[HarmonyPatch(typeof(GameManager), "Start")]
public static class Patch_GameManager_Start
{
private static void Postfix()
{
//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
//IL_07df: Unknown result type (might be due to invalid IL or missing references)
//IL_07e4: Unknown result type (might be due to invalid IL or missing references)
//IL_07e6: Unknown result type (might be due to invalid IL or missing references)
//IL_07e8: Unknown result type (might be due to invalid IL or missing references)
//IL_07ea: Unknown result type (might be due to invalid IL or missing references)
//IL_07ec: Unknown result type (might be due to invalid IL or missing references)
//IL_07f2: Unknown result type (might be due to invalid IL or missing references)
//IL_06a7: Unknown result type (might be due to invalid IL or missing references)
//IL_0786: Unknown result type (might be due to invalid IL or missing references)
//IL_074d: Unknown result type (might be due to invalid IL or missing references)
//IL_06d3: Unknown result type (might be due to invalid IL or missing references)
//IL_0665: Unknown result type (might be due to invalid IL or missing references)
//IL_0623: Unknown result type (might be due to invalid IL or missing references)
//IL_0760: Unknown result type (might be due to invalid IL or missing references)
//IL_0691: Unknown result type (might be due to invalid IL or missing references)
//IL_05f7: Unknown result type (might be due to invalid IL or missing references)
//IL_05b5: Unknown result type (might be due to invalid IL or missing references)
//IL_0589: Unknown result type (might be due to invalid IL or missing references)
//IL_059f: Unknown result type (might be due to invalid IL or missing references)
//IL_072b: Unknown result type (might be due to invalid IL or missing references)
//IL_064f: Unknown result type (might be due to invalid IL or missing references)
//IL_055d: Unknown result type (might be due to invalid IL or missing references)
//IL_0534: Unknown result type (might be due to invalid IL or missing references)
//IL_054a: Unknown result type (might be due to invalid IL or missing references)
//IL_05e1: Unknown result type (might be due to invalid IL or missing references)
//IL_067b: Unknown result type (might be due to invalid IL or missing references)
//IL_06e9: Unknown result type (might be due to invalid IL or missing references)
//IL_0799: Unknown result type (might be due to invalid IL or missing references)
//IL_06bd: Unknown result type (might be due to invalid IL or missing references)
//IL_0773: Unknown result type (might be due to invalid IL or missing references)
//IL_073e: Unknown result type (might be due to invalid IL or missing references)
//IL_06ff: Unknown result type (might be due to invalid IL or missing references)
//IL_05cb: Unknown result type (might be due to invalid IL or missing references)
//IL_060d: Unknown result type (might be due to invalid IL or missing references)
//IL_0906: Unknown result type (might be due to invalid IL or missing references)
//IL_0910: Unknown result type (might be due to invalid IL or missing references)
//IL_0573: Unknown result type (might be due to invalid IL or missing references)
//IL_0715: Unknown result type (might be due to invalid IL or missing references)
//IL_0639: Unknown result type (might be due to invalid IL or missing references)
//IL_0a71: Unknown result type (might be due to invalid IL or missing references)
//IL_0a77: Unknown result type (might be due to invalid IL or missing references)
if (!ProfileCheck())
{
return;
}
if (PlayerData.Instance == null)
{
Logger.LogWarning((object)"PlayerData.Instance is null!");
return;
}
Global instance = Global.Instance;
if ((Object)(object)instance == (Object)null)
{
Logger.LogWarning((object)"[Hellmod] Global instance was null in Start");
return;
}
instance.MissionModifierChance = 1000f;
Logger.LogInfo((object)"MissionModifierChance set to 1");
Keyframe[] keys = instance.MissionModifierCountCurve.keys;
for (int i = 0; i < keys.Length; i++)
{
((Keyframe)(ref keys[i])).value = (i + 1) * 6 * (i + 1);
}
WeightedArray<MissionModifier> missionModifiers = instance.MissionModifiers;
for (int j = 0; j < missionModifiers.Length; j++)
{
int num = 0;
float num2 = 1f;
ModifierFlags val = (ModifierFlags)0;
int weight = missionModifiers.GetWeight(j);
float num3 = 0f;
ModifierFlags val2 = (ModifierFlags)0;
switch (missionModifiers[j].ModifierName)
{
case "Amalgamation Hunt":
num = 600;
num2 = 1.05f;
val = (ModifierFlags)3;
break;
case "//ERROR_REDACTED//":
num = 600;
num2 = 1.05f;
val = (ModifierFlags)3;
break;
case "Dave vs Goliath":
num = 10;
num2 = 1.05f;
val = (ModifierFlags)3;
break;
case "Bullet Hell":
num = 600;
num2 = 1.05f;
val = (ModifierFlags)3;
break;
case "Macrowave":
num = 600;
num2 = 1.05f;
val = (ModifierFlags)3;
break;
case "Fairy Tale":
num = 600;
num2 = 1.05f;
val = (ModifierFlags)3;
break;
case "Eclipse":
num = 1000;
num2 = 1.05f;
val = (ModifierFlags)3;
break;
case "Corrosive Coating":
num = 500;
num2 = 1.05f;
val = (ModifierFlags)3;
break;
case "Rot":
num = 250;
num2 = 1.05f;
val = (ModifierFlags)3;
break;
case "BEES":
num = 1000;
num2 = 1.05f;
val = (ModifierFlags)3;
break;
case "Unhealthy Charging":
num = 1000;
num2 = 1.05f;
val = (ModifierFlags)3;
break;
case "Warranty Expiration":
num = 1000;
num2 = 1.05f;
val = (ModifierFlags)3;
break;
case "Explodungus":
num = 300;
num2 = 1.05f;
val = (ModifierFlags)3;
break;
case "Fungal Workout":
num = 1000;
num2 = 1.05f;
val = (ModifierFlags)3;
break;
case "Overheated Cores":
num = 500;
num2 = 1.05f;
val = (ModifierFlags)3;
break;
case "Burn":
num = 300;
num2 = 1.05f;
val = (ModifierFlags)3;
break;
case "Fog":
num = 1000;
num2 = 1.05f;
val = (ModifierFlags)3;
break;
case "Horde":
num = 1000;
num2 = 1.05f;
val = (ModifierFlags)3;
break;
case "Powder Keg":
num = 700;
num2 = 1.05f;
val = (ModifierFlags)3;
break;
case "Meteor Shower":
num = 1000;
num2 = 1.05f;
val = (ModifierFlags)3;
break;
case "Mitosis":
num = 1000;
num2 = 1.05f;
val = (ModifierFlags)3;
break;
case "Tread Carefully":
num = 1000;
num2 = 1.05f;
val = (ModifierFlags)3;
break;
case "Overclocker":
num = 1000;
num2 = 1.05f;
val = (ModifierFlags)3;
break;
case "Gallbladder":
num = 1000;
num2 = 1.05f;
val = (ModifierFlags)3;
break;
case "Saxonite Storm":
num = 1000;
num2 = 1.05f;
val = (ModifierFlags)3;
break;
case "Sharpshooter":
num = 1;
num2 = 1.05f;
val = (ModifierFlags)3;
break;
case "Conductive Machinery":
num = 500;
num2 = 1.05f;
val = (ModifierFlags)3;
break;
case "Electrified":
num = 500;
num2 = 1.05f;
val = (ModifierFlags)3;
break;
case "Tussle":
num = 250;
num2 = 1.05f;
val = (ModifierFlags)3;
break;
case "Weak Link":
num = 1000;
num2 = 1.05f;
val = (ModifierFlags)3;
break;
default:
num = 0;
break;
}
missionModifiers.SetWeight(j, num);
MissionModifier obj = missionModifiers[j];
FieldInfo field = typeof(MissionModifier).GetField("flags", BindingFlags.Instance | BindingFlags.NonPublic);
if (field != null)
{
ModifierFlags val3 = (ModifierFlags)field.GetValue(obj);
val2 = val3;
val3 = val;
field.SetValue(obj, val3);
}
FieldInfo field2 = typeof(MissionModifier).GetField("incompatibleModifiers", BindingFlags.Instance | BindingFlags.NonPublic);
if (field2 != null)
{
field2.SetValue(obj, new MissionModifier[0]);
}
FieldInfo field3 = typeof(MissionModifier).GetField("incompatibleMissions", BindingFlags.Instance | BindingFlags.NonPublic);
if (field3 != null)
{
field3.SetValue(obj, new Mission[0]);
}
FieldInfo field4 = typeof(MissionModifier).GetField("xpMultiplier", BindingFlags.Instance | BindingFlags.NonPublic);
if (field4 != null)
{
num3 = (float)field4.GetValue(obj);
field4.SetValue(obj, num2);
}
missionModifiers.SetWeight(j, num);
Logger.LogInfo((object)$"Modifier[{j,2}] {missionModifiers[j].ModifierName,-24} | Weight: {missionModifiers.GetWeight(j),4} (Def: {weight,4}) | XP: {num2,4} (Def: {num3,4}) | Flags: {val,-40} (Def: {val2})");
}
instance.MissionModifiers = missionModifiers;
instance.MissionModifierCountCurve.keys = keys;
GearInfo[] array = Resources.FindObjectsOfTypeAll<GearInfo>();
foreach (GearInfo val4 in array)
{
if ((Object)(object)val4 == (Object)null)
{
Logger.LogWarning((object)"Null GearInfo item found.");
continue;
}
Logger.LogDebug((object)("GearInfo: " + val4.Name));
GearData gearData = PlayerData.GetGearData(val4);
if (gearData == null)
{
Logger.LogWarning((object)("GearData is null for " + val4.Name));
continue;
}
IUpgradable gear = gearData.Gear;
Logger.LogDebug((object)$"Gear: {gear}");
if (gear == null)
{
continue;
}
List<UpgradeInfo> allUpgrades = PlayerData.GetAllUpgrades(gear);
if (allUpgrades == null)
{
Logger.LogWarning((object)$"Upgrades is null for Gear {gear}");
continue;
}
Logger.LogDebug((object)$"Found {allUpgrades.Count} upgrades for {gear}");
foreach (UpgradeInfo item in allUpgrades)
{
if (item == null)
{
Logger.LogWarning((object)$"Null UpgradeInfo in upgrade list for {gear}");
continue;
}
if ((item.Upgrade.Flags & 2) != 0)
{
Logger.LogWarning((object)$"Skill Tree Upgrade for {item}");
continue;
}
FieldInfo field5 = typeof(UpgradeInfo).GetField("totalInstancesCollected", BindingFlags.Instance | BindingFlags.NonPublic);
if (field5 != null)
{
Logger.LogDebug((object)$"Setting totalInstancesCollected = 10 for {item}");
field5.SetValue(item, 10);
}
else
{
Logger.LogError((object)"Field totalInstancesCollected not found via reflection.");
}
}
}
}
}
[HarmonyPatch(typeof(ObjectiveBase), "GiveSideObjectiveRewards")]
public static class Patch_ObjectiveBase_GiveSideObjectiveRewards
{
private static void Postfix()
{
if (ProfileCheck())
{
PlayerData.Instance.AddResource(Global.Instance.SkillPointResource, 1);
}
}
}
[HarmonyPatch(typeof(UpgradeCollectable), "TryCollect")]
public static class Patch_UpgradeCollectable_TryCollect
{
private static bool Prefix(UpgradeCollectable __instance, ref Player player)
{
if (!ProfileCheck())
{
return true;
}
if (!Traverse.Create((object)__instance).Field("canCollect").GetValue<bool>())
{
return false;
}
UpgradeInstance value = Traverse.Create((object)__instance).Field("upgrade").GetValue<UpgradeInstance>();
bool flag = true;
PlayerResource[] array = Resources.FindObjectsOfTypeAll<PlayerResource>();
foreach (PlayerResource val in array)
{
Logger.LogDebug((object)val.Name.ToLower());
Logger.LogDebug((object)value.Upgrade.RarityName.ToLower());
if (val.Name.Contains("Scrap") && val.Name.ToLower().Contains(value.Upgrade.RarityName.ToLower()))
{
PlayerData.Instance.AddResource(val, 1);
flag = false;
}
}
if (flag)
{
return true;
}
Traverse.Create((object)__instance).Field("upgrade").SetValue((object)null);
Object.Destroy((Object)(object)((Component)__instance).gameObject);
return false;
}
}
[HarmonyPatch(typeof(StartMenu), "Start")]
public static class Patch_StartMenu_Start
{
private static void Postfix()
{
((TMP_Text)((Component)((Component)StartMenu.Instance).transform.GetChild(1).GetChild(21).GetChild(8)).GetComponent<TextMeshProUGUI>()).text = "<color=\"red\">HELLMOD";
if (!ProfileCheck())
{
return;
}
if ((Object)(object)lg == (Object)null)
{
LoadEmbeddedAssetBundle();
}
if ((Object)(object)StartMenu.Instance == (Object)null)
{
return;
}
((Component)((Component)StartMenu.Instance).transform.GetChild(1).GetChild(9)).GetComponent<Image>().sprite = lg;
((TMP_Text)((Component)((Component)StartMenu.Instance).transform.GetChild(1).GetChild(14).GetChild(0)).GetComponent<TextMeshProUGUI>()).text = "<color=\"red\">HELLMOD";
if (ChangeBuildID.Value)
{
FieldInfo field = typeof(Global).GetField("_buildID", BindingFlags.Static | BindingFlags.NonPublic);
if (field != null)
{
field.SetValue(null, "Hellmod - 1.0.2 - " + Online.GetBuildID());
}
}
}
}
[HarmonyPatch(typeof(StorageWindow), "OnOpen")]
public static class Patch_StorageWindow_OnOpen
{
private static void Postfix(StorageWindow __instance)
{
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_0020: Expected O, but got Unknown
//IL_003a: Unknown result type (might be due to invalid IL or missing references)
GameObject val = (GameObject)AccessTools.Field(typeof(StorageWindow), "craftingCover").GetValue(__instance);
Graphic val2 = (Graphic)AccessTools.Field(typeof(StorageWindow), "craftButton").GetValue(__instance);
val.SetActive(false);
val2.raycastTarget = true;
}
}
public class UpdateBehaviour : MonoBehaviour
{
public Vector3 size;
private void Update()
{
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
//IL_001d: 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_0048: Unknown result type (might be due to invalid IL or missing references)
//IL_004d: 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_006f: 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_0077: Unknown result type (might be due to invalid IL or missing references)
//IL_0082: Unknown result type (might be due to invalid IL or missing references)
//IL_0094: Unknown result type (might be due to invalid IL or missing references)
//IL_0099: 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_00b4: Unknown result type (might be due to invalid IL or missing references)
//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
//IL_00be: Unknown result type (might be due to invalid IL or missing references)
//IL_018b: Unknown result type (might be due to invalid IL or missing references)
//IL_0190: Unknown result type (might be due to invalid IL or missing references)
if (!ProfileCheck())
{
return;
}
if ((Object)(object)fuck != (Object)null)
{
Vector3 val = Vector3.zero;
int num = 0;
for (int i = 0; i < GameManager.players.Count; i++)
{
if (!((Object)(object)GameManager.players[i] == (Object)null))
{
val += ((Component)GameManager.players[i]).transform.position;
num++;
}
}
if (num > 0)
{
val /= (float)num;
fuck.transform.position = val;
fuck.transform.localScale = DivVectors(size, Vector3.one + new Vector3(0.05f, 0.05f, 0.05f) * (float)num);
Renderer[] componentsInChildren = fuck.GetComponentsInChildren<Renderer>();
for (int j = 0; j < componentsInChildren.Length; j++)
{
componentsInChildren[j].enabled = ToggleBubbleVisibility.Value;
}
}
}
if ((Object)(object)fuck == (Object)null && GameManager.players != null && GameManager.players.Count > 0 && (Object)(object)GameManager.players[0] != (Object)null)
{
SafetyBubble[] array = Resources.FindObjectsOfTypeAll<SafetyBubble>();
if (array == null || array.Length == 0 || (Object)(object)array[0] == (Object)null)
{
Debug.LogError((object)"SafetyBubble not found");
return;
}
fuck = Object.Instantiate<GameObject>(((Component)array[0]).gameObject);
fuck.layer = LayerMask.NameToLayer("Bubble");
size = fuck.transform.localScale;
}
}
public Vector3 DivVectors(Vector3 a, Vector3 b)
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
//IL_0006: 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_0013: Unknown result type (might be due to invalid IL or missing references)
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_0020: 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)
return new Vector3(a.x / b.x, a.y / b.y, a.z / b.z);
}
}
internal static ManualLogSource Logger;
public static ConfigEntry<bool> ChangeBuildID;
public static ConfigEntry<bool> ToggleBubble;
public static ConfigEntry<bool> ToggleBubbleVisibility;
private GameObject updaterGO;
public static AssetBundle assets;
public static Sprite lg;
public static GameObject fuck;
private void Awake()
{
//IL_007f: Unknown result type (might be due to invalid IL or missing references)
Logger = ((BaseUnityPlugin)this).Logger;
Logger.LogInfo((object)"Plugin Hellmod is loaded!");
ChangeBuildID = ((BaseUnityPlugin)this).Config.Bind<bool>("Hellmod", "ChangeBuildID", true, "Lockout non-modded players");
ToggleBubble = ((BaseUnityPlugin)this).Config.Bind<bool>("Hellmod", "ToggleBubble", false, "Toggle multiplayer distance thingy");
ToggleBubbleVisibility = ((BaseUnityPlugin)this).Config.Bind<bool>("Hellmod", "ToggleBubbleVisibility", false, "Toggle multiplayer distance thingy Visibility");
new Harmony("com.catalyss.hellmod").PatchAll();
SceneManager.sceneLoaded += OnSceneLoaded;
}
private void OnSceneLoaded(Scene arg0, LoadSceneMode arg1)
{
//IL_004c: Unknown result type (might be due to invalid IL or missing references)
//IL_0056: Expected O, but got Unknown
if (ProfileCheck())
{
LostLootMachine[] array = Object.FindObjectsByType<LostLootMachine>((FindObjectsInactive)1, (FindObjectsSortMode)0);
for (int i = 0; i < array.Length; i++)
{
((Component)array[i]).gameObject.SetActive(false);
}
if ((Object)(object)updaterGO == (Object)null && ToggleBubble.Value)
{
updaterGO = new GameObject("CustomSceneLoaderUpdater");
updaterGO.AddComponent<UpdateBehaviour>();
Object.DontDestroyOnLoad((Object)(object)updaterGO);
}
}
}
public static void CustomSkillPointLogic()
{
}
public static bool ProfileCheck()
{
ProfileConfig instance = ProfileConfig.Instance;
if (instance == null)
{
Logger.LogWarning((object)"PlayerData.ProfileConfig is null!");
return false;
}
FieldInfo field = typeof(ProfileConfig).GetField("profileIndex", BindingFlags.Instance | BindingFlags.NonPublic);
if (field == null)
{
Logger.LogWarning((object)"Could not find private field 'profileIndex'");
return false;
}
int num = (int)field.GetValue(instance);
if (num < 7)
{
Logger.LogWarning((object)$"profileIndex = {num}, skipping");
return false;
}
return true;
}
public static void LoadEmbeddedAssetBundle()
{
Logger.LogInfo((object)"Loading embedded AssetBundle...");
Assembly executingAssembly = Assembly.GetExecutingAssembly();
string text = executingAssembly.GetManifestResourceNames().FirstOrDefault((string name) => name.EndsWith("hellmod"));
if (text == null)
{
Logger.LogError((object)"Embedded resource 'hellmod' not found!");
return;
}
using (Stream stream = executingAssembly.GetManifestResourceStream(text))
{
if (stream == null)
{
Logger.LogError((object)"Failed to get stream for embedded AssetBundle 'hellmod'.");
return;
}
using MemoryStream memoryStream = new MemoryStream();
stream.CopyTo(memoryStream);
assets = AssetBundle.LoadFromMemory(memoryStream.ToArray());
}
if ((Object)(object)assets == (Object)null)
{
Logger.LogError((object)"Failed to load AssetBundle from memory.");
return;
}
Logger.LogInfo((object)"AssetBundle 'hellmod' loaded successfully.");
lg = assets.LoadAsset<Sprite>("hellmod_logo");
if ((Object)(object)lg == (Object)null)
{
Logger.LogError((object)"Failed to load 'hellmod_logo' prefab from AssetBundle.");
}
else
{
Logger.LogInfo((object)"Prefab 'hellmod_logo' loaded successfully.");
}
}
}
public static class MyPluginInfo
{
public const string PLUGIN_GUID = "Hellmod";
public const string PLUGIN_NAME = "Hellmod";
public const string PLUGIN_VERSION = "1.0.2";
}
}