using System;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using LethalConfig;
using LethalConfig.ConfigItems;
using LethalLib.Modules;
using SharedUtils;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.Audio;
using YippeeScrap.Assets.Mods.Yippee;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyVersion("0.0.0.0")]
[CompilerGenerated]
[EditorBrowsable(EditorBrowsableState.Never)]
[GeneratedCode("Unity.MonoScriptGenerator.MonoScriptInfoGenerator", null)]
internal class UnitySourceGeneratedAssemblyMonoScriptTypes_v1
{
private struct MonoScriptData
{
public byte[] FilePathsData;
public byte[] TypesData;
public int TotalTypes;
public int TotalFiles;
public bool IsEditorOnly;
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private static MonoScriptData Get()
{
MonoScriptData result = default(MonoScriptData);
result.FilePathsData = new byte[179]
{
0, 0, 0, 1, 0, 0, 0, 41, 92, 65,
115, 115, 101, 116, 115, 92, 77, 111, 100, 115,
92, 89, 105, 112, 112, 101, 101, 92, 76, 101,
116, 104, 97, 108, 67, 111, 110, 102, 105, 103,
67, 111, 109, 112, 97, 116, 46, 99, 115, 0,
0, 0, 1, 0, 0, 0, 29, 92, 65, 115,
115, 101, 116, 115, 92, 77, 111, 100, 115, 92,
89, 105, 112, 112, 101, 101, 92, 80, 108, 117,
103, 105, 110, 46, 99, 115, 0, 0, 0, 1,
0, 0, 0, 33, 92, 65, 115, 115, 101, 116,
115, 92, 77, 111, 100, 115, 92, 89, 105, 112,
112, 101, 101, 92, 80, 108, 117, 103, 105, 110,
73, 110, 102, 111, 46, 99, 115, 0, 0, 0,
1, 0, 0, 0, 44, 92, 65, 115, 115, 101,
116, 115, 92, 77, 111, 100, 115, 92, 89, 105,
112, 112, 101, 101, 92, 85, 116, 105, 108, 115,
92, 65, 117, 100, 105, 111, 77, 105, 120, 101,
114, 70, 105, 120, 101, 114, 46, 99, 115
};
result.TypesData = new byte[136]
{
0, 0, 0, 0, 49, 89, 105, 112, 112, 101,
101, 83, 99, 114, 97, 112, 46, 65, 115, 115,
101, 116, 115, 46, 77, 111, 100, 115, 46, 89,
105, 112, 112, 101, 101, 124, 76, 101, 116, 104,
97, 108, 67, 111, 110, 102, 105, 103, 67, 111,
109, 112, 97, 116, 0, 0, 0, 0, 18, 89,
105, 112, 112, 101, 101, 83, 99, 114, 97, 112,
124, 80, 108, 117, 103, 105, 110, 0, 0, 0,
0, 22, 89, 105, 112, 112, 101, 101, 83, 99,
114, 97, 112, 124, 80, 108, 117, 103, 105, 110,
73, 110, 102, 111, 0, 0, 0, 0, 27, 89,
105, 112, 112, 101, 101, 83, 99, 114, 97, 112,
124, 65, 117, 100, 105, 111, 77, 105, 120, 101,
114, 70, 105, 120, 101, 114
};
result.TotalFiles = 4;
result.TotalTypes = 4;
result.IsEditorOnly = false;
return result;
}
}
namespace YippeeScrap
{
[BepInPlugin("ainavt.lc.yippee", "YippeeScrap", "1.0.7")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
public class Plugin : BaseUnityPlugin
{
private static Plugin instance;
private static AssetBundle assetBundle;
private static ConfigEntry<int> configRarity;
private void Awake()
{
if ((Object)(object)instance == (Object)null)
{
instance = this;
}
LogUtils.Init("ainavt.lc.yippee");
LoadScrap(PathUtils.PathForResourceInAssembly("ainavt_yippee", (Assembly)null), "Assets/mods/Yippee/Yippee.asset", "Yippee");
LogUtils.LogInfo("YippeeScrap loaded!");
}
private void LoadScrap(string assetBundlePath, string innerAssetPath, string name)
{
//IL_0016: Unknown result type (might be due to invalid IL or missing references)
//IL_003a: Unknown result type (might be due to invalid IL or missing references)
//IL_0044: Expected O, but got Unknown
//IL_0044: Expected O, but got Unknown
configRarity = ((BaseUnityPlugin)this).Config.Bind<int>(new ConfigDefinition("General", name + " Rarity"), 30, new ConfigDescription("How often " + name + " will show up. Higher value means more likely to show up", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), Array.Empty<object>()));
assetBundle = AssetBundle.LoadFromFile(assetBundlePath);
Item val = assetBundle.LoadAsset<Item>(innerAssetPath);
if ((Object)(object)val == (Object)null)
{
LogUtils.LogError("Failed to load " + name + " assets.");
}
else
{
NetworkPrefabs.RegisterNetworkPrefab(val.spawnPrefab);
Items.RegisterScrap(val, configRarity.Value, (LevelTypes)(-1));
LogUtils.LogInfo(name + " scrap loaded!");
}
if (LethalConfigCompat.IsAvailable)
{
LethalConfigCompat.AddIntSlider(configRarity, restartRequired: true);
}
}
}
[StructLayout(LayoutKind.Sequential, Size = 1)]
internal struct PluginInfo
{
public const string Guid = "ainavt.lc.yippee";
public const string Name = "YippeeScrap";
public const string Version = "1.0.7";
}
public class AudioMixerFixer : MonoBehaviour
{
private static AudioMixerGroup _masterDiageticMixer;
[SerializeField]
private List<AudioSource> sourcesToFix;
public static AudioMixerGroup MasterDiageticMixer
{
get
{
if ((Object)(object)_masterDiageticMixer == (Object)null)
{
AudioSource? obj = (from p in ((Component)GameNetworkManager.Instance).GetComponent<NetworkManager>().NetworkConfig.Prefabs.Prefabs
select p.Prefab.GetComponentInChildren<NoisemakerProp>() into p
where (Object)(object)p != (Object)null
select ((Component)p).GetComponentInChildren<AudioSource>() into p
where (Object)(object)p != (Object)null
select p).FirstOrDefault();
if ((Object)(object)obj == (Object)null)
{
throw new Exception("Failed to locate a suitable AudioSource output mixer to reference! Could you be calling this method before the GameNetworkManager is initialized?");
}
_masterDiageticMixer = obj.outputAudioMixerGroup;
}
return _masterDiageticMixer;
}
}
private void Start()
{
AudioSource[] componentsInChildren = ((Component)this).GetComponentsInChildren<AudioSource>();
foreach (AudioSource item in componentsInChildren)
{
if (!sourcesToFix.Contains(item))
{
sourcesToFix.Add(item);
}
}
foreach (AudioSource item2 in sourcesToFix)
{
LogUtils.LogInfo("Replaced source to diagetic mixer.");
item2.outputAudioMixerGroup = MasterDiageticMixer;
}
}
}
}
namespace YippeeScrap.Assets.Mods.Yippee
{
internal static class LethalConfigCompat
{
public const string GUID = "ainavt.lc.lethalconfig";
public static bool IsAvailable => Chainloader.PluginInfos.ContainsKey("ainavt.lc.lethalconfig");
[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
public static void AddIntSlider(ConfigEntry<int> entry, bool restartRequired)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Expected O, but got Unknown
LethalConfigManager.AddConfigItem((BaseConfigItem)new IntSliderConfigItem(entry, restartRequired));
}
}
}