using System; 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.Bootstrap; using BepInEx.Logging; using Microsoft.CodeAnalysis; using UnityEngine; using loaforcsSoundAPI; using loaforcsSoundAPI.SoundPacks.Data.Conditions; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("XuXiaolan,loaforc")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("0.9.21.0")] [assembly: AssemblyInformationalVersion("0.9.21+78d07c774d74f29674974668e8e7aca2a1029d4a")] [assembly: AssemblyProduct("DawnLib.Compatibility")] [assembly: AssemblyTitle("com.github.teamxiaolan.dawnlib.compatibility")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.9.21.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 Dawn.Compatibility { [BepInPlugin("com.github.teamxiaolan.dawnlib.compatibility", "DawnLib.Compatibility", "0.9.21")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] public class DawnCompatibilityPlugin : BaseUnityPlugin { internal static ManualLogSource Logger { get; private set; } private void Awake() { Logger = ((BaseUnityPlugin)this).Logger; if (SoundAPICompat.Enabled) { SoundAPICompat.Init(); } Logger.LogInfo((object)"com.github.teamxiaolan.dawnlib.compatibility v0.9.21 has loaded!"); } } internal class DawnTaggableCondition : Condition { [CompilerGenerated] private Func P; private NamespacedKey? _key; public string Value { get; private set; } public DawnTaggableCondition(Func generator) { P = generator; ((Condition)this)..ctor(); } public override bool Evaluate(IContext context) { if (_key == null) { _key = NamespacedKey.ForceParse(Value); } ITaggable val = P(); if (val != null) { return val.HasTag(_key); } return false; } } internal static class SoundAPICompat { public static bool Enabled => Chainloader.PluginInfos.ContainsKey("me.loaforc.soundapi"); [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] internal static void Init() { SoundAPI.RegisterCondition("DawnLib:moon:has_tag", (Func)(() => (Condition)(object)new DawnTaggableCondition(() => (ITaggable?)(object)((!Object.op_Implicit((Object)(object)StartOfRound.Instance)) ? null : SelectableLevelExtensions.GetDawnInfo(StartOfRound.Instance.currentLevel))))); SoundAPI.RegisterCondition("DawnLib:dungeon:has_tag", (Func)(() => (Condition)(object)new DawnTaggableCondition(delegate { if (!Object.op_Implicit((Object)(object)RoundManager.Instance)) { return null; } return (ITaggable?)(object)((!Object.op_Implicit((Object)(object)RoundManager.Instance.dungeonGenerator)) ? null : DungeonFlowExtensions.GetDawnInfo(RoundManager.Instance.dungeonGenerator.Generator.DungeonFlow)); }))); } } public static class MyPluginInfo { public const string PLUGIN_GUID = "com.github.teamxiaolan.dawnlib.compatibility"; public const string PLUGIN_NAME = "DawnLib.Compatibility"; public const string PLUGIN_VERSION = "0.9.21"; } }