using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using LobbyCompatibility.Attributes;
using Microsoft.CodeAnalysis;
using Nutcracker_Only.Patches;
using Unity.Netcode;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: IgnoresAccessChecksTo("AmazingAssets.TerrainToMesh")]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp-firstpass")]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: IgnoresAccessChecksTo("ClientNetworkTransform")]
[assembly: IgnoresAccessChecksTo("DissonanceVoip")]
[assembly: IgnoresAccessChecksTo("Facepunch Transport for Netcode for GameObjects")]
[assembly: IgnoresAccessChecksTo("Facepunch.Steamworks.Win64")]
[assembly: IgnoresAccessChecksTo("Unity.AI.Navigation")]
[assembly: IgnoresAccessChecksTo("Unity.Animation.Rigging")]
[assembly: IgnoresAccessChecksTo("Unity.Animation.Rigging.DocCodeExamples")]
[assembly: IgnoresAccessChecksTo("Unity.Burst")]
[assembly: IgnoresAccessChecksTo("Unity.Burst.Unsafe")]
[assembly: IgnoresAccessChecksTo("Unity.Collections")]
[assembly: IgnoresAccessChecksTo("Unity.Collections.LowLevel.ILSupport")]
[assembly: IgnoresAccessChecksTo("Unity.InputSystem")]
[assembly: IgnoresAccessChecksTo("Unity.InputSystem.ForUI")]
[assembly: IgnoresAccessChecksTo("Unity.Jobs")]
[assembly: IgnoresAccessChecksTo("Unity.Mathematics")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.Common")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.MetricTypes")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStats")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Component")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Configuration")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Implementation")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsReporting")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetworkProfiler.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetworkSolutionInterface")]
[assembly: IgnoresAccessChecksTo("Unity.Netcode.Components")]
[assembly: IgnoresAccessChecksTo("Unity.Netcode.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.Networking.Transport")]
[assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Csg")]
[assembly: IgnoresAccessChecksTo("Unity.ProBuilder")]
[assembly: IgnoresAccessChecksTo("Unity.ProBuilder.KdTree")]
[assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Poly2Tri")]
[assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Stl")]
[assembly: IgnoresAccessChecksTo("Unity.Profiling.Core")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.ShaderLibrary")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.HighDefinition.Config.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.HighDefinition.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Authentication")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Analytics")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Configuration")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Device")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Environments")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Environments.Internal")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Internal")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Networking")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Registration")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Scheduler")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Telemetry")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Threading")]
[assembly: IgnoresAccessChecksTo("Unity.Services.QoS")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Relay")]
[assembly: IgnoresAccessChecksTo("Unity.TextMeshPro")]
[assembly: IgnoresAccessChecksTo("Unity.Timeline")]
[assembly: IgnoresAccessChecksTo("Unity.VisualEffectGraph.Runtime")]
[assembly: IgnoresAccessChecksTo("UnityEngine.ARModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.NVIDIAModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.UI")]
[assembly: AssemblyCompany("NutcrackerOnly")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.4.0")]
[assembly: AssemblyInformationalVersion("1.0.4-dev.7+797c04fd33f7fceeef9e894a0336da2a4e3886e0")]
[assembly: AssemblyProduct("Nutcracker Only")]
[assembly: AssemblyTitle("NutcrackerOnly")]
[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.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
internal sealed class NullableAttribute : Attribute
{
public readonly byte[] NullableFlags;
public NullableAttribute(byte P_0)
{
NullableFlags = new byte[1] { P_0 };
}
public NullableAttribute(byte[] P_0)
{
NullableFlags = P_0;
}
}
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
internal sealed class NullableContextAttribute : Attribute
{
public readonly byte Flag;
public NullableContextAttribute(byte P_0)
{
Flag = P_0;
}
}
[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 Nutcracker_Only
{
[BepInPlugin("NutcrackerOnly", "Nutcracker Only", "1.0.4")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[LobbyCompatibility(/*Could not decode attribute arguments.*/)]
public class NutcrackerOnly : BaseUnityPlugin
{
public static AssetBundle SecondNutAsset;
public static NutcrackerOnly Instance { get; private set; }
internal static ManualLogSource Logger { get; private set; }
internal static Harmony? Harmony { get; set; }
private void Awake()
{
Logger = ((BaseUnityPlugin)this).Logger;
Instance = this;
Patch();
Logger.LogInfo((object)"NutcrackerOnly v1.0.4 has loaded!");
Logger.LogInfo((object)"I am NutCowBoy!");
}
internal static void Patch()
{
//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)
//IL_0018: Expected O, but got Unknown
if (Harmony == null)
{
Harmony = new Harmony("NutcrackerOnly");
}
Logger.LogDebug((object)"Patching...");
Harmony.PatchAll(typeof(LevelGen));
Harmony.PatchAll(typeof(NutChanges));
Harmony.PatchAll(typeof(EggSpawns));
Harmony.PatchAll(typeof(ExpFix));
Harmony.PatchAll(typeof(InterestEggs));
Logger.LogDebug((object)"Finished patching!");
}
internal static void Unpatch()
{
Logger.LogDebug((object)"Unpatching...");
Harmony? harmony = Harmony;
if (harmony != null)
{
harmony.UnpatchSelf();
}
Logger.LogDebug((object)"Finished unpatching!");
}
}
public static class MyPluginInfo
{
public const string PLUGIN_GUID = "NutcrackerOnly";
public const string PLUGIN_NAME = "Nutcracker Only";
public const string PLUGIN_VERSION = "1.0.4";
}
}
namespace Nutcracker_Only.Patches
{
public class LevelGen
{
private static SpawnableEnemyWithRarity Crack = StartOfRound.Instance.levels[1].Enemies[8];
private static SpawnableEnemyWithRarity Bracken = StartOfRound.Instance.levels[5].Enemies[5];
private static SpawnableEnemyWithRarity Coil = StartOfRound.Instance.levels[5].Enemies[6];
private static SpawnableEnemyWithRarity GhostGirl = StartOfRound.Instance.levels[5].Enemies[0];
private static SpawnableEnemyWithRarity OutsideNut = new SpawnableEnemyWithRarity();
private static SelectableLevel NutLevel = new SelectableLevel();
private static SelectableLevel previousLevel = new SelectableLevel();
private static EnemyType outCracker = new EnemyType();
[HarmonyPatch(typeof(StartOfRound), "StartGame")]
[HarmonyPostfix]
public static void MakeOutcracker(StartOfRound __instance)
{
//IL_024d: Unknown result type (might be due to invalid IL or missing references)
//IL_0252: Unknown result type (might be due to invalid IL or missing references)
//IL_0383: Unknown result type (might be due to invalid IL or missing references)
//IL_0388: Unknown result type (might be due to invalid IL or missing references)
//IL_0393: Unknown result type (might be due to invalid IL or missing references)
//IL_03a8: Expected O, but got Unknown
outCracker = ScriptableObject.CreateInstance<EnemyType>();
outCracker.enemyName = "Outcracker";
outCracker.probabilityCurve = Crack.enemyType.probabilityCurve;
outCracker.spawningDisabled = Crack.enemyType.spawningDisabled;
outCracker.spawnFromWeeds = Crack.enemyType.spawnFromWeeds;
outCracker.numberSpawnedFalloff = Crack.enemyType.numberSpawnedFalloff;
outCracker.useNumberSpawnedFalloff = Crack.enemyType.useNumberSpawnedFalloff;
outCracker.enemyPrefab = Crack.enemyType.enemyPrefab;
outCracker.PowerLevel = Crack.enemyType.PowerLevel;
outCracker.MaxCount = 70;
outCracker.numberSpawned = Crack.enemyType.numberSpawned;
outCracker.isOutsideEnemy = true;
outCracker.isDaytimeEnemy = Crack.enemyType.isDaytimeEnemy;
outCracker.increasedChanceInterior = Crack.enemyType.increasedChanceInterior;
outCracker.normalizedTimeInDayToLeave = Crack.enemyType.normalizedTimeInDayToLeave;
outCracker.stunTimeMultiplier = Crack.enemyType.stunTimeMultiplier;
outCracker.doorSpeedMultiplier = Crack.enemyType.doorSpeedMultiplier;
outCracker.stunGameDifficultyMultiplier = Crack.enemyType.stunGameDifficultyMultiplier;
outCracker.canBeStunned = Crack.enemyType.canBeStunned;
outCracker.canDie = Crack.enemyType.canDie;
outCracker.canBeDestroyed = Crack.enemyType.canBeDestroyed;
outCracker.destroyOnDeath = Crack.enemyType.destroyOnDeath;
outCracker.canSeeThroughFog = Crack.enemyType.canSeeThroughFog;
outCracker.pushPlayerForce = Crack.enemyType.pushPlayerForce;
outCracker.pushPlayerDistance = Crack.enemyType.pushPlayerDistance;
outCracker.SizeLimit = Crack.enemyType.SizeLimit;
outCracker.timeToPlayAudio = Crack.enemyType.timeToPlayAudio;
outCracker.loudnessMultiplier = Crack.enemyType.loudnessMultiplier;
outCracker.overrideVentSFX = Crack.enemyType.overrideVentSFX;
outCracker.nestSpawnPrefab = Crack.enemyType.nestSpawnPrefab;
outCracker.nestSpawnPrefabWidth = Crack.enemyType.nestSpawnPrefabWidth;
outCracker.useMinEnemyThresholdForNest = Crack.enemyType.useMinEnemyThresholdForNest;
outCracker.hitBodySFX = Crack.enemyType.hitBodySFX;
outCracker.hitEnemyVoiceSFX = Crack.enemyType.hitEnemyVoiceSFX;
outCracker.deathSFX = Crack.enemyType.deathSFX;
outCracker.stunSFX = Crack.enemyType.stunSFX;
outCracker.miscAnimations = Crack.enemyType.miscAnimations;
outCracker.audioClips = Crack.enemyType.audioClips;
OutsideNut = new SpawnableEnemyWithRarity
{
enemyType = outCracker,
rarity = Crack.rarity
};
}
[HarmonyPatch(typeof(StartOfRound), "StartGame")]
[HarmonyPostfix]
public static void CreateUpdatedAnimationCurve(StartOfRound __instance)
{
//IL_0043: Unknown result type (might be due to invalid IL or missing references)
//IL_0048: 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_005e: 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_0074: Unknown result type (might be due to invalid IL or missing references)
//IL_0085: Unknown result type (might be due to invalid IL or missing references)
//IL_008a: Unknown result type (might be due to invalid IL or missing references)
//IL_008f: Unknown result type (might be due to invalid IL or missing references)
//IL_0099: Expected O, but got Unknown
//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
//IL_00ce: 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)
//IL_00e4: 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_00f3: Expected O, but got Unknown
//IL_010d: Unknown result type (might be due to invalid IL or missing references)
//IL_0112: Unknown result type (might be due to invalid IL or missing references)
//IL_0123: Unknown result type (might be due to invalid IL or missing references)
//IL_0128: Unknown result type (might be due to invalid IL or missing references)
//IL_0139: 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_0143: Unknown result type (might be due to invalid IL or missing references)
//IL_014d: Expected O, but got Unknown
//IL_0167: Unknown result type (might be due to invalid IL or missing references)
//IL_016c: Unknown result type (might be due to invalid IL or missing references)
//IL_017d: Unknown result type (might be due to invalid IL or missing references)
//IL_0182: Unknown result type (might be due to invalid IL or missing references)
//IL_0193: 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_01a7: Expected O, but got Unknown
//IL_01c1: Unknown result type (might be due to invalid IL or missing references)
//IL_01c6: 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_01ed: Unknown result type (might be due to invalid IL or missing references)
//IL_01f2: Unknown result type (might be due to invalid IL or missing references)
//IL_0203: Unknown result type (might be due to invalid IL or missing references)
//IL_0208: Unknown result type (might be due to invalid IL or missing references)
//IL_020d: Unknown result type (might be due to invalid IL or missing references)
//IL_0217: Expected O, but got Unknown
//IL_0231: Unknown result type (might be due to invalid IL or missing references)
//IL_0236: Unknown result type (might be due to invalid IL or missing references)
//IL_0247: Unknown result type (might be due to invalid IL or missing references)
//IL_024c: Unknown result type (might be due to invalid IL or missing references)
//IL_025d: Unknown result type (might be due to invalid IL or missing references)
//IL_0262: 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_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_0293: Unknown result type (might be due to invalid IL or missing references)
//IL_029d: Expected O, but got Unknown
//IL_02b7: Unknown result type (might be due to invalid IL or missing references)
//IL_02bc: Unknown result type (might be due to invalid IL or missing references)
//IL_02cd: Unknown result type (might be due to invalid IL or missing references)
//IL_02d2: Unknown result type (might be due to invalid IL or missing references)
//IL_02e3: Unknown result type (might be due to invalid IL or missing references)
//IL_02e8: Unknown result type (might be due to invalid IL or missing references)
//IL_02ed: Unknown result type (might be due to invalid IL or missing references)
//IL_02f7: Expected O, but got Unknown
//IL_0311: Unknown result type (might be due to invalid IL or missing references)
//IL_0316: Unknown result type (might be due to invalid IL or missing references)
//IL_0327: Unknown result type (might be due to invalid IL or missing references)
//IL_032c: Unknown result type (might be due to invalid IL or missing references)
//IL_033d: Unknown result type (might be due to invalid IL or missing references)
//IL_0342: Unknown result type (might be due to invalid IL or missing references)
//IL_0347: Unknown result type (might be due to invalid IL or missing references)
//IL_0351: Expected O, but got Unknown
//IL_036b: Unknown result type (might be due to invalid IL or missing references)
//IL_0370: Unknown result type (might be due to invalid IL or missing references)
//IL_0381: Unknown result type (might be due to invalid IL or missing references)
//IL_0386: Unknown result type (might be due to invalid IL or missing references)
//IL_0397: Unknown result type (might be due to invalid IL or missing references)
//IL_039c: Unknown result type (might be due to invalid IL or missing references)
//IL_03ad: Unknown result type (might be due to invalid IL or missing references)
//IL_03b2: Unknown result type (might be due to invalid IL or missing references)
//IL_03b7: Unknown result type (might be due to invalid IL or missing references)
//IL_03c1: Expected O, but got Unknown
//IL_03dc: Unknown result type (might be due to invalid IL or missing references)
//IL_03e1: Unknown result type (might be due to invalid IL or missing references)
//IL_03f2: Unknown result type (might be due to invalid IL or missing references)
//IL_03f7: Unknown result type (might be due to invalid IL or missing references)
//IL_0408: Unknown result type (might be due to invalid IL or missing references)
//IL_040d: Unknown result type (might be due to invalid IL or missing references)
//IL_0412: Unknown result type (might be due to invalid IL or missing references)
//IL_041c: Expected O, but got Unknown
//IL_0447: Unknown result type (might be due to invalid IL or missing references)
//IL_044c: Unknown result type (might be due to invalid IL or missing references)
//IL_045d: Unknown result type (might be due to invalid IL or missing references)
//IL_0462: Unknown result type (might be due to invalid IL or missing references)
//IL_0473: Unknown result type (might be due to invalid IL or missing references)
//IL_0478: Unknown result type (might be due to invalid IL or missing references)
//IL_047d: Unknown result type (might be due to invalid IL or missing references)
//IL_0487: Expected O, but got Unknown
//IL_04a2: Unknown result type (might be due to invalid IL or missing references)
//IL_04a7: Unknown result type (might be due to invalid IL or missing references)
//IL_04b8: Unknown result type (might be due to invalid IL or missing references)
//IL_04bd: Unknown result type (might be due to invalid IL or missing references)
//IL_04ce: Unknown result type (might be due to invalid IL or missing references)
//IL_04d3: Unknown result type (might be due to invalid IL or missing references)
//IL_04d8: Unknown result type (might be due to invalid IL or missing references)
//IL_04e2: Expected O, but got Unknown
SelectableLevel[] levels = __instance.levels;
foreach (SelectableLevel val in levels)
{
Debug.Log((object)val.PlanetName);
}
__instance.levels[0].enemySpawnChanceThroughoutDay = new AnimationCurve((Keyframe[])(object)new Keyframe[4]
{
new Keyframe(0f, -3f),
new Keyframe(0.195999f, 4.73351f),
new Keyframe(0.7593884f, 4.973001f),
new Keyframe(1f, 15f)
});
__instance.levels[1].enemySpawnChanceThroughoutDay = new AnimationCurve((Keyframe[])(object)new Keyframe[3]
{
new Keyframe(0f, -3f),
new Keyframe(0.4999272f, 6.038967f),
new Keyframe(1f, 15f)
});
__instance.levels[2].enemySpawnChanceThroughoutDay = new AnimationCurve((Keyframe[])(object)new Keyframe[3]
{
new Keyframe(0f, 1.240476f),
new Keyframe(0.504f, 6.507092f),
new Keyframe(1f, 15f)
});
__instance.levels[4].enemySpawnChanceThroughoutDay = new AnimationCurve((Keyframe[])(object)new Keyframe[3]
{
new Keyframe(0f, -3f),
new Keyframe(0.224f, 4.410501f),
new Keyframe(1f, 15f)
});
__instance.levels[4].outsideEnemySpawnChanceThroughDay = new AnimationCurve((Keyframe[])(object)new Keyframe[4]
{
new Keyframe(0f, 1f),
new Keyframe(0.28f, 2f),
new Keyframe(0.8769338f, 3.964059f),
new Keyframe(1f, 5.359401f)
});
__instance.levels[5].enemySpawnChanceThroughoutDay = new AnimationCurve((Keyframe[])(object)new Keyframe[5]
{
new Keyframe(0f, -3f),
new Keyframe(0.1625553f, 0.006106406f),
new Keyframe(0.504f, 5f),
new Keyframe(0.7631003f, 11.27556f),
new Keyframe(1f, 15f)
});
__instance.levels[6].enemySpawnChanceThroughoutDay = new AnimationCurve((Keyframe[])(object)new Keyframe[3]
{
new Keyframe(0f, -3f),
new Keyframe(0.056f, 2.817775f),
new Keyframe(1f, 15f)
});
__instance.levels[7].enemySpawnChanceThroughoutDay = new AnimationCurve((Keyframe[])(object)new Keyframe[3]
{
new Keyframe(0f, 2.817775f),
new Keyframe(0.336f, 6.660501f),
new Keyframe(1f, 15f)
});
__instance.levels[8].enemySpawnChanceThroughoutDay = new AnimationCurve((Keyframe[])(object)new Keyframe[4]
{
new Keyframe(0f, -3f),
new Keyframe(0.2077699f, 1.22323f),
new Keyframe(0.504f, 7.363626f),
new Keyframe(1f, 15f)
});
__instance.levels[9].enemySpawnChanceThroughoutDay = new AnimationCurve((Keyframe[])(object)new Keyframe[3]
{
new Keyframe(0f, 5f),
new Keyframe(0.504f, 11.27556f),
new Keyframe(1f, 15f)
});
__instance.levels[10].maxEnemyPowerCount = 24;
__instance.levels[10].enemySpawnChanceThroughoutDay = new AnimationCurve((Keyframe[])(object)new Keyframe[3]
{
new Keyframe(0f, 7f),
new Keyframe(0.448f, 12f),
new Keyframe(1f, 15f)
});
__instance.levels[12].enemySpawnChanceThroughoutDay = new AnimationCurve((Keyframe[])(object)new Keyframe[3]
{
new Keyframe(0f, 1.516304f),
new Keyframe(0.448f, 7.363626f),
new Keyframe(1f, 15f)
});
}
[HarmonyPatch(typeof(RoundManager), "FinishGeneratingLevel")]
[HarmonyPostfix]
public static void SetNutcrackersOnly(RoundManager __instance)
{
//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
//IL_00e7: Invalid comparison between Unknown and I4
Crack.rarity = 90;
Bracken.rarity = 7;
Coil.rarity = 2;
GhostGirl.rarity = 1;
Crack.enemyType.MaxCount = 30;
NutLevel = ScriptableObject.CreateInstance<SelectableLevel>();
NutLevel.Enemies = new List<SpawnableEnemyWithRarity>();
NutLevel.Enemies.Add(Crack);
NutLevel.Enemies.Add(Bracken);
NutLevel.Enemies.Add(Coil);
NutLevel.Enemies.Add(GhostGirl);
NutLevel.OutsideEnemies = new List<SpawnableEnemyWithRarity>();
NutLevel.OutsideEnemies.Add(OutsideNut);
__instance.scrapValueMultiplier = 0f;
if ((int)__instance.currentLevel.currentWeather == 5)
{
previousLevel = ScriptableObject.CreateInstance<SelectableLevel>();
previousLevel.levelID = __instance.currentLevel.levelID;
previousLevel.OutsideEnemies = ((IEnumerable<SpawnableEnemyWithRarity>)__instance.currentLevel.OutsideEnemies).Select((Func<SpawnableEnemyWithRarity, SpawnableEnemyWithRarity>)((SpawnableEnemyWithRarity e) => new SpawnableEnemyWithRarity
{
enemyType = e.enemyType,
rarity = e.rarity
})).ToList();
__instance.currentLevel.OutsideEnemies.Clear();
__instance.currentLevel.OutsideEnemies.Add(NutLevel.OutsideEnemies[0]);
}
if (__instance.currentLevel.levelID == 0)
{
__instance.currentLevel.Enemies.Clear();
__instance.currentLevel.Enemies.Add(NutLevel.Enemies[0]);
__instance.minEnemiesToSpawn = 1;
return;
}
if (__instance.currentLevel.levelID == 4)
{
__instance.currentLevel.OutsideEnemies.Clear();
__instance.currentLevel.OutsideEnemies.Add(NutLevel.OutsideEnemies[0]);
}
if (__instance.currentLevel.levelID == 9)
{
Crack.enemyType.MaxCount = 45;
}
if (__instance.currentLevel.levelID == 10)
{
Crack.enemyType.MaxCount = 70;
}
__instance.currentLevel.Enemies.Clear();
__instance.currentLevel.Enemies.Add(NutLevel.Enemies[0]);
__instance.currentLevel.Enemies.Add(NutLevel.Enemies[2]);
__instance.currentLevel.Enemies.Add(NutLevel.Enemies[1]);
__instance.currentLevel.Enemies.Add(NutLevel.Enemies[3]);
__instance.minEnemiesToSpawn = 2;
}
[HarmonyPatch(typeof(RoundManager), "UnloadSceneObjectsEarly")]
[HarmonyPostfix]
public static void RevertEclipsed(RoundManager __instance)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Invalid comparison between Unknown and I4
if ((int)__instance.currentLevel.currentWeather == 5)
{
__instance.currentLevel.OutsideEnemies = previousLevel.OutsideEnemies;
}
}
}
public class NutChanges
{
[HarmonyPatch(typeof(NutcrackerEnemyAI), "GrabGun")]
[HarmonyPrefix]
public static bool RedoShotgun(NutcrackerEnemyAI __instance)
{
return false;
}
[HarmonyPatch(typeof(NutcrackerEnemyAI), "GrabGun")]
[HarmonyPostfix]
public static void SetScrapValue(NutcrackerEnemyAI __instance, GameObject gunObject)
{
__instance.gun = gunObject.GetComponent<ShotgunItem>();
if ((Object)(object)__instance.gun == (Object)null)
{
((EnemyAI)__instance).LogEnemyError("Gun in GrabGun function did not contain ShotgunItem component.");
return;
}
Debug.Log((object)"Setting gun scrap value");
((GrabbableObject)__instance.gun).SetScrapValue(60);
RoundManager instance = RoundManager.Instance;
instance.totalScrapValueInLevel += (float)((GrabbableObject)__instance.gun).scrapValue;
((GrabbableObject)__instance.gun).parentObject = __instance.gunPoint;
((GrabbableObject)__instance.gun).isHeldByEnemy = true;
((GrabbableObject)__instance.gun).grabbableToEnemies = false;
((GrabbableObject)__instance.gun).grabbable = false;
__instance.gun.shellsLoaded = 2;
((GrabbableObject)__instance.gun).GrabItemFromEnemy((EnemyAI)(object)__instance);
}
[HarmonyPatch(typeof(NutcrackerEnemyAI), "SpawnShotgunShells")]
[HarmonyPrefix]
public static bool RedoShells(NutcrackerEnemyAI __instance)
{
return false;
}
[HarmonyPatch(typeof(NutcrackerEnemyAI), "SpawnShotgunShells")]
[HarmonyPostfix]
public static void AddEggs(NutcrackerEnemyAI __instance)
{
//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_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_0078: Unknown result type (might be due to invalid IL or missing references)
//IL_007d: Unknown result type (might be due to invalid IL or missing references)
//IL_0082: Unknown result type (might be due to invalid IL or missing references)
if (((NetworkBehaviour)__instance).IsOwner)
{
for (int i = 0; i < 2; i++)
{
GameObject val = Object.Instantiate<GameObject>(StartOfRound.Instance.allItemsList.itemsList[69].spawnPrefab, ((Component)__instance).transform.position + Vector3.up * 0.6f + new Vector3(Random.Range(-0.8f, 0.8f), 0f, Random.Range(-0.8f, 0.8f)), Quaternion.identity, RoundManager.Instance.spawnedScrapContainer);
val.GetComponent<GrabbableObject>().fallTime = 0f;
val.GetComponent<NetworkObject>().Spawn(false);
}
}
}
[HarmonyPatch(typeof(NutcrackerEnemyAI), "Update")]
[HarmonyPostfix]
public static void CheckIfOutside(NutcrackerEnemyAI __instance)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
if ((double)((Component)__instance).transform.position.y > -80.0)
{
((EnemyAI)__instance).SetEnemyOutside(true);
}
}
}
public class EggSpawns
{
private static SpawnableItemWithRarity Egg = StartOfRound.Instance.levels[0].spawnableScrap[22];
private static SelectableLevel EggLevel = new SelectableLevel();
[HarmonyPatch(typeof(RoundManager), "FinishGeneratingLevel")]
[HarmonyPostfix]
public static void SetEggsOnly(RoundManager __instance)
{
EggLevel = ScriptableObject.CreateInstance<SelectableLevel>();
EggLevel.spawnableScrap = new List<SpawnableItemWithRarity>();
EggLevel.spawnableScrap.Add(Egg);
__instance.currentLevel.spawnableScrap.Clear();
__instance.currentLevel.spawnableScrap.Add(EggLevel.spawnableScrap[0]);
}
[HarmonyPatch(typeof(RoundManager), "waitForScrapToSpawnToSync")]
[HarmonyPostfix]
public static void SetValueToZero(RoundManager __instance, NetworkObjectReference[] spawnedScrap, int[] scrapValues)
{
foreach (int num in scrapValues)
{
Debug.Log((object)num);
}
}
}
public class ExpFix
{
[HarmonyPatch(typeof(HUDManager), "SetPlayerLevel")]
[HarmonyPrefix]
public static void SetPlayerLevel(HUDManager __instance)
{
RoundManager instance = RoundManager.Instance;
instance.totalScrapValueInLevel += 3f;
}
}
public class InterestEggs
{
[HarmonyPatch(typeof(StartOfRound), "GetValueOfAllScrap")]
[HarmonyPrefix]
public static bool EggInterest(ref int __result, StartOfRound __instance, bool onlyScrapCollected = true, bool onlyNewScrap = false)
{
//IL_006e: Unknown result type (might be due to invalid IL or missing references)
//IL_0073: Unknown result type (might be due to invalid IL or missing references)
//IL_007f: Unknown result type (might be due to invalid IL or missing references)
GrabbableObject[] array = Object.FindObjectsOfType<GrabbableObject>();
int num = 0;
for (int i = 0; i < array.Length; i++)
{
if (array[i].itemProperties.itemName == "Easter egg" && __instance.currentLevel.levelID != StartOfRound.Instance.levels[3].levelID)
{
array[i].SetScrapValue(array[i].scrapValue + 3);
}
Bounds bounds = __instance.shipInnerRoomBounds.bounds;
if (((Bounds)(ref bounds)).Contains(((Component)array[i]).transform.position))
{
array[i].isInShipRoom = true;
}
}
for (int j = 0; j < array.Length; j++)
{
if ((!onlyNewScrap || !array[j].scrapPersistedThroughRounds) && array[j].itemProperties.isScrap && !array[j].deactivated && !array[j].itemUsedUp && (array[j].isInShipRoom || !onlyScrapCollected))
{
num += array[j].scrapValue;
}
}
__result = num;
return false;
}
}
}
namespace System.Runtime.CompilerServices
{
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
internal sealed class IgnoresAccessChecksToAttribute : Attribute
{
public IgnoresAccessChecksToAttribute(string assemblyName)
{
}
}
}