Decompiled source of FullElementalCocktailFix v1.0.0

ECFix.dll

Decompiled 3 days ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using Pigeon.Math;
using Pigeon.Movement;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyCompany("ECFix")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("ECFix")]
[assembly: AssemblyTitle("ECFix")]
[assembly: AssemblyVersion("1.0.0.0")]
[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 ElementalCocktailSelfPatch
{
	[MycoMod(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("Elementalcocktail_selfpatch", "Elemental Cocktail Self Patch", "1.0.0")]
	public class ElementalCocktailSelfPatch : BaseUnityPlugin
	{
		private void Awake()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			Harmony val = new Harmony("elementalcocktail_selfpatch");
			val.PatchAll();
		}
	}
	[HarmonyPatch]
	public static class UpgradeProperty_Player_ApplyElementOnSaturate_Patch
	{
		private static MethodBase TargetMethod()
		{
			Type typeFromHandle = typeof(UpgradeProperty_Player_ApplyElementOnSaturate);
			return AccessTools.Method(typeFromHandle, "OnSaturateTarget", new Type[1] { typeof(EffectCallbackData).MakeByRefType() }, (Type[])null);
		}

		private static bool Prefix(ref EffectCallbackData effectData, UpgradeProperty_Player_ApplyElementOnSaturate __instance)
		{
			//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_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			ref UpgradeVariableData upgradeVariables = ref Player.LocalPlayer.UpgradeVariables;
			if (effectData.effect != upgradeVariables.elementSynergyPrimary)
			{
				return false;
			}
			if (((Random)(ref Random.shared)).NextFloat() > __instance.chance.max)
			{
				return false;
			}
			ApplyElement(effectData.target, upgradeVariables.elementSynergySecondary);
			if (effectData.target == Player.LocalPlayer)
			{
				ApplyElement((ITarget)(object)Player.LocalPlayer, upgradeVariables.elementSynergySecondary);
				ApplyElement((ITarget)(object)Player.LocalPlayer, upgradeVariables.elementSynergySecondary);
			}
			return false;
		}

		private static void ApplyElement(ITarget target, EffectType element)
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			IDamageSource.DamageTarget((IDamageSource)(object)Player.LocalPlayer, target, new DamageData(0f, element, 10f), Player.LocalPlayer.PhysicsPosition, (Collider)null);
		}
	}
}