using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using EntityStates.VoidSurvivor.Weapon;
using HarmonyLib;
using RiskOfOptions;
using RiskOfOptions.OptionConfigs;
using RiskOfOptions.Options;
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(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("Voidfiendbeam")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("Voidfiendbeam")]
[assembly: AssemblyTitle("Voidfiendbeam")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace VoidFiendBeam;
[BepInPlugin("com.YourName.VoidFiendBeam", "Void Fiend Beam", "1.0.0")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
public class VoidFiendBeam : BaseUnityPlugin
{
public static ConfigEntry<float> BeamRange;
public static ConfigEntry<float> BeamVfxXScale;
public static ConfigEntry<float> BeamVfxYScale;
public static ConfigEntry<float> BeamVfxZScale;
private static bool hasPrefabBeenModified;
private static GameObject originalPrefab;
public void Awake()
{
//IL_0096: Unknown result type (might be due to invalid IL or missing references)
//IL_009b: Unknown result type (might be due to invalid IL or missing references)
//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
//IL_00c2: Expected O, but got Unknown
//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
//IL_00c7: Expected O, but got Unknown
//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
//IL_00f9: Expected O, but got Unknown
//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
//IL_00fe: Expected O, but got Unknown
//IL_0104: Unknown result type (might be due to invalid IL or missing references)
//IL_0109: Unknown result type (might be due to invalid IL or missing references)
//IL_0114: Unknown result type (might be due to invalid IL or missing references)
//IL_011f: Unknown result type (might be due to invalid IL or missing references)
//IL_0130: Expected O, but got Unknown
//IL_012b: Unknown result type (might be due to invalid IL or missing references)
//IL_0135: Expected O, but got Unknown
//IL_013b: Unknown result type (might be due to invalid IL or missing references)
//IL_0140: Unknown result type (might be due to invalid IL or missing references)
//IL_014b: Unknown result type (might be due to invalid IL or missing references)
//IL_0156: Unknown result type (might be due to invalid IL or missing references)
//IL_0167: Expected O, but got Unknown
//IL_0162: Unknown result type (might be due to invalid IL or missing references)
//IL_016c: Expected O, but got Unknown
//IL_0172: Unknown result type (might be due to invalid IL or missing references)
//IL_0178: Expected O, but got Unknown
BeamRange = ((BaseUnityPlugin)this).Config.Bind<float>("Beam Settings", "Beam Range", 75f, "The effective range of the Corrupt Hand Beam. Default is 75.");
BeamVfxXScale = ((BaseUnityPlugin)this).Config.Bind<float>("Beam Settings", "Beam VFX X Scale", 1f, "The scale of the beam's visual effects (VFX) on the X-axis. Default is 1.");
BeamVfxYScale = ((BaseUnityPlugin)this).Config.Bind<float>("Beam Settings", "Beam VFX Y Scale", 1f, "The scale of the beam's visual effects (VFX) on the Y-axis. Default is 1.");
BeamVfxZScale = ((BaseUnityPlugin)this).Config.Bind<float>("Beam Settings", "Beam VFX Z Scale", 3.25f, "The scale of the beam's visual effects (VFX) on the Z-axis. Default is 3.25.");
ModSettingsManager.AddOption((BaseOption)new SliderOption(BeamRange, new SliderConfig
{
min = 10f,
max = 200f,
FormatString = "{0:0}"
}));
ModSettingsManager.AddOption((BaseOption)new SliderOption(BeamVfxXScale, new SliderConfig
{
min = 0.1f,
max = 10f,
FormatString = "{0:0.0}"
}));
ModSettingsManager.AddOption((BaseOption)new SliderOption(BeamVfxYScale, new SliderConfig
{
min = 0.1f,
max = 10f,
FormatString = "{0:0.0}"
}));
ModSettingsManager.AddOption((BaseOption)new SliderOption(BeamVfxZScale, new SliderConfig
{
min = 0.1f,
max = 20f,
FormatString = "{0:0.0}"
}));
Harmony val = new Harmony("com.YourName.VoidFiendBeam");
val.PatchAll();
((BaseUnityPlugin)this).Logger.LogInfo((object)"Void Fiend Beam has awakened!");
}
}
[HarmonyPatch(typeof(FireCorruptHandBeam), "OnEnter")]
public static class FireCorruptHandBeam_OnEnter_Patch
{
private static void Postfix(FireCorruptHandBeam __instance)
{
__instance.maxDistance = VoidFiendBeam.BeamRange.Value;
if ((Object)(object)__instance.beamVfxPrefab != (Object)null)
{
VoidFiendVFXBeam.ScaleBeamVFX(__instance.beamVfxPrefab, VoidFiendBeam.BeamVfxXScale.Value, VoidFiendBeam.BeamVfxYScale.Value, VoidFiendBeam.BeamVfxZScale.Value);
}
}
}
public static class VoidFiendVFXBeam
{
public static void ScaleBeamVFX(GameObject beamVfxPrefab, float newVfxXScale, float newVfxYScale, float newVfxZScale)
{
//IL_0017: Unknown result type (might be due to invalid IL or missing references)
if (!((Object)(object)beamVfxPrefab == (Object)null))
{
beamVfxPrefab.transform.localScale = new Vector3(newVfxXScale, newVfxYScale, newVfxZScale);
}
}
}
[HarmonyPatch(typeof(FireCorruptHandBeam))]
public static class FireCorruptHandBeam_Constructor_Patch
{
[HarmonyPatch(/*Could not decode attribute arguments.*/)]
[HarmonyPostfix]
private static void Postfix(FireCorruptHandBeam __instance)
{
if ((Object)(object)__instance.beamVfxPrefab != (Object)null)
{
VoidFiendVFXBeam.ScaleBeamVFX(__instance.beamVfxPrefab, VoidFiendBeam.BeamVfxXScale.Value, VoidFiendBeam.BeamVfxYScale.Value, VoidFiendBeam.BeamVfxZScale.Value);
}
}
}