Decompiled source of GorpDropsStrawPairies v1.0.0

GorpDropsStrawPairies.dll

Decompiled 2 days ago
using System;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using Microsoft.CodeAnalysis;
using RoR2;
using SeekingTheVoid;
using UnityEngine;

[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("GorpDropsStrawPairies")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("GorpDropsStrawPairies")]
[assembly: AssemblyTitle("GorpDropsStrawPairies")]
[assembly: AssemblyVersion("1.0.0.0")]
[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 GorpDropsStrawParies
{
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("Xaidee.GorpDropsStrawPairies", "GorpDropsStrawPairies", "1.0.0")]
	public class EdibleStarstorm : BaseUnityPlugin
	{
		public static AssetBundle AssetBundle { get; private set; }

		public void Awake()
		{
			Log.Init(((BaseUnityPlugin)this).Logger);
			AssetBundle = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), "yellowstrawpairy.bundle"));
			if (!SeekingTheVoid.isPairyEnabled)
			{
				StrawPairy.Init();
			}
			((ResourceAvailability)(ref ItemCatalog.availability)).CallWhenAvailable((Action)ModifyStrawPairies);
			((ResourceAvailability)(ref BodyCatalog.availability)).CallWhenAvailable((Action)ModifyGorp);
		}

		private static void ModifyStrawPairies()
		{
			ItemDef strawPairyDef = StrawPairy.StrawPairyDef;
			if (Object.op_Implicit((Object)(object)strawPairyDef))
			{
				strawPairyDef.pickupIconSprite = AssetBundle.LoadAsset<Sprite>("StrawPairy.png");
				strawPairyDef.tier = (ItemTier)4;
				strawPairyDef.tags = strawPairyDef.tags.Append((ItemTag)9).ToArray();
			}
		}

		private static void ModifyGorp()
		{
			//IL_003e: 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_005d: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = BodyCatalog.FindBodyPrefab("GorpBody");
			if (Object.op_Implicit((Object)(object)val))
			{
				DeathRewards component = val.GetComponent<DeathRewards>();
				ExplicitPickupDropTable val2 = ScriptableObject.CreateInstance<ExplicitPickupDropTable>();
				((Object)val2).name = "dtBossGorp";
				((PickupDropTable)val2).canDropBeReplaced = true;
				val2.pickupEntries = (PickupDefEntry[])(object)new PickupDefEntry[1]
				{
					new PickupDefEntry
					{
						pickupDef = (Object)(object)StrawPairy.StrawPairyDef,
						pickupWeight = 1f
					}
				};
				component.bossDropTable = (PickupDropTable)(object)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);
		}
	}
}