Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of NorseDemigods v1.8.1
plugins\AnimationSpeedManager.dll
Decompiled a day agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using HarmonyLib; using JetBrains.Annotations; using Microsoft.CodeAnalysis; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyTitle("AnimationSpeedManager")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("AnimationSpeedManager")] [assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("B3A6D52C-449A-4665-9FD0-BB48C8CF2CDF")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.6.2", FrameworkDisplayName = ".NET Framework 4.6.2")] [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; } } } public static class AnimationSpeedManager { public delegate double Handler(Character character, double speed); private static readonly Harmony harmony = new Harmony("AnimationSpeedManager"); private static bool hasMarkerPatch = false; private static readonly MethodInfo method = AccessTools.DeclaredMethod(typeof(CharacterAnimEvent), "CustomFixedUpdate", (Type[])null, (Type[])null); private static int index = 0; private static bool changed = false; private static Handler[][] handlers = Array.Empty<Handler[]>(); private static readonly Dictionary<int, List<Handler>> handlersPriorities = new Dictionary<int, List<Handler>>(); [PublicAPI] public static void Add(Handler handler, int priority = 400) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Expected O, but got Unknown //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Expected O, but got Unknown if (!hasMarkerPatch) { harmony.Patch((MethodBase)method, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, new HarmonyMethod(AccessTools.DeclaredMethod(typeof(AnimationSpeedManager), "markerPatch", (Type[])null, (Type[])null)), (HarmonyMethod)null); hasMarkerPatch = true; } if (!handlersPriorities.TryGetValue(priority, out List<Handler> value)) { handlersPriorities.Add(priority, value = new List<Handler>()); harmony.Patch((MethodBase)method, (HarmonyMethod)null, new HarmonyMethod(AccessTools.DeclaredMethod(typeof(AnimationSpeedManager), "wrapper", (Type[])null, (Type[])null)), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); } value.Add(handler); handlers = (from kv in handlersPriorities orderby kv.Key select kv.Value.ToArray()).ToArray(); } private static void wrapper(Character ___m_character, Animator ___m_animator) { Character ___m_character2 = ___m_character; double num = (double)___m_animator.speed * 10000000.0 % 100.0; if ((!(num > 10.0) || !(num < 30.0)) && !(___m_animator.speed <= 0.001f)) { double num2 = ___m_animator.speed; double num3 = handlers[index++].Aggregate(num2, (double current, Handler handler) => handler(___m_character2, current)); if (num3 != num2) { ___m_animator.speed = (float)(num3 - num3 % 1E-05); changed = true; } } } private static void markerPatch(Animator ___m_animator) { if (changed) { double num = (double)___m_animator.speed * 10000000.0 % 100.0; if ((num < 10.0 || num > 30.0) ? true : false) { ___m_animator.speed += 1.9E-06f; } changed = false; } index = 0; } }
plugins\NorseDemigods.dll
Decompiled a day ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Serialization.Formatters.Binary; using System.Runtime.Versioning; using System.Security.Permissions; using System.Text; using BepInEx; using BepInEx.Configuration; using DigitalRuby.LightningBolt; using HarmonyLib; using Jotunn; using Jotunn.Configs; using Jotunn.Entities; using Jotunn.Managers; using Jotunn.Utils; using Microsoft.CodeAnalysis; using NorseDemigods.Abilities; using NorseDemigods.Attributes; using NorseDemigods.Controllers; using NorseDemigods.DataProperties; using NorseDemigods.Demigods; using NorseDemigods.Patches; using NorseDemigods.StatusEffects; using SimpleJson; using UnityEngine; using UnityEngine.Audio; using UnityEngine.Events; using UnityEngine.SceneManagement; using UnityEngine.UI; using YamlDotNet.Serialization; using YamlDotNet.Serialization.NamingConventions; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyTitle("NorseDemigods")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("NorseDemigods")] [assembly: AssemblyCopyright("Copyright © 2021")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("e3243d22-4307-4008-ba36-9f326008cde5")] [assembly: AssemblyFileVersion("0.0.1.0")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.0.1.0")] 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; } } } namespace DigitalRuby.LightningBolt { public enum LightningBoltAnimationMode { None, Random, Loop, PingPong } [RequireComponent(typeof(LineRenderer))] public class LightningBoltScript : MonoBehaviour { [Tooltip("The game object from which the lightning is emitted. If null, StartPosition is used.")] public GameObject StartObject; [Tooltip("The position from which the lightning is emitted. This is in world space if StartObject is null; otherwise, it is an offset from StartObject's position.")] public Vector3 StartPosition; [Tooltip("The game object at which the lightning ends. If null, EndPosition is used.")] public GameObject EndObject; [Tooltip("The position at which the lightning ends. This is in world space if EndObject is null; otherwise, it is an offset from EndObject's position.")] public Vector3 EndPosition; [Range(0f, 8f)] [Tooltip("How many generations? Higher numbers create more line segments.")] public int Generations = 6; [Range(0.01f, 1f)] [Tooltip("How long each bolt should last before creating a new bolt. In ManualMode, the bolt will simply disappear after this number of seconds.")] public float Duration = 0.05f; private float timer; [Range(0f, 1f)] [Tooltip("How chaotic should the lightning be? (0-1)")] public float ChaosFactor = 0.15f; [Tooltip("In manual mode, the trigger method must be called to create a bolt")] public bool ManualMode; [Range(1f, 64f)] [Tooltip("The number of rows in the texture. Used for animation.")] public int Rows = 1; [Range(1f, 64f)] [Tooltip("The number of columns in the texture. Used for animation.")] public int Columns = 1; [Tooltip("The animation mode for the lightning")] public LightningBoltAnimationMode AnimationMode = LightningBoltAnimationMode.PingPong; [NonSerialized] [HideInInspector] public Random RandomGenerator = new Random(); private LineRenderer lineRenderer; private List<KeyValuePair<Vector3, Vector3>> segments = new List<KeyValuePair<Vector3, Vector3>>(); private int startIndex; private Vector2 size; private Vector2[] offsets; private int animationOffsetIndex; private int animationPingPongDirection = 1; private bool orthographic; private void GetPerpendicularVector(ref Vector3 directionNormalized, out Vector3 side) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: 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_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) if (directionNormalized == Vector3.zero) { side = Vector3.right; return; } float x = directionNormalized.x; float y = directionNormalized.y; float z = directionNormalized.z; float num = Mathf.Abs(x); float num2 = Mathf.Abs(y); float num3 = Mathf.Abs(z); float num4; float num5; float num6; if (num >= num2 && num2 >= num3) { num4 = 1f; num5 = 1f; num6 = (0f - (y * num4 + z * num5)) / x; } else if (num2 >= num3) { num6 = 1f; num5 = 1f; num4 = (0f - (x * num6 + z * num5)) / y; } else { num6 = 1f; num4 = 1f; num5 = (0f - (x * num6 + y * num4)) / z; } Vector3 val = new Vector3(num6, num4, num5); side = ((Vector3)(ref val)).normalized; } private void GenerateLightningBolt(Vector3 start, Vector3 end, int generation, int totalGenerations, float offsetAmount) { //IL_0039: 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_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: 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_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: 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_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) if (generation < 0 || generation > 8) { return; } if (orthographic) { start.z = (end.z = Mathf.Min(start.z, end.z)); } segments.Add(new KeyValuePair<Vector3, Vector3>(start, end)); if (generation == 0) { return; } if (offsetAmount <= 0f) { Vector3 val = end - start; offsetAmount = ((Vector3)(ref val)).magnitude * ChaosFactor; } while (generation-- > 0) { int num = startIndex; startIndex = segments.Count; for (int i = num; i < startIndex; i++) { start = segments[i].Key; end = segments[i].Value; Vector3 val2 = (start + end) * 0.5f; RandomVector(ref start, ref end, offsetAmount, out var result); val2 += result; segments.Add(new KeyValuePair<Vector3, Vector3>(start, val2)); segments.Add(new KeyValuePair<Vector3, Vector3>(val2, end)); } offsetAmount *= 0.5f; } } public void RandomVector(ref Vector3 start, ref Vector3 end, float offsetAmount, out Vector3 result) { //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //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_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) Vector3 val; if (orthographic) { val = end - start; Vector3 normalized = ((Vector3)(ref val)).normalized; Vector3 val2 = default(Vector3); ((Vector3)(ref val2))..ctor(0f - normalized.y, normalized.x, normalized.z); float num = (float)RandomGenerator.NextDouble() * offsetAmount * 2f - offsetAmount; result = val2 * num; } else { val = end - start; Vector3 directionNormalized = ((Vector3)(ref val)).normalized; GetPerpendicularVector(ref directionNormalized, out var side); float num2 = ((float)RandomGenerator.NextDouble() + 0.1f) * offsetAmount; float num3 = (float)RandomGenerator.NextDouble() * 360f; result = Quaternion.AngleAxis(num3, directionNormalized) * side * num2; } } private void SelectOffsetFromAnimationMode() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) if (AnimationMode == LightningBoltAnimationMode.None) { ((Renderer)lineRenderer).material.mainTextureOffset = offsets[0]; return; } int num; if (AnimationMode == LightningBoltAnimationMode.PingPong) { num = animationOffsetIndex; animationOffsetIndex += animationPingPongDirection; if (animationOffsetIndex >= offsets.Length) { animationOffsetIndex = offsets.Length - 2; animationPingPongDirection = -1; } else if (animationOffsetIndex < 0) { animationOffsetIndex = 1; animationPingPongDirection = 1; } } else if (AnimationMode == LightningBoltAnimationMode.Loop) { num = animationOffsetIndex++; if (animationOffsetIndex >= offsets.Length) { animationOffsetIndex = 0; } } else { num = RandomGenerator.Next(0, offsets.Length); } if (num >= 0 && num < offsets.Length) { ((Renderer)lineRenderer).material.mainTextureOffset = offsets[num]; } else { ((Renderer)lineRenderer).material.mainTextureOffset = offsets[0]; } } private void UpdateLineRenderer() { //IL_0047: 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) int num = segments.Count - startIndex + 1; lineRenderer.positionCount = num; if (num >= 1) { int num2 = 0; lineRenderer.SetPosition(num2++, segments[startIndex].Key); for (int i = startIndex; i < segments.Count; i++) { lineRenderer.SetPosition(num2++, segments[i].Value); } segments.Clear(); SelectOffsetFromAnimationMode(); } } private void Start() { orthographic = (Object)(object)Camera.main != (Object)null && Camera.main.orthographic; lineRenderer = ((Component)this).GetComponent<LineRenderer>(); lineRenderer.positionCount = 0; UpdateFromMaterialChange(); } private void Update() { orthographic = (Object)(object)Camera.main != (Object)null && Camera.main.orthographic; if (timer <= 0f) { if (ManualMode) { timer = Duration; lineRenderer.positionCount = 0; } else { Trigger(); } } timer -= Time.deltaTime; } public void Trigger() { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0072: 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) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) timer = Duration + Mathf.Min(0f, timer); Vector3 start = ((!((Object)(object)StartObject == (Object)null)) ? (StartObject.transform.position + StartPosition) : StartPosition); Vector3 end = ((!((Object)(object)EndObject == (Object)null)) ? (EndObject.transform.position + EndPosition) : EndPosition); startIndex = 0; GenerateLightningBolt(start, end, Generations, Generations, 0f); UpdateLineRenderer(); } public void UpdateFromMaterialChange() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0031: 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) //IL_0084: Unknown result type (might be due to invalid IL or missing references) size = new Vector2(1f / (float)Columns, 1f / (float)Rows); ((Renderer)lineRenderer).material.mainTextureScale = size; offsets = (Vector2[])(object)new Vector2[Rows * Columns]; for (int i = 0; i < Rows; i++) { for (int j = 0; j < Columns; j++) { offsets[j + i * Columns] = new Vector2((float)j / (float)Columns, (float)i / (float)Rows); } } } } } namespace NorseDemigods { public class Cache { public struct CachedItemDataKey { public readonly string ItemName; public readonly Type Ability; public CachedItemDataKey(string itemName, Type ability) { ItemName = itemName; Ability = ability; } } public static LayerMask LayerMaskDestructibles = LayerMask.op_Implicit(LayerMask.GetMask(new string[7] { "Default", "Default_small", "hitbox", "piece", "piece_nonsolid", "static_solid", "vehicle" })); public static LayerMask LayerMaskItems = LayerMask.op_Implicit(LayerMask.GetMask(new string[1] { "item" })); public static LayerMask LayerMaskPieces = LayerMask.op_Implicit(LayerMask.GetMask(new string[1] { "piece" })); public static LayerMask LayerMaskCharacters = LayerMask.op_Implicit(LayerMask.GetMask(new string[3] { "character", "character_ghost", "character_net" })); public static LayerMask LayerMaskEnvironment = LayerMask.op_Implicit(LayerMask.GetMask(new string[8] { "Default", "Default_small", "item", "piece", "piece_nonsolid", "static_solid", "terrain", "vehicle" })); public static LayerMask LayerMaskEnvNoTerrain = LayerMask.op_Implicit(LayerMask.GetMask(new string[7] { "Default", "Default_small", "item", "piece", "piece_nonsolid", "static_solid", "vehicle" })); public static LayerMask LayerMaskEnvWithWater = LayerMask.op_Implicit(LayerMask.GetMask(new string[9] { "Default", "Default_small", "item", "piece", "piece_nonsolid", "static_solid", "terrain", "vehicle", "Water" })); public static LayerMask LayerMaskEnvOnlySolid = LayerMask.op_Implicit(LayerMask.GetMask(new string[5] { "Default", "Default_small", "piece", "static_solid", "terrain" })); public static LayerMask LayerMaskTerrainWithWater = LayerMask.op_Implicit(LayerMask.GetMask(new string[2] { "terrain", "Water" })); public static LayerMask LayerMaskTerrain = LayerMask.op_Implicit(LayerMask.GetMask(new string[1] { "terrain" })); public static LayerMask LayerMaskWater = LayerMask.op_Implicit(LayerMask.GetMask(new string[1] { "Water" })); public static LayerMask LayerMaskWaterVolume = LayerMask.op_Implicit(LayerMask.GetMask(new string[1] { "WaterVolume" })); public static LayerMask LayerMaskEverything = LayerMask.op_Implicit(LayerMask.GetMask(new string[12] { "character", "character_ghost", "character_net", "Default", "Default_small", "hitbox", "item", "piece", "piece_nonsolid", "static_solid", "terrain", "vehicle" })); public static readonly int s_statusEffectSlowFall = StringExtensionMethods.GetStableHashCode("SlowFall"); public static readonly int s_statusEffectJCGliding = StringExtensionMethods.GetStableHashCode("JCGliding"); public static readonly int s_statusEffectDarkWings = StringExtensionMethods.GetStableHashCode("SE_DarkWings"); public static readonly int s_statusEffectElectricWings = StringExtensionMethods.GetStableHashCode("JC_Electric_Wings_SE"); public static readonly int s_statusEffectFenringArmor = StringExtensionMethods.GetStableHashCode("SetEffect_FenringArmor"); public static readonly int s_statusEffectBerserkerArmor = StringExtensionMethods.GetStableHashCode("SetEffect_BerserkerArmor"); public static readonly int s_statusEffectInfusedBeltStrength = StringExtensionMethods.GetStableHashCode("SE_Infused_Belt_Strength"); public static readonly int itemHashFistBjornClaw = StringExtensionMethods.GetStableHashCode("FistBjornClaw"); public static readonly int itemHashFenrirClaws = StringExtensionMethods.GetStableHashCode("fenrir_claws"); public static GameObject FxLightningWithSoundOnline; public static GameObject FxLightningWithoutSoundOnline; public static GameObject FxLightningWithoutSoundOffline; public static GameObject FxFlameOnline; public static GameObject FxFlameWithSoundOnline; public static GameObject FxFlameTransparentOnline; public static GameObject FxFlameTransparentOffline; public static Piece PieceWard; public static Attack AcidBoltAttack; public static Attack ArcaneBoltAttack; public static Attack IceshardsAttack; public static Attack LightningBoltAttack; public static Attack PoisonJavelinAttack; public static Attack UnarmedClawAttack; public static AnimationClip CachedAnimPunch1; public static AnimationClip CachedAnimPunch2; public static AnimationClip CachedAnimSlash1; public static AnimationClip CachedAnimSlash2; public static AnimationClip CachedAnimSlash3; public static AnimationClip CachedAnimSlash4; public static AnimationClip CachedAnimFireball1; public static AnimationClip CachedAnimFireball2; public static AnimationClip CachedAnimMaceSecondary; public static AnimationClip CachedAnimSwordSecondary; public static AnimationClip CachedAnimGuardianPower; public static Vector3? BrennaLocation; public static readonly Dictionary<int, GameObject> OfflinePrefabs = new Dictionary<int, GameObject>(); public static readonly Dictionary<string, SharedData> OriginalItemSharedDataDictionary = new Dictionary<string, SharedData>(); public static readonly Dictionary<CachedItemDataKey, SharedData> ModifiedItemSharedDataDictionary = new Dictionary<CachedItemDataKey, SharedData>(); public static Demigod MyDemigod { get; set; } = null; public static CachedItemDataKey GetCachedItemDataKey(string itemName, Type ability) { return new CachedItemDataKey(itemName, ability); } public static void ClearCache() { ModifiedItemSharedDataDictionary.Clear(); MyDemigod = null; } } public interface IUpgradableAttribute { int AttributeLevel { get; set; } string[] Consumables { get; } } [Serializable] public class SoundEffectProperties { public string AudioTypeName { get; set; } public string AudioClipName { get; set; } public float MinDistance { get; set; } public float MaxDistance { get; set; } public float MaxVolume { get; set; } public float FadeTime { get; set; } public float StartTime { get; set; } public float EndTime { get; set; } } public class DemigodAbility : IDemigodEntity { public struct AbilityParametersStruct { public AbilityType AbilityType; public SkillType[] SkillTypes; public object Properties; public AbilityParametersStruct(AbilityType abilityType, SkillType[] skillTypes = null, object properties = null) { AbilityType = abilityType; Properties = properties; if (skillTypes != null) { SkillTypes = skillTypes; } else { SkillTypes = (SkillType[])(object)new SkillType[1]; } } } public enum AbilityType { NONE, SLOT_1, SLOT_2, SLOT_3, SLOT_4, TELEPORT, SPECIAL_ATTACK, SPECIAL_ATTACK_AIR, SPECIAL_ATTACK_BLOCKING } public static bool IsGamePadAbilityModifierActive; protected SE_Ability_Cooldown AbilityCooldownStatusEffect; private int s_statusEffectCooldown; private float energyDrainTimer = -1f; private float tickTimer = -1f; private float lifeTimer = -1f; private float lifeTime; private int energyDrainedSinceActivation = -1; private Player owner; private Demigod demigod; public AbilityParametersStruct AbilityParameters { get; protected set; } public Texture2D Icon { get; protected set; } public string ClassName { get; set; } public string ConfigName { get; set; } public string DisplayName { get; set; } public int EnergyRequired { get; protected set; } public int EnergyCost { get; protected set; } public int EitrCost { get; protected set; } public float EnergyDrainPeriod { get; protected set; } public float Cooldown { get; protected set; } public float Duration { get; protected set; } public bool IsBuff { get; protected set; } public bool IsChanneled { get; protected set; } public bool IsActive { get; protected set; } public bool CanBeStopped { get; protected set; } public bool StoppedAfterTeleporting { get; private set; } public Player Owner { get { return owner; } set { owner = value; } } public Demigod Demigod { get { return demigod; } set { demigod = value; } } public bool DrainsEnergy => EnergyDrainPeriod > 0f; public float LifeTime => lifeTime; public DemigodAbility(AbilityParametersStruct abilityInfo) { AbilityParameters = abilityInfo; Helper.SetupDemigodEntity(this); s_statusEffectCooldown = StringExtensionMethods.GetStableHashCode(GetType().Name + "Cooldown"); } public DemigodAbility(Player owner, Demigod demigod, AbilityParametersStruct abilityInfo) { this.owner = owner; this.demigod = demigod; AbilityParameters = abilityInfo; Helper.SetupDemigodEntity(this); s_statusEffectCooldown = StringExtensionMethods.GetStableHashCode(GetType().Name + "Cooldown"); } public virtual string GetName() { return NorseDemigods.Localization.TryTranslate("$ability_" + ConfigName + "_name"); } public virtual string GetTooltip() { return NorseDemigods.Localization.TryTranslate("$ability_" + ConfigName + "_tooltip"); } public virtual string GetTooltip(string suffix) { return NorseDemigods.Localization.TryTranslate("$ability_" + ConfigName + "_tooltip_" + suffix); } public virtual string GetInfusedTooltip() { string text = NorseDemigods.Localization.TryTranslate("$ability_" + ConfigName + "_infused_tooltip"); if (!text.StartsWith("[") || !text.EndsWith("]")) { return text; } return null; } public virtual string GetStatusTooltip() { string text = NorseDemigods.Localization.TryTranslate("$ability_" + ConfigName + "_status_tooltip"); if (!text.StartsWith("[") || !text.EndsWith("]")) { return text; } return null; } public unsafe virtual string GetInputTooltip() { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010f: 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_0189: Unknown result type (might be due to invalid IL or missing references) //IL_018e: 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_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: 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_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0148: 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_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_036d: Unknown result type (might be due to invalid IL or missing references) //IL_0372: Unknown result type (might be due to invalid IL or missing references) StringBuilder stringBuilder = new StringBuilder(); KeyboardShortcut value; switch (AbilityParameters.AbilityType) { case AbilityType.SLOT_1: value = Configs.HotkeyAbilityA.Value; stringBuilder.Append(((object)(*(KeyboardShortcut*)(&value))/*cast due to .constrained prefix*/).ToString()); break; case AbilityType.SLOT_2: value = Configs.HotkeyAbilityB.Value; stringBuilder.Append(((object)(*(KeyboardShortcut*)(&value))/*cast due to .constrained prefix*/).ToString()); break; case AbilityType.SLOT_3: value = Configs.HotkeyAbilityC.Value; if ((int)((KeyboardShortcut)(ref value)).MainKey != 0) { value = Configs.HotkeyAbilityC.Value; stringBuilder.Append(((object)(*(KeyboardShortcut*)(&value))/*cast due to .constrained prefix*/).ToString()); break; } value = Configs.HotkeyAbilityA.Value; stringBuilder.Append(((object)(*(KeyboardShortcut*)(&value))/*cast due to .constrained prefix*/).ToString()); stringBuilder.Append(" + "); stringBuilder.Append(NorseDemigods.Localization.TryTranslate("$skill_blocking")); break; case AbilityType.SLOT_4: value = Configs.HotkeyAbilityD.Value; if ((int)((KeyboardShortcut)(ref value)).MainKey != 0) { value = Configs.HotkeyAbilityD.Value; stringBuilder.Append(((object)(*(KeyboardShortcut*)(&value))/*cast due to .constrained prefix*/).ToString()); break; } value = Configs.HotkeyAbilityB.Value; stringBuilder.Append(((object)(*(KeyboardShortcut*)(&value))/*cast due to .constrained prefix*/).ToString()); stringBuilder.Append(" + "); stringBuilder.Append(NorseDemigods.Localization.TryTranslate("$skill_blocking")); break; case AbilityType.TELEPORT: value = Configs.HotkeyAbilityTeleport.Value; stringBuilder.Append(((object)(*(KeyboardShortcut*)(&value))/*cast due to .constrained prefix*/).ToString()); break; case AbilityType.SPECIAL_ATTACK: { for (int j = 0; j < AbilityParameters.SkillTypes.Length; j++) { stringBuilder.Append(NorseDemigods.Localization.TryTranslate("$skill_" + ((object)Unsafe.As<SkillType, SkillType>(ref AbilityParameters.SkillTypes[j])/*cast due to .constrained prefix*/).ToString().ToLowerInvariant())); if (j < AbilityParameters.SkillTypes.Length - 1) { stringBuilder.Append(" | "); } } stringBuilder.Append(" » "); stringBuilder.Append(NorseDemigods.Localization.TryTranslate("$settings_secondaryattack")); stringBuilder.Append(" "); string format3 = NorseDemigods.Localization.TryTranslate("$ability_hotkey_ignore_special_attack"); object[] array3 = new object[1]; value = Configs.HotkeyIgnoreSpecialAttack.Value; array3[0] = ((object)(*(KeyboardShortcut*)(&value))/*cast due to .constrained prefix*/).ToString(); stringBuilder.Append(Helper.SafeFormat(format3, array3)); break; } case AbilityType.SPECIAL_ATTACK_BLOCKING: { for (int i = 0; i < AbilityParameters.SkillTypes.Length; i++) { stringBuilder.Append(NorseDemigods.Localization.TryTranslate("$skill_" + ((object)Unsafe.As<SkillType, SkillType>(ref AbilityParameters.SkillTypes[i])/*cast due to .constrained prefix*/).ToString().ToLowerInvariant())); if (i < AbilityParameters.SkillTypes.Length - 1) { stringBuilder.Append(" | "); } } stringBuilder.Append(" » "); stringBuilder.Append(NorseDemigods.Localization.TryTranslate("$settings_secondaryattack")); stringBuilder.Append(" + "); stringBuilder.Append(NorseDemigods.Localization.TryTranslate("$skill_blocking")); stringBuilder.Append(" "); string format2 = NorseDemigods.Localization.TryTranslate("$ability_hotkey_ignore_special_attack"); object[] array2 = new object[1]; value = Configs.HotkeyIgnoreSpecialAttack.Value; array2[0] = ((object)(*(KeyboardShortcut*)(&value))/*cast due to .constrained prefix*/).ToString(); stringBuilder.Append(Helper.SafeFormat(format2, array2)); break; } case AbilityType.SPECIAL_ATTACK_AIR: { stringBuilder.Append(NorseDemigods.Localization.TryTranslate("$settings_jump")); stringBuilder.Append(" + "); stringBuilder.Append(NorseDemigods.Localization.TryTranslate("$settings_secondaryattack")); stringBuilder.Append(" "); string format = NorseDemigods.Localization.TryTranslate("$ability_hotkey_ignore_special_attack"); object[] array = new object[1]; value = Configs.HotkeyIgnoreSpecialAttack.Value; array[0] = ((object)(*(KeyboardShortcut*)(&value))/*cast due to .constrained prefix*/).ToString(); stringBuilder.Append(Helper.SafeFormat(format, array)); break; } } return stringBuilder.ToString(); } public virtual void Update(float dt) { if ((Object)(object)Owner == (Object)null || ((Character)Owner).IsDead()) { return; } if ((Object)(object)Owner == (Object)(object)Player.m_localPlayer && ((Character)Owner).TakeInput() && !((Character)Owner).InPlaceMode()) { ProcessAbilityInput(); } if (!IsActive) { return; } if (EnergyDrainPeriod > 0f) { energyDrainTimer -= dt; if (energyDrainTimer <= 0f) { demigod.DemigodStatusEffect.RemoveEnergy(1); energyDrainedSinceActivation++; if (demigod.DemigodStatusEffect.Energy <= 0) { Stop(); } energyDrainTimer += EnergyDrainPeriod; } } if (IsActive) { lifeTime += dt; if (Duration > 0f) { lifeTimer -= dt; if (lifeTimer <= 0f) { Stop(); } } } tickTimer -= dt; if (tickTimer <= 0f) { OnBuffTick(); tickTimer += 1f; } } public virtual bool CanExecute(bool showMessage = true) { if (((Character)Owner).GetSEMan().HaveStatusEffect(s_statusEffectCooldown)) { if (showMessage && (Object)(object)AbilityCooldownStatusEffect != (Object)null) { ((Character)Owner).Message((MessageType)1, Helper.SafeFormat(NorseDemigods.Localization.TryTranslate("$ability_oncooldown_message"), DisplayName, Mathf.CeilToInt(((StatusEffect)AbilityCooldownStatusEffect).GetRemaningTime())), 0, (Sprite)null, false); } return false; } if (demigod.DemigodStatusEffect.Energy < EnergyRequired || demigod.DemigodStatusEffect.Energy < EnergyCost) { if (showMessage) { ((Character)Owner).Message((MessageType)1, Helper.SafeFormat(NorseDemigods.Localization.TryTranslate("$ability_notenoughenergy_message"), DisplayName, demigod.DemigodStatusEffect.Energy, Math.Max(EnergyRequired, EnergyCost)), 0, (Sprite)null, false); } return false; } if (Owner.m_eitr < (float)EitrCost) { Hud.instance.EitrBarEmptyFlash(); return false; } if (IsChanneled && IsActive) { return false; } return true; } public virtual void Execute() { if (EnergyCost > 0 && EnergyDrainPeriod <= 0f) { demigod.DemigodStatusEffect.RemoveEnergy(EnergyCost); } if (EitrCost > 0) { Player obj = Owner; obj.m_eitr -= (float)EitrCost; } if (IsBuff || IsChanneled) { energyDrainTimer = EnergyDrainPeriod; energyDrainedSinceActivation = 0; tickTimer = 1f; IsActive = true; } if (Cooldown > 0f && !NorseDemigods.Instance.NoAbilityCooldown) { AbilityCooldownStatusEffect = SE_Ability_Cooldown.CreateAbilityCooldownStatusEffect(this); } if (Duration > 0f) { lifeTimer = Duration; } lifeTime = 0f; StoppedAfterTeleporting = false; } public virtual void Stop(bool keyUp = false) { if (!IsActive) { return; } IsActive = false; lifeTime = 0f; if (EnergyDrainPeriod > 0f) { if (energyDrainedSinceActivation <= 0) { demigod.DemigodStatusEffect.RemoveEnergy(1); } energyDrainedSinceActivation = -1; } } public virtual void OnPlayerDeath() { Stop(); } public virtual void OnPlayerTeleporting() { if (IsActive) { StoppedAfterTeleporting = true; } Stop(); } public virtual void OnPlayerDisconnecting() { Stop(); } public virtual void OnDestroy() { Stop(); } public virtual void Awake() { } public virtual void OnBuffTick() { } public virtual void OnBlocking(HitData hit) { } public virtual void OnTakingDamage(HitData hit) { } public virtual void OnVictimDamage(Character victim, HitData hit) { } public virtual void OnVictimDeath(Character victim) { } public virtual void OnCharacterDeath(string characterToken, Vector3 characterLastPosition) { } public virtual void OnPlayerSpawned() { } public virtual void ModifyWeaponSharedData(SharedData modifiedData, in SharedData originalData) { } public void ResetCooldown() { if ((Object)(object)AbilityCooldownStatusEffect != (Object)null) { ((Character)Owner).GetSEMan().RemoveStatusEffect((StatusEffect)(object)AbilityCooldownStatusEffect, false); } } private void ProcessAbilityInput() { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_0334: Unknown result type (might be due to invalid IL or missing references) //IL_0339: Unknown result type (might be due to invalid IL or missing references) //IL_033c: Unknown result type (might be due to invalid IL or missing references) //IL_0492: Unknown result type (might be due to invalid IL or missing references) //IL_0497: Unknown result type (might be due to invalid IL or missing references) //IL_007a: 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) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0069: 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_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0284: 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_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: 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_03ed: Unknown result type (might be due to invalid IL or missing references) //IL_034b: Unknown result type (might be due to invalid IL or missing references) //IL_0350: Unknown result type (might be due to invalid IL or missing references) //IL_04c4: Unknown result type (might be due to invalid IL or missing references) //IL_04c9: Unknown result type (might be due to invalid IL or missing references) //IL_04ab: Unknown result type (might be due to invalid IL or missing references) //IL_04b0: Unknown result type (might be due to invalid IL or missing references) //IL_04b3: 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_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_02b6: Unknown result type (might be due to invalid IL or missing references) //IL_02bb: Unknown result type (might be due to invalid IL or missing references) //IL_029d: Unknown result type (might be due to invalid IL or missing references) //IL_02a2: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_0205: 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_041a: Unknown result type (might be due to invalid IL or missing references) //IL_041f: Unknown result type (might be due to invalid IL or missing references) //IL_0401: Unknown result type (might be due to invalid IL or missing references) //IL_0406: Unknown result type (might be due to invalid IL or missing references) //IL_0409: Unknown result type (might be due to invalid IL or missing references) //IL_037d: Unknown result type (might be due to invalid IL or missing references) //IL_0382: Unknown result type (might be due to invalid IL or missing references) //IL_0364: Unknown result type (might be due to invalid IL or missing references) //IL_0369: Unknown result type (might be due to invalid IL or missing references) //IL_036c: Unknown result type (might be due to invalid IL or missing references) //IL_04dc: Unknown result type (might be due to invalid IL or missing references) //IL_04e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: 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_019b: Unknown result type (might be due to invalid IL or missing references) //IL_02de: 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_0234: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) //IL_0442: Unknown result type (might be due to invalid IL or missing references) //IL_0447: Unknown result type (might be due to invalid IL or missing references) //IL_0398: Unknown result type (might be due to invalid IL or missing references) //IL_039d: Unknown result type (might be due to invalid IL or missing references) //IL_050e: Unknown result type (might be due to invalid IL or missing references) //IL_0513: Unknown result type (might be due to invalid IL or missing references) //IL_04f5: Unknown result type (might be due to invalid IL or missing references) //IL_04fa: Unknown result type (might be due to invalid IL or missing references) //IL_04fd: Unknown result type (might be due to invalid IL or missing references) //IL_0310: Unknown result type (might be due to invalid IL or missing references) //IL_0315: Unknown result type (might be due to invalid IL or missing references) //IL_02f7: Unknown result type (might be due to invalid IL or missing references) //IL_02fc: Unknown result type (might be due to invalid IL or missing references) //IL_02ff: Unknown result type (might be due to invalid IL or missing references) //IL_0266: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Unknown result type (might be due to invalid IL or missing references) //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_0255: Unknown result type (might be due to invalid IL or missing references) //IL_0474: Unknown result type (might be due to invalid IL or missing references) //IL_0479: Unknown result type (might be due to invalid IL or missing references) //IL_045b: Unknown result type (might be due to invalid IL or missing references) //IL_0460: Unknown result type (might be due to invalid IL or missing references) //IL_0463: Unknown result type (might be due to invalid IL or missing references) //IL_03ca: Unknown result type (might be due to invalid IL or missing references) //IL_03cf: Unknown result type (might be due to invalid IL or missing references) //IL_03b1: Unknown result type (might be due to invalid IL or missing references) //IL_03b6: Unknown result type (might be due to invalid IL or missing references) //IL_03b9: Unknown result type (might be due to invalid IL or missing references) bool flag = false; bool flag2 = false; KeyboardShortcut value; switch (AbilityParameters.AbilityType) { case AbilityType.SLOT_1: _ = IsGamePadAbilityModifierActive; value = Configs.HotkeyAbilityA.Value; if (((KeyboardShortcut)(ref value)).Modifiers.Count() == 0) { value = Configs.HotkeyAbilityA.Value; if (Input.GetKeyDown(((KeyboardShortcut)(ref value)).MainKey)) { goto IL_0089; } } value = Configs.HotkeyAbilityA.Value; if (((KeyboardShortcut)(ref value)).IsDown()) { goto IL_0089; } goto IL_00b1; case AbilityType.SLOT_2: _ = IsGamePadAbilityModifierActive; value = Configs.HotkeyAbilityB.Value; if (((KeyboardShortcut)(ref value)).Modifiers.Count() == 0) { value = Configs.HotkeyAbilityB.Value; if (Input.GetKeyDown(((KeyboardShortcut)(ref value)).MainKey)) { goto IL_014d; } } value = Configs.HotkeyAbilityB.Value; if (((KeyboardShortcut)(ref value)).IsDown()) { goto IL_014d; } goto IL_0175; case AbilityType.SLOT_3: _ = IsGamePadAbilityModifierActive; value = Configs.HotkeyAbilityC.Value; if ((int)((KeyboardShortcut)(ref value)).MainKey != 0) { value = Configs.HotkeyAbilityC.Value; if (((KeyboardShortcut)(ref value)).Modifiers.Count() == 0) { value = Configs.HotkeyAbilityC.Value; if (Input.GetKeyDown(((KeyboardShortcut)(ref value)).MainKey)) { goto IL_0228; } } value = Configs.HotkeyAbilityC.Value; if (((KeyboardShortcut)(ref value)).IsDown()) { goto IL_0228; } value = Configs.HotkeyAbilityC.Value; if (((KeyboardShortcut)(ref value)).Modifiers.Count() == 0) { value = Configs.HotkeyAbilityC.Value; if (Input.GetKeyUp(((KeyboardShortcut)(ref value)).MainKey)) { goto IL_0278; } } value = Configs.HotkeyAbilityC.Value; if (!((KeyboardShortcut)(ref value)).IsUp()) { break; } goto IL_0278; } value = Configs.HotkeyAbilityA.Value; if (((KeyboardShortcut)(ref value)).Modifiers.Count() == 0) { value = Configs.HotkeyAbilityA.Value; if (Input.GetKeyDown(((KeyboardShortcut)(ref value)).MainKey)) { goto IL_02c5; } } value = Configs.HotkeyAbilityA.Value; if (((KeyboardShortcut)(ref value)).IsDown()) { goto IL_02c5; } goto IL_02d9; case AbilityType.SLOT_4: _ = IsGamePadAbilityModifierActive; value = Configs.HotkeyAbilityD.Value; if ((int)((KeyboardShortcut)(ref value)).MainKey != 0) { value = Configs.HotkeyAbilityD.Value; if (((KeyboardShortcut)(ref value)).Modifiers.Count() == 0) { value = Configs.HotkeyAbilityD.Value; if (Input.GetKeyDown(((KeyboardShortcut)(ref value)).MainKey)) { goto IL_038c; } } value = Configs.HotkeyAbilityD.Value; if (((KeyboardShortcut)(ref value)).IsDown()) { goto IL_038c; } value = Configs.HotkeyAbilityD.Value; if (((KeyboardShortcut)(ref value)).Modifiers.Count() == 0) { value = Configs.HotkeyAbilityD.Value; if (Input.GetKeyUp(((KeyboardShortcut)(ref value)).MainKey)) { goto IL_03dc; } } value = Configs.HotkeyAbilityD.Value; if (!((KeyboardShortcut)(ref value)).IsUp()) { break; } goto IL_03dc; } value = Configs.HotkeyAbilityB.Value; if (((KeyboardShortcut)(ref value)).Modifiers.Count() == 0) { value = Configs.HotkeyAbilityB.Value; if (Input.GetKeyDown(((KeyboardShortcut)(ref value)).MainKey)) { goto IL_0429; } } value = Configs.HotkeyAbilityB.Value; if (((KeyboardShortcut)(ref value)).IsDown()) { goto IL_0429; } goto IL_043d; case AbilityType.TELEPORT: value = Configs.HotkeyAbilityTeleport.Value; if (((KeyboardShortcut)(ref value)).Modifiers.Count() == 0) { value = Configs.HotkeyAbilityTeleport.Value; if (Input.GetKeyDown(((KeyboardShortcut)(ref value)).MainKey)) { goto IL_04d3; } } value = Configs.HotkeyAbilityTeleport.Value; if (((KeyboardShortcut)(ref value)).IsDown()) { goto IL_04d3; } value = Configs.HotkeyAbilityTeleport.Value; if (((KeyboardShortcut)(ref value)).Modifiers.Count() == 0) { value = Configs.HotkeyAbilityTeleport.Value; if (Input.GetKeyUp(((KeyboardShortcut)(ref value)).MainKey)) { goto IL_051d; } } value = Configs.HotkeyAbilityTeleport.Value; if (!((KeyboardShortcut)(ref value)).IsUp()) { break; } goto IL_051d; case AbilityType.SPECIAL_ATTACK: case AbilityType.SPECIAL_ATTACK_AIR: case AbilityType.SPECIAL_ATTACK_BLOCKING: { if (ZInput.GetButtonUp("SecondaryAttack")) { flag2 = true; } break; } IL_043d: value = Configs.HotkeyAbilityB.Value; if (((KeyboardShortcut)(ref value)).Modifiers.Count() == 0) { value = Configs.HotkeyAbilityB.Value; if (Input.GetKeyUp(((KeyboardShortcut)(ref value)).MainKey)) { goto IL_0486; } } value = Configs.HotkeyAbilityB.Value; if (!((KeyboardShortcut)(ref value)).IsUp()) { break; } goto IL_0486; IL_02c5: if (((Character)Owner).IsBlocking()) { flag = true; break; } goto IL_02d9; IL_04d3: flag = true; break; IL_0486: flag2 = true; break; IL_02d9: value = Configs.HotkeyAbilityA.Value; if (((KeyboardShortcut)(ref value)).Modifiers.Count() == 0) { value = Configs.HotkeyAbilityA.Value; if (Input.GetKeyUp(((KeyboardShortcut)(ref value)).MainKey)) { goto IL_0322; } } value = Configs.HotkeyAbilityA.Value; if (!((KeyboardShortcut)(ref value)).IsUp()) { break; } goto IL_0322; IL_051d: flag2 = true; break; IL_0322: flag2 = true; break; IL_0228: flag = true; break; IL_038c: flag = true; break; IL_00fa: flag2 = true; break; IL_0278: flag2 = true; break; IL_01be: flag2 = true; break; IL_03dc: flag2 = true; break; IL_0175: value = Configs.HotkeyAbilityB.Value; if (((KeyboardShortcut)(ref value)).Modifiers.Count() == 0) { value = Configs.HotkeyAbilityB.Value; if (Input.GetKeyUp(((KeyboardShortcut)(ref value)).MainKey)) { goto IL_01be; } } value = Configs.HotkeyAbilityB.Value; if (!((KeyboardShortcut)(ref value)).IsUp()) { break; } goto IL_01be; IL_00b1: value = Configs.HotkeyAbilityA.Value; if (((KeyboardShortcut)(ref value)).Modifiers.Count() == 0) { value = Configs.HotkeyAbilityA.Value; if (Input.GetKeyUp(((KeyboardShortcut)(ref value)).MainKey)) { goto IL_00fa; } } value = Configs.HotkeyAbilityA.Value; if (!((KeyboardShortcut)(ref value)).IsUp()) { break; } goto IL_00fa; IL_0089: value = Configs.HotkeyAbilityC.Value; if ((int)((KeyboardShortcut)(ref value)).MainKey != 0 || !((Character)Owner).IsBlocking()) { flag = true; break; } goto IL_00b1; IL_0429: if (((Character)Owner).IsBlocking()) { flag = true; break; } goto IL_043d; IL_014d: value = Configs.HotkeyAbilityD.Value; if ((int)((KeyboardShortcut)(ref value)).MainKey != 0 || !((Character)Owner).IsBlocking()) { flag = true; break; } goto IL_0175; } if (flag) { if (!IsActive) { if (CanExecute()) { Execute(); } } else if (CanBeStopped) { Stop(); } } else if (flag2 && IsChanneled && IsActive) { Stop(keyUp: true); } } } [Serializable] public class CustomConsumable { [Serializable] public class CustomData { public string AttributeToGive { get; set; } public string VisualEffectPrefab { get; set; } public string RestrictedToDemigod { get; set; } public bool IsUpgrade { get; set; } } public string OriginalPrefab { get; set; } public string Prefab { get; set; } public string ItemName { get; set; } public string ItemIcon { get; set; } public RecipeConfig Recipe { get; set; } public Dictionary<string, object> ItemSharedProperties { get; set; } public CustomData ItemCustomData { get; set; } } [Serializable] public abstract class DemigodAttribute : IDemigodEntity { [NonSerialized] private Player owner; [NonSerialized] private Demigod demigod; [NonSerialized] private string className; [NonSerialized] private string configName; [NonSerialized] private string displayName; [NonSerialized] private object properties; public Player Owner { get { return owner; } set { owner = value; } } public Demigod Demigod { get { return demigod; } set { demigod = value; } } public string ClassName { get { return className; } set { className = value; } } public string ConfigName { get { return configName; } set { configName = value; } } public string DisplayName { get { return displayName; } set { displayName = value; } } public object Properties { get { return properties; } set { properties = value; } } public DemigodAttribute() { Helper.SetupDemigodEntity(this); } public DemigodAttribute(object properties) { this.properties = properties; Helper.SetupDemigodEntity(this); } public DemigodAttribute(Player owner, Demigod demigod, object properties = null) { this.owner = owner; this.demigod = demigod; this.properties = properties; Helper.SetupDemigodEntity(this); } public virtual string GetName() { return NorseDemigods.Localization.TryTranslate("$attribute_" + ConfigName + "_name"); } public virtual string GetTooltip() { return NorseDemigods.Localization.TryTranslate("$attribute_" + ConfigName + "_tooltip"); } public virtual string GetStatusTooltip() { string text = NorseDemigods.Localization.TryTranslate("$attribute_" + ConfigName + "_status_tooltip"); if (!text.StartsWith("[") || !text.EndsWith("]")) { return text; } return null; } public virtual void Awake() { } public virtual void Update(float dt) { } public virtual void OnBlocking(HitData hit) { } public virtual void OnTakingDamage(HitData hit) { } public virtual void OnVictimDamage(Character victim, HitData hit) { } public virtual void OnVictimDeath(Character victim) { } public virtual void OnCharacterDeath(string characterToken, Vector3 characterLastPosition) { } public virtual void OnPlayerSpawned() { } public virtual void OnPlayerDeath() { } public virtual void OnPlayerTeleporting() { } public virtual void OnPlayerDisconnecting() { } public virtual void OnDestroy() { } } public static class Configs { public struct SkillDemigodCapStruct { public string BossName; public string TrophyName; public int SkillCap; public SkillDemigodCapStruct(string bossName, string keyName, int skillCap) { BossName = bossName; TrophyName = keyName; SkillCap = skillCap; } } public const string CurrentConfigVersion = "1.8.1"; public static readonly SkillDemigodCapStruct[] SkillDemigodCapSettings = new SkillDemigodCapStruct[7] { new SkillDemigodCapStruct("None", null, 10), new SkillDemigodCapStruct("Eikthyr", "TrophyEikthyr", 25), new SkillDemigodCapStruct("The Elder", "TrophyTheElder", 40), new SkillDemigodCapStruct("Bonemass", "TrophyBonemass", 55), new SkillDemigodCapStruct("Moder", "TrophyDragonQueen", 70), new SkillDemigodCapStruct("Yagluth", "TrophyGoblinKing", 85), new SkillDemigodCapStruct("The Queen", "TrophySeekerQueen", 0) }; public static ConfigEntry<bool> AutomaticallyUpdateConfigs; public static ConfigEntry<string> ModVersion; public static ConfigEntry<string> Difficulty; public static ConfigEntry<int> AmmoConsumption; public static ConfigEntry<int> DeerRunSpeedModifier; public static ConfigEntry<int> FeatherDropMultiplier; public static ConfigEntry<int> WorldCreaturesSpawnAmount; public static ConfigEntry<int> WorldCreaturesSpawnFrequency; public static ConfigEntry<string> WorldCreaturesExempt; public static ConfigEntry<bool> EnableMod; public static ConfigEntry<bool> EnableExperimentalFeatures; public static ConfigEntry<bool> EnablePassiveSpecialEffects; public static ConfigEntry<bool> EnhanceAttackAngle; public static ConfigEntry<bool> EnhanceCompatibilityWithModAgility; public static ConfigEntry<bool> EnhanceCompatibilityWithModWarfare; public static ConfigEntry<bool> FindClosestBosses; public static ConfigEntry<bool> FindClosestMerchants; public static ConfigEntry<bool> ProtectPiecesCoveredByWard; public static ConfigEntry<bool> ProtectResourcesFromCollateralDamage; public static ConfigEntry<string> DisabledDemigodsList; public static ConfigEntry<KeyboardShortcut> HotkeyAbilityA; public static ConfigEntry<KeyboardShortcut> HotkeyAbilityB; public static ConfigEntry<KeyboardShortcut> HotkeyAbilityC; public static ConfigEntry<KeyboardShortcut> HotkeyAbilityD; public static ConfigEntry<KeyboardShortcut> HotkeyAbilityTeleport; public static ConfigEntry<KeyboardShortcut> HotkeyIgnoreSpecialAttack; public static ConfigEntry<int> SpecialAttackSpeedModifier; public static ConfigEntry<int> SpecialDamageModifier; public static ConfigEntry<int> SpecialDamageToResourcesModifier; public static ConfigEntry<int> SpecialHealingModifier; public static ConfigEntry<int> SpecialJumpForceModifier; public static ConfigEntry<int> SpecialMovementSpeedModifier; public static ConfigEntry<bool> EnablePvpForAbilities; public static ConfigEntry<bool> EnemiesIgnoreChopDamage; public static ConfigEntry<bool> EnemiesIgnorePickaxeDamage; public static ConfigEntry<int> FollowerDamageFromBossModifier; public static ConfigEntry<int> EnergyAtBaseLevel; public static ConfigEntry<int> EnergyAtMaxLevel; public static ConfigEntry<int> EnergyRegenerationPeriod; public static ConfigEntry<int> BerserkerArmorSetGrantedArmor; public static ConfigEntry<int> FenrisArmorBonusMovementSpeed; public static ConfigEntry<int> FenrisArmorSetGrantedArmor; public static ConfigEntry<string> InfusedMegingjordCostItemName; public static ConfigEntry<int> InfusedMegingjordCostItemQuantity; public static ConfigEntry<int> InfusedMegingjordIncreasedEnergy; public static ConfigEntry<int> InfusedMegingjordIncreasedMaxWeight; public static ConfigEntry<bool> EnableHarpoonFishing; public static ConfigEntry<int> HarpoonMaxQuality; public static ConfigEntry<float> HarpoonProjectileCollisionRadius; public static ConfigEntry<int> HarpoonUpgradeChitinPerLevel; public static ConfigEntry<int> HarpoonUpgradeDurabilityPerLevel; public static ConfigEntry<bool> IgnoreBeehiveProximityCheck; public static ConfigEntry<int> MaxHoneyProducedByBeehive; public static ConfigEntry<int> QueenBeeSpawnChance; public static ConfigEntry<bool> EnableCustomMerchantItems; public static ConfigEntry<int> AbyssalHarpoonPrice; public static ConfigEntry<int> QueenBeePrice; public static ConfigEntry<bool> RunestoneSpawnAtStart; public static ConfigEntry<bool> RunestoneConsumable; public static ConfigEntry<string> RunestoneCraftingRecipe; public static ConfigEntry<int> SkillDemigodExperienceModifier; public static ConfigEntry<bool> EnableSkillDemigodCap; public static ConfigEntry<bool> EnableSkillLossOnDeath; public static ConfigEntry<int> LevelsLostOnDeath; public static ConfigEntry<int> LevelsLostWhenSwitchingDemigod; public static List<ConfigEntry<int>> SkillDemigodCap = new List<ConfigEntry<int>>(); public static ConfigurationManagerAttributes IsAdminOnly = new ConfigurationManagerAttributes { IsAdminOnly = true }; public static ConfigurationManagerAttributes IsAdminOnlyAndAdvanced = new ConfigurationManagerAttributes { IsAdminOnly = true, IsAdvanced = true }; public static ConfigEntry<bool> EnableTeleportAbility; public static ConfigEntry<bool> IgnoreNonTeleportableItems; public static List<string> ExemptWorldCreaturesListPrefabs; public static List<string> DisabledDemigodsListNames; public static void SetupConfigs(ConfigFile config) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Expected O, but got Unknown //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Expected O, but got Unknown //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Expected O, but got Unknown //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Expected O, but got Unknown //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Expected O, but got Unknown //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Expected O, but got Unknown //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Expected O, but got Unknown //IL_0255: Unknown result type (might be due to invalid IL or missing references) //IL_025a: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Unknown result type (might be due to invalid IL or missing references) //IL_026d: Unknown result type (might be due to invalid IL or missing references) //IL_0280: Expected O, but got Unknown //IL_0280: Unknown result type (might be due to invalid IL or missing references) //IL_028a: Expected O, but got Unknown //IL_02b7: Unknown result type (might be due to invalid IL or missing references) //IL_02c1: Expected O, but got Unknown //IL_02eb: Unknown result type (might be due to invalid IL or missing references) //IL_02f5: Expected O, but got Unknown //IL_035f: Unknown result type (might be due to invalid IL or missing references) //IL_0369: Expected O, but got Unknown //IL_0393: Unknown result type (might be due to invalid IL or missing references) //IL_039d: Expected O, but got Unknown //IL_03c7: Unknown result type (might be due to invalid IL or missing references) //IL_03d1: Expected O, but got Unknown //IL_03fb: Unknown result type (might be due to invalid IL or missing references) //IL_0405: Expected O, but got Unknown //IL_042f: Unknown result type (might be due to invalid IL or missing references) //IL_0439: Expected O, but got Unknown //IL_0463: Unknown result type (might be due to invalid IL or missing references) //IL_046d: Expected O, but got Unknown //IL_0495: Unknown result type (might be due to invalid IL or missing references) //IL_049a: Unknown result type (might be due to invalid IL or missing references) //IL_04a1: Unknown result type (might be due to invalid IL or missing references) //IL_04ae: Unknown result type (might be due to invalid IL or missing references) //IL_04c1: Expected O, but got Unknown //IL_04c1: Unknown result type (might be due to invalid IL or missing references) //IL_04cb: Expected O, but got Unknown //IL_04ea: Unknown result type (might be due to invalid IL or missing references) //IL_0518: Unknown result type (might be due to invalid IL or missing references) //IL_0542: Unknown result type (might be due to invalid IL or missing references) //IL_056c: Unknown result type (might be due to invalid IL or missing references) //IL_0597: Unknown result type (might be due to invalid IL or missing references) //IL_05c5: Unknown result type (might be due to invalid IL or missing references) //IL_060e: Unknown result type (might be due to invalid IL or missing references) //IL_0618: Expected O, but got Unknown //IL_0652: Unknown result type (might be due to invalid IL or missing references) //IL_065c: Expected O, but got Unknown //IL_0696: Unknown result type (might be due to invalid IL or missing references) //IL_06a0: Expected O, but got Unknown //IL_06da: Unknown result type (might be due to invalid IL or missing references) //IL_06e4: Expected O, but got Unknown //IL_071e: Unknown result type (might be due to invalid IL or missing references) //IL_0728: Expected O, but got Unknown //IL_0762: Unknown result type (might be due to invalid IL or missing references) //IL_076c: Expected O, but got Unknown //IL_0796: Unknown result type (might be due to invalid IL or missing references) //IL_07a0: Expected O, but got Unknown //IL_081a: Unknown result type (might be due to invalid IL or missing references) //IL_0824: Expected O, but got Unknown //IL_0855: Unknown result type (might be due to invalid IL or missing references) //IL_085f: Expected O, but got Unknown //IL_0891: Unknown result type (might be due to invalid IL or missing references) //IL_089b: Expected O, but got Unknown //IL_08d5: Unknown result type (might be due to invalid IL or missing references) //IL_08df: Expected O, but got Unknown //IL_0914: Unknown result type (might be due to invalid IL or missing references) //IL_091e: Expected O, but got Unknown //IL_0954: Unknown result type (might be due to invalid IL or missing references) //IL_095e: Expected O, but got Unknown //IL_0993: Unknown result type (might be due to invalid IL or missing references) //IL_099d: Expected O, but got Unknown //IL_09cb: Unknown result type (might be due to invalid IL or missing references) //IL_09d5: Expected O, but got Unknown //IL_0a0a: Unknown result type (might be due to invalid IL or missing references) //IL_0a14: Expected O, but got Unknown //IL_0a45: Unknown result type (might be due to invalid IL or missing references) //IL_0a4f: Expected O, but got Unknown //IL_0a87: Unknown result type (might be due to invalid IL or missing references) //IL_0a91: Expected O, but got Unknown //IL_0abb: Unknown result type (might be due to invalid IL or missing references) //IL_0ac5: Expected O, but got Unknown //IL_0af5: Unknown result type (might be due to invalid IL or missing references) //IL_0aff: Expected O, but got Unknown //IL_0b3b: Unknown result type (might be due to invalid IL or missing references) //IL_0b45: Expected O, but got Unknown //IL_0b7a: Unknown result type (might be due to invalid IL or missing references) //IL_0b84: Expected O, but got Unknown //IL_0bb9: Unknown result type (might be due to invalid IL or missing references) //IL_0bc3: Expected O, but got Unknown //IL_0bed: Unknown result type (might be due to invalid IL or missing references) //IL_0bf7: Expected O, but got Unknown //IL_0c28: Unknown result type (might be due to invalid IL or missing references) //IL_0c32: Expected O, but got Unknown //IL_0c68: Unknown result type (might be due to invalid IL or missing references) //IL_0c72: Expected O, but got Unknown //IL_0c9f: Unknown result type (might be due to invalid IL or missing references) //IL_0ca9: Expected O, but got Unknown //IL_0ce1: Unknown result type (might be due to invalid IL or missing references) //IL_0ceb: Expected O, but got Unknown //IL_0d23: Unknown result type (might be due to invalid IL or missing references) //IL_0d2d: Expected O, but got Unknown //IL_0d5a: Unknown result type (might be due to invalid IL or missing references) //IL_0d64: Expected O, but got Unknown //IL_0d91: Unknown result type (might be due to invalid IL or missing references) //IL_0d9b: Expected O, but got Unknown //IL_0dcd: Unknown result type (might be due to invalid IL or missing references) //IL_0dd7: Expected O, but got Unknown //IL_0e14: Unknown result type (might be due to invalid IL or missing references) //IL_0e1e: Expected O, but got Unknown //IL_0e48: Unknown result type (might be due to invalid IL or missing references) //IL_0e52: Expected O, but got Unknown //IL_0e7c: Unknown result type (might be due to invalid IL or missing references) //IL_0e86: Expected O, but got Unknown //IL_0eb7: Unknown result type (might be due to invalid IL or missing references) //IL_0ec1: Expected O, but got Unknown //IL_0eec: Unknown result type (might be due to invalid IL or missing references) //IL_0ef1: Unknown result type (might be due to invalid IL or missing references) //IL_0ef8: Unknown result type (might be due to invalid IL or missing references) //IL_0f05: Expected O, but got Unknown //IL_0f05: Unknown result type (might be due to invalid IL or missing references) //IL_0f0f: Expected O, but got Unknown //IL_0f6a: Unknown result type (might be due to invalid IL or missing references) //IL_0f74: Expected O, but got Unknown //IL_0f9e: Unknown result type (might be due to invalid IL or missing references) //IL_0fa8: Expected O, but got Unknown AutomaticallyUpdateConfigs = config.Bind<bool>("(Configs)", GenerateConfigKey("AutomaticallyUpdateConfigs"), true, new ConfigDescription("Determines if your advanced settings (mainly abilities, attributes and demigods) will be automatically reset and updated after every mod upgrade to rebalance the game.", (AcceptableValueBase)null, new object[1] { IsAdminOnly })); ModVersion = config.Bind<string>("(Configs)", GenerateConfigKey("ModVersion"), "1.8.1", new ConfigDescription("Please do not modify this value. This value will be automatically updated every time your mod version is upgraded, which is used for resetting and updating your advanced settings (mainly abilities, attributes and demigods) to rebalance the game (in case 'Automatically Update Configs' in this section is enabled).", (AcceptableValueBase)null, new object[1] { IsAdminOnlyAndAdvanced })); Difficulty = config.Bind<string>("(Difficulty)", GenerateConfigKey("Difficulty"), "Vanilla", new ConfigDescription("Base damage modifier from enemies (stacks with world and mod modifiers); and final damage modifier from enemies (only after applying resistances and armor, which works differently from a world modifier or typical mod modifier):\n\nVanilla: No changes (too easy for a demigod)\n\nNovice: Base damage = +0%\nFinal damage = +25% (+50% for bosses)\n\nAdept: Base damage = +0%\nFinal damage = +50% (+100% for bosses)\n\nExpert: Base damage = +0%\nFinal damage = +75% (+150% for bosses)\n\nElite: Base damage = +0%\nFinal damage = +100% (+200% for bosses)\n\nHardcore: Base damage = +25%\nFinal damage = +100% (+200% for bosses)\n\nInsane: Base damage = +50%\nFinal damage = +100% (+200% for bosses)", (AcceptableValueBase)(object)new AcceptableValueList<string>(new string[7] { "Vanilla", "Novice", "Adept", "Expert", "Elite", "Hardcore", "Insane" }), new object[1] { SetOrder(1) })); AmmoConsumption = config.Bind<int>("(Difficulty)", GenerateConfigKey("AmmoConsumption", "%"), 100, new ConfigDescription("Determines the percentage of ammo, such as arrows or bolts, that will be consumed when firing. A value of '50%' would mean that on average only 1 out of 2 shots will consume ammo. Default game value = 100%.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), new object[1] { IsAdminOnly })); DeerRunSpeedModifier = config.Bind<int>("(Difficulty)", GenerateConfigKey("DeerRunSpeedModifier", "%"), 100, new ConfigDescription("Determines the speed at which deers will run to compensate for the increased mobility of demigods. Default game value = 100%.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 300), new object[1] { IsAdminOnly })); FeatherDropMultiplier = config.Bind<int>("(Difficulty)", GenerateConfigKey("FeatherDropMultiplier"), 1, new ConfigDescription("Multiplies feather drops by this number.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 3), new object[1] { IsAdminOnly })); WorldCreaturesSpawnAmount = config.Bind<int>("(Difficulty)", GenerateConfigKey("WorldCreaturesSpawnAmount", "%"), 100, new ConfigDescription("Determines the amount of spawned world creatures (excluding the ones from the list below).", (AcceptableValueBase)(object)new AcceptableValueRange<int>(100, 300), new object[1] { IsAdminOnly })); WorldCreaturesSpawnFrequency = config.Bind<int>("(Difficulty)", GenerateConfigKey("WorldCreaturesSpawnFrequency", "%"), 100, new ConfigDescription("Determines the frequency of spawned world creatures (excluding the ones from the list below).", (AcceptableValueBase)(object)new AcceptableValueRange<int>(100, 500), new object[1] { IsAdminOnly })); WorldCreaturesExempt = config.Bind<string>("(Difficulty)", GenerateConfigKey("WorldCreaturesExempt"), "Boar,Deer,Neck,Seagal,Bear,Crow,Troll,Abomination,StoneGolem,Lox,Unbjorn,Dverger,DvergerMage,Gjall,Hare,AshCrow,BonemawSerpent,DvergerAshlands,FallenValkyrie,Morgen,Fish,Serpent", new ConfigDescription("Names of the prefabs separated by commas.", (AcceptableValueBase)null, new object[1] { (object)new ConfigurationManagerAttributes { IsAdminOnly = true, Order = -1, CustomDrawer = TextAreaDrawer } })); EnableMod = config.Bind<bool>("(General)", GenerateConfigKey("EnableMod"), true, new ConfigDescription("Determines if the mod should run at all. The game (server/client) must be restarted in order for the settings to take effect.", (AcceptableValueBase)null, new object[1] { SetOrder(1) })); EnableExperimentalFeatures = config.Bind<bool>("(General)", GenerateConfigKey("EnableExperimentalFeatures"), false, new ConfigDescription("Enables experimental features that are not fully tested yet. Disable in case of issues.", (AcceptableValueBase)null, new object[1] { IsAdminOnly })); EnablePassiveSpecialEffects = config.Bind<bool>("(General)", GenerateConfigKey("EnablePassiveSpecialEffects"), true, "Enables passive special effects on your character, such as continuous lightning effects on Thor or fire on Surtr. Does not apply to active effects or abilities."); EnhanceAttackAngle = config.Bind<bool>("(General)", GenerateConfigKey("EnhanceAttackAngle"), true, "Allows your vertical looking angle (up and down) to affect the angle of your melee attacks, meaning that you can hit things slightly below or above you depending which angle you are facing. This is nearly a MUST for Fenrir to be able to hit logs. Inspired by the 'Slope Combat Fix' mod by flppyflip3."); EnhanceCompatibilityWithModAgility = config.Bind<bool>("(General)", GenerateConfigKey("EnhanceCompatibilityWithModAgility"), true, new ConfigDescription("Enhance compatibility with the Agility mod by invalidating the jump force modifier from that mod. Without this option enabled, double jump will not work. Disable in case of issues.", (AcceptableValueBase)null, new object[1] { IsAdminOnly })); EnhanceCompatibilityWithModWarfare = config.Bind<bool>("(General)", GenerateConfigKey("EnhanceCompatibilityWithModWarfare"), true, new ConfigDescription("Enhance compatibility with the Warfare mod by rebalancing some overpowered special attacks from that mod, so that they do not make AoE abilities from Norse demigods practically obsolete. Disable in case of issues.", (AcceptableValueBase)null, new object[1] { IsAdminOnly })); FindClosestBosses = config.Bind<bool>("(General)", GenerateConfigKey("FindClosestBosses"), false, new ConfigDescription("Pins the closest bosses on the map on spawn (only up to Yagluth).", (AcceptableValueBase)null, new object[1] { IsAdminOnly })); FindClosestMerchants = config.Bind<bool>("(General)", GenerateConfigKey("FindClosestMerchants"), false, new ConfigDescription("Pins the closest merchants on the map on spawn.", (AcceptableValueBase)null, new object[1] { IsAdminOnly })); ProtectPiecesCoveredByWard = config.Bind<bool>("(General)", GenerateConfigKey("ProtectPiecesCoveredByWard"), false, new ConfigDescription("Prevent damage caused by players to pieces (buildings) protected by a ward.", (AcceptableValueBase)null, new object[1] { IsAdminOnly })); ProtectResourcesFromCollateralDamage = config.Bind<bool>("(General)", GenerateConfigKey("ProtectResourcesFromCollateralDamage"), true, new ConfigDescription("Prevent unintended damage to resources (such as trees and ores) caused by special sources (such as abilities with a large radius) under certain circumstances, such as when being targeted by a close enemy.", (AcceptableValueBase)null, new object[1] { IsAdminOnly })); DisabledDemigodsList = config.Bind<string>("(General)", GenerateConfigKey("DisabledDemigodsList"), string.Empty, new ConfigDescription("English names of disabled demigods separated by commas (e.g., 'Fenrir,Thor').", (AcceptableValueBase)null, new object[1] { (object)new ConfigurationManagerAttributes { IsAdminOnly = true, Order = -3, CustomDrawer = TextAreaDrawer } })); HotkeyAbilityA = config.Bind<KeyboardShortcut>("(Hotkeys)", GenerateConfigKey("HotkeyAbilityA"), new KeyboardShortcut((KeyCode)327, Array.Empty<KeyCode>()), "Hotkey for the primary ability. Examples: Mouse 0, Mouse 1, Q, C, LeftShift + Q, LeftShift + Alpha1. It is recommended that you use a configuration manager mod to easily change the hotkey in-game."); HotkeyAbilityB = config.Bind<KeyboardShortcut>("(Hotkeys)", GenerateConfigKey("HotkeyAbilityB"), new KeyboardShortcut((KeyCode)326, Array.Empty<KeyCode>()), "Hotkey for the secondary ability. Examples: Mouse 0, Mouse 1, Q, C, LeftShift + Q, LeftShift + Alpha1. It is recommended that you use a configuration manager mod to easily change the hotkey in-game."); HotkeyAbilityC = config.Bind<KeyboardShortcut>("(Hotkeys)", GenerateConfigKey("HotkeyAbilityC"), new KeyboardShortcut((KeyCode)0, Array.Empty<KeyCode>()), "Hotkey for the tertiary ability. If none, the default hotkey will be set to 'Hotkey Ability A' + Blocking. It is recommended that you use a configuration manager mod to easily change the hotkey in-game."); HotkeyAbilityD = config.Bind<KeyboardShortcut>("(Hotkeys)", GenerateConfigKey("HotkeyAbilityD"), new KeyboardShortcut((KeyCode)0, Array.Empty<KeyCode>()), "Hotkey for the quaternary ability. If none, the default hotkey will be set to 'Hotkey Ability B' + Blocking. It is recommended that you use a configuration manager mod to easily change the hotkey in-game."); HotkeyAbilityTeleport = config.Bind<KeyboardShortcut>("(Hotkeys)", GenerateConfigKey("HotkeyAbilityTeleport"), new KeyboardShortcut((KeyCode)112, Array.Empty<KeyCode>()), "Hotkey for the teleport ability. Examples: Mouse 0, Mouse 1, Q, C, LeftShift + Q, LeftShift + Alpha1. It is recommended that you use a configuration manager mod to easily change the hotkey in-game."); HotkeyIgnoreSpecialAttack = config.Bind<KeyboardShortcut>("(Hotkeys)", GenerateConfigKey("HotkeyIgnoreSpecialAttack"), new KeyboardShortcut((KeyCode)308, Array.Empty<KeyCode>()), "Hotkey used to ignore the demigod's special attack, performing the original (game default) special attack instead. It is recommended that you use a configuration manager mod to easily change the hotkey in-game."); SpecialAttackSpeedModifier = config.Bind<int>("(Special Modifiers)", GenerateConfigKey("SpecialAttackSpeedModifier", "%"), 100, new ConfigDescription("Modifier, as a percentage, to the attack speed increased by special sources from this mod (such as attributes). Does not affect punches or custom ability animation speeds.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 300), new object[1] { IsAdminOnly })); SpecialDamageModifier = config.Bind<int>("(Special Modifiers)", GenerateConfigKey("SpecialDamageModifier", "%"), 100, new ConfigDescription("Modifier, as a percentage, to the damage caused by special sources from this mod (such as abilities or attributes).", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 1000), new object[1] { IsAdminOnly })); SpecialDamageToResourcesModifier = config.Bind<int>("(Special Modifiers)", GenerateConfigKey("SpecialDamageToResourcesModifier", "%"), 100, new ConfigDescription("Modifier, as a percentage, to the damage to resources (such as trees and ores) caused by special sources from this mod (such as abilities).", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 500), new object[1] { IsAdminOnly })); SpecialHealingModifier = config.Bind<int>("(Special Modifiers)", GenerateConfigKey("SpecialHealingModifier", "%"), 100, new ConfigDescription("Modifier, as a percentage, to healing from this mod, including abilities, attributes and summoned creatures. Applied after healing caps; only the bonus portion of food regeneration is modified.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 1000), new object[1] { IsAdminOnly })); SpecialJumpForceModifier = config.Bind<int>("(Special Modifiers)", GenerateConfigKey("SpecialJumpForceModifier", "%"), 100, new ConfigDescription("Modifier, as a percentage, to the jump force increased by special sources from this mod (such as attributes).", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 300), new object[1] { IsAdminOnly })); SpecialMovementSpeedModifier = config.Bind<int>("(Special Modifiers)", GenerateConfigKey("SpecialMovementSpeedModifier", "%"), 100, new ConfigDescription("Modifier, as a percentage, to the movement speed increased by special sources from this mod (such as attributes).", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 300), new object[1] { IsAdminOnly })); EnablePvpForAbilities = config.Bind<bool>("Combat", GenerateConfigKey("EnablePvpForAbilities"), true, new ConfigDescription("Offensive abilities will be taken into account in player-versus-player (PvP) combat.", (AcceptableValueBase)null, new object[1] { IsAdminOnly })); EnemiesIgnoreChopDamage = config.Bind<bool>("Combat", GenerateConfigKey("EnemiesIgnoreChopDamage"), true, "Any enemy hit by a demigod will start ignoring chop damage until dead. This will prevent enemies that are weak against this damage type from being obliterated by certain abilities that are also used to damage and gather resources."); EnemiesIgnorePickaxeDamage = config.Bind<bool>("Combat", GenerateConfigKey("EnemiesIgnorePickaxeDamage"), true, "Any enemy hit by a demigod will start ignoring pickaxe damage until dead. This will prevent enemies that are weak against this damage type from being obliterated by certain abilities that are also used to damage and gather resources."); FollowerDamageFromBossModifier = config.Bind<int>("Combat", GenerateConfigKey("FollowerDamageFromBossModifier", "%"), 50, new ConfigDescription("Determines the damage, as a percentage, a summoned companion would take from a boss. A value of '100%' would mean no changes to the damage taken, whereas a value of '20%' would mean an 80% reduction to the damage taken.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 500), new object[1] { IsAdminOnly })); EnergyAtBaseLevel = config.Bind<int>("Energy", GenerateConfigKey("EnergyAtBaseLevel"), 2, new ConfigDescription("Determines the maximum energy the player will have at demigod skill level zero.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), new object[1] { IsAdminOnly })); EnergyAtMaxLevel = config.Bind<int>("Energy", GenerateConfigKey("EnergyAtMaxLevel"), 12, new ConfigDescription("Determines the maximum energy the player will have at the maximum demigod skill level.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), new object[1] { IsAdminOnly })); EnergyRegenerationPeriod = config.Bind<int>("Energy", GenerateConfigKey("EnergyRegenerationPeriod", "seconds"), 10, new ConfigDescription("Determines how often, in seconds, one energy point is passively regenerated. Enter '0' in order to disable this feature.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 600), new object[1] { IsAdminOnly })); BerserkerArmorSetGrantedArmor = config.Bind<int>("Enhanced Armor Set Berserker", GenerateConfigKey("BerserkerArmorSetGrantedArmor"), 12, new ConfigDescription("Provides additional armor to Fenrir when wearing the full set.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 500), new object[1] { IsAdminOnly })); FenrisArmorBonusMovementSpeed = config.Bind<int>("Enhanced Armor Set Fenris", GenerateConfigKey("FenrisArmorBonusMovementSpeed", "%"), 5, new ConfigDescription("Determines the additional movement speed granted by a single armor piece (excluding the helmet). Default game value = 3% per piece (including the helmet).", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), new object[1] { IsAdminOnly })); FenrisArmorSetGrantedArmor = config.Bind<int>("Enhanced Armor Set Fenris", GenerateConfigKey("FenrisArmorSetGrantedArmor"), 18, new ConfigDescription("Provides additional armor to Fenrir when wearing the full set.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 500), new object[1] { IsAdminOnly })); InfusedMegingjordCostItemName = config.Bind<string>("Enhanced Megingjord", GenerateConfigKey("InfusedMegingjordCostItemName"), "Thunderstone", new ConfigDescription("The name of the required item to forge an Infused Megingjord.", (AcceptableValueBase)null, new object[1] { IsAdminOnly })); InfusedMegingjordCostItemQuantity = config.Bind<int>("Enhanced Megingjord", GenerateConfigKey("InfusedMegingjordCostItemQuantity"), 20, new ConfigDescription("The quantity of the item required to forge an Infused Megingjord.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 500), new object[1] { IsAdminOnly })); InfusedMegingjordIncreasedEnergy = config.Bind<int>("Enhanced Megingjord", GenerateConfigKey("InfusedMegingjordIncreasedEnergy"), 3, new ConfigDescription("The amount of extra energy the wearer of an Infused Megingjord will have.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), new object[1] { IsAdminOnly })); InfusedMegingjordIncreasedMaxWeight = config.Bind<int>("Enhanced Megingjord", GenerateConfigKey("InfusedMegingjordIncreasedMaxWeight"), 300, new ConfigDescription("The amount of extra weight the wearer of an Infused Megingjord will be able to carry.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 2000), new object[1] { IsAdminOnly })); EnableHarpoonFishing = config.Bind<bool>("Harpoon Fishing", GenerateConfigKey("EnableHarpoonFishing"), true, new ConfigDescription("Enables fishing with an Abyssal harpoon.", (AcceptableValueBase)null, new object[1] { IsAdminOnly })); HarpoonMaxQuality = config.Bind<int>("Harpoon Fishing", GenerateConfigKey("HarpoonMaxQuality"), 3, new ConfigDescription("Abyssal harpoon's max quality, which can be upgraded at the crafting station. Game default value = 1.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 5), new object[1] { IsAdminOnly })); HarpoonProjectileCollisionRadius = config.Bind<float>("Harpoon Fishing", GenerateConfigKey("HarpoonProjectileCollisionRadius"), 0.3f, new ConfigDescription("Base collision radius of the Abyssal harpoon's projectile, making it easier to catch fish. Game default value = 0.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 0.5f), new object[1] { IsAdminOnly })); HarpoonUpgradeChitinPerLevel = config.Bind<int>("Harpoon Fishing", GenerateConfigKey("HarpoonUpgradeChitinPerLevel"), 15, new ConfigDescription("Chitin required to upgrade an Abyssal harpoon. The amount doubles with every upgrade. Game default value = 0.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 500), new object[1] { IsAdminOnly })); HarpoonUpgradeDurabilityPerLevel = config.Bind<int>("Harpoon Fishing", GenerateConfigKey("HarpoonUpgradeDurabilityPerLevel"), 25, new ConfigDescription("Abyssal harpoon's durability increase per upgrade. Game default value = 0.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 500), new object[1] { IsAdminOnly })); IgnoreBeehiveProximityCheck = config.Bind<bool>("Honey", GenerateConfigKey("IgnoreBeehiveProximityCheck"), false, new ConfigDescription("Ignore beehive proximity check, meaning bees will not require any extra space to be happy. Disable in case of issues.", (AcceptableValueBase)null, new object[1] { IsAdminOnly })); MaxHoneyProducedByBeehive = config.Bind<int>("Honey", GenerateConfigKey("MaxHoneyProducedByBeehive"), 4, new ConfigDescription("Determines the maximum amount of honey a beehive can produce before it becomes full. Default game value = 4.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 50), new object[1] { IsAdminOnly })); QueenBeeSpawnChance = config.Bind<int>("Honey", GenerateConfigKey("QueenBeeSpawnChance", "%"), 0, new ConfigDescription("Determines the chance, as a percentage, of spawning a queen bee per honey extracted from a beehive. Default game value = 0%.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), new object[1] { IsAdminOnly })); EnableCustomMerchantItems = config.Bind<bool>("Merchant", GenerateConfigKey("EnableCustomMerchantItems"), false, new ConfigDescription("Enables the selling of additional items by the merchant (Haldor).", (AcceptableValueBase)null, new object[1] { SetOrder(1) })); AbyssalHarpoonPrice = config.Bind<int>("Merchant", GenerateConfigKey("AbyssalHarpoonPrice"), 350, new ConfigDescription("Number of coins required to buy an Abyssal Harpoon from the merchant. Enter '0' to disable trading this item.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 10000), new object[1] { IsAdminOnly })); QueenBeePrice = config.Bind<int>("Merchant", GenerateConfigKey("QueenBeePrice"), 150, new ConfigDescription("Number of coins required to buy a queen bee from the merchant. Enter '0' to disable trading this item.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 10000), new object[1] { IsAdminOnly })); RunestoneSpawnAtStart = config.Bind<bool>("Runestone", GenerateConfigKey("RunestoneSpawnAtStart"), true, new ConfigDescription("Place a runestone in the player's inventory at the start of the game. If disabled, the player will have to craft the item to pick a demigod.", (AcceptableValueBase)null, new object[1] { SetOrder(0) })); RunestoneConsumable = config.Bind<bool>("Runestone", GenerateConfigKey("RunestoneConsumable"), false, new ConfigDescription("Consume runestone when used.", (AcceptableValueBase)null, new object[1] { SetOrder(-1) })); RunestoneCraftingRecipe = config.Bind<string>("Runestone", GenerateConfigKey("RunestoneCraftingRecipe"), "Stone:1,Resin:1", new ConfigDescription("Resources and amounts required for crafting a runestone. Format: prefab1:quantity1,prefab2:quantity2,(...)", (AcceptableValueBase)null, new object[1] { SetOrder(-2) })); SkillDemigodExperienceModifier = config.Bind<int>("Skills", GenerateConfigKey("SkillDemigodExperienceModifier", "%"), 100, new ConfigDescription("Modifier, as a percentage, to demigod skill points gained overall.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 1000), new object[1] { SetOrder(1) })); EnableSkillDemigodCap = config.Bind<bool>("Skills", GenerateConfigKey("EnableSkillDemigodCap"), true, new ConfigDescription("The demigod skill is capped based on the highest-level defeated boss.", (AcceptableValueBase)null, new object[1] { IsAdminOnly })); EnableSkillLossOnDeath = config.Bind<bool>("Skills", GenerateConfigKey("EnableSkillLossOnDeath"), false, new ConfigDescription("Enable loss of the demigod skill (level) on death.", (AcceptableValueBase)null, new object[1] { IsAdminOnly })); LevelsLostOnDeath = config.Bind<int>("Skills", GenerateConfigKey("LevelsLostOnDeath"), 5, new ConfigDescription("Demigod skill levels lost on death.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), new object[1] { IsAdminOnly })); LevelsLostWhenSwitchingDemigod = config.Bind<int>("Skills", GenerateConfigKey("LevelsLostWhenSwitchingDemigod"), 5, new ConfigDescription("Demigod skill levels lost when switching demigods. Applies independently of skill loss on death.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), new object[1] { (object)new ConfigurationManagerAttributes { IsAdminOnly = true, ShowRangeAsPercent = false } })); for (int i = 0; i < SkillDemigodCapSettings.Length; i++) { SkillDemigodCap.Add(GenerateDemigodSkillCapConfigEntry(config, SkillDemigodCapSettings[i], -i - 1)); } EnableTeleportAbility = config.Bind<bool>("Teleportation", GenerateConfigKey("EnableTeleportAbility"), true, new ConfigDescription("Enables the teleport ability for all demigods. Can be used to teleport the player to bed, and back to the location saved before teleporting to bed.", (AcceptableValueBase)null, new object[1] { IsAdminOnly })); IgnoreNonTeleportableItems = config.Bind<bool>("Teleportation", GenerateConfigKey("IgnoreNonTeleportableItems"), false, new ConfigDescription("Ignore non-teleportable items such as ore, allowing them to be carried over. This setting has no effect if neither world modifiers nor other mods restrict teleportation.", (AcceptableValueBase)null, new object[1] { IsAdminOnly })); WeakerCreaturesListSettingChanged(null, null); DisabledDemigodsSettingChanged(null, null); CustomUI.SetupConfigs(config, "User Interface"); Type[] entities = GetEntities(); foreach (Type type in entities) { type.GetMethod("SetupConfigs", BindingFlags.Static | BindingFlags.NonPublic).Invoke(type, new object[2] { config, GenerateConfigKey(type.Name) }); } if (AutomaticallyUpdateConfigs.Value && ModVersion.Value != "1.8.1") { ResetMainSettings(); } ModVersion.Value = "1.8.1"; WorldCreaturesExempt.SettingChanged += WeakerCreaturesListSettingChanged; DisabledDemigodsList.SettingChanged += DisabledDemigodsSettingChanged; config.SettingChanged += Config_SettingChanged; } private static void WeakerCreaturesListSettingChanged(object sender, EventArgs e) { if (Helper.StringToList(WorldCreaturesExempt.Value, ref ExemptWorldCreaturesListPrefabs)) { Logger.LogInfo((object)string.Format("Config entry '{0}' parsed successfully.", "WorldCreaturesExempt")); } else { Logger.LogError((object)string.Format("Could not parse config entry '{0}'.", "WorldCreaturesExempt")); } } private static void DisabledDemigodsSettingChanged(object sender, EventArgs e) { if (Helper.StringToList(DisabledDemigodsList.Value, ref DisabledDemigodsListNames)) { Logger.LogInfo((object)string.Format("Config entry '{0}' parsed successfully.", "DisabledDemigodsList")); } else { Logger.LogError((object)string.Format("Could not parse config entry '{0}'.", "DisabledDemigodsList")); } } public static Type[] GetEntities() { return (from t in Assembly.GetExecutingAssembly().GetTypes() where t.IsClass && !t.IsNested && (t.Namespace == "NorseDemigods.Abilities" || t.Namespace == "NorseDemigods.Attributes" || t.Namespace == "NorseDemigods.Demigods") select t).ToArray(); } public static string GenerateConfigKey(string key) { return GenerateConfigKey(key, null); } public static string GenerateConfigKey(string key, string unit) { key = string.Concat(key.Select((char x) => (!char.IsUpper(x)) ? x.ToString() : (" " + x))).TrimStart(new char[1] { ' ' }); if (!string.IsNullOrEmpty(unit)) { key += $" ({unit})"; } return key; } public static ConfigEntry<int> GenerateDemigodSkillCapConfigEntry(ConfigFile config, SkillDemigodCapStruct skillDemigodCapSetting, int order) { //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Expected O, but got Unknown return config.Bind<int>("Skills", string.Format("Skill Demigod Cap {0}", GenerateConfigKey(skillDemigodCapSetting.BossName.Replace(" ", ""))), skillDemigodCapSetting.SkillCap, new ConfigDescription("Caps the demigod skill at the given level based on the highest-level boss defeated. Enter '0' to remove the cap.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), new object[1] { SetOrder(order) })); } public static ConfigurationManagerAttributes SetOrder(int order, bool isAdvanced = false, bool isAdminOnly = true) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown return new ConfigurationManagerAttributes { Order = order, IsAdvanced = isAdvanced, IsAdminOnly = isAdminOnly }; } public static void ResetMainSettings() { //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) Type[] entities = GetEntities(); foreach (Type type in entities) { FieldInfo[] fields = type.GetFields(BindingFlags.Static | BindingFlags.NonPublic); foreach (FieldInfo fieldInfo in fields) { if (!fieldInfo.FieldType.Name.Contains("ConfigEntry")) { continue; } object value = fieldInfo.GetValue(type); object obj = ((ConfigDescription)value.GetType().GetProperty("Description", BindingFlags.Instance | BindingFlags.Public).GetValue(value)).Tags.FirstOrDefault((object x) => x.GetType() == typeof(ConfigurationManagerAttributes)); if (obj != null) { bool? isAdvanced = ((ConfigurationManagerAttributes)obj).IsAdvanced; if (isAdvanced.HasVa