Decompiled source of Backpack Additions v2.0.1

VikBackpackAdditions.dll

Decompiled 4 months ago
using System;
using System.Collections;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using SideLoader;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("OutwardModTemplate")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("OutwardModTemplate")]
[assembly: AssemblyCopyright("Copyright ©  2021")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("c5450fe0-edcf-483f-b9ea-4b1ef9d36da7")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace VikBackPackExpansion;

[BepInPlugin("vik.VikBackPackExpansion", "VikBackPackExpansion", "0.0.1")]
public class VikBackPackExpansion : BaseUnityPlugin
{
	public const string GUID = "vik.VikBackPackExpansion";

	public const string NAME = "VikBackPackExpansion";

	public const string VERSION = "0.0.1";

	internal static ManualLogSource Log;

	internal void Awake()
	{
		//IL_0023: Unknown result type (might be due to invalid IL or missing references)
		Log = ((BaseUnityPlugin)this).Logger;
		SL.OnPacksLoaded += SL_OnPacksLoaded;
		new Harmony("vik.VikBackPackExpansion").PatchAll();
	}

	private void SL_OnPacksLoaded()
	{
		DelayDo(delegate
		{
			//IL_0133: Unknown result type (might be due to invalid IL or missing references)
			//IL_014f: Unknown result type (might be due to invalid IL or missing references)
			//IL_016b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0191: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_023c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0258: Unknown result type (might be due to invalid IL or missing references)
			//IL_0274: 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_02b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0345: Unknown result type (might be due to invalid IL or missing references)
			//IL_0361: Unknown result type (might be due to invalid IL or missing references)
			//IL_037d: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_03bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_044e: Unknown result type (might be due to invalid IL or missing references)
			//IL_046a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0486: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0557: 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_058f: 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_05d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0660: Unknown result type (might be due to invalid IL or missing references)
			//IL_067c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0698: Unknown result type (might be due to invalid IL or missing references)
			//IL_06be: Unknown result type (might be due to invalid IL or missing references)
			//IL_06da: Unknown result type (might be due to invalid IL or missing references)
			//IL_074a: Unknown result type (might be due to invalid IL or missing references)
			//IL_07b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_081c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0885: Unknown result type (might be due to invalid IL or missing references)
			//IL_08f1: Unknown result type (might be due to invalid IL or missing references)
			Item itemPrefab = ResourcesPrefabManager.Instance.GetItemPrefab(-6900001);
			Item itemPrefab2 = ResourcesPrefabManager.Instance.GetItemPrefab(-6900002);
			Item itemPrefab3 = ResourcesPrefabManager.Instance.GetItemPrefab(-6900003);
			Item itemPrefab4 = ResourcesPrefabManager.Instance.GetItemPrefab(-6900004);
			Item itemPrefab5 = ResourcesPrefabManager.Instance.GetItemPrefab(-6900005);
			Item itemPrefab6 = ResourcesPrefabManager.Instance.GetItemPrefab(-6900006);
			Item itemPrefab7 = ResourcesPrefabManager.Instance.GetItemPrefab(-6900007);
			Item itemPrefab8 = ResourcesPrefabManager.Instance.GetItemPrefab(-6900008);
			Item itemPrefab9 = ResourcesPrefabManager.Instance.GetItemPrefab(-6900009);
			Item itemPrefab10 = ResourcesPrefabManager.Instance.GetItemPrefab(-6900010);
			Item itemPrefab11 = ResourcesPrefabManager.Instance.GetItemPrefab(-6900011);
			if ((Object)(object)itemPrefab6 != (Object)null)
			{
				Item itemPrefab12 = ResourcesPrefabManager.Instance.GetItemPrefab(2300050);
				Transform itemVisual = itemPrefab12.GetItemVisual(itemPrefab12.HasSpecialVisualPrefab);
				Transform child = itemVisual.GetChild(3);
				Transform val = Object.Instantiate<Transform>(child);
				Transform itemVisual2 = itemPrefab6.GetItemVisual(itemPrefab6.HasSpecialVisualPrefab);
				((Component)val).transform.parent = ((Component)itemVisual2).transform;
				val.localPosition = new Vector3(0f, 0.01f, -0.2f);
				val.localRotation = Quaternion.Euler(270f, 190f, 0f);
				val.localScale = new Vector3(1f, 1f, 1.5f);
				Transform child2 = itemVisual2.GetChild(2);
				child2.localPosition = new Vector3(0.27f, 0.05f, -0.35f);
				child2.localRotation = Quaternion.Euler(0f, 270f, 270f);
				Object.DontDestroyOnLoad((Object)(object)itemVisual2);
			}
			if ((Object)(object)itemPrefab7 != (Object)null)
			{
				Item itemPrefab13 = ResourcesPrefabManager.Instance.GetItemPrefab(2300070);
				Transform itemVisual3 = itemPrefab13.GetItemVisual(itemPrefab13.HasSpecialVisualPrefab);
				Transform child3 = itemVisual3.GetChild(3);
				Transform val2 = Object.Instantiate<Transform>(child3);
				Transform itemVisual4 = itemPrefab7.GetItemVisual(itemPrefab7.HasSpecialVisualPrefab);
				((Component)val2).transform.parent = ((Component)itemVisual4).transform;
				val2.localPosition = new Vector3(0f, 0.04f, -0.25f);
				val2.localRotation = Quaternion.Euler(270f, 190f, 0f);
				val2.localScale = new Vector3(0.8f, 1f, 1.2f);
				Transform child4 = itemVisual4.GetChild(2);
				child4.localPosition = new Vector3(0.27f, 0.12f, -0.35f);
				child4.localRotation = Quaternion.Euler(0f, 270f, 270f);
				Object.DontDestroyOnLoad((Object)(object)itemVisual4);
			}
			if ((Object)(object)itemPrefab8 != (Object)null)
			{
				Item itemPrefab14 = ResourcesPrefabManager.Instance.GetItemPrefab(2300290);
				Transform itemVisual5 = itemPrefab14.GetItemVisual(itemPrefab14.HasSpecialVisualPrefab);
				Transform child5 = itemVisual5.GetChild(3);
				Transform val3 = Object.Instantiate<Transform>(child5);
				Transform itemVisual6 = itemPrefab8.GetItemVisual(itemPrefab8.HasSpecialVisualPrefab);
				((Component)val3).transform.parent = ((Component)itemVisual6).transform;
				val3.localPosition = new Vector3(0f, 0.02f, -0.25f);
				val3.localRotation = Quaternion.Euler(90f, 10f, 0f);
				val3.localScale = new Vector3(0.8f, 0.8f, 1f);
				Transform child6 = itemVisual6.GetChild(2);
				child6.localPosition = new Vector3(-0.05f, 0.08f, -0.52f);
				child6.localRotation = Quaternion.Euler(0f, 270f, 270f);
				Object.DontDestroyOnLoad((Object)(object)itemVisual6);
			}
			if ((Object)(object)itemPrefab9 != (Object)null)
			{
				Item itemPrefab15 = ResourcesPrefabManager.Instance.GetItemPrefab(2300300);
				Transform itemVisual7 = itemPrefab15.GetItemVisual(itemPrefab15.HasSpecialVisualPrefab);
				Transform child7 = itemVisual7.GetChild(3);
				Transform val4 = Object.Instantiate<Transform>(child7);
				Transform itemVisual8 = itemPrefab9.GetItemVisual(itemPrefab9.HasSpecialVisualPrefab);
				((Component)val4).transform.parent = ((Component)itemVisual8).transform;
				val4.localPosition = new Vector3(0f, 0.1f, -0.25f);
				val4.localRotation = Quaternion.Euler(270f, 190f, 0f);
				val4.localScale = new Vector3(0.7f, 0.7f, 0.7f);
				Transform child8 = itemVisual8.GetChild(2);
				child8.localPosition = new Vector3(0.27f, 0.12f, -0.39f);
				child8.localRotation = Quaternion.Euler(0f, 270f, 270f);
				Object.DontDestroyOnLoad((Object)(object)itemVisual8);
			}
			if ((Object)(object)itemPrefab10 != (Object)null)
			{
				Item itemPrefab16 = ResourcesPrefabManager.Instance.GetItemPrefab(2300100);
				Transform itemVisual9 = itemPrefab16.GetItemVisual(itemPrefab16.HasSpecialVisualPrefab);
				Transform child9 = itemVisual9.GetChild(3);
				Transform val5 = Object.Instantiate<Transform>(child9);
				Transform itemVisual10 = itemPrefab10.GetItemVisual(itemPrefab10.HasSpecialVisualPrefab);
				((Component)val5).transform.parent = ((Component)itemVisual10).transform;
				val5.localPosition = new Vector3(0f, -0.01f, -0.2f);
				val5.localRotation = Quaternion.Euler(270f, 190f, 0f);
				val5.localScale = new Vector3(0.8f, 0.8f, 1f);
				Transform child10 = itemVisual10.GetChild(2);
				child10.localPosition = new Vector3(-0.05f, 0.08f, -0.52f);
				child10.localRotation = Quaternion.Euler(0f, 270f, 270f);
				Object.DontDestroyOnLoad((Object)(object)itemVisual10);
			}
			if ((Object)(object)itemPrefab11 != (Object)null)
			{
				Item itemPrefab17 = ResourcesPrefabManager.Instance.GetItemPrefab(2300340);
				Transform itemVisual11 = itemPrefab17.GetItemVisual(itemPrefab17.HasSpecialVisualPrefab);
				Transform child11 = itemVisual11.GetChild(3);
				Transform val6 = Object.Instantiate<Transform>(child11);
				Transform itemVisual12 = itemPrefab11.GetItemVisual(itemPrefab11.HasSpecialVisualPrefab);
				((Component)val6).transform.parent = ((Component)itemVisual12).transform;
				val6.localPosition = new Vector3(0f, 0.02f, -0.2f);
				val6.localRotation = Quaternion.Euler(270f, 190f, 0f);
				val6.localScale = new Vector3(0.9f, 0.9f, 1f);
				Transform child12 = itemVisual12.GetChild(2);
				child12.localPosition = new Vector3(0.17f, 0.05f, -0.53f);
				child12.localRotation = Quaternion.Euler(0f, 270f, 270f);
				Object.DontDestroyOnLoad((Object)(object)itemVisual12);
			}
			if ((Object)(object)itemPrefab != (Object)null)
			{
				Transform itemVisual13 = itemPrefab.GetItemVisual(itemPrefab.HasSpecialVisualPrefab);
				Light componentInChildren = ((Component)itemVisual13).gameObject.GetComponentInChildren<Light>();
				if ((Object)(object)componentInChildren != (Object)null)
				{
					componentInChildren.range = 10f;
					componentInChildren.color = new Color(0.4f, 0.8f, 0.7f, 1f);
				}
			}
			if ((Object)(object)itemPrefab2 != (Object)null)
			{
				Transform itemVisual14 = itemPrefab2.GetItemVisual(itemPrefab2.HasSpecialVisualPrefab);
				Light componentInChildren2 = ((Component)itemVisual14).gameObject.GetComponentInChildren<Light>();
				if ((Object)(object)componentInChildren2 != (Object)null)
				{
					componentInChildren2.range = 10f;
					componentInChildren2.color = new Color(0.7f, 0.4f, 0.3f, 1f);
				}
			}
			if ((Object)(object)itemPrefab3 != (Object)null)
			{
				Transform itemVisual15 = itemPrefab3.GetItemVisual(itemPrefab3.HasSpecialVisualPrefab);
				Light componentInChildren3 = ((Component)itemVisual15).gameObject.GetComponentInChildren<Light>();
				if ((Object)(object)componentInChildren3 != (Object)null)
				{
					componentInChildren3.range = 10f;
					componentInChildren3.color = new Color(0.7f, 0.7f, 0.5f, 1f);
				}
			}
			if ((Object)(object)itemPrefab4 != (Object)null)
			{
				Transform itemVisual16 = itemPrefab4.GetItemVisual(itemPrefab4.HasSpecialVisualPrefab);
				Light componentInChildren4 = ((Component)itemVisual16).gameObject.GetComponentInChildren<Light>();
				if ((Object)(object)componentInChildren4 != (Object)null)
				{
					componentInChildren4.range = 10f;
					componentInChildren4.color = new Color(0.4f, 0.5f, 0.8f, 1f);
				}
			}
			if ((Object)(object)itemPrefab5 != (Object)null)
			{
				Transform itemVisual17 = itemPrefab5.GetItemVisual(itemPrefab5.HasSpecialVisualPrefab);
				Light componentInChildren5 = ((Component)itemVisual17).gameObject.GetComponentInChildren<Light>();
				if ((Object)(object)componentInChildren5 != (Object)null)
				{
					componentInChildren5.range = 10f;
					componentInChildren5.color = new Color(0.07f, 0.4f, 0.25f, 1f);
				}
			}
		}, 5f);
	}

	public void DelayDo(Action OnAfterDelay, float DelayTime)
	{
		((MonoBehaviour)this).StartCoroutine(DoAfterDelay(OnAfterDelay, DelayTime));
	}

	public IEnumerator DoAfterDelay(Action OnAfterDelay, float DelayTime)
	{
		yield return (object)new WaitForSeconds(DelayTime);
		OnAfterDelay();
	}
}