Decompiled source of VoidSymbioticScorpion v1.0.3

plugins/VoidScorpion.dll

Decompiled 19 hours 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 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("VoidScorpion")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+8cc076ff26d4a37d1cf03674a30bf4a4d1b3da96")]
[assembly: AssemblyProduct("VoidScorpion")]
[assembly: AssemblyTitle("VoidScorpion")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[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 VoidScorpion
{
	public static class Asset
	{
		public static AssetBundle mainBundle;

		public const string bundleName = "voidscorpionbundle";

		public static string AssetBundlePath => Path.Combine(Path.GetDirectoryName(typeof(VoidScorpionPlugin).Assembly.Location), "voidscorpionbundle");

		public static void Init()
		{
			mainBundle = AssetBundle.LoadFromFile(AssetBundlePath);
		}
	}
	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);
		}
	}
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("com.Slendykray.VoidSymbioticScorpion", "VoidSymbioticScorpion", "1.0.0")]
	public class VoidScorpionPlugin : BaseUnityPlugin
	{
		public void Awake()
		{
			//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_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			Log.Init(((BaseUnityPlugin)this).Logger);
			Asset.Init();
			ItemDef itemDef = Addressables.LoadAssetAsync<ItemDef>((object)"RoR2/Base/ArmorReductionOnHit/ArmorReductionOnHit.asset").WaitForCompletion();
			ItemDef val = Addressables.LoadAssetAsync<ItemDef>((object)"RoR2/DLC1/PermanentDebuffOnHit/PermanentDebuffOnHit.asset").WaitForCompletion();
			val._itemTierDef = Addressables.LoadAssetAsync<ItemTierDef>((object)"RoR2/DLC1/Common/VoidTier3Def.asset").WaitForCompletion();
			val.pickupToken = "Permanently reduce armor on hit. <style=cIsVoid>Corrupts all Shattering Justices</style>.";
			val.descriptionToken = "<style=cIsDamage>100%</style> chance on hit to reduce <style=cIsDamage>armor</style> by <style=cIsDamage>2</style> <style=cStack>(+2 per stack)</style> <style=cIsDamage>permanently</style>. <style=cIsVoid>Corrupts all Shattering Justices</style>.";
			val.pickupIconSprite = Asset.mainBundle.LoadAsset<Sprite>("icon.png");
			ItemRelationshipProvider val2 = ScriptableObject.CreateInstance<ItemRelationshipProvider>();
			((Object)val2).name = "ScorpionContagiousItemProvider";
			val2.relationshipType = Addressables.LoadAssetAsync<ItemRelationshipType>((object)"RoR2/DLC1/Common/ContagiousItem.asset").WaitForCompletion();
			val2.relationships = (Pair[])(object)new Pair[1]
			{
				new Pair
				{
					itemDef1 = itemDef,
					itemDef2 = val
				}
			};
			ContentAddition.AddItemRelationshipProvider(val2);
		}
	}
}