Decompiled source of Slim Chicks v1.0.1

Plugins/VentureValheim.SlimChicks.dll

Decompiled a day ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using Jotunn.Managers;
using Microsoft.CodeAnalysis;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("VentureValheim.SlimChicks")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("VentureValheim.SlimChicks")]
[assembly: AssemblyCopyright("Copyright ©  2026")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("D38B4E45-1BBC-4AF8-98C2-ECDF8C286A61")]
[assembly: AssemblyFileVersion("1.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
}
namespace VentureValheim.SlimChicks
{
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("com.orianaventure.mod.SlimChicks", "SlimChicks", "1.0.0")]
	public class SlimChicksPlugin : BaseUnityPlugin
	{
		private const string ModName = "SlimChicks";

		private const string ModVersion = "1.0.0";

		private const string Author = "com.orianaventure.mod";

		private const string ModGUID = "com.orianaventure.mod.SlimChicks";

		private readonly Harmony HarmonyInstance = new Harmony("com.orianaventure.mod.SlimChicks");

		public static readonly ManualLogSource SlimChicksLogger = Logger.CreateLogSource("SlimChicks");

		public void Awake()
		{
			SlimChicksLogger.LogInfo((object)"Let's get together and feel alright.");
			Assembly executingAssembly = Assembly.GetExecutingAssembly();
			HarmonyInstance.PatchAll(executingAssembly);
			PrefabManager.OnPrefabsRegistered += SlimChicks.SlimThoseChicks;
		}
	}
	public class SlimChicks
	{
		public static void SlimThoseChicks()
		{
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			GameObject prefab = PrefabManager.Instance.GetPrefab("Chicken");
			CapsuleCollider val = default(CapsuleCollider);
			Rigidbody val2 = default(Rigidbody);
			if ((Object)(object)prefab != (Object)null && prefab.TryGetComponent<CapsuleCollider>(ref val) && prefab.TryGetComponent<Rigidbody>(ref val2))
			{
				val.center = new Vector3(0f, 0.33f, 0.1f);
				val.radius = 0.25f;
				val.height = 0.7f;
				val2.mass = 1f;
			}
			else
			{
				SlimChicksPlugin.SlimChicksLogger.LogWarning((object)"Could not modify Chicken!");
			}
			GameObject prefab2 = PrefabManager.Instance.GetPrefab("Hen");
			CapsuleCollider val3 = default(CapsuleCollider);
			Rigidbody val4 = default(Rigidbody);
			if ((Object)(object)prefab2 != (Object)null && prefab2.TryGetComponent<CapsuleCollider>(ref val3) && prefab2.TryGetComponent<Rigidbody>(ref val4))
			{
				val3.center = new Vector3(0f, 0.33f, 0.05f);
				val3.radius = 0.25f;
				val3.height = 0.7f;
				val4.mass = 4f;
			}
			else
			{
				SlimChicksPlugin.SlimChicksLogger.LogWarning((object)"Could not modify Hen!");
			}
		}
	}
}