using System;
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 BepInEx;
using HarmonyLib;
using LethalLib.Modules;
using Microsoft.CodeAnalysis;
using Unity.Netcode;
using UnityEngine;
using silverPlushies.Behaviours;
[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: AssemblyCompany("silverPlushies")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("My first plugin")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("silverPlushies")]
[assembly: AssemblyTitle("silverPlushies")]
[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 silverPlushies
{
[BepInPlugin("silverPlushies", "silverPlushies", "1.0.0")]
public class Plugin : BaseUnityPlugin
{
public static AssetBundle silverAssets;
private void Awake()
{
((BaseUnityPlugin)this).Logger.LogMessage((object)"Start Silver plushies mod");
string text = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "silverplushies");
silverAssets = AssetBundle.LoadFromFile(text);
if ((Object)(object)silverAssets == (Object)null)
{
((BaseUnityPlugin)this).Logger.LogError((object)"Failed to load bundle. ");
}
else
{
((BaseUnityPlugin)this).Logger.LogMessage((object)"Bundle loaded succesfully");
}
Item val = silverAssets.LoadAsset<Item>("Assets/finished prefabs/items/PetalpalPlushItem.asset");
Item val2 = silverAssets.LoadAsset<Item>("Assets/finished prefabs/items/PetalpalControllerItem.asset");
Item val3 = silverAssets.LoadAsset<Item>("Assets/finished prefabs/items/PetalpalJerkyItem.asset");
Item val4 = silverAssets.LoadAsset<Item>("Assets/finished prefabs/items/PetalpalWrenchItem.asset");
Item val5 = silverAssets.LoadAsset<Item>("Assets/finished prefabs/items/PetalpalCrabbieItem.asset");
Item val6 = silverAssets.LoadAsset<Item>("Assets/finished prefabs/items/PetalpalKnifeItem.asset");
Item val7 = silverAssets.LoadAsset<Item>("Assets/finished prefabs/items/PetalpalCornItem.asset");
Item val8 = silverAssets.LoadAsset<Item>("Assets/finished prefabs/items/PetalbudItem.asset");
Item val9 = silverAssets.LoadAsset<Item>("Assets/finished prefabs/items/PetalbudKazooItem.asset");
Item val10 = silverAssets.LoadAsset<Item>("Assets/finished prefabs/items/PetalbudTeddyItem.asset");
Item val11 = silverAssets.LoadAsset<Item>("Assets/finished prefabs/items/PetalbudCowItem.asset");
Item val12 = silverAssets.LoadAsset<Item>("Assets/finished prefabs/items/PetalpupPlushItem.asset");
Item val13 = silverAssets.LoadAsset<Item>("Assets/finished prefabs/items/PetalpupStarItem.asset");
Item val14 = silverAssets.LoadAsset<Item>("Assets/finished prefabs/items/PetalpupOwlyItem.asset");
Item val15 = silverAssets.LoadAsset<Item>("Assets/finished prefabs/items/PetalpupKixItem.asset");
Item val16 = silverAssets.LoadAsset<Item>("Assets/finished prefabs/items/KonPlushItem.asset");
PlaySoundAction playSoundAction = val16.spawnPrefab.AddComponent<PlaySoundAction>();
((GrabbableObject)playSoundAction).grabbable = true;
((GrabbableObject)playSoundAction).grabbableToEnemies = true;
((GrabbableObject)playSoundAction).itemProperties = val16;
Item val17 = silverAssets.LoadAsset<Item>("Assets/finished prefabs/items/KonMaskItem.asset");
Item val18 = silverAssets.LoadAsset<Item>("Assets/finished prefabs/items/MaskPiece1Item.asset");
Item val19 = silverAssets.LoadAsset<Item>("Assets/finished prefabs/items/MaskPiece2Item.asset");
Item val20 = silverAssets.LoadAsset<Item>("Assets/finished prefabs/items/MaskPiece3Item.asset");
Item val21 = silverAssets.LoadAsset<Item>("Assets/finished prefabs/items/KuroPlushItem.asset");
Item val22 = silverAssets.LoadAsset<Item>("Assets/finished prefabs/items/KazooItem.asset");
PlaySoundAction playSoundAction2 = val22.spawnPrefab.AddComponent<PlaySoundAction>();
((GrabbableObject)playSoundAction2).grabbable = true;
((GrabbableObject)playSoundAction2).grabbableToEnemies = true;
((GrabbableObject)playSoundAction2).itemProperties = val22;
Item val23 = silverAssets.LoadAsset<Item>("Assets/finished prefabs/items/CornPlushItem.asset");
Item val24 = silverAssets.LoadAsset<Item>("Assets/finished prefabs/items/CrabbieItem.asset");
Item val25 = silverAssets.LoadAsset<Item>("Assets/finished prefabs/items/CrabbieCowboyItem.asset");
Item val26 = silverAssets.LoadAsset<Item>("Assets/finished prefabs/items/MamaGlassesItem.asset");
Item val27 = silverAssets.LoadAsset<Item>("Assets/finished prefabs/items/DakiItem.asset");
Item val28 = silverAssets.LoadAsset<Item>("Assets/finished prefabs/items/YuiPlushItem.asset");
Item val29 = silverAssets.LoadAsset<Item>("Assets/finished prefabs/items/YuiCheeseItem.asset");
Item val30 = silverAssets.LoadAsset<Item>("Assets/finished prefabs/items/YuiHelmetItem.asset");
Item val31 = silverAssets.LoadAsset<Item>("Assets/finished prefabs/items/silverPlushItem.asset");
PlaySoundAction playSoundAction3 = val31.spawnPrefab.AddComponent<PlaySoundAction>();
((GrabbableObject)playSoundAction3).grabbable = true;
((GrabbableObject)playSoundAction3).grabbableToEnemies = true;
((GrabbableObject)playSoundAction3).itemProperties = val31;
Item val32 = silverAssets.LoadAsset<Item>("Assets/finished prefabs/items/MamaPlushItem.asset");
PlaySoundAction playSoundAction4 = val32.spawnPrefab.AddComponent<PlaySoundAction>();
((GrabbableObject)playSoundAction4).grabbable = true;
((GrabbableObject)playSoundAction4).grabbableToEnemies = true;
((GrabbableObject)playSoundAction4).itemProperties = val32;
NetworkPrefabs.RegisterNetworkPrefab(val.spawnPrefab);
Utilities.FixMixerGroups(val.spawnPrefab);
Items.RegisterScrap(val, 15, (LevelTypes)(-1));
NetworkPrefabs.RegisterNetworkPrefab(val2.spawnPrefab);
Utilities.FixMixerGroups(val2.spawnPrefab);
Items.RegisterScrap(val2, 9, (LevelTypes)(-1));
NetworkPrefabs.RegisterNetworkPrefab(val7.spawnPrefab);
Utilities.FixMixerGroups(val7.spawnPrefab);
Items.RegisterScrap(val7, 9, (LevelTypes)(-1));
NetworkPrefabs.RegisterNetworkPrefab(val5.spawnPrefab);
Utilities.FixMixerGroups(val5.spawnPrefab);
Items.RegisterScrap(val5, 7, (LevelTypes)(-1));
NetworkPrefabs.RegisterNetworkPrefab(val3.spawnPrefab);
Utilities.FixMixerGroups(val3.spawnPrefab);
Items.RegisterScrap(val3, 9, (LevelTypes)(-1));
NetworkPrefabs.RegisterNetworkPrefab(val6.spawnPrefab);
Utilities.FixMixerGroups(val6.spawnPrefab);
Items.RegisterScrap(val6, 9, (LevelTypes)(-1));
NetworkPrefabs.RegisterNetworkPrefab(val4.spawnPrefab);
Utilities.FixMixerGroups(val4.spawnPrefab);
Items.RegisterScrap(val4, 9, (LevelTypes)(-1));
NetworkPrefabs.RegisterNetworkPrefab(val8.spawnPrefab);
Utilities.FixMixerGroups(val8.spawnPrefab);
Items.RegisterScrap(val8, 10, (LevelTypes)(-1));
NetworkPrefabs.RegisterNetworkPrefab(val11.spawnPrefab);
Utilities.FixMixerGroups(val11.spawnPrefab);
Items.RegisterScrap(val11, 7, (LevelTypes)(-1));
NetworkPrefabs.RegisterNetworkPrefab(val9.spawnPrefab);
Utilities.FixMixerGroups(val9.spawnPrefab);
Items.RegisterScrap(val9, 7, (LevelTypes)(-1));
NetworkPrefabs.RegisterNetworkPrefab(val10.spawnPrefab);
Utilities.FixMixerGroups(val10.spawnPrefab);
Items.RegisterScrap(val10, 7, (LevelTypes)(-1));
NetworkPrefabs.RegisterNetworkPrefab(val12.spawnPrefab);
Utilities.FixMixerGroups(val12.spawnPrefab);
Items.RegisterScrap(val12, 6, (LevelTypes)(-1));
NetworkPrefabs.RegisterNetworkPrefab(val15.spawnPrefab);
Utilities.FixMixerGroups(val15.spawnPrefab);
Items.RegisterScrap(val15, 4, (LevelTypes)(-1));
NetworkPrefabs.RegisterNetworkPrefab(val14.spawnPrefab);
Utilities.FixMixerGroups(val14.spawnPrefab);
Items.RegisterScrap(val14, 4, (LevelTypes)(-1));
NetworkPrefabs.RegisterNetworkPrefab(val13.spawnPrefab);
Utilities.FixMixerGroups(val13.spawnPrefab);
Items.RegisterScrap(val13, 4, (LevelTypes)(-1));
NetworkPrefabs.RegisterNetworkPrefab(val31.spawnPrefab);
Utilities.FixMixerGroups(val31.spawnPrefab);
Items.RegisterScrap(val31, 2, (LevelTypes)(-1));
NetworkPrefabs.RegisterNetworkPrefab(val32.spawnPrefab);
Utilities.FixMixerGroups(val32.spawnPrefab);
Items.RegisterScrap(val32, 2, (LevelTypes)(-1));
NetworkPrefabs.RegisterNetworkPrefab(val16.spawnPrefab);
Utilities.FixMixerGroups(val16.spawnPrefab);
Items.RegisterScrap(val16, 2, (LevelTypes)(-1));
NetworkPrefabs.RegisterNetworkPrefab(val17.spawnPrefab);
Utilities.FixMixerGroups(val17.spawnPrefab);
Items.RegisterScrap(val17, 4, (LevelTypes)(-1));
NetworkPrefabs.RegisterNetworkPrefab(val18.spawnPrefab);
Utilities.FixMixerGroups(val18.spawnPrefab);
Items.RegisterScrap(val18, 6, (LevelTypes)(-1));
NetworkPrefabs.RegisterNetworkPrefab(val19.spawnPrefab);
Utilities.FixMixerGroups(val19.spawnPrefab);
Items.RegisterScrap(val19, 6, (LevelTypes)(-1));
NetworkPrefabs.RegisterNetworkPrefab(val20.spawnPrefab);
Utilities.FixMixerGroups(val20.spawnPrefab);
Items.RegisterScrap(val20, 6, (LevelTypes)(-1));
NetworkPrefabs.RegisterNetworkPrefab(val22.spawnPrefab);
Utilities.FixMixerGroups(val22.spawnPrefab);
Items.RegisterScrap(val22, 9, (LevelTypes)(-1));
NetworkPrefabs.RegisterNetworkPrefab(val21.spawnPrefab);
Utilities.FixMixerGroups(val21.spawnPrefab);
Items.RegisterScrap(val21, 4, (LevelTypes)(-1));
NetworkPrefabs.RegisterNetworkPrefab(val23.spawnPrefab);
Utilities.FixMixerGroups(val23.spawnPrefab);
Items.RegisterScrap(val23, 15, (LevelTypes)(-1));
NetworkPrefabs.RegisterNetworkPrefab(val24.spawnPrefab);
Utilities.FixMixerGroups(val24.spawnPrefab);
Items.RegisterScrap(val24, 4, (LevelTypes)(-1));
NetworkPrefabs.RegisterNetworkPrefab(val25.spawnPrefab);
Utilities.FixMixerGroups(val25.spawnPrefab);
Items.RegisterScrap(val25, 3, (LevelTypes)(-1));
NetworkPrefabs.RegisterNetworkPrefab(val26.spawnPrefab);
Utilities.FixMixerGroups(val26.spawnPrefab);
Items.RegisterScrap(val26, 5, (LevelTypes)(-1));
NetworkPrefabs.RegisterNetworkPrefab(val28.spawnPrefab);
Utilities.FixMixerGroups(val28.spawnPrefab);
Items.RegisterScrap(val28, 9, (LevelTypes)(-1));
NetworkPrefabs.RegisterNetworkPrefab(val27.spawnPrefab);
Utilities.FixMixerGroups(val27.spawnPrefab);
Items.RegisterScrap(val27, 3, (LevelTypes)(-1));
NetworkPrefabs.RegisterNetworkPrefab(val29.spawnPrefab);
Utilities.FixMixerGroups(val29.spawnPrefab);
Items.RegisterScrap(val29, 5, (LevelTypes)(-1));
NetworkPrefabs.RegisterNetworkPrefab(val30.spawnPrefab);
Utilities.FixMixerGroups(val30.spawnPrefab);
Items.RegisterScrap(val30, 5, (LevelTypes)(-1));
((BaseUnityPlugin)this).Logger.LogMessage((object)"Items loaded succesfully");
TerminalNode val33 = ScriptableObject.CreateInstance<TerminalNode>();
val33.clearPreviousText = true;
val33.displayText = "This is a silvervale plushie made by Niko\n";
Items.RegisterShopItem(val31, (TerminalNode)null, (TerminalNode)null, val33, 200);
val33.clearPreviousText = true;
val33.displayText = "This is a mamavale plushie made by Niko\n";
Items.RegisterShopItem(val32, (TerminalNode)null, (TerminalNode)null, val33, 200);
val33.clearPreviousText = true;
val33.displayText = "This is a Konzetsu plushie made by Lolstarrr\n";
Items.RegisterShopItem(val16, (TerminalNode)null, (TerminalNode)null, val33, 200);
val33.clearPreviousText = true;
val33.displayText = "Dakimakura of goddess Silvervale\n";
Items.RegisterShopItem(val27, (TerminalNode)null, (TerminalNode)null, val33, 200);
((BaseUnityPlugin)this).Logger.LogMessage((object)"Store loaded succesfully");
((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin silverPlushies is loaded!");
}
}
public static class PluginInfo
{
public const string PLUGIN_GUID = "silverPlushies";
public const string PLUGIN_NAME = "silverPlushies";
public const string PLUGIN_VERSION = "1.0.0";
}
}
namespace silverPlushies.Behaviours
{
internal class PlaySoundAction : PhysicsProp
{
public override void ItemActivate(bool used, bool buttonDown = true)
{
//IL_0251: 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_03a0: Unknown result type (might be due to invalid IL or missing references)
//IL_03a5: Unknown result type (might be due to invalid IL or missing references)
//IL_03e3: Unknown result type (might be due to invalid IL or missing references)
//IL_03e8: 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_02d0: 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_02e5: Unknown result type (might be due to invalid IL or missing references)
//IL_0303: Unknown result type (might be due to invalid IL or missing references)
//IL_0321: Unknown result type (might be due to invalid IL or missing references)
//IL_0323: Unknown result type (might be due to invalid IL or missing references)
//IL_04b2: Unknown result type (might be due to invalid IL or missing references)
//IL_04b4: Unknown result type (might be due to invalid IL or missing references)
//IL_04c7: Unknown result type (might be due to invalid IL or missing references)
//IL_04e5: Unknown result type (might be due to invalid IL or missing references)
//IL_0503: Unknown result type (might be due to invalid IL or missing references)
//IL_0505: Unknown result type (might be due to invalid IL or missing references)
AudioSource component = ((Component)this).GetComponent<AudioSource>();
((GrabbableObject)this).ItemActivate(used, buttonDown);
bool flag = false;
AssetBundle silverAssets = Plugin.silverAssets;
Debug.Log((object)"loading angry mama prefab");
GameObject val = silverAssets.LoadAsset<GameObject>("Assets/mamaAngrySoundPrefab.prefab");
AudioClip val2 = null;
if ((Object)(object)val != (Object)null)
{
Debug.Log((object)"Angry mama gameobject loaded");
AudioSource component2 = val.GetComponent<AudioSource>();
if ((Object)(object)component2 != (Object)null)
{
Debug.Log((object)"Angry mama AudioSource loaded");
val2 = component2.clip;
}
}
if ((Object)(object)((GrabbableObject)this).itemProperties.throwSFX != (Object)null)
{
Debug.Log((object)"There is a throw SFX");
AudioClip throwSFX = ((GrabbableObject)this).itemProperties.throwSFX;
if (!buttonDown)
{
return;
}
if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null)
{
if ((Object)(object)((GrabbableObject)this).playerHeldBy.ItemSlots[0] != (Object)null)
{
if (((GrabbableObject)this).playerHeldBy.ItemSlots[0].itemProperties.itemName == "GolKaz")
{
flag = true;
}
}
else
{
Debug.Log((object)"Item slot 0 is null");
}
if ((Object)(object)((GrabbableObject)this).playerHeldBy.ItemSlots[1] != (Object)null)
{
if (((GrabbableObject)this).playerHeldBy.ItemSlots[1].itemProperties.itemName == "GolKaz")
{
flag = true;
}
}
else
{
Debug.Log((object)"Item slot 1 is null");
}
if ((Object)(object)((GrabbableObject)this).playerHeldBy.ItemSlots[2] != (Object)null)
{
if (((GrabbableObject)this).playerHeldBy.ItemSlots[2].itemProperties.itemName == "GolKaz")
{
flag = true;
}
}
else
{
Debug.Log((object)"Item slot 2 is null");
}
if ((Object)(object)((GrabbableObject)this).playerHeldBy.ItemSlots[3] != (Object)null)
{
if (((GrabbableObject)this).playerHeldBy.ItemSlots[3].itemProperties.itemName == "GolKaz")
{
flag = true;
}
}
else
{
Debug.Log((object)"Item slot 3 is null");
}
Vector3 val5;
if (((GrabbableObject)this).itemProperties.itemName == "Mamavale plushie" && flag)
{
Debug.Log((object)"Mamavale and Kazoo are held");
GameObject gameObject = ((Component)((GrabbableObject)this).playerHeldBy).gameObject;
Vector3 position = gameObject.transform.position;
if ((Object)(object)component != (Object)null)
{
component.PlayOneShot(val2, 2f);
Debug.Log((object)"Angry Mama sound playing");
}
else
{
Debug.Log((object)"Could not find audio source of angry Mama");
}
SpawnableMapObject[] spawnableMapObjects = RoundManager.Instance.currentLevel.spawnableMapObjects;
foreach (SpawnableMapObject val3 in spawnableMapObjects)
{
if (!((Object)(object)val3.prefabToSpawn.GetComponentInChildren<Landmine>() == (Object)null))
{
GameObject val4 = Object.Instantiate<GameObject>(val3.prefabToSpawn, position, Quaternion.identity);
val4.transform.position = position;
val4.transform.forward = new Vector3(1f, 0f, 0f);
val4.GetComponent<NetworkObject>().Spawn(true);
val5 = position;
Debug.Log((object)("Tried spawning a mine at " + ((object)(Vector3)(ref val5)).ToString()));
break;
}
}
}
else if (((GrabbableObject)this).itemProperties.itemName == "GolKaz")
{
bool flag2 = false;
Vector3[] array = (Vector3[])(object)new Vector3[0];
GameObject[] array2 = GameObject.FindGameObjectsWithTag("PhysicsProp");
GameObject gameObject2 = ((Component)((GrabbableObject)this).playerHeldBy).gameObject;
Vector3 position2 = gameObject2.transform.position;
GameObject[] array3 = array2;
foreach (GameObject val6 in array3)
{
if (((Object)val6).name == "MamaPlush(Clone)")
{
Debug.Log((object)"Found a mamavale plush");
if (Vector3.Distance(val6.transform.position, position2) < 2f)
{
flag2 = true;
}
CollectionExtensions.AddItem<Vector3>((IEnumerable<Vector3>)array, val6.transform.position);
}
}
if (flag2)
{
Debug.Log((object)"Mamaplush is close");
if ((Object)(object)component != (Object)null)
{
component.PlayOneShot(val2, 2.5f);
Debug.Log((object)"Angry Mama sound playing");
}
else
{
Debug.Log((object)"Could not find audio source of angry Mama");
}
SpawnableMapObject[] spawnableMapObjects2 = RoundManager.Instance.currentLevel.spawnableMapObjects;
foreach (SpawnableMapObject val7 in spawnableMapObjects2)
{
if (!((Object)(object)val7.prefabToSpawn.GetComponentInChildren<Landmine>() == (Object)null))
{
GameObject val8 = Object.Instantiate<GameObject>(val7.prefabToSpawn, position2, Quaternion.identity);
val8.transform.position = position2;
val8.transform.forward = new Vector3(1f, 0f, 0f);
val8.GetComponent<NetworkObject>().Spawn(true);
val5 = position2;
Debug.Log((object)("Tried spawning a mine at " + ((object)(Vector3)(ref val5)).ToString()));
break;
}
}
}
else
{
Debug.Log((object)"Mamaplush is far");
if ((Object)(object)component != (Object)null)
{
component.PlayOneShot(throwSFX, 1f);
Debug.Log((object)"normal sound effect playing");
}
else
{
Debug.Log((object)"Could not find audio source of normal item");
}
}
}
else if ((Object)(object)component != (Object)null)
{
component.PlayOneShot(throwSFX, 1f);
Debug.Log((object)"normal sound effect playing");
}
else
{
Debug.Log((object)"Could not find audio source of normal item");
}
}
else
{
Debug.Log((object)"not held by player");
}
}
else
{
Debug.Log((object)"Throw SFX not found");
}
}
}
}