Decompiled source of Wub And Song v1.0.3

ExamplePlugin.dll

Decompiled a month ago
using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using Microsoft.CodeAnalysis;
using R2API;
using RoR2;
using RoR2.ExpansionManagement;
using UnityEngine;
using UnityEngine.AddressableAssets;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("ExamplePlugin")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("ExamplePlugin")]
[assembly: AssemblyTitle("ExamplePlugin")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.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 WubAndSong
{
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("TheWubDoctor.Wub_And_Song", "Wub_And_Song", "1.0.0")]
	public class WubAndSong : BaseUnityPlugin
	{
		public const string PluginGUID = "TheWubDoctor.Wub_And_Song";

		public const string PluginAuthor = "TheWubDoctor";

		public const string PluginName = "Wub_And_Song";

		public const string PluginVersion = "1.0.0";

		private static ItemDef WubDollDef;

		private static ItemDef SongDollDef;

		public static AssetBundle MainAssets;

		public void Awake()
		{
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f2: Expected O, but got Unknown
			//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: Expected O, but got Unknown
			//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_017f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0184: Unknown result type (might be due to invalid IL or missing references)
			//IL_01df: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e9: Expected O, but got Unknown
			//IL_0202: Unknown result type (might be due to invalid IL or missing references)
			//IL_0207: Unknown result type (might be due to invalid IL or missing references)
			//IL_0220: Unknown result type (might be due to invalid IL or missing references)
			//IL_023e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0240: Unknown result type (might be due to invalid IL or missing references)
			MainAssets = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), "wubdoll"));
			Log.Init(((BaseUnityPlugin)this).Logger);
			WubDollDef = ScriptableObject.CreateInstance<ItemDef>();
			((Object)WubDollDef).name = "WUBDOLL";
			WubDollDef.nameToken = "Wub Doll";
			WubDollDef.pickupToken = "For SongBird <3";
			WubDollDef.descriptionToken = "For SongBird <3";
			WubDollDef.loreToken = "For SongBird <3";
			WubDollDef._itemTierDef = Addressables.LoadAssetAsync<ItemTierDef>((object)"RoR2/Base/Common/Tier3Def.asset").WaitForCompletion();
			WubDollDef.pickupIconSprite = MainAssets.LoadAsset<Sprite>("Wub_ICON128.png");
			WubDollDef.pickupModelPrefab = MainAssets.LoadAsset<GameObject>("WubDoll.prefab");
			WubDollDef.canRemove = true;
			WubDollDef.hidden = false;
			ItemDisplayRuleDict val = new ItemDisplayRuleDict((ItemDisplayRule[])null);
			ItemAPI.Add(new CustomItem(WubDollDef, val));
			SongDollDef = ScriptableObject.CreateInstance<ItemDef>();
			((Object)SongDollDef).name = "voidWUBDOLL";
			SongDollDef.nameToken = "SongBird Doll";
			SongDollDef.pickupToken = "TeeHee <3";
			SongDollDef.descriptionToken = "TeeHee <3";
			SongDollDef.loreToken = "TeeHee <3";
			SongDollDef._itemTierDef = Addressables.LoadAssetAsync<ItemTierDef>((object)"RoR2/DLC1/Common/VoidTier3Def.asset").WaitForCompletion();
			SongDollDef.requiredExpansion = Addressables.LoadAssetAsync<ExpansionDef>((object)"RoR2/DLC1/Common/DLC1.asset").WaitForCompletion();
			SongDollDef.pickupIconSprite = MainAssets.LoadAsset<Sprite>("SONG_ICON128.png");
			SongDollDef.pickupModelPrefab = MainAssets.LoadAsset<GameObject>("SongDoll.prefab");
			SongDollDef.canRemove = true;
			SongDollDef.hidden = false;
			ItemAPI.Add(new CustomItem(SongDollDef, val));
			ItemRelationshipProvider val2 = ScriptableObject.CreateInstance<ItemRelationshipProvider>();
			((Object)val2).name = "DollItemContagiousProvider";
			val2.relationshipType = Addressables.LoadAssetAsync<ItemRelationshipType>((object)"RoR2/DLC1/Common/ContagiousItem.asset").WaitForCompletion();
			val2.relationships = (Pair[])(object)new Pair[1]
			{
				new Pair
				{
					itemDef1 = WubDollDef,
					itemDef2 = SongDollDef
				}
			};
			ContentAddition.AddItemRelationshipProvider(val2);
		}
	}
	internal static class Log
	{
		private static ManualLogSource _logSource;

		internal static void Init(ManualLogSource logSource)
		{
			_logSource = logSource;
		}

		internal static void Debug(object data)
		{
			_logSource.LogDebug(data);
		}

		internal static void Error(object data)
		{
			_logSource.LogError(data);
		}

		internal static void Fatal(object data)
		{
			_logSource.LogFatal(data);
		}

		internal static void Info(object data)
		{
			_logSource.LogInfo(data);
		}

		internal static void Message(object data)
		{
			_logSource.LogMessage(data);
		}

		internal static void Warning(object data)
		{
			_logSource.LogWarning(data);
		}
	}
}