using System;
using System.CodeDom.Compiler;
using System.ComponentModel;
using System.Diagnostics;
using System.Globalization;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using GwenethGoop.Patches;
using GwynethGoop;
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: AssemblyTitle("GwenethGoop")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("GwenethGoop")]
[assembly: AssemblyCopyright("Copyright © 2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("7dd2de82-b8e3-41f5-9f6d-c10c091569de")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace GwynethGoop
{
[BepInPlugin("AllegedMexican.GwynethGoop", "Gwyneth Paltrow Hygrodere", "1.0.0.0")]
public class SlimeReplacerBase : BaseUnityPlugin
{
private const string GUID = "AllegedMexican.GwynethGoop";
private const string NAME = "Gwyneth Paltrow Hygrodere";
private const string VERSION = "1.0.0.0";
private readonly Harmony harmony = new Harmony("AllegedMexican.GwynethGoop");
public static SlimeReplacerBase Instance;
internal ManualLogSource mls;
public static AssetBundle assetBundle;
private void Awake()
{
if ((Object)(object)Instance == (Object)null)
{
Instance = this;
}
mls = Logger.CreateLogSource("AllegedMexican.GwynethGoop");
mls.LogInfo((object)"Gwyneth Paltrow is in your game now :)");
assetBundle = AssetBundle.LoadFromStream(Assembly.GetExecutingAssembly().GetManifestResourceStream("GwenethGoop.Resources.gwynethmat"));
harmony.PatchAll(typeof(SlimeReplacerBase));
harmony.PatchAll(typeof(SlimeReplacerPatch));
}
}
}
namespace GwenethGoop.Properties
{
[GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[DebuggerNonUserCode]
[CompilerGenerated]
internal class Resources
{
private static ResourceManager resourceMan;
private static CultureInfo resourceCulture;
[EditorBrowsable(EditorBrowsableState.Advanced)]
internal static ResourceManager ResourceManager
{
get
{
if (resourceMan == null)
{
ResourceManager resourceManager = new ResourceManager("GwenethGoop.Properties.Resources", typeof(Resources).Assembly);
resourceMan = resourceManager;
}
return resourceMan;
}
}
[EditorBrowsable(EditorBrowsableState.Advanced)]
internal static CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
internal static byte[] gwynethmat
{
get
{
object @object = ResourceManager.GetObject("gwynethmat", resourceCulture);
return (byte[])@object;
}
}
internal Resources()
{
}
}
}
namespace GwenethGoop.Patches
{
[HarmonyPatch]
internal class SlimeReplacerPatch
{
[HarmonyPatch(typeof(BlobAI), "Start")]
[HarmonyPostfix]
private static void TexturePatch(BlobAI __instance, Material ___thisSlimeMaterial)
{
Random random = new Random();
int num = random.Next(1, 100);
Material val = SlimeReplacerBase.assetBundle.LoadAsset<Material>("NewBlobMaterialSmall");
if (num <= 30)
{
val = SlimeReplacerBase.assetBundle.LoadAsset<Material>("NewBlobMaterialMultiple");
}
___thisSlimeMaterial = val;
try
{
((Renderer)((EnemyAI)__instance).skinnedMeshRenderers[0]).material = val;
}
catch (Exception ex)
{
Debug.LogError((object)ex.Message);
}
}
}
}