using System;
using System.Collections;
using System.Diagnostics;
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 Microsoft.CodeAnalysis;
using Peak.Afflictions;
using UnityEngine;
using Zorro.Core;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("com.atomic.eatablebingbong")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("0.1.3.0")]
[assembly: AssemblyInformationalVersion("0.1.3+6a22d7d239a6f44656a7ccb6df17a701b859565a")]
[assembly: AssemblyProduct("com.atomic.eatablebingbong")]
[assembly: AssemblyTitle("Eatable_BingBong")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.1.3.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[Embedded]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
internal sealed class NullableAttribute : Attribute
{
public readonly byte[] NullableFlags;
public NullableAttribute(byte P_0)
{
NullableFlags = new byte[1] { P_0 };
}
public NullableAttribute(byte[] P_0)
{
NullableFlags = P_0;
}
}
[CompilerGenerated]
[Embedded]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
internal sealed class NullableContextAttribute : Attribute
{
public readonly byte Flag;
public NullableContextAttribute(byte P_0)
{
Flag = P_0;
}
}
[CompilerGenerated]
[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 BepInEx
{
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
[Conditional("CodeGeneration")]
internal sealed class BepInAutoPluginAttribute : Attribute
{
public BepInAutoPluginAttribute(string? id = null, string? name = null, string? version = null)
{
}
}
}
namespace BepInEx.Preloader.Core.Patching
{
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
[Conditional("CodeGeneration")]
internal sealed class PatcherAutoPluginAttribute : Attribute
{
public PatcherAutoPluginAttribute(string? id = null, string? name = null, string? version = null)
{
}
}
}
namespace Eatable_BingBong
{
[BepInPlugin("com.atomic.eatablebingbong", "Eatable_BingBong", "0.1.3")]
public class Plugin : BaseUnityPlugin
{
private static Harmony harmony;
public const string Id = "com.atomic.eatablebingbong";
internal static ManualLogSource Log { get; private set; }
public static string Name => "Eatable_BingBong";
public static string Version => "0.1.3";
private void Awake()
{
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
//IL_001a: Expected O, but got Unknown
Log = ((BaseUnityPlugin)this).Logger;
harmony = new Harmony("com.atomic.eatablebingbong");
harmony.PatchAll();
Log.LogInfo((object)("Plugin " + Name + " is loaded!"));
((Component)this).gameObject.AddComponent<CrabManager>();
}
}
public class CrabManager : MonoBehaviour
{
public static CrabManager instance;
private void Awake()
{
instance = this;
}
public static void TriggerGiveCrab(Character character)
{
if ((Object)(object)character == (Object)null)
{
Debug.LogError((object)"Cannot give crab to a null character.");
}
else if ((Object)(object)instance == (Object)null)
{
Debug.LogError((object)"CrabManager instance is missing from the scene.");
}
else
{
((MonoBehaviour)instance).StartCoroutine(GiveCrabRoutine(character));
}
}
private static IEnumerator GiveCrabRoutine(Character character)
{
yield return (object)new WaitForSeconds(60f);
WaitForSeconds tick = new WaitForSeconds(1f);
for (int i = 1; i < 50; i++)
{
if ((Object)(object)character == (Object)null)
{
break;
}
if ((Object)(object)character.refs.afflictions == (Object)null)
{
break;
}
if (i <= 4)
{
character.refs.afflictions.AddStatus((STATUSTYPE)6, 0.15f, false, true, true);
}
character.refs.afflictions.AddStatus((STATUSTYPE)4, 0.01f, false, true, true);
yield return tick;
}
}
}
[HarmonyPatch]
public static class PatchesBingBong
{
public static SFX_Instance Lollipop;
public static void BingBong(Item __instance)
{
__instance.UIData.hasSecondInteract = true;
__instance.UIData.secondaryInteractPrompt = "eat";
__instance._useFeedback.useAnimation = "Eat";
Item obj = __instance;
obj.OnSecondaryStarted = (Action)Delegate.Combine(obj.OnSecondaryStarted, (Action)delegate
{
__instance._useFeedback.useAnimation = "Eat";
__instance.usingTimePrimary = 2f;
});
Item obj2 = __instance;
obj2.OnPrimaryStarted = (Action)Delegate.Combine(obj2.OnPrimaryStarted, (Action)delegate
{
__instance._useFeedback.useAnimation = "";
__instance.usingTimePrimary = 0.25f;
});
Item obj3 = __instance;
obj3.OnSecondaryFinishedCast = (Action)Delegate.Combine(obj3.OnSecondaryFinishedCast, (Action)delegate
{
//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_0052: Unknown result type (might be due to invalid IL or missing references)
//IL_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_00a1: 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_00b2: Unknown result type (might be due to invalid IL or missing references)
//IL_00be: Expected O, but got Unknown
//IL_00c4: 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_00da: Unknown result type (might be due to invalid IL or missing references)
//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
//IL_00f1: Expected O, but got Unknown
//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
//IL_0107: 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_0119: Unknown result type (might be due to invalid IL or missing references)
//IL_012e: Expected O, but got Unknown
//IL_012e: Unknown result type (might be due to invalid IL or missing references)
//IL_0133: Unknown result type (might be due to invalid IL or missing references)
//IL_013f: Unknown result type (might be due to invalid IL or missing references)
//IL_0149: Expected O, but got Unknown
ItemCooking component = ((Component)((Component)__instance).transform).GetComponent<ItemCooking>();
GlobalEvents.TriggerItemConsumed(__instance, __instance.holderCharacter);
Optionable<byte> currentSelectedSlot = __instance.holderCharacter.refs.items.currentSelectedSlot;
__instance.holderCharacter.player.EmptySlot(currentSelectedSlot);
__instance.holderCharacter.refs.items.EquipSlot(currentSelectedSlot);
__instance.holderCharacter.refs.afflictions.AddStatus((STATUSTYPE)5, 0.1f * (float)(component.timesCookedLocal + 1), false, true, true);
Action_RestoreHunger val = new Action_RestoreHunger
{
item = __instance,
restorationAmount = 0.8f
};
((ItemActionBase)val).RunAction();
Affliction_AdjustDrowsyOverTime drowsyAffliction = new Affliction_AdjustDrowsyOverTime
{
character = __instance.holderCharacter,
statusPerSecond = 0.1f,
totalTime = 10f
};
Affliction_InfiniteStamina affliction = new Affliction_InfiniteStamina
{
character = __instance.holderCharacter,
drowsyAffliction = (Affliction)(object)drowsyAffliction,
climbDelay = 3f,
totalTime = 15f + (float)component.timesCookedLocal
};
Action_ApplyAffliction val2 = new Action_ApplyAffliction
{
item = __instance,
affliction = (Affliction)(object)affliction
};
((ItemActionBase)val2).RunAction();
});
}
public static void AncientIdol(Item __instance)
{
__instance.UIData.hasMainInteract = true;
__instance.UIData.mainInteractPrompt = "eat";
__instance._useFeedback.useAnimation = "Eat";
Item obj = __instance;
obj.OnPrimaryStarted = (Action)Delegate.Combine(obj.OnPrimaryStarted, (Action)delegate
{
__instance._useFeedback.useAnimation = "Eat";
__instance.usingTimePrimary = 2f;
});
Item obj2 = __instance;
obj2.OnPrimaryFinishedCast = (Action)Delegate.Combine(obj2.OnPrimaryFinishedCast, (Action)delegate
{
//IL_004c: Unknown result type (might be due to invalid IL or missing references)
//IL_0051: Unknown result type (might be due to invalid IL or missing references)
//IL_0062: 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_00b1: 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_00c2: Unknown result type (might be due to invalid IL or missing references)
//IL_00ce: Expected O, but got Unknown
//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
//IL_00d9: 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_00f5: Unknown result type (might be due to invalid IL or missing references)
//IL_0109: Expected O, but got Unknown
//IL_0109: 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_011f: Unknown result type (might be due to invalid IL or missing references)
//IL_0126: Unknown result type (might be due to invalid IL or missing references)
//IL_0133: Expected O, but got Unknown
//IL_0133: Unknown result type (might be due to invalid IL or missing references)
//IL_0138: Unknown result type (might be due to invalid IL or missing references)
//IL_0144: Unknown result type (might be due to invalid IL or missing references)
//IL_014d: Expected O, but got Unknown
//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_0165: Unknown result type (might be due to invalid IL or missing references)
//IL_016f: Expected O, but got Unknown
ItemCooking component = ((Component)((Component)__instance).transform).GetComponent<ItemCooking>();
CrabManager.TriggerGiveCrab(__instance.holderCharacter);
GlobalEvents.TriggerItemConsumed(__instance, __instance.holderCharacter);
Optionable<byte> currentSelectedSlot = __instance.holderCharacter.refs.items.currentSelectedSlot;
__instance.holderCharacter.player.EmptySlot(currentSelectedSlot);
__instance.holderCharacter.refs.items.EquipSlot(currentSelectedSlot);
__instance.holderCharacter.refs.afflictions.AddStatus((STATUSTYPE)5, 0.2f * (float)(component.timesCookedLocal + 1), false, true, true);
Action_RestoreHunger val = new Action_RestoreHunger
{
item = __instance,
restorationAmount = 1f
};
((ItemActionBase)val).RunAction();
Affliction_InfiniteStamina affliction = new Affliction_InfiniteStamina
{
character = __instance.holderCharacter,
climbDelay = 3f,
totalTime = 10f + (float)component.timesCookedLocal
};
Affliction_Invincibility affliction2 = new Affliction_Invincibility
{
character = __instance.holderCharacter,
isFromMilk = true,
totalTime = 60f
};
Action_ApplyAffliction val2 = new Action_ApplyAffliction
{
item = __instance,
affliction = (Affliction)(object)affliction
};
((ItemActionBase)val2).RunAction();
Action_ApplyAffliction val3 = new Action_ApplyAffliction
{
item = __instance,
affliction = (Affliction)(object)affliction2
};
((ItemActionBase)val3).RunAction();
});
}
[HarmonyPostfix]
[HarmonyPatch(typeof(Item), "Awake")]
public static void GetBingBong(Item __instance)
{
if (__instance.itemID == 13 || __instance.itemID == 124)
{
BingBong(__instance);
}
if (__instance.itemID == 47)
{
AncientIdol(__instance);
}
}
}
}
namespace System.Runtime.CompilerServices
{
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
internal sealed class IgnoresAccessChecksToAttribute : Attribute
{
public IgnoresAccessChecksToAttribute(string assemblyName)
{
}
}
}