using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using Configgy;
using HarmonyLib;
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("SmolGabriel")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("SmolGabriel")]
[assembly: AssemblyTitle("SmolGabriel")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace SmolGabriel;
public static class ModConfig
{
public const float ScaleFactor = 0.5f;
public const float VoicePitch = 2f;
}
[BepInPlugin("smolgabriel.ultranoob.ultrakill", "SmolGabriel", "1.0.0")]
public class SmolGabriel : BaseUnityPlugin
{
private Harmony harmony;
public static ConfigBuilder ConfigMenu;
[Configgable("Settings", "Enable Mod", 0, "Enable or disable the mod.")]
public static bool modEnabled = true;
private void Awake()
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_0011: Expected O, but got Unknown
//IL_0027: Unknown result type (might be due to invalid IL or missing references)
//IL_0031: Expected O, but got Unknown
harmony = new Harmony("smolgabriel.ultranoob.ultrakill");
harmony.PatchAll();
ConfigMenu = new ConfigBuilder("smolgabriel.ultranoob.ultrakill", "SmolGabriel");
ConfigMenu.BuildType(typeof(SmolGabriel));
((BaseUnityPlugin)this).Logger.LogInfo((object)"SmolGabriel mod loaded!");
}
}
[HarmonyPatch(typeof(Gabriel), "Start")]
public static class Gabriel_Start_Patch
{
private static void Postfix(Gabriel __instance)
{
//IL_0016: Unknown result type (might be due to invalid IL or missing references)
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
if (SmolGabriel.modEnabled)
{
Transform transform = ((Component)__instance).transform;
transform.localScale *= 0.5f;
}
}
}
[HarmonyPatch(typeof(GabrielSecond), "Start")]
public static class GabrielSecond_Start_Patch
{
private static void Postfix(GabrielSecond __instance)
{
//IL_0016: Unknown result type (might be due to invalid IL or missing references)
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
if (SmolGabriel.modEnabled)
{
Transform transform = ((Component)__instance).transform;
transform.localScale *= 0.5f;
}
}
}
[HarmonyPatch(typeof(GabrielIntro), "Begin")]
public static class GabrielIntro_Begin_Patch
{
private static void Postfix(GabrielIntro __instance)
{
//IL_0016: Unknown result type (might be due to invalid IL or missing references)
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
if (SmolGabriel.modEnabled)
{
Transform transform = ((Component)__instance).transform;
transform.localScale *= 0.5f;
}
}
}
[HarmonyPatch(typeof(GabrielOutro), "Start")]
public static class GabrielOutro_Start_Patch
{
private static void Postfix(GabrielOutro __instance)
{
//IL_0016: Unknown result type (might be due to invalid IL or missing references)
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
if (SmolGabriel.modEnabled)
{
Transform transform = ((Component)__instance).transform;
transform.localScale *= 0.5f;
}
}
}
[HarmonyPatch(typeof(GabrielVoice), "Start")]
public static class GabrielVoice_Start_Patch
{
private static void Postfix(GabrielVoice __instance)
{
if (SmolGabriel.modEnabled)
{
AudioSource component = ((Component)__instance).GetComponent<AudioSource>();
if ((Object)(object)component != (Object)null)
{
component.pitch = 2f;
}
}
}
}
[HarmonyPatch(typeof(GabrielVoice), "Hurt")]
public static class GabrielVoice_Hurt_Patch
{
private static void Prefix(GabrielVoice __instance)
{
if (SmolGabriel.modEnabled)
{
AudioSource component = ((Component)__instance).GetComponent<AudioSource>();
if ((Object)(object)component != (Object)null)
{
component.pitch = 2f;
}
}
}
}
[HarmonyPatch(typeof(GabrielVoice), "BigHurt")]
public static class GabrielVoice_BigHurt_Patch
{
private static void Prefix(GabrielVoice __instance)
{
if (SmolGabriel.modEnabled)
{
AudioSource component = ((Component)__instance).GetComponent<AudioSource>();
if ((Object)(object)component != (Object)null)
{
component.pitch = 2f;
}
}
}
}
[HarmonyPatch(typeof(GabrielVoice), "PhaseChange")]
public static class GabrielVoice_PhaseChange_Patch
{
private static void Prefix(GabrielVoice __instance)
{
if (SmolGabriel.modEnabled)
{
AudioSource component = ((Component)__instance).GetComponent<AudioSource>();
if ((Object)(object)component != (Object)null)
{
component.pitch = 2f;
}
}
}
}
[HarmonyPatch(typeof(GabrielVoice), "Taunt")]
public static class GabrielVoice_Taunt_Patch
{
private static void Prefix(GabrielVoice __instance)
{
if (SmolGabriel.modEnabled)
{
AudioSource component = ((Component)__instance).GetComponent<AudioSource>();
if ((Object)(object)component != (Object)null)
{
component.pitch = 2f;
}
}
}
}
[HarmonyPatch(typeof(SubtitledAudioSource), "Awake")]
public static class SubtitledAudioSource_Awake_Patch
{
private static void Postfix(SubtitledAudioSource __instance)
{
if (SmolGabriel.modEnabled)
{
AudioSource component = ((Component)__instance).GetComponent<AudioSource>();
if ((Object)(object)component != (Object)null)
{
component.pitch = 2f;
}
}
}
}
[HarmonyPatch(typeof(SubtitledAudioSource), "OnEnable")]
public static class SubtitledAudioSource_OnEnable_Patch
{
private static void Postfix(SubtitledAudioSource __instance)
{
if (SmolGabriel.modEnabled)
{
AudioSource component = ((Component)__instance).GetComponent<AudioSource>();
if ((Object)(object)component != (Object)null)
{
component.pitch = 2f;
}
}
}
}
[HarmonyPatch]
public static class Gabriel_SpawnLeftHandWeapon_Patch
{
private static MethodBase TargetMethod()
{
return AccessTools.DeclaredMethod(typeof(Gabriel), "SpawnLeftHandWeapon", (Type[])null, (Type[])null);
}
private static void Postfix(object __instance)
{
//IL_0033: Unknown result type (might be due to invalid IL or missing references)
//IL_0039: Expected O, but got Unknown
//IL_004e: Unknown result type (might be due to invalid IL or missing references)
//IL_0058: Unknown result type (might be due to invalid IL or missing references)
if (!SmolGabriel.modEnabled)
{
return;
}
FieldInfo fieldInfo = AccessTools.Field(__instance.GetType(), "leftHandWeapon");
if (fieldInfo != null)
{
GameObject val = (GameObject)fieldInfo.GetValue(__instance);
if ((Object)(object)val != (Object)null)
{
Transform transform = val.transform;
transform.localScale *= 0.5f;
}
}
}
}
[HarmonyPatch]
public static class Gabriel_SpawnRightHandWeapon_Patch
{
private static MethodBase TargetMethod()
{
return AccessTools.DeclaredMethod(typeof(Gabriel), "SpawnRightHandWeapon", (Type[])null, (Type[])null);
}
private static void Postfix(object __instance)
{
//IL_0033: Unknown result type (might be due to invalid IL or missing references)
//IL_0039: Expected O, but got Unknown
//IL_004e: Unknown result type (might be due to invalid IL or missing references)
//IL_0058: Unknown result type (might be due to invalid IL or missing references)
if (!SmolGabriel.modEnabled)
{
return;
}
FieldInfo fieldInfo = AccessTools.Field(__instance.GetType(), "rightHandWeapon");
if (fieldInfo != null)
{
GameObject val = (GameObject)fieldInfo.GetValue(__instance);
if ((Object)(object)val != (Object)null)
{
Transform transform = val.transform;
transform.localScale *= 0.5f;
}
}
}
}
[HarmonyPatch(typeof(Gabriel), "ThrowWeapon")]
public static class Gabriel_ThrowWeapon_Patch
{
private static void Postfix(Gabriel __instance, GameObject projectile)
{
//IL_0033: Unknown result type (might be due to invalid IL or missing references)
//IL_0039: Expected O, but got Unknown
//IL_004e: Unknown result type (might be due to invalid IL or missing references)
//IL_0058: Unknown result type (might be due to invalid IL or missing references)
if (!SmolGabriel.modEnabled)
{
return;
}
FieldInfo fieldInfo = AccessTools.Field(((object)__instance).GetType(), "thrownObject");
if (fieldInfo != null)
{
GameObject val = (GameObject)fieldInfo.GetValue(__instance);
if ((Object)(object)val != (Object)null)
{
Transform transform = val.transform;
transform.localScale *= 0.5f;
}
}
}
}