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 SnakewaySurfer v1.16.163
SnakewaySurfer.dll
Decompiled 3 days 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.Globalization; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; using TMPro; using UnityEngine; using UnityEngine.Audio; using UnityEngine.Rendering; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: IgnoresAccessChecksTo("assembly_guiutils")] [assembly: IgnoresAccessChecksTo("assembly_utils")] [assembly: IgnoresAccessChecksTo("assembly_valheim")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyCompany("SnakewaySurfer")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+2b48b71c7e4bcc430c018099ed37431b408c2ff1")] [assembly: AssemblyProduct("SnakewaySurfer")] [assembly: AssemblyTitle("SnakewaySurfer")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace SnakewaySurfer { internal sealed class BiomeDef { public string Name = ""; public Color Ground; public string Monsters = ""; public string Flyers = ""; public string FallbackMonsters = ""; public string FallbackFlyers = ""; public string Scenery = ""; public string Logs = ""; public string Foods = ""; public string Giants = ""; public string Locations = ""; public string Landmarks = ""; public string Pickables = ""; } internal static class Biomes { public static readonly BiomeDef[] Defaults = new BiomeDef[8] { new BiomeDef { Name = "Meadows", Landmarks = "Neck: Pickable_Flint; Boar: Pickable_Mushroom", Pickables = "Pickable_Dandelion, Pickable_Mushroom, Pickable_Flint, Pickable_Stone, Pickable_Branch, RaspberryBush", Ground = new Color(0.36f, 0.52f, 0.22f), Monsters = "auto", FallbackMonsters = "greyling, boar, neck, deer", Flyers = "auto", FallbackFlyers = "", Scenery = "Beech1, Beech_small1, Beech_small2, Oak1, Bush01, Rock_3", Logs = "beech_log_half, Oak_log_half", Foods = "raspberries, honey, meat_cooked, deer_meat_cooked, boarjerky" }, new BiomeDef { Name = "Black Forest", Landmarks = "Greydwarf*: Spawner_GreydwarfNest; Skeleton: BonePileSpawner; Troll: Pickable_Stone", Pickables = "Pickable_Mushroom_yellow, Pickable_Thistle, Pickable_SeedCarrot, Pickable_Branch, Pickable_Stone, BlueberryBush", Locations = "troll:1.2, skeleton:0.6", Ground = new Color(0.2f, 0.3f, 0.16f), Monsters = "auto", FallbackMonsters = "greydwarf, greydwarfbrute, greydwarfshaman, troll, skeleton, bjorn", Giants = "troll", Flyers = "auto", FallbackFlyers = "", Scenery = "FirTree, Pinetree_01, FirTree_small, FirTree_oldLog, rock4_forest", Logs = "FirTree_log_half, PineTree_log_half", Foods = "blueberries, carrotsoup, deerstew, queensjam, mushroomyellow" }, new BiomeDef { Name = "Swamp", Landmarks = "Draugr*: Spawner_DraugrPile; Skeleton*: BonePileSpawner_swamp; Blob*: Pickable_Mushroom", Pickables = "Pickable_SeedTurnip, Pickable_Branch, Pickable_Mushroom", Locations = "draugr:0.8, draugrelite:0.4, skeletonpoison:0.4", Giants = "abomination", Ground = new Color(0.24f, 0.22f, 0.14f), Monsters = "auto", FallbackMonsters = "draugr, draugrelite, blob, abomination, wraith, skeletonpoison", Flyers = "auto", FallbackFlyers = "", Scenery = "SwampTree1, SwampTree2, SwampTree2_darkland, stubbe, Rock_4", Logs = "SwampTree1_log, SwampTree2_log", Foods = "sausages, turnipstew, blacksoup, shocklatesmoothie" }, new BiomeDef { Name = "Mountains", Landmarks = "Hatchling: Pickable_DragonEgg; Fenring: Pickable_Obsidian", Pickables = "Pickable_Branch_Snow, Pickable_Stone, Pickable_Obsidian, Pickable_SeedOnion", Locations = "fenring:0.6, ulv:0.6", Ground = new Color(0.86f, 0.89f, 0.93f), Monsters = "auto", FallbackMonsters = "wolf, fenring, stonegolem, ulv, trollfrost", Flyers = "auto", FallbackFlyers = "drake, bat", Scenery = "Pinetree_Snow, SnowFirTree, Pinetree_Snow_dead, rock1_mountain, rock2_mountain, rock3_mountain", Logs = "PineTree_Snow_log_half, FirTree_Snow_log_half", Foods = "eyescream, onionsoup, wolfjerky, wolf_skewer, wolf_meat_cooked" }, new BiomeDef { Name = "Plains", Landmarks = "Goblin*: goblin_totempole, goblin_banner, goblin_fence, goblin_trashpile", Pickables = "Pickable_Barley_Wild, Pickable_Flax_Wild, CloudberryBush, Pickable_Branch", Locations = "goblinbrute:0.5, goblinshaman:0.5", Ground = new Color(0.62f, 0.58f, 0.3f), Monsters = "auto", FallbackMonsters = "goblin, goblinbrute, goblinshaman, lox, unbjorn", Flyers = "auto", FallbackFlyers = "deathsquito", Scenery = "Birch1, Birch2, Birch1_aut, Birch2_aut, rock2_heath, rock4_heath, Bush01", Logs = "Birch_log_half", Foods = "bloodpudding, bread, fishwraps, loxpie, loxmeat_cooked, cloudberries" }, new BiomeDef { Name = "Mistlands", Landmarks = "Dverger*: dvergrprops_crate, dvergrprops_barrel, dvergrprops_lantern_standing, dvergrprops_banner; Seeker*: Pickable_RoyalJelly; Tick: Pickable_RoyalJelly", Pickables = "Pickable_Mushroom_Magecap, Pickable_Mushroom_JotunPuffs, Pickable_DvergrLantern", Locations = "seekerbrute:0.4, seeker:0.8, tick:0.4", Ground = new Color(0.3f, 0.28f, 0.33f), Monsters = "auto", FallbackMonsters = "seeker, seekerbrute, tick, dvergr, dvergr_mage", Flyers = "auto", FallbackFlyers = "", Scenery = "YggaShoot1, YggaShoot2, YggaShoot3, YggaShoot_small1, rock1_mistlands", Logs = "yggashoot_log_half", Foods = "salad, mushroomomelette, seekeraspic, yggdrasilporridge, mistharesupreme, fishandbread, honeyglazedchicken, magicallystuffedmushroom" }, new BiomeDef { Name = "Ashlands", Landmarks = "Charred*: Pickable_Charredskull", Pickables = "Pickable_Ashstone, Pickable_Charredskull, Pickable_SmokePuff", Ground = new Color(0.17f, 0.12f, 0.11f), Monsters = "auto", FallbackMonsters = "charred_melee, charred_archer, charred_mage, asksvin, morgen, fallenvalkyrie", Flyers = "auto", FallbackFlyers = "volture", Scenery = "AshlandsTree1, AshlandsTree3, AshlandsTree4, AshlandsTree5, AshlandsTreeStump1", Logs = "AshlandsTreeLogHalf1, AshlandsTreeLogHalf2", Foods = "scorchingmedley, sparklingshroomshake, piquantpie, roastedcrustpie, sizzlingberrybroth, marinatedgreens, spicymarmalade, mashedmeat" }, new BiomeDef { Name = "Deep North", Landmarks = "", Pickables = "Pickable_Branch_Snow, Pickable_Snowball", Ground = new Color(0.8f, 0.88f, 0.95f), Monsters = "auto", FallbackMonsters = "frysling, jotun_warrior, jotun_witch, kvastur, moose, trollfrost, blobfrost, writhan", Flyers = "auto", FallbackFlyers = "bat", Scenery = "SnowFirTree, Pinetree_Snow, FirTree_oldLog_deepnorth, rock3_ice, Pinetree_Snow_dead", Logs = "PineTree_Snow_log_half, FirTree_Snow_log_half", Foods = "sealsoup, smokedmoosemeat, moose_meat_cooked, meatballsmashedpoteitr, oatmeallingonberryjam, blubber_cooked" } }; } internal sealed class Compare : MonoBehaviour { private static Compare? s_active; private Character m_real; private Animator? m_realAnim; private Animator? m_picAnim; private GameObject m_picture; private Transform m_holder; private float m_offset; private float m_logTimer; private float m_life = 90f; private readonly List<(string name, AnimatorControllerParameterType type)> m_params = new List<(string, AnimatorControllerParameterType)>(); public static void Run(Terminal terminal) { //IL_0089: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)s_active != (Object)null) { Object.Destroy((Object)(object)((Component)s_active).gameObject); s_active = null; terminal.AddString("surfcompare: off."); return; } Character val = Target(); if ((Object)(object)val == (Object)null) { terminal.AddString("surfcompare: look at a creature within 40 m first."); return; } GameObject val2 = (((Object)(object)ZNetScene.instance != (Object)null) ? ZNetScene.instance.GetPrefab(Utils.GetPrefabName(((Component)val).gameObject)) : null); if ((Object)(object)val2 == (Object)null) { terminal.AddString("surfcompare: couldn't find that creature's prefab."); return; } Compare compare = new GameObject("SurfCompare").AddComponent<Compare>(); compare.Setup(val, val2); s_active = compare; terminal.AddString("surfcompare: the minigame's " + ((Object)val2).name + " is beside the real one for 90 s (type surfcompare again to remove it). Details in the log."); } private static Character? Target() { //IL_0044: 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_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: 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_0078: Unknown result type (might be due to invalid IL or missing references) Camera main = Camera.main; if ((Object)(object)main == (Object)null) { return null; } Character result = null; float num = float.MaxValue; foreach (Character allCharacter in Character.GetAllCharacters()) { if ((Object)(object)allCharacter == (Object)null || allCharacter is Player) { continue; } Vector3 val = allCharacter.GetCenterPoint() - ((Component)main).transform.position; float magnitude = ((Vector3)(ref val)).magnitude; if (magnitude > 40f) { continue; } float num2 = Vector3.Angle(((Component)main).transform.forward, val); if (!(num2 > 25f)) { float num3 = num2 + magnitude * 0.2f; if (num3 < num) { num = num3; result = allCharacter; } } } return result; } private void Setup(Character real, GameObject prefab) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Expected O, but got Unknown //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Invalid comparison between Unknown and I4 //IL_012b: Unknown result type (might be due to invalid IL or missing references) m_real = real; m_realAnim = ((Component)real).GetComponentInChildren<Animator>(); GameObject val = new GameObject("Templates"); val.SetActive(false); val.transform.SetParent(((Component)this).transform, false); m_holder = val.transform; CreatureInfo creatureInfo = CreatureInfo.Of(prefab); GameObject val2 = Pictures.MakePicture(prefab, m_holder, ((Component)real).gameObject.layer); m_picture = Object.Instantiate<GameObject>(val2, ((Component)this).transform, false); m_picture.transform.localScale = ((Component)real).transform.localScale; m_offset = Mathf.Max(1.5f, creatureInfo.Height * 0.6f + 1f); m_picAnim = m_picture.GetComponentInChildren<Animator>(); CreatureAttack creatureAttack = creatureInfo.PickMelee() ?? creatureInfo.PickRanged(); if (creatureAttack != null) { Arm(m_picture, creatureInfo, creatureAttack); } if ((Object)(object)m_realAnim != (Object)null) { AnimatorControllerParameter[] parameters = m_realAnim.parameters; foreach (AnimatorControllerParameter val3 in parameters) { if ((int)val3.type != 9) { m_params.Add((val3.name, val3.type)); } } } Place(); Log(creatureInfo, "start"); } private void Arm(GameObject creature, CreatureInfo info, CreatureAttack attack) { //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0079: 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) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: 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_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: 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_00ff: Unknown result type (might be due to invalid IL or missing references) string text = (attack.LeftHand ? info.LeftHand : info.RightHand); if (!((Object)(object)attack.Attach == (Object)null) && !string.IsNullOrEmpty(text)) { Transform val = creature.transform.Find(text); if (!((Object)(object)val == (Object)null)) { GameObject obj = Object.Instantiate<GameObject>(Pictures.MakePicture(attack.Attach, m_holder, creature.layer), val, false); obj.transform.localPosition = Vector3.zero; obj.transform.localRotation = Quaternion.identity; Vector3 val2 = attack.AttachScale * creature.transform.localScale.x; Vector3 lossyScale = val.lossyScale; obj.transform.localScale = new Vector3(val2.x / Mathf.Max(0.0001f, Mathf.Abs(lossyScale.x)), val2.y / Mathf.Max(0.0001f, Mathf.Abs(lossyScale.y)), val2.z / Mathf.Max(0.0001f, Mathf.Abs(lossyScale.z))); } } } private void Place() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) Transform transform = ((Component)m_real).transform; m_picture.transform.SetPositionAndRotation(transform.position + transform.right * m_offset, transform.rotation); } private void LateUpdate() { //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_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Expected I4, but got Unknown //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) m_life -= Time.deltaTime; if ((Object)(object)m_real == (Object)null || m_life <= 0f) { Object.Destroy((Object)(object)((Component)this).gameObject); return; } Place(); if ((Object)(object)m_realAnim != (Object)null && (Object)(object)m_picAnim != (Object)null) { foreach (var (text, val) in m_params) { switch (val - 1) { case 0: m_picAnim.SetFloat(text, m_realAnim.GetFloat(text)); break; case 2: m_picAnim.SetInteger(text, m_realAnim.GetInteger(text)); break; case 3: m_picAnim.SetBool(text, m_realAnim.GetBool(text)); break; } } AnimatorStateInfo currentAnimatorStateInfo = m_realAnim.GetCurrentAnimatorStateInfo(0); AnimatorStateInfo currentAnimatorStateInfo2 = m_picAnim.GetCurrentAnimatorStateInfo(0); if (((AnimatorStateInfo)(ref currentAnimatorStateInfo)).fullPathHash != ((AnimatorStateInfo)(ref currentAnimatorStateInfo2)).fullPathHash && !m_picAnim.IsInTransition(0)) { m_picAnim.CrossFade(((AnimatorStateInfo)(ref currentAnimatorStateInfo)).fullPathHash, 0.15f, 0, ((AnimatorStateInfo)(ref currentAnimatorStateInfo)).normalizedTime); } m_picAnim.speed = m_realAnim.speed; } m_logTimer -= Time.deltaTime; if (m_logTimer <= 0f) { m_logTimer = 3f; Log(null, "now"); } } private void Log(CreatureInfo? info, string when) { //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_02e0: Unknown result type (might be due to invalid IL or missing references) //IL_02e5: Unknown result type (might be due to invalid IL or missing references) //IL_02e9: Unknown result type (might be due to invalid IL or missing references) //IL_02ec: Invalid comparison between Unknown and I4 //IL_02ee: Unknown result type (might be due to invalid IL or missing references) //IL_02f1: Invalid comparison between Unknown and I4 StringBuilder stringBuilder = new StringBuilder(); stringBuilder.Append("[surfcompare] " + ((Object)m_real).name + " " + when + ": "); if (info != null) { stringBuilder.Append($"minigame height {info.Height:0.00} (Monster Height {Plugin.MonsterHeight.Value:0.0} shrinks it x{((info.Height > 0.3f) ? Mathf.Min(1f, Plugin.MonsterHeight.Value / info.Height) : 1f):0.00}), walk {info.WalkSpeed:0.0} run {info.RunSpeed:0.0}; "); } stringBuilder.Append($"real scale {((Component)m_real).transform.lossyScale.x:0.00} level {m_real.GetLevel()}"); CapsuleCollider component = ((Component)m_real).GetComponent<CapsuleCollider>(); if ((Object)(object)component != (Object)null) { stringBuilder.Append($" collider h {component.height * ((Component)m_real).transform.lossyScale.y:0.00}"); } if (Pictures.MeshBounds(((Component)m_real).gameObject, out var bounds)) { stringBuilder.Append($" render h {((Bounds)(ref bounds)).size.y:0.00} w {((Bounds)(ref bounds)).size.x:0.00}"); } if (Pictures.MeshBounds(m_picture, out var bounds2)) { stringBuilder.Append($"; picture render h {((Bounds)(ref bounds2)).size.y:0.00} w {((Bounds)(ref bounds2)).size.x:0.00}, feet {((Bounds)(ref bounds2)).min.y - m_picture.transform.position.y:+0.00;-0.00} vs real {(Pictures.MeshBounds(((Component)m_real).gameObject, out var bounds3) ? (((Bounds)(ref bounds3)).min.y - ((Component)m_real).transform.position.y) : 0f):+0.00;-0.00}"); } stringBuilder.Append($"; anim real {Clips(m_realAnim)} speed {(((Object)(object)m_realAnim != (Object)null) ? m_realAnim.speed : 0f):0.00}, picture {Clips(m_picAnim)}"); if ((Object)(object)m_realAnim != (Object)null) { List<string> list = new List<string>(); foreach (var (text, val) in m_params) { list.Add(((int)val == 1) ? $"{text}={m_realAnim.GetFloat(text):0.00}" : (((int)val == 3) ? $"{text}={m_realAnim.GetInteger(text)}" : $"{text}={m_realAnim.GetBool(text)}")); } stringBuilder.Append("; real params " + string.Join(" ", list)); } Plugin.Log.LogInfo((object)stringBuilder.ToString()); } private static string Clips(Animator? anim) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)anim == (Object)null) { return "none"; } List<string> list = new List<string>(); AnimatorClipInfo[] currentAnimatorClipInfo = anim.GetCurrentAnimatorClipInfo(0); for (int i = 0; i < currentAnimatorClipInfo.Length; i++) { AnimatorClipInfo val = currentAnimatorClipInfo[i]; list.Add($"{((Object)((AnimatorClipInfo)(ref val)).clip).name}({((AnimatorClipInfo)(ref val)).weight:0.0})"); } if (list.Count <= 0) { return "?"; } return string.Join("+", list); } private void OnDestroy() { if ((Object)(object)s_active == (Object)(object)this) { s_active = null; } } } internal sealed class CreatureAttack { public string Item = ""; public string Animation = ""; public AttackType Type; public GameObject? Projectile; public GameObject? Attach; public Vector3 AttachScale = Vector3.one; public bool LeftHand; public int AnimationState; public string Sound = ""; public readonly List<GameObject> Effects = new List<GameObject>(); public readonly List<GameObject> Impact = new List<GameObject>(); public readonly List<string> StartSounds = new List<string>(); public readonly List<string> ImpactSounds = new List<string>(); public bool Area => (int)Type == 4; public bool Ranged => (Object)(object)Projectile != (Object)null; } internal sealed class CreatureInfo { public readonly List<CreatureAttack> Melee = new List<CreatureAttack>(); public readonly List<CreatureAttack> Ranged = new List<CreatureAttack>(); public float WalkSpeed = 2f; public float RunSpeed = 5f; public bool Flying; public string? RightHand; public string? LeftHand; public string AlertSound = ""; public string StepSound = ""; public string WakeSound = ""; public float Height; public string? LevelPath; public string? MainRenderPath; public string? BaseEnablePath; public readonly List<(float scale, float hue, float saturation, float value, bool emissive, Color emission, string? enablePath)> Levels = new List<(float, float, float, float, bool, Color, string)>(); public readonly List<string> Talk = new List<string>(); private static readonly Dictionary<GameObject, CreatureInfo> s_cache = new Dictionary<GameObject, CreatureInfo>(); public bool Fast => RunSpeed >= 7f; public static CreatureInfo Of(GameObject prefab) { //IL_0123: 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_00ff: 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_0367: Unknown result type (might be due to invalid IL or missing references) if (s_cache.TryGetValue(prefab, out CreatureInfo info)) { return info; } info = new CreatureInfo(); Character component = prefab.GetComponent<Character>(); if ((Object)(object)component != (Object)null) { info.WalkSpeed = component.m_walkSpeed; info.RunSpeed = component.m_runSpeed; info.Flying = component.m_flying; } BaseAI component2 = prefab.GetComponent<BaseAI>(); if ((Object)(object)component2 != (Object)null) { info.AlertSound = FirstSound(component2.m_alertedEffects) ?? FirstSound(component2.m_idleSound) ?? ""; } MonsterAI val = (MonsterAI)(object)((component2 is MonsterAI) ? component2 : null); if (val != null) { info.WakeSound = FirstSound(val.m_wakeupEffects) ?? ""; } CapsuleCollider component3 = prefab.GetComponent<CapsuleCollider>(); if ((Object)(object)component3 != (Object)null) { float num = ((component3.direction == 1) ? prefab.transform.lossyScale.y : ((component3.direction == 0) ? prefab.transform.lossyScale.x : prefab.transform.lossyScale.z)); info.Height = ((component3.direction == 1) ? (component3.height * num) : (component3.radius * 2f * prefab.transform.lossyScale.y)); } FootStep componentInChildren = prefab.GetComponentInChildren<FootStep>(true); if ((Object)(object)componentInChildren != (Object)null && componentInChildren.m_effects != null) { foreach (StepEffect effect in componentInChildren.m_effects) { if (info.StepSound.Length > 0) { break; } GameObject[] array = (GameObject[])(((object)effect?.m_effectPrefabs) ?? ((object)new GameObject[0])); foreach (GameObject val2 in array) { if ((Object)(object)val2 != (Object)null && (Object)(object)val2.GetComponentInChildren<ZSFX>(true) != (Object)null) { info.StepSound = ((Object)val2).name; break; } } } } LevelEffects componentInChildren2 = prefab.GetComponentInChildren<LevelEffects>(true); if ((Object)(object)componentInChildren2 != (Object)null) { info.LevelPath = (((Object)(object)((Component)componentInChildren2).transform == (Object)(object)prefab.transform) ? "" : PathOf(prefab.transform, ((Component)componentInChildren2).transform)); info.MainRenderPath = ((!((Object)(object)componentInChildren2.m_mainRender != (Object)null)) ? null : (((Object)(object)((Component)componentInChildren2.m_mainRender).transform == (Object)(object)prefab.transform) ? "" : PathOf(prefab.transform, ((Component)componentInChildren2.m_mainRender).transform))); info.BaseEnablePath = (((Object)(object)componentInChildren2.m_baseEnableObject != (Object)null) ? PathOf(prefab.transform, componentInChildren2.m_baseEnableObject.transform) : null); foreach (LevelSetup item in componentInChildren2.m_levelSetups ?? new List<LevelSetup>()) { info.Levels.Add((item.m_scale, item.m_hue, item.m_saturation, item.m_value, item.m_setEmissiveColor, item.m_emissiveColor, ((Object)(object)item.m_enableObject != (Object)null) ? PathOf(prefab.transform, item.m_enableObject.transform) : null)); } } NpcTalk componentInChildren3 = prefab.GetComponentInChildren<NpcTalk>(true); if ((Object)(object)componentInChildren3 != (Object)null) { info.Talk.AddRange(componentInChildren3.m_randomGreets ?? new List<string>()); info.Talk.AddRange(componentInChildren3.m_randomTalk ?? new List<string>()); } VisEquipment component4 = prefab.GetComponent<VisEquipment>(); if ((Object)(object)component4 != (Object)null) { info.RightHand = PathOf(prefab.transform, component4.m_rightHand); info.LeftHand = PathOf(prefab.transform, component4.m_leftHand); } Humanoid val3 = (Humanoid)(object)((component is Humanoid) ? component : null); HashSet<GameObject> seen; if ((Object)(object)val3 != (Object)null) { seen = new HashSet<GameObject>(); GameObject[] array = (GameObject[])(((object)val3.m_defaultItems) ?? ((object)new GameObject[0])); for (int i = 0; i < array.Length; i++) { Add(array[i]); } array = (GameObject[])(((object)val3.m_randomWeapon) ?? ((object)new GameObject[0])); for (int i = 0; i < array.Length; i++) { Add(array[i]); } ItemSet[] array2 = (ItemSet[])(((object)val3.m_randomSets) ?? ((object)new ItemSet[0])); for (int i = 0; i < array2.Length; i++) { array = (GameObject[])(((object)array2[i].m_items) ?? ((object)new GameObject[0])); for (int j = 0; j < array.Length; j++) { Add(array[j]); } } } if (Plugin.DebugLog.Value) { Plugin.Log.LogInfo((object)string.Format("{0}: walk {1:0.0}, run {2:0.0}, height {3:0.0}, alert '{4}', step '{5}', wake '{6}', melee [{7}], ranged [{8}]", ((Object)prefab).name, info.WalkSpeed, info.RunSpeed, info.Height, info.AlertSound, info.StepSound, info.WakeSound, string.Join(", ", info.Melee.ConvertAll((CreatureAttack a) => a.Item + ":" + a.Animation + (((Object)(object)a.Attach != (Object)null) ? "+attach" : ""))), string.Join(", ", info.Ranged.ConvertAll((CreatureAttack a) => a.Item + ":" + a.Animation + "->" + ((Object)a.Projectile).name)))); } s_cache[prefab] = info; return info; void Add(GameObject? item) { //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Expected I4, but got Unknown //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Invalid comparison between Unknown and I4 //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Invalid comparison between Unknown and I4 //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Invalid comparison between Unknown and I4 //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Expected I4, but got Unknown if (!((Object)(object)item == (Object)null) && seen.Add(item)) { ItemDrop component5 = item.GetComponent<ItemDrop>(); SharedData val4 = ((!((Object)(object)component5 != (Object)null)) ? null : component5.m_itemData?.m_shared); if (val4 != null && val4.m_attack != null && !string.IsNullOrEmpty(val4.m_attack.m_attackAnimation)) { ItemType itemType = val4.m_itemType; switch (itemType - 5) { default: if (itemType - 17 <= 1) { return; } break; case 0: case 1: case 2: case 6: case 8: return; case 3: case 4: case 5: case 7: break; } Attack attack = val4.m_attack; Transform val5 = item.transform.Find("attach") ?? item.transform.Find("attach_skin"); CreatureAttack creatureAttack = new CreatureAttack { Item = ((Object)item).name, Animation = attack.m_attackAnimation, Type = attack.m_attackType, Projectile = (((int)attack.m_attackType == 2) ? attack.m_attackProjectile : null), Attach = (((Object)(object)val5 != (Object)null) ? ((Component)val5).gameObject : null), AttachScale = (((Object)(object)val5 != (Object)null) ? val5.lossyScale : Vector3.one), LeftHand = ((int)val4.m_itemType == 4), AnimationState = (int)val4.m_animationState, Sound = (FirstSound(attack.m_startEffect) ?? FirstSound(attack.m_triggerEffect) ?? "") }; AddVisuals(attack.m_triggerEffect, creatureAttack.Effects); AddVisuals(attack.m_startEffect, creatureAttack.Effects); AddVisuals(val4.m_triggerEffect, creatureAttack.Effects); AddVisuals(val4.m_startEffect, creatureAttack.Effects); AddSounds(attack.m_startEffect, creatureAttack.StartSounds); AddSounds(val4.m_startEffect, creatureAttack.StartSounds); AddSounds(attack.m_triggerEffect, creatureAttack.ImpactSounds); AddSounds(val4.m_triggerEffect, creatureAttack.ImpactSounds); EffectList[] array3 = (EffectList[])(object)new EffectList[5] { attack.m_hitEffect, attack.m_hitTerrainEffect, attack.m_burstEffect, val4.m_hitEffect, val4.m_hitTerrainEffect }; foreach (EffectList effects in array3) { AddVisuals(effects, creatureAttack.Impact); AddSounds(effects, creatureAttack.ImpactSounds); } AddSpawned(attack.m_spawnOnTrigger, creatureAttack, 0); AddSpawned(attack.m_attackProjectile, creatureAttack, 0); (creatureAttack.Ranged ? info.Ranged : info.Melee).Add(creatureAttack); } } } } private static void AddVisuals(EffectList? effects, List<GameObject> into) { if (effects?.m_effectPrefabs == null) { return; } EffectData[] effectPrefabs = effects.m_effectPrefabs; foreach (EffectData val in effectPrefabs) { if (val != null && val.m_enabled && (Object)(object)val.m_prefab != (Object)null && (Object)(object)val.m_prefab.GetComponentInChildren<ParticleSystem>(true) != (Object)null && !into.Contains(val.m_prefab)) { into.Add(val.m_prefab); } } } private static void AddSounds(EffectList? effects, List<string> into) { if (effects?.m_effectPrefabs == null) { return; } EffectData[] effectPrefabs = effects.m_effectPrefabs; foreach (EffectData val in effectPrefabs) { if (val != null && val.m_enabled && (Object)(object)val.m_prefab != (Object)null && (Object)(object)val.m_prefab.GetComponentInChildren<ZSFX>(true) != (Object)null && !into.Contains(((Object)val.m_prefab).name)) { into.Add(((Object)val.m_prefab).name); } } } private static void AddSpawned(GameObject? go, CreatureAttack a, int depth) { if ((Object)(object)go == (Object)null || depth > 2) { return; } if (!((Object)(object)go.GetComponent<Projectile>() != (Object)null) && !a.Impact.Contains(go) && ((Object)(object)go.GetComponentInChildren<ParticleSystem>(true) != (Object)null || (Object)(object)go.GetComponentInChildren<Renderer>(true) != (Object)null)) { a.Impact.Add(go); } MonoBehaviour[] componentsInChildren = go.GetComponentsInChildren<MonoBehaviour>(true); foreach (MonoBehaviour val in componentsInChildren) { if ((Object)(object)val == (Object)null) { continue; } FieldInfo[] fields = ((object)val).GetType().GetFields(BindingFlags.Instance | BindingFlags.Public); foreach (FieldInfo obj in fields) { object value = obj.GetValue(val); string text = obj.Name.ToLowerInvariant(); EffectList val2 = (EffectList)((value is EffectList) ? value : null); if (val2 != null && (text.Contains("hit") || text.Contains("spawn") || text.Contains("start") || text.Contains("explo"))) { AddVisuals(val2, a.Impact); AddSounds(val2, a.ImpactSounds); continue; } GameObject val3 = (GameObject)((value is GameObject) ? value : null); if (val3 != null && (Object)(object)val3 != (Object)(object)go && (text.Contains("spawn") || text.Contains("onhit")) && (Object)(object)val3.GetComponent<Character>() == (Object)null) { AddSpawned(val3, a, depth + 1); } else { if (!(value is GameObject[] array) || (!text.Contains("spawn") && !text.Contains("onhit"))) { continue; } GameObject[] array2 = array; foreach (GameObject val4 in array2) { if ((Object)(object)val4 != (Object)null && (Object)(object)val4 != (Object)(object)go && (Object)(object)val4.GetComponent<Character>() == (Object)null) { AddSpawned(val4, a, depth + 1); } } } } } } private static string? FirstSound(EffectList? effects) { if (effects?.m_effectPrefabs == null) { return null; } EffectData[] effectPrefabs = effects.m_effectPrefabs; foreach (EffectData val in effectPrefabs) { if (val != null && val.m_enabled && (Object)(object)val.m_prefab != (Object)null && (Object)(object)val.m_prefab.GetComponentInChildren<ZSFX>(true) != (Object)null) { return ((Object)val.m_prefab).name; } } return null; } private static string? PathOf(Transform root, Transform? t) { if ((Object)(object)t == (Object)null) { return null; } List<string> list = new List<string>(); while ((Object)(object)t != (Object)null && (Object)(object)t != (Object)(object)root) { list.Insert(0, ((Object)t).name); t = t.parent; } if (!((Object)(object)t == (Object)(object)root)) { return null; } return string.Join("/", list); } public CreatureAttack? PickMelee(string prefer = "") { if (Melee.Count == 0) { return null; } if (prefer.Length > 0) { foreach (CreatureAttack item in Melee) { if (item.Animation.ToLowerInvariant().Contains(prefer) || item.Item.ToLowerInvariant().Contains(prefer)) { return item; } } } return Melee[Random.Range(0, Melee.Count)]; } public CreatureAttack? PickRanged() { if (Ranged.Count != 0) { return Ranged[Random.Range(0, Ranged.Count)]; } return null; } } internal static class GameWeather { private static readonly Biome[] s_order; public static void Apply(int index, string name, ref float fog, ref Color fogColor, ref Color ambient, ref Color sunColor, ref float sunIntensity, ref Color sky) { //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0086: 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_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: 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_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) if (Plugin.GameLighting.Value && !((Object)(object)EnvMan.instance == (Object)null) && index >= 0 && index < s_order.Length) { EnvSetup val = MainEnv(s_order[index]); if (val == null) { Plugin.Log.LogInfo((object)("No game weather found for the " + name + "; using the minigame's own.")); return; } fog = val.m_fogDensityDay; fogColor = val.m_fogColorDay; ambient = val.m_ambColorDay * Plugin.GameLightScale.Value; sunColor = val.m_sunColorDay; sunIntensity = val.m_lightIntensityDay * Plugin.GameLightScale.Value; sky = Color.Lerp(sky, val.m_fogColorDay, 0.7f); Plugin.Log.LogInfo((object)$"{name} weather '{val.m_name}': fog {fog:0.000} {fogColor}, ambient {val.m_ambColorDay}, sun {sunColor} x{val.m_lightIntensityDay:0.00}"); } } private static EnvSetup? MainEnv(Biome biome) { //IL_0026: 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) EnvMan instance = EnvMan.instance; foreach (BiomeEnvSetup biome2 in instance.m_biomes) { if (biome2 == null || biome2.m_biome != biome) { continue; } if (!(Field(biome2, "m_environments") is IList list)) { return null; } object obj = null; float num = -1f; foreach (object item in list) { float num2 = ((Field(item, "m_weight") is float num3) ? num3 : 1f); if (num2 > num) { obj = item; num = num2; } } if (obj == null) { return null; } object? obj2 = Field(obj, "m_env"); EnvSetup val = (EnvSetup)((obj2 is EnvSetup) ? obj2 : null); if (val != null && val != null) { return val; } string text = (Field(obj, "m_environment") as string) ?? ""; if (Field(instance, "m_environments") is IList list2) { foreach (object item2 in list2) { EnvSetup val2 = (EnvSetup)((item2 is EnvSetup) ? item2 : null); if (val2 != null && val2.m_name == text) { return val2; } } } return null; } return null; } private static object? Field(object? target, string name) { return target?.GetType().GetField(name, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(target); } static GameWeather() { Biome[] array = new Biome[8]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); s_order = (Biome[])(object)array; } } internal static class Pictures { private static Dictionary<string, GameObject>? s_monsters; private static Dictionary<string, GameObject>? s_items; private static readonly Dictionary<Type, Type[]> s_requires = new Dictionary<Type, Type[]>(); public static void ClearCaches() { s_monsters = null; s_items = null; } public static List<string> SplitList(string list) { return (from s in list.Split(new char[2] { ',', ';' }, StringSplitOptions.RemoveEmptyEntries) select s.Trim() into s where s.Length > 0 select s).ToList(); } public static GameObject? Monster(string key) { if ((Object)(object)ZNetScene.instance == (Object)null) { return null; } if (s_monsters == null) { s_monsters = new Dictionary<string, GameObject>(StringComparer.OrdinalIgnoreCase); foreach (GameObject prefab2 in ZNetScene.instance.m_prefabs) { if ((Object)(object)prefab2 == (Object)null) { continue; } Character component = prefab2.GetComponent<Character>(); if (!((Object)(object)component == (Object)null) && !(component is Player) && !string.IsNullOrEmpty(component.m_name) && component.m_name.StartsWith("$enemy_")) { string key2 = component.m_name.Substring("$enemy_".Length); if (!s_monsters.TryGetValue(key2, out GameObject value) || ((Object)prefab2).name.Length < ((Object)value).name.Length) { s_monsters[key2] = prefab2; } } } } if (s_monsters.TryGetValue(key, out GameObject value2)) { return value2; } GameObject prefab = ZNetScene.instance.GetPrefab(key); if (!((Object)(object)prefab != (Object)null) || !((Object)(object)prefab.GetComponent<Character>() != (Object)null)) { return null; } return prefab; } public static GameObject? Item(string key) { if ((Object)(object)ObjectDB.instance == (Object)null) { return null; } if (s_items == null) { s_items = new Dictionary<string, GameObject>(StringComparer.OrdinalIgnoreCase); foreach (GameObject item in ObjectDB.instance.m_items) { ItemDrop val = (((Object)(object)item != (Object)null) ? item.GetComponent<ItemDrop>() : null); if ((Object)(object)val == (Object)null || val.m_itemData?.m_shared == null) { continue; } string text = val.m_itemData.m_shared.m_name ?? ""; if (text.StartsWith("$item_")) { string key2 = text.Substring("$item_".Length); if (!s_items.TryGetValue(key2, out GameObject value) || ((Object)item).name.Length < ((Object)value).name.Length) { s_items[key2] = item; } } } } if (s_items.TryGetValue(key, out GameObject value2)) { return value2; } GameObject itemPrefab = ObjectDB.instance.GetItemPrefab(key); if (!((Object)(object)itemPrefab != (Object)null) || !((Object)(object)itemPrefab.GetComponent<ItemDrop>() != (Object)null)) { return null; } return itemPrefab; } public static GameObject? Prefab(string name) { if ((Object)(object)ZNetScene.instance == (Object)null) { return null; } GameObject val = ZNetScene.instance.GetPrefab(name); if ((Object)(object)val == (Object)null && (Object)(object)ObjectDB.instance != (Object)null) { val = ObjectDB.instance.GetItemPrefab(name); } return val; } public static GameObject MakePicture(GameObject source, Transform inactiveHolder, int layer) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) GameObject val = Object.Instantiate<GameObject>(source, inactiveHolder, false); ((Object)val).name = ((Object)source).name + "_SurfPicture"; val.transform.localPosition = Vector3.zero; val.transform.localRotation = Quaternion.identity; Strip(val); SetLayer(val, layer); Animator[] componentsInChildren = val.GetComponentsInChildren<Animator>(true); foreach (Animator obj in componentsInChildren) { obj.fireEvents = false; obj.applyRootMotion = false; obj.cullingMode = (AnimatorCullingMode)0; } return val; } public static void Strip(GameObject go) { MonoBehaviour[] componentsInChildren = go.GetComponentsInChildren<MonoBehaviour>(true); foreach (MonoBehaviour val in componentsInChildren) { if ((Object)(object)val != (Object)null && (Object)(object)((Component)val).gameObject != (Object)(object)go && ((object)val).GetType().Name == "RandomFlyingBird") { Object.DestroyImmediate((Object)(object)((Component)val).gameObject); } } for (int j = 0; j < 8; j++) { MonoBehaviour[] componentsInChildren2 = go.GetComponentsInChildren<MonoBehaviour>(true); bool flag = false; componentsInChildren = componentsInChildren2; foreach (MonoBehaviour val2 in componentsInChildren) { if (!((Object)(object)val2 == (Object)null) && !(val2 is ZNetView) && !IsRequired((Component)(object)val2)) { Object.DestroyImmediate((Object)(object)val2); flag = true; } } if (!flag) { break; } } ZNetView[] componentsInChildren3 = go.GetComponentsInChildren<ZNetView>(true); for (int i = 0; i < componentsInChildren3.Length; i++) { Object.DestroyImmediate((Object)(object)componentsInChildren3[i]); } Joint[] componentsInChildren4 = go.GetComponentsInChildren<Joint>(true); for (int i = 0; i < componentsInChildren4.Length; i++) { Object.DestroyImmediate((Object)(object)componentsInChildren4[i]); } Collider[] componentsInChildren5 = go.GetComponentsInChildren<Collider>(true); for (int i = 0; i < componentsInChildren5.Length; i++) { Object.DestroyImmediate((Object)(object)componentsInChildren5[i]); } Rigidbody[] componentsInChildren6 = go.GetComponentsInChildren<Rigidbody>(true); for (int i = 0; i < componentsInChildren6.Length; i++) { Object.DestroyImmediate((Object)(object)componentsInChildren6[i]); } AudioSource[] componentsInChildren7 = go.GetComponentsInChildren<AudioSource>(true); for (int i = 0; i < componentsInChildren7.Length; i++) { Object.DestroyImmediate((Object)(object)componentsInChildren7[i]); } } private static Type[] Requires(Type type) { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown if (!s_requires.TryGetValue(type, out Type[] value)) { List<Type> list = new List<Type>(); object[] customAttributes = type.GetCustomAttributes(typeof(RequireComponent), inherit: true); for (int i = 0; i < customAttributes.Length; i++) { RequireComponent val = (RequireComponent)customAttributes[i]; Type[] array = new Type[3] { val.m_Type0, val.m_Type1, val.m_Type2 }; foreach (Type type2 in array) { if (type2 != null) { list.Add(type2); } } } value = list.ToArray(); s_requires[type] = value; } return value; } private static bool IsRequired(Component c) { Type type = ((object)c).GetType(); Component[] components = c.GetComponents<Component>(); foreach (Component val in components) { if ((Object)(object)val == (Object)null || (Object)(object)val == (Object)(object)c) { continue; } Type[] array = Requires(((object)val).GetType()); for (int j = 0; j < array.Length; j++) { if (array[j].IsAssignableFrom(type)) { return true; } } } return false; } public static void SetLayer(GameObject go, int layer) { Transform[] componentsInChildren = go.GetComponentsInChildren<Transform>(true); for (int i = 0; i < componentsInChildren.Length; i++) { ((Component)componentsInChildren[i]).gameObject.layer = layer; } } public static bool MeshBounds(GameObject go, out Bounds bounds) { //IL_0001: 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_0036: 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_003f: 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_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) bounds = default(Bounds); bool flag = false; Renderer[] componentsInChildren = go.GetComponentsInChildren<Renderer>(); foreach (Renderer val in componentsInChildren) { if ((!(val is MeshRenderer) && !(val is SkinnedMeshRenderer)) || !val.enabled) { continue; } Bounds bounds2 = val.bounds; Vector3 size = ((Bounds)(ref bounds2)).size; if (!(((Vector3)(ref size)).sqrMagnitude < 1E-06f)) { if (!flag) { bounds = val.bounds; flag = true; } else { ((Bounds)(ref bounds)).Encapsulate(val.bounds); } } } return flag; } } internal static class PlayerHooks { [HarmonyPatch(typeof(Player), "SetupVisEquipment")] private static class CircletPatch { private static void Postfix(Player __instance, VisEquipment visEq, bool isRagdoll) { if (!isRagdoll && IsSurfer((Character)(object)__instance) && !((Object)(object)visEq == (Object)null)) { string text = Plugin.CircletItem.Value.Trim(); if (text.Length > 0) { visEq.SetHelmetItem(StringExtensionMethods.GetStableHashCode(text)); } } } } [HarmonyPatch(typeof(Character), "UpdateWalking")] private static class RunInPlacePatch { private static void Postfix(Character __instance) { if (SurfGame.RunningInPlace && IsSurfer(__instance) && !((Object)(object)__instance.m_zanim == (Object)null)) { __instance.m_zanim.SetFloat(Character.s_forwardSpeed, __instance.m_runSpeed); __instance.m_zanim.SetFloat(Character.s_sidewaySpeed, 0f); __instance.m_zanim.SetBool(Character.s_onGround, true); } } } [HarmonyPatch(typeof(Player), "TakeInput")] private static class TakeInputPatch { private static void Postfix(Player __instance, ref bool __result) { if (IsSurfer((Character)(object)__instance)) { __result = false; } } } [HarmonyPatch(typeof(Player), "SetControls")] private static class SetControlsPatch { private static void Prefix(Player __instance, ref Vector3 movedir, ref bool attack, ref bool attackHold, ref bool secondaryAttack, ref bool secondaryAttackHold, ref bool block, ref bool blockHold, ref bool jump, ref bool crouch, ref bool run, ref bool autoRun, ref bool dodge) { //IL_000a: 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) if (IsSurfer((Character)(object)__instance)) { movedir = Vector3.zero; attack = (attackHold = (secondaryAttack = (secondaryAttackHold = false))); block = (blockHold = (jump = (crouch = (run = (autoRun = (dodge = false)))))); } } } [HarmonyPatch(typeof(Menu), "Update")] private static class MenuPatch { private static bool Prefix() { return (Object)(object)SurfGame.Active == (Object)null; } } [HarmonyPatch(typeof(Chat), "Update")] private static class ChatPatch { private static bool Prefix(object __instance) { if ((Object)(object)SurfGame.Active != (Object)null) { return !(__instance is Chat); } return true; } } [HarmonyPatch(typeof(GameCamera), "LateUpdate")] private static class GameCameraPatch { private static void Postfix() { SurfGame.Active?.ApplyGameCamera(); } } private static bool IsSurfer(Character c) { if ((Object)(object)SurfGame.Active != (Object)null && (Object)(object)c != (Object)null) { return (Object)(object)c == (Object)(object)Player.m_localPlayer; } return false; } public static void RefreshHelmet(Player player) { if ((Object)(object)player != (Object)null && (Object)(object)((Humanoid)player).m_visEquipment != (Object)null) { ((Humanoid)player).SetupVisEquipment(((Humanoid)player).m_visEquipment, false); } } } [BepInPlugin("com.snakesquad.snakewaysurfer", "SnakewaySurfer", "1.16.0")] public class Plugin : BaseUnityPlugin { [HarmonyPatch(typeof(Terminal), "InitTerminal")] private static class InitTerminalPatch { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static ConsoleEvent <>9__0_0; public static ConsoleEvent <>9__0_1; public static ConsoleEvent <>9__0_2; public static ConsoleEvent <>9__0_3; public static ConsoleEvent <>9__0_4; public static ConsoleEvent <>9__0_5; internal void <Postfix>b__0_0(ConsoleEventArgs args) { Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer == (Object)null) { args.Context.AddString("Load into a world first."); } else { SurfGame.Begin(localPlayer, args.Context, args.Args); } } internal void <Postfix>b__0_1(ConsoleEventArgs args) { Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer == (Object)null) { args.Context.AddString("Load into a world first."); } else if ((Object)(object)SurfGame.Active != (Object)null) { args.Context.AddString("Stop the run first."); } else { args.Context.AddString(Progress.Command(localPlayer, args.Args)); } } internal void <Postfix>b__0_2(ConsoleEventArgs args) { Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer == (Object)null) { args.Context.AddString("Load into a world first."); } else { args.Context.AddString(SurfStory.Command(localPlayer, args.Args)); } } internal void <Postfix>b__0_3(ConsoleEventArgs args) { Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer == (Object)null) { args.Context.AddString("Load into a world first."); return; } args.Context.AddString(SurfStory.Command(localPlayer, new string[2] { "surfstory", "portal" })); } internal void <Postfix>b__0_4(ConsoleEventArgs args) { Probe.Run(args.Context); } internal void <Postfix>b__0_5(ConsoleEventArgs args) { Compare.Run(args.Context); } } private static void Postfix() { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Expected O, but got Unknown //IL_006c: 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_0062: Expected O, but got Unknown //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Expected O, but got Unknown //IL_00de: 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_00d4: Expected O, but got Unknown //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Expected O, but got Unknown //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Expected O, but got Unknown object obj = <>c.<>9__0_0; if (obj == null) { ConsoleEvent val = delegate(ConsoleEventArgs args) { Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer == (Object)null) { args.Context.AddString("Load into a world first."); } else { SurfGame.Begin(localPlayer, args.Context, args.Args); } }; <>c.<>9__0_0 = val; obj = (object)val; } new ConsoleCommand("surfsup", "surfsup [biome] [stars] - kill some time: run the Snakeway through the biomes, dodging monsters on 3 lanes (starts at your latest checkpoint, or the biome you name)", (ConsoleEvent)obj, false, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false); object obj2 = <>c.<>9__0_1; if (obj2 == null) { ConsoleEvent val2 = delegate(ConsoleEventArgs args) { Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer == (Object)null) { args.Context.AddString("Load into a world first."); } else if ((Object)(object)SurfGame.Active != (Object)null) { args.Context.AddString("Stop the run first."); } else { args.Context.AddString(Progress.Command(localPlayer, args.Args)); } }; <>c.<>9__0_1 = val2; obj2 = (object)val2; } new ConsoleCommand("surfprogress", "surfprogress [wipe | set <biome> [stars] | dream] - testing: show this character's SnakewaySurfer progress, erase all of it, set the checkpoints reached (e.g. \"surfprogress set plains 1\"), or see the first-run dream again", (ConsoleEvent)obj2, false, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false); object obj3 = <>c.<>9__0_2; if (obj3 == null) { ConsoleEvent val3 = delegate(ConsoleEventArgs args) { Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer == (Object)null) { args.Context.AddString("Load into a world first."); } else { args.Context.AddString(SurfStory.Command(localPlayer, args.Args)); } }; <>c.<>9__0_2 = val3; obj3 = (object)val3; } new ConsoleCommand("surfstory", "surfstory [reset | portal | hugin [days awake] | munin [episode] | next] - testing: the ravens' story (the strange portal, Hugin's nagging, Munin's episodes)", (ConsoleEvent)obj3, false, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false); object obj4 = <>c.<>9__0_3; if (obj4 == null) { ConsoleEvent val4 = delegate(ConsoleEventArgs args) { Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer == (Object)null) { args.Context.AddString("Load into a world first."); } else { args.Context.AddString(SurfStory.Command(localPlayer, new string[2] { "surfstory", "portal" })); } }; <>c.<>9__0_3 = val4; obj4 = (object)val4; } new ConsoleCommand("surfportal", "surfportal - testing: the ravens' strange portal, right now, in front of you", (ConsoleEvent)obj4, false, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false); object obj5 = <>c.<>9__0_4; if (obj5 == null) { ConsoleEvent val5 = delegate(ConsoleEventArgs args) { Probe.Run(args.Context); }; <>c.<>9__0_4 = val5; obj5 = (object)val5; } new ConsoleCommand("surfprobe", "surfprobe - write this spot's weather, fog, light, camera effects, terrain material and nearby creatures to the log (for tuning SnakewaySurfer)", (ConsoleEvent)obj5, false, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false); object obj6 = <>c.<>9__0_5; if (obj6 == null) { ConsoleEvent val6 = delegate(ConsoleEventArgs args) { Compare.Run(args.Context); }; <>c.<>9__0_5 = val6; obj6 = (object)val6; } new ConsoleCommand("surfcompare", "surfcompare - put the minigame's version of the creature you're looking at beside the real one and log both (size, pose, animation); again to remove it", (ConsoleEvent)obj6, false, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false); } } public const string PluginGUID = "com.snakesquad.snakewaysurfer"; public const string PluginName = "SnakewaySurfer"; public const string PluginVersion = "1.16.0"; private static Plugin instance = null; internal static ManualLogSource Log = null; internal static ConfigEntry<float> BiomeLength = null; internal static ConfigEntry<float> StartSpeed = null; internal static ConfigEntry<float> SpeedPerBiome = null; internal static ConfigEntry<float> MaxSpeed = null; internal static ConfigEntry<float> MonsterMove = null; internal static ConfigEntry<bool> RangedAttacks = null; internal static ConfigEntry<float> RoadRoll = null; internal static ConfigEntry<bool> SwampWater = null; internal static ConfigEntry<float> JumpHeight = null; internal static ConfigEntry<float> SlideTime = null; internal static ConfigEntry<float> LaneSwitchSpeed = null; internal static ConfigEntry<float> Countdown = null; internal static ConfigEntry<KeyCode> ExitKey = null; internal static ConfigEntry<bool> StopWhenHurt = null; internal static ConfigEntry<float> HurtThreshold = null; internal static ConfigEntry<bool> Sounds = null; internal static ConfigEntry<float> SoundVolume = null; internal static ConfigEntry<float> RunLevelsPerBiome = null; internal static ConfigEntry<float> MaxRunLevels = null; internal static ConfigEntry<float> RunXpPerSecond = null; internal static ConfigEntry<float> MaxRunXpSeconds = null; internal static ConfigEntry<float> FoodCooldownMinutes = null; internal static ConfigEntry<float> MinRunSecondsForFood = null; internal static ConfigEntry<string> CircletItem = null; internal static ConfigEntry<float> CameraDistance = null; internal static ConfigEntry<float> CameraHeight = null; internal static ConfigEntry<float> CameraFov = null; internal static ConfigEntry<float> LightIntensity = null; internal static ConfigEntry<float> MonsterHeight = null; internal static ConfigEntry<float> SceneryDensity = null; internal static ConfigEntry<string> TrackPiece = null; internal static ConfigEntry<float> StageHeight = null; internal static ConfigEntry<int> RenderLayer = null; internal static ConfigEntry<bool> DebugLog = null; internal static ConfigEntry<bool> Invincible = null; internal static ConfigEntry<bool> AllowPause = null; internal static ConfigEntry<bool> GameLighting = null; internal static ConfigEntry<bool> UseGameCamera = null; internal static ConfigEntry<bool> GameTerrainShader = null; internal static ConfigEntry<bool> GameTerrainShape = null; internal static ConfigEntry<bool> GameGrass = null; internal static ConfigEntry<string> TrackStyle = null; internal static ConfigEntry<float> GameLightScale = null; internal static ConfigEntry<KeyCode> PauseKey = null; internal static ConfigEntry<string> Swoopers = null; internal static ConfigEntry<string> Ambushers = null; internal static ConfigEntry<string> Smashers = null; internal static ConfigEntry<string> CreatureSchemas = null; internal static ConfigEntry<int> LoopBiomes = null; internal static ConfigEntry<float> GameSpeed = null; internal static ConfigEntry<bool> GameGroundTextures = null; private static ConfigEntry<string>[] s_monsters = null; private static ConfigEntry<string>[] s_flyers = null; private static ConfigEntry<string>[] s_scenery = null; private static ConfigEntry<string>[] s_logs = null; private static ConfigEntry<string>[] s_foods = null; private static ConfigEntry<string>[] s_giants = null; private static ConfigEntry<string>[] s_locations = null; private static ConfigEntry<string>[] s_landmarks = null; private static ConfigEntry<string>[] s_pickables = null; internal static ConfigEntry<bool> BossFights = null; internal static ConfigEntry<int> Lives = null; internal static ConfigEntry<int> Difficulty = null; internal static readonly string[] DifficultyNames = new string[3] { "Gentle", "Normal", "Hard" }; internal static ConfigEntry<bool> IgnoreBossGate = null; internal static ConfigEntry<bool> BossLandmarks = null; internal static ConfigEntry<float> MonumentSize = null; internal static ConfigEntry<bool> MonumentSky = null; internal static ConfigEntry<bool> BossChase = null; internal static ConfigEntry<bool> BossWeather = null; internal static ConfigEntry<bool> BossSummon = null; internal static ConfigEntry<float> GiantChance = null; internal static ConfigEntry<float> FogStrength = null; internal static ConfigEntry<bool> DistanceHaze = null; internal static ConfigEntry<bool> WaveGuide = null; internal static ConfigEntry<float> RollStamina = null; internal static ConfigEntry<KeyCode> SprintKey = null; internal static ConfigEntry<KeyCode> BlockKey = null; internal static ConfigEntry<KeyCode> ThrowKey = null; internal static ConfigEntry<float> SprintSpeed = null; internal static ConfigEntry<float> MaxStamina = null; internal static ConfigEntry<float> SprintStamina = null; internal static ConfigEntry<float> BlockStamina = null; internal static ConfigEntry<float> BlockHoldStamina = null; internal static ConfigEntry<float> BlockSpeed = null; internal static ConfigEntry<bool> SkillXp = null; internal static ConfigEntry<float> StaminaRegen = null; internal static ConfigEntry<float> ParryWindow = null; internal static ConfigEntry<bool> PopupText = null; internal static ConfigEntry<bool> StartMenu = null; internal static ConfigEntry<bool> ParryDuel = null; internal static ConfigEntry<float> AmbientLight = null; internal static ConfigEntry<float> HillHeight = null; internal static ConfigEntry<float> TrackBrightness = null; internal static ConfigEntry<bool> OceanCrossing = null; internal static ConfigEntry<bool> MidCheckpoints = null; internal static ConfigEntry<bool> CampBreak = null; internal static ConfigEntry<bool> PortalPiece = null; internal static ConfigEntry<float> OceanLength = null; internal static ConfigEntry<float> SailSpeed = null; internal static ConfigEntry<bool> SeaSerpent = null; internal static ConfigEntry<bool> Dungeons = null; internal static ConfigEntry<bool> Traders = null; internal static ConfigEntry<bool> Places = null; internal static ConfigEntry<bool> Lava = null; internal static ConfigEntry<bool> Raven = null; internal static ConfigEntry<bool> LoadingScreen = null; internal static ConfigEntry<bool> DreamIntro = null; internal static ConfigEntry<bool> RavenStory = null; internal static ConfigEntry<float> PortalMinutes = null; internal static ConfigEntry<float> RavenMinutes = null; internal static ConfigEntry<float> MuninDays = null; internal static ConfigEntry<bool> DreamEverySleep = null; internal static ConfigEntry<float> ViewDistance = null; internal static int Level => Mathf.Clamp(Difficulty.Value, 0, 2); internal static int StartLives => Mathf.Max(1, Lives.Value + ((Level == 0) ? 2 : ((Level == 2) ? (-1) : 0))); internal static float SpeedScale { get { if (Level != 0) { if (Level != 2) { return 1f; } return 1.15f; } return 0.85f; } } internal static float FoeScale { get { if (Level != 0) { if (Level != 2) { return 1f; } return 1.25f; } return 0.7f; } } private void Awake() { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Expected O, but got Unknown //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Expected O, but got Unknown //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Expected O, but got Unknown //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Expected O, but got Unknown //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Expected O, but got Unknown //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Expected O, but got Unknown //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Expected O, but got Unknown //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_0234: Expected O, but got Unknown //IL_0267: Unknown result type (might be due to invalid IL or missing references) //IL_0271: Expected O, but got Unknown //IL_02a4: Unknown result type (might be due to invalid IL or missing references) //IL_02ae: Expected O, but got Unknown //IL_0322: Unknown result type (might be due to invalid IL or missing references) //IL_032c: Expected O, but got Unknown //IL_037f: Unknown result type (might be due to invalid IL or missing references) //IL_0389: Expected O, but got Unknown //IL_03bc: Unknown result type (might be due to invalid IL or missing references) //IL_03c6: Expected O, but got Unknown //IL_03f9: Unknown result type (might be due to invalid IL or missing references) //IL_0403: Expected O, but got Unknown //IL_0436: Unknown result type (might be due to invalid IL or missing references) //IL_0440: Expected O, but got Unknown //IL_0473: Unknown result type (might be due to invalid IL or missing references) //IL_047d: Expected O, but got Unknown //IL_04b0: Unknown result type (might be due to invalid IL or missing references) //IL_04ba: Expected O, but got Unknown //IL_04ed: Unknown result type (might be due to invalid IL or missing references) //IL_04f7: Expected O, but got Unknown //IL_054e: Unknown result type (might be due to invalid IL or missing references) //IL_0558: Expected O, but got Unknown //IL_058b: Unknown result type (might be due to invalid IL or missing references) //IL_0595: Expected O, but got Unknown //IL_05c8: Unknown result type (might be due to invalid IL or missing references) //IL_05d2: Expected O, but got Unknown //IL_0605: Unknown result type (might be due to invalid IL or missing references) //IL_060f: Expected O, but got Unknown //IL_0682: Unknown result type (might be due to invalid IL or missing references) //IL_068c: Expected O, but got Unknown //IL_06bf: Unknown result type (might be due to invalid IL or missing references) //IL_06c9: Expected O, but got Unknown //IL_06fc: Unknown result type (might be due to invalid IL or missing references) //IL_0706: Expected O, but got Unknown //IL_0739: Unknown result type (might be due to invalid IL or missing references) //IL_0743: Expected O, but got Unknown //IL_0776: Unknown result type (might be due to invalid IL or missing references) //IL_0780: Expected O, but got Unknown //IL_07b3: Unknown result type (might be due to invalid IL or missing references) //IL_07bd: Expected O, but got Unknown //IL_07f0: Unknown result type (might be due to invalid IL or missing references) //IL_07fa: Expected O, but got Unknown //IL_0851: Unknown result type (might be due to invalid IL or missing references) //IL_085b: Expected O, but got Unknown //IL_0884: Unknown result type (might be due to invalid IL or missing references) //IL_088e: Expected O, but got Unknown //IL_0da5: Unknown result type (might be due to invalid IL or missing references) //IL_0daf: Expected O, but got Unknown //IL_0e8f: Unknown result type (might be due to invalid IL or missing references) //IL_0e99: Expected O, but got Unknown //IL_0ecc: Unknown result type (might be due to invalid IL or missing references) //IL_0ed6: Expected O, but got Unknown //IL_0f09: Unknown result type (might be due to invalid IL or missing references) //IL_0f13: Expected O, but got Unknown //IL_0f46: Unknown result type (might be due to invalid IL or missing references) //IL_0f50: Expected O, but got Unknown //IL_0f83: Unknown result type (might be due to invalid IL or missing references) //IL_0f8d: Expected O, but got Unknown //IL_0fc0: Unknown result type (might be due to invalid IL or missing references) //IL_0fca: Expected O, but got Unknown //IL_0ffd: Unknown result type (might be due to invalid IL or missing references) //IL_1007: Expected O, but got Unknown //IL_105a: Unknown result type (might be due to invalid IL or missing references) //IL_1064: Expected O, but got Unknown //IL_1097: Unknown result type (might be due to invalid IL or missing references) //IL_10a1: Expected O, but got Unknown //IL_11d8: Unknown result type (might be due to invalid IL or missing references) //IL_11e2: Expected O, but got Unknown //IL_1215: Unknown result type (might be due to invalid IL or missing references) //IL_121f: Expected O, but got Unknown //IL_1252: Unknown result type (might be due to invalid IL or missing references) //IL_125c: Expected O, but got Unknown //IL_13ae: Unknown result type (might be due to invalid IL or missing references) //IL_13b8: Expected O, but got Unknown //IL_1400: Unknown result type (might be due to invalid IL or missing references) //IL_140a: Expected O, but got Unknown //IL_1431: Unknown result type (might be due to invalid IL or missing references) //IL_143b: Expected O, but got Unknown //IL_1552: Unknown result type (might be due to invalid IL or missing references) //IL_155c: Expected O, but got Unknown //IL_162f: Unknown result type (might be due to invalid IL or missing references) //IL_1639: Expected O, but got Unknown //IL_166c: Unknown result type (might be due to invalid IL or missing references) //IL_1676: Expected O, but got Unknown //IL_1720: Unknown result type (might be due to invalid IL or missing references) //IL_1734: Unknown result type (might be due to invalid IL or missing references) //IL_1739: Unknown result type (might be due to invalid IL or missing references) //IL_173f: Expected O, but got Unknown instance = this; Log = ((BaseUnityPlugin)this).Logger; BiomeLength = ((BaseUnityPlugin)this).Config.Bind<float>("1 - Run", "Biome Length", 500f, new ConfigDescription("Metres of track per biome. The run goes Meadows, Black Forest, Swamp, Mountains, Plains, Mistlands, Ashlands, Deep North, and Deep North never ends.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(100f, 5000f), Array.Empty<object>())); StartSpeed = ((BaseUnityPlugin)this).Config.Bind<float>("1 - Run", "Start Speed", 9f, new ConfigDescription("Running speed at the start, in metres per second (a vanilla sprint is about 7).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(3f, 30f), Array.Empty<object>())); SpeedPerBiome = ((BaseUnityPlugin)this).Config.Bind<float>("1 - Run", "Speed Per Biome", 1.5f, new ConfigDescription("How much faster you run for each biome you get through (it rises smoothly, not in steps).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 10f), Array.Empty<object>())); MaxSpeed = ((BaseUnityPlugin)this).Config.Bind<float>("1 - Run", "Max Speed", 22f, new ConfigDescription("Running speed never goes above this.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(5f, 50f), Array.Empty<object>())); MonsterMove = ((BaseUnityPlugin)this).Config.Bind<float>("1 - Run", "Monster Movement", 1f, new ConfigDescription("Some monsters come at you instead of standing still: fast ones (wolves, deer, fenrings...) charge, slow ones walk, a little more in later biomes. This scales their speed; 0 keeps them all still.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 3f), Array.Empty<object>())); RangedAttacks = ((BaseUnityPlugin)this).Config.Bind<bool>("1 - Run", "Ranged Attacks", true, "Monsters with a ranged attack (archers, stone-throwing greydwarfs, mages...) shoot down the track toward your lane. Slide under the shot or change lane."); RoadRoll = ((BaseUnityPlugin)this).Config.Bind<float>("3 - Look", "Road Roll", 1f, new ConfigDescription("How much the road rolls up and down; it gets stronger with every biome. 0 makes it flat.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 3f), Array.Empty<object>())); SwampWater = ((BaseUnityPlugin)this).Config.Bind<bool>("3 - Look", "Swamp Water", true, "In the Swamp you run through shallow water."); JumpHeight = ((BaseUnityPlugin)this).Config.Bind<float>("1 - Run", "Jump Height", 1.6f, new ConfigDescription("How high a jump goes, in metres. Logs are 0.7 m high.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.8f, 4f), Array.Empty<object>())); SlideTime = ((BaseUnityPlugin)this).Config.Bind<float>("1 - Run", "Slide Time", 0.8f, new ConfigDescription("How long a slide lasts, in seconds.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.3f, 2f), Array.Empty<object>())); LaneSwitchSpeed = ((BaseUnityPlugin)this).Config.Bind<float>("1 - Run", "Lane Switch Speed", 14f, new ConfigDescription("How fast you move sideways between lanes, in metres per second (lanes are 2.6 m apart).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(4f, 40f), Array.Empty<object>())); Countdown = ((BaseUnityPlugin)this).Config.Bind<float>("1 - Run", "Countdown", 3f, new ConfigDescription("Seconds of countdown before each run.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 10f), Array.Empty<object>())); ExitKey = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("1 - Run", "Exit Key", (KeyCode)27, "Stops the minigame and puts you back in the world. Stopping mid-run still counts the run for rewards."); StopWhenHurt = ((BaseUnityPlugin)this).Config.Bind<bool>("1 - Run", "Stop When Hurt", true, "Stop the minigame as soon as something damages your character in the real world. Health lost because food is wearing off doesn't count."); HurtThreshold = ((BaseUnityPlugin)this).Config.Bind<float>("1 - Run", "Hurt Threshold", 1f, new ConfigDescription("Smallest health drop (in one frame) that counts as being hurt.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 50f), Array.Empty<object>())); Sounds = ((BaseUnityPlugin)this).Config.Bind<bool>("3 - Look", "Sounds", true, "Play sounds for the countdown, jumps, slides, lane changes, coins, new biomes and crashes. Only you hear them."); SoundVolume = ((BaseUnityPlugin)this).Config.Bind<float>("3 - Look", "Sound Volume", 0.8f, new ConfigDescription("Volume of the minigame sounds.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>())); RunLevelsPerBiome = ((BaseUnityPlugin)this).Config.Bind<float>("2 - Rewards", "Run Levels Per Biome", 0.08f, new ConfigDescription("Not used since 1.14 (see Run XP Per Second).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 10f), Array.Empty<object>())); MaxRunLevels = ((BaseUnityPlugin)this).Config.Bind<float>("2 - Rewards", "Max Run Levels Per Run", 0.75f, new ConfigDescription("Not used since 1.14 (see Max Run XP Seconds).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 10f), Array.Empty<object>())); RunXpPerSecond = ((BaseUnityPlugin)this).Config.Bind<float>("2 - Rewards", "Run XP Per Second", 0.5f, new ConfigDescription("Run skill XP for each second of the run, as real XP (the game's own skill gain, so it takes longer to level as your skill gets high). 1 = the same as running in the world for that long. 0 turns XP off.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 5f), Array.Empty<object>())); MaxRunXpSeconds = ((BaseUnityPlugin)this).Config.Bind<float>("2 - Rewards", "Max Run XP Seconds", 300f, new ConfigDescription("Seconds of a run that count for XP at most (longer runs give no more). 0 = no limit.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 3600f), Array.Empty<object>())); FoodCooldownMinutes = ((BaseUnityPlugin)this).Config.Bind<float>("2 - Rewards", "Food Cooldown Minutes", 30f, new ConfigDescription("Real-time minutes after a food reward before the next run can give food again (saved on your character, so relogging doesn't reset it). XP has no cooldown.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1440f), Array.Empty<object>())); MinRunSecondsForFood = ((BaseUnityPlugin)this).Config.Bind<float>("2 - Rewards", "Min Run Seconds For Food", 30f, new ConfigDescription("A run must last at least this many seconds to give food.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 600f), Array.Empty<object>())); CircletItem = ((BaseUnityPlugin)this).Config.Bind<string>("3 - Look", "Circlet Item", "HelmetDverger", "Helmet item other players see on you while you surf (prefab name). HelmetDverger is the Dverger circlet. Empty: keep your own helmet."); CameraDistance = ((BaseUnityPlugin)this).Config.Bind<float>("3 - Look", "Camera Distance", 6.5f, new ConfigDescription("How far behind you the minigame camera sits.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(2f, 20f), Array.Empty<object>())); CameraHeight = ((BaseUnityPlugin)this).Config.Bind<float>("3 - Look", "Camera Height", 3.4f, new ConfigDescription("How high above the track the minigame camera sits.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.5f, 15f), Array.Empty<object>())); CameraFov = ((BaseUnityPlugin)this).Config.Bind<float>("3 - Look", "Camera Field Of View", 65f, new ConfigDescription("Minigame camera field of view in degrees.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(30f, 110f), Array.Empty<object>())); FogStrength = ((BaseUnityPlugin)this).Config.Bind<float>("3 - Look", "Fog Strength", 1f, new ConfigDescription("How thick the minigame's fog is (each biome has its own; the Swamp and Mistlands are thickest). 0 turns it off.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 4f), Array.Empty<object>())); WaveGuide = ((BaseUnityPlugin)this).Config.Bind<bool>("3 - Look", "Wave Guide", false, "At sea, a band through the ship while a rolling wave comes at her side on (waves no longer do damage, so it's off by default)."); DistanceHaze = ((BaseUnityPlugin)this).Config.Bind<bool>("3 - Look", "Distance Haze", true, "Thin sheets of mist across the far end of the view, so the end of the track fades away even where the game's own fog doesn't reach the minigame."); AmbientLight = ((BaseUnityPlugin)this).Config.Bind<float>("3 - Look", "Ambient Light", 0.45f, new ConfigDescription("Brightness of the light that comes from the sky colour everywhere (shadows get darker as it goes down).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 2f), Array.Empty<object>())); HillHeight = ((BaseUnityPlugin)this).Config.Bind<float>("3 - Look", "Hill Height", 1f, new ConfigDescription("How tall the hills beside the track are (each biome has its own; Mountains are highest). 0 makes the land flat.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 3f), Array.Empty<object>())); TrackBrightness = ((BaseUnityPlugin)this).Config.Bind<float>("3 - Look", "Track Brightness", 0.6f, new ConfigDescription("Darkens the paved track (1 = the build piece's own colour, which looked washed out).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 1.5f), Array.Empty<object>())); GiantChance = ((BaseUnityPlugin)this).Config.Bind<float>("1 - Run", "Giant Chance", 0.22f, new ConfigDescription("Chance that a row of obstacles is a troll set piece instead, in biomes that have Giants (the Black Forest by default).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>())); LightIntensity = ((BaseUnityPlugin)this).Config.Bind<float>("3 - Look", "Light Intensity", 0.45f, new ConfigDescription("Brightness of the minigame's own sun.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 4f), Array.Empty<object>())); MonsterHeight = ((BaseUnityPlugin)this).Config.Bind<float>("3 - Look", "Monster Height", 9f, new ConfigDescription("Monsters in the lanes are their real size, but anything taller than this (or much wider than a lane) is shrunk to fit.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 20f), Array.Empty<object>())); SceneryDensity = ((BaseUnityPlugin)this).Config.Bind<float>("3 - Look", "Scenery Density", 1f, new ConfigDescription("How many trees and rocks line the track. Lower it if the minigame runs slowly.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.2f, 3f), Array.Empty<object>())); TrackPiece = ((BaseUnityPlugin)this).Config.Bind<string>("3 - Look", "Track Piece", "stone_floor_2x2", "Build piece whose material paves the track (prefab name, e.g. stone_floor_2x2, wood_floor)."); StageHeight = ((BaseUnityPlugin)this).Config.Bind<float>("3 - Look", "Stage Height", 4000f, new ConfigDescription("How far above you the (invisible to everyone else) minigame track is built.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1000f, 9000f), Array.Empty<object>())); RenderLayer = ((BaseUnityPlugin)this).Config.Bind<int>("3 - Look", "Render Layer", 30, new ConfigDescription("Unity layer the minigame draws on. Only change it if another mod uses layer 30 and things show up wrong.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(8, 31), Array.Empty<object>())); s_monsters = new ConfigEntry<string>[Biomes.Defaults.Length]; s_flyers = new ConfigEntry<string>[Biomes.Defaults.Length]; s_scenery = new ConfigEntry<string>[Biomes.Defaults.Length]; s_logs = new ConfigEntry<string>[Biomes.Defaults.Length]; s_foods = new ConfigEntry<string>[Biomes.Defaults.Length]; s_giants = new ConfigEntry<string>[Biomes.Defaults.Length]; s_locations = new ConfigEntry<string>[Biomes.Defaults.Length]; s_landmarks = new ConfigEntry<string>[Biomes.Defaults.Length]; s_pickables = new ConfigEntry<string>[Biomes.Defaults.Length]; for (int i = 0; i < Biomes.Defaults.Length; i++) { BiomeDef biomeDef = Biomes.Defaults[i]; string text = $"4.{i + 1} - {biomeDef.Name}"; s_monsters[i] = ((BaseUnityPlugin)this).Config.Bind<string>(text, "Monsters", biomeDef.Monsters, "Monsters in the lanes. \"auto\" uses the game's own spawn tables for this biome (the creatures that really live here, as common as they really are, in their group sizes). Or a comma-separated list of creature names as in the game's text keys (\"greydwarfbrute\" for $enemy_greydwarfbrute) or prefab names, each optionally with :weight and :group size (\"greydwarf:6:3\"). Unknown names are skipped and logged."); s_flyers[i] = ((BaseUnityPlugin)this).Config.Bind<string>(text, "Flyers", biomeDef.Flyers, "Flying monsters at head height; slide under them. \"auto\": the flying creatures from this biome's spawn tables. Same naming as Monsters. Empty: hanging logs only."); s_scenery[i] = ((BaseUnityPlugin)this).Config.Bind<string>(text, "Scenery", biomeDef.Scenery, "Trees and rocks beside the track (prefab names)."); s_logs[i] = ((BaseUnityPlugin)this).Config.Bind<string>(text, "Logs", biomeDef.Logs, "Log prefabs used for things to jump over and hanging logs to slide under."); s_giants[i] = ((BaseUnityPlugin)this).Config.Bind<string>(text, "Giants", biomeDef.Giants, "Big monsters used for set pieces: one beside the track slams a log down across the outer lane as you run past, or one jumps down straddling the track so you must slide between its legs. Same naming as Monsters. Empty: no set pieces in this biome."); s_locations[i] = ((BaseUnityPlugin)this).Config.Bind<string>(text, "Location Monsters", biomeDef.Locations, "With Monsters on \"auto\": creatures that live at places in this biome (troll caves, crypts, villages) instead of the world spawn tables, added with these weights. Same naming as Monsters."); s_landmarks[i] = ((BaseUnityPlugin)this).Config.Bind<string>(text, "Landmarks", biomeDef.Landmarks, "Creature homes put beside the track now and then near those creatures, as \"Prefab: home, home; Prefab*: home\" (creature prefab names; a trailing * matches a name start; homes are prefab names such as Spawner_GreydwarfNest or goblin_totempole)."); s_pickables[i] = ((BaseUnityPlugin)this).Config.Bind<string>(text, "Pickables", biomeDef.Pickables, "Plants, mushrooms, stones and bushes along the track edge (prefab names). Empty: none."); s_foods[i] = ((BaseUnityPlugin)this).Config.Bind<string>(text, "Foods", biomeDef.Foods, "Foods you can win when this is the furthest biome you reached; one is picked at random. Item names as in the game's text keys (\"carrotsoup\" for $item_carrotsoup) or prefab names."); } ConfigEntry<int> val = ((BaseUnityPlugin)this).Config.Bind<int>("9 - Debug", "Balance Version", 0, "Internal: which release's default changes have been applied to this file. Leave it alone."); if (val.Value < 1) { if (Mathf.Approximately(RunLevelsPerBiome.Value, 1f)) { RunLevelsPerBiome.Value = 0.25f; } val.Value = 1; } if (val.Value < 2) { if (Mathf.Approximately(MonsterHeight.Value, 2.2f)) { MonsterHeight.Value = 4.2f; } val.Value = 2; } if (val.Value < 3) { for (int j = 0; j < Biomes.Defaults.Length; j++) { if (s_monsters[j].Value == Biomes.Defaults[j].FallbackMonsters) { s_monsters[j].Value = "auto"; } if (s_flyers[j].Value == Biomes.Defaults[j].FallbackFlyers) { s_flyers[j].Value = "auto"; } } if (s_giants[2].Value == "") { s_giants[2].Value = "abomination"; } if (MonsterHeight.Value <= 4.2f) { MonsterHeight.Value = 9f; } val.Value = 3; } if (val.Value < 4) { if (Mathf.Approximately(RunLevelsPerBiome.Value, 0.25f)) { RunLevelsPerBiome.Value = 0.08f; } val.Value = 4; } if (val.Value < 5) { if (s_landmarks[0].Value == "Greyling: Spawner_GreydwarfNest") { s_landmarks[0].Value = Biomes.Defaults[0].Landmarks; } val.Value = 5; } DebugLog = ((BaseUnityPlugin)this).Config.Bind<bool>("9 - Debug", "Log Details", false, "Log which monsters, scenery and logs were found for each biome when a run starts."); Invincible = ((BaseUnityPlugin)this).Config.Bind<bool>("9 - Debug", "Invincible", false, "Testing: run through everything instead of crashing (a banner says what would have got you)."); GameTerrainShader = ((BaseUnityPlugin)this).Config.Bind<bool>("3 - Look", "Game Terrain Shader", false, "Testing: draw the land with the game's own terrain shader. It doesn't draw on the minigame's stage (the ground shows the sky), so by default the land uses the game's ground textures on a plain shader (Game Ground Textures)."); GameTerrainShape = ((BaseUnityPlugin)this).Config.Bind<bool>("3 - Look", "Game Terrain Shape", true, "Shape the land beside the track like this world's real ground: each biome borrows a ring of terrain from a spot in your world where that biome is (the game's own height formulas, with its rivers, Mistlands cliffs and mountain slopes), plus the game's paint mask for the ground textures. Off: the minigame's own rolling hills."); GameGrass = ((BaseUnityPlugin)this).Config.Bind<bool>("3 - Look", "Game Grass", true, "Grow the game's own grass and ground clutter beside the track, by the game's rules for each biome (and its grass quality setting)."); TrackStyle = ((BaseUnityPlugin)this).Config.Bind<string>("3 - Look", "Track Style", "dirt", "\"dirt\" (the game's dirt ground), \"paved\" (its paved road), \"stone\" (the Track Piece's stone floor), or \"hoed\" / \"hoed paved\" (drawn by the game's terrain shader like a hoed path; it can look very dark)."); UseGameCamera = ((BaseUnityPlugin)this).Config.Bind<bool>("3 - Look", "Use Game Camera", true, "Draw the minigame through the game's own camera, with its post effects (bloom, colour grading, ambient occlusion) and sky. Off: the minigame's own plain camera."); GameLighting = ((BaseUnityPlugin)this).Config.Bind<bool>("3 - Look", "Game Lighting", true, "Light and fog each biome the way the game's own daytime weather for that biome does (fog density and colour, ambient light, sun). Off: the minigame's own simpler values (Fog Strength, Ambient Light and Light Intensity)."); GameLightScale = ((BaseUnityPlugin)this).Config.Bind<float>("3 - Look", "Game Light Scale", 0.8f, new ConfigDescription("With Game Lighting: scales the sun and ambient light (the game's shaders and post effects differ from the minigame's).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 3f), Array.Empty<object>())); AllowPause = ((BaseUnityPlugin)this).Config.Bind<bool>("2 - Keys", "Allow Pause", true, "The Pause Key freezes the minigame: the run, creatures, effects and sounds. It also pauses by itself while the game's menu (Esc) is open."); PauseKey = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("2 - Keys", "Pause Key", (KeyCode)112, "Pauses and resumes the minigame."); SprintKey = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("2 - Keys", "Sprint Key", (KeyCode)304, "Hold to sprint: faster, so you can get past an attack before it lands. Uses stamina."); BlockKey = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("2 - Keys", "Block Key", (KeyCode)324, "Hold to block a creature's attack with your shield (holding it drains stamina, each blocked hit costs more, and you slow down, which helps to pick a way through). Press it just before the hit lands to parry: no stamina, and the attacker staggers. Logs, gas and tar can't be blocked, and a bat in the face knocks your guard down for a moment."); ThrowKey = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("2 - Keys", "Throw Key", (KeyCode)323, "Throws a spear you picked up at the boss (Eikthyr): it flies down your lane, so throw when he's lined up with you."); SprintSpeed = ((BaseUnityPlugin)this).Config.Bind<float>("1 - Run", "Sprint Speed", 1.35f, new ConfigDescription("How much faster you run while sprinting.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 2f), Array.Empty<object>())); MaxStamina = ((BaseUnityPlugin)this).Config.Bind<float>("1 - Run", "Stamina", 100f, new ConfigDescription("Stamina for sprinting and blocking. It recharges after a second of not using it.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(10f, 500f), Array.Empty<object>())); SprintStamina = ((BaseUnityPlugin)this).Config.Bind<float>("1 - Run", "Sprint Stamina Per Second", 18f, new ConfigDescription("Stamina used each second of sprinting.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 100f), Array.Empty<object>())); RollStamina = ((BaseUnityPlugin)this).Config.Bind<float>("1 - Run", "Roll Stamina", 12f, new ConfigDescription("Stamina used by each roll (and each dive from the air). Without enough you can't roll.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 100f), Array.Empty<object>())); BlockStamina = ((BaseUnityPlugin)this).Config.Bind<float>("1 - Run", "Block Stamina", 30f, new ConfigDescription("Stamina used by each blocked hit (a parry is free). Without enough, the guard breaks and the hit gets through.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 200f), Array.Empty<object>())); BlockHoldStamina = ((BaseUnityPlugin)this).Config.Bind<float>("1 - Run", "Block Hold Stamina Per Second", 8f, new ConfigDescription("Stamina used each second the block is held. At none left the guard stays up, but blocked hits break through it (a parry still works).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 100f), Array.Empty<object>())); BlockSpeed = ((BaseUnityPlugin)this).Config.Bind<float>("1 - Run", "Block Speed", 0.75f, new ConfigDescription("How fast you run behind your shield, from your normal speed (it eases in and out).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.3f, 1f), Array.Empty<object>())); SkillXp = ((BaseUnityPlugin)this).Config.Bind<bool>("2 - Rewards", "Block And Dodge XP", true, "Blocking and Dodge skill XP as the game gives it: 1 for each blocked hit, 2 for each parry (Blocking), and 1 for each attack you roll under, jump or step out of the way of (Dodge). Given with the Run XP when the run ends."); StaminaRegen = ((BaseUnityPlugin)this).Config.Bind<float>("1 - Run", "Stamina Regen Per Second", 22f, new ConfigDescription("Stamina recovered each second once you stop sprinting and blocking for a second.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 200f), Array.Empty<object>())); ParryWindow = ((BaseUnityPlugin)this).Config.Bind<float>("1 - Run", "Parry Window", 0.3f, new ConfigDescription("Seconds before a hit in which pressing block parries it.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.05f, 1f), Array.Empty<object>())); ParryDuel = ((BaseUnityPlugin)this).Config.Bind<bool>("1 - Run", "Parry Duel", true, "Bosses (not Eikthyr or Moder) are hurt by parrying: grab the weapon on the track and the boss closes in and swings at your lane up to three times; parry a swing and your blow lands. Off: grabbing the weapon hurts the boss straight away."); StartMenu = ((BaseUnityPlugin)this).Config.Bind<bool>("2 - Keys", "Start Menu", true, "surfsup (with nothing after it) opens a grid of the biomes and star laps you've reached, to pick where to start. Off: it starts at your latest checkpoint."); PopupText = ((BaseUnityPlugin)this).Config.Bind<bool>("3 - Look", "Popup Text", false, "Show text pop-ups during the run (\"Entering ...\", boss messages, JUMP!/SLIDE!). Off: the run speaks through sounds, flashes and the HUD instead."); Raven = ((BaseUnityPlugin)this).Config.Bind<bool>("3 - Look", "Hugin Messages", true, "The run's messages (entering a biome, a boss's items, lives left, a boss beaten) come from Hugin, the tutorial raven: he flies in at the top right of the screen, says it in the game's own speech popup, and flies off. Off: no messages, unless Popup Text is on."); LoadingScreen = ((BaseUnityPlugin)this).Config.Bind<bool>("3 - Look", "Portal Loading Screen", true, "Runs load behind the game's own portal loading screen (the swirl you see when you teleport), fading in when the run is ready. Off: the run just starts."); ViewDistance = ((BaseUnityPlu