Decompiled source of NewMutation v1.0.0

NewMutation.dll

Decompiled 2 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using Atomicrops.Core;
using Atomicrops.Core.Agent2;
using Atomicrops.Core.DamageSystem;
using Atomicrops.Core.GunSystem;
using Atomicrops.Core.Loot;
using Atomicrops.Core.Models;
using Atomicrops.Core.Ui;
using Atomicrops.Core.Upgrades;
using Atomicrops.Crops;
using Atomicrops.Game.Agents;
using Atomicrops.Game.Crops;
using Atomicrops.Game.Data;
using Atomicrops.Game.EnemySystem;
using Atomicrops.Game.GameState;
using Atomicrops.Game.Loot;
using Atomicrops.Game.NightWaves2;
using Atomicrops.Game.ParamsSystem;
using Atomicrops.Game.Player;
using Atomicrops.Game.Scenes.Farm;
using Atomicrops.Game.Ui.Hud;
using BepInEx;
using BepInEx.Logging;
using CustomParams;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using SharedLib;
using UnityEngine;
using UnityEngine.UI;

[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.0", FrameworkDisplayName = ".NET Standard 2.0")]
[assembly: AssemblyCompany("NewMutation")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("My first Atomicrops modpack fully utilizing Custom Params by bigpauli. Includes over a dozen items for different item pools.")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("NewMutation")]
[assembly: AssemblyTitle("NewMutation")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[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 NewMutationProject
{
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "NewMutation";

		public const string PLUGIN_NAME = "NewMutation";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}
namespace NewMutation
{
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "ImJustBag.plugin.NewMutation";

		public const string PLUGIN_NAME = "NewMutation";

		public const string PLUGIN_VERSION = "1.0.0";

		public static string PLUGIN_PATH = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
	}
	[BepInPlugin("ImJustBag.plugin.NewMutation", "NewMutation", "1.0.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Plugin : BaseUnityPlugin
	{
		public static ManualLogSource Log;

		private void Awake()
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Expected O, but got Unknown
			Log = ((BaseUnityPlugin)this).Logger;
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin ImJustBag.plugin.NewMutation, v 1.0.0 is loaded!");
			NewMutationLogo.Init();
			RegisterUpgrade();
			Harmony val = new Harmony("ImJustBag.plugin.NewMutation");
			val.PatchAll();
		}

		private void RegisterUpgrade()
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Expected O, but got Unknown
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Expected O, but got Unknown
			//IL_010b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0112: Expected O, but got Unknown
			//IL_0188: Unknown result type (might be due to invalid IL or missing references)
			//IL_018f: Expected O, but got Unknown
			//IL_0213: Unknown result type (might be due to invalid IL or missing references)
			//IL_021a: Expected O, but got Unknown
			//IL_02ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0306: Expected O, but got Unknown
			//IL_0383: Unknown result type (might be due to invalid IL or missing references)
			//IL_038a: Expected O, but got Unknown
			//IL_03d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e0: Expected O, but got Unknown
			//IL_0446: Unknown result type (might be due to invalid IL or missing references)
			//IL_044d: Expected O, but got Unknown
			//IL_0599: Unknown result type (might be due to invalid IL or missing references)
			//IL_05a0: Expected O, but got Unknown
			//IL_065b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0662: Expected O, but got Unknown
			//IL_06b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_06bf: Expected O, but got Unknown
			//IL_071f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0726: Expected O, but got Unknown
			//IL_0785: Unknown result type (might be due to invalid IL or missing references)
			//IL_078c: Expected O, but got Unknown
			//IL_07cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_07d2: Expected O, but got Unknown
			//IL_080a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0811: Expected O, but got Unknown
			//IL_0870: Unknown result type (might be due to invalid IL or missing references)
			//IL_0877: Expected O, but got Unknown
			//IL_08e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_08eb: Expected O, but got Unknown
			//IL_0984: Unknown result type (might be due to invalid IL or missing references)
			//IL_098b: Expected O, but got Unknown
			//IL_09d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_09d8: Expected O, but got Unknown
			//IL_0a37: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a3e: Expected O, but got Unknown
			//IL_0a9d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0aa4: Expected O, but got Unknown
			//IL_0b03: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b0a: Expected O, but got Unknown
			//IL_0b69: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b70: Expected O, but got Unknown
			//IL_0bd6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bdd: Expected O, but got Unknown
			//IL_0c3c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c43: Expected O, but got Unknown
			//IL_0ca2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ca9: Expected O, but got Unknown
			//IL_0d08: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d0f: Expected O, but got Unknown
			//IL_0d6e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d75: Expected O, but got Unknown
			//IL_0dd4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ddb: Expected O, but got Unknown
			//IL_0e3a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e41: Expected O, but got Unknown
			//IL_0ea0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ea7: Expected O, but got Unknown
			//IL_0f24: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f2b: Expected O, but got Unknown
			//IL_0f8a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f91: Expected O, but got Unknown
			//IL_0fe3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0fea: Expected O, but got Unknown
			//IL_1049: Unknown result type (might be due to invalid IL or missing references)
			//IL_1050: Expected O, but got Unknown
			Upgrade val = new Upgrade("Instruction Manual", "How did you build things without this?!\n+1 Turret.", "InstructionManual.png", Assembly.GetExecutingAssembly());
			val.AddVanillaParam("Player.TurretWork", 0.3f, "Multiply");
			Dictionary<string, int> dictionary = new Dictionary<string, int> { { "turret", 1 } };
			val.AddTurrets(dictionary);
			val.AddUpgradeToLootPool("Main");
			Upgrade val2 = new Upgrade("Blinker Fluid", "Makes your invulnerability frames on taking damage last longer.", "BlinkerFluid.png", Assembly.GetExecutingAssembly());
			val2.AddVanillaParam("Player.InvincibilityAfterHitDur", 2f, "Multiply");
			val2.AddUpgradeToLootPool("Main");
			Upgrade val3 = new Upgrade("Elephant Trunk", "Blast water more and farther.", "ElephantTrunk.png", Assembly.GetExecutingAssembly());
			val3.AddCustomParam((Action)ElephantTrunkState.EnableElephantTrunk, (Action)ElephantTrunkState.Cleanup);
			val3.AddUpgradeToLootPool("Main");
			Upgrade val4 = new Upgrade("Lightning Chain", "Chain less actions to combo. Zap enemies when you energize!", "LightningChain.png", Assembly.GetExecutingAssembly());
			val4.AddVanillaParam("Farm.ComboPointsForBoost", -2f, "Add");
			val4.AddCustomParam((Action)LightningChainState.EnableLightningChain, (Action)LightningChainState.Cleanup);
			val4.AddUpgradeToLootPool("Main");
			Upgrade val5 = new Upgrade("Chicken Coop", "More room for chickens makes them lay more eggs.\n+1 chicken.", "ChickenCoop.png", Assembly.GetExecutingAssembly());
			val5.AddVanillaParam("Farm.ChickenEggDropMin", 1f, "Add");
			val5.AddVanillaParam("Farm.ChickenEggDropMax", 3f, "Add");
			val5.AddVanillaParam("Farm.MaxChickens", 5f, "Add");
			Dictionary<string, int> dictionary2 = new Dictionary<string, int> { { "chickenweed", 1 } };
			val5.AddFriends(dictionary2);
			val5.AddUpgradeToLootPool("Main");
			Upgrade val6 = new Upgrade("Contraband Contract", "Sign here for a banned item at the expense of your energy.", "ContrabandContract.png", Assembly.GetExecutingAssembly());
			val6.AddVanillaParam("Farm.EnergizedAddPerCombo", 0f, "Multiply");
			val6.AddVanillaParam("Farm.BoostPointOnKillChance", 0f, "Multiply");
			val6.AddVanillaParam("Farm.ComboDecay", 0f, "Multiply");
			val6.AddVanillaParam("Farm.EnergizedDuration", 0f, "Multiply");
			val6.AddVanillaParam("Farm.DoBoostOnTractor", false);
			val6.AddVanillaParam("Player.DoBoostOnEnemyKill", false);
			val6.AddVanillaParam("Player.DoLowHealthAlwaysEnergized", false);
			val6.AddCustomParam((Action)ContrabandContractState.EnableContrabandContract, (Action)ContrabandContractState.Cleanup);
			val6.AddUpgradeToLootPool("DeerShop");
			Upgrade val7 = new Upgrade("Remote Worker", "Time moves slower when away from home.", "RemoteWorker.png", Assembly.GetExecutingAssembly());
			val7.AddVanillaParam("GameState.DayProgressMultTundra", 0.9f, "Multiply");
			val7.AddVanillaParam("GameState.DayProgressMultJungle", 0.9f, "Multiply");
			val7.AddVanillaParam("GameState.DayProgressMultPlains", 0.9f, "Multiply");
			val7.AddVanillaParam("GameState.DayProgressMultDesert", 0.9f, "Multiply");
			val7.AddUpgradeToLootPool("Main");
			Upgrade val8 = new Upgrade("Tree Mulch", "Plant trees quicker and watch them grow faster!", "TreeMulch.png", Assembly.GetExecutingAssembly());
			val8.AddVanillaParam("Farm.GlobalTreeGrowthMult", 1.1f, "Multiply");
			val8.AddVanillaParam("Player.TreeWorkDuration", 0.333f, "Multiply");
			val8.AddUpgradeToLootPool("Main");
			Upgrade val9 = new Upgrade("Project: L1V3-5T0K", "Superior animals stored in a singularity...", "ProjectLivestock.png", Assembly.GetExecutingAssembly());
			Dictionary<string, int> dictionary3 = new Dictionary<string, int>
			{
				{ "bee2", 1 },
				{ "cow2", 1 },
				{ "pig2", 1 },
				{ "chickenweed2", 1 }
			};
			val9.AddFriends(dictionary3);
			val9.AddUpgradeToLootPool("GoldenChest");
			Upgrade val10 = new Upgrade("Side Stats Up", "Jack of all trades, master of none.", "SideStatsUp.png", Assembly.GetExecutingAssembly());
			val10.AddVanillaParam("Player.BarkSkin", 0.05f, "Add");
			val10.AddVanillaParam("Player.Luck", 0.05f, "Add");
			val10.AddVanillaParam("Player.HomingPigeon", 0.05f, "Add");
			val10.AddVanillaParam("Player.TractorJumpStart", 0.05f, "Add");
			val10.AddVanillaParam("Player.DeervilCurse", 0.003f, "Add");
			val10.AddVanillaParam("Shop.ChanceGunWontBreak", 0.05f, "Add");
			val10.AddVanillaParam("Player.HeartBeetOnDamageChance", 0.05f, "Add");
			val10.AddVanillaParam("Farm.FallPumpkinDropChance", 0.05f, "Add");
			val10.AddVanillaParam("Farm.FallPumpkinDropChance_classic", 0.05f, "Add");
			val10.AddVanillaParam("Farm.SummerSunflowerDropChance", 0.05f, "Add");
			val10.AddVanillaParam("Farm.SummerSunflowerDropChance_classic", 0.05f, "Add");
			val10.AddVanillaParam("Player.TillMoistSoilChance", 0.05f, "Add");
			val10.AddVanillaParam("Player.LootMagnetDist", 0.5f, "Add");
			val10.AddUpgradeToLootPool("GoldenChest");
			Upgrade val11 = new Upgrade("Foraging Guide", "Learn to prepare mushroomes to boost their effects.", "ForagingGuide.png", Assembly.GetExecutingAssembly());
			val11.AddVanillaParam("Player.MushBerserkTime", 5f, "Add");
			val11.AddVanillaParam("Player.MushFertTime", 5f, "Add");
			val11.AddVanillaParam("Player.MushSpeedTime", 5f, "Add");
			val11.AddVanillaParam("Player.MushDayTimeAdd", 10f, "Add");
			val11.AddCustomParam((Action)ForagingGuideState.EnableForagingGuide, (Action)ForagingGuideState.Cleanup);
			val11.AddUpgradeToLootPool("Main");
			Upgrade val12 = new Upgrade("U.C.A.V.", "+1 Drone\nExtra sight range.", "UCAV.png", Assembly.GetExecutingAssembly());
			Dictionary<string, int> dictionary4 = new Dictionary<string, int> { { "drone", 1 } };
			val12.AddFriends(dictionary4);
			val12.AddVanillaParam("Player.LookDistMult", 1.4f, "Multiply");
			val12.AddUpgradeToLootPool("Main");
			Upgrade val13 = new Upgrade("Defensive Kit", "+1 Turret\n+1 Scarecrow\n+1 Drone", "DefensiveKit.png", Assembly.GetExecutingAssembly());
			Dictionary<string, int> dictionary5 = new Dictionary<string, int>();
			Dictionary<string, int> dictionary6 = new Dictionary<string, int>();
			dictionary5.Add("drone", 1);
			dictionary6.Add("scarecrow", 1);
			dictionary6.Add("turret", 1);
			val13.AddFriends(dictionary5);
			val13.AddTurrets(dictionary6);
			Upgrade val14 = new Upgrade("Membership Card", "An exclusive membership that gives more stats to guns in the shop.", "MembershipCard.png", Assembly.GetExecutingAssembly());
			val14.AddCustomParam((Action)MembershipCardState.EnableMembershipCard, (Action)MembershipCardState.Cleanup);
			val14.AddUpgradeToLootPool("Main");
			Upgrade val15 = new Upgrade("Lost Alien", "He's just a little guy!\nWhon't you take him home?", "LostAlien.png", Assembly.GetExecutingAssembly());
			Dictionary<string, int> dictionary7 = new Dictionary<string, int> { { "alienpet", 1 } };
			val15.AddFriends(dictionary7);
			val15.AddUpgradeToLootPool("GoldenChest");
			Upgrade val16 = new Upgrade("Wet Hoes", "All that hard work is starting to make you drip sweat.", "WetHoes.png", Assembly.GetExecutingAssembly());
			val16.AddVanillaParam("Player.TillMoistSoilChance", 0.5f, "Add");
			val16.AddUpgradeToLootPool("Main");
			Upgrade val17 = new Upgrade("Skeleton Car Keys", "Car camps always pay out.\nDid you know they refresh daily?", "SkeletonCarKeys.png", Assembly.GetExecutingAssembly());
			val17.AddCustomParam((Action)SkeletonCarKeysState.EnableSkeletonCarKeys, (Action)SkeletonCarKeysState.Cleanup);
			val17.AddUpgradeToLootPool("GoldenChest");
			Upgrade val18 = new Upgrade("Mind's Eye", "See enemy health.\n+1 Fighting Stat", "MindsEye.png", Assembly.GetExecutingAssembly());
			val18.AddCustomParam((Action)MindsEyeState.EnableMindsEye, (Action)MindsEyeState.Cleanup);
			val18.AddLoot("FightStat", 1);
			val18.AddUpgradeToLootPool("Main");
			Upgrade val19 = new Upgrade("Hive Mind", "The swarm consumes your animals, but bees now water crops and flower weeds.\n+1 Bee.", "HiveMind.png", Assembly.GetExecutingAssembly());
			val19.AddCustomParam((Action)HiveMindState.EnableHiveMind, (Action)HiveMindState.Cleanup);
			val19.AddVanillaParam("Farm.BeeWatering", true);
			val19.AddVanillaParam("Farm.BeesFlowers", true);
			Dictionary<string, int> dictionary8 = new Dictionary<string, int> { { "bee", 1 } };
			val19.AddFriends(dictionary8);
			val19.AddUpgradeToLootPool("DeerShop");
			Upgrade val20 = new Upgrade("Super Greens", "It's green flavor.\n+1 Farming Stat and +10% Luck.", "SuperGreens.png", Assembly.GetExecutingAssembly());
			val20.AddLoot("FarmStat", 1);
			val20.AddVanillaParam("Player.Luck", 0.1f, "Add");
			val20.AddUpgradeToLootPool("Main");
			Upgrade val21 = new Upgrade("Solar Panel", "Tractors charge faster during the day.", "SolarPanel.png", Assembly.GetExecutingAssembly());
			val21.AddCustomParam((Action)SolarPanelState.EnableSolarPanel, (Action)SolarPanelState.Cleanup);
			val21.AddUpgradeToLootPool("Main");
			Upgrade val22 = new Upgrade("Blood Money", "Pain = Gain", "BloodMoney.png", Assembly.GetExecutingAssembly());
			val22.AddCustomParam((Action)BloodMoneyState.EnableBloodMoney, (Action)BloodMoneyState.Cleanup);
			val22.AddUpgradeToLootPool("Main");
			Upgrade val23 = new Upgrade("Turret Timers", "Turrets and scarecrows give time at the start of day.", "TurretTimers.png", Assembly.GetExecutingAssembly());
			val23.AddCustomParam((Action)TurretTimersState.EnableTurretTimers, (Action)TurretTimersState.Cleanup);
			val23.AddUpgradeToLootPool("Main");
			Upgrade val24 = new Upgrade("Pretty Plumage", "Fancy feathers gets you a discount on flirting.", "PrettyPlumage.png", Assembly.GetExecutingAssembly());
			val24.AddCustomParam((Action)PrettyPlumageState.EnablePrettyPlumage, (Action)PrettyPlumageState.Cleanup);
			val24.AddUpgradeToLootPool("CrowOregano");
			Upgrade val25 = new Upgrade("Maypole", "Increase scarecrow ability radius, frequency, and knockback.", "Maypole.png", Assembly.GetExecutingAssembly());
			val25.AddVanillaParam("Player.ScarecrowPushRange", 1.25f, "Multiply");
			val25.AddVanillaParam("Player.ScarecrowKnockback", 1.25f, "Multiply");
			val25.AddVanillaParam("Player.ScarecrowRate", 0.8f, "Multiply");
			val25.AddUpgradeToLootPool("Main");
			Upgrade val26 = new Upgrade("Crocodile Tears", "+2 max health. You cry about being low health more.", "CrocodileTears.png", Assembly.GetExecutingAssembly());
			val26.AddCustomParam((Action)CrocodileTearsState.EnableCrocodileTears, (Action)CrocodileTearsState.Cleanup);
			val26.AddUpgradeToLootPool("Main");
			Upgrade val27 = new Upgrade("Pepper Bell", "Become energized and clear the screen of bullets when night waves start.", "PepperBell.png", Assembly.GetExecutingAssembly());
			val27.AddCustomParam((Action)PepperBellState.EnablePepperBell, (Action)PepperBellState.Cleanup);
			val27.AddUpgradeToLootPool("Main");
			Upgrade val28 = new Upgrade("Pollinator Pair", "Bees spawn butterfly missiles when pollinating.", "PollinatorPair.png", Assembly.GetExecutingAssembly());
			val28.AddCustomParam((Action)PollinatorPairState.EnablePollinatorPair, (Action)PollinatorPairState.Cleanup);
			val28.AddUpgradeToLootPool("Main");
			Upgrade val29 = new Upgrade("Scarecrow Hat", "Getting hit damages and knocks back enemies and deletes nearby bullets.", "ScarecrowHat.png", Assembly.GetExecutingAssembly());
			val29.AddCustomParam((Action)ScarecrowHatState.EnableScarecrowHat, (Action)ScarecrowHatState.Cleanup);
			val29.AddUpgradeToLootPool("Main");
			Upgrade val30 = new Upgrade("Hot Salsa", "Shooting enemies has a chance to ignite them.", "HotSalsa.png", Assembly.GetExecutingAssembly());
			val30.AddCustomParam((Action)HotSalsaState.EnableHotSalsa, (Action)HotSalsaState.Cleanup);
			val30.AddUpgradeToLootPool("GoldenChest");
			Upgrade val31 = new Upgrade("Pressure Cooker", "Deal more damage when at low health.", "PressureCooker.png", Assembly.GetExecutingAssembly());
			val31.AddCustomParam((Action)PressureCookerState.EnablePressureCooker, (Action)PressureCookerState.Cleanup);
			val31.AddUpgradeToLootPool("Main");
			Upgrade val32 = new Upgrade("Whack-A-Mole", "Hit moles to make them drop goodies!", "WhackAMole.png", Assembly.GetExecutingAssembly());
			val32.AddCustomParam((Action)WhackAMoleState.EnableWhackAMole, (Action)WhackAMoleState.Cleanup);
			val32.AddUpgradeToLootPool("Main");
			Upgrade val33 = new Upgrade("Pact of the Cow God", "Sacrifice your watering can to give your cows claws, making them move faster and tear apart the weeds and soil beneath.\n+1 Grass-Fed Cow.", "pactOfTheCowGod.png", Assembly.GetExecutingAssembly());
			Dictionary<string, int> dictionary9 = new Dictionary<string, int> { { "cow2", 1 } };
			val33.AddFriends(dictionary9);
			val33.AddCustomParam((Action)PactOfTheCowGodState.EnablePactOfTheCowGod, (Action)PactOfTheCowGodState.Cleanup);
			val33.AddUpgradeToLootPool("DeerShop");
			Upgrade val34 = new Upgrade("Pressure Washer", "Watering crops has a chance to break neighboring crust.", "PressureWasher.png", Assembly.GetExecutingAssembly());
			val34.AddCustomParam((Action)PressureWasherState.EnablePressureWasher, (Action)PressureWasherState.Cleanup);
			val34.AddUpgradeToLootPool("GoldenChest");
			Upgrade val35 = new Upgrade("Migration Season", "Beeson will move across your farm.", "MigrationSeason.png", Assembly.GetExecutingAssembly());
			val35.AddCustomParam((Action)MigrationSeasonState.EnableMigrationSeason, (Action)MigrationSeasonState.Cleanup);
			Upgrade val36 = new Upgrade("Golden Pickaxe", "Doubled pickaxe gain.", "GoldenPickaxe.png", Assembly.GetExecutingAssembly());
			val36.AddCustomParam((Action)GoldenPickaxeState.EnableGoldenPickaxe, (Action)GoldenPickaxeState.Cleanup);
			val36.AddUpgradeToLootPool("Main");
			Upgrade val37 = new Upgrade("New Mutation", "Something different for everyone...", "NewMutationItem.png", Assembly.GetExecutingAssembly());
			val37.AddCustomParam((Action)NewMutationItemState.EnableNewMutationItem, (Action)NewMutationItemState.Cleanup);
			val37.AddUpgradeToLootPool("GoldenChest");
		}
	}
	public static class ElephantTrunkState
	{
		public static bool DoElephantTrunk;

		private static bool refreshedWater;

		public static void EnableElephantTrunk()
		{
			DoElephantTrunk = true;
			if (!refreshedWater)
			{
				IntModel water = SingletonScriptableObject<GameData>.I.Water;
				water.Set(water.Get());
				refreshedWater = true;
			}
		}

		public static void Cleanup()
		{
			DoElephantTrunk = false;
			refreshedWater = false;
		}
	}
	public static class LightningChainState
	{
		public static bool DoLightningChain;

		public static void EnableLightningChain()
		{
			DoLightningChain = true;
		}

		public static void Cleanup()
		{
			DoLightningChain = false;
		}

		public static void ChainLinkZap()
		{
			//IL_000d: 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)
			PlayerComp i = SingletonSceneScope<PlayerComp>.I;
			WaterZap.DoZap(Vector2.op_Implicit(i.Anchors.Center), 10f, 2);
		}
	}
	public static class ForagingGuideState
	{
		public static bool DoForagingGuide;

		public static void EnableForagingGuide()
		{
			DoForagingGuide = true;
		}

		public static void Cleanup()
		{
			DoForagingGuide = false;
		}
	}
	public static class MembershipCardState
	{
		public static bool DoMembershipCard;

		public static void EnableMembershipCard()
		{
			DoMembershipCard = true;
		}

		public static void Cleanup()
		{
			DoMembershipCard = false;
		}
	}
	public static class SkeletonCarKeysState
	{
		public static bool DoSkeletonCarKeys;

		public static void EnableSkeletonCarKeys()
		{
			DoSkeletonCarKeys = true;
		}

		public static void Cleanup()
		{
			DoSkeletonCarKeys = false;
		}
	}
	public static class MindsEyeState
	{
		public static void EnableMindsEye()
		{
			DebugShowEnemyHealthNumbers.ShowHealthNumers = true;
		}

		public static void Cleanup()
		{
			DebugShowEnemyHealthNumbers.ShowHealthNumers = false;
		}
	}
	public static class HiveMindState
	{
		public static bool DoHiveMind;

		private static bool ReplacedFriends;

		public static void EnableHiveMind()
		{
			//IL_0144: Unknown result type (might be due to invalid IL or missing references)
			//IL_014b: Expected O, but got Unknown
			DoHiveMind = true;
			if (ReplacedFriends || !DoHiveMind)
			{
				return;
			}
			FriendsCollection friends = SingletonScriptableObject<GameData>.I.Friends;
			List<FriendModel> all = friends.GetAll();
			HashSet<string> hashSet = new HashSet<string> { "pig", "pig2", "cow", "cow2", "chickenweed", "chickenweed2" };
			FriendDef val = FriendDefLoader.Get("bee");
			if ((Object)(object)val == (Object)null)
			{
				Debug.LogError((object)"[HiveMind] Could not find 'bee' FriendDef.");
				return;
			}
			List<FriendModel> list = new List<FriendModel>();
			foreach (FriendModel item in all)
			{
				if (!((Object)(object)item?.Def == (Object)null) && hashSet.Contains(((Object)item.Def).name.ToLower()))
				{
					list.Add(item);
				}
			}
			foreach (FriendModel item2 in list)
			{
				friends.Remove(item2);
				FriendModel val2 = new FriendModel(val);
				friends.Add(val2);
			}
			ReplacedFriends = true;
		}

		public static void Cleanup()
		{
			DoHiveMind = false;
			ReplacedFriends = false;
		}
	}
	public static class SolarPanelState
	{
		public static bool DoSolarPanel;

		public static bool buffApplied;

		public const float solarPanelMultiplier = 0.85f;

		public static void EnableSolarPanel()
		{
			DoSolarPanel = true;
			SingletonSceneScopeAutoLoad<DayNightSystem>.I.onAnyStateEntered += SolarPanelBuff;
			SolarPanelBuff();
		}

		public static void SolarPanelBuff()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Invalid comparison between Unknown and I4
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Invalid comparison between Unknown and I4
			if (DoSolarPanel && (int)SingletonSceneScopeAutoLoad<DayNightSystem>.I.GetState() != 4 && !buffApplied)
			{
				foreach (ActionItemModel item in SingletonScriptableObject<GameData>.I.ActionItems.GetCollection())
				{
					PlayerActionDef playerActionDef = item.GetPlayerActionDef();
					playerActionDef.ReloadTime *= 0.85f;
					buffApplied = true;
				}
				return;
			}
			if (!DoSolarPanel || (int)SingletonSceneScopeAutoLoad<DayNightSystem>.I.GetState() != 4 || !buffApplied)
			{
				return;
			}
			foreach (ActionItemModel item2 in SingletonScriptableObject<GameData>.I.ActionItems.GetCollection())
			{
				PlayerActionDef playerActionDef2 = item2.GetPlayerActionDef();
				playerActionDef2.ReloadTime /= 0.85f;
				buffApplied = false;
			}
		}

		public static void Cleanup()
		{
			DoSolarPanel = false;
			SingletonSceneScopeAutoLoad<DayNightSystem>.I.onAnyStateEntered -= SolarPanelBuff;
			buffApplied = false;
		}
	}
	public static class BloodMoneyState
	{
		public static bool DoBloodMoney = false;

		private static readonly Vector2 CashewDropRange = new Vector2(1f, 2f);

		private const float DropWaitDur = 0.025f;

		private static WaitForSeconds wait = new WaitForSeconds(0.025f);

		private static readonly int CashewAmount = 25;

		public static void EnableBloodMoney()
		{
			DoBloodMoney = true;
		}

		public static void Cleanup()
		{
			DoBloodMoney = false;
		}

		public static IEnumerator DropCashews()
		{
			PlayerComp playerComp = SingletonSceneScope<PlayerComp>.I;
			for (int i = 0; i < CashewAmount; i++)
			{
				LootItemFuncs.DropAutoPickup((ILootDef)(object)SingletonScriptableObject<ConfigGame>.I.CommonLoot.Cashew, 1, Vector2.op_Implicit(playerComp.Anchors.Center), VectorExtensions.RandomRange(CashewDropRange), true);
				yield return wait;
			}
		}
	}
	public static class TurretTimersState
	{
		public static bool DoTurretTimers;

		public const int turretSeconds = 4;

		private static bool flag;

		public static void EnableTurretTimers()
		{
			DoTurretTimers = true;
			if (!flag)
			{
				SingletonSceneScopeAutoLoad<DayNightSystem>.I.onDayBegin += ActivateTurretTimers;
				flag = true;
			}
		}

		public static void Cleanup()
		{
			DoTurretTimers = false;
			SingletonSceneScopeAutoLoad<DayNightSystem>.I.onDayBegin -= ActivateTurretTimers;
			flag = false;
		}

		public static void ActivateTurretTimers()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Invalid comparison between Unknown and I4
			if ((int)SingletonSceneScopeAutoLoad<DayNightSystem>.I.GetState() == 2 && DoTurretTimers)
			{
				GiveTime();
			}
		}

		private static void GiveTime()
		{
			//IL_016b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0171: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
			TurretCollection turrets = SingletonScriptableObject<GameData>.I.Turrets;
			float num = turrets.GetCount();
			if (LiveParams.Farm.CowTurrets || LiveParams.Farm.PigTurrets)
			{
				FriendsCollection friends = SingletonScriptableObject<GameData>.I.Friends;
				List<FriendModel> all = friends.GetAll();
				if (LiveParams.Farm.CowTurrets)
				{
					foreach (FriendModel item in all)
					{
						string name = ((Object)item.Def).name;
						if (name == "Cow" || name == "Cow2")
						{
							num += 0.5f;
						}
					}
				}
				if (LiveParams.Farm.PigTurrets)
				{
					foreach (FriendModel item2 in all)
					{
						string name2 = ((Object)item2.Def).name;
						if (name2 == "Pig" || name2 == "Pig2")
						{
							num += 0.5f;
						}
					}
				}
			}
			DayNightUtils.AddTime(4f * num);
			InGameText.FloatUpFromPlayer($"+{4f * num} seconds", false, default(Vector2));
			SingletonScriptableObject<ConfigSound>.I.TimeAdded.PlayOneShot(((Component)SingletonSceneScope<SoundListener>.I).transform);
			Fx.Play(SingletonScriptableObject<ConfigArt>.I.TimeFx, Vector2.op_Implicit(SingletonSceneScope<PlayerComp>.I.Anchors.Head));
		}
	}
	public static class PrettyPlumageState
	{
		public static bool DoPrettyPlumage;

		private static bool roseCostsModified;

		public static void EnablePrettyPlumage()
		{
			DoPrettyPlumage = true;
			List<int> roseCostsPerLevel = SingletonScriptableObject<ConfigGame>.I.SpouseConfig.RoseCostsPerLevel;
			if (!roseCostsModified)
			{
				for (int i = 0; i < roseCostsPerLevel.Count; i++)
				{
					roseCostsPerLevel[i] = Mathf.Max(0, roseCostsPerLevel[i] - 1);
				}
				roseCostsModified = true;
			}
		}

		public static void Cleanup()
		{
			DoPrettyPlumage = false;
			List<int> roseCostsPerLevel = SingletonScriptableObject<ConfigGame>.I.SpouseConfig.RoseCostsPerLevel;
			if (roseCostsModified)
			{
				for (int i = 0; i < roseCostsPerLevel.Count; i++)
				{
					roseCostsPerLevel[i]++;
				}
				roseCostsModified = false;
			}
		}
	}
	public static class ContrabandContractState
	{
		private static bool flag = false;

		private static string[] itemText = new string[2] { "Mode:\t (Mode)", "Item:\t (Banned Item)" };

		public static void EnableContrabandContract()
		{
			FarmParams farm = LiveParams.Farm;
			if (!ClassicModeUtils.InRunIsClassicMode())
			{
				farm.NoMergeFertReq = true;
				if (!flag)
				{
					itemText = new string[2] { "Game Mode:\t Normal", "Item:\t Participation Trophy" };
					((MonoBehaviour)SingletonSceneScope<PlayerComp>.I).StartCoroutine(DisplayText());
					flag = true;
				}
			}
			else
			{
				farm.AddTimeOnSow = 0.1f;
				if (!flag)
				{
					itemText = new string[2] { "Game Mode:\t Classic", "Item:\t Chronoseeds" };
					((MonoBehaviour)SingletonSceneScope<PlayerComp>.I).StartCoroutine(DisplayText());
					flag = true;
				}
			}
		}

		public static void Cleanup()
		{
			flag = false;
			itemText = new string[2] { "Mode:\t(Mode)", "Item:\t(Banned Item)" };
		}

		private static IEnumerator DisplayText()
		{
			for (int i = 0; i < itemText.Length; i++)
			{
				InGameText.FloatUpNumberOnly(itemText[i], Vector2.op_Implicit(SingletonSceneScope<PlayerComp>.I.Anchors.Head), false, 5f);
				yield return (object)new WaitForSeconds(1.5f);
			}
		}
	}
	public static class CrocodileTearsState
	{
		public static bool DoCrocodileTears;

		private static bool gaveHealth;

		public static void EnableCrocodileTears()
		{
			//IL_0061: 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_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			DoCrocodileTears = true;
			SingletonScriptableObject<ConfigGame>.I.Player.LowHealthPercent = 0.3f;
			if (!gaveHealth)
			{
				SingletonScriptableObject<GameData>.I.PlayerMaxHealth.Set(SingletonScriptableObject<GameData>.I.PlayerMaxHealth.Get() + 2);
				if (LowHealthUtils.IsPlayerLowHealth())
				{
					InGameText.FloatUp("Low Health", Vector2.op_Implicit(SingletonSceneScope<PlayerComp>.I.Anchors.Head + new Vector3(0f, 0.5f)), false, 2f);
				}
				gaveHealth = true;
			}
		}

		public static void Cleanup()
		{
			DoCrocodileTears = false;
			gaveHealth = false;
			SingletonScriptableObject<ConfigGame>.I.Player.LowHealthPercent = 0.2f;
		}
	}
	public static class PepperBellState
	{
		public static bool DoPepperBell;

		public static void EnablePepperBell()
		{
			DoPepperBell = true;
		}

		public static void Cleanup()
		{
			DoPepperBell = false;
		}
	}
	public static class PollinatorPairState
	{
		public static bool DoPollinatorPair;

		public static GameObject ButterflyPrefab;

		public static void EnablePollinatorPair()
		{
			DoPollinatorPair = true;
		}

		public static void Cleanup()
		{
			DoPollinatorPair = false;
			ButterflyPrefab = null;
		}
	}
	public static class ScarecrowHatState
	{
		public static bool DoScarecrowHat;

		private static SoundItem scarecrowHatSound;

		private static int _fertDropped;

		private const int maxFertBeforeThrottle = 20;

		public static void EnableScarecrowHat()
		{
			DoScarecrowHat = true;
			InitializeSound();
		}

		public static void Cleanup()
		{
			DoScarecrowHat = false;
			scarecrowHatSound = null;
		}

		public static void InitializeSound()
		{
			if (scarecrowHatSound == null)
			{
				TurretDefLoader i = SingletonScriptableObject<TurretDefLoader>.I;
				TurretDef val = i.Defs.Find((TurretDef def) => ((Object)def).name == "TurretScarecrowA");
				scarecrowHatSound = val.PlopSound;
			}
		}

		public static void DoKnockBackOnPlayer()
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_0157: Unknown result type (might be due to invalid IL or missing references)
			//IL_015c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			PlayerComp i = SingletonSceneScope<PlayerComp>.I;
			PlayerParams player = LiveParams.Player;
			IEnumerable<Enemy> allEnemiesInRadius = AiSearches.GetAllEnemiesInRadius(Vector2.op_Implicit(i.Anchors.Center), 2f * player.ScarecrowPushRange);
			foreach (Enemy item in allEnemiesInRadius)
			{
				item.DoKnockback(player.ScarecrowKnockback, Vector2.op_Implicit(item.Center - i.Anchors.Center));
				if (player.ScarecrowDamage > 0)
				{
					item.DoDamage(player.ScarecrowDamage, (DamageSourceType)0, (DamageSource)4);
				}
				if (player.ScarecrowFertDropOnHit > 0 && TimeManager.GetFarmTimeSinceLevelLoad() - item.__fertDropScareCrow > player.InvincibilityAfterHitDur)
				{
					int num = player.ScarecrowFertDropOnHit;
					if (_fertDropped > 20)
					{
						num = Rando.Range(0, 3);
					}
					for (int j = 0; j < num; j++)
					{
						LootItemFuncs.DropFert(Vector2.op_Implicit(item.Center), 1f);
					}
					_fertDropped += num;
					item.__fertDropScareCrow = TimeManager.GetFarmTimeSinceLevelLoad();
				}
			}
			if (scarecrowHatSound != null)
			{
				scarecrowHatSound.PlayOneShot(Vector2.op_Implicit(i.Anchors.Center));
			}
		}
	}
	public static class HotSalsaState
	{
		public static bool DoHotSalsa;

		public static void EnableHotSalsa()
		{
			DoHotSalsa = true;
		}

		public static void Cleanup()
		{
			DoHotSalsa = false;
		}
	}
	public static class PressureCookerState
	{
		public static bool DoPressureCooker;

		private static bool flag;

		public static void EnablePressureCooker()
		{
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			DoPressureCooker = true;
			if (LowHealthUtils.IsPlayerLowHealth() && !flag)
			{
				InGameText.FloatUp("Low Health", Vector2.op_Implicit(SingletonSceneScope<PlayerComp>.I.Anchors.Head + new Vector3(0f, 0.5f)), false, 2f);
				flag = true;
			}
		}

		public static void Cleanup()
		{
			DoPressureCooker = false;
			flag = false;
		}
	}
	public static class WhackAMoleState
	{
		public static bool DoWhackAMole;

		public static void EnableWhackAMole()
		{
			DoWhackAMole = true;
		}

		public static void Cleanup()
		{
			DoWhackAMole = false;
		}
	}
	public static class PactOfTheCowGodState
	{
		public static bool DoPactOfTheCowGod;

		private static bool refreshedWater;

		public static void EnablePactOfTheCowGod()
		{
			FarmParams farm = LiveParams.Farm;
			DoPactOfTheCowGod = true;
			farm.CowSpeedPer += 0.666f;
			if (!refreshedWater)
			{
				IntModel water = SingletonScriptableObject<GameData>.I.Water;
				water.Set(PlayerUtils.GetWaterCapacity());
				refreshedWater = true;
			}
		}

		public static void Cleanup()
		{
			DoPactOfTheCowGod = false;
		}
	}
	public static class PressureWasherState
	{
		public static bool DoPressureWasher;

		public const float soilBreakChance = 0.03f;

		public static GameObject BreakSoilFx;

		public static void EnablePressureWasher()
		{
			DoPressureWasher = true;
			InitializeFx();
		}

		public static void Cleanup()
		{
			DoPressureWasher = false;
		}

		public static void InitializeFx()
		{
			if (!((Object)(object)BreakSoilFx != (Object)null))
			{
				OneUseItemController i = SingletonSceneScope<OneUseItemController>.I;
				BreakSoilFx = i.ExpandFarmTileFx;
			}
		}
	}
	public static class MigrationSeasonState
	{
		public static GameObject TundraMigrationZone;

		public static GameObject JungleMigrationZone;

		public static bool DoMigrationSeason;

		private static int TundraBeesonGroupCount;

		private static int JungleBeesonGroupCount;

		public static void EnableMigrationSeason()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			DoMigrationSeason = true;
			Debug.Log((object)$"Current Scene: {GameStateManager.GetState()}");
			AddMigratingBeeson((ZonesEnum)98);
			AddMigratingBeeson((ZonesEnum)99);
		}

		public static void AddMigratingBeeson(ZonesEnum spawnZone)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Invalid comparison between Unknown and I4
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_013e: Unknown result type (might be due to invalid IL or missing references)
			//IL_014a: Unknown result type (might be due to invalid IL or missing references)
			//IL_014f: Unknown result type (might be due to invalid IL or missing references)
			//IL_016a: Unknown result type (might be due to invalid IL or missing references)
			//IL_016d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0183: Unknown result type (might be due to invalid IL or missing references)
			//IL_0197: Unknown result type (might be due to invalid IL or missing references)
			if ((int)GameStateManager.GetState() != 2)
			{
				return;
			}
			bool flag = default(bool);
			while (TundraBeesonGroupCount < 2 && DoMigrationSeason)
			{
				TundraBeesonGroupCount++;
				MvaWrapperModel mva = Mvw.GetMva((MvwTypes)2);
				MvaAgentDef3 val = MvaAgentDefLoader3.Get("BeesonASwarmMva");
				Vector2 val2 = ZoneUtils.TryGetRandomPointNotOnScreen(SingletonSceneScopeAutoLoad<ZoneSystem>.I.Get(spawnZone), ref flag);
				if (flag)
				{
					MvaAgentModel3 mvaAgentModel2 = mva.Add(val, val2, spawnZone);
					mvaAgentModel2.SetOriginalPosition(val2);
					Debug.Log((object)$"Created Tundra Beeson Group: {mvaAgentModel2} at {val2}");
					mvaAgentModel2.OnRemoved += delegate
					{
						//IL_0007: Unknown result type (might be due to invalid IL or missing references)
						OnBeesonKill("tundra", spawnZone);
					};
					SingletonSceneScopeAutoLoad<DayNightSystem>.I.onDawnBegin += delegate
					{
						RemoveMigratingBeeson(mvaAgentModel2);
					};
				}
			}
			bool flag2 = default(bool);
			while (JungleBeesonGroupCount < 2 && DoMigrationSeason)
			{
				JungleBeesonGroupCount++;
				MvaWrapperModel mva2 = Mvw.GetMva((MvwTypes)2);
				MvaAgentDef3 val3 = MvaAgentDefLoader3.Get("BeesonASwarmMva");
				Vector2 val4 = ZoneUtils.TryGetRandomPointNotOnScreen(SingletonSceneScopeAutoLoad<ZoneSystem>.I.Get(spawnZone), ref flag2);
				if (flag2)
				{
					MvaAgentModel3 mvaAgentModel = mva2.Add(val3, val4, spawnZone);
					mvaAgentModel.SetOriginalPosition(val4);
					Debug.Log((object)$"Created Jungle Beeson Group: {mvaAgentModel} at {val4}");
					mvaAgentModel.OnRemoved += delegate
					{
						//IL_0007: Unknown result type (might be due to invalid IL or missing references)
						OnBeesonKill("jungle", spawnZone);
					};
					SingletonSceneScopeAutoLoad<DayNightSystem>.I.onDawnBegin += delegate
					{
						RemoveMigratingBeeson(mvaAgentModel);
					};
				}
			}
		}

		public static void OnBeesonKill(string groupType, ZonesEnum spawnZone)
		{
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			if (groupType == "tundra")
			{
				TundraBeesonGroupCount--;
				AddMigratingBeeson(spawnZone);
			}
			else if (groupType == "jungle")
			{
				JungleBeesonGroupCount--;
				AddMigratingBeeson(spawnZone);
			}
		}

		public static void RemoveMigratingBeeson(MvaAgentModel3 mvaAgentModel3)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Invalid comparison between Unknown and I4
			if ((int)GameStateManager.GetCurrentScene() == 1)
			{
				Debug.Log((object)$"MigrationSeason: {mvaAgentModel3} removed self.");
				mvaAgentModel3.DoRemove();
			}
		}

		public static void Cleanup()
		{
			TundraMigrationZone = null;
			JungleMigrationZone = null;
			DoMigrationSeason = false;
			JungleBeesonGroupCount = 0;
			TundraBeesonGroupCount = 0;
		}
	}
	public static class GoldenPickaxeState
	{
		public static bool DoGoldenPickaxe = false;

		private static bool subscribed = false;

		private static bool isDoubling = true;

		public static void EnableGoldenPickaxe()
		{
			DoGoldenPickaxe = true;
			if (!subscribed)
			{
				subscribed = true;
				IntModel pickaxe = SingletonScriptableObject<GameData>.I.Pickaxe;
				pickaxe.OnChange += PickaxeOnOnChange;
			}
		}

		public static void Cleanup()
		{
			subscribed = false;
			DoGoldenPickaxe = false;
			isDoubling = true;
		}

		private static void PickaxeOnOnChange(object o, IntModelEventArgs intModelEventArgs)
		{
			if (DoGoldenPickaxe && intModelEventArgs.Delta > 0 && isDoubling)
			{
				IntModel pickaxe = SingletonScriptableObject<GameData>.I.Pickaxe;
				isDoubling = false;
				pickaxe.Add(intModelEventArgs.Delta);
				isDoubling = true;
			}
		}
	}
	public static class NewMutationItemState
	{
		public static bool DoNewMutationItem = false;

		public static string currentCharacter = SingletonSceneScopeAutoLoad<ProfileModelController>.I.Get().SelectedCharacter;

		public const float lavenderNM_BeeSpeedMult = 2f;

		public static GameObject lavenderNM_PickupFx = null;

		public const float lavenderNM_Chance = 0.2f;

		public static int dandelionNM_KillCount = 0;

		public const int dandelionNM_KillReq = 15;

		public const float robustaNM_Mult = 0.7501876f;

		public static float crowNM_LuckAdd = 0f;

		public static int crowNM_SeedCount = 0;

		public const float crowNM_DecayRate = 0.1f;

		private static bool flag = false;

		private static string[] characterText = new string[2] { "Character:\t Sub-Item Name", "Effect" };

		public static void EnableNewMutationItem()
		{
			//IL_020d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0212: Unknown result type (might be due to invalid IL or missing references)
			//IL_0216: Unknown result type (might be due to invalid IL or missing references)
			//IL_0220: Unknown result type (might be due to invalid IL or missing references)
			//IL_0225: Unknown result type (might be due to invalid IL or missing references)
			//IL_022d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0232: Unknown result type (might be due to invalid IL or missing references)
			//IL_0237: Unknown result type (might be due to invalid IL or missing references)
			//IL_0239: Unknown result type (might be due to invalid IL or missing references)
			PlayerParams player = LiveParams.Player;
			GameStateParams gameState = LiveParams.GameState;
			PlayerComp i = SingletonSceneScope<PlayerComp>.I;
			DoNewMutationItem = true;
			currentCharacter = SingletonSceneScopeAutoLoad<ProfileModelController>.I.Get().SelectedCharacter;
			switch (currentCharacter)
			{
			case "Lavender":
				if (!flag)
				{
					characterText = new string[2] { "Lavender:\t Queen Bee", "Faster bees +\nBees collect seeds from their crops!" };
					((MonoBehaviour)i).StartCoroutine(DisplayText());
					flag = true;
				}
				InitializeBeeQueenPickupFx();
				break;
			case "Rye":
				if (!flag)
				{
					characterText = new string[2] { "Rye:\tIllegal Gun Parts", "Better, half priced guns +\nShotgun turrets!" };
					((MonoBehaviour)i).StartCoroutine(DisplayText());
					flag = true;
				}
				break;
			case "Robusta":
				if (!flag)
				{
					characterText = new string[2] { "Robusta:\t Double Espresso", "More caffeine,\nLess problems!" };
					((MonoBehaviour)i).StartCoroutine(DisplayText());
					flag = true;
				}
				player.EnemyBulletSpeedMultOneAdded -= 0.7501876f;
				gameState.DayProgressMultTundra *= 0.7501876f;
				gameState.DayProgressMultPlains *= 0.7501876f;
				gameState.DayProgressMultJungle *= 0.7501876f;
				gameState.DayProgressMultDesert *= 0.7501876f;
				gameState.DayProgressMultFarm *= 0.7501876f;
				break;
			case "Dandelions":
				if (!flag)
				{
					characterText = new string[2] { "Dandelion:\t Seed Spitters", "Puffs activate twice +\nKill bundits for puffs!" };
					((MonoBehaviour)i).StartCoroutine(DisplayText());
					flag = true;
					Vector2 insideUnitCircle = Random.insideUnitCircle;
					Vector2 val = ((Vector2)(ref insideUnitCircle)).normalized * 2f;
					DandelionsUtils.SpawnCollectible(Vector2.op_Implicit(i.Anchors.Center) + val);
				}
				break;
			case "Botanist":
				if (!flag)
				{
					characterText = new string[2] { "Thyme:\tUnstable Thymeline", "50/ 50 chance to dodge hits +\nNukes on hit!" };
					((MonoBehaviour)i).StartCoroutine(DisplayText());
					flag = true;
				}
				player.BarkSkin += 0.5f;
				break;
			case "Crow":
				if (!flag)
				{
					characterText = new string[2] { "Oregacrow:\t Shiny Finder", "Pecking up seeds gives luck +\nSeeds will drop goodies!" };
					((MonoBehaviour)i).StartCoroutine(DisplayText());
					flag = true;
				}
				player.Luck += crowNM_LuckAdd;
				break;
			default:
				if (!flag)
				{
					characterText = new string[2] { "Wait...", "Who are YOU?!" };
					((MonoBehaviour)i).StartCoroutine(DisplayText());
					flag = true;
				}
				break;
			}
		}

		public static void Cleanup()
		{
			DoNewMutationItem = false;
			flag = false;
			currentCharacter = null;
			characterText = new string[2] { "Character:\t Sub-Item Name", "Effect" };
			lavenderNM_PickupFx = null;
			dandelionNM_KillCount = 0;
			crowNM_SeedCount = 0;
			crowNM_LuckAdd = 0f;
		}

		private static IEnumerator DisplayText()
		{
			int textTime = 6;
			PlayerComp playerComp = SingletonSceneScope<PlayerComp>.I;
			for (int i = 0; i < characterText.Length; i++)
			{
				if (i == 0)
				{
					textTime = 5;
				}
				if (i == 1)
				{
					textTime = 6;
				}
				InGameText.FloatUpNumberOnly(characterText[i], Vector2.op_Implicit(playerComp.Anchors.Head), false, (float)textTime);
				yield return (object)new WaitForSeconds(2f);
			}
		}

		private static void InitializeBeeQueenPickupFx()
		{
			if (!((Object)(object)lavenderNM_PickupFx != (Object)null))
			{
				TillDrops val = Object.FindObjectOfType<TillDrops>();
				if ((Object)(object)val == (Object)null)
				{
					Debug.LogError((object)"Could not find TillDrops in the scene!");
				}
				else
				{
					lavenderNM_PickupFx = val.SeedDropSparkleFx;
				}
			}
		}
	}
	public static class LowHealthUtils
	{
		public static bool IsPlayerLowHealth()
		{
			int num = Mathf.CeilToInt((float)SingletonScriptableObject<GameData>.I.PlayerMaxHealth.Get() * SingletonScriptableObject<ConfigGame>.I.Player.LowHealthPercent);
			int num2 = SingletonScriptableObject<GameData>.I.PlayerHealth.Get();
			return num2 <= num;
		}
	}
	public static class CoordsUtils
	{
		public static List<Int2> GetCropNeighboringCoords(CropModel crop)
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Invalid comparison between Unknown and I4
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Invalid comparison between Unknown and I4
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Invalid comparison between Unknown and I4
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			if (crop == null)
			{
				return null;
			}
			Int2 coord = crop.Coord;
			int num = 1;
			List<Int2> list = new List<Int2>();
			if ((int)crop.Size == 2)
			{
				num = 1;
			}
			else if ((int)crop.Size == 1)
			{
				num = 2;
			}
			else if ((int)crop.Size == 0)
			{
				num = 4;
			}
			for (int i = -1; i <= num; i++)
			{
				for (int j = -1; j <= num; j++)
				{
					if (i < 0 || i >= num || j < 0 || j >= num)
					{
						list.Add(new Int2(coord.x + i, coord.y + j));
					}
				}
			}
			return list;
		}
	}
	public class PactRunToTill : RunToTill
	{
		public override void UpdateEveryFrame(float delta)
		{
			((Behaviour)this).enabled = PactOfTheCowGodState.DoPactOfTheCowGod;
			if (((Behaviour)this).enabled)
			{
				((RunToTill)this).UpdateEveryFrame(delta);
			}
		}
	}
	public class PactWeedStep : GameMonoBehaviour
	{
		public Vector2 Offset;

		private WeedController _weedController;

		private Vector2 _pos;

		private Int2 _coord;

		private void OnEnable()
		{
			_weedController = SingletonSceneScope<WeedController>.I;
		}

		private void Update()
		{
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			if (PactOfTheCowGodState.DoPactOfTheCowGod && !((Object)(object)_weedController == (Object)null))
			{
				_pos = Vector2.op_Implicit(((Component)this).transform.position) + Offset;
				_coord = Grid.Coord(_pos);
				_weedController.PopWeedEveryFrameSafe(_coord, _pos, (WeedCutSource)1, (FriendModel)null);
			}
		}
	}
	public class BreakCrustOnWater : MonoBehaviour
	{
		private readonly SoilTopGridCollection soilTopGridCollection = SingletonScriptableObject<GameData>.I.SoilCrustCollection;

		private bool subscribed = false;

		private void OnEnable()
		{
			if (!subscribed)
			{
				SingletonScriptableObject<GameData>.I.CropSystemData.Crops.OnWatered += CrustOn_OnWatered;
				subscribed = true;
			}
		}

		private void OnDisable()
		{
			SingletonScriptableObject<GameData>.I.CropSystemData.Crops.OnWatered -= CrustOn_OnWatered;
			if (subscribed)
			{
				subscribed = false;
			}
		}

		private void CrustOn_OnWatered(CropModel cropModel, WaterEventArg waterEventArg)
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			if (!PressureWasherState.DoPressureWasher)
			{
				return;
			}
			List<Int2> cropNeighboringCoords = CoordsUtils.GetCropNeighboringCoords(cropModel);
			foreach (Int2 item in cropNeighboringCoords)
			{
				if (soilTopGridCollection.Get(item) != null && Rando.Roll(LuckUtils.ScaledLuck(0.03f, 1f)))
				{
					soilTopGridCollection.Remove(item, (FriendModel)null);
					Fx.Play(PressureWasherState.BreakSoilFx, Grid.WorldPos(item));
				}
			}
		}
	}
	public static class CustomZones
	{
		public const ZonesEnum JungleMigrationZone = 98;

		public const ZonesEnum TundraMigrationZone = 99;

		public static readonly Dictionary<string, ZonesEnum> ZoneEnumNames = new Dictionary<string, ZonesEnum>(StringComparer.OrdinalIgnoreCase)
		{
			{
				"#JungleMigrationZone",
				(ZonesEnum)98
			},
			{
				"#TundraMigrationZone",
				(ZonesEnum)99
			}
		};
	}
	public static class NewMutationLogo
	{
		public static Texture2D LogoTexture = new Texture2D(480, 120, (TextureFormat)4, false);

		private static bool is_Init = false;

		public static Sprite LogoSprite { get; private set; }

		public static void Init()
		{
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			if (is_Init)
			{
				return;
			}
			string text = Path.Combine(MyPluginInfo.PLUGIN_PATH, "NewMutationLogo.png");
			if (!File.Exists(text))
			{
				Debug.LogError((object)("[NewMutationLogo] Could not find logo at " + text));
				return;
			}
			try
			{
				byte[] array = File.ReadAllBytes(text);
				ImageConversion.LoadImage(LogoTexture, array);
				((Texture)LogoTexture).filterMode = (FilterMode)0;
				((Texture)LogoTexture).wrapMode = (TextureWrapMode)1;
				LogoSprite = Sprite.Create(LogoTexture, new Rect(0f, 0f, (float)((Texture)LogoTexture).width, (float)((Texture)LogoTexture).height), new Vector2(240f, 60f), 32f);
			}
			catch (Exception arg)
			{
				Debug.LogError((object)$"[NewMutationLogo] Failed to load logo: {arg}");
			}
			is_Init = true;
		}
	}
	[HarmonyPatch(typeof(PlayerUtils), "GetWateringRadius")]
	public static class PlayerUtils_GetWateringRadius_Patch
	{
		private static void Postfix(ref float __result)
		{
			if (ElephantTrunkState.DoElephantTrunk)
			{
				__result *= 2f;
			}
		}
	}
	[HarmonyPatch(typeof(PlayerUtils), "GetWaterCapacity")]
	public static class PlayerUtils_GetWateringCapacity_Patch
	{
		private static void Postfix(ref int __result)
		{
			if (PactOfTheCowGodState.DoPactOfTheCowGod)
			{
				__result = 0;
			}
			if (ElephantTrunkState.DoElephantTrunk)
			{
				__result += 10;
			}
		}
	}
	[HarmonyPatch(typeof(MushroomManager), "EatRechargeMush")]
	public static class MushroomManager_EatRechargeMush_Patch
	{
		public static bool Prefix()
		{
			if (ForagingGuideState.DoForagingGuide)
			{
				ActionItemModel val = SingletonScriptableObject<GameData>.I.ActionItems.Get(SingletonScriptableObject<GameData>.I.ActionItems.GetCurrentIdx());
				val.GetModdedPlayerActionDef();
				val.GetActionModel().CurrentAmmo.Add(2);
				return false;
			}
			return true;
		}
	}
	[HarmonyPatch(typeof(GunShop), "_generateLootModelFromRarity")]
	public static class GunShop_generateLootModelFromRarity_Patch
	{
		public static void Postfix(ref LootModel __result)
		{
			if (MembershipCardState.DoMembershipCard)
			{
				LootModel obj = __result;
				obj.FarmStatOnPickup++;
				LootModel obj2 = __result;
				obj2.FightStatOnPickup++;
			}
			if (NewMutationItemState.DoNewMutationItem && NewMutationItemState.currentCharacter == "Rye")
			{
				__result.Cost /= 2;
				LootModel obj3 = __result;
				obj3.RandomMods++;
			}
		}
	}
	[HarmonyPatch(typeof(NewCarCamp), "MvgItemOnOnEnterScreen")]
	public static class MvgOnOnEnterScreen_Patch
	{
		public static void Postfix(NewCarCamp __instance)
		{
			if (!SkeletonCarKeysState.DoSkeletonCarKeys)
			{
				if (!ClassicModeUtils.InRunIsClassicMode())
				{
					__instance.NothingChance = 1f;
					__instance.GardenBedChance = 0.005f;
					__instance.SeedChance = 0.01f;
					__instance.FertChance = 0.01f;
					__instance.WormChance = 0.005f;
				}
				else if (ClassicModeUtils.InRunIsClassicMode())
				{
					__instance.NothingChance = 1f;
					__instance.SeedChance = 0.01f;
					__instance.FertChance = 0.01f;
				}
			}
			else if (!ClassicModeUtils.InRunIsClassicMode())
			{
				SingletonScriptableObject<GameData>.I.DidCarWormDrop = false;
				__instance.NothingChance = 0f;
				__instance.GardenBedChance = 0.15f;
				__instance.SeedChance = 0.4f;
				__instance.FertChance = 0.4f;
				__instance.WormChance = 0.05f;
			}
			else if (ClassicModeUtils.InRunIsClassicMode())
			{
				__instance.NothingChance = 0f;
				__instance.SeedChance = 0.5f;
				__instance.FertChance = 0.5f;
			}
		}
	}
	[HarmonyPatch(typeof(PlayerActionItemCollection), "Add")]
	public static class PlayerActionItemCollection_Add_Patch
	{
		private static void Prefix(PlayerActionItemCollection __instance, ActionItemModel def)
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Invalid comparison between Unknown and I4
			if (SolarPanelState.DoSolarPanel && (int)SingletonSceneScopeAutoLoad<DayNightSystem>.I.GetState() != 4)
			{
				PlayerActionDef playerActionDef = def.GetPlayerActionDef();
				playerActionDef.ReloadTime *= 0.85f;
				SolarPanelState.buffApplied = true;
				if (__instance.GetCount() > LiveParams.Player.ActionItemMaxCount)
				{
					PlayerActionDef playerActionDef2 = __instance.Get().GetPlayerActionDef();
					playerActionDef2.ReloadTime /= 0.85f;
				}
			}
		}
	}
	[HarmonyPatch(typeof(FlowersOnDamage), "PlayerCompOnOnDamageReceived")]
	public static class FlowersOnDamage_Patch
	{
		private static GameObject missileTractorPrefab;

		private static void Prefix()
		{
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_0110: Expected O, but got Unknown
			//IL_0114: Unknown result type (might be due to invalid IL or missing references)
			PlayerComp i = SingletonSceneScope<PlayerComp>.I;
			if (BloodMoneyState.DoBloodMoney)
			{
				((MonoBehaviour)i).StartCoroutine(BloodMoneyState.DropCashews());
			}
			if (ScarecrowHatState.DoScarecrowHat)
			{
				ProjShield.Shield(Vector2.op_Implicit(i.Anchors.Center), 2f * LiveParams.Player.ScarecrowPushRange, 0.5f);
				ScarecrowHatState.DoKnockBackOnPlayer();
			}
			if (!NewMutationItemState.DoNewMutationItem || !(NewMutationItemState.currentCharacter == "Botanist"))
			{
				return;
			}
			try
			{
				if ((Object)(object)missileTractorPrefab == (Object)null)
				{
					MissileTractorAction val = Object.FindObjectOfType<MissileTractorAction>();
					if ((Object)(object)val != (Object)null)
					{
						missileTractorPrefab = val.TractorPrefab;
					}
				}
				if (!((Object)(object)missileTractorPrefab == (Object)null))
				{
					Vector3 center = i.Anchors.Center;
					GameObject val2 = SimplePool.Spawn(missileTractorPrefab, center, Quaternion.identity);
					MissileTractor component = val2.GetComponent<MissileTractor>();
					if ((Object)(object)component != (Object)null)
					{
						PlayerActionDef val3 = new PlayerActionDef
						{
							FloatAttr0 = 5f
						};
						component.Go(val3, Vector2.zero, (Action<Vector2>)null);
					}
				}
			}
			catch (Exception ex)
			{
				Debug.LogError((object)("[Thyme OnDamage Effect] Megaton effect failed: " + ex));
			}
		}
	}
	[HarmonyPatch(typeof(LowHealthUpgradesController), "_hasALowHealthAbility")]
	public static class LowHealthUpgradesController__hasALowHealthAbility_Patch
	{
		private static void Postfix(ref bool __result)
		{
			if (LowHealthUtils.IsPlayerLowHealth() && (CrocodileTearsState.DoCrocodileTears || PressureCookerState.DoPressureCooker))
			{
				__result = true;
			}
		}
	}
	[HarmonyPatch(typeof(NightWaves2Manager), "SpawnWave")]
	public static class NightWaves2Manager_SpawnWave_Patch
	{
		private static void Postfix()
		{
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			if (PepperBellState.DoPepperBell)
			{
				PlayerGridWorkController component = ((Component)SingletonSceneScope<PlayerComp>.I).GetComponent<PlayerGridWorkController>();
				if ((Object)(object)component != (Object)null)
				{
					component.EnableComboBoost();
					ProjShield.Shield(Vector2.op_Implicit(SingletonSceneScope<PlayerComp>.I.Anchors.Center), 5f, 0.25f);
				}
			}
		}
	}
	[HarmonyPatch(typeof(AiCropBoostAgent), "StartBoost")]
	public static class AiCropBoostAgent_StartBoost_Patch
	{
		public static void Postfix(AiCropBoostAgent __instance)
		{
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//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)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_011b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0120: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: Unknown result type (might be due to invalid IL or missing references)
			//IL_012c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0132: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: Invalid comparison between Unknown and I4
			if (!PollinatorPairState.DoPollinatorPair)
			{
				return;
			}
			CropModel claimedCrop = __instance.GetClaimedCrop();
			if (claimedCrop == null)
			{
				return;
			}
			if (!__instance.BoostNeighbors && Rando.Roll(LuckUtils.ScaledLuck(0.5f, 1f)))
			{
				Vector2 worldPosition = claimedCrop.GetWorldPosition();
				AdjBonusMissileGun.Fire(worldPosition, 16f, false, default(Vector2));
			}
			else
			{
				if (!__instance.BoostNeighbors)
				{
					return;
				}
				CropsController i = SingletonSceneScope<CropsController>.I;
				Int2[] offsetsSquare3x = GridCollectionUtils.OffsetsSquare3x3;
				foreach (Int2 val in offsetsSquare3x)
				{
					CropModel crop = i.GetCrop(claimedCrop.Coord + val);
					if (crop != null && !crop.GetDef().Starts2x2 && !crop.IsWaterNeeded() && !crop.IsFroozen && !crop.IsYielding && (int)crop.GetDef().CropTag != 6 && Rando.Roll(LuckUtils.ScaledLuck(0.2f, 1f)))
					{
						Vector2 worldPosition2 = crop.GetWorldPosition();
						AdjBonusMissileGun.Fire(worldPosition2, 16f, false, default(Vector2));
					}
				}
			}
		}
	}
	[HarmonyPatch(typeof(Enemy), "DoDamage", new Type[] { typeof(DamageEventArg) })]
	public static class Enemy_DoDamage_DamageEventArgs_Patch
	{
		private static void Postfix(Enemy __instance, DamageEventArg arg)
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Invalid comparison between Unknown and I4
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Invalid comparison between Unknown and I4
			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Invalid comparison between Unknown and I4
			//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d3: Invalid comparison between Unknown and I4
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0127: Unknown result type (might be due to invalid IL or missing references)
			//IL_0129: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0169: Unknown result type (might be due to invalid IL or missing references)
			//IL_016b: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e7: Unknown result type (might be due to invalid IL or missing references)
			if (HotSalsaState.DoHotSalsa && (int)arg.DamageInfo.Source == 3 && (Object)(object)__instance != (Object)null && ((Component)__instance).gameObject.activeInHierarchy && !__instance.GetIsDead() && Rando.Roll(LuckUtils.ScaledLuck(0.25f, 1f)))
			{
				__instance.Burn(2, 5, 5, (BurnChannels)0, (DamageSource)4);
			}
			if (!WhackAMoleState.DoWhackAMole)
			{
				return;
			}
			EnemyDef2Base def = __instance.GetDef2();
			if ((Object)(object)def == (Object)null)
			{
				return;
			}
			string name = ((Object)def).name;
			if ((!(name == "MoleA") && !(name == "MoleA_2")) || ((int)arg.DamageInfo.Source != 3 && (int)arg.DamageInfo.Source != 4 && (int)arg.DamageInfo.Source != 2))
			{
				return;
			}
			Vector3 val = Vector2.op_Implicit(__instance.GetAgent().GetCenter());
			if (Rando.Roll(LuckUtils.ScaledLuck(0.8f, 1f)))
			{
				ScriptableObject fertilizer = SingletonScriptableObject<ConfigGame>.I.CommonLoot.Fertilizer;
				LootItemFuncs.DropAutoPickup((ILootDef)(object)((fertilizer is ILootDef) ? fertilizer : null), 1, Vector2.op_Implicit(val), 1f, true);
				if (Rando.Roll(LuckUtils.ScaledLuck(0.2f, 1f)))
				{
					ScriptableObject fertilizer2 = SingletonScriptableObject<ConfigGame>.I.CommonLoot.Fertilizer;
					LootItemFuncs.DropAutoPickup((ILootDef)(object)((fertilizer2 is ILootDef) ? fertilizer2 : null), 1, Vector2.op_Implicit(val), 1f, true);
				}
			}
			if (Rando.Roll(LuckUtils.ScaledLuck(0.2f, 1f)))
			{
				LootItemFuncs.DropAutoPickup((ILootDef)(object)ListExtra.PickRandomFaster<CropDef>(CropDefLoader.GetCrops()), 1, Vector2.op_Implicit(val), 1f, true);
				if (Rando.Roll(LuckUtils.ScaledLuck(0.05f, 1f)))
				{
					ScriptableObject fertilizer3 = SingletonScriptableObject<ConfigGame>.I.CommonLoot.Fertilizer;
					LootItemFuncs.DropAutoPickup((ILootDef)(object)((fertilizer3 is ILootDef) ? fertilizer3 : null), 1, Vector2.op_Implicit(val), 1f, true);
				}
			}
		}
	}
	[HarmonyPatch(typeof(GunModFightStatToAttributes), "_modifyGunDef")]
	public static class GunModFightStatToAttributes_ModifyGunDef_Patch
	{
		private static void Postfix(ref GunDef def)
		{
			if (PressureCookerState.DoPressureCooker && LowHealthUtils.IsPlayerLowHealth())
			{
				def.DamagePerBullet = (int)Math.Ceiling((float)def.DamagePerBullet * 1.2f);
			}
		}
	}
	[HarmonyPatch(typeof(PlayerGridWorkController), "Awake")]
	public static class PlayerGridWorkController_Awake_Patch
	{
		private static void Postfix(PlayerGridWorkController __instance)
		{
			__instance.OnEnergizedEnter += delegate
			{
				if (LightningChainState.DoLightningChain)
				{
					LightningChainState.ChainLinkZap();
				}
			};
		}
	}
	[HarmonyPatch(typeof(MoveController), "Move", new Type[]
	{
		typeof(Vector2),
		typeof(float)
	})]
	public static class MoveController_Move_Patch
	{
		private static void Prefix(MoveController __instance, ref float speed)
		{
			if ((Object)(object)((Component)__instance).GetComponent<Enemy>() != (Object)null && NewMutationItemState.DoNewMutationItem && NewMutationItemState.currentCharacter == "Robusta")
			{
				speed *= 0.7501876f;
			}
		}
	}
	[HarmonyPatch(typeof(EliteSkullAttack), "Go")]
	public static class EliteSkullAttack_Go_Patch
	{
		private static void Postfix(EliteSkullAttack __instance)
		{
			if (NewMutationItemState.DoNewMutationItem && NewMutationItemState.currentCharacter == "Robusta")
			{
				FieldInfo fieldInfo = AccessTools.Field(typeof(EliteSkullAttack), "_pursueSpeed");
				if (fieldInfo != null)
				{
					float num = (float)fieldInfo.GetValue(__instance);
					fieldInfo.SetValue(__instance, num * 0.7501876f);
				}
			}
		}
	}
	[HarmonyPatch(typeof(BeeAgent), "_startBoost")]
	public static class BeeAgent_startBoost_Patch
	{
		private static readonly FieldRef<BeeAgent, AiCropBoostAgent> _boostAiRef = AccessTools.FieldRefAccess<BeeAgent, AiCropBoostAgent>("_boostAi");

		private static void Postfix(BeeAgent __instance)
		{
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0172: Unknown result type (might be due to invalid IL or missing references)
			//IL_0137: Unknown result type (might be due to invalid IL or missing references)
			//IL_013d: Invalid comparison between Unknown and I4
			if (!NewMutationItemState.DoNewMutationItem || NewMutationItemState.currentCharacter != "Lavender")
			{
				return;
			}
			AiCropBoostAgent val = _boostAiRef.Invoke(__instance);
			if ((Object)(object)val == (Object)null)
			{
				return;
			}
			FriendModel model = ((FriendCompBase)__instance).GetModel();
			if (model == null)
			{
				return;
			}
			CropModel claimedCrop = val.GetClaimedCrop();
			if (claimedCrop == null)
			{
				return;
			}
			CropsController i = SingletonSceneScope<CropsController>.I;
			if (!val.BoostNeighbors && Rando.Roll(LuckUtils.ScaledLuck(0.2f, 1f)))
			{
				model.SeedInvAdd(claimedCrop.GetDef(), 1, true);
				Fx.Play(NewMutationItemState.lavenderNM_PickupFx, claimedCrop.GetWorldPosition());
			}
			else
			{
				if (!val.BoostNeighbors)
				{
					return;
				}
				Int2[] offsetsSquare3x = GridCollectionUtils.OffsetsSquare3x3;
				foreach (Int2 val2 in offsetsSquare3x)
				{
					CropModel crop = i.GetCrop(claimedCrop.Coord + val2);
					if (crop != null && !crop.GetDef().Starts2x2 && !crop.IsWaterNeeded() && !crop.IsFroozen && !crop.IsYielding && (int)crop.GetDef().CropTag != 6 && Rando.Roll(LuckUtils.ScaledLuck(0.05f, 1f)))
					{
						model.SeedInvAdd(claimedCrop.GetDef(), 1, true);
						Fx.Play(NewMutationItemState.lavenderNM_PickupFx, claimedCrop.GetWorldPosition());
					}
				}
			}
		}
	}
	[HarmonyPatch(typeof(BeeAgent), "ModAgentDef")]
	public static class BeeAgent_ModAgentDef_Postfix
	{
		private static void Postfix(ref AgentDef Def)
		{
			if (NewMutationItemState.DoNewMutationItem && NewMutationItemState.currentCharacter == "Lavender")
			{
				AgentDef obj = Def;
				obj.Speed *= 2f;
			}
		}
	}
	[HarmonyPatch(typeof(TurretBasicA), "_fire")]
	public static class TurretBasicA_Fire_Patch
	{
		private static void Postfix(TurretBasicA __instance)
		{
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_0115: Unknown result type (might be due to invalid IL or missing references)
			//IL_0159: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01df: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0201: Unknown result type (might be due to invalid IL or missing references)
			//IL_0206: Unknown result type (might be due to invalid IL or missing references)
			//IL_020b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0212: Unknown result type (might be due to invalid IL or missing references)
			//IL_0217: Unknown result type (might be due to invalid IL or missing references)
			//IL_021e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0223: Unknown result type (might be due to invalid IL or missing references)
			//IL_0228: Unknown result type (might be due to invalid IL or missing references)
			//IL_022d: Unknown result type (might be due to invalid IL or missing references)
			//IL_023f: Expected O, but got Unknown
			if (NewMutationItemState.DoNewMutationItem && NewMutationItemState.currentCharacter == "Rye" && !((Object)(object)__instance.Muzzle == (Object)null) && !((Object)(object)__instance.ProjectilePrefab == (Object)null))
			{
				Vector3 val;
				if ((Object)(object)__instance.GetTarget() != (Object)null)
				{
					Bounds bounds = __instance.GetTarget().bounds;
					val = ((Bounds)(ref bounds)).center;
				}
				else
				{
					val = __instance.Muzzle.position + __instance.Muzzle.up;
				}
				Vector3 val2 = val - __instance.Muzzle.position;
				Vector3 normalized = ((Vector3)(ref val2)).normalized;
				TurretDefParams value = Traverse.Create((object)__instance).Field<TurretDefParams>("_def").Value;
				ProjectileCommonData projectileData = __instance.ProjectileData;
				for (int i = 0; i < 3; i++)
				{
					float num = Random.Range(-30f, 30f);
					Vector3 val3 = Quaternion.Euler(0f, 0f, num) * normalized;
					GameObject val4 = SimplePool.Spawn(__instance.ProjectilePrefab, __instance.Muzzle.position, Quaternion.identity);
					Projectile component = val4.GetComponent<Projectile>();
					component.GetLiveDamageInfo().Amount = MathUtils.Mult(value.Damage, 1f + LiveParams.Player.TurretBasicDamage);
					component.GetLiveDamageInfo().Source = (DamageSource)0;
					component.GetLiveDamageInfo().Knockback = value.Knockback * (1f + LiveParams.Player.TurretBasicKnockback);
					float value2 = Traverse.Create((object)__instance).Method("_getRange", Array.Empty<object>()).GetValue<float>();
					projectileData.Range = new Vector2(value2 + 1f, value2 + 1f);
					projectileData.Radius = value.BulletSize * (1f + LiveParams.Player.TurretBasicBulletSize);
					component.Init(new ProjectileInitData
					{
						Direction = Vector2.op_Implicit(((Vector3)(ref val3)).normalized),
						Layer = (DamageLayer)0,
						Position = Vector2.op_Implicit(__instance.Muzzle.position),
						Target = Vector2.op_Implicit(__instance.Muzzle.position + val3 * 10f)
					}, (IGun)null, projectileData, (DamageInfo)null, "unknown");
				}
			}
		}
	}
	[HarmonyPatch(typeof(FriendMountedTurret), "_fire")]
	public static class FriendMountedTurret_Fire_Patch
	{
		private static void Postfix(FriendMountedTurret __instance)
		{
			//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_010a: Unknown result type (might be due to invalid IL or missing references)
			//IL_010f: 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_0116: Unknown result type (might be due to invalid IL or missing references)
			//IL_011d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: Unknown result type (might be due to invalid IL or missing references)
			//IL_0127: Unknown result type (might be due to invalid IL or missing references)
			//IL_012b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0130: Unknown result type (might be due to invalid IL or missing references)
			//IL_0192: Unknown result type (might be due to invalid IL or missing references)
			//IL_0197: Unknown result type (might be due to invalid IL or missing references)
			//IL_0198: Unknown result type (might be due to invalid IL or missing references)
			//IL_019d: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0223: Unknown result type (might be due to invalid IL or missing references)
			//IL_0228: Unknown result type (might be due to invalid IL or missing references)
			//IL_024e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0253: Unknown result type (might be due to invalid IL or missing references)
			//IL_0256: Unknown result type (might be due to invalid IL or missing references)
			//IL_025b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0260: Unknown result type (might be due to invalid IL or missing references)
			//IL_0265: Unknown result type (might be due to invalid IL or missing references)
			//IL_0267: Unknown result type (might be due to invalid IL or missing references)
			//IL_026c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0273: Unknown result type (might be due to invalid IL or missing references)
			//IL_0278: Unknown result type (might be due to invalid IL or missing references)
			//IL_027d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0282: Unknown result type (might be due to invalid IL or missing references)
			//IL_0289: Unknown result type (might be due to invalid IL or missing references)
			//IL_028e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0295: Unknown result type (might be due to invalid IL or missing references)
			//IL_029a: Unknown result type (might be due to invalid IL or missing references)
			//IL_029f: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b7: Expected O, but got Unknown
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: 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_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			if (!NewMutationItemState.DoNewMutationItem || !(NewMutationItemState.currentCharacter == "Rye") || (Object)(object)__instance.Muzzle == (Object)null || (Object)(object)__instance.ProjectilePrefab == (Object)null)
			{
				return;
			}
			Collider2D value = Traverse.Create((object)__instance).Field<Collider2D>("_targetCollider").Value;
			IMover value2 = Traverse.Create((object)__instance).Field<IMover>("_targetMoveController").Value;
			Vector3 val;
			if ((Object)(object)value != (Object)null)
			{
				Bounds bounds;
				if (__instance.LeadTarget && value2 != null)
				{
					Vector3 position = __instance.Muzzle.position;
					Vector3 zero = Vector3.zero;
					float num = VectorExtensions.RandomRange(__instance.ProjectileData.Speed);
					bounds = value.bounds;
					val = MathUtils.FirstOrderIntercept(position, zero, num, ((Bounds)(ref bounds)).center, Vector2.op_Implicit(value2.GetVelocity()));
				}
				else
				{
					bounds = value.bounds;
					val = ((Bounds)(ref bounds)).center;
				}
			}
			else
			{
				val = __instance.Muzzle.position + __instance.Muzzle.up;
			}
			Vector3 val2 = val - __instance.Muzzle.position;
			Vector3 normalized = ((Vector3)(ref val2)).normalized;
			TurretDefParams value3 = Traverse.Create((object)__instance).Field<TurretDefParams>("_def").Value;
			ProjectileCommonData projectileData = __instance.ProjectileData;
			float value4 = Traverse.Create((object)__instance).Method("_getRange", Array.Empty<object>()).GetValue<float>();
			for (int i = 0; i < 2; i++)
			{
				float num2 = Random.Range(-30f, 30f);
				Vector3 val3 = Quaternion.Euler(0f, 0f, num2) * normalized;
				GameObject val4 = SimplePool.Spawn(__instance.ProjectilePrefab, __instance.Muzzle.position, Quaternion.identity);
				Projectile component = val4.GetComponent<Projectile>();
				component.GetLiveDamageInfo().Amount = MathUtils.Mult(value3.Damage, 1f + LiveParams.Player.TurretBasicDamage);
				component.GetLiveDamageInfo().Knockback = value3.Knockback * (1f + LiveParams.Player.TurretBasicKnockback);
				projectileData.Range = new Vector2(value4 + 1f, value4 + 1f);
				projectileData.Radius = value3.BulletSize * (1f + LiveParams.Player.TurretBasicBulletSize);
				component.Init(new ProjectileInitData
				{
					Direction = Vector2.op_Implicit(((Vector3)(ref val3)).normalized),
					Layer = (DamageLayer)0,
					Position = Vector2.op_Implicit(__instance.Muzzle.position),
					Target = Vector2.op_Implicit(__instance.Muzzle.position + val3 * 10f)
				}, (IGun)null, projectileData, (DamageInfo)null, "unknown");
			}
		}
	}
	[HarmonyPatch(typeof(WandererTrigger), "OnTriggerEnter2D")]
	public static class WandererTrigger_OnTriggerEnter2D_Patc
	{
		private static bool Prefix(WandererTrigger __instance, Collider2D other)
		{
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Expected O, but got Unknown
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Expected O, but got Unknown
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			FieldInfo fieldInfo = AccessTools.Field(typeof(WandererTrigger), "_upgrade");
			FieldInfo fieldInfo2 = AccessTools.Field(typeof(WandererTrigger), "_mva");
			UpgradeDef val = (UpgradeDef)fieldInfo.GetValue(__instance);
			MvaMonoBehaviour3 val2 = (MvaMonoBehaviour3)fieldInfo2.GetValue(__instance);
			Vector3 position = ((Component)__instance).transform.position;
			if (NewMutationItemState.DoNewMutationItem && NewMutationItemState.currentCharacter == "Dandelions" && (Object)(object)val != (Object)null && ((Object)val).name == "DandUpgradeStackable")
			{
				for (int i = 0; i < 2; i++)
				{
					LootApply.ApplyWithFx(LootModelGenerator.GenerateLootModel((ILootDef)(object)val, 1, true, false, (LootCollectionIdsEnum)0), Vector2.op_Implicit(position));
				}
			}
			else
			{
				LootApply.ApplyWithFx(LootModelGenerator.GenerateLootModel((ILootDef)(object)val, 1, true, false, (LootCollectionIdsEnum)0), Vector2.op_Implicit(position));
			}
			val2.GetModel().DoRemove();
			return false;
		}
	}
	[HarmonyPatch(typeof(Enemy), "Kill")]
	public static class Enemy_Kill_Patch
	{
		public static void Postfix(Enemy __instance)
		{
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			if (NewMutationItemState.DoNewMutationItem && NewMutationItemState.currentCharacter == "Dandelions" && ((Object)__instance).name.ToLower().Contains("bundit"))
			{
				NewMutationItemState.dandelionNM_KillCount++;
			}
			if (NewMutationItemState.dandelionNM_KillCount >= 15)
			{
				DandelionsUtils.SpawnCollectible(__instance.GetAgent().GetCenter());
				NewMutationItemState.dandelionNM_KillCount = 0;
			}
		}
	}
	[HarmonyPatch(typeof(LootItem), "_TriggerPickup")]
	public static class LootItem__TriggerPickup_Patch
	{
		private static readonly float fertDrop = 0.8f;

		private static readonly float cashewDrop = 0.15f;

		private static readonly float pickaxeDrop = 0.049f;

		public static void Postfix(LootItem __instance)
		{
			//IL_007c: 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)
			//IL_010e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0229: Unknown result type (might be due to invalid IL or missing references)
			//IL_022e: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_0154: Unknown result type (might be due to invalid IL or missing references)
			//IL_0159: Unknown result type (might be due to invalid IL or missing references)
			//IL_0274: Unknown result type (might be due to invalid IL or missing references)
			//IL_0279: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f9: Unknown result type (might be due to invalid IL or missing references)
			if (!NewMutationItemState.DoNewMutationItem || NewMutationItemState.currentCharacter != "Crow")
			{
				return;
			}
			LootModel model = __instance.GetModel();
			if ((Object)(object)model.Seed == (Object)null)
			{
				return;
			}
			PlayerComp i = SingletonSceneScope<PlayerComp>.I;
			float value = Random.value;
			if (value < fertDrop)
			{
				ScriptableObject fertilizer = SingletonScriptableObject<ConfigGame>.I.CommonLoot.Fertilizer;
				LootItemFuncs.DropAutoPickup((ILootDef)(object)((fertilizer is ILootDef) ? fertilizer : null), 1, Vector2.op_Implicit(((Component)__instance).transform.position), 1f, true);
				if (Rando.Roll(LuckUtils.ScaledLuck(0.1f, 1f)))
				{
					ScriptableObject fertilizer2 = SingletonScriptableObject<ConfigGame>.I.CommonLoot.Fertilizer;
					LootItemFuncs.DropAutoPickup((ILootDef)(object)((fertilizer2 is ILootDef) ? fertilizer2 : null), 1, Vector2.op_Implicit(((Component)__instance).transform.position), 1f, true);
				}
			}
			else if (value < fertDrop + cashewDrop)
			{
				LootItemFuncs.DropAutoPickup((ILootDef)(object)SingletonScriptableObject<ConfigGame>.I.CommonLoot.Cashew, 1, Vector2.op_Implicit(((Component)__instance).transform.position), 1f, true);
				if (Rando.Roll(LuckUtils.ScaledLuck(0.1f, 1f)))
				{
					LootItemFuncs.DropAutoPickup((ILootDef)(object)SingletonScriptableObject<ConfigGame>.I.CommonLoot.Cashew, 1, Vector2.op_Implicit(((Component)__instance).transform.position), 1f, true);
				}
			}
			else if (value < fertDrop + cashewDrop + pickaxeDrop)
			{
				ScriptableObject pickaxe = SingletonScriptableObject<ConfigGame>.I.CommonLoot.Pickaxe;
				LootItemFuncs.DropAutoPickup((ILootDef)(object)((pickaxe is ILootDef) ? pickaxe : null), 1, Vector2.op_Implicit(((Component)__instance).transform.position), 1f, true);
				if (Rando.Roll(LuckUtils.ScaledLuck(0.1f, 1f)))
				{
					ScriptableObject pickaxe2 = SingletonScriptableObject<ConfigGame>.I.CommonLoot.Pickaxe;
					LootItemFuncs.DropAutoPickup((ILootDef)(object)((pickaxe2 is ILootDef) ? pickaxe2 : null), 1, Vector2.op_Implicit(((Component)__instance).transform.position), 1f, true);
				}
			}
			else
			{
				ScriptableObject copia = SingletonScriptableObject<ConfigGame>.I.CommonLoot.Copia;
				LootItemFuncs.DropAutoPickup((ILootDef)(object)((copia is ILootDef) ? copia : null), 1, Vector2.op_Implicit(((Component)__instance).transform.position), 1f, true);
				if (Rando.Roll(LuckUtils.ScaledLuck(0.1f, 1f)))
				{
					ScriptableObject copia2 = SingletonScriptableObject<ConfigGame>.I.CommonLoot.Copia;
					LootItemFuncs.DropAutoPickup((ILootDef)(object)((copia2 is ILootDef) ? copia2 : null), 1, Vector2.op_Implicit(((Component)__instance).transform.position), 1f, true);
				}
			}
			NewMutationItemState.crowNM_SeedCount++;
			float num = Mathf.Max(0.00015f, 0.01f / (1f + 0.1f * (float)(NewMutationItemState.crowNM_SeedCount - 1)));
			PlayerParams player = LiveParams.Player;
			player.Luck += num;
			NewMutationItemState.crowNM_LuckAdd += num;
		}
	}
	[HarmonyPatch(typeof(FriendsCollection), "_add")]
	public static class FriendsCollection_Add_Patch
	{
		private static void Postfix(FriendModel model)
		{
			if (model == null)
			{
				return;
			}
			string text = ((Object)model.Def).name.ToLower();
			if (text != "cow" && text != "cow2")
			{
				return;
			}
			FriendsManager i = SingletonSceneScopeAutoLoad<FriendsManager>.I;
			GameObject gameObjectForModel = i.GetGameObjectForModel(model);
			if (!((Object)(object)gameObjectForModel == (Object)null))
			{
				if ((Object)(object)gameObjectForModel.GetComponent<PactRunToTill>() == (Object)null)
				{
					PactRunToTill pactRunToTill = gameObjectForModel.AddComponent<PactRunToTill>();
					((RunToTill)pactRunToTill).DoAlways = true;
					((RunToTill)pactRunToTill).NotPlayer = true;
				}
				GameObjectExtensions.GetOrAddComponent<PactWeedStep>(gameObjectForModel);
			}
		}
	}
	[HarmonyPatch(typeof(UiHudWaterCount), "_refresh")]
	public static class UiHudWaterCount_refresh_Patch
	{
		public static bool Prefix(UiHudWaterCount __instance)
		{
			if (PactOfTheCowGodState.DoPactOfTheCowGod && PlayerUtils.GetWaterCapacity() == 0)
			{
				TextWithOutline value = Traverse.Create((object)__instance).Field<TextWithOutline>("_text").Value;
				if ((Object)(object)value != (Object)null)
				{
					value.text = $"{SingletonScriptableObject<GameData>.I.Water.Get()}/{PlayerUtils.GetWaterCapacity()}";
				}
				GameObject value2 = Traverse.Create((object)__instance).Field<GameObject>("_grp").Value;
				if ((Object)(object)value2 != (Object)null)
				{
					value2.SetActive(true);
				}
				((MonoBehaviour)__instance).CancelInvoke("_blink");
				Traverse.Create((object)__instance).Field<bool>("_isBlinking").Value = false;
				return false;
			}
			return true;
		}
	}
	[HarmonyPatch(typeof(MainMenu), "Awake")]
	public static class MainMenu_Awake_Patch
	{
		public static void Postfix(MainMenu __instance)
		{
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)NewMutationLogo.LogoSprite == (Object)null)
			{
				return;
			}
			Transform val = ((Component)__instance).transform.Find("Logo");
			if ((Object)(object)val == (Object)null)
			{
				return;
			}
			Image component = ((Component)val).GetComponent<Image>();
			if (!((Object)(object)component == (Object)null))
			{
				component.sprite = NewMutationLogo.LogoSprite;
				RectTransform component2 = ((Component)val).GetComponent<RectTransform>();
				if ((Object)(object)component2 != (Object)null)
				{
					Vector2 anchoredPosition = component2.anchoredPosition;
					anchoredPosition.y = 70f;
					component2.anchoredPosition = anchoredPosition;
				}
			}
		}
	}
	[HarmonyPatch(typeof(FarmSceneManager), "DayStartProc")]
	public static class FarmSceneManager_DayStartProc_Patch
	{
		public static void Postfix()
		{
			GameObject val = GameObject.Find("UpgradesController");
			if ((Object)(object)val != (Object)null)
			{
				GameObjectExtensions.GetOrAddComponent<BreakCrustOnWater>(val);
			}
		}

		public static void Postfix(FarmSceneManager __instance)
		{
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0167: Unknown result type (might be due to invalid IL or missing references)
			//IL_0196: Unknown result type (might be due to invalid IL or missing references)
			Transform transform = ((Component)__instance).gameObject.transform;
			if ((Object)(object)transform.Find("#JungleMigrationZone") == (Object)null)
			{
				GameObject gameObject = ((Component)transform.Find("BeesonZone0")).gameObject;
				if ((Object)(object)gameObject == (Object)null)
				{
					Debug.LogError((object)"[ERROR] FarmSceneManager Child BeesonZone0 not found.");
					return;
				}
				MigrationSeasonState.JungleMigrationZone = Object.Instantiate<GameObject>(gameObject, ((Component)transform).transform);
				((Object)MigrationSeasonState.JungleMigrationZone).name = "#JungleMigrationZone";
				ZoneCirle orAddComponent = GameObjectExtensions.GetOrAddComponent<ZoneCirle>(MigrationSeasonState.JungleMigrationZone);
				((Component)orAddComponent).transform.position = new Vector3(17.3f, 50f, 0f);
				orAddComponent.SetInnerRadius(25f);
				orAddComponent.SetOutRadius(40f);
				((ZoneBase)orAddComponent).GetZoneInterface();
				((ZoneBase)orAddComponent).GetKey();
				ZoneSystem i = SingletonSceneScopeAutoLoad<ZoneSystem>.I;
				i.Reload();
			}
			if ((Object)(object)transform.Find("#TundraMigrationZone") == (Object)null)
			{
				GameObject gameObject2 = ((Component)transform.Find("BeesonZone0")).gameObject;
				if ((Object)(object)gameObject2 == (Object)null)
				{
					Debug.LogError((object)"[ERROR] FarmSceneManager Child BeesonZone0 not found.");
					return;
				}
				MigrationSeasonState.TundraMigrationZone = Object.Instantiate<GameObject>(gameObject2, ((Component)transform).transform);
				((Object)MigrationSeasonState.TundraMigrationZone).name = "#TundraMigrationZone";
				ZoneCirle orAddComponent2 = GameObjectExtensions.GetOrAddComponent<ZoneCirle>(MigrationSeasonState.TundraMigrationZone);
				((Component)orAddComponent2).transform.position = new Vector3(17.3f, 50f, 0f);
				orAddComponent2.SetInnerRadius(25f);
				orAddComponent2.SetOutRadius(40f);
				((ZoneBase)orAddComponent2).GetZoneInterface();
				((ZoneBase)orAddComponent2).GetKey();
				ZoneSystem i2 = SingletonSceneScopeAutoLoad<ZoneSystem>.I;
				i2.Reload();
			}
		}
	}
	[HarmonyPatch]
	public static class ParseEnum_ZonesEnum_Patch
	{
		private static MethodBase TargetMethod()
		{
			MethodInfo methodInfo = AccessTools.Method(typeof(EnumUtils), "ParseEnum", new Type[1] { typeof(string) }, (Type[])null);
			return methodInfo.MakeGenericMethod(typeof(ZonesEnum));
		}

		private static bool Prefix(ref ZonesEnum __result, string value)
		{
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Expected I4, but got Unknown
			if (!string.IsNullOrEmpty(value) && value.StartsWith("#"))
			{
				string key = value.ToLower();
				if (CustomZones.ZoneEnumNames.TryGetValue(key, out var value2))
				{
					__result = (ZonesEnum)(int)value2;
					return false;
				}
			}
			return true;
		}
	}
}