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 DeadGodLocations v0.2.1
plugins/DeadGodLocations/DeadGodLocations.dll
Decompiled 34 minutes 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.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Cryptography; using System.Security.Permissions; using System.Text; using System.Threading.Tasks; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using DeadGodLocations.Gen; using DeadGodLocations.Structures; using HG; using HG.Reflection; using KinematicCharacterController; using Microsoft.CodeAnalysis; using On.RoR2; using On.RoR2.Networking; using On.RoR2.UI; using On.RoR2.UI.MainMenu; using RiskOfOptions; using RiskOfOptions.OptionConfigs; using RiskOfOptions.Options; using RoR2; using RoR2.CharacterAI; using RoR2.ContentManagement; using RoR2.Navigation; using RoR2.Networking; using RoR2.UI; using RoR2.UI.MainMenu; using SimpleJSON; using TMPro; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.AddressableAssets.ResourceLocators; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.Experimental.Rendering; using UnityEngine.Networking; using UnityEngine.Profiling; using UnityEngine.Rendering; using UnityEngine.Rendering.PostProcessing; using UnityEngine.SceneManagement; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: IgnoresAccessChecksTo("com.unity.multiplayer-hlapi.Runtime")] [assembly: IgnoresAccessChecksTo("RoR2")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("DeadGodLocations")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+e6165f6fae17311965941a047e30de40aad4c311")] [assembly: AssemblyProduct("DeadGodLocations")] [assembly: AssemblyTitle("DeadGodLocations")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [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.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace DeadGodLocations { public class AirParticles : MonoBehaviour { private struct Air { public Color color; public int amount; public float rise; public float size; public bool glow; } private static Air? For(string title) { //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Unknown result type (might be due to invalid IL or missing references) //IL_0255: Unknown result type (might be due to invalid IL or missing references) //IL_02f4: Unknown result type (might be due to invalid IL or missing references) //IL_02f9: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_029e: Unknown result type (might be due to invalid IL or missing references) //IL_02a3: Unknown result type (might be due to invalid IL or missing references) return title switch { "Луга" => new Air { color = new Color(1f, 0.92f, 0.45f), amount = 260, rise = 0.15f, size = 0.09f, glow = true }, "Лес" => new Air { color = new Color(0.6f, 1f, 0.55f), amount = 320, rise = 0.1f, size = 0.08f, glow = true }, "Каньоны" => new Air { color = new Color(0.95f, 0.82f, 0.6f), amount = 240, rise = 0.05f, size = 0.07f }, "Болота" => new Air { color = new Color(0.7f, 1f, 0.5f), amount = 380, rise = 0.12f, size = 0.09f, glow = true }, "Снежные горы" => new Air { color = Color.white, amount = 700, rise = -1.6f, size = 0.08f }, "Вулкан" => new Air { color = new Color(1f, 0.5f, 0.12f), amount = 420, rise = 1.3f, size = 0.08f, glow = true }, "Мёртвые земли" => new Air { color = new Color(0.8f, 0.65f, 1f), amount = 320, rise = 0.25f, size = 0.1f, glow = true }, _ => null, }; } public static void Add(WorldData d, Transform parent) { //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) //IL_0035: 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_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: 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_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: 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_00e8: 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_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_0176: 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_0186: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: 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_0210: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02b2: Expected O, but got Unknown //IL_02c7: Unknown result type (might be due to invalid IL or missing references) //IL_02e1: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_0263: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_0251: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) Air? air = For(d.title); if (!air.HasValue) { return; } Air value = air.Value; GameObject val = new GameObject("Air"); val.transform.SetParent(parent, false); val.transform.position = new Vector3(d.spawn.x, d.HeightAt(d.spawn.x, d.spawn.y) + 6f, d.spawn.y); ParticleSystem val2 = val.AddComponent<ParticleSystem>(); val2.Stop(true, (ParticleSystemStopBehavior)0); MainModule main = val2.main; ((MainModule)(ref main)).loop = true; ((MainModule)(ref main)).duration = 9f; ((MainModule)(ref main)).startLifetime = MinMaxCurve.op_Implicit(9f); ((MainModule)(ref main)).maxParticles = value.amount; ((MainModule)(ref main)).startSize = MinMaxCurve.op_Implicit(value.size * 2f); ((MainModule)(ref main)).startColor = MinMaxGradient.op_Implicit(value.glow ? (value.color * 2.2f) : value.color); ((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)1; ((MainModule)(ref main)).prewarm = true; ((MainModule)(ref main)).gravityModifier = MinMaxCurve.op_Implicit(0f); float num = Mathf.Abs(value.rise); ((MainModule)(ref main)).startSpeed = new MinMaxCurve(num * 0.6f + 0.15f, num * 1.2f + 0.5f); EmissionModule emission = val2.emission; ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit((float)value.amount / 9f); ShapeModule shape = val2.shape; ((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)5; ((ShapeModule)(ref shape)).scale = new Vector3(76f, 20f, 76f); VelocityOverLifetimeModule velocityOverLifetime = val2.velocityOverLifetime; ((VelocityOverLifetimeModule)(ref velocityOverLifetime)).enabled = true; VelFix.Same(velocityOverLifetime); ((VelocityOverLifetimeModule)(ref velocityOverLifetime)).space = (ParticleSystemSimulationSpace)1; ((VelocityOverLifetimeModule)(ref velocityOverLifetime)).x = new MinMaxCurve(0.2f, 0.5f); ((VelocityOverLifetimeModule)(ref velocityOverLifetime)).y = new MinMaxCurve(value.rise * 0.6f, value.rise * 1.2f); ((VelocityOverLifetimeModule)(ref velocityOverLifetime)).z = new MinMaxCurve(0.05f, 0.25f); ParticleSystemRenderer component = val.GetComponent<ParticleSystemRenderer>(); component.renderMode = (ParticleSystemRenderMode)0; Material val3 = Heaven.GlowParticles("matDGLAir"); if (Object.op_Implicit((Object)(object)val3)) { ((MainModule)(ref main)).startColor = MinMaxGradient.op_Implicit(value.glow ? (value.color * 1.6f) : (value.color * 0.9f)); ((MainModule)(ref main)).startSize = MinMaxCurve.op_Implicit(value.size * (value.glow ? 3.2f : 2.6f)); } else { val3 = new Material(Palette.Material) { name = "matDGLAir" }; val3.SetTexture("_MainTex", (Texture)null); val3.SetColor("_Color", value.color); if (value.glow) { val3.SetColor("_EmColor", value.color); val3.SetFloat("_EmPower", 2.5f); val3.EnableKeyword("EMISSION"); } } ((Renderer)component).sharedMaterial = val3; ((Renderer)component).shadowCastingMode = (ShadowCastingMode)0; val.AddComponent<AirParticles>(); val2.Play(); } private void LateUpdate() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) Camera main = Camera.main; if (Object.op_Implicit((Object)(object)main)) { ((Component)this).transform.position = ((Component)main).transform.position; } } } public class Ambience : MonoBehaviour { private static readonly (string bank, string play)[] Sets = new(string, string)[7] { ("zoneLakesDay", "Play_AMB_zone_lakesDay"), ("zoneRootJungle", "Play_AMB_zone_rootJungle"), ("zoneDesert", "Play_AMB_zone_desert"), ("zoneLakesNight", "Play_AMB_zone_lakesNight"), ("zoneTundra", "Play_AMB_zone_tundra"), ("zoneDampCaveSimple", "Play_AMB_zone_damp_cave_simple"), ("zoneWispGraveyard", "Play_AMB_zone_wisp_graveyard") }; private string ev; public static void Play(Biome b, Transform parent) { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Expected O, but got Unknown //IL_008a: Unknown result type (might be due to invalid IL or missing references) if (b.index >= 0 && b.index < Sets.Length) { (string, string) tuple = Sets[b.index]; uint num = default(uint); AKRESULT val = AkSoundEngine.LoadBank(tuple.Item1, ref num); GameObject val2 = new GameObject("Ambience"); val2.transform.SetParent(parent, false); val2.AddComponent<Ambience>().ev = tuple.Item2; uint num2 = Util.PlaySound(tuple.Item2, val2); Plugin.Log.LogInfo((object)string.Format("[DGL] звук окружения: банк {0} -> {1}, событие {2} -> {3}", tuple.Item1, val, tuple.Item2, (num2 != 0) ? "играет" : "не играет")); } } public static void Replay(GameObject go) { Ambience component = go.GetComponent<Ambience>(); if (Object.op_Implicit((Object)(object)component) && component.ev != null) { Util.PlaySound(component.ev, go); } } private void OnDestroy() { try { AkSoundEngine.StopAll(((Component)this).gameObject); } catch { } } } public static class Atmosphere { public class Look2 { public string sun; public string top; public string horizon; public string fog; public string backdrop; public string dirt; public string rut; public string ambientColor; public float energy; public float pitch; public float yaw; public float ambient; public float fogMul; public float saturation; public float contrast; } private static readonly Look2[] Looks = new Look2[7] { new Look2 { sun = "fff3d6", energy = 2f, pitch = -50f, yaw = 40f, top = "#3378e6", horizon = "#bddefa", ambient = 0.75f, fogMul = 0.7f, fog = "cfe2f0", saturation = 1.16f, contrast = 1.06f, dirt = "b08e62", rut = "8c6e4c", backdrop = "7f9cba" }, new Look2 { sun = "e4f4f0", energy = 0.45f, pitch = -64f, yaw = 25f, top = "#0d1b20", horizon = "#4f717a", ambient = 0.9f, fogMul = 2.2f, fog = "6a8a92", saturation = 0.76f, contrast = 1.05f, dirt = "2e4a4e", rut = "24393d", backdrop = "16282c", ambientColor = "#80a1a2" }, new Look2 { sun = "ffa868", energy = 2.1f, pitch = -14f, yaw = 72f, top = "#4a5aa8", horizon = "#ffa878", ambient = 0.55f, fogMul = 0.7f, fog = "eaa47e", saturation = 1.04f, contrast = 1.1f, dirt = "c99c68", rut = "a67c50", backdrop = "a8704e", ambientColor = "#9499b8" }, new Look2 { sun = "c2d09a", energy = 0.85f, pitch = -34f, yaw = -30f, top = "#4d5e54", horizon = "#85997a", ambient = 0.62f, fogMul = 2.6f, fog = "8a9486", saturation = 0.95f, contrast = 1.1f, dirt = "605a44", rut = "4a4636", backdrop = "4a5a4c" }, new Look2 { sun = "ffd8cc", energy = 1.5f, pitch = -21f, yaw = 130f, top = "#0d1745", horizon = "#8f99db", ambient = 0.95f, fogMul = 1.3f, fog = "a4b2d8", saturation = 1.05f, contrast = 1.08f, dirt = "cdd5dc", rut = "a9b4c0", backdrop = "6f7fa8", ambientColor = "#94a8eb" }, new Look2 { sun = "ffc497", energy = 1.7f, pitch = -34f, yaw = 10f, top = "#1a0f0c", horizon = "#8a3a1c", ambient = 1f, fogMul = 1.1f, fog = "3e2e28", saturation = 1.06f, contrast = 1.2f, dirt = "4a403a", rut = "302824", backdrop = "2c2422", ambientColor = "#7a6c6a" }, new Look2 { sun = "f2ecff", energy = 1.35f, pitch = -30f, yaw = 200f, top = "#0f0930", horizon = "#9966b3", ambient = 0.6f, fogMul = 0.8f, fog = "8a72a8", saturation = 1.08f, contrast = 1.1f, dirt = "9a8fa6", rut = "7a7086", backdrop = "5a4a6a", ambientColor = "#8080a8" } }; private static bool AnimeSky; private static bool NebulaSky; public static float SkyFog = -1f; public static Look2 For(int location) { return Looks[Mathf.Clamp(location, 0, Looks.Length - 1)]; } public static void Apply(Biome b, WorldData d, string vanillaProfile) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: 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_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0030: 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_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Expected O, but got Unknown //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: 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_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_019d: 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_01af: Unknown result type (might be due to invalid IL or missing references) //IL_04a5: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_050a: Unknown result type (might be due to invalid IL or missing references) //IL_0511: Unknown result type (might be due to invalid IL or missing references) //IL_0518: Unknown result type (might be due to invalid IL or missing references) //IL_0524: Unknown result type (might be due to invalid IL or missing references) //IL_057b: Unknown result type (might be due to invalid IL or missing references) //IL_0582: Unknown result type (might be due to invalid IL or missing references) //IL_0589: Unknown result type (might be due to invalid IL or missing references) //IL_05a1: Unknown result type (might be due to invalid IL or missing references) //IL_05b2: Unknown result type (might be due to invalid IL or missing references) //IL_05b9: Unknown result type (might be due to invalid IL or missing references) //IL_05c0: Unknown result type (might be due to invalid IL or missing references) //IL_05d8: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Unknown result type (might be due to invalid IL or missing references) //IL_0252: Unknown result type (might be due to invalid IL or missing references) //IL_025c: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Unknown result type (might be due to invalid IL or missing references) //IL_027b: Unknown result type (might be due to invalid IL or missing references) //IL_0286: Unknown result type (might be due to invalid IL or missing references) //IL_0290: Unknown result type (might be due to invalid IL or missing references) //IL_029a: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_0227: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Unknown result type (might be due to invalid IL or missing references) //IL_0236: Unknown result type (might be due to invalid IL or missing references) //IL_02f7: Unknown result type (might be due to invalid IL or missing references) //IL_02fe: Expected O, but got Unknown //IL_0313: Unknown result type (might be due to invalid IL or missing references) //IL_02ad: Unknown result type (might be due to invalid IL or missing references) //IL_02be: Unknown result type (might be due to invalid IL or missing references) //IL_02c8: Unknown result type (might be due to invalid IL or missing references) //IL_02d2: Unknown result type (might be due to invalid IL or missing references) //IL_0688: Unknown result type (might be due to invalid IL or missing references) //IL_068d: Unknown result type (might be due to invalid IL or missing references) //IL_0696: Unknown result type (might be due to invalid IL or missing references) //IL_069d: Unknown result type (might be due to invalid IL or missing references) //IL_06a4: Unknown result type (might be due to invalid IL or missing references) //IL_06b0: Unknown result type (might be due to invalid IL or missing references) //IL_06c1: Unknown result type (might be due to invalid IL or missing references) //IL_06c8: Unknown result type (might be due to invalid IL or missing references) //IL_06cf: Unknown result type (might be due to invalid IL or missing references) //IL_06db: Unknown result type (might be due to invalid IL or missing references) //IL_06ec: Unknown result type (might be due to invalid IL or missing references) //IL_06f3: Unknown result type (might be due to invalid IL or missing references) //IL_06fa: Unknown result type (might be due to invalid IL or missing references) //IL_0706: Unknown result type (might be due to invalid IL or missing references) //IL_0370: Unknown result type (might be due to invalid IL or missing references) //IL_0384: Unknown result type (might be due to invalid IL or missing references) //IL_038b: Expected O, but got Unknown //IL_0764: Unknown result type (might be due to invalid IL or missing references) //IL_03d1: Unknown result type (might be due to invalid IL or missing references) //IL_03d6: Unknown result type (might be due to invalid IL or missing references) Look2 look = For(b.index); Color val = Look.Html(look.top); Color val2 = Look.Html(look.horizon); Color val3 = Look.Html(look.fog); Color val4 = Color.Lerp(val3, val2, 0.7f); try { Material val5 = new Material(Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Common/Skyboxes/matSkybox1.mat").WaitForCompletion()) { name = "matDGLSky" }; Vector3 toSun = -(Quaternion.Euler(0f - look.pitch, 180f - look.yaw, 0f) * Vector3.forward); float stars = Mathf.Clamp01((0.25f - ((Color)(ref val)).grayscale) / 0.15f); AnimeSky = b.index == 0; NebulaSky = b.index == 6; val5.SetTexture("_Tex", (Texture)(object)GradientCube(val, val2, Color.Lerp(val2, val3, 0.6f), toSun, Look.Html(look.sun), stars)); if (val5.HasProperty("_Exposure")) { val5.SetFloat("_Exposure", 1f); } if (val5.HasProperty("_Tint")) { val5.SetColor("_Tint", new Color(0.5f, 0.5f, 0.5f, 0.5f)); } if (val5.HasProperty("_Rotation")) { val5.SetFloat("_Rotation", 0f); } RenderSettings.skybox = val5; } catch (Exception ex) { Plugin.Log.LogWarning((object)("[DGL] небо: " + ex.Message)); } Color val6 = ((look.ambientColor != null) ? Look.Html(look.ambientColor) : Color.Lerp(val, val2, 0.6f)); float num = ((b.index == 5) ? 2.2f : ((b.index == 6) ? 1.3f : ((b.index == 3) ? 1.6f : ((b.index == 1) ? 1.45f : 1f)))); val6 *= num; if (b.index == 4) { val6 = Color.Lerp(val6, new Color(0.85f, 0.88f, 0.95f), 0.6f) * 0.8f; } RenderSettings.ambientMode = (AmbientMode)1; RenderSettings.ambientSkyColor = val6 * (0.55f + look.ambient * 0.6f); RenderSettings.ambientEquatorColor = Color.Lerp(val6, val2, 0.5f) * (0.45f + look.ambient * 0.5f); RenderSettings.ambientGroundColor = d.groundColor.Darkened(0.5f) * 0.6f; if (b.index == 1) { RenderSettings.ambientGroundColor = Color.Lerp(val6, new Color(0.35f, 0.6f, 0.62f), 0.5f) * 0.75f; } RenderSettings.ambientIntensity = 1f; RenderSettings.fog = false; RenderSettings.defaultReflectionMode = (DefaultReflectionMode)0; GameObject val7 = new GameObject("Sun"); Light obj = val7.AddComponent<Light>(); obj.type = (LightType)1; obj.color = Look.Html(look.sun); obj.intensity = look.energy * ((b.index == 3) ? 1f : 0.75f); obj.shadows = (LightShadows)2; obj.shadowStrength = 0.85f; val7.transform.rotation = Quaternion.Euler(0f - look.pitch, 180f - look.yaw, 0f); RenderSettings.sun = obj; GameObject val8 = new GameObject("PP + Amb"); val8.SetActive(false); val8.layer = LayerIndex.postProcess.intVal; PostProcessVolume val9 = val8.AddComponent<PostProcessVolume>(); val9.isGlobal = true; val9.priority = 0f; val9.weight = 1f; PostProcessProfile val10 = null; try { val10 = Addressables.LoadAssetAsync<PostProcessProfile>((object)vanillaProfile).WaitForCompletion(); } catch (Exception ex2) { Plugin.Log.LogInfo((object)("[DGL] профиль картинки не загрузился: " + ex2.GetType().Name)); } val10 = (Object.op_Implicit((Object)(object)val10) ? Object.Instantiate<PostProcessProfile>(val10) : ScriptableObject.CreateInstance<PostProcessProfile>()); ((Object)val10).name = "ppDGL_" + b.scene; RampFog val11 = default(RampFog); if (!val10.TryGetSettings<RampFog>(ref val11)) { val11 = val10.AddSettings<RampFog>(); } else { Plugin.Log.LogInfo((object)$"[DGL] дымка обычного этапа: sky={((ParameterOverride<float>)(object)val11.skyboxStrength).value} one={((ParameterOverride<float>)(object)val11.fogOne).value} zero={((ParameterOverride<float>)(object)val11.fogZero).value} end={((ParameterOverride<Color>)(object)val11.fogColorEnd).value} hI={((ParameterOverride<float>)(object)val11.fogHeightIntensity).value} hS={((ParameterOverride<float>)(object)val11.fogHeightStart).value} hE={((ParameterOverride<float>)(object)val11.fogHeightEnd).value}"); } ((ParameterOverride<bool>)(object)((PostProcessEffectSettings)val11).enabled).Override(true); ((ParameterOverride<Color>)(object)val11.fogColorStart).Override(new Color(val4.r, val4.g, val4.b, 0f)); float num2 = 0.0009f * look.fogMul; float num3 = 0.8f * (1f - Mathf.Exp((0f - num2) * 1000f)); float num4 = 0.8f * (1f - Mathf.Exp((0f - num2) * 2000f)); ((ParameterOverride<Color>)(object)val11.fogColorMid).Override(new Color(val4.r, val4.g, val4.b, Mathf.Clamp(num3, 0.05f, 0.7f))); ((ParameterOverride<Color>)(object)val11.fogColorEnd).Override(new Color(val4.r, val4.g, val4.b, Mathf.Clamp(num4, 0.3f, 0.8f))); ((ParameterOverride<float>)(object)val11.fogZero).Override(-0.02f); ((ParameterOverride<float>)(object)val11.fogOne).Override(0.5f); ((ParameterOverride<float>)(object)val11.fogIntensity).Override(1f); ((ParameterOverride<float>)(object)val11.fogPower).Override(1f); ((ParameterOverride<float>)(object)val11.skyboxStrength).Override((SkyFog >= 0f) ? SkyFog : Mathf.Clamp(0.9f - 0.2f * look.fogMul, 0.3f, 0.85f)); ((ParameterOverride<float>)(object)val11.fogHeightIntensity).Override(0f); if (b.index == 1) { Color val12 = Look.Html("65818d"); ((ParameterOverride<Color>)(object)val11.fogColorStart).Override(new Color(val12.r, val12.g, val12.b, 0f)); ((ParameterOverride<Color>)(object)val11.fogColorMid).Override(new Color(val12.r, val12.g, val12.b, 0.42f)); ((ParameterOverride<Color>)(object)val11.fogColorEnd).Override(new Color(val12.r, val12.g, val12.b, 0.78f)); ((ParameterOverride<float>)(object)val11.fogZero).Override(-0.004f); ((ParameterOverride<float>)(object)val11.fogOne).Override(0.09f); } ColorGrading val13 = default(ColorGrading); if (!val10.TryGetSettings<ColorGrading>(ref val13)) { val13 = val10.AddSettings<ColorGrading>(); } ((ParameterOverride<bool>)(object)((PostProcessEffectSettings)val13).enabled).Override(true); Plugin.Log.LogInfo((object)$"[DGL] цвет: режим правки был {((ParameterOverride<GradingMode>)(object)val13.gradingMode).value}, насыщенность ставлю {(look.saturation - 1f) * 100f:0}"); ((ParameterOverride<GradingMode>)(object)val13.gradingMode).Override((GradingMode)1); ((ParameterOverride<float>)(object)val13.saturation).Override((look.saturation - 1f) * 100f); ((ParameterOverride<float>)(object)val13.contrast).Override((look.contrast - 1f) * 100f); if (b.index == 1) { ((ParameterOverride<float>)(object)val13.tint).Override(-5f); ((ParameterOverride<float>)(object)val13.temperature).Override(0f); } if (b.index == 1) { val9.priority = 60f; } val9.sharedProfile = val10; val8.SetActive(true); } private static Cubemap GradientCube(Color top, Color horizon, Color bottom) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) return GradientCube(top, horizon, bottom, Vector3.zero, Color.black, 0f); } private static float Noise3(Vector3 p) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) return (Mathf.PerlinNoise(p.x + 17.1f, p.y + 3.7f) + Mathf.PerlinNoise(p.y + 41.3f, p.z + 9.2f) + Mathf.PerlinNoise(p.z + 23.9f, p.x + 61.4f)) / 3f * 1.35f - 0.17f; } private static Cubemap GradientCube(Color top, Color horizon, Color bottom, Vector3 toSun, Color sunColor, float stars) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_069b: 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_00a6: Expected I4, but got Unknown //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_02cd: Unknown result type (might be due to invalid IL or missing references) //IL_02ce: Unknown result type (might be due to invalid IL or missing references) //IL_02df: Unknown result type (might be due to invalid IL or missing references) //IL_02e1: Unknown result type (might be due to invalid IL or missing references) //IL_02ee: Unknown result type (might be due to invalid IL or missing references) //IL_02f0: Unknown result type (might be due to invalid IL or missing references) //IL_032a: Unknown result type (might be due to invalid IL or missing references) //IL_032f: Unknown result type (might be due to invalid IL or missing references) //IL_0334: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_066e: Unknown result type (might be due to invalid IL or missing references) //IL_0670: Unknown result type (might be due to invalid IL or missing references) //IL_0362: 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) //IL_036b: Unknown result type (might be due to invalid IL or missing references) //IL_0370: Unknown result type (might be due to invalid IL or missing references) //IL_0372: Unknown result type (might be due to invalid IL or missing references) //IL_0374: Unknown result type (might be due to invalid IL or missing references) //IL_038b: Unknown result type (might be due to invalid IL or missing references) //IL_0392: Unknown result type (might be due to invalid IL or missing references) //IL_039c: Unknown result type (might be due to invalid IL or missing references) //IL_03a3: Unknown result type (might be due to invalid IL or missing references) //IL_03a8: Unknown result type (might be due to invalid IL or missing references) //IL_03b2: Unknown result type (might be due to invalid IL or missing references) //IL_03b7: Unknown result type (might be due to invalid IL or missing references) //IL_03c3: Unknown result type (might be due to invalid IL or missing references) //IL_03ca: Unknown result type (might be due to invalid IL or missing references) //IL_03cf: Unknown result type (might be due to invalid IL or missing references) //IL_03d9: Unknown result type (might be due to invalid IL or missing references) //IL_03de: Unknown result type (might be due to invalid IL or missing references) //IL_041a: Unknown result type (might be due to invalid IL or missing references) //IL_0421: Unknown result type (might be due to invalid IL or missing references) //IL_0426: Unknown result type (might be due to invalid IL or missing references) //IL_0430: Unknown result type (might be due to invalid IL or missing references) //IL_0435: Unknown result type (might be due to invalid IL or missing references) //IL_0491: Unknown result type (might be due to invalid IL or missing references) //IL_04c2: Unknown result type (might be due to invalid IL or missing references) //IL_04c9: Unknown result type (might be due to invalid IL or missing references) //IL_04ce: Unknown result type (might be due to invalid IL or missing references) //IL_04d8: Unknown result type (might be due to invalid IL or missing references) //IL_04dd: Unknown result type (might be due to invalid IL or missing references) //IL_04e9: Unknown result type (might be due to invalid IL or missing references) //IL_04fc: Unknown result type (might be due to invalid IL or missing references) //IL_0501: Unknown result type (might be due to invalid IL or missing references) //IL_0503: Unknown result type (might be due to invalid IL or missing references) //IL_0505: Unknown result type (might be due to invalid IL or missing references) //IL_0520: Unknown result type (might be due to invalid IL or missing references) //IL_0525: Unknown result type (might be due to invalid IL or missing references) //IL_0527: Unknown result type (might be due to invalid IL or missing references) //IL_0529: Unknown result type (might be due to invalid IL or missing references) //IL_052d: Unknown result type (might be due to invalid IL or missing references) //IL_0537: Unknown result type (might be due to invalid IL or missing references) //IL_053c: Unknown result type (might be due to invalid IL or missing references) //IL_0541: Unknown result type (might be due to invalid IL or missing references) //IL_0543: Unknown result type (might be due to invalid IL or missing references) //IL_0554: Unknown result type (might be due to invalid IL or missing references) //IL_055b: Unknown result type (might be due to invalid IL or missing references) //IL_0565: Unknown result type (might be due to invalid IL or missing references) //IL_0577: Unknown result type (might be due to invalid IL or missing references) //IL_057c: Unknown result type (might be due to invalid IL or missing references) //IL_0581: Unknown result type (might be due to invalid IL or missing references) //IL_022e: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_0254: Unknown result type (might be due to invalid IL or missing references) //IL_025a: Unknown result type (might be due to invalid IL or missing references) //IL_025f: Unknown result type (might be due to invalid IL or missing references) //IL_0263: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_0279: Unknown result type (might be due to invalid IL or missing references) //IL_027b: Unknown result type (might be due to invalid IL or missing references) //IL_0295: Unknown result type (might be due to invalid IL or missing references) //IL_02a6: Unknown result type (might be due to invalid IL or missing references) //IL_02c6: Unknown result type (might be due to invalid IL or missing references) //IL_02cb: Unknown result type (might be due to invalid IL or missing references) //IL_05bc: Unknown result type (might be due to invalid IL or missing references) //IL_05c3: Unknown result type (might be due to invalid IL or missing references) //IL_05c4: Unknown result type (might be due to invalid IL or missing references) //IL_05c7: Expected I4, but got Unknown //IL_0623: Unknown result type (might be due to invalid IL or missing references) //IL_0634: Unknown result type (might be due to invalid IL or missing references) //IL_064f: Unknown result type (might be due to invalid IL or missing references) //IL_0654: Unknown result type (might be due to invalid IL or missing references) Cubemap val = new Cubemap(256, (GraphicsFormat)4, (TextureCreationFlags)0) { name = "dglSkyCube" }; CubemapFace[] array = new CubemapFace[6]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); Color[] array2 = (Color[])(object)new Color[65536]; CubemapFace[] array3 = (CubemapFace[])(object)array; Vector3 val3 = default(Vector3); Color val5 = default(Color); Color val6 = default(Color); Color val7 = default(Color); Color val11 = default(Color); Color val12 = default(Color); foreach (CubemapFace val2 in array3) { for (int j = 0; j < 256; j++) { for (int k = 0; k < 256; k++) { float num = ((float)k + 0.5f) / 256f * 2f - 1f; float num2 = ((float)j + 0.5f) / 256f * 2f - 1f; switch ((int)val2) { case 0: ((Vector3)(ref val3))..ctor(1f, 0f - num2, 0f - num); break; case 1: ((Vector3)(ref val3))..ctor(-1f, 0f - num2, num); break; case 2: ((Vector3)(ref val3))..ctor(num, 1f, num2); break; case 3: ((Vector3)(ref val3))..ctor(num, -1f, 0f - num2); break; case 4: ((Vector3)(ref val3))..ctor(num, 0f - num2, 1f); break; default: ((Vector3)(ref val3))..ctor(0f - num, 0f - num2, -1f); break; } float y = ((Vector3)(ref val3)).normalized.y; Color val4 = ((y >= 0f) ? Color.Lerp(horizon, top, Mathf.Clamp01(1f - Mathf.Pow(1f - y, 6.6666665f))) : Color.Lerp(horizon, bottom, Mathf.Clamp01(1f - Mathf.Pow(1f + y, 50f)))); Vector3 normalized = ((Vector3)(ref val3)).normalized; if (AnimeSky && y >= 0f) { ((Color)(ref val5))..ctor(0.86f, 0.93f, 1f); ((Color)(ref val6))..ctor(0.47f, 0.71f, 0.96f); ((Color)(ref val7))..ctor(0.16f, 0.38f, 0.85f); val4 = ((y < 0.3f) ? Color.Lerp(val5, val6, Mathf.SmoothStep(0f, 1f, y / 0.3f)) : Color.Lerp(val6, val7, Mathf.SmoothStep(0f, 1f, (y - 0.3f) / 0.7f))); Vector2 val8 = new Vector2(normalized.x, normalized.z); Vector2 normalized2 = ((Vector2)(ref val8)).normalized; val8 = new Vector2(toSun.x, toSun.z); Vector2 normalized3 = ((Vector2)(ref val8)).normalized; float num3 = 0.35f + 0.65f * Mathf.Pow(Mathf.Max(0f, Vector2.Dot(normalized2, normalized3)), 2f); val4 = Color.Lerp(val4, new Color(1f, 0.88f, 0.76f), Mathf.Pow(1f - y, 10f) * 0.6f * num3); } if (toSun != Vector3.zero) { float num4 = Mathf.Max(0f, Vector3.Dot(normalized, toSun)); val4 += sunColor * (Mathf.Pow(num4, 900f) * 1.2f + Mathf.Pow(num4, 60f) * 0.35f + Mathf.Pow(num4, 6f) * 0.12f); } float num5 = 1f; if (NebulaSky && y > -0.05f) { Vector3 val9 = new Vector3(0.35f, 0.62f, 0.7f); Vector3 normalized4 = ((Vector3)(ref val9)).normalized; float num6 = Vector3.Dot(normalized, normalized4); float num7 = Mathf.Exp((0f - num6 * num6) / 0.0484f); float num8 = Noise3(normalized * 3.1f); float num9 = Noise3(normalized * 7.3f + Vector3.one * 5f); float num10 = Noise3(normalized * 15f + Vector3.one * 11f); float num11 = Mathf.Clamp01((num8 * 0.6f + num9 * 0.3f + num10 * 0.1f - 0.35f) * 2.2f); float num12 = Mathf.Clamp01(1f - Mathf.Abs(Noise3(normalized * 5.5f + Vector3.one * 2f) - 0.5f) * 9f); float num13 = num7 * num11 * (1f - 0.65f * num12) * Mathf.Clamp01((y + 0.05f) * 6f); Color val10 = new Color(0.85f, 0.32f, 0.78f); ((Color)(ref val11))..ctor(0.32f, 0.42f, 1f); ((Color)(ref val12))..ctor(0.35f, 0.85f, 0.95f); float num14 = Noise3(normalized * 2.2f + Vector3.one * 31f); Color val13 = Color.Lerp(val10, val11, Mathf.SmoothStep(0.3f, 0.7f, num14)); val13 = Color.Lerp(val13, val12, Mathf.Clamp01((num9 - 0.62f) * 4f) * 0.6f); val4 += val13 * num13 * 0.75f; val4 += new Color(0.55f, 0.45f, 0.8f) * num7 * 0.12f * Mathf.Clamp01(y * 4f); num5 = 1f + num7 * 3f; } if (stars > 0f && y > 0.08f) { uint num15 = (uint)((k * 73856093) ^ (j * 19349663) ^ (val2 * 83492791)); num15 ^= num15 >> 13; num15 *= 1540483477; num15 ^= num15 >> 15; if ((float)(num15 & 0xFFFF) / 65535f < 0.0035f * stars * num5) { float num16 = 0.45f + 0.55f * (float)((num15 >> 16) & 0xFF) / 255f; val4 = Color.Lerp(val4, new Color(1f, 0.97f, 0.92f), num16 * Mathf.Clamp01((y - 0.08f) * 3f)); } } val4.a = 1f; array2[j * 256 + k] = val4; } } val.SetPixels(array2, val2); } val.Apply(false, true); return val; } } public class AuroraMotion : MonoBehaviour { public Mesh mesh; public Vector3 middle; public float radius; public float bottom; public float height; public float start; public float phase; public float uShift; private const int Steps = 160; private Vector3[] verts; private Color[] cols; private Vector2[] uvs; private float t; public void Build() { //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0108: 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) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) verts = (Vector3[])(object)new Vector3[322]; cols = (Color[])(object)new Color[verts.Length]; uvs = (Vector2[])(object)new Vector2[verts.Length]; int[] array = new int[1920]; for (int i = 0; i < 160; i++) { int num = i * 2; int num2 = i * 12; array[num2] = num; array[num2 + 1] = num + 1; array[num2 + 2] = num + 2; array[num2 + 3] = num + 2; array[num2 + 4] = num + 1; array[num2 + 5] = num + 3; array[num2 + 6] = num; array[num2 + 7] = num + 2; array[num2 + 8] = num + 1; array[num2 + 9] = num + 2; array[num2 + 10] = num + 3; array[num2 + 11] = num + 1; } Shape(); mesh.vertices = verts; mesh.colors = cols; mesh.uv = uvs; mesh.triangles = array; mesh.bounds = new Bounds(middle + Vector3.up * (bottom + height * 0.5f), Vector3.one * (radius * 2f + 400f)); } private void Shape() { //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_017c: 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_0186: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_0233: Unknown result type (might be due to invalid IL or missing references) //IL_0235: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_0275: Unknown result type (might be due to invalid IL or missing references) //IL_027a: Unknown result type (might be due to invalid IL or missing references) //IL_0291: Unknown result type (might be due to invalid IL or missing references) //IL_0296: Unknown result type (might be due to invalid IL or missing references) float num = t + phase; float num2 = Mathf.Pow(Mathf.Max(0f, Mathf.Sin(num * 0.11f)), 12f); float num3 = 0.75f + 0.25f * Mathf.Sin(num * 0.23f) + 0.6f * num2; Vector3 val2 = default(Vector3); for (int i = 0; i <= 160; i++) { float num4 = (float)i / 160f; float num5 = start + num4 * 2.4f; float num6 = Mathf.Sin(num4 * 9f + num * 0.07f) * 70f + Mathf.Sin(num4 * 23f - num * 0.15f) * 22f + Mathf.Sin(num4 * 57f + num * 0.31f) * 6f; float num7 = radius + num6; float num8 = Mathf.Sin(num4 * 5f + num * 0.05f) * 30f; Vector3 val = middle + new Vector3(Mathf.Cos(num5) * num7, bottom + num8, Mathf.Sin(num5) * num7); ((Vector3)(ref val2))..ctor(Mathf.Cos(num5), 0f, Mathf.Sin(num5)); verts[i * 2] = val; verts[i * 2 + 1] = val + Vector3.up * height + val2 * height * 0.25f; float num9 = Mathf.SmoothStep(0f, 1f, Mathf.Clamp01(num4 / 0.12f)) * (1f - Mathf.SmoothStep(0f, 1f, Mathf.Clamp01((num4 - 0.88f) / 0.12f))); float num10 = 0.55f + 0.45f * Mathf.Sin(num4 * 13f - num * 0.4f) * Mathf.Sin(num4 * 4f + num * 0.13f); Color val3 = Color.white * (num9 * num3 * num10); val3.a = 1f; cols[i * 2] = val3; cols[i * 2 + 1] = val3; float num11 = uShift + num4 * 1.6f + num * 0.004f; uvs[i * 2] = new Vector2(num11, 0f); uvs[i * 2 + 1] = new Vector2(num11, 1f); } } private void Update() { if (Object.op_Implicit((Object)(object)mesh)) { t += Time.deltaTime; Shape(); mesh.vertices = verts; mesh.colors = cols; mesh.uv = uvs; } } } public class AutoTest : MonoBehaviour { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static UnityAction<Scene, Scene> <>9__6_0; public static hook_Save <>9__6_1; public static hook_SaveLoggedInUserProfiles <>9__6_2; public static hook_SaveHistory <>9__6_3; public static Action<DamageReport> <>9__12_0; public static hook_Update <>9__12_1; public static hook_FixedUpdate <>9__12_2; public static hook_Suicide <>9__12_3; public static hook_OnBodyDeath <>9__12_4; public static Func<PostProcessEffectSettings, string> <>9__12_6; public static Comparison<(float d, Vector3 a, Vector3 b)> <>9__12_10; public static Func<KeyValuePair<string, int>, string> <>9__13_0; public static Func<KeyValuePair<string, int>, string> <>9__13_1; public static Func<KeyValuePair<string, int>, string> <>9__13_2; internal void <TryStart>b__6_0(Scene a, Scene b) { Log.LogInfo((object)("[DGL] scene -> " + ((Scene)(ref b)).name)); } internal bool <TryStart>b__6_1(orig_Save orig, SaveSystem self, UserProfile data, bool blocking) { Log.LogInfo((object)"[DGL] autotest: сохранение профиля пропущено"); return true; } internal void <TryStart>b__6_2(orig_SaveLoggedInUserProfiles orig, SaveSystem self) { } internal void <TryStart>b__6_3(orig_SaveHistory orig, SaveSystemSteam self, byte[] data, string fileName) { } internal void <RunScript>b__12_0(DamageReport rep) { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) if (rep != null && Object.op_Implicit((Object)(object)rep.victimBody) && rep.victimBody.isPlayerControlled) { DamageInfo damageInfo = rep.damageInfo; ManualLogSource log = Log; object[] obj = new object[6] { rep.victimBody.footPosition, damageInfo?.damage, damageInfo?.damageType.damageType, Object.op_Implicit((Object)(object)rep.attackerBody) ? ((Object)rep.attackerBody).name : (Object.op_Implicit((Object)(object)damageInfo?.attacker) ? ((Object)damageInfo.attacker).name : "нет"), Object.op_Implicit((Object)(object)damageInfo?.inflictor) ? ((Object)damageInfo.inflictor).name : "нет", null }; Scene activeScene = SceneManager.GetActiveScene(); obj[5] = ((Scene)(ref activeScene)).name; log.LogInfo((object)string.Format("[DGL] СМЕРТЬ героя: в {0}, урон {1:0} тип {2} атакующий {3} источник {4}, сцена {5}", obj)); } } internal void <RunScript>b__12_1(orig_Update orig, PlayerCharacterMasterController self) { if (!Autopilot) { orig.Invoke(self); } } internal void <RunScript>b__12_2(orig_FixedUpdate orig, PlayerCharacterMasterController self) { if (!Autopilot) { orig.Invoke(self); } } internal void <RunScript>b__12_3(orig_Suicide orig, HealthComponent self, GameObject attacker, GameObject inflictor, DamageTypeCombo dt) { //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.body) && self.body.isPlayerControlled) { Log.LogInfo((object)$"[DGL] СМЕРТЬ-Suicide героя в {self.body.footPosition}: {Environment.StackTrace}"); } orig.Invoke(self, attacker, inflictor, dt); } internal void <RunScript>b__12_4(orig_OnBodyDeath orig, CharacterMaster self, CharacterBody body) { //IL_002f: 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) if (Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.playerCharacterMasterController)) { Log.LogInfo((object)string.Format("[DGL] СМЕРТЬ-тело героя {0} godMode={1}: {2}", Object.op_Implicit((Object)(object)body) ? ((object)body.footPosition/*cast due to .constrained prefix*/).ToString() : "-", Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)body.healthComponent) && body.healthComponent.godMode, Environment.StackTrace)); } orig.Invoke(self, body); } internal string <RunScript>b__12_6(PostProcessEffectSettings x) { return ((object)x).GetType().Name + (((ParameterOverride<bool>)(object)x.enabled).value ? "" : "(off)"); } internal int <RunScript>b__12_10((float d, Vector3 a, Vector3 b) x, (float d, Vector3 a, Vector3 b) y) { return x.d.CompareTo(y.d); } internal string <LogState>b__13_0(KeyValuePair<string, int> kv) { return kv.Key + " x" + kv.Value; } internal string <LogState>b__13_1(KeyValuePair<string, int> kv) { return kv.Key + " x" + kv.Value; } internal string <LogState>b__13_2(KeyValuePair<string, int> kv) { return kv.Key + " x" + kv.Value; } } public static ManualLogSource Log; private bool godMode; private static bool Autopilot; private static readonly List<CameraRigController> frozen = new List<CameraRigController>(); public static string FlagPath => Path.Combine(Paths.ConfigPath, "DeadGodLocations.autotest.txt"); public static string ShotsDir => Path.Combine(Paths.BepInExRootPath, "dgl-shots"); public static void TryStart(GameObject host, ManualLogSource log) { //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Expected O, but got Unknown //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Expected O, but got Unknown //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Expected O, but got Unknown Log = log; SceneManager.activeSceneChanged += delegate(Scene a, Scene b) { Log.LogInfo((object)("[DGL] scene -> " + ((Scene)(ref b)).name)); }; if (!File.Exists(FlagPath)) { return; } Log.LogInfo((object)("[DGL] AutoTest включён: " + FlagPath)); object obj = <>c.<>9__6_1; if (obj == null) { hook_Save val = delegate { Log.LogInfo((object)"[DGL] autotest: сохранение профиля пропущено"); return true; }; <>c.<>9__6_1 = val; obj = (object)val; } SaveSystem.Save += (hook_Save)obj; object obj2 = <>c.<>9__6_2; if (obj2 == null) { hook_SaveLoggedInUserProfiles val2 = delegate { }; <>c.<>9__6_2 = val2; obj2 = (object)val2; } SaveSystem.SaveLoggedInUserProfiles += (hook_SaveLoggedInUserProfiles)obj2; object obj3 = <>c.<>9__6_3; if (obj3 == null) { hook_SaveHistory val3 = delegate { }; <>c.<>9__6_3 = val3; obj3 = (object)val3; } SaveSystemSteam.SaveHistory += (hook_SaveHistory)obj3; host.AddComponent<AutoTest>(); } private void Start() { Directory.CreateDirectory(ShotsDir); ((MonoBehaviour)this).StartCoroutine(RunScript()); ((MonoBehaviour)this).StartCoroutine(SkipIntro()); } private static CharacterBody NearestFoe(CharacterBody me, float range) { //IL_0056: 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_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) CharacterBody result = null; float num = range; foreach (TeamComponent teamMember in TeamComponent.GetTeamMembers((TeamIndex)2)) { CharacterBody val = (Object.op_Implicit((Object)(object)teamMember) ? teamMember.body : null); if (!Object.op_Implicit((Object)(object)val) || !Object.op_Implicit((Object)(object)val.healthComponent) || !val.healthComponent.alive) { continue; } float num2 = Vector3.Distance(val.corePosition, me.corePosition); if (!(num2 >= num)) { Vector3 aimOrigin = me.aimOrigin; Vector3 corePosition = val.corePosition; LayerIndex world = LayerIndex.world; if (!Physics.Linecast(aimOrigin, corePosition, LayerMask.op_Implicit(((LayerIndex)(ref world)).mask), (QueryTriggerInteraction)1)) { result = val; num = num2; } } } return result; } private void Update() { if (!godMode) { return; } foreach (PlayerCharacterMasterController instance in PlayerCharacterMasterController.instances) { CharacterBody val = (Object.op_Implicit((Object)(object)instance.master) ? instance.master.GetBody() : null); if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val.healthComponent)) { val.healthComponent.godMode = true; } if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val.healthComponent) && val.healthComponent.health < val.healthComponent.fullHealth) { val.healthComponent.health = val.healthComponent.fullHealth; } } } private IEnumerator SkipIntro() { while (true) { Scene activeScene = SceneManager.GetActiveScene(); string scene = ((Scene)(ref activeScene)).name; if (scene == "intro" || scene == "splash") { yield return (object)new WaitForSecondsRealtime(2f); if (RoR2Application.loadFinished && !IntroCutsceneController.shouldSkip) { Log.LogInfo((object)"[DGL] autotest: пропускаю ролик"); IntroCutsceneController.shouldSkip = true; } } if (scene == "title") { break; } yield return (object)new WaitForSecondsRealtime(1f); } } private unsafe IEnumerator RunScript() { string[] array = File.ReadAllLines(FlagPath); GlobalEventManager.onCharacterDeathGlobal += delegate(DamageReport rep) { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) if (rep != null && Object.op_Implicit((Object)(object)rep.victimBody) && rep.victimBody.isPlayerControlled) { DamageInfo damageInfo = rep.damageInfo; ManualLogSource log13 = Log; object[] obj10 = new object[6] { rep.victimBody.footPosition, damageInfo?.damage, damageInfo?.damageType.damageType, Object.op_Implicit((Object)(object)rep.attackerBody) ? ((Object)rep.attackerBody).name : (Object.op_Implicit((Object)(object)damageInfo?.attacker) ? ((Object)damageInfo.attacker).name : "нет"), Object.op_Implicit((Object)(object)damageInfo?.inflictor) ? ((Object)damageInfo.inflictor).name : "нет", null }; Scene activeScene2 = SceneManager.GetActiveScene(); obj10[5] = ((Scene)(ref activeScene2)).name; log13.LogInfo((object)string.Format("[DGL] СМЕРТЬ героя: в {0}, урон {1:0} тип {2} атакующий {3} источник {4}, сцена {5}", obj10)); } }; object obj = <>c.<>9__12_1; if (obj == null) { hook_Update val = delegate(orig_Update orig, PlayerCharacterMasterController self) { if (!Autopilot) { orig.Invoke(self); } }; <>c.<>9__12_1 = val; obj = (object)val; } PlayerCharacterMasterController.Update += (hook_Update)obj; object obj2 = <>c.<>9__12_2; if (obj2 == null) { hook_FixedUpdate val2 = delegate(orig_FixedUpdate orig, PlayerCharacterMasterController self) { if (!Autopilot) { orig.Invoke(self); } }; <>c.<>9__12_2 = val2; obj2 = (object)val2; } PlayerCharacterMasterController.FixedUpdate += (hook_FixedUpdate)obj2; object obj3 = <>c.<>9__12_3; if (obj3 == null) { hook_Suicide val3 = delegate(orig_Suicide orig, HealthComponent self, GameObject attacker, GameObject inflictor, DamageTypeCombo dt) { //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.body) && self.body.isPlayerControlled) { Log.LogInfo((object)$"[DGL] СМЕРТЬ-Suicide героя в {self.body.footPosition}: {Environment.StackTrace}"); } orig.Invoke(self, attacker, inflictor, dt); }; <>c.<>9__12_3 = val3; obj3 = (object)val3; } HealthComponent.Suicide += (hook_Suicide)obj3; object obj4 = <>c.<>9__12_4; if (obj4 == null) { hook_OnBodyDeath val4 = delegate(orig_OnBodyDeath orig, CharacterMaster self, CharacterBody val81) { //IL_002f: 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) if (Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.playerCharacterMasterController)) { Log.LogInfo((object)string.Format("[DGL] СМЕРТЬ-тело героя {0} godMode={1}: {2}", Object.op_Implicit((Object)(object)val81) ? ((object)val81.footPosition/*cast due to .constrained prefix*/).ToString() : "-", Object.op_Implicit((Object)(object)val81) && Object.op_Implicit((Object)(object)val81.healthComponent) && val81.healthComponent.godMode, Environment.StackTrace)); } orig.Invoke(self, val81); }; <>c.<>9__12_4 = val4; obj4 = (object)val4; } CharacterMaster.OnBodyDeath += (hook_OnBodyDeath)obj4; string[] array2 = array; Vector3 val72 = default(Vector3); RaycastHit val55 = default(RaycastHit); Vector3 val49 = default(Vector3); Vector3 val18 = default(Vector3); Vector3 val19 = default(Vector3); Vector3 item = default(Vector3); Vector3 val22 = default(Vector3); Vector3 val58 = default(Vector3); Vector3 val43 = default(Vector3); Vector3 val5 = default(Vector3); Vector2 val70 = default(Vector2); Vector3 val68 = default(Vector3); for (int num = 0; num < array2.Length; num++) { string text = array2[num].Trim(); if (text.Length == 0 || text.StartsWith("#")) { continue; } Log.LogInfo((object)("[DGL] autotest> " + text)); int num2 = text.IndexOf(' '); string text2 = ((num2 < 0) ? text : text.Substring(0, num2)); string arg = ((num2 < 0) ? "" : text.Substring(num2 + 1).Trim()); float t0 = Time.realtimeSinceStartup; LayerIndex world; Bounds bounds; Vector3 u; Vector2 val20; Scene activeScene; Vector3 val12; switch (text2) { case "wait": { if (float.TryParse(arg, NumberStyles.Float, CultureInfo.InvariantCulture, out var result)) { yield return (object)new WaitForSecondsRealtime(result); break; } while (!Check(arg)) { if (Time.realtimeSinceStartup - t0 > 120f) { Log.LogError((object)("[DGL] autotest: таймаут ожидания " + arg)); LogState(); break; } yield return (object)new WaitForSecondsRealtime(0.5f); } break; } case "cmd": try { Console.instance.SubmitCmd((NetworkUser)null, arg, false); } catch (Exception ex3) { Log.LogError((object)("[DGL] cmd error: " + ex3)); } break; case "shot": { string text10 = Path.Combine(ShotsDir, arg + ".png"); ScreenCapture.CaptureScreenshot(text10); Log.LogInfo((object)("[DGL] shot " + text10)); yield return (object)new WaitForSecondsRealtime(1f); break; } case "dumpscene": try { Inspect.DumpScene(Path.Combine(ShotsDir, arg + ".txt")); Log.LogInfo((object)"[DGL] dumpscene ok"); } catch (Exception ex2) { Log.LogError((object)("[DGL] dumpscene: " + ex2)); } break; case "dumpkeys": try { Inspect.DumpKeys(arg, Path.Combine(ShotsDir, "keys-" + ((arg.Length > 0) ? arg.Replace('/', '_') : "all") + ".txt")); Log.LogInfo((object)"[DGL] dumpkeys ok"); } catch (Exception ex4) { Log.LogError((object)("[DGL] dumpkeys: " + ex4)); } break; case "survivor": { LocalUser firstLocalUser = LocalUserManager.GetFirstLocalUser(); NetworkUser val8 = ((firstLocalUser != null) ? firstLocalUser.currentNetworkUser : null); float t1 = Time.realtimeSinceStartup; while (!Object.op_Implicit((Object)(object)val8) && Time.realtimeSinceStartup - t1 < 30f) { yield return (object)new WaitForSecondsRealtime(0.5f); LocalUser firstLocalUser2 = LocalUserManager.GetFirstLocalUser(); val8 = ((firstLocalUser2 != null) ? firstLocalUser2.currentNetworkUser : null); } if (!Object.op_Implicit((Object)(object)val8)) { Log.LogError((object)"[DGL] survivor: нет NetworkUser"); break; } BodyIndex val9 = BodyCatalog.FindBodyIndex((arg.Length > 0) ? arg : "CommandoBody"); val8.CallCmdSetBodyPreference(val9); Log.LogInfo((object)$"[DGL] survivor -> {arg} ({val9})"); break; } case "shaders": try { Inspect.DumpShaders(Path.Combine(ShotsDir, "shaders.txt"), arg.Split(new char[1] { ' ' }, StringSplitOptions.RemoveEmptyEntries)); Log.LogInfo((object)"[DGL] shaders ok"); } catch (Exception ex) { Log.LogError((object)("[DGL] shaders: " + ex)); } break; case "cam": { string[] v3 = arg.Split(' '); SetCamera(new Vector3(F(0), F(1), F(2)), new Vector3(F(3), F(4), F(5))); break; } case "camtp": { TeleporterInteraction instance4 = TeleporterInteraction.instance; if (Object.op_Implicit((Object)(object)instance4)) { Vector3 position = ((Component)instance4).transform.position; SetCamera(position + new Vector3(18f, 14f, 18f), position + Vector3.up * 2f); } else { Log.LogWarning((object)"[DGL] camtp: телепорта нет"); } break; } case "ppvols": { PostProcessVolume[] array12 = Object.FindObjectsOfType<PostProcessVolume>(); foreach (PostProcessVolume val33 in array12) { PostProcessProfile sharedProfile = val33.sharedProfile; string text5 = (Object.op_Implicit((Object)(object)sharedProfile) ? string.Join(",", sharedProfile.settings.Select((PostProcessEffectSettings x) => ((object)x).GetType().Name + (((ParameterOverride<bool>)(object)x.enabled).value ? "" : "(off)"))) : "-"); Log.LogInfo((object)string.Format("[DGL] pp: {0} global={1} prio={2} weight={3} active={4} layer={5} profile={6} [{7}]", ((Object)val33).name, val33.isGlobal, val33.priority, val33.weight, ((Behaviour)val33).isActiveAndEnabled, ((Component)val33).gameObject.layer, Object.op_Implicit((Object)(object)sharedProfile) ? ((Object)sharedProfile).name : "-", text5)); } Camera[] allCameras = Camera.allCameras; foreach (Camera val34 in allCameras) { Log.LogInfo((object)$"[DGL] cam: {((Object)val34).name} clear={val34.clearFlags} far={val34.farClipPlane} fov={val34.fieldOfView} aspect={val34.aspect}"); } Log.LogInfo((object)("[DGL] skybox=" + (Object.op_Implicit((Object)(object)RenderSettings.skybox) ? ((Object)RenderSettings.skybox).name : "-"))); break; } case "geyser": { JumpVolume[] array13 = Object.FindObjectsOfType<JumpVolume>(); CharacterBody b = ((PlayerCharacterMasterController.instances.Count > 0) ? PlayerCharacterMasterController.instances[0].master.GetBody() : null); Log.LogInfo((object)$"[DGL] geyser: гейзеров {array13.Length}"); if (array13.Length == 0 || !Object.op_Implicit((Object)(object)b)) { break; } JumpVolume[] array14 = array13; foreach (JumpVolume pad in array14) { float t1 = ((StageBuilder.Current != null) ? StageBuilder.GroundY(((Component)pad).transform.position.x, ((Component)pad).transform.position.z, StageBuilder.Current) : float.NaN); TeleportHelper.TeleportBody(b, ((Component)pad).transform.position + Vector3.up * 1.2f, true); float y0 = ((Component)pad).transform.position.y; float maxY = y0; float tg = Time.realtimeSinceStartup; while (Time.realtimeSinceStartup - tg < 4f) { maxY = Mathf.Max(maxY, b.transform.position.y); yield return null; } ManualLogSource log7 = Log; object[] array15 = new object[7]; Transform parent2 = ((Component)pad).transform.parent; array15[0] = ((parent2 != null) ? ((Object)parent2).name : null); array15[1] = ((Object)pad).name; array15[2] = y0; array15[3] = t1; array15[4] = pad.jumpVelocity.y; array15[5] = maxY; array15[6] = maxY - y0; log7.LogInfo((object)string.Format("[DGL] geyser: {0}/{1} на высоте {2:0.0} (земля {3:0.0}), скорость {4:0}, герой поднялся до {5:0.0} (на {6:0.0} м)", array15)); } break; } case "cavetest": { CharacterBody b = ((PlayerCharacterMasterController.instances.Count > 0) ? PlayerCharacterMasterController.instances[0].master.GetBody() : null); if (!Object.op_Implicit((Object)(object)b)) { break; } int num5 = 0; int vinesAll = 0; VineShortcut[] array4 = Object.FindObjectsOfType<VineShortcut>(); foreach (VineShortcut vs in array4) { vinesAll++; TeleportHelper.TeleportBody(b, ((Component)vs).transform.position, true); float tg = Time.realtimeSinceStartup; while (Time.realtimeSinceStartup - tg < 1f) { yield return null; } bool flag2 = Object.op_Implicit((Object)(object)vs.launcher) && vs.launcher.activeSelf && Object.op_Implicit((Object)(object)vs.hanging) && vs.hanging.activeSelf; if (flag2) { num5++; } Log.LogInfo((object)string.Format("[DGL] cavetest: лиана у {0} -> {1}", ((Component)vs).transform.position, flag2 ? "сброшена" : "НЕ сработала")); } int aimOk = 0; int aimAll = 0; ShroomBounce[] array5 = Object.FindObjectsOfType<ShroomBounce>(); foreach (ShroomBounce sb in array5) { if (sb.hasAim && aimAll < 10) { aimAll++; TeleportHelper.TeleportBody(b, ((Component)sb).transform.position + Vector3.up * 1.4f, true); if (Object.op_Implicit((Object)(object)b.characterMotor)) { b.characterMotor.velocity = Vector3.zero; } if (Object.op_Implicit((Object)(object)b.inputBank)) { b.inputBank.moveVector = Vector3.zero; } float tg = Time.realtimeSinceStartup; float maxY = 0f; while (Time.realtimeSinceStartup - tg < 7f) { maxY = Mathf.Max(maxY, b.footPosition.y); yield return null; } Vector3 footPosition = b.footPosition; float num7 = Vector2.Distance(new Vector2(footPosition.x, footPosition.z), new Vector2(sb.aim.x, sb.aim.z)); bool flag3 = footPosition.y > sb.aim.y - 2f && num7 < 4f; if (flag3) { aimOk++; } Log.LogInfo((object)string.Format("[DGL] cavetest: бросок с {0} в {1}: макс {2:0.0}, конец {3} (мимо на {4:0.0} м) -> {5}", ((Component)sb).transform.position, sb.aim, maxY, footPosition, num7, flag3 ? "ДОЛЕТЕЛ" : "мимо")); } } int puffOk = 0; int puffAll = 0; SporePuff[] array6 = Object.FindObjectsOfType<SporePuff>(); foreach (SporePuff puff in array6) { if (puffAll >= 2) { break; } puffAll++; TeleportHelper.TeleportBody(b, ((Component)puff).transform.position + new Vector3(3f, 0.5f, 0f), true); float maxY = Time.realtimeSinceStartup; bool got = false; while (Time.realtimeSinceStartup - maxY < 24f) { if (b.HasBuff(Buffs.Cloak)) { got = true; break; } yield return null; } if (got) { puffOk++; } Log.LogInfo((object)string.Format("[DGL] cavetest: дождевик у {0} -> {1}", ((Component)puff).transform.position, got ? "невидимость есть" : "НЕТ невидимости")); } Log.LogInfo((object)$"[DGL] cavetest: итог - лиан {num5}/{vinesAll}, бросков в цель {aimOk}/{aimAll}, споры {puffOk}/{puffAll}"); break; } case "shroomtest": { CharacterBody b = ((PlayerCharacterMasterController.instances.Count > 0) ? PlayerCharacterMasterController.instances[0].master.GetBody() : null); ShroomInfo[] array25 = Object.FindObjectsOfType<ShroomInfo>(); if (!Object.op_Implicit((Object)(object)b) || array25.Length == 0) { Log.LogWarning((object)"[DGL] shroomtest: нет грибов"); break; } int puffAll = 0; int puffOk = 0; int aimAll = 0; int aimOk = 0; ShroomInfo[] array26 = array25; foreach (ShroomInfo inf in array26) { bool got = inf.step; if (got ? (puffAll >= 8) : (aimAll >= 6)) { continue; } if (got) { puffAll++; ((Vector3)(ref val72))..ctor(inf.cap.x, inf.top + 1.2f, inf.cap.z); } else { aimAll++; ((Vector3)(ref val72))..ctor(inf.cap.x + inf.r * 0.95f, inf.top + 1.5f, inf.cap.z); } TeleportHelper.TeleportBody(b, val72, true); if (Object.op_Implicit((Object)(object)b.characterMotor)) { b.characterMotor.velocity = Vector3.zero; } float maxY = val72.y; float tg = Time.realtimeSinceStartup; float y0 = (got ? 5f : 1.5f); while (Time.realtimeSinceStartup - tg < y0) { maxY = Mathf.Max(maxY, b.footPosition.y); if (got && Object.op_Implicit((Object)(object)b.inputBank)) { Vector3 val73 = inf.target - b.footPosition; val73.y = 0f; b.inputBank.moveVector = ((((Vector3)(ref val73)).magnitude > 0.6f) ? ((Vector3)(ref val73)).normalized : Vector3.zero); } yield return null; } if (Object.op_Implicit((Object)(object)b.inputBank)) { b.inputBank.moveVector = Vector3.zero; } Vector3 footPosition4 = b.footPosition; Vector3 val74 = (got ? inf.target : inf.cap); float num55 = (got ? inf.targetTop : inf.top); float num56 = (got ? inf.targetR : inf.r); float num57 = Vector2.Distance(new Vector2(footPosition4.x, footPosition4.z), new Vector2(val74.x, val74.z)); bool flag10 = footPosition4.y > num55 - 1.5f && num57 < num56 * 1.2f; if (got && flag10) { puffOk++; } if (!got && flag10) { aimOk++; } Log.LogInfo((object)string.Format("[DGL] shroomtest: {0} {1} верх {2:0.0} -> цель верх {3:0.0}: макс {4:0.0}, конец {5} (от центра цели {6:0.0} м) -> {7}", got ? "ступенька" : "край", ((Object)inf).name, inf.top, num55, maxY, footPosition4, num57, flag10 ? "НА ЦЕЛИ" : "мимо")); } Log.LogInfo((object)$"[DGL] shroomtest: итог - со ступеньки на следующую шляпку {puffOk} из {puffAll}, край держит {aimOk} из {aimAll}"); break; } case "shafttest": { CharacterBody b = ((PlayerCharacterMasterController.instances.Count > 0) ? PlayerCharacterMasterController.instances[0].master.GetBody() : null); if (!Object.op_Implicit((Object)(object)b)) { break; } world = LayerIndex.world; int wm = LayerMask.op_Implicit(((LayerIndex)(ref world)).mask); int num30 = 0; int num31 = 0; Dictionary<string, int> dictionary2 = new Dictionary<string, int>(); PurchaseInteraction[] array21 = Object.FindObjectsOfType<PurchaseInteraction>(); foreach (PurchaseInteraction val54 in array21) { num30++; string text7 = ((Object)val54).name.Replace("(Clone)", ""); dictionary2[text7] = ((!dictionary2.TryGetValue(text7, out var value3)) ? 1 : (value3 + 1)); if (Physics.Raycast(((Component)val54).transform.position + Vector3.up * 1.5f, Vector3.down, 4f, wm, (QueryTriggerInteraction)1)) { num31++; } else { Log.LogInfo((object)$"[DGL] shafttest: БЕЗ ПОЛА {text7} в {((Component)val54).transform.position}"); } } List<string> list6 = new List<string>(); foreach (KeyValuePair<string, int> item3 in dictionary2) { list6.Add(item3.Key + " x" + item3.Value); } Log.LogInfo((object)string.Format("[DGL] shafttest: покупок {0}, на полу {1}: {2}", num30, num31, string.Join(", ", list6))); int num32 = 0; int num33 = 0; foreach (Vector3 testMini in Shaft.TestMinis) { num32++; if (Physics.Raycast(testMini + Vector3.up * 3f, Vector3.down, ref val55, 4.2f, wm, (QueryTriggerInteraction)1) && ((RaycastHit)(ref val55)).point.y > testMini.y - 1.2f) { num33++; } } Log.LogInfo((object)$"[DGL] shafttest: мелких грибов {num32}, твёрдых {num33}"); int aimOk = 0; ShroomBounce[] array5 = Object.FindObjectsOfType<ShroomBounce>(); foreach (ShroomBounce sb in array5) { if (!sb.straightUp || aimOk >= 3) { continue; } aimOk++; Collider component3 = ((Component)sb).GetComponent<Collider>(); Vector3 val56; if (!Object.op_Implicit((Object)(object)component3)) { val56 = ((Component)sb).transform.position + Vector3.up * 3f; } else { bounds = component3.bounds; Vector3 center3 = ((Bounds)(ref bounds)).center; Vector3 up2 = Vector3.up; bounds = component3.bounds; val56 = center3 + up2 * (((Bounds)(ref bounds)).extents.y + 1.5f); } Vector3 top = val56; TeleportHelper.TeleportBody(b, top, true); if (Object.op_Implicit((Object)(object)b.characterMotor)) { b.characterMotor.velocity = Vector3.zero; } float y0 = top.y; float tg = Time.realtimeSinceStartup; Vector3 apexAt = top; while (Time.realtimeSinceStartup - tg < 5f) { if (b.footPosition.y > y0) { y0 = b.footPosition.y; apexAt = b.footPosition; } yield return null; } float num34 = Vector2.Distance(new Vector2(apexAt.x, apexAt.z), new Vector2(top.x, top.z)); Log.LogInfo((object)$"[DGL] shafttest: батут {((Object)sb).name} в {top}: подбросил на {y0 - top.y:0.0} м, унесло в сторону на {num34:0.0} м"); } if (aimOk == 0) { Log.LogInfo((object)"[DGL] shafttest: батутов 'вверх' нет"); } Vector3 S = Shaft.Spawn; u = Shaft.Axis(S.y) - S; u.y = 0f; ((Vector3)(ref u)).Normalize(); for (int aimAll = 0; aimAll < 2; aimAll++) { TeleportHelper.TeleportBody(b, S + Vector3.up * 1.2f, true); yield return (object)new WaitForSecondsRealtime(1.5f); Vector3 apexAt = ((aimAll == 0) ? u : (Quaternion.Euler(0f, 70f, 0f) * u)); float tg = Time.realtimeSinceStartup; float y0 = b.footPosition.y; Vector3 top = b.footPosition; while (Time.realtimeSinceStartup - tg < 12f && b.footPosition.y > y0 - 6f) { if (Object.op_Implicit((Object)(object)b.inputBank)) { b.inputBank.moveVector = apexAt; } if (Object.op_Implicit((Object)(object)b.characterMotor) && b.characterMotor.isGrounded) { top = b.footPosition; } yield return null; } if (Object.op_Implicit((Object)(object)b.inputBank)) { b.inputBank.moveVector = Vector3.zero; } bool got = b.footPosition.y <= y0 - 6f; float maxY = Time.realtimeSinceStartup; while (Time.realtimeSinceStartup - maxY < 14f && (!Object.op_Implicit((Object)(object)b.characterMotor) || !b.characterMotor.isGrounded || !(b.footPosition.y > -6f) || !(Time.realtimeSinceStartup - maxY > 2f))) { yield return null; } yield return (object)new WaitForSecondsRealtime(1f); Vector3 footPosition3 = b.footPosition; Log.LogInfo((object)string.Format("[DGL] shafttest: падение {0}: {1}, сошёл с {2}, вернуло в {3}, до края {4:0.0} м, до места схода {5:0.0} м, здоровье {6:0} из {7:0}", aimAll, got ? "упал" : "НЕ УПАЛ за 12 с", top, footPosition3, Edge(footPosition3), Vector3.Distance(footPosition3, top), b.healthComponent.health, b.healthComponent.fullHealth)); } break; } case "camshelf": { Vector3 spawn = Shaft.Spawn; Vector3 val45 = Shaft.Axis(spawn.y) - spawn; val45.y = 0f; ((Vector3)(ref val45)).Normalize(); Vector3 val46 = Vector3.Cross(Vector3.up, val45); Vector3 val47 = spawn + val45 * 15f - val46 * 15f; Vector3 val48 = spawn - val47; val48.y = 0f; ((Vector3)(ref val48)).Normalize(); ((Vector3)(ref val49))..ctor(0f - val48.z, 0f, val48.x); SetCamera(val47 + val48 * 12f - val49 * 14f + Vector3.up * 7f, val47 + val48 * 5f + Vector3.up * 8f); break; } case "mortal": godMode = false; foreach (PlayerCharacterMasterController instance5 in PlayerCharacterMasterController.instances) { CharacterBody val66 = (Object.op_Implicit((Object)(object)instance5.master) ? instance5.master.GetBody() : null); if (Object.op_Implicit((Object)(object)val66) && Object.op_Implicit((Object)(object)val66.healthComponent)) { val66.healthComponent.godMode = false; } } Log.LogInfo((object)"[DGL] бессмертие выключено"); break; case "tunneltest": { int num15 = 0; int num16 = 0; foreach (List<Vector3> tunnelPath in Shaft.TunnelPaths) { num15++; string text6 = null; for (int num17 = 0; num17 + 1 < tunnelPath.Count; num17++) { if (text6 != null) { break; } for (int num18 = 0; num18 < 6; num18++) { if (text6 != null) { break; } Vector3 val41 = Vector3.Lerp(tunnelPath[num17], tunnelPath[num17 + 1], (float)num18 / 6f); world = LayerIndex.world; Collider[] array17 = Physics.OverlapSphere(val41, 0.7f, LayerMask.op_Implicit(((LayerIndex)(ref world)).mask), (QueryTriggerInteraction)1); if (array17.Length != 0) { text6 = string.Format("{0} у {1}, отрезок {2} из {3}, точка {4}", ((Object)array17[0]).name, Object.op_Implicit((Object)(object)((Component)array17[0]).transform.parent) ? ((Object)((Component)array17[0]).transform.parent).name : "-", num17, tunnelPath.Count - 1, val41); } } } if (text6 == null) { num16++; } else { Log.LogInfo((object)$"[DGL] tunneltest: туннель {num15} ПЕРЕКРЫТ: {text6}"); } } Log.LogInfo((object)$"[DGL] tunneltest: свободно {num16} из {Shaft.TunnelPaths.Count}"); break; } case "tunnelwalk": { CharacterBody b = ((PlayerCharacterMasterController.instances.Count > 0) ? PlayerCharacterMasterController.instances[0].master.GetBody() : null); if (!Object.op_Implicit((Object)(object)b)) { break; } int aimOk = 0; int aimAll = 0; int puffOk = 0; foreach (List<Vector3> tp in Shaft.TunnelPaths) { aimOk++; for (int puffAll = 0; puffAll < 2; puffAll++) { puffOk++; int vinesAll = tp.Count / 2; int num5 = ((puffAll == 0) ? 1 : (-1)); int num6 = ((puffAll == 0) ? (tp.Count - 1) : 0); TeleportHelper.TeleportBody(b, tp[vinesAll], true); yield return (object)new WaitForSecondsRealtime(1.2f); int cur = vinesAll + num5; float maxY = Time.realtimeSinceStartup; while (Time.realtimeSinceStartup - maxY < 22f) { Vector3 val39 = tp[cur] - b.footPosition; val39.y = 0f; if (((Vector3)(ref val39)).magnitude < 1.6f) { if (cur == num6) { break; } cur += num5; } else { if (Object.op_Implicit((Object)(object)b.inputBank)) { b.inputBank.moveVector = ((Vector3)(ref val39)).normalized; } yield return null; } } if (Object.op_Implicit((Object)(object)b.inputBank)) { b.inputBank.moveVector = Vector3.zero; } Vector3 val40 = tp[num6] - b.footPosition; val40.y = 0f; bool flag6 = cur == num6 && ((Vector3)(ref val40)).magnitude < 2.5f; if (flag6) { aimAll++; } Log.LogInfo((object)string.Format("[DGL] tunnelwalk: туннель {0} {1}: {2}, встал в {3}, до выхода {4:0.0} м, точка {5} из {6}", aimOk, (puffAll == 0) ? "вверх" : "вниз", flag6 ? "вышел" : "НЕ ВЫШЕЛ", b.footPosition, ((Vector3)(ref val40)).magnitude, cur, tp.Count - 1)); } } Log.LogInfo((object)$"[DGL] tunnelwalk: вышел {aimAll} из {puffOk}"); break; } case "catchertest": { CharacterBody b = ((PlayerCharacterMasterController.instances.Count > 0) ? PlayerCharacterMasterController.instances[0].master.GetBody() : null); if (!Object.op_Implicit((Object)(object)b)) { break; } int puffOk = 0; ShaftCatcher[] array28 = Object.FindObjectsOfType<ShaftCatcher>(); foreach (ShaftCatcher sc in array28) { if (puffOk >= 2) { break; } puffOk++; u = ((Component)sc).transform.position + Vector3.up * 14f; TeleportHelper.TeleportBody(b, u, true); if (Object.op_Implicit((Object)(object)b.characterMotor)) { b.characterMotor.velocity = Vector3.zero; } float maxY = Time.realtimeSinceStartup; float y0 = -999f; bool got = false; Vector3 S = u; while (Time.realtimeSinceStartup - maxY < 6f) { if (b.footPosition.y < ((Component)sc).transform.position.y + 3f) { got = true; } if (got) { y0 = Mathf.Max(y0, b.footPosition.y); } S = b.footPosition; yield return null; } val20 = new Vector2(S.x - u.x, S.z - u.z); float magnitude = ((Vector2)(ref val20)).magnitude; Log.LogInfo((object)string.Format("[DGL] catchertest: гриб на {0:0} м: {1}, подбросило до {2:0.0} м, через 6 с герой в {3}, по земле от гриба {4:0.0} м -> {5}", ((Component)sc).transform.position.y, got ? "коснулся" : "НЕ КОСНУЛСЯ", y0, S, magnitude, (magnitude < 25f) ? "остался у гриба (телепорта нет)" : "ПЕРЕНЕСЛО")); } break; } case "groups": { for (int num14 = 1; num14 <= 5; num14++) { SceneCollection val36 = Addressables.LoadAssetAsync<SceneCollection>((object)$"RoR2/Base/SceneGroups/sgStage{num14}.asset").WaitForCompletion(); List<string> list = new List<string>(); if (Object.op_Implicit((Object)(object)val36)) { Enumerator<SceneEntry> enumerator2 = val36.sceneEntries.GetEnumerator(); try { while (enumerator2.MoveNext()) { SceneEntry current3 = enumerator2.Current; list.Add(Object.op_Implicit((Object)(object)current3.sceneDef) ? current3.sceneDef.cachedName : "-"); } } finally { ((IDisposable)enumerator2/*cast due to .constrained prefix*/).Dispose(); } } Log.LogInfo((object)string.Format("[DGL] groups: этап {0}: {1}", num14, string.Join(", ", list))); } SceneDef mostRecentSceneDef = SceneCatalog.mostRecentSceneDef; if (Object.op_Implicit((Object)(object)mostRecentSceneDef) && Object.op_Implicit((Object)(object)mostRecentSceneDef.destinationsGroup)) { List<string> list2 = new List<string>(); Enumerator<SceneEntry> enumerator2 = mostRecentSceneDef.destinationsGroup.sceneEntries.GetEnumerator(); try { while (enumerator2.MoveNext()) { SceneEntry current4 = enumerator2.Current; list2.Add(Object.op_Implicit((Object)(object)current4.sceneDef) ? current4.sceneDef.cachedName : "-"); } } finally { ((IDisposable)enumerator2/*cast due to .constrained prefix*/).Dispose(); } Log.LogInfo((object)("[DGL] groups: после " + mostRecentSceneDef.cachedName + ": " + string.Join(", ", list2))); } ClassicStageInfo instance = ClassicStageInfo.instance; if (Object.op_Implicit((Object)(object)instance)) { Log.LogInfo((object)$"[DGL] groups: награды на этапе {instance.sceneDirectorInteractibleCredits}"); } break; } case "pondtest": { WorldData d = StageBuilder.Current; CharacterBody b = ((PlayerCharacterMasterController.instances.Count > 0) ? PlayerCharacterMasterController.instances[0].master.GetBody() : null); if (d == null || !Object.op_Implicit((Object)(object)b) || d.liquid != "water") { Log.LogWarning((object)"[DGL] pondtest: нет воды"); break; } int puffOk = 0; int aimAll = 0; for (int aimOk = 0; aimOk < 4000; aimOk++) { if (puffOk >= 5) { break; } float y0 = 50f + (float)(aimOk * 37 % 300); float maxY = 50f + (float)(aimOk * 91 % 300); float tg = StageBuilder.GroundY(y0, maxY, d); if (!(tg > d.liquidLevel - 1.2f)) { puffOk++; Vector3 S = new Vector3(y0, tg + 0.5f, maxY); TeleportHelper.TeleportBody(b, S, true); yield return (object)new WaitForSecondsRealtime(3f); float num60 = Vector3.Distance(b.footPosition, S); if (num60 < 4f) { aimAll++; } Log.LogInfo((object)string.Format("[DGL] pondtest: дно {0:0.0} (вода {1:0.0}) у ({2:0}, {3:0}): через 3 с сдвиг {4:0.0} м -> {5}", tg, d.liquidLevel, y0, maxY, num60, (num60 < 4f) ? "в воде" : "ВЫКИНУЛО")); } } Log.LogInfo((object)$"[DGL] pondtest: итог - осталось в воде {aimAll} из {puffOk}"); break; } case "seed": Plugin.TestSeed = int.Parse(arg); Log.LogInfo((object)("[DGL] мир для проверки: " + arg)); break; case "probe": { string[] v2 = arg.Split(' '); Vector3 val79 = new Vector3(P2(0), P2(1), P2(2)); float num59 = P2(3); world = LayerIndex.world; Collider[] array8 = Physics.OverlapSphere(val79, num59, LayerMask.op_Implicit(((LayerIndex)(ref world)).mask), (QueryTriggerInteraction)1); foreach (Collider val80 in array8) { ManualLogSource log12 = Log; object[] obj9 = new object[5] { ((Object)val80).name, ((object)val80).GetType().Name, null, null, null }; Transform parent3 = ((Component)val80).transform.parent; obj9[2] = ((parent3 != null) ? ((Object)parent3).name : null); bounds = val80.bounds; obj9[3] = ((Bounds)(ref bounds)).min; bounds = val80.bounds; obj9[4] = ((Bounds)(ref bounds)).max; log12.LogInfo((object)string.Format("[DGL] probe: {0} ({1}) у {2}, границы {3} - {4}", obj9)); } break; } case "stuckdebug": Unstuck.Debug = true; break; case "escape": { string[] v = arg.Split(' '); Vector3 S = new Vector3(P(0), P(1), P(2)); CharacterBody b = PlayerCharacterMasterController.instances[0].master.GetBody(); Autopilot = true; int aimAll = 0; for (int puffOk = 0; puffOk < 8; puffOk++) { TeleportHelper.TeleportBody(b, S, false); yield return (object)new WaitForSecondsRealtime(0.8f); u = b.footPosition; Vector3 top = new Vector3(Mathf.Cos((float)puffOk * MathF.PI / 4f), 0f, Mathf.Sin((float)puffOk * MathF.PI / 4f)); float tg = Time.time; while (Time.time - tg < 3f) { b.inputBank.moveVector = top; b.inputBank.aimDirection = top; ((ButtonState)(ref b.inputBank.jump)).PushState((int)((Time.time - tg) * 2f) % 2 == 0); yield return (object)new WaitForFixedUpdate(); } b.inputBank.moveVector = Vector3.zero; ((ButtonState)(ref b.inputBank.jump)).PushState(false); float num53 = Vector3.Distance(b.footPosition, u); if (num53 > 4f) { aimAll++; } Log.LogInfo((object)$"[DGL] escape: сторона {puffOk * 45}°: ушёл на {num53:0.0} м, теперь {b.footPosition}, на земле {b.characterMotor.isGrounded}"); } Autopilot = false; Log.LogInfo((object)$"[DGL] escape: ушёл в {aimAll} сторон из 8"); break; } case "traitsoff": WorldTraits.Enabled = false; Log.LogInfo((object)"[DGL] особенности миров выключены"); break; case "traitson": WorldTraits.Enabled = true; break; case "extraoff": StructuresAdapter.ExtraOn = false; Log.LogInfo((object)"[DGL] твёрдые балки выключены"); break; case "extraon": StructuresAdapter.ExtraOn = true; break; case "monsters": { ClassicStageInfo instance3 = ClassicStageInfo.instance; List<string> list3 = new List<string>(); if ((Object)(object)instance3 != (Object)null && instance3.monsterSelection != null) { for (int num19 = 0; num19 < instance3.monsterSelection.Count; num19++) { DirectorCard value = instance3.monsterSelection.GetChoice(num19).value; if (value != null && Object.op_Implicit((Object)(object)value.spawnCard)) { list3.Add(((Object)value.spawnCard).name.Replace("csc", "")); } } } ManualLogSource log9 = Log; activeScene = SceneManager.GetActiveScene(); log9.LogInfo((object)string.Format("[DGL] monsters: {0} набор ({1}): {2}", ((Scene)(ref activeScene)).name, list3.Count, string.Join(", ", list3))); Dictionary<string, int> dictionary = new Dictionary<string, int>(); foreach (CharacterBody readOnlyInstances in CharacterBody.readOnlyInstancesList) { if (Object.op_Implicit((Object)(object)readOnlyInstances) && Object.op_Implicit((Object)(object)readOnlyInstances.teamComponent) && (int)readOnlyInstances.teamComponent.teamIndex == 2) { dictionary.TryGetValue(((Object)readOnlyInstances).name, out var value2); dictionary[((Object)readOnlyInstances).name] = value2 + 1; } } List<string> list4 = new List<string>(); foreach (KeyValuePair<string, int> item4 in dictionary) { list4.Add(item4.Key.Replace("(Clone)", "") + " x" + item4.Value); } Log.LogInfo((object)("[DGL] monsters: живы сейчас: " + string.Join(", ", list4))); break; } case "trait": { CharacterBody b = ((PlayerCharacterMasterController.instances.Count > 0) ? PlayerCharacterMasterController.instances[0].master.GetBody() : null); WorldData d = StageBuilder.Current; if (!Object.op_Implicit((Object)(object)b) || d == null) { break; } WorldTraits.TraitRunner runner = Object.FindObjectOfType<WorldTraits.TraitRunner>(); Log.LogInfo((object)$"[DGL] trait: {d.title}, зон {(Object.op_Implicit((Object)(object)runner) ? runner.zones.Count : 0)}, разгон героя {b.acceleration:0}, тяжесть {Physics.gravity.y:0.0}"); if (Object.op_Implicit((Object)(object)runner) && runner.zones.Count > 0) { WorldTraits.Zone z = runner.zones[0]; b.healthComponent.Networkhealth = b.healthComponent.fullHealth * 0.4f; float tg = b.healthComponent.health; TeleportHelper.TeleportBody(b, z.center + Vector3.up * 1f, true); yield return (object)new WaitForSecondsRealtime(2f); Log.LogInfo((object)$"[DGL] trait: в зоне {z.kind}: замедлен={b.HasBuff(Buffs.Slow50)}, здоровье {tg:0} -> {b.healthComponent.health:0} из {b.healthComponent.fullHealth:0}"); } if (Object.op_Implicit((Object)(object)runner) && !float.IsNaN(runner.mireLevel)) { Vector3 zero = Vector3.zero; bool flag7 = false; for (int num26 = 0; num26 < 4000; num26++) { if (flag7) { break; } float num27 = Random.Range(40f, 520f); float num28 = Random.Range(40f, 520f); float num29 = StageBuilder.GroundY(num27, num28, d); if (num29 < runner.mireLevel - 0.6f && num29 > runner.mireLevel - 1.6f) { ((Vector3)(ref zero))..ctor(num27, num29 + 0.5f, num28); flag7 = true;
plugins/DeadGodLocations/DeadGodLocations.Gen.dll
Decompiled 34 minutes ago
The result has been truncated due to the large size, download it to view full contents!
using System; 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 Microsoft.CodeAnalysis; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("DeadGodLocations.Gen")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+e6165f6fae17311965941a047e30de40aad4c311")] [assembly: AssemblyProduct("DeadGodLocations.Gen")] [assembly: AssemblyTitle("DeadGodLocations.Gen")] [assembly: AssemblyVersion("1.0.0.0")] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [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 DeadGodLocations.Gen { public sealed class AStar2D { private sealed class Point { public int id; public V2 pos; public float weight; public bool enabled = true; public List<int> neighbors = new List<int>(8); public Point prev; public ulong openPass; public ulong closedPass; public float g; public float f; public float absG; public float absF; public int heapIdx; } private Point[] _points = new Point[16]; private ulong _pass = 1uL; private readonly List<Point> _open = new List<Point>(1024); public void ReserveSpace(int n) { if (_points.Length < n) { Array.Resize(ref _points, n); } } public void AddPoint(int id, V2 pos, double weight) { if (id >= _points.Length) { Array.Resize(ref _points, Math.Max(id + 1, _points.Length * 2)); } Point point = _points[id]; if (point == null) { _points[id] = new Point { id = id, pos = pos, weight = (float)weight }; } else { point.pos = pos; point.weight = (float)weight; } } public void SetPointDisabled(int id, bool disabled) { _points[id].enabled = !disabled; } public V2 GetPointPosition(int id) { return _points[id].pos; } public void ConnectPoints(int a, int b) { Point point = _points[a]; Point point2 = _points[b]; if (!point.neighbors.Contains(b)) { point.neighbors.Add(b); } if (!point2.neighbors.Contains(a)) { point2.neighbors.Add(a); } } public bool ArePointsConnected(int a, int b) { return _points[a].neighbors.Contains(b); } public List<int> Connections(int id) { return new List<int>(_points[id].neighbors); } private static float Dist(V2 a, V2 b) { float num = b.x - a.x; float num2 = b.y - a.y; float num3 = num * num; float num4 = num2 * num2; return GD.Sqrtf(num3 + num4 + 0f); } private static bool Worse(Point A, Point B) { if (A.f > B.f) { return true; } if (A.f < B.f) { return false; } return A.g < B.g; } private static void Set(List<Point> arr, int i, Point v) { arr[i] = v; v.heapIdx = i; } private static void PushHeap(int first, int hole, int top, Point value, List<Point> arr) { int num = (hole - 1) / 2; while (hole > top && Worse(arr[first + num], value)) { Set(arr, first + hole, arr[first + num]); hole = num; num = (hole - 1) / 2; } Set(arr, first + hole, value); } private static void AdjustHeap(int first, int hole, int len, Point value, List<Point> arr) { int top = hole; int num; for (num = 2 * hole + 2; num < len; num = 2 * (num + 1)) { if (Worse(arr[first + num], arr[first + (num - 1)])) { num--; } Set(arr, first + hole, arr[first + num]); hole = num; } if (num == len) { Set(arr, first + hole, arr[first + (num - 1)]); hole = num - 1; } PushHeap(first, hole, top, value, arr); } private static void PopHeap(int first, int last, List<Point> arr) { Point value = arr[last - 1]; arr[last - 1] = arr[first]; AdjustHeap(first, 0, last - 1 - first, value, arr); } private bool Solve(Point begin, Point end) { _pass++; if (!end.enabled) { return false; } bool result = false; List<Point> open = _open; open.Clear(); begin.g = 0f; begin.f = Dist(begin.pos, end.pos); begin.absG = 0f; begin.absF = Dist(begin.pos, end.pos); open.Add(begin); begin.heapIdx = 0; while (open.Count > 0) { Point point = open[0]; if (point == end) { result = true; break; } PopHeap(0, open.Count, open); open.RemoveAt(open.Count - 1); point.closedPass = _pass; List<int> neighbors = point.neighbors; for (int i = 0; i < neighbors.Count; i++) { Point point2 = _points[neighbors[i]]; if (point2.enabled && point2.closedPass != _pass) { float num = GD.FmaF(Dist(point.pos, point2.pos), point2.weight, point.g); bool flag = false; if (point2.openPass != _pass) { point2.openPass = _pass; open.Add(point2); point2.heapIdx = open.Count - 1; flag = true; } else if (num >= point2.g) { continue; } point2.prev = point; point2.g = num; point2.f = point2.g + Dist(point2.pos, end.pos); point2.absG = num; point2.absF = point2.f - point2.g; if (flag) { PushHeap(0, open.Count - 1, 0, point2, open); } else { PushHeap(0, point2.heapIdx, 0, point2, open); } } } } return result; } public List<int> GetIdPath(int from, int to) { Point point = _points[from]; Point point2 = _points[to]; List<int> list = new List<int>(); if (point == point2) { list.Add(point.id); return list; } if (!point.enabled) { return list; } if (!Solve(point, point2)) { return list; } for (Point point3 = point2; point3 != point; point3 = point3.prev) { list.Add(point3.id); } list.Add(point.id); list.Reverse(); return list; } } public static class Cliffs { private sealed class Seg { public (int x, int y) K1; public (int x, int y) K2; public double H; public double Low; public V2 Out; public int Idx; public int O; } public const double MIN_DROP = 3.5; private const int N = 281; private const double STEP = 2.0; private static readonly (int x, int y)[] Offs = new(int, int)[4] { (1, 0), (-1, 0), (0, 1), (0, -1) }; public static void Prepare(LocationData data) { data.CliffCells = new byte[78961]; data.CliffChains = Chains(data); } private static List<List<double[]>> Chains(LocationData data) { double b = ((data.Liquid != "none") ? (data.LiquidLevel - 1.5) : (-1000000000.0)); List<(V2, double)> list = new List<(V2, double)>(); List<(V2, V2, double)> list2 = new List<(V2, V2, double)>(); foreach (Tunnel tunnel in data.Tunnels) { list2.Add((tunnel.A, tunnel.B, tunnel.Half + 2.5)); } foreach (Fall fall in data.Falls) { list.Add((new V2(fall.Top.x, fall.Top.z), fall.Width * 0.5 + 2.0)); } foreach (V3 floorSpot in data.FloorSpots) { list.Add((new V2(floorSpot.x, floorSpot.z), 8.0)); } list.Add((data.Altar, 14.0)); List<Seg> list3 = new List<Seg>(); Dictionary<(int, int), List<int>> dictionary = new Dictionary<(int, int), List<int>>(); float[] heights = data.Heights; for (int i = 1; i < 280; i++) { for (int j = 1; j < 280; j++) { int num = i * 281 + j; double num2 = heights[num]; (int, int)[] offs = Offs; for (int k = 0; k < offs.Length; k++) { (int, int) tuple = offs[k]; int num3 = (i + tuple.Item2) * 281 + (j + tuple.Item1); double num4 = GD.maxf(heights[num3], b); if (num2 - num4 < 3.5 || data.Deck[num] == 1 || data.Deck[num3] == 1) { continue; } V2 v = new V2(((double)j + (double)tuple.Item1 * 0.5) * 2.0, ((double)i + (double)tuple.Item2 * 0.5) * 2.0); bool flag = false; foreach (var item in list2) { if ((double)Geometry2D.ClosestPointToSegment(v, item.Item1, item.Item2).DistanceTo(v) < item.Item3) { flag = true; } } foreach (var item2 in list) { if ((double)v.DistanceTo(item2.Item1) < item2.Item2) { flag = true; break; } } if (flag) { continue; } (int, int) tuple2 = (2 * j + tuple.Item1, 2 * i + tuple.Item2); (int, int) tuple3 = ((tuple.Item1 != 0) ? (0, 1) : (1, 0)); (int, int) tuple4 = (tuple2.Item1 - tuple3.Item1, tuple2.Item2 - tuple3.Item2); (int, int) tuple5 = (tuple2.Item1 + tuple3.Item1, tuple2.Item2 + tuple3.Item2); int count = list3.Count; list3.Add(new Seg { K1 = tuple4, K2 = tuple5, H = num2, Low = num4, Out = new V2(tuple.Item1, tuple.Item2), Idx = num, O = num3 }); (int, int)[] array = new(int, int)[2] { tuple4, tuple5 }; foreach ((int, int) key in array) { if (!dictionary.TryGetValue(key, out var value)) { value = (dictionary[key] = new List<int>()); } value.Add(count); } } } } byte[] array2 = new byte[list3.Count]; List<List<double[]>> list5 = new List<List<double[]>>(); List<int> list6 = new List<int>(); for (int m = 0; m < list3.Count; m++) { if (array2[m] == 1) { continue; } array2[m] = 1; List<int> list7 = new List<int> { m }; for (int n = 0; n < 2; n++) { int num5 = m; (int, int) tuple6 = ((n == 0) ? list3[m].K2 : list3[m].K1); while (true) { List<int> value2; List<int> obj = (dictionary.TryGetValue(tuple6, out value2) ? value2 : list6); int num6 = -1; double num7 = 3.0; foreach (int item3 in obj) { if (item3 != num5 && array2[item3] != 1) { double num8 = Math.Abs(list3[item3].H - list3[num5].H) + 0.5 * Math.Abs(list3[item3].Low - list3[num5].Low); if (num8 < num7) { num7 = num8; num6 = item3; } } } if (num6 < 0) { break; } array2[num6] = 1; if (n == 0) { list7.Add(num6); } else { list7.Insert(0, num6); } num5 = num6; (int, int) k2 = list3[num6].K1; (int, int) tuple7 = tuple6; tuple6 = ((k2.Item1 == tuple7.Item1 && k2.Item2 == tuple7.Item2) ? list3[num6].K2 : list3[num6].K1); } } List<double[]> list8 = new List<double[]>(); if (list7.Count == 1) { Seg seg = list3[list7[0]]; Cover(data, seg.Idx, seg.O); (int, int)[] offs = new(int, int)[2] { seg.K1, seg.K2 }; for (int k = 0; k < offs.Length; k++) { (int, int) tuple8 = offs[k]; V2 v2 = new V2(tuple8.Item1, tuple8.Item2) * 2.0 * 0.5; list8.Add(new double[6] { v2.x, v2.y, seg.H, seg.Low, seg.Out.x, seg.Out.y }); } list7.Clear(); } foreach (int item4 in list7) { Seg seg2 = list3[item4]; Cover(data, seg2.Idx, seg2.O); V2 v3 = (new V2(seg2.K1.x, seg2.K1.y) + new V2(seg2.K2.x, seg2.K2.y)) * 0.5 * 2.0 * 0.5; list8.Add(new double[6] { v3.x, v3.y, seg2.H, seg2.Low, seg2.Out.x, seg2.Out.y }); } List<double[]> list9 = Smooth(Smooth(list8)); for (int num9 = 0; num9 < 2; num9++) { double[] array3 = ((num9 == 0) ? list9[0] : list9[list9.Count - 1]); double[] array4 = ((num9 == 0) ? list9[1] : list9[list9.Count - 2]); V2 v4 = new V2(array3[0] - array4[0], array3[1] - array4[1]).Normalized() * 2.4; double[] array5 = (double[])array3.Clone(); array5[0] = array3[0] + (double)v4.x; array5[1] = array3[1] + (double)v4.y; if (num9 == 0) { list9.Insert(0, array5); } else { list9.Add(array5); } } list5.Add(list9); } return list5; } private static void Cover(LocationData data, int a, int b) { int num = Math.Min(a, b); data.CliffCells[num] |= (byte)((Math.Abs(a - b) == 1) ? 1 : 2); } private static List<double[]> Smooth(List<double[]> chain) { if (chain.Count < 3) { return chain; } List<double[]> list = new List<double[]>(chain.Count * 2) { chain[0] }; for (int i = 0; i < chain.Count - 1; i++) { double[] array = chain[i]; double[] array2 = chain[i + 1]; double[] array3 = new double[array.Length]; double[] array4 = new double[array.Length]; for (int j = 0; j < array.Length; j++) { array3[j] = GD.lerpf(array[j], array2[j], 0.25); array4[j] = GD.lerpf(array[j], array2[j], 0.75); } list.Add(array3); list.Add(array4); } list.Add(chain[chain.Count - 1]); return list; } } internal class FastNoiseLite { public enum NoiseType { OpenSimplex2, OpenSimplex2S, Cellular, Perlin, ValueCubic, Value } public enum RotationType3D { None, ImproveXYPlanes, ImproveXZPlanes } public enum FractalType { None, FBm, Ridged, PingPong, DomainWarpProgressive, DomainWarpIndependent } public enum CellularDistanceFunction { Euclidean, EuclideanSq, Manhattan, Hybrid } public enum CellularReturnType { CellValue, Distance, Distance2, Distance2Add, Distance2Sub, Distance2Mul, Distance2Div } public enum DomainWarpType { OpenSimplex2, OpenSimplex2Reduced, BasicGrid } private enum TransformType3D { None, ImproveXYPlanes, ImproveXZPlanes, DefaultOpenSimplex2 } private const short INLINE = 256; private const short OPTIMISE = 512; private int mSeed = 1337; private float mFrequency = 0.01f; private NoiseType mNoiseType; private RotationType3D mRotationType3D; private TransformType3D mTransformType3D = TransformType3D.DefaultOpenSimplex2; private FractalType mFractalType; private int mOctaves = 3; private float mLacunarity = 2f; private float mGain = 0.5f; private float mWeightedStrength; private float mPingPongStrength = 2f; private float mFractalBounding = 0.5714286f; private CellularDistanceFunction mCellularDistanceFunction = CellularDistanceFunction.EuclideanSq; private CellularReturnType mCellularReturnType = CellularReturnType.Distance; private float mCellularJitterModifier = 1f; private DomainWarpType mDomainWarpType; private TransformType3D mWarpTransformType3D = TransformType3D.DefaultOpenSimplex2; private float mDomainWarpAmp = 1f; private static readonly float[] Gradients2D = new float[256] { 0.13052619f, 0.9914449f, 0.38268343f, 0.9238795f, 0.6087614f, 0.7933533f, 0.7933533f, 0.6087614f, 0.9238795f, 0.38268343f, 0.9914449f, 0.13052619f, 0.9914449f, -0.13052619f, 0.9238795f, -0.38268343f, 0.7933533f, -0.6087614f, 0.6087614f, -0.7933533f, 0.38268343f, -0.9238795f, 0.13052619f, -0.9914449f, -0.13052619f, -0.9914449f, -0.38268343f, -0.9238795f, -0.6087614f, -0.7933533f, -0.7933533f, -0.6087614f, -0.9238795f, -0.38268343f, -0.9914449f, -0.13052619f, -0.9914449f, 0.13052619f, -0.9238795f, 0.38268343f, -0.7933533f, 0.6087614f, -0.6087614f, 0.7933533f, -0.38268343f, 0.9238795f, -0.13052619f, 0.9914449f, 0.13052619f, 0.9914449f, 0.38268343f, 0.9238795f, 0.6087614f, 0.7933533f, 0.7933533f, 0.6087614f, 0.9238795f, 0.38268343f, 0.9914449f, 0.13052619f, 0.9914449f, -0.13052619f, 0.9238795f, -0.38268343f, 0.7933533f, -0.6087614f, 0.6087614f, -0.7933533f, 0.38268343f, -0.9238795f, 0.13052619f, -0.9914449f, -0.13052619f, -0.9914449f, -0.38268343f, -0.9238795f, -0.6087614f, -0.7933533f, -0.7933533f, -0.6087614f, -0.9238795f, -0.38268343f, -0.9914449f, -0.13052619f, -0.9914449f, 0.13052619f, -0.9238795f, 0.38268343f, -0.7933533f, 0.6087614f, -0.6087614f, 0.7933533f, -0.38268343f, 0.9238795f, -0.13052619f, 0.9914449f, 0.13052619f, 0.9914449f, 0.38268343f, 0.9238795f, 0.6087614f, 0.7933533f, 0.7933533f, 0.6087614f, 0.9238795f, 0.38268343f, 0.9914449f, 0.13052619f, 0.9914449f, -0.13052619f, 0.9238795f, -0.38268343f, 0.7933533f, -0.6087614f, 0.6087614f, -0.7933533f, 0.38268343f, -0.9238795f, 0.13052619f, -0.9914449f, -0.13052619f, -0.9914449f, -0.38268343f, -0.9238795f, -0.6087614f, -0.7933533f, -0.7933533f, -0.6087614f, -0.9238795f, -0.38268343f, -0.9914449f, -0.13052619f, -0.9914449f, 0.13052619f, -0.9238795f, 0.38268343f, -0.7933533f, 0.6087614f, -0.6087614f, 0.7933533f, -0.38268343f, 0.9238795f, -0.13052619f, 0.9914449f, 0.13052619f, 0.9914449f, 0.38268343f, 0.9238795f, 0.6087614f, 0.7933533f, 0.7933533f, 0.6087614f, 0.9238795f, 0.38268343f, 0.9914449f, 0.13052619f, 0.9914449f, -0.13052619f, 0.9238795f, -0.38268343f, 0.7933533f, -0.6087614f, 0.6087614f, -0.7933533f, 0.38268343f, -0.9238795f, 0.13052619f, -0.9914449f, -0.13052619f, -0.9914449f, -0.38268343f, -0.9238795f, -0.6087614f, -0.7933533f, -0.7933533f, -0.6087614f, -0.9238795f, -0.38268343f, -0.9914449f, -0.13052619f, -0.9914449f, 0.13052619f, -0.9238795f, 0.38268343f, -0.7933533f, 0.6087614f, -0.6087614f, 0.7933533f, -0.38268343f, 0.9238795f, -0.13052619f, 0.9914449f, 0.13052619f, 0.9914449f, 0.38268343f, 0.9238795f, 0.6087614f, 0.7933533f, 0.7933533f, 0.6087614f, 0.9238795f, 0.38268343f, 0.9914449f, 0.13052619f, 0.9914449f, -0.13052619f, 0.9238795f, -0.38268343f, 0.7933533f, -0.6087614f, 0.6087614f, -0.7933533f, 0.38268343f, -0.9238795f, 0.13052619f, -0.9914449f, -0.13052619f, -0.9914449f, -0.38268343f, -0.9238795f, -0.6087614f, -0.7933533f, -0.7933533f, -0.6087614f, -0.9238795f, -0.38268343f, -0.9914449f, -0.13052619f, -0.9914449f, 0.13052619f, -0.9238795f, 0.38268343f, -0.7933533f, 0.6087614f, -0.6087614f, 0.7933533f, -0.38268343f, 0.9238795f, -0.13052619f, 0.9914449f, 0.38268343f, 0.9238795f, 0.9238795f, 0.38268343f, 0.9238795f, -0.38268343f, 0.38268343f, -0.9238795f, -0.38268343f, -0.9238795f, -0.9238795f, -0.38268343f, -0.9238795f, 0.38268343f, -0.38268343f, 0.9238795f }; private static readonly float[] RandVecs2D = new float[512] { -0.2700222f, -0.9628541f, 0.38630927f, -0.9223693f, 0.04444859f, -0.9990117f, -0.59925234f, -0.80056024f, -0.781928f, 0.62336874f, 0.9464672f, 0.32279992f, -0.6514147f, -0.7587219f, 0.93784726f, 0.34704837f, -0.8497876f, -0.52712524f, -0.87904257f, 0.47674325f, -0.8923003f, -0.45144236f, -0.37984443f, -0.9250504f, -0.9951651f, 0.09821638f, 0.7724398f, -0.635088f, 0.75732833f, -0.6530343f, -0.9928005f, -0.119780056f, -0.05326657f, 0.99858034f, 0.97542536f, -0.22033007f, -0.76650184f, 0.64224213f, 0.9916367f, 0.12906061f, -0.99469686f, 0.10285038f, -0.53792053f, -0.8429955f, 0.50228155f, -0.86470413f, 0.45598215f, -0.8899889f, -0.8659131f, -0.50019443f, 0.08794584f, -0.9961253f, -0.5051685f, 0.8630207f, 0.7753185f, -0.6315704f, -0.69219446f, 0.72171104f, -0.51916593f, -0.85467345f, 0.8978623f, -0.4402764f, -0.17067741f, 0.98532695f, -0.935343f, -0.35374206f, -0.99924046f, 0.038967468f, -0.2882064f, -0.9575683f, -0.96638113f, 0.2571138f, -0.87597144f, -0.48236302f, -0.8303123f, -0.55729836f, 0.051101338f, -0.99869347f, -0.85583735f, -0.51724505f, 0.098870255f, 0.9951003f, 0.9189016f, 0.39448678f, -0.24393758f, -0.96979094f, -0.81214094f, -0.5834613f, -0.99104315f, 0.13354214f, 0.8492424f, -0.52800316f, -0.9717839f, -0.23587295f, 0.9949457f, 0.10041421f, 0.6241065f, -0.7813392f, 0.6629103f, 0.74869883f, -0.7197418f, 0.6942418f, -0.8143371f, -0.58039224f, 0.10452105f, -0.9945227f, -0.10659261f, -0.99430275f, 0.44579968f, -0.8951328f, 0.105547406f, 0.99441427f, -0.9927903f, 0.11986445f, -0.83343667f, 0.55261505f, 0.9115562f, -0.4111756f, 0.8285545f, -0.55990845f, 0.7217098f, -0.6921958f, 0.49404928f, -0.8694339f, -0.36523214f, -0.9309165f, -0.9696607f, 0.24445485f, 0.089255095f, -0.9960088f, 0.5354071f, -0.8445941f, -0.10535762f, 0.9944344f, -0.98902845f, 0.1477251f, 0.004856105f, 0.9999882f, 0.98855984f, 0.15082914f, 0.92861295f, -0.37104982f, -0.5832394f, -0.8123003f, 0.30152076f, 0.9534596f, -0.95751107f, 0.28839657f, 0.9715802f, -0.23671055f, 0.2299818f, 0.97319496f, 0.9557638f, -0.2941352f, 0.7409561f, 0.67155343f, -0.9971514f, -0.07542631f, 0.69057107f, -0.7232645f, -0.2907137f, -0.9568101f, 0.5912778f, -0.80646795f, -0.94545925f, -0.3257405f, 0.66644555f, 0.7455537f, 0.6236135f, 0.78173286f, 0.9126994f, -0.40863165f, -0.8191762f, 0.57354194f, -0.8812746f, -0.4726046f, 0.99533135f, 0.09651673f, 0.98556507f, -0.16929697f, -0.8495981f, 0.52743065f, 0.6174854f, -0.78658235f, 0.85081565f, 0.5254643f, 0.99850327f, -0.0546925f, 0.19713716f, -0.98037595f, 0.66078556f, -0.7505747f, -0.030974941f, 0.9995202f, -0.6731661f, 0.73949134f, -0.71950185f, -0.69449055f, 0.97275114f, 0.2318516f, 0.9997059f, -0.02425069f, 0.44217876f, -0.89692694f, 0.9981351f, -0.061043672f, -0.9173661f, -0.39804456f, -0.81500566f, -0.579453f, -0.87893313f, 0.476945f, 0.015860584f, 0.99987423f, -0.8095465f, 0.5870558f, -0.9165899f, -0.39982867f, -0.8023543f, 0.5968481f, -0.5176738f, 0.85557806f, -0.8154407f, -0.57884055f, 0.40220103f, -0.91555136f, -0.9052557f, -0.4248672f, 0.7317446f, 0.681579f, -0.56476325f, -0.825253f, -0.8403276f, -0.54207885f, -0.93142813f, 0.36392525f, 0.52381986f, 0.85182905f, 0.7432804f, -0.66898f, -0.9853716f, -0.17041974f, 0.46014687f, 0.88784283f, 0.8258554f, 0.56388193f, 0.6182366f, 0.785992f, 0.83315027f, -0.55304664f, 0.15003075f, 0.9886813f, -0.6623304f, -0.7492119f, -0.66859865f, 0.74362344f, 0.7025606f, 0.7116239f, -0.54193896f, -0.84041786f, -0.33886164f, 0.9408362f, 0.833153f, 0.55304253f, -0.29897207f, -0.95426184f, 0.2638523f, 0.9645631f, 0.12410874f, -0.9922686f, -0.7282649f, -0.6852957f, 0.69625f, 0.71779937f, -0.91835356f, 0.395761f, -0.6326102f, -0.7744703f, -0.9331892f, -0.35938552f, -0.11537793f, -0.99332166f, 0.9514975f, -0.30765656f, -0.08987977f, -0.9959526f, 0.6678497f, 0.7442962f, 0.79524004f, -0.6062947f, -0.6462007f, -0.7631675f, -0.27335986f, 0.96191186f, 0.966959f, -0.25493184f, -0.9792895f, 0.20246519f, -0.5369503f, -0.84361386f, -0.27003646f, -0.9628501f, -0.6400277f, 0.76835185f, -0.78545374f, -0.6189204f, 0.060059056f, -0.9981948f, -0.024557704f, 0.9996984f, -0.65983623f, 0.7514095f, -0.62538946f, -0.7803128f, -0.6210409f, -0.7837782f, 0.8348889f, 0.55041856f, -0.15922752f, 0.9872419f, 0.83676225f, 0.54756635f, -0.8675754f, -0.4973057f, -0.20226626f, -0.97933054f, 0.939919f, 0.34139755f, 0.98774046f, -0.1561049f, -0.90344554f, 0.42870283f, 0.12698042f, -0.9919052f, -0.3819601f, 0.92417884f, 0.9754626f, 0.22016525f, -0.32040158f, -0.94728184f, -0.9874761f, 0.15776874f, 0.025353484f, -0.99967855f, 0.4835131f, -0.8753371f, -0.28508f, -0.9585037f, -0.06805516f, -0.99768156f, -0.7885244f, -0.61500347f, 0.3185392f, -0.9479097f, 0.8880043f, 0.45983514f, 0.64769214f, -0.76190215f, 0.98202413f, 0.18875542f, 0.93572754f, -0.35272372f, -0.88948953f, 0.45695552f, 0.7922791f, 0.6101588f, 0.74838185f, 0.66326815f, -0.728893f, -0.68462765f, 0.8729033f, -0.48789328f, 0.8288346f, 0.5594937f, 0.08074567f, 0.99673474f, 0.97991484f, -0.1994165f, -0.5807307f, -0.81409574f, -0.47000498f, -0.8826638f, 0.2409493f, 0.9705377f, 0.9437817f, -0.33056942f, -0.89279985f, -0.45045355f, -0.80696225f, 0.59060305f, 0.062589735f, 0.99803936f, -0.93125975f, 0.36435598f, 0.57774496f, 0.81621736f, -0.3360096f, -0.9418586f, 0.69793206f, -0.71616393f, -0.0020081573f, -0.999998f, -0.18272944f, -0.98316324f, -0.6523912f, 0.7578824f, -0.43026268f, -0.9027037f, -0.9985126f, -0.054520912f, -0.010281022f, -0.99994713f, -0.49460712f, 0.86911666f, -0.299935f, 0.95395964f, 0.8165472f, 0.5772787f, 0.26974604f, 0.9629315f, -0.7306287f, -0.68277496f, -0.7590952f, -0.65097964f, -0.9070538f, 0.4210146f, -0.5104861f, -0.859886f, 0.86133504f, 0.5080373f, 0.50078815f, -0.8655699f, -0.6541582f, 0.7563578f, -0.83827555f, -0.54524684f, 0.6940071f, 0.7199682f, 0.06950936f, 0.9975813f, 0.17029423f, -0.9853933f, 0.26959732f, 0.9629731f, 0.55196124f, -0.83386976f, 0.2256575f, -0.9742067f, 0.42152628f, -0.9068162f, 0.48818734f, -0.87273884f, -0.3683855f, -0.92967314f, -0.98253906f, 0.18605645f, 0.81256473f, 0.582871f, 0.3196461f, -0.947537f, 0.9570914f, 0.28978625f, -0.6876655f, -0.7260276f, -0.9988771f, -0.04737673f, -0.1250179f, 0.9921545f, -0.82801336f, 0.56070834f, 0.93248636f, -0.36120513f, 0.63946533f, 0.7688199f, -0.016238471f, -0.99986815f, -0.99550146f, -0.094746135f, -0.8145332f, 0.580117f, 0.4037328f, -0.91487694f, 0.9944263f, 0.10543368f, -0.16247116f, 0.9867133f, -0.9949488f, -0.10038388f, -0.69953024f, 0.714603f, 0.5263415f, -0.85027325f, -0.5395222f, 0.8419714f, 0.65793705f, 0.7530729f, 0.014267588f, -0.9998982f, -0.6734384f, 0.7392433f, 0.6394121f, -0.7688642f, 0.9211571f, 0.38919085f, -0.14663722f, -0.98919034f, -0.7823181f, 0.6228791f, -0.5039611f, -0.8637264f, -0.774312f, -0.632804f }; private static readonly float[] Gradients3D = new float[256] { 0f, 1f, 1f, 0f, 0f, -1f, 1f, 0f, 0f, 1f, -1f, 0f, 0f, -1f, -1f, 0f, 1f, 0f, 1f, 0f, -1f, 0f, 1f, 0f, 1f, 0f, -1f, 0f, -1f, 0f, -1f, 0f, 1f, 1f, 0f, 0f, -1f, 1f, 0f, 0f, 1f, -1f, 0f, 0f, -1f, -1f, 0f, 0f, 0f, 1f, 1f, 0f, 0f, -1f, 1f, 0f, 0f, 1f, -1f, 0f, 0f, -1f, -1f, 0f, 1f, 0f, 1f, 0f, -1f, 0f, 1f, 0f, 1f, 0f, -1f, 0f, -1f, 0f, -1f, 0f, 1f, 1f, 0f, 0f, -1f, 1f, 0f, 0f, 1f, -1f, 0f, 0f, -1f, -1f, 0f, 0f, 0f, 1f, 1f, 0f, 0f, -1f, 1f, 0f, 0f, 1f, -1f, 0f, 0f, -1f, -1f, 0f, 1f, 0f, 1f, 0f, -1f, 0f, 1f, 0f, 1f, 0f, -1f, 0f, -1f, 0f, -1f, 0f, 1f, 1f, 0f, 0f, -1f, 1f, 0f, 0f, 1f, -1f, 0f, 0f, -1f, -1f, 0f, 0f, 0f, 1f, 1f, 0f, 0f, -1f, 1f, 0f, 0f, 1f, -1f, 0f, 0f, -1f, -1f, 0f, 1f, 0f, 1f, 0f, -1f, 0f, 1f, 0f, 1f, 0f, -1f, 0f, -1f, 0f, -1f, 0f, 1f, 1f, 0f, 0f, -1f, 1f, 0f, 0f, 1f, -1f, 0f, 0f, -1f, -1f, 0f, 0f, 0f, 1f, 1f, 0f, 0f, -1f, 1f, 0f, 0f, 1f, -1f, 0f, 0f, -1f, -1f, 0f, 1f, 0f, 1f, 0f, -1f, 0f, 1f, 0f, 1f, 0f, -1f, 0f, -1f, 0f, -1f, 0f, 1f, 1f, 0f, 0f, -1f, 1f, 0f, 0f, 1f, -1f, 0f, 0f, -1f, -1f, 0f, 0f, 1f, 1f, 0f, 0f, 0f, -1f, 1f, 0f, -1f, 1f, 0f, 0f, 0f, -1f, -1f, 0f }; private static readonly float[] RandVecs3D = new float[1024] { -0.7292737f, -0.66184396f, 0.17355819f, 0f, 0.7902921f, -0.5480887f, -0.2739291f, 0f, 0.7217579f, 0.62262124f, -0.3023381f, 0f, 0.5656831f, -0.8208298f, -0.079000026f, 0f, 0.76004905f, -0.55559796f, -0.33709997f, 0f, 0.37139457f, 0.50112647f, 0.78162545f, 0f, -0.12770624f, -0.4254439f, -0.8959289f, 0f, -0.2881561f, -0.5815839f, 0.7607406f, 0f, 0.5849561f, -0.6628202f, -0.4674352f, 0f, 0.33071712f, 0.039165374f, 0.94291687f, 0f, 0.8712122f, -0.41133744f, -0.26793817f, 0f, 0.580981f, 0.7021916f, 0.41156778f, 0f, 0.5037569f, 0.6330057f, -0.5878204f, 0f, 0.44937122f, 0.6013902f, 0.6606023f, 0f, -0.6878404f, 0.090188906f, -0.7202372f, 0f, -0.59589565f, -0.64693505f, 0.47579765f, 0f, -0.5127052f, 0.1946922f, -0.83619875f, 0f, -0.99115074f, -0.054102764f, -0.12121531f, 0f, -0.21497211f, 0.9720882f, -0.09397608f, 0f, -0.7518651f, -0.54280573f, 0.37424695f, 0f, 0.5237069f, 0.8516377f, -0.021078179f, 0f, 0.6333505f, 0.19261672f, -0.74951047f, 0f, -0.06788242f, 0.39983058f, 0.9140719f, 0f, -0.55386287f, -0.47298968f, -0.6852129f, 0f, -0.72614557f, -0.5911991f, 0.35099334f, 0f, -0.9229275f, -0.17828088f, 0.34120494f, 0f, -0.6968815f, 0.65112746f, 0.30064803f, 0f, 0.96080446f, -0.20983632f, -0.18117249f, 0f, 0.068171464f, -0.9743405f, 0.21450691f, 0f, -0.3577285f, -0.6697087f, -0.65078455f, 0f, -0.18686211f, 0.7648617f, -0.61649746f, 0f, -0.65416974f, 0.3967915f, 0.64390874f, 0f, 0.699334f, -0.6164538f, 0.36182392f, 0f, -0.15466657f, 0.6291284f, 0.7617583f, 0f, -0.6841613f, -0.2580482f, -0.68215424f, 0f, 0.5383981f, 0.4258655f, 0.727163f, 0f, -0.5026988f, -0.7939833f, -0.3418837f, 0f, 0.32029718f, 0.28344154f, 0.9039196f, 0f, 0.86832273f, -0.00037626564f, -0.49599952f, 0f, 0.79112005f, -0.085110456f, 0.60571057f, 0f, -0.04011016f, -0.43972486f, 0.8972364f, 0f, 0.914512f, 0.35793462f, -0.18854876f, 0f, -0.96120393f, -0.27564842f, 0.010246669f, 0f, 0.65103614f, -0.28777993f, -0.70237786f, 0f, -0.20417863f, 0.73652375f, 0.6448596f, 0f, -0.7718264f, 0.37906268f, 0.5104856f, 0f, -0.30600828f, -0.7692988f, 0.56083715f, 0f, 0.45400733f, -0.5024843f, 0.73578995f, 0f, 0.48167956f, 0.6021208f, -0.636738f, 0f, 0.69619805f, -0.32221973f, 0.6414692f, 0f, -0.65321606f, -0.6781149f, 0.33685157f, 0f, 0.50893015f, -0.61546624f, -0.60182345f, 0f, -0.16359198f, -0.9133605f, -0.37284088f, 0f, 0.5240802f, -0.8437664f, 0.11575059f, 0f, 0.5902587f, 0.4983818f, -0.63498837f, 0f, 0.5863228f, 0.49476475f, 0.6414308f, 0f, 0.6779335f, 0.23413453f, 0.6968409f, 0f, 0.7177054f, -0.68589795f, 0.12017863f, 0f, -0.532882f, -0.5205125f, 0.6671608f, 0f, -0.8654874f, -0.07007271f, -0.4960054f, 0f, -0.286181f, 0.79520893f, 0.53454953f, 0f, -0.048495296f, 0.98108363f, -0.18741156f, 0f, -0.63585216f, 0.60583484f, 0.47818002f, 0f, 0.62547946f, -0.28616196f, 0.72586966f, 0f, -0.258526f, 0.50619495f, -0.8227582f, 0f, 0.021363068f, 0.50640166f, -0.862033f, 0f, 0.20011178f, 0.85992634f, 0.46955505f, 0f, 0.47435614f, 0.6014985f, -0.6427953f, 0f, 0.6622994f, -0.52024746f, -0.539168f, 0f, 0.08084973f, -0.65327203f, 0.7527941f, 0f, -0.6893687f, 0.059286036f, 0.7219805f, 0f, -0.11218871f, -0.96731853f, 0.22739525f, 0f, 0.7344116f, 0.59796685f, -0.3210533f, 0f, 0.5789393f, -0.24888498f, 0.776457f, 0f, 0.69881827f, 0.35571697f, -0.6205791f, 0f, -0.86368454f, -0.27487713f, -0.4224826f, 0f, -0.4247028f, -0.46408808f, 0.77733505f, 0f, 0.5257723f, -0.84270173f, 0.11583299f, 0f, 0.93438303f, 0.31630248f, -0.16395439f, 0f, -0.10168364f, -0.8057303f, -0.58348876f, 0f, -0.6529239f, 0.50602126f, -0.5635893f, 0f, -0.24652861f, -0.9668206f, -0.06694497f, 0f, -0.9776897f, -0.20992506f, -0.0073688254f, 0f, 0.7736893f, 0.57342446f, 0.2694238f, 0f, -0.6095088f, 0.4995679f, 0.6155737f, 0f, 0.5794535f, 0.7434547f, 0.33392924f, 0f, -0.8226211f, 0.081425816f, 0.56272936f, 0f, -0.51038545f, 0.47036678f, 0.719904f, 0f, -0.5764972f, -0.072316565f, -0.81389266f, 0f, 0.7250629f, 0.39499715f, -0.56414634f, 0f, -0.1525424f, 0.48608407f, -0.8604958f, 0f, -0.55509764f, -0.49578208f, 0.6678823f, 0f, -0.18836144f, 0.91458696f, 0.35784173f, 0f, 0.76255566f, -0.54144084f, -0.35404897f, 0f, -0.5870232f, -0.3226498f, -0.7424964f, 0f, 0.30511242f, 0.2262544f, -0.9250488f, 0f, 0.63795763f, 0.57724243f, -0.50970703f, 0f, -0.5966776f, 0.14548524f, -0.7891831f, 0f, -0.65833056f, 0.65554875f, -0.36994147f, 0f, 0.74348927f, 0.23510846f, 0.6260573f, 0f, 0.5562114f, 0.82643604f, -0.08736329f, 0f, -0.302894f, -0.8251527f, 0.47684193f, 0f, 0.11293438f, -0.9858884f, -0.123571075f, 0f, 0.5937653f, -0.5896814f, 0.5474657f, 0f, 0.6757964f, -0.58357584f, -0.45026484f, 0f, 0.7242303f, -0.11527198f, 0.67985505f, 0f, -0.9511914f, 0.0753624f, -0.29925808f, 0f, 0.2539471f, -0.18863393f, 0.9486454f, 0f, 0.5714336f, -0.16794509f, -0.8032796f, 0f, -0.06778235f, 0.39782694f, 0.9149532f, 0f, 0.6074973f, 0.73306f, -0.30589226f, 0f, -0.54354787f, 0.16758224f, 0.8224791f, 0f, -0.5876678f, -0.3380045f, -0.7351187f, 0f, -0.79675627f, 0.040978227f, -0.60290986f, 0f, -0.19963509f, 0.8706295f, 0.4496111f, 0f, -0.027876602f, -0.91062325f, -0.4122962f, 0f, -0.7797626f, -0.6257635f, 0.019757755f, 0f, -0.5211233f, 0.74016446f, -0.42495546f, 0f, 0.8575425f, 0.4053273f, -0.31675017f, 0f, 0.10452233f, 0.8390196f, -0.53396744f, 0f, 0.3501823f, 0.9242524f, -0.15208502f, 0f, 0.19878499f, 0.076476134f, 0.9770547f, 0f, 0.78459966f, 0.6066257f, -0.12809642f, 0f, 0.09006737f, -0.97509897f, -0.20265691f, 0f, -0.82743436f, -0.54229957f, 0.14582036f, 0f, -0.34857976f, -0.41580227f, 0.8400004f, 0f, -0.2471779f, -0.730482f, -0.6366311f, 0f, -0.3700155f, 0.8577948f, 0.35675845f, 0f, 0.59133947f, -0.54831195f, -0.59133035f, 0f, 0.120487355f, -0.7626472f, -0.6354935f, 0f, 0.6169593f, 0.03079648f, 0.7863923f, 0f, 0.12581569f, -0.664083f, -0.73699677f, 0f, -0.6477565f, -0.17401473f, -0.74170774f, 0f, 0.6217889f, -0.7804431f, -0.06547655f, 0f, 0.6589943f, -0.6096988f, 0.44044736f, 0f, -0.26898375f, -0.6732403f, -0.68876356f, 0f, -0.38497752f, 0.56765425f, 0.7277094f, 0f, 0.57544446f, 0.81104714f, -0.10519635f, 0f, 0.91415936f, 0.3832948f, 0.13190056f, 0f, -0.10792532f, 0.9245494f, 0.36545935f, 0f, 0.3779771f, 0.30431488f, 0.87437165f, 0f, -0.21428852f, -0.8259286f, 0.5214617f, 0f, 0.58025444f, 0.41480985f, -0.7008834f, 0f, -0.19826609f, 0.85671616f, -0.47615966f, 0f, -0.033815537f, 0.37731808f, -0.9254661f, 0f, -0.68679225f, -0.6656598f, 0.29191336f, 0f, 0.7731743f, -0.28757936f, -0.565243f, 0f, -0.09655942f, 0.91937083f, -0.3813575f, 0f, 0.27157024f, -0.957791f, -0.09426606f, 0f, 0.24510157f, -0.6917999f, -0.6792188f, 0f, 0.97770077f, -0.17538553f, 0.115503654f, 0f, -0.522474f, 0.8521607f, 0.029036159f, 0f, -0.77348804f, -0.52612925f, 0.35341796f, 0f, -0.71344924f, -0.26954725f, 0.6467878f, 0f, 0.16440372f, 0.5105846f, -0.84396374f, 0f, 0.6494636f, 0.055856112f, 0.7583384f, 0f, -0.4711971f, 0.50172806f, -0.7254256f, 0f, -0.63357645f, -0.23816863f, -0.7361091f, 0f, -0.9021533f, -0.2709478f, -0.33571818f, 0f, -0.3793711f, 0.8722581f, 0.3086152f, 0f, -0.68555987f, -0.32501432f, 0.6514394f, 0f, 0.29009423f, -0.7799058f, -0.5546101f, 0f, -0.20983194f, 0.8503707f, 0.48253515f, 0f, -0.45926037f, 0.6598504f, -0.5947077f, 0f, 0.87159455f, 0.09616365f, -0.48070312f, 0f, -0.6776666f, 0.71185046f, -0.1844907f, 0f, 0.7044378f, 0.3124276f, 0.637304f, 0f, -0.7052319f, -0.24010932f, -0.6670798f, 0f, 0.081921004f, -0.72073364f, -0.68835455f, 0f, -0.6993681f, -0.5875763f, -0.4069869f, 0f, -0.12814544f, 0.6419896f, 0.75592864f, 0f, -0.6337388f, -0.67854714f, -0.3714147f, 0f, 0.5565052f, -0.21688876f, -0.8020357f, 0f, -0.57915545f, 0.7244372f, -0.3738579f, 0f, 0.11757791f, -0.7096451f, 0.69467926f, 0f, -0.613462f, 0.13236311f, 0.7785528f, 0f, 0.69846356f, -0.029805163f, -0.7150247f, 0f, 0.83180827f, -0.3930172f, 0.39195976f, 0f, 0.14695764f, 0.055416517f, -0.98758924f, 0f, 0.70886856f, -0.2690504f, 0.65201014f, 0f, 0.27260533f, 0.67369765f, -0.68688995f, 0f, -0.65912956f, 0.30354586f, -0.68804663f, 0f, 0.48151314f, -0.752827f, 0.4487723f, 0f, 0.943001f, 0.16756473f, -0.28752613f, 0f, 0.43480295f, 0.7695305f, -0.46772778f, 0f, 0.39319962f, 0.5944736f, 0.70142365f, 0f, 0.72543365f, -0.60392565f, 0.33018148f, 0f, 0.75902355f, -0.6506083f, 0.024333132f, 0f, -0.8552769f, -0.3430043f, 0.38839358f, 0f, -0.6139747f, 0.6981725f, 0.36822575f, 0f, -0.74659055f, -0.575201f, 0.33428493f, 0f, 0.5730066f, 0.8105555f, -0.12109168f, 0f, -0.92258775f, -0.3475211f, -0.16751404f, 0f, -0.71058166f, -0.47196922f, -0.5218417f, 0f, -0.0856461f, 0.35830015f, 0.9296697f, 0f, -0.8279698f, -0.2043157f, 0.5222271f, 0f, 0.42794403f, 0.278166f, 0.8599346f, 0f, 0.539908f, -0.78571206f, -0.3019204f, 0f, 0.5678404f, -0.5495414f, -0.61283076f, 0f, -0.9896071f, 0.13656391f, -0.045034185f, 0f, -0.6154343f, -0.64408755f, 0.45430374f, 0f, 0.10742044f, -0.79463404f, 0.59750944f, 0f, -0.359545f, -0.888553f, 0.28495783f, 0f, -0.21804053f, 0.1529889f, 0.9638738f, 0f, -0.7277432f, -0.61640507f, -0.30072346f, 0f, 0.7249729f, -0.0066971947f, 0.68874484f, 0f, -0.5553659f, -0.5336586f, 0.6377908f, 0f, 0.5137558f, 0.79762083f, -0.316f, 0f, -0.3794025f, 0.92456084f, -0.035227515f, 0f, 0.82292485f, 0.27453658f, -0.49741766f, 0f, -0.5404114f, 0.60911417f, 0.5804614f, 0f, 0.8036582f, -0.27030295f, 0.5301602f, 0f, 0.60443187f, 0.68329686f, 0.40959433f, 0f, 0.06389989f, 0.96582085f, -0.2512108f, 0f, 0.10871133f, 0.74024713f, -0.6634878f, 0f, -0.7134277f, -0.6926784f, 0.10591285f, 0f, 0.64588976f, -0.57245487f, -0.50509584f, 0f, -0.6553931f, 0.73814714f, 0.15999562f, 0f, 0.39109614f, 0.91888714f, -0.05186756f, 0f, -0.48790225f, -0.5904377f, 0.64291114f, 0f, 0.601479f, 0.77074414f, -0.21018201f, 0f, -0.5677173f, 0.7511361f, 0.33688518f, 0f, 0.7858574f, 0.22667466f, 0.5753667f, 0f, -0.45203456f, -0.6042227f, -0.65618575f, 0f, 0.0022721163f, 0.4132844f, -0.9105992f, 0f, -0.58157516f, -0.5162926f, 0.6286591f, 0f, -0.03703705f, 0.8273786f, 0.5604221f, 0f, -0.51196927f, 0.79535437f, -0.324498f, 0f, -0.26824173f, -0.957229f, -0.10843876f, 0f, -0.23224828f, -0.9679131f, -0.09594243f, 0f, 0.3554329f, -0.8881506f, 0.29130062f, 0f, 0.73465204f, -0.4371373f, 0.5188423f, 0f, 0.998512f, 0.046590112f, -0.028339446f, 0f, -0.37276876f, -0.9082481f, 0.19007573f, 0f, 0.9173738f, -0.3483642f, 0.19252984f, 0f, 0.2714911f, 0.41475296f, -0.86848867f, 0f, 0.5131763f, -0.71163344f, 0.4798207f, 0f, -0.87373537f, 0.18886992f, -0.44823506f, 0f, 0.84600437f, -0.3725218f, 0.38145f, 0f, 0.89787275f, -0.17802091f, -0.40265754f, 0f, 0.21780656f, -0.9698323f, -0.10947895f, 0f, -0.15180314f, -0.7788918f, -0.6085091f, 0f, -0.2600385f, -0.4755398f, -0.840382f, 0f, 0.5723135f, -0.7474341f, -0.33734185f, 0f, -0.7174141f, 0.16990171f, -0.67561114f, 0f, -0.6841808f, 0.021457076f, -0.72899675f, 0f, -0.2007448f, 0.06555606f, -0.9774477f, 0f, -0.11488037f, -0.8044887f, 0.5827524f, 0f, -0.787035f, 0.03447489f, 0.6159443f, 0f, -0.20155965f, 0.68598723f, 0.69913894f, 0f, -0.085810825f, -0.10920836f, -0.99030805f, 0f, 0.5532693f, 0.73252505f, -0.39661077f, 0f, -0.18424894f, -0.9777375f, -0.100407675f, 0f, 0.07754738f, -0.9111506f, 0.40471104f, 0f, 0.13998385f, 0.7601631f, -0.63447344f, 0f, 0.44844192f, -0.84528923f, 0.29049253f, 0f }; private const int PrimeX = 501125321; private const int PrimeY = 1136930381; private const int PrimeZ = 1720413743; public FastNoiseLite(int seed = 1337) { SetSeed(seed); } public void SetSeed(int seed) { mSeed = seed; } public void SetFrequency(float frequency) { mFrequency = frequency; } public void SetNoiseType(NoiseType noiseType) { mNoiseType = noiseType; UpdateTransformType3D(); } public void SetRotationType3D(RotationType3D rotationType3D) { mRotationType3D = rotationType3D; UpdateTransformType3D(); UpdateWarpTransformType3D(); } public void SetFractalType(FractalType fractalType) { mFractalType = fractalType; } public void SetFractalOctaves(int octaves) { mOctaves = octaves; CalculateFractalBounding(); } public void SetFractalLacunarity(float lacunarity) { mLacunarity = lacunarity; } public void SetFractalGain(float gain) { mGain = gain; CalculateFractalBounding(); } public void SetFractalWeightedStrength(float weightedStrength) { mWeightedStrength = weightedStrength; } public void SetFractalPingPongStrength(float pingPongStrength) { mPingPongStrength = pingPongStrength; } public void SetCellularDistanceFunction(CellularDistanceFunction cellularDistanceFunction) { mCellularDistanceFunction = cellularDistanceFunction; } public void SetCellularReturnType(CellularReturnType cellularReturnType) { mCellularReturnType = cellularReturnType; } public void SetCellularJitter(float cellularJitter) { mCellularJitterModifier = cellularJitter; } public void SetDomainWarpType(DomainWarpType domainWarpType) { mDomainWarpType = domainWarpType; UpdateWarpTransformType3D(); } public void SetDomainWarpAmp(float domainWarpAmp) { mDomainWarpAmp = domainWarpAmp; } [MethodImpl(MethodImplOptions.AggressiveOptimization)] public float GetNoise(float x, float y) { TransformNoiseCoordinate(ref x, ref y); return mFractalType switch { FractalType.FBm => GenFractalFBm(x, y), FractalType.Ridged => GenFractalRidged(x, y), FractalType.PingPong => GenFractalPingPong(x, y), _ => GenNoiseSingle(mSeed, x, y), }; } [MethodImpl(MethodImplOptions.AggressiveOptimization)] public float GetNoise(float x, float y, float z) { TransformNoiseCoordinate(ref x, ref y, ref z); return mFractalType switch { FractalType.FBm => GenFractalFBm(x, y, z), FractalType.Ridged => GenFractalRidged(x, y, z), FractalType.PingPong => GenFractalPingPong(x, y, z), _ => GenNoiseSingle(mSeed, x, y, z), }; } [MethodImpl(MethodImplOptions.AggressiveOptimization)] public void DomainWarp(ref float x, ref float y) { switch (mFractalType) { default: DomainWarpSingle(ref x, ref y); break; case FractalType.DomainWarpProgressive: DomainWarpFractalProgressive(ref x, ref y); break; case FractalType.DomainWarpIndependent: DomainWarpFractalIndependent(ref x, ref y); break; } } [MethodImpl(MethodImplOptions.AggressiveOptimization)] public void DomainWarp(ref float x, ref float y, ref float z) { switch (mFractalType) { default: DomainWarpSingle(ref x, ref y, ref z); break; case FractalType.DomainWarpProgressive: DomainWarpFractalProgressive(ref x, ref y, ref z); break; case FractalType.DomainWarpIndependent: DomainWarpFractalIndependent(ref x, ref y, ref z); break; } } [MethodImpl(MethodImplOptions.AggressiveInlining)] private static float FastMin(float a, float b) { if (!(a < b)) { return b; } return a; } [MethodImpl(MethodImplOptions.AggressiveInlining)] private static float FastMax(float a, float b) { if (!(a > b)) { return b; } return a; } [MethodImpl(MethodImplOptions.AggressiveInlining)] private static float FastAbs(float f) { if (!(f < 0f)) { return f; } return 0f - f; } [MethodImpl(MethodImplOptions.AggressiveInlining)] private static float FastSqrt(float f) { return (float)Math.Sqrt(f); } [MethodImpl(MethodImplOptions.AggressiveInlining)] private static int FastFloor(float f) { if (!(f >= 0f)) { return (int)f - 1; } return (int)f; } [MethodImpl(MethodImplOptions.AggressiveInlining)] private static int FastRound(float f) { if (!(f >= 0f)) { return (int)(f - 0.5f); } return (int)(f + 0.5f); } [MethodImpl(MethodImplOptions.AggressiveInlining)] private static float Lerp(float a, float b, float t) { return a + t * (b - a); } [MethodImpl(MethodImplOptions.AggressiveInlining)] private static float InterpHermite(float t) { return t * t * (3f - 2f * t); } [MethodImpl(MethodImplOptions.AggressiveInlining)] private static float InterpQuintic(float t) { return t * t * t * (t * (t * 6f - 15f) + 10f); } [MethodImpl(MethodImplOptions.AggressiveInlining)] private static float CubicLerp(float a, float b, float c, float d, float t) { float num = d - c - (a - b); return t * t * t * num + t * t * (a - b - num) + t * (c - a) + b; } [MethodImpl(MethodImplOptions.AggressiveInlining)] private static float PingPong(float t) { t -= (float)((int)(t * 0.5f) * 2); if (!(t < 1f)) { return 2f - t; } return t; } private void CalculateFractalBounding() { float num = FastAbs(mGain); float num2 = num; float num3 = 1f; for (int i = 1; i < mOctaves; i++) { num3 += num2; num2 *= num; } mFractalBounding = 1f / num3; } [MethodImpl(MethodImplOptions.AggressiveInlining)] private static int Hash(int seed, int xPrimed, int yPrimed) { return (seed ^ xPrimed ^ yPrimed) * 668265261; } [MethodImpl(MethodImplOptions.AggressiveInlining)] private static int Hash(int seed, int xPrimed, int yPrimed, int zPrimed) { return (seed ^ xPrimed ^ yPrimed ^ zPrimed) * 668265261; } [MethodImpl(MethodImplOptions.AggressiveInlining)] private static float ValCoord(int seed, int xPrimed, int yPrimed) { int num = Hash(seed, xPrimed, yPrimed); int num2 = num * num; return (float)(num2 ^ (num2 << 19)) * 4.656613E-10f; } [MethodImpl(MethodImplOptions.AggressiveInlining)] private static float ValCoord(int seed, int xPrimed, int yPrimed, int zPrimed) { int num = Hash(seed, xPrimed, yPrimed, zPrimed); int num2 = num * num; return (float)(num2 ^ (num2 << 19)) * 4.656613E-10f; } [MethodImpl(MethodImplOptions.AggressiveInlining)] private static float GradCoord(int seed, int xPrimed, int yPrimed, float xd, float yd) { int num = Hash(seed, xPrimed, yPrimed); num ^= num >> 15; num &= 0xFE; float num2 = Gradients2D[num]; float num3 = Gradients2D[num | 1]; return xd * num2 + yd * num3; } [MethodImpl(MethodImplOptions.AggressiveInlining)] private static float GradCoord(int seed, int xPrimed, int yPrimed, int zPrimed, float xd, float yd, float zd) { int num = Hash(seed, xPrimed, yPrimed, zPrimed); num ^= num >> 15; num &= 0xFC; float num2 = Gradients3D[num]; float num3 = Gradients3D[num | 1]; float num4 = Gradients3D[num | 2]; return xd * num2 + yd * num3 + zd * num4; } [MethodImpl(MethodImplOptions.AggressiveInlining)] private static void GradCoordOut(int seed, int xPrimed, int yPrimed, out float xo, out float yo) { int num = Hash(seed, xPrimed, yPrimed) & 0x1FE; xo = RandVecs2D[num]; yo = RandVecs2D[num | 1]; } [MethodImpl(MethodImplOptions.AggressiveInlining)] private static void GradCoordOut(int seed, int xPrimed, int yPrimed, int zPrimed, out float xo, out float yo, out float zo) { int num = Hash(seed, xPrimed, yPrimed, zPrimed) & 0x3FC; xo = RandVecs3D[num]; yo = RandVecs3D[num | 1]; zo = RandVecs3D[num | 2]; } [MethodImpl(MethodImplOptions.AggressiveInlining)] private static void GradCoordDual(int seed, int xPrimed, int yPrimed, float xd, float yd, out float xo, out float yo) { int num = Hash(seed, xPrimed, yPrimed); int num2 = num & 0xFE; int num3 = (num >> 7) & 0x1FE; float num4 = Gradients2D[num2]; float num5 = Gradients2D[num2 | 1]; float num6 = xd * num4 + yd * num5; float num7 = RandVecs2D[num3]; float num8 = RandVecs2D[num3 | 1]; xo = num6 * num7; yo = num6 * num8; } [MethodImpl(MethodImplOptions.AggressiveInlining)] private static void GradCoordDual(int seed, int xPrimed, int yPrimed, int zPrimed, float xd, float yd, float zd, out float xo, out float yo, out float zo) { int num = Hash(seed, xPrimed, yPrimed, zPrimed); int num2 = num & 0xFC; int num3 = (num >> 6) & 0x3FC; float num4 = Gradients3D[num2]; float num5 = Gradients3D[num2 | 1]; float num6 = Gradients3D[num2 | 2]; float num7 = xd * num4 + yd * num5 + zd * num6; float num8 = RandVecs3D[num3]; float num9 = RandVecs3D[num3 | 1]; float num10 = RandVecs3D[num3 | 2]; xo = num7 * num8; yo = num7 * num9; zo = num7 * num10; } private float GenNoiseSingle(int seed, float x, float y) { return mNoiseType switch { NoiseType.OpenSimplex2 => SingleSimplex(seed, x, y), NoiseType.OpenSimplex2S => SingleOpenSimplex2S(seed, x, y), NoiseType.Cellular => SingleCellular(seed, x, y), NoiseType.Perlin => SinglePerlin(seed, x, y), NoiseType.ValueCubic => SingleValueCubic(seed, x, y), NoiseType.Value => SingleValue(seed, x, y), _ => 0f, }; } private float GenNoiseSingle(int seed, float x, float y, float z) { return mNoiseType switch { NoiseType.OpenSimplex2 => SingleOpenSimplex2(seed, x, y, z), NoiseType.OpenSimplex2S => SingleOpenSimplex2S(seed, x, y, z), NoiseType.Cellular => SingleCellular(seed, x, y, z), NoiseType.Perlin => SinglePerlin(seed, x, y, z), NoiseType.ValueCubic => SingleValueCubic(seed, x, y, z), NoiseType.Value => SingleValue(seed, x, y, z), _ => 0f, }; } [MethodImpl(MethodImplOptions.AggressiveInlining)] private void TransformNoiseCoordinate(ref float x, ref float y) { x *= mFrequency; y *= mFrequency; NoiseType noiseType = mNoiseType; if ((uint)noiseType <= 1u) { float num = (x + y) * 0.3660254f; x += num; y += num; } } [MethodImpl(MethodImplOptions.AggressiveInlining)] private void TransformNoiseCoordinate(ref float x, ref float y, ref float z) { x *= mFrequency; y *= mFrequency; z *= mFrequency; switch (mTransformType3D) { case TransformType3D.ImproveXYPlanes: { float num4 = x + y; float num5 = num4 * -0.21132487f; z *= 0.57735026f; x += num5 - z; y = y + num5 - z; z += num4 * 0.57735026f; break; } case TransformType3D.ImproveXZPlanes: { float num2 = x + z; float num3 = num2 * -0.21132487f; y *= 0.57735026f; x += num3 - y; z += num3 - y; y += num2 * 0.57735026f; break; } case TransformType3D.DefaultOpenSimplex2: { float num = (x + y + z) * (2f / 3f); x = num - x; y = num - y; z = num - z; break; } } } private void UpdateTransformType3D() { switch (mRotationType3D) { case RotationType3D.ImproveXYPlanes: mTransformType3D = TransformType3D.ImproveXYPlanes; return; case RotationType3D.ImproveXZPlanes: mTransformType3D = TransformType3D.ImproveXZPlanes; return; } NoiseType noiseType = mNoiseType; if ((uint)noiseType <= 1u) { mTransformType3D = TransformType3D.DefaultOpenSimplex2; } else { mTransformType3D = TransformType3D.None; } } [MethodImpl(MethodImplOptions.AggressiveInlining)] private void TransformDomainWarpCoordinate(ref float x, ref float y) { DomainWarpType domainWarpType = mDomainWarpType; if ((uint)domainWarpType <= 1u) { float num = (x + y) * 0.3660254f; x += num; y += num; } } [MethodImpl(MethodImplOptions.AggressiveInlining)] private void TransformDomainWarpCoordinate(ref float x, ref float y, ref float z) { switch (mWarpTransformType3D) { case TransformType3D.ImproveXYPlanes: { float num4 = x + y; float num5 = num4 * -0.21132487f; z *= 0.57735026f; x += num5 - z; y = y + num5 - z; z += num4 * 0.57735026f; break; } case TransformType3D.ImproveXZPlanes: { float num2 = x + z; float num3 = num2 * -0.21132487f; y *= 0.57735026f; x += num3 - y; z += num3 - y; y += num2 * 0.57735026f; break; } case TransformType3D.DefaultOpenSimplex2: { float num = (x + y + z) * (2f / 3f); x = num - x; y = num - y; z = num - z; break; } } } private void UpdateWarpTransformType3D() { switch (mRotationType3D) { case RotationType3D.ImproveXYPlanes: mWarpTransformType3D = TransformType3D.ImproveXYPlanes; return; case RotationType3D.ImproveXZPlanes: mWarpTransformType3D = TransformType3D.ImproveXZPlanes; return; } DomainWarpType domainWarpType = mDomainWarpType; if ((uint)domainWarpType <= 1u) { mWarpTransformType3D = TransformType3D.DefaultOpenSimplex2; } else { mWarpTransformType3D = TransformType3D.None; } } private float GenFractalFBm(float x, float y) { int num = mSeed; float num2 = 0f; float num3 = mFractalBounding; for (int i = 0; i < mOctaves; i++) { float num4 = GenNoiseSingle(num++, x, y); num2 += num4 * num3; num3 *= Lerp(1f, FastMin(num4 + 1f, 2f) * 0.5f, mWeightedStrength); x *= mLacunarity; y *= mLacunarity; num3 *= mGain; } return num2; } private float GenFractalFBm(float x, float y, float z) { int num = mSeed; float num2 = 0f; float num3 = mFractalBounding; for (int i = 0; i < mOctaves; i++) { float num4 = GenNoiseSingle(num++, x, y, z); num2 += num4 * num3; num3 *= Lerp(1f, (num4 + 1f) * 0.5f, mWeightedStrength); x *= mLacunarity; y *= mLacunarity; z *= mLacunarity; num3 *= mGain; } return num2; } private float GenFractalRidged(float x, float y) { int num = mSeed; float num2 = 0f; float num3 = mFractalBounding; for (int i = 0; i < mOctaves; i++) { float num4 = FastAbs(GenNoiseSingle(num++, x, y)); num2 += (num4 * -2f + 1f) * num3; num3 *= Lerp(1f, 1f - num4, mWeightedStrength); x *= mLacunarity; y *= mLacunarity; num3 *= mGain; } return num2; } private float GenFractalRidged(float x, float y, float z) { int num = mSeed; float num2 = 0f; float num3 = mFractalBounding; for (int i = 0; i < mOctaves; i++) { float num4 = FastAbs(GenNoiseSingle(num++, x, y, z)); num2 += (num4 * -2f + 1f) * num3; num3 *= Lerp(1f, 1f - num4, mWeightedStrength); x *= mLacunarity; y *= mLacunarity; z *= mLacunarity; num3 *= mGain; } return num2; } private float GenFractalPingPong(float x, float y) { int num = mSeed; float num2 = 0f; float num3 = mFractalBounding; for (int i = 0; i < mOctaves; i++) { float num4 = PingPong((GenNoiseSingle(num++, x, y) + 1f) * mPingPongStrength); num2 += (num4 - 0.5f) * 2f * num3; num3 *= Lerp(1f, num4, mWeightedStrength); x *= mLacunarity; y *= mLacunarity; num3 *= mGain; } return num2; } private float GenFractalPingPong(float x, float y, float z) { int num = mSeed; float num2 = 0f; float num3 = mFractalBounding; for (int i = 0; i < mOctaves; i++) { float num4 = PingPong((GenNoiseSingle(num++, x, y, z) + 1f) * mPingPongStrength); num2 += (num4 - 0.5f) * 2f * num3; num3 *= Lerp(1f, num4, mWeightedStrength); x *= mLacunarity; y *= mLacunarity; z *= mLacunarity; num3 *= mGain; } return num2; } private float SingleSimplex(int seed, float x, float y) { int num = FastFloor(x); int num2 = FastFloor(y); float num3 = x - (float)num; float num4 = y - (float)num2; float num5 = (num3 + num4) * 0.21132487f; float num6 = num3 - num5; float num7 = num4 - num5; num *= 501125321; num2 *= 1136930381; float num8 = 0.5f - num6 * num6 - num7 * num7; float num9 = ((!(num8 <= 0f)) ? (num8 * num8 * (num8 * num8) * GradCoord(seed, num, num2, num6, num7)) : 0f); float num10 = 3.1547005f * num5 + (-0.6666666f + num8); float num11; if (num10 <= 0f) { num11 = 0f; } else { float xd = num6 + -0.57735026f; float yd = num7 + -0.57735026f; num11 = num10 * num10 * (num10 * num10) * GradCoord(seed, num + 501125321, num2 + 1136930381, xd, yd); } float num15; if (num7 > num6) { float num12 = num6 + 0.21132487f; float num13 = num7 + -0.7886751f; float num14 = 0.5f - num12 * num12 - num13 * num13; num15 = ((!(num14 <= 0f)) ? (num14 * num14 * (num14 * num14) * GradCoord(seed, num, num2 + 1136930381, num12, num13)) : 0f); } else { float num16 = num6 + -0.7886751f; float num17 = num7 + 0.21132487f; float num18 = 0.5f - num16 * num16 - num17 * num17; num15 = ((!(num18 <= 0f)) ? (num18 * num18 * (num18 * num18) * GradCoord(seed, num + 501125321, num2, num16, num17)) : 0f); } return (num9 + num15 + num11) * 99.83685f; } private float SingleOpenSimplex2(int seed, float x, float y, float z) { int num = FastRound(x); int num2 = FastRound(y); int num3 = FastRound(z); float num4 = x - (float)num; float num5 = y - (float)num2; float num6 = z - (float)num3; int num7 = (int)(-1f - num4) | 1; int num8 = (int)(-1f - num5) | 1; int num9 = (int)(-1f - num6) | 1; float num10 = (float)num7 * (0f - num4); float num11 = (float)num8 * (0f - num5); float num12 = (float)num9 * (0f - num6); num *= 501125321; num2 *= 1136930381; num3 *= 1720413743; float num13 = 0f; float num14 = 0.6f - num4 * num4 - (num5 * num5 + num6 * num6); int num15 = 0; while (true) { if (num14 > 0f) { num13 += num14 * num14 * (num14 * num14) * GradCoord(seed, num, num2, num3, num4, num5, num6); } if (num10 >= num11 && num10 >= num12) { float num16 = num14 + num10 + num10; if (num16 > 1f) { num16 -= 1f; num13 += num16 * num16 * (num16 * num16) * GradCoord(seed, num - num7 * 501125321, num2, num3, num4 + (float)num7, num5, num6); } } else if (num11 > num10 && num11 >= num12) { float num17 = num14 + num11 + num11; if (num17 > 1f) { num17 -= 1f; num13 += num17 * num17 * (num17 * num17) * GradCoord(seed, num, num2 - num8 * 1136930381, num3, num4, num5 + (float)num8, num6); } } else { float num18 = num14 + num12 + num12; if (num18 > 1f) { num18 -= 1f; num13 += num18 * num18 * (num18 * num18) * GradCoord(seed, num, num2, num3 - num9 * 1720413743, num4, num5, num6 + (float)num9); } } if (num15 == 1) { break; } num10 = 0.5f - num10; num11 = 0.5f - num11; num12 = 0.5f - num12; num4 = (float)num7 * num10; num5 = (float)num8 * num11; num6 = (float)num9 * num12; num14 += 0.75f - num10 - (num11 + num12); num += (num7 >> 1) & 0x1DDE90C9; num2 += (num8 >> 1) & 0x43C42E4D; num3 += (num9 >> 1) & 0x668B6E2F; num7 = -num7; num8 = -num8; num9 = -num9; seed = ~seed; num15++; } return num13 * 32.694283f; } private float SingleOpenSimplex2S(int seed, float x, float y) { int num = FastFloor(x); int num2 = FastFloor(y); float num3 = x - (float)num; float num4 = y - (float)num2; num *= 501125321; num2 *= 1136930381; int xPrimed = num + 501125321; int yPrimed = num2 + 1136930381; float num5 = (num3 + num4) * 0.21132487f; float num6 = num3 - num5; float num7 = num4 - num5; float num8 = 2f / 3f - num6 * num6 - num7 * num7; float num9 = num8 * num8 * (num8 * num8) * GradCoord(seed, num, num2, num6, num7); float num10 = 3.1547005f * num5 + (-0.6666666f + num8); float xd = num6 - 0.57735026f; float yd = num7 - 0.57735026f; num9 += num10 * num10 * (num10 * num10) * GradCoord(seed, xPrimed, yPrimed, xd, yd); float num11 = num3 - num4; if (num5 > 0.21132487f) { if (num3 + num11 > 1f) { float num12 = num6 + -1.3660254f; float num13 = num7 + -0.3660254f; float num14 = 2f / 3f - num12 * num12 - num13 * num13; if (num14 > 0f) { num9 += num14 * num14 * (num14 * num14) * GradCoord(seed, num + 1002250642, num2 + 1136930381, num12, num13); } } else { float num15 = num6 + 0.21132487f; float num16 = num7 + -0.7886751f; float num17 = 2f / 3f - num15 * num15 - num16 * num16; if (num17 > 0f) { num9 += num17 * num17 * (num17 * num17) * GradCoord(seed, num, num2 + 1136930381, num15, num16); } } if (num4 - num11 > 1f) { float num18 = num6 + -0.3660254f; float num19 = num7 + -1.3660254f; float num20 = 2f / 3f - num18 * num18 - num19 * num19; if (num20 > 0f) { num9 += num20 * num20 * (num20 * num20) * GradCoord(seed, num + 501125321, num2 + -2021106534, num18, num19); } } else { float num21 = num6 + -0.7886751f; float num22 = num7 + 0.21132487f; float num23 = 2f / 3f - num21 * num21 - num22 * num22; if (num23 > 0f) { num9 += num23 * num23 * (num23 * num23) * GradCoord(seed, num + 501125321, num2, num21, num22); } } } else { if (num3 + num11 < 0f) { float num24 = num6 + 0.7886751f; float num25 = num7 - 0.21132487f; float num26 = 2f / 3f - num24 * num24 - num25 * num25; if (num26 > 0f) { num9 += num26 * num26 * (num26 * num26) * GradCoord(seed, num - 501125321, num2, num24, num25); } } else { float num27 = num6 + -0.7886751f; float num28 = num7 + 0.21132487f; float num29 = 2f / 3f - num27 * num27 - num28 * num28; if (num29 > 0f) { num9 += num29 * num29 * (num29 * num29) * GradCoord(seed, num + 501125321, num2, num27, num28); } } if (num4 < num11) { float num30 = num6 - 0.21132487f; float num31 = num7 - -0.7886751f; float num32 = 2f / 3f - num30 * num30 - num31 * num31; if (num32 > 0f) { num9 += num32 * num32 * (num32 * num32) * GradCoord(seed, num, num2 - 1136930381, num30, num31); } } else { float num33 = num6 + 0.21132487f; float num34 = num7 + -0.7886751f; float num35 = 2f / 3f - num33 * num33 - num34 * num34; if (num35 > 0f) { num9 += num35 * num35 * (num35 * num35) * GradCoord(seed, num, num2 + 1136930381, num33, num34); } } } return num9 * 18.241962f; } private float SingleOpenSimplex2S(int seed, float x, float y, float z) { int num = FastFloor(x); int num2 = FastFloor(y); int num3 = FastFloor(z); float num4 = x - (float)num; float num5 = y - (float)num2; float num6 = z - (float)num3; num *= 501125321; num2 *= 1136930381; num3 *= 1720413743; int seed2 = seed + 1293373; int num7 = (int)(-0.5f - num4); int num8 = (int)(-0.5f - num5); int num9 = (int)(-0.5f - num6); float num10 = num4 + (float)num7; float num11 = num5 + (float)num8; float num12 = num6 + (float)num9; float num13 = 0.75f - num10 * num10 - num11 * num11 - num12 * num12; float num14 = num13 * num13 * (num13 * num13) * GradCoord(seed, num + (num7 & 0x1DDE90C9), num2 + (num8 & 0x43C42E4D), num3 + (num9 & 0x668B6E2F), num10, num11, num12); float num15 = num4 - 0.5f; float num16 = num5 - 0.5f; float num17 = num6 - 0.5f; float num18 = 0.75f - num15 * num15 - num16 * num16 - num17 * num17; num14 += num18 * num18 * (num18 * num18) * GradCoord(seed2, num + 501125321, num2 + 1136930381, num3 + 1720413743, num15, num16, num17); float num19 = (float)((num7 | 1) << 1) * num15; float num20 = (float)((num8 | 1) << 1) * num16; float num21 = (float)((num9 | 1) << 1) * num17; float num22 = (float)(-2 - (num7 << 2)) * num15 - 1f; float num23 = (float)(-2 - (num8 << 2)) * num16 - 1f; float num24 = (float)(-2 - (num9 << 2)) * num17 - 1f; bool flag = false; float num25 = num19 + num13; if (num25 > 0f) { float xd = num10 - (float)(num7 | 1); float yd = num11; float zd = num12; num14 += num25 * num25 * (num25 * num25) * GradCoord(seed, num + (~num7 & 0x1DDE90C9), num2 + (num8 & 0x43C42E4D), num3 + (num9 & 0x668B6E2F), xd, yd, zd); } else { float num26 = num20 + num21 + num13; if (num26 > 0f) { float xd2 = num10; float yd2 = num11 - (float)(num8 | 1); float zd2 = num12 - (float)(num9 | 1); num14 += num26 * num26 * (num26 * num26) * GradCoord(seed, num + (num7 & 0x1DDE90C9), num2 + (~num8 & 0x43C42E4D), num3 + (~num9 & 0x668B6E2F), xd2, yd2, zd2); } float num27 = num22 + num18; if (num27 > 0f) { float xd3 = (float)(num7 | 1) + num15; float yd3 = num16; float zd3 = num17; num14 += num27 * num27 * (num27 * num27) * GradCoord(seed2, num + (num7 & 0x3BBD2192), num2 + 1136930381, num3 + 1720413743, xd3, yd3, zd3); flag = true; } } bool flag2 = false; float num28 = num20 + num13; if (num28 > 0f) { float xd4 = num10; float yd4 = num11 - (float)(num8 | 1); float zd4 = num12; num14 += num28 * num28 * (num28 * num28) * GradCoord(seed, num + (num7 & 0x1DDE90C9), num2 + (~num8 & 0x43C42E4D), num3 + (num9 & 0x668B6E2F), xd4, yd4, zd4); } else { float num29 = num19 + num21 + num13; if (num29 > 0f) { float xd5 = num10 - (float)(num7 | 1); float yd5 = num11; float zd5 = num12 - (float)(num9 | 1); num14 += num29 * num29 * (num29 * num29) * GradCoord(seed, num + (~num7 & 0x1DDE90C9), num2 + (num8 & 0x43C42E4D), num3 + (~num9 & 0x668B6E2F), xd5, yd5, zd5); } float num30 = num23 + num18; if (num30 > 0f) { float xd6 = num15; float yd6 = (float)(num8 | 1) + num16; float zd6 = num17; num14 += num30 * num30 * (num30 * num30) * GradCoord(seed2, num + 501125321, num2 + (num8 & -2021106534), num3 + 1720413743, xd6, yd6, zd6); flag2 = true; } } bool flag3 = false; float num31 = num21 + num13; if (num31 > 0f) { float xd7 = num10; float yd7 = num11; float zd7 = num12 - (float)(num9 | 1); num14 += num31 * num31 * (num31 * num31) * GradCoord(seed, num + (num7 & 0x1DDE90C9), num2 + (num8 & 0x43C42E4D), num3 + (~num9 & 0x668B6E2F), xd7, yd7, zd7); } else { float num32 = num19 + num20 + num13; if (num32 > 0f) { float xd8 = num10 - (float)(num7 | 1); float yd8 = num11 - (float)(num8 | 1); float zd8 = num12; num14 += num32 * num32 * (num32 * num32) * GradCoord(seed, num + (~num7 & 0x1DDE90C9), num2 + (~num8 & 0x43C42E4D), num3 + (num9 & 0x668B6E2F), xd8, yd8, zd8); } float num33 = num24 + num18; if (num33 > 0f) { float xd9 = num15; float yd9 = num16; float zd9 = (float)(num9 | 1) + num17; num14 += num33 * num33 * (num33 * num33) * GradCoord(seed2, num + 501125321, num2 + 1136930381, num3 + (num9 & -854139810), xd9, yd9, zd9); flag3 = true; } } if (!flag) { float num34 = num23 + num24 + num18; if (num34 > 0f) { float xd10 = num15; float yd10 = (float)(num8 | 1) + num16; float zd10 = (float)(num9 | 1) + num17; num14 += num34 * num34 * (num34 * num34) * GradCoord(seed2, num + 501125321, num2 + (num8 & -2021106534), num3 + (num9 & -854139810), xd10, yd10, zd10); } } if (!flag2) { float num35 = num22 + num24 + num18; if (num35 > 0f) { float xd11 = (float)(num7 | 1) + num15; float yd11 = num16; float zd11 = (float)(num9 | 1) + num17; num14 += num35 * num35 * (num35 * num35) * GradCoord(seed2, num + (num7 & 0x3BBD2192), num2 + 1136930381, num3 + (num9 & -854139810), xd11, yd11, zd11); } } if (!flag3) { float num36 = num22 + num23 + num18; if (num36 > 0f) { float xd12 = (float)(num7 | 1) + num15; float yd12 = (float)(num8 | 1) + num16; float zd12 = num17; num14 += num36 * num36 * (num36 * num36) * GradCoord(seed2, num + (num7 & 0x3BBD2192), num2 + (num8 & -2021106534), num3 + 1720413743, xd12, yd12, zd12); } } return num14 * 9.046026f; } private float SingleCellular(int seed, float x, float y) { int num = FastRound(x); int num2 = FastRound(y); float num3 = float.MaxValue; float num4 = float.MaxValue; int num5 = 0; float num6 = 0.43701595f * mCellularJitterModifier; int num7 = (num - 1) * 501125321; int num8 = (num2 - 1) * 1136930381; switch (mCellularDistanceFunction) { default: { for (int k = num - 1; k <= num + 1; k++) { int num15 = num8; for (int l = num2 - 1; l <= num2 + 1; l++) { int num16 = Hash(seed, num7, num15); int num17 = num16 & 0x1FE; float num18 = (float)k - x + RandVecs2D[num17] * num6; float num19 = (float)l - y + RandVecs2D[num17 | 1] * num6; float num20 = num18 * num18 + num19 * num19; num4 = FastMax(FastMin(num4, num20), num3); if (num20 < num3) { num3 = num20; num5 = num16; } num15 += 1136930381; } num7 += 501125321; } break; } case CellularDistanceFunction.Manhattan: { for (int m = num - 1; m <= num + 1; m++) { int num21 = num8; for (int n = num2 - 1; n <= num2 + 1; n++) { int num22 = Hash(seed, num7, num21); int num23 = num22 & 0x1FE; float f = (float)m - x + RandVecs2D[num23] * num6; float f2 = (float)n - y + RandVecs2D[num23 | 1] * num6; float num24 = FastAbs(f) + FastAbs(f2); num4 = FastMax(FastMin(num4, num24), num3); if (num24 < num3) { num3 = num24; num5 = num22; } num21 += 1136930381; } num7 += 501125321; } break; } case CellularDistanceFunction.Hybrid: { for (int i = num - 1; i <= num + 1; i++) { int num9 = num8; for (int j = num2 - 1; j <= num2 + 1; j++) { int num10 = Hash(seed, num7, num9); int num11 = num10 & 0x1FE; float num12 = (float)i - x + RandVecs2D[num11] * num6; float num13 = (float)j - y + RandVecs2D[num11 | 1] * num6; float num14 = FastAbs(num12) + FastAbs(num13) + (num12 * num12 + num13 * num13); num4 = FastMax(FastMin(num4, num14), num3); if (num14 < num3) { num3 = num14; num5 = num10; } num9 += 1136930381; } num7 += 501125321; } break; } } if (mCellularDistanceFunction == CellularDistanceFunction.Euclidean && mCellularReturnType >= CellularReturnType.Distance) { num3 = FastSqrt(num3); if (mCellularReturnType >= CellularReturnType.Distance2) { num4 = FastSqrt(num4); } } return mCellularReturnType switch { CellularReturnType.CellValue => (float)num5 * 4.656613E-10f, CellularReturnType.Distance => num3 - 1f, CellularReturnType.Distance2 => num4 - 1f, CellularReturnType.Distance2Add => (num4 + num3) * 0.5f - 1f, CellularReturnType.Distance2Sub => num4 - num3 - 1f, CellularReturnType.Distance2Mul => num4 * num3 * 0.5f - 1f, CellularReturnType.Distance2Div => num3 / num4 - 1f, _ => 0f, }; } private float SingleCellular(int seed, float x, float y, float z) { int num = FastRound(x); int num2 = FastRound(y); int num3 = FastRound(z); float num4 = float.MaxValue; float num5 = float.MaxValue; int num6 = 0; float num7 = 0.39614353f * mCellularJitterModifier; int num8 = (num - 1) * 501125321; int num9 = (num2 - 1) * 1136930381; int num10 = (num3 - 1) * 1720413743; switch (mCellularDistanceFunction) { case CellularDistanceFunction.Euclidean: case CellularDistanceFunction.EuclideanSq: { for (int l = num - 1; l <= num + 1; l++) { int num19 = num9; for (int m = num2 - 1; m <= num2 + 1; m++) { int num20 = num10; for (int n = num3 - 1; n <= num3 + 1; n++) { int num21 = Hash(seed, num8, num19, num20); int num22 = num21 & 0x3FC; float num23 = (float)l - x + RandVecs3D[num22] * num7; float num24 = (float)m - y + RandVecs3D[num22 | 1] * num7; float num25 = (float)n - z + RandVecs3D[num22 | 2] * num7; float num26 = num23 * num23 + num24 * num24 + num25 * num25; num5 = FastMax(FastMin(num5, num26), num4); if (num26 < num4) { num4 = num26; num6 = num21; } num20 += 1720413743; } num19 += 1136930381; } num8 += 501125321; } break; } case CellularDistanceFunction.Manhattan: { for (int num27 = num - 1; num27 <= num + 1; num27++) { int num28 = num9; for (int num29 = num2 - 1; num29 <= num2 + 1; num29++) { int num30 = num10; for (int num31 = num3 - 1; num31 <= num3 + 1; num31++) { int num32 = Hash(seed, num8, num28, num30); int num33 = num32 & 0x3FC; float f = (float)num27 - x + RandVecs3D[num33] * num7; float f2 = (float)num29 - y + RandVecs3D[num33 | 1] * num7; float f3 = (float)num31 - z + RandVecs3D[num33 | 2] * num7; float num34 = FastAbs(f) + FastAbs(f2) + FastAbs(f3); num5 = FastMax(FastMin(num5, num34), num4); if (num34 < num4) { num4 = num34; num6 = num32; } num30 += 1720413743; } num28 += 1136930381; } num8 += 501125321; } break; } case CellularDistanceFunction.Hybrid: { for (int i = num - 1; i <= num + 1; i++) { int num11 = num9; for (int j = num2 - 1; j <= num2 + 1; j++) { int num12 = num10; for (int k = num3 - 1; k <= num3 + 1; k++) { int num13 = Hash(seed, num8, num11, num12); int num14 = num13 & 0x3FC; float num15 = (float)i - x + RandVecs3D[num14] * num7; float num16 = (float)j - y + RandVecs3D[num14 | 1] * num7; float num17 = (float)k - z + RandVecs3D[num14 | 2] * num7; float num18 = FastAbs(num15) + FastAbs(num16) + FastAbs(num17) + (num15 * num15 + num16 * num16 + num17 * num17); num5 = FastMax(FastMin(num5, num18), num4); if (num18 < num4) { num4 = num18; num6 = num13; } num12 += 1720413743; } num11 += 1136930381; } num8 += 501125321; } break; } } if (mCellularDistanceFunction == CellularDistanceFunction.Euclidean && mCellularReturnType >= CellularReturnType.Distance) { num4 = FastSqrt(num4); if (mCellularReturnType >= CellularReturnType.Distance2) { num5 = FastSqrt(num5); } } return mCellularReturnType switch { CellularReturnType.CellValue => (float)num6 * 4.656613E-10f, CellularReturnType.Distance => num4 - 1f, CellularReturnType.Distance2 => num5 - 1f, CellularReturnType.Distance2Add => (num5 + num4) * 0.5f - 1f, CellularReturnType.Distance2Sub => num5 - num4 - 1f, CellularReturnType.Distance2Mul => num5 * num4 * 0.5f - 1f, CellularReturnType.Distance2Div => num4 / num5 - 1f, _ => 0f, }; } private float SinglePerlin(int seed, float x, float y) { int num = FastFloor(x); int num2 = FastFloor(y); float num3 = x - (float)num; float num4 = y - (float)num2; float xd = num3 - 1f; float yd = num4 - 1f; float t = InterpQuintic(num3); float t2 = InterpQuintic(num4); num *= 501125321; num2 *= 1136930381; int xPrimed = num + 501125321; int yPrimed = num2 + 1136930381; float a = Lerp(GradCoord(seed, num, num2, num3, num4), GradCoord(seed, xPrimed, num2, xd, num4), t); float b = Lerp(GradCoord(seed, num, yPrimed, num3, yd), GradCoord(seed, xPrimed, yPrimed, xd, yd), t); return Lerp(a, b, t2) * 1.4247692f; } private float SinglePerlin(int seed, float x, float y, float z) { int num = FastFloor(x); int num2 = FastFloor(y); int num3 = FastFloor(z); float num4 = x - (float)num; float num5 = y - (float)num2; float num6 = z - (float)num3; float xd = num4 - 1f; float yd = num5 - 1f; float zd = num6 - 1f; float t = InterpQuintic(num4); float t2 = InterpQuintic(num5); float t3 = InterpQuintic(num6); num *= 501125321; num2 *= 1136930381; num3 *= 1720413743; int xPrimed = num + 501125321; int yPrimed = num2 + 1136930381; int zPrimed = num3 + 1720413743; float a = Lerp(GradCoord(seed, num, num2, num3, num4, num5, num6), GradCoord(seed, xPrimed, num2, num3, xd, num5, num6), t); float b = Lerp(GradCoord(seed, num, yPrimed, num3, num4, yd, num6), GradCoord(seed, xPrimed, yPrimed, num3, xd, yd, num6), t); float a2 = Lerp(GradCoord(seed, num, num2, zPrimed, num4, num5, zd), GradCoord(seed, xPrimed, num2, zPrimed, xd, num5, zd), t); float b2 = Lerp(GradCoord(seed, num, yPrimed, zPrimed, num4, yd, zd), GradCoord(seed, xPrimed, yPrimed, zPrimed, xd, yd, zd), t); float a3 = Lerp(a, b, t2); float b3 = Lerp(a2, b2, t2); return Lerp(a3, b3, t3) * 0.9649214f; } private float SingleValueCubic(int seed, float x, float y) { int num = FastFloor(x); int num2 = FastFloor(y); float t = x - (float)num; float t2 = y - (float)num2; num *= 501125321; num2 *= 1136930381; int xPrimed = num - 501125321; int yPrimed = num2 - 1136930381; int xPrimed2 = num + 501125321; int yPrimed2 = num2 + 1136930381; int xPrimed3 = num + 1002250642; int yPrimed3 = num2 + -2021106534; return CubicLerp(CubicLerp(ValCoord(seed, xPrimed, yPrimed), ValCoord(seed, num, yPrimed), ValCoord(seed, xPrimed2, yPrimed), ValCoord(seed, xPrimed3, yPrimed), t), CubicLerp(ValCoord(seed, xPrimed, num2), ValCoord(seed, num, num2), ValCoord(seed, xPrimed2, num2), ValCoord(seed, xPrimed3, num2), t), CubicLerp(ValCoord(seed, xPrimed, yPrimed2), ValCoord(seed, num, yPrimed2), ValCoord(seed, xPrimed2, yPrimed2), ValCoord(seed, xPrimed3, yPrimed2), t), CubicLerp(ValCoord(seed, xPrimed, yPrimed3), ValCoord(seed, num, yPrimed3), ValCoord(seed, xPrimed2, yPrimed3), ValCoord(seed, xPrimed3, yPrimed3), t), t2) * (4f / 9f); } private float SingleValueCubic(int seed, float x, float y, float z) { int num = FastFloor(x); int num2 = FastFloor(y); int num3 = FastFloor(z); float t = x - (float)num; float t2 = y - (float)num2; float t3 = z - (float)num3; num *= 501125321; num2 *= 1136930381; num3 *= 1720413743; int xPrimed = num - 501125321; int yPrimed = num2 - 1136930381; int zPrimed = num3 - 1720413743; int xPrimed2 = num + 501125321; int yPrimed2 = num2 + 1136930381; int zPrimed2 = num3 + 1720413743; int xPrimed3 = num + 1002250642; int yPrimed3 = num2 + -2021106534; int zPrimed3 = num3 + -854139810; return CubicLerp(CubicLerp(CubicLerp(ValCoord(seed, xPrimed, yPrimed, zPrimed), ValCoord(seed, num, yPrimed, zPrimed), ValCoord(seed, xPrimed2, yPrimed, zPrimed), ValCoord(seed, xPrimed3, yPrimed, zPrimed), t), CubicLerp(ValCoord(seed, xPrimed, num2, zPrimed), ValCoord(seed, num, num2, zPrimed), ValCoord(seed, xPrimed2, num2, zPrimed), ValCoord(seed, xPrimed3, num2, zPrimed), t), CubicLerp(ValCoord(seed, xPrimed, yPrimed2, zPrimed), ValCoord(seed, num, yPrimed2, zPrimed), ValCoord(seed, xPrimed2, yPrimed2, zPrimed), ValCoord(seed, xPrimed3, yPrimed2, zPrimed), t), CubicLerp(ValCoord(seed, xPrimed, yPrimed3, zPrimed), ValCoord(seed, num, yPrimed3, zPrimed), ValCoord(seed, xPrimed2, yPrimed3, zPrimed), ValCoord(seed, xPrimed3, yPrimed3, zPrimed), t), t2), CubicLerp(CubicLerp(ValCoord(seed, xPrimed, yPrimed, num3), ValCoord(seed, num, yPrimed, num3), ValCoord(seed, xPrimed2, yPrimed, num3), ValCoord(seed, xPrimed3, yPrimed, num3), t), CubicLerp(ValCoord(seed, xPrimed, num2, num3), ValCoord(seed, num, num2, num3), ValCoord(seed, xPrimed2, num2, num3), ValCoord(seed, xPrimed3, num2, num3), t), CubicLerp(ValCoord(seed, xPrimed, yPrimed2, num3), ValCoord(seed, num, yPrimed2, num3), ValCoord(seed, xPrimed2, yPrimed2, num3), ValCoord(seed, xPrimed3, yPrimed2, num3), t), CubicLerp(ValCoord(seed, xPrimed, yPrimed3, num3), ValCoord(seed, num, yPrimed3, num3), ValCoord(seed, xPrimed2, yPrimed3, num3), ValCoord(seed, xPrimed3, yPrimed3, num3), t), t2), CubicLerp(CubicLerp(ValCoord(seed, xPrimed, yPrimed, zPrimed2), ValCoord(seed, num, yPrimed, zPrimed2), ValCoord(seed, xPrimed2, yPrimed, zPrimed2), ValCoord(seed, xPrimed3, yPrimed, zPrimed2), t), CubicLerp(ValCoord(seed, xPrimed, num2, zPrimed2), ValCoord(seed, num, num2, zPrimed2), ValCoord(seed, xPrimed2, num2, zPrimed2), ValCoord(seed, xPrimed3, num2, zPrimed2), t), CubicLerp(ValCoord(seed, xPrimed, yPrimed2, zPrimed2), ValCoord(seed, num, yPrimed2, zPrimed2), ValCoord(seed, xPrimed2, yPrimed2, zPrimed2), ValCoord(seed, xPrimed3, yPrimed2, zPrimed2), t), CubicLerp(ValCoord(seed, xPrimed, yPrimed3, zPrimed2), ValCoord(seed, num, yPrimed3, zPrimed2), ValCoord(seed, xPrimed2, yPrimed3, zPrimed2), ValCoord(seed, xPrimed3, yPrimed3, zPrimed2), t), t2), CubicLerp(CubicLerp(ValCoord(seed, xPrimed, yPrimed, zPrimed3), ValCoord(seed, num, yPrimed, zPrimed3), ValCoord(seed, xPrimed2, yPrimed, zPrimed3), ValCoord(seed, xPrimed3, yPrimed, zPrimed3), t), CubicLerp(ValCoord(seed, xPrimed, num2, zPrimed3), ValCoord(seed, num, num2, zPrimed3), ValCoord(seed, xPrimed2, num2, zPrimed3), ValCoord(seed, xPrimed3, num2, zPrimed3), t), CubicLerp(ValCoord(seed, xPrimed, yPrimed2, zPrimed3), ValCoord(seed, num, yPrimed2, zPrimed3), ValCoord(seed, xPrimed2, yPrimed2, zPrimed3), ValCoord(seed, xPrimed3, yPrimed2, zPrimed3), t), CubicLerp(ValCoord(seed, xPrimed, yPrimed3, zPrimed3), ValCoord(seed, num, yPrimed3, zPrimed3), ValCoord(seed, xPrimed2, yPrimed3, zPrimed3), ValCoord(seed, xPrimed3, yPrimed3, zPrimed3), t), t2), t3) * (8f / 27f); } private float SingleValue(int seed, float x, float y) { int num = FastFloor(x); int num2 = FastFloor(y); float t = InterpHermite(x - (float)num); float t2 = InterpHermite(y - (float)num2); num *= 501125321; num2 *= 1136930381; int xPrimed = num + 501125321; int yPrimed = num2 + 1136930381; float a = Lerp(ValCoord(seed, num, num2), ValCoord(seed, xPrimed, num2), t); float b = Lerp(ValCoord(seed, num, yPrimed), ValCoord(seed, xPrimed, yPrimed), t); return Lerp(a, b, t2); } private float SingleValue(int seed, float x, float y, float z) { int num = FastFloor(x); int num2 = FastFloor(y); int num3 = FastFloor(z); float t = InterpHermite(x - (float)num); float t2 = InterpHermite(y - (float)num2); float t3 = InterpHermite(z - (float)num3); num *= 501125321; num2 *= 1136930381; num3 *= 1720413743; int xPrimed = num + 501125321; int yPrimed = num2 + 1136930381; int zPrimed = num3 + 1720413743; float a = Lerp(ValCoord(seed, num, num2, num3), ValCoord(seed, xPrimed, num2, num3), t); float b = Lerp(ValCoord(seed, num, yPrimed, num3), ValCoord(seed, xPrimed, yPrimed, num3), t); float a2 = Lerp(ValCoord(seed, num, num2, zPrimed), ValCoord(seed, xPrimed, num2, zPrimed), t); float b2 = Lerp(ValCoord(seed, num, yPrimed, zPrimed), ValCoord(seed, xPrimed, yPrimed, zPrimed), t); float a3 = Lerp(a, b, t2); float b3 = Lerp(a2, b2, t2); return Lerp(a3, b3, t3); } private void DoSingleDomainWarp(int seed, float amp, float freq, float x, float y, ref float xr, ref float yr) { switch (mDomainWarpType) { case DomainWarpType.OpenSimplex2: SingleDomainWarpSimplexGradient(seed, amp * 38.283688f, freq, x, y, ref xr, ref yr, outGradOnly: false); break; case DomainWarpType.OpenSimplex2Reduced: SingleDomainWarpSimplexGradient(seed, amp * 16f, freq, x, y, ref xr, ref yr, outGradOnly: true); break; case DomainWarpType.BasicGrid: SingleDomainWarpBasicGrid(seed, amp, freq, x, y, ref xr, ref yr); break; } } private void DoSingleDomainWarp(int seed, float amp, float freq, float x, float y, float z, ref float xr, ref float yr, ref float zr) { switch (mDomainWarpType) { case DomainWarpType.OpenSimplex2: SingleDomainWarpOpenSimplex2Gradient(seed, amp * 32.694283f, freq, x, y, z, ref xr, ref yr, ref zr, outGradOnly: false); break; case DomainWarpType.OpenSimplex2Reduced: SingleDomainWarpOpenSimplex2Gradient(seed, amp * 7.716049f, freq, x, y, z, ref xr, ref yr, ref zr, outGradOnly: true); break; case DomainWarpType.BasicGrid: SingleDomainWarpBasicGrid(seed, amp, freq, x, y, z, ref xr, ref yr, ref zr); break; } } private void DomainWarpSingle(ref float x, ref float y) { int seed = mSeed; float amp = mDomainWarpAmp * mFractalBounding; float freq = mFrequency; float x2 = x; float y2 = y; TransformDomainWarpCoordinate(ref x2, ref y2); DoSingleDomainWarp(seed, amp, freq, x2, y2, ref x, ref y); } private void DomainWarpSingle(ref float x, ref float y, ref float z) { int seed = mSeed; float amp = mDomainWarpAmp * mFractalBounding; float freq = mFrequency; float x2 = x; float y2 = y; float z2 = z; TransformDomainWarpCoordinate(ref x2, ref y2, ref z2); DoSingleDomainWarp(seed, amp, freq, x2, y2, z2, ref x, ref y, ref z); } private void DomainWarpFractalProgressive(ref float x, ref float y) { int num = mSeed; float num2 = mDomainWarpAmp * mFractalBounding; float num3 = mFrequency; for (int i = 0; i < mOctaves; i++) { float x2 = x; float y2 = y; TransformDomainWarpCoordinate(ref x2, ref y2); DoSingleDomainWarp(num, num2, num3, x2, y2, ref x, ref y); num++; num2 *= mGain; num3 *= mLacunarity; } } private void DomainWarpFractalProgressive(ref float x, ref float y, ref float z) { int num = mSeed; float num2 = mDomainWarpAmp * mFractalBounding; float num3 = mFrequency; for (int i = 0; i < mOctaves; i++) { float x2 = x; float y2 = y; float z2 = z; TransformDomainWarpCoordinate(ref x2, ref y2, ref z2); DoSingleDomainWarp(num, num2, num3, x2, y2, z2, ref x, ref y, ref z); num++; num2 *= mGain; num3 *= mLacunarity; } } private void DomainWarpFractalIndependent(ref float x, ref float y) { float x2 = x; float y2 = y; TransformDomainWarpCoordinate(ref x2, ref y2); int num = mSeed; float num2 = mDomainWarpAmp * mFractalBounding; float num3 = mFrequency; for (int i = 0; i < mOctaves; i++) { DoSingleDomainWarp(num, num2, num3, x2, y2, ref x, ref y); num++; num2 *= mGain; num3 *= mLacunarity; } } private void DomainWarpFractalIndependent(ref float x, ref float y, ref float z) { float x2 = x; float y2 = y; float z2 = z; TransformDomainWarpCoordinate(ref x2, ref y2, ref z2); int num = mSeed; float num2 = mDomainWarpAmp * mFractalBounding; float num3 = mFrequency; for (int i = 0; i < mOctaves; i++) { DoSingleDomainWarp(num, num2, num3, x2, y2, z2, ref x, ref y, ref z); num++; num2 *= mGain; num3 *= mLacunarity; } } private void SingleDomainWarpBasicGrid(int seed, float warpAmp, float frequency, float x, float y, ref float xr, ref float yr) { float num = x * frequency; float num2 = y * frequency; int num3 = FastFloor(num); int num4 = FastFloor(num2); float t = InterpHermite(num - (float)num3); float t2 = InterpHermite(num2 - (float)num4); num3 *= 501125321; num4 *= 1136930381; int xPrimed = num3 + 501125321; int yPrimed = num4 + 1136930381; int num5 = Hash(seed, num3, num4) & 0x1FE; int num6 = Hash(seed, xPrimed, num4) & 0x1FE; float a = Lerp(RandVecs2D[num5], RandVecs2D[num6], t); float a2 = Lerp(RandVecs2D[num5 | 1], RandVecs2D[num6 | 1], t); num5 = Hash(seed, num3, yPrimed) & 0x1FE; num6 = Hash(seed, xPrimed, yPrimed) & 0x1FE; float b = Lerp(RandVecs2D[num5], RandVecs2D[num6], t); float b2 = Lerp(RandVecs2D[num5 | 1], RandVecs2D[num6 | 1], t); xr += Lerp(a, b, t2) * warpAmp; yr += Lerp(a2, b2, t2) * warpAmp; } private void SingleDomainWarpBasicGrid(int seed, float warpAmp, float frequency, float x, float y, float z, ref float xr, ref float yr, ref float zr) { float num = x * frequency; float num2 = y * frequency; float num3 = z * frequency; int num4 = FastFloor(num); int num5 = FastFloor(num2); int num6 = FastFloor(num3); float t = InterpHermite(num - (float)num4); float t2 = InterpHermite(num2 - (float)num5); float t3 = InterpHermite(num3 - (float)num6); num4 *= 501125321; num5 *= 1136930381; num6 *= 1720413743; int xPrimed = num4 + 501125321; int yPrimed = num5 + 1136930381; int zPrimed = num6 + 1720413743; int num7 = Hash(seed, num4, num5, num6) & 0x3FC; int num8 = Hash(seed, xPrimed, num5, num6) & 0x3FC; float a = Lerp(RandVecs3D[num7], RandVecs3D[num8], t); float a2 = Lerp(RandVecs3D[num7 | 1], RandVecs3D[num8 | 1], t); float a3 = Lerp(RandVecs3D[num7 | 2], RandVecs3D[num8 | 2], t); num7 = Hash(seed, num4, yPrimed, num6) & 0x3FC; num8 = Hash(seed, xPrimed, yPrimed, num6) & 0x3FC; float b = Lerp(RandVecs3D[num7], RandVecs3D[num8], t); float b2 = Lerp(RandVecs3D[num7 | 1], RandVecs3D[num8 | 1], t); float b3 = Lerp(RandVecs3D[num7 | 2], RandVecs3D[num8 | 2], t); float a4 = Lerp(a, b, t2); float a5 = Lerp(a2, b2, t2); float a6 = Lerp(a3, b3, t2); num7 = Hash(seed, num4, num5, zPrimed) & 0x3FC; num8 = Hash(seed, xPrimed, num5, zPrimed) & 0x3FC; a = Lerp(RandVecs3D[num7], RandVecs3D[num8], t); a2 = Lerp(RandVecs3D[num7 | 1], RandVecs3D[num8 | 1], t); a3 = Lerp(RandVecs3D[num7 | 2], RandVecs3D[num8 | 2], t); num7 = Hash(seed, num4, yPrimed, zPrimed) & 0x3FC; num8 = Hash(seed, xPrimed, yPrimed, zPrimed) & 0x3FC; b = Lerp(RandVecs3D[num7], RandVecs3D[num8], t); b2 = Lerp(RandVecs3D[num7 | 1], RandVecs3D[num8 | 1], t); b3 = Lerp(RandVecs3D[num7 | 2], RandVecs3D[num8 | 2], t); xr += Lerp(a4, Lerp(a, b, t2), t3) * warpAmp; yr += Lerp(a5, Lerp(a2, b2, t2), t3) * warpAmp; zr += Lerp(a6, Lerp(a3, b3, t2), t3) * warpAmp; } private void SingleDomainWarpSimplexGradient(int seed, float warpAmp, float frequency, float x, float y, ref float xr, ref float yr, bool outGradOnly) { x *= frequency; y *= frequency; int num = FastFloor(x); int num2 = FastFloor(y); float num3 = x - (float)num; float num4 = y - (float)num2; float num5 = (num3 + num4) * 0.21132487f; float num6 = num3 - num5; float num7 = num4 - num5; num *= 501125321; num2 *= 1136930381; float num9; float num8 = (num9 = 0f); float num10 = 0.5f - num6 * num6 - num7 * num7; if (num10 > 0f) { float num11 = num10 * num10 * (num10 * num10); float xo; float yo; if (outGradOnly) { GradCoordOut(seed, num, num2, out xo, out yo); } else { GradCoordDual(seed, num, num2, num6, num7, out xo, out yo); } num8 += num11 * xo; num9 += num11 * yo; } float num12 = 3.1547005f * num5 + (-0.6666666f + num10); if (num12 > 0f) { float xd = num6 + -0.57735026f; float yd = num7 + -0.57735026f; float num13 = num12 * num12 * (num12 * num12); float xo2; float yo2; if (outGradOnly) { GradCoordOut(seed, num + 501125321, num2 + 1136930381, out xo2, out yo2); } else { GradCoordDual(seed, num + 501125321, num2 + 1136930381, xd, yd, out xo2, out yo2); } num8 += num13 * xo2; num9 += num13 * yo2; } if (num7 > num6) { float num14 = num6 + 0.21132487f; float num15 = num7 + -0.7886751f; float num16 = 0.5f - num14 * num14 - num15 * num15; if (num16 > 0f) { float num17 = num16 * num16 * (num16 * num16); float xo3; float yo3; if (outGradOnly) { GradCoordOut(seed, num, num2 + 1136930381, out xo3, out yo3); } else { GradCoordDual(seed, num, num2 + 1136930381, num14, num15, out xo3, out yo3); } num8 += num17 * xo3; num9 += num17 * yo3; } } else { float num18 = num6 + -0.7886751f; float num19 = num7 + 0.21132487f; float num20 = 0.5f - num18 * num18 - num19 * num19; if (num20 > 0f) { float num21 = num20 * num20 * (num20 * num20); float xo4; float yo4; if (outGradOnly) { GradCoordOut(seed, num + 501125321, num2, out xo4, out yo4); } else { GradCoordDual(seed, num + 501125321, num2, num18, num19, out xo4, out yo4); } num8 += num21 * xo4; num9 += num21 * yo4; } } xr += num8 * warpAmp; yr += num9 * warpAmp; } private void SingleDomainWarpOpenSimplex2Gradient(int seed, float warpAmp, float frequency, float x, float y, float z, ref float xr, ref float yr, ref float zr, bool outGradOnly) { x *= frequency; y *= frequency; z *= frequency; int num = FastRound(x); int num2 = FastRound(y); int num3 = FastRound(z); float num4 = x - (float)num; float num5 = y - (float)num2; float num6 = z - (float)num3; int num7 = (int)(0f - num4 - 1f) | 1; int num8 = (int)(0f - num5 - 1f) | 1; int num9 = (int)(0f - num6 - 1f) | 1; float num10 = (float)num7 * (0f - num4); float num11 = (float)num8 * (0f - num5); float num12 = (float)num9 * (0f - num6); num *= 501125321; num2 *= 1136930381; num3 *= 1720413743; float num14; float num15; float num13 = (num14 = (num15 = 0f)); float num16 = 0.6f - num4 * num4 - (num5 * num5 + num6 * num6); int num17 = 0; while (true) { if (num16 > 0f) { float num18 = num16 * num16 * (num16 * num16); float xo; float yo; float zo; if (outGradOnly) { GradCoordOut(seed, num, num2, num3, out xo, out yo, out zo); } else { GradCoordDual(seed, num, num2, num3, num4, num5, num6, out xo, out yo, out zo); } num13 += num18 * xo; num14 += num18 * yo; num15 += num18 * zo; } float num19 = num16; int num20 = num; int num21 = num2; int num22 = num3; float num23 = num4; float num24 = num5; float num25 = num6; if (num10 >= num11 && num10 >= num12) { num23 += (float)num7; num19 = num19 + num10 + num10; num20 -= num7 * 501125321; } else if (num11 > num10 && num11 >= num12) { num24 += (float)num8; num19 = num19 + num11 + num11; num21 -= num8 * 1136930381; } else { num25 += (float)num9; num19 = num19 + num12 + num12; num22 -= num9 * 1720413743; } if (num19 > 1f) { num19 -= 1f; float num26 = num19 * num19 * (num19 * num19); float xo2; float yo2; float zo2; if (outGradOnly) { GradCoordOut(seed, num20, num21, num22, out xo2, out yo2, out zo2); } else { GradCoordDual(seed, num20, num21, num22, num23, num24, num25, out xo2, out yo2, out zo2); } num13 += num26 * xo2; num14 += num26 * yo2; num15 += num26 * zo2; } if (num17 == 1) { break; } num10 = 0.5f - num10; num11 = 0.5f - num11; num12 = 0.5f - num12; num4 = (float)num7 * num10; num5 = (float)num8 * num11; num6 = (float)num9 * num12; num16 += 0.75f - num10 - (num11 + num12); num += (num7 >> 1) & 0x1DDE90C9; num2 += (num8 >> 1) & 0x43C42E4D; num3 += (num9 >> 1) & 0x668B6E2F; num7 = -num7; num8 = -num8; num9 = -num9; seed += 1293373; num17++; } xr += num13 * warpAmp; yr += num14 * warpAmp; zr += num15 * warpAmp; } } public static class Generator { public struct Entry { public int Biome; public string Title; public Entry(int biome, string title) { Biome = biome; Title = title; } } public static readonly Entry[] ORDER = new Entry[7] { new Entry(0, "Луга"), new Entry(1, "Лес"), new Entry(4, "Каньоны"), new Entry(5, "Болота"), new Entry(2, "Снежные горы"), new Entry(3, "Вулкан"), new Entry(6, "Мёртвые земли") }; public static int Count => ORDER.Length; public static string TitleOf(int index) { return ORDER[(int)GD.posmod(index, ORDER.Length)].Title; } public static LocationData Make(int locationIndex, int seed, bool prepareCliffs = true) { LocationData locationData = null; LocationData locationData2 = null; int num = int.MaxValue; for (int i = 0; i < 6; i++) { locationData = MakeOnce(locationIndex, seed + i * 100003); Prof.Mark("check"); Tools.SnapSites(locationData); Tools.CheckResult checkResult = Tools.Check(locationData, 196.0); Prof.Mark(null); if (checkResult.Ok) { locationData.Retries = i; locationData2 = locationData; break; } int num2 = 0; foreach (string reason in checkResult.Reasons) { num2 += (reason.StartsWith("до алтаря") ? 1000 : ((!reason.StartsWith("алтарь слишком")) ? 1 : 100)); } if (num2 < num) { num = num2; locationData2 = locationData; locationData2.Retries = i; } } locationData = locationData2; Prof.Mark("cliffs.prepare"); if (prepareCliffs) { Cliffs.Prepare(locationData); } Prof.Mark(null); return locationData; } public static LocationData MakeOnce(int index, int seed) { Entry entry = ORDER[(int)GD.posmod(index, ORDER.Length)]; return Tiers.Build(seed, entry.Biome, entry.Title, OptionsFor(entry.Title)); } private static TierOptions O(params object[] kv) { TierOptions tierOptions = new TierOptions(); for (int i = 0; i < kv.Length; i += 2) { tierOptions[(string)kv[i]] = kv[i + 1]; } return tierOptions; } private static Col C(string hex) { return Col.Html(hex); } public static TierOptions OptionsFor(string title) { return title switch { "Луга" => O("home", "поселение", "god", "hand", "hills", 3.2, "roll", 1.4, "layout", "bowl", "pit", 22.0, "heights", new double[5] { 3.0, 11.0, 19.0, 28.0, 38.0 }, "cells", 17, "spacing", 58.0, "jitter", 1.0, "sunk", 1, "sunk_m", -1.6, "tunnels", 1, "caves", 1, "stairs", 2, "falls", 4), "Лес" => O("home", "лагерь охотников", "god", "ribs", "density", 1.2, "hills", 1.6, "layout", "axis", "jitter", 0.8, "heights", new double[7] { 0.0, 14.0, 28.0, 43.0, 58.0, 74.0, 90.0 }, "cells", 26, "spacing", 44.0, "liquid", "clouds", "liquid_level", -70.0, "void", true, "isles", true, "gap", 13.0, "sunk", 6, "sunk_m", -160.0, "edge_m", -160.0, "edge_soft", 3.0, "bridge", "rope", "rope", true, "link_max", 95.0, "tunnels", 1, "caves", 2, "stairs", 4, "spans", 1, "falls", 3, "ground", C("3d6670"), "tint", C("3f7a74"), "rock", C("5a5480"), "dry", 0.0, "far_color", C("1c1a2c")), "Каньоны" => O("home", "руины храма", "god", "leg", "liquid", "none", "density", 0.6, "heights", new double[3] { 0.0, 24.0, 47.0 }, "layout", "canyon", "start_tier", 1, "altar_tier", 1, "steep_top", true, "cells", 40, "spacing", 32.0, "jitter", 0.0, "spans", 5, "rope_mix", true, "tunnels", 4, "caves", 3, "stairs", 2, "rock", C("a8744e"), "dry", 0.4, "tint", C("d9a86a"), "far_color", C("c39a64")), "Болота" => O("home", "посёлок на сваях", "god", "arm", "heights", new double[4] { -0.4, 4.0, 9.0, 15.0 }, "roll", 0.3, "isles", true, "gap", 11.0, "sunk", 4, "sunk_m", -3.0, "bridge", "rope", "caves", 1, "stairs", 1, "cells", 22, "spacing", 50.0, "density", 1.4, "rock", C("4f4c3e"), "tint", C("6a7a42"), "far_color", C("3f4a3c")), "Снежные горы" => O("home", "стоянка", "god", "spine", "radial", true, "jitter", 0.8, "peak_power", 1.3, "horns", 6, "heights", new double[6] { 0.0, 12.0, 24.0, 37.0, 50.0, 64.0 }, "density", 0.6, "rock", C("7f8a96"), "liquid", "clouds", "liquid_level", -70.0, "void", true, "isles", true, "gap", 12.0, "sunk", 3, "sunk_m", -160.0, "edge_m", -160.0, "edge_soft", 3.0, "bridge", "stone", "link_max", 95.0, "cells", 20, "spacing", 50.0, "tunnels", 1, "caves", 2, "stairs", 4, "snow_line", 6.0, "dry", 0.0, "tint", C("e8eef2"), "far_color", C("5d6f80")), "Вулкан" => O("home", "кузня", "god", "jaw", "liquid", "lava", "layout", "crater", "pit", 34.0, "stream", true, "jitter", 0.7, "sunk", 4, "sunk_m", -3.0, "heights", new double[4] { 4.0, 16.0, 29.0, 43.0 }, "cells", 26, "spacing", 44.0, "density", 0.7, "tunnels", 1, "caves", 1, "stairs", 2, "falls", 6, "rock", C("1f1c21"), "dry", 0.1, "ground", C("332f35"), "tint", C("5c5559"), "far_color", C("2a2426"), "spans", 2), "Мёртвые земли" => O("home", "руины", "god", "skull", "liquid", "clouds", "liquid_level", -42.0, "void", true, "heights", new double[4] { 0.0, 12.0, 25.0, 39.0 }, "cells", 24, "spacing", 46.0, "isles", true, "gap", 10.0, "sunk", 6, "sunk_m", -120.0, "edge_m", -120.0, "edge_soft", 3.0, "bridge", "rope", "rope", true, "spans", 0, "stairs", 2, "density", 0.6, "rock", C("4c4858"), "dry", 0.1, "ground", C("a39c90"), "tint", C("cfc6b0")), _ => throw new KeyNotFoundException(title), }; } } public static class GD { public const double TAU = Math.PI * 2.0; public const double PI = Math.PI; public static readonly V2 INF2 = new V2(float.PositiveInfinity, float.PositiveInfinity); public static bool FusedF = false; public static bool FusedD = false; public static Func<float, float> CosF = (float x) => (float)Math.Cos(x); public static Func<float, float> SinF = (float x) => (float)Math.Sin(x); public static float FmaF(float a, float b, float c) { if (!FusedF) { return a * b + c; } return (float)((double)a * (double)b + (double)c); } public static double FmaD(double a, double b, double c) { if (!FusedD) { return a * b + c; } return SoftFma.Fma(a, b, c); } public static double lerpf(double a, double b, double w) { return FmaD(b - a, w, a); } public static double clampf(double v, double lo, double hi) { if (!(v < lo)) { if (!(v > hi)) { return v; } return hi; } return lo; } public static long clampi(long v, long lo, long hi) { if (v >= lo) { if (v <= hi) { return v; } return hi; } return lo; } public static double absf(double v) { return Math.Abs(v); } public static double maxf(double a, double b) { if (!(a > b)) { return b; } return a; } public static double minf(double a, double b) { if (!(a < b)) { return b; } return a; } public static long maxi(long a, long b) { if (a <= b) { return b; } return a; } public static long mini(long a, long b) { if (a >= b) { return b; } return a; } public static long absi(long a) { if (a >= 0) { return a; } return -a; } public static double smoothstep(double from, double to, double s) { if (IsEqualApprox(from, to)) { if (from <= to) { if (!(s <= from)) { return 1.0; } return 0.0; } if (!(s <= to)) { return 0.0; } return 1.0; } double num = (s - from) / (to - from); num = ((num < 0.0) ? 0.0 : ((num > 1.0) ? 1.0 : num)); return num * num * (3.0 - 2.0 * num); } public static bool IsEqualApprox(double a, double b) { if (a == b) { return true; } double num = 1E-05 * Math.Abs(a); if (num < 1E-05) { num = 1E-05; } return Math.Abs(a - b) < num; } public static long roundi(double v) { return (long)Math.Round(v, MidpointRounding.AwayFromZero); } public static long posmod(long a, long b) { long num = a % b; if ((num < 0 && b > 0) || (num > 0 && b < 0)) { num += b; } return num; } public static long idiv(long a, long b) { return a / b; } public static float Sqrtf(float v) { return (float)Math.Sqrt(v); } }
plugins/DeadGodLocations/DeadGodLocations.Structures.dll
Decompiled 34 minutes ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using DeadGodLocations.Gen; using Microsoft.CodeAnalysis; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("DeadGodLocations.Structures")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+e6165f6fae17311965941a047e30de40aad4c311")] [assembly: AssemblyProduct("DeadGodLocations.Structures")] [assembly: AssemblyTitle("DeadGodLocations.Structures")] [assembly: AssemblyVersion("1.0.0.0")] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [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 DeadGodLocations.Structures { public static class Buildings { public static readonly Col WOOD = Col.Html("7a5a3c"); public static readonly Col DARK_WOOD = Col.Html("4f3a28"); public static readonly Col STONE = Col.Html("8c8780"); public static readonly Col DARK_STONE = Col.Html("5e5a58"); public static readonly Col PLASTER = Col.Html("d9cdb4"); public static readonly Col ROOF_RED = Col.Html("a85a44"); public static readonly Col THATCH = Col.Html("b89c58"); public static readonly Col FIRE = new Col(1.0, 0.55, 0.15, 0.3); public static readonly Col HEART = new Col(1.0, 0.3, 0.42, 0.15); private static readonly Col LAMP_GLOW = new Col(1.0, 0.82, 0.45, 0.3); private const double PI = Math.PI; private const double TAU = Math.PI * 2.0; private static readonly Col TILE = Col.Html("57524e"); private static readonly Col TILE_RED = Col.Html("8c3a32"); private static readonly Col LANTERN = Col.Html("f2b25c"); private static Col C(string hex) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return Col.Html(hex); } private static Vec3 V(double x, double y, double z) { return new Vec3(x, y, z); } public static void Sign(Kit kit, Col color, int shape) { //IL_001e: 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_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0060: 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_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_0153: 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) kit.Cylinder(0.16, 0.1, 11.0, 5L, DARK_WOOD, V(0.0, 5.5, 0.0), solid: true); Col color2 = default(Col); ((Col)(ref color2))..ctor(color.r, color.g, color.b, 0.3f); switch (shape) { case 0: kit.Box(V(0.08, 2.6, 1.5), color, V(0.0, 9.4, 0.85), solid: false); kit.Box(V(0.08, 1.3, 0.9), ((Col)(ref color)).Darkened(0.25), V(0.0, 8.7, 2.0), solid: false); break; case 1: kit.Cylinder(1.1, 1.1, 0.16, 8L, color, V(0.0, 9.6, 0.0), solid: false, V(0.0, 0.0, Math.PI / 2.0)); break; default: kit.Box(V(0.1, 1.7, 1.7), color, V(0.0, 9.6, 0.0), solid: false, V(Math.PI / 4.0, 0.0, 0.0)); break; } kit.Ball(0.42, color2, V(0.0, 11.3, 0.0)); } public static void Span(Kit kit, V2 from, V2 to, double fromY, double toY, bool stone, bool slabs = false) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_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_0069: 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) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0097: 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_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0132: 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_03dd: Unknown result type (might be due to invalid IL or missing references) //IL_03e2: Unknown result type (might be due to invalid IL or missing references) //IL_03d1: Unknown result type (might be due to invalid IL or missing references) //IL_03c5: Unknown result type (might be due to invalid IL or missing references) //IL_0409: Unknown result type (might be due to invalid IL or missing references) //IL_040e: Unknown result type (might be due to invalid IL or missing references) //IL_03fd: Unknown result type (might be due to invalid IL or missing references) //IL_03f1: Unknown result type (might be due to invalid IL or missing references) //IL_0435: Unknown result type (might be due to invalid IL or missing references) //IL_043a: Unknown result type (might be due to invalid IL or missing references) //IL_0429: Unknown result type (might be due to invalid IL or missing references) //IL_041d: Unknown result type (might be due to invalid IL or missing references) //IL_0459: Unknown result type (might be due to invalid IL or missing references) //IL_045c: Unknown result type (might be due to invalid IL or missing references) //IL_0461: Unknown result type (might be due to invalid IL or missing references) //IL_048b: Unknown result type (might be due to invalid IL or missing references) //IL_04b6: Unknown result type (might be due to invalid IL or missing references) //IL_0509: Unknown result type (might be due to invalid IL or missing references) //IL_0af5: Unknown result type (might be due to invalid IL or missing references) //IL_0b03: Unknown result type (might be due to invalid IL or missing references) //IL_0989: Unknown result type (might be due to invalid IL or missing references) //IL_098e: Unknown result type (might be due to invalid IL or missing references) //IL_09a2: Unknown result type (might be due to invalid IL or missing references) //IL_07eb: Unknown result type (might be due to invalid IL or missing references) //IL_07f0: Unknown result type (might be due to invalid IL or missing references) //IL_0804: Unknown result type (might be due to invalid IL or missing references) //IL_057a: Unknown result type (might be due to invalid IL or missing references) //IL_0916: Unknown result type (might be due to invalid IL or missing references) //IL_05f8: Unknown result type (might be due to invalid IL or missing references) //IL_060d: Unknown result type (might be due to invalid IL or missing references) //IL_0b27: Unknown result type (might be due to invalid IL or missing references) //IL_0b2c: Unknown result type (might be due to invalid IL or missing references) //IL_0b35: Unknown result type (might be due to invalid IL or missing references) //IL_0b44: Unknown result type (might be due to invalid IL or missing references) //IL_0a34: Unknown result type (might be due to invalid IL or missing references) //IL_0a8a: Unknown result type (might be due to invalid IL or missing references) //IL_0721: Unknown result type (might be due to invalid IL or missing references) //IL_0774: Unknown result type (might be due to invalid IL or missing references) //IL_0660: Unknown result type (might be due to invalid IL or missing references) //IL_06c4: Unknown result type (might be due to invalid IL or missing references) //IL_0bd7: Unknown result type (might be due to invalid IL or missing references) //IL_0bd0: Unknown result type (might be due to invalid IL or missing references) //IL_0c62: Unknown result type (might be due to invalid IL or missing references) //IL_0c37: Unknown result type (might be due to invalid IL or missing references) double num = ((V2)(ref from)).DistanceTo(to); V2 val = to - from; V2 val2 = ((V2)(ref val)).Normalized(); double angle = Math.Atan2(val2.x, val2.y); long num2 = Math.Max((long)(num / 2.5), 1L); double num3 = num / (double)num2; long num4 = -1L; long num5 = -1L; List<float> list = new List<float>(); V2[] array = (V2[])(object)new V2[5] { V2.ZERO, val2 * 1.1, val2 * -1.1, ((V2)(ref val2)).Orthogonal() * 1.4, ((V2)(ref val2)).Orthogonal() * -1.4 }; for (long num6 = 0L; num6 < num2 + 1; num6++) { V2 val3 = ((V2)(ref from)).Lerp(to, (double)num6 / (double)num2); double num7 = -1000000000.0; V2[] array2 = array; foreach (V2 val4 in array2) { num7 = GD.maxf(num7, kit.HeightAt((double)kit.Origin.x + (double)val3.x + (double)val4.x, (double)kit.Origin.z + (double)val3.y + (double)val4.y) - (double)kit.Origin.y); } list.Add((float)num7); if (GD.lerpf(fromY, toY, (double)num6 / (double)num2) - (double)list[(int)num6] > 1.0) { if (num4 < 0) { num4 = num6; } num5 = num6; } } long num8 = Math.Max(num4 - 1, 0L); while (num8 > 0 && GD.lerpf(fromY, toY, (double)num8 / (double)num2) - (double)list[(int)num8] > 0.3) { num8--; } long num9; for (num9 = Math.Min(num5 + 1, num2); num9 < num2 && GD.lerpf(fromY, toY, (double)num9 / (double)num2) - (double)list[(int)num9] > 0.3; num9++) { } double num10 = (slabs ? 0.0 : GD.minf(1.1, 0.05 * (double)(num9 - num8) * num3)); List<float> list2 = new List<float>(); for (long num11 = 0L; num11 < num2 + 1; num11++) { double num12 = (double)num11 / (double)num2; if (stone || num4 < 0) { list2.Add((float)(GD.lerpf(fromY, toY, num12) + (stone ? (0.8 * Math.Sin(num12 * Math.PI)) : 0.0))); continue; } if (num11 <= num8 || num11 >= num9) { list2.Add((float)((double)list[(int)num11] + 0.08)); continue; } double num13 = (double)(num11 - num8) / (double)(num9 - num8); list2.Add((float)GD.maxf(GD.lerpf((double)list[(int)num8] + 0.08, (double)list[(int)num9] + 0.08, num13) - num10 * Math.Sin(Math.PI * num13), (double)list[(int)num11] + 0.08)); } string obj = ((kit.Data != null) ? kit.Data.Title : ""); bool flag = obj == "Снежные горы"; bool flag2 = obj == "Каньоны"; Col color = (flag ? C("aab4c4") : (flag2 ? C("a8704a") : C("3a3336"))); Col color2 = (flag ? C("8c96a8") : (flag2 ? C("8e5a3a") : C("332c2f"))); Col color3 = (flag ? C("7a8496") : (flag2 ? C("7a4a30") : C("2a2426"))); for (long num14 = 0L; num14 < num2; num14++) { double num15 = ((double)num14 + 0.5) / (double)num2; V2 val5 = ((V2)(ref from)).Lerp(to, num15); double num16 = Math.Atan2((double)list2[(int)num14 + 1] - (double)list2[(int)num14], num3); kit.Base = new Xf(Basis.Yaw(angle), V(val5.x, ((double)list2[(int)num14] + (double)list2[(int)num14 + 1]) * 0.5, val5.y)); Col val6; if (stone) { kit.Box(V(5.0, 0.9, num3 + 0.2), ((Col)(ref color)).Lightened(0.06 * (double)(num14 % 3)), V(0.0, -0.4, 0.0), solid: true, V(0.0 - num16, 0.0, 0.0)); if (flag) { kit.Box(V(4.4, 0.12, num3 + 0.1), C("eef2f6"), V(0.0, 0.08, 0.0), solid: false, V(0.0 - num16, 0.0, 0.0)); } if (num14 % 4 == 2) { double num17 = (double)kit.Origin.y + (double)kit.Base.origin.y; double num18 = kit.HeightAt((double)kit.Origin.x + (double)val5.x, (double)kit.Origin.z + (double)val5.y); if (num17 - num18 > 3.0 && num17 - num18 < 45.0) { kit.Box(V(2.6, num17 - num18, 2.0), color2, V(0.0, (0.0 - (num17 - num18)) * 0.5 - 0.6, 0.0)); kit.Box(V(4.6, 1.2, 2.6), color, V(0.0, -1.4, 0.0), solid: false); } } if (num14 % 3 == 0L) { kit.Box(V(0.7, 0.9, 0.7), color3, V(-2.3, 0.4, 0.0), solid: false); kit.Box(V(0.7, 0.9, 0.7), color3, V(2.3, 0.4, 0.0), solid: false); } } else if (slabs) { Vec3 size = V(3.4 - 0.5 * (double)(num14 % 2), 0.6, num3 * 0.84); val6 = C("8a8494"); kit.Box(size, ((Col)(ref val6)).Darkened(0.08 * (double)(num14 % 3)), V(0.0, -0.3, 0.0), solid: false, V(0.0 - num16, 0.0, 0.0)); kit.Solids.Add((V(3.0, 0.6, num3 + 0.2), kit.Base * new Xf(Basis.FromEuler(V(0.0 - num16, 0.0, 0.0)), V(0.0, -0.3, 0.0)))); if (num14 % 2 == 0L) { kit.Cylinder(0.5, 0.0, 1.8, 5L, new Col(0.72, 0.48, 1.0, 0.6), V(0.0, -1.5, 0.0), solid: false, V(Math.PI, 0.0, 0.0)); } } else { Vec3 size2 = V(2.6, 0.18, num3 + 0.15); val6 = WOOD; kit.Box(size2, ((Col)(ref val6)).Darkened(0.1 * (double)(num14 % 2)), V(0.0, -0.09, 0.0), solid: true, V(0.0 - num16, 0.0, 0.0)); double[] array3 = new double[2] { -1.25, 1.25 }; foreach (double x in array3) { kit.Cylinder(0.06, 0.06, 1.1, 4L, DARK_WOOD, V(x, 0.5, 0.0)); kit.Box(V(0.05, 0.05, num3 + 0.15), C("b89c58"), V(x, 1.0, 0.0), solid: false, V(0.0 - num16, 0.0, 0.0)); } } } if (slabs) { return; } (V2, double)[] array4 = new(V2, double)[2] { (from, fromY), (to, toY) }; for (int i = 0; i < array4.Length; i++) { (V2, double) tuple = array4[i]; V2 item = tuple.Item1; kit.Base = new Xf(Basis.Yaw(angle), V(item.x, tuple.Item2, item.y)); double[] array3 = ((!stone) ? new double[2] { -1.7, 1.7 } : new double[2] { -2.9, 2.9 }); foreach (double x2 in array3) { kit.Cylinder(0.22, 0.18, 2.4, 5L, stone ? DARK_STONE : DARK_WOOD, V(x2, 1.0, 0.0), solid: true); kit.Ball(0.2, stone ? new Col(1.0, 0.75, 0.35, 0.3) : new Col(0.8, 0.75, 1.0, 0.3), V(x2, 2.4, 0.0)); } } } public static void Lookout(Kit kit) { //IL_0001: 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_0072: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: Unknown result type (might be due to invalid IL or missing references) kit.Place(V2.ZERO); kit.Ball(0.8, STONE, V(0.0, 0.4, 0.0), V(1.3, 0.8, 1.2)); kit.Ball(0.55, DARK_STONE, V(0.1, 1.05, 0.0), V(1.2, 0.8, 1.1)); kit.Ball(0.35, STONE, V(0.0, 1.55, 0.05)); kit.Place(new V2(3.0, 1.5), 0.5); kit.Box(V(2.2, 0.14, 0.5), WOOD, V(0.0, 0.55, 0.0), solid: false); kit.Box(V(0.14, 0.55, 0.4), DARK_WOOD, V(-0.9, 0.27, 0.0), solid: false); kit.Box(V(0.14, 0.55, 0.4), DARK_WOOD, V(0.9, 0.27, 0.0), solid: false); kit.Place(new V2(-3.0, -1.0)); kit.Cylinder(0.12, 0.08, 8.0, 5L, DARK_WOOD, V(0.0, 4.0, 0.0), solid: true); kit.Box(V(2.0, 0.9, 0.05), C("d8c36a"), V(1.1, 7.3, 0.0), solid: false); } public static void House(Kit kit, double width, double depth, Col wall, Col roofColor, bool broken = false) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: 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_0132: Unknown result type (might be due to invalid IL or missing references) kit.Box(V(width, 3.0, depth), wall, V(0.0, 1.5, 0.0)); if (broken) { kit.Box(V(width * 0.5, 0.3, depth + 0.6), roofColor, V((0.0 - width) * 0.25, 3.5, 0.0), solid: false, V(0.0, 0.0, 0.5)); } else { kit.Roof(V(width + 0.8, 2.2, depth + 0.8), roofColor, V(0.0, 4.1, 0.0)); } kit.Box(V(1.1, 2.0, 0.2), DARK_WOOD, V(0.0, 1.0, depth * 0.5 + 0.05), solid: false); } public static void Campfire(Kit kit) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_0266: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < 9; i++) { double num = Math.PI * 2.0 * (double)i / 9.0; double radius = 0.26 + 0.05 * (double)(i % 3); Col dARK_STONE = DARK_STONE; kit.Ball(radius, ((Col)(ref dARK_STONE)).Lightened(0.04 * (double)(i % 2)), V(Math.Cos(num) * 0.95, 0.12, Math.Sin(num) * 0.95), V(1.2, 0.75, 1.0)); } kit.Cylinder(0.75, 0.75, 0.06, 8L, C("2a2220"), V(0.0, 0.03, 0.0)); for (int j = 0; j < 4; j++) { double num2 = Math.PI * 2.0 * (double)j / 4.0 + 0.4; kit.Cylinder(0.08, 0.07, 1.1, 5L, C("5a4330"), V(Math.Cos(num2) * 0.22, 0.38, Math.Sin(num2) * 0.22), solid: false, V(Math.Sin(num2) * 0.55, 0.0, (0.0 - Math.Cos(num2)) * 0.55)); } kit.Cylinder(0.55, 0.0, 1.3, 5L, FIRE, V(0.0, 0.85, 0.0)); kit.Smoke(V(0.0, 1.6, 0.0)); kit.Cylinder(0.22, 0.2, 2.0, 7L, DARK_WOOD, V(2.2, 0.22, 0.6), solid: false, V(0.0, 0.5, Math.PI / 2.0)); } public static void Well(Kit kit) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) kit.Cylinder(1.3, 1.3, 1.0, 8L, STONE, V(0.0, 0.5, 0.0), solid: true); kit.Cylinder(0.12, 0.12, 2.4, 4L, DARK_WOOD, V(-1.1, 1.7, 0.0)); kit.Cylinder(0.12, 0.12, 2.4, 4L, DARK_WOOD, V(1.1, 1.7, 0.0)); kit.Roof(V(3.0, 1.0, 2.2), ROOF_RED, V(0.0, 3.3, 0.0)); } public static void Tower(Kit kit, double height) { //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_028a: Unknown result type (might be due to invalid IL or missing references) Vec3[] array = new Vec3[4] { V(-1.6, 0.0, -1.6), V(1.6, 0.0, -1.6), V(-1.6, 0.0, 1.6), V(1.6, 0.0, 1.6) }; foreach (Vec3 vec in array) { kit.Cylinder(0.22, 0.22, height, 5L, DARK_WOOD, vec + V(0.0, height * 0.5, 0.0)); } kit.Box(V(4.4, 0.3, 4.4), WOOD, V(0.0, height, 0.0), solid: false); kit.Box(V(4.4, 1.0, 0.15), WOOD, V(0.0, height + 0.65, 2.1), solid: false); kit.Box(V(4.4, 1.0, 0.15), WOOD, V(0.0, height + 0.65, -2.1), solid: false); kit.Cylinder(3.4, 0.0, 2.2, 4L, DARK_WOOD, V(0.0, height + 3.3, 0.0), solid: false, V(0.0, Math.PI / 4.0, 0.0)); kit.Box(V(3.6, height, 3.6), DARK_WOOD, V(0.0, -50.0, 0.0)); kit.Solids[kit.Solids.Count - 1] = (V(3.6, height, 3.6), kit.Base * new Xf(Basis.IDENTITY, V(0.0, height * 0.5, 0.0))); } public static void Column(Kit kit, double height, Col color, bool fallen = false) { //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) if (fallen) { kit.Cylinder(0.6, 0.6, height, 7L, color, V(0.0, 0.6, 0.0), solid: true, V(0.0, 0.0, Math.PI / 2.0)); return; } kit.Cylinder(0.6, 0.6, height, 7L, color, V(0.0, height * 0.5, 0.0), solid: true); kit.Box(V(1.6, 0.4, 1.6), color, V(0.0, height + 0.2, 0.0), solid: false); } private static void AnimeHouse(Kit kit, GodotRng rng) { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: 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_0098: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_0256: Unknown result type (might be due to invalid IL or missing references) //IL_02b2: Unknown result type (might be due to invalid IL or missing references) //IL_0330: Unknown result type (might be due to invalid IL or missing references) //IL_03ac: Unknown result type (might be due to invalid IL or missing references) //IL_0425: Unknown result type (might be due to invalid IL or missing references) //IL_047a: Unknown result type (might be due to invalid IL or missing references) //IL_04ff: Unknown result type (might be due to invalid IL or missing references) //IL_0597: Unknown result type (might be due to invalid IL or missing references) //IL_0601: Unknown result type (might be due to invalid IL or missing references) //IL_065c: Unknown result type (might be due to invalid IL or missing references) //IL_06e4: Unknown result type (might be due to invalid IL or missing references) //IL_0729: Unknown result type (might be due to invalid IL or missing references) //IL_07dc: Unknown result type (might be due to invalid IL or missing references) double num = rng.Rr(9.0, 12.0); double num2 = rng.Rr(7.0, 8.5); double num3 = 4.2; double num4 = 3.6; Col val = PLASTER; val = ((Col)(ref val)).Lightened(0.06); Col color = ((Col)(ref val)).Darkened(rng.Rr(0.0, 0.06)); Col color2 = ((rng.Rf() < 0.6) ? TILE : TILE_RED); double num5 = num2 * 0.5; kit.Box(V(num + 0.8, 0.8, num2 + 0.8), DARK_STONE, V(0.0, 0.4, 0.0)); kit.Box(V(num, num3, num2), color, V(0.0, 0.8 + num3 * 0.5, 0.0)); double[] array = new double[4] { -0.5, -0.17, 0.17, 0.5 }; foreach (double num6 in array) { kit.Box(V(0.32, num3, 0.32), DARK_WOOD, V(num * num6, 0.8 + num3 * 0.5, num5 + 0.02), solid: false); kit.Box(V(0.32, num3, 0.32), DARK_WOOD, V(num * num6, 0.8 + num3 * 0.5, 0.0 - num5 - 0.02), solid: false); } kit.Box(V(num + 0.2, 0.3, num2 + 0.2), DARK_WOOD, V(0.0, 0.8 + num3, 0.0), solid: false); kit.Roof(V(num + 2.6, 1.3, num2 + 2.6), color2, V(0.0, 0.8 + num3 + 0.7, 0.0)); double num7 = num * 0.78; double num8 = num2 * 0.78; double num9 = 0.8 + num3 + 0.6; kit.Box(V(num7, num4, num8), color, V(0.0, num9 + num4 * 0.5, 0.0)); array = new double[3] { -0.5, 0.0, 0.5 }; foreach (double num10 in array) { kit.Box(V(0.3, num4, 0.3), DARK_WOOD, V(num7 * num10, num9 + num4 * 0.5, num8 * 0.5 + 0.02), solid: false); } double num11 = num9 + 0.1; kit.Box(V(num7, 0.3, 2.4), WOOD, V(0.0, num11, num8 * 0.5 + 1.2)); kit.Box(V(num7, 0.9, 0.15), DARK_WOOD, V(0.0, num11 + 0.6, num8 * 0.5 + 2.35)); int num12 = 12; for (int j = 0; j < num12; j++) { double num13 = ((double)j + 1.0) / (double)num12; kit.Box(V(1.4, 0.25, 0.6), WOOD, V(num * 0.5 + 0.9, 0.8 + (num11 - 0.8) * num13, num5 + 1.0 - (double)j * 0.55)); } kit.Roof(V(num7 + 2.4, 2.6, num8 + 2.4), color2, V(0.0, num9 + num4 + 1.3, 0.0)); kit.Box(V(num7 + 2.6, 0.35, 0.35), ((Col)(ref color2)).Darkened(0.2), V(0.0, num9 + num4 + 2.65, 0.0), solid: false); kit.Box(V(1.6, 2.6, 0.18), WOOD, V(0.0, 2.1, num5 + 0.1), solid: false); array = new double[2] { -1.0, 1.0 }; foreach (double num14 in array) { kit.Box(V(0.06, 0.5, 0.06), DARK_WOOD, V(num14 * 1.4, 3.9000000000000004, num5 + 0.5), solid: false); kit.Ball(0.38, LANTERN, V(num14 * 1.4, 3.4000000000000004, num5 + 0.5), V(1.0, 1.3, 1.0)); } array = new double[2] { -0.32, 0.32 }; foreach (double num15 in array) { kit.Box(V(1.8, 1.4, 0.1), Col.Html("efe6d2"), V(num * num15, 3.2, num5 + 0.08), solid: false); } } public static void Torii(Kit kit) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: 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_0165: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) Col color = Col.Html("c0392b"); Col color2 = Col.Html("2a2422"); double[] array = new double[2] { -1.0, 1.0 }; foreach (double num in array) { kit.Cylinder(0.45, 0.4, 6.5, 8L, color, V(num * 3.2, 3.25, 0.0), solid: true); kit.Cylinder(0.6, 0.6, 0.6, 8L, color2, V(num * 3.2, 0.3, 0.0)); } kit.Box(V(9.4, 0.6, 0.7), color2, V(0.0, 6.8, 0.0), solid: false); kit.Box(V(8.2, 0.45, 0.55), color, V(0.0, 6.2, 0.0), solid: false); kit.Box(V(7.2, 0.4, 0.45), color, V(0.0, 5.2, 0.0), solid: false); } public static void StoneLantern(Kit kit) { //IL_0021: 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_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) kit.Box(V(0.9, 0.3, 0.9), STONE, V(0.0, 0.15, 0.0)); kit.Cylinder(0.22, 0.22, 1.1, 6L, STONE, V(0.0, 0.85, 0.0)); Vec3 size = V(0.8, 0.6, 0.8); Col sTONE = STONE; kit.Box(size, ((Col)(ref sTONE)).Lightened(0.05), V(0.0, 1.7, 0.0), solid: false); kit.Box(V(0.5, 0.35, 0.82), LANTERN, V(0.0, 1.7, 0.0), solid: false); long sides = 4L; sTONE = STONE; kit.Cylinder(0.75, 0.05, 0.6, sides, ((Col)(ref sTONE)).Darkened(0.1), V(0.0, 2.3, 0.0), solid: false, V(0.0, 0.785, 0.0)); } private static void Cottage(Kit kit, GodotRng rng) { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: 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_0083: 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_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_02bc: Unknown result type (might be due to invalid IL or missing references) //IL_0482: Unknown result type (might be due to invalid IL or missing references) //IL_04da: Unknown result type (might be due to invalid IL or missing references) //IL_054f: Unknown result type (might be due to invalid IL or missing references) //IL_05a1: Unknown result type (might be due to invalid IL or missing references) //IL_05f3: Unknown result type (might be due to invalid IL or missing references) //IL_0998: Unknown result type (might be due to invalid IL or missing references) //IL_09f3: Unknown result type (might be due to invalid IL or missing references) //IL_07ae: Unknown result type (might be due to invalid IL or missing references) //IL_07de: Unknown result type (might be due to invalid IL or missing references) //IL_086f: Unknown result type (might be due to invalid IL or missing references) //IL_08ab: Unknown result type (might be due to invalid IL or missing references) //IL_0919: Unknown result type (might be due to invalid IL or missing references) //IL_0950: Unknown result type (might be due to invalid IL or missing references) //IL_0a87: Unknown result type (might be due to invalid IL or missing references) //IL_03d3: Unknown result type (might be due to invalid IL or missing references) //IL_0bb3: Unknown result type (might be due to invalid IL or missing references) //IL_0c29: Unknown result type (might be due to invalid IL or missing references) //IL_0c89: Unknown result type (might be due to invalid IL or missing references) //IL_0cec: Unknown result type (might be due to invalid IL or missing references) //IL_0d3b: Unknown result type (might be due to invalid IL or missing references) //IL_0d40: Unknown result type (might be due to invalid IL or missing references) //IL_0d4c: Unknown result type (might be due to invalid IL or missing references) //IL_0d51: Unknown result type (might be due to invalid IL or missing references) //IL_0d5d: Unknown result type (might be due to invalid IL or missing references) //IL_0d62: Unknown result type (might be due to invalid IL or missing references) //IL_0b0b: Unknown result type (might be due to invalid IL or missing references) //IL_0e2f: Unknown result type (might be due to invalid IL or missing references) //IL_0e83: Unknown result type (might be due to invalid IL or missing references) //IL_0eed: Unknown result type (might be due to invalid IL or missing references) //IL_0f65: Unknown result type (might be due to invalid IL or missing references) //IL_0fb5: Unknown result type (might be due to invalid IL or missing references) //IL_1005: Unknown result type (might be due to invalid IL or missing references) //IL_105f: Unknown result type (might be due to invalid IL or missing references) //IL_0d93: Unknown result type (might be due to invalid IL or missing references) //IL_10ed: Unknown result type (might be due to invalid IL or missing references) //IL_1133: Unknown result type (might be due to invalid IL or missing references) double num = rng.Rr(5.6, 7.6); double num2 = rng.Rr(4.6, 5.8); Col pLASTER = PLASTER; Col color = ((Col)(ref pLASTER)).Darkened(rng.Rr(0.0, 0.1)); Col color2 = (new Col[4] { ROOF_RED, C("8c5a3c"), THATCH, C("7a4a3a") })[rng.RandiRange(0L, 3L)]; double num3 = num2 * 0.5; kit.Box(V(num + 0.4, 0.6, num2 + 0.4), DARK_STONE, V(0.0, 0.3, 0.0)); kit.Box(V(num, 2.8, num2), color, V(0.0, 2.0, 0.0)); Vec3[] array = new Vec3[4] { V((0.0 - num) * 0.5, 2.0, 0.0 - num3), V(num * 0.5, 2.0, 0.0 - num3), V((0.0 - num) * 0.5, 2.0, num3), V(num * 0.5, 2.0, num3) }; foreach (Vec3 at in array) { kit.Box(V(0.28, 2.8, 0.28), DARK_WOOD, at, solid: false); } kit.Box(V(num + 0.15, 0.25, num2 + 0.15), DARK_WOOD, V(0.0, 3.3, 0.0), solid: false); kit.Box(V(num + 0.1, 0.18, num2 + 0.1), DARK_WOOD, V(0.0, 1.75, 0.0), solid: false); double[] array2 = new double[2] { -1.0, 1.0 }; foreach (double num4 in array2) { double[] array3 = new double[2] { -1.0, 1.0 }; foreach (double num5 in array3) { (double, double)[] array4 = new(double, double)[2] { (1.05, 0.62), (2.55, -0.62) }; for (int k = 0; k < array4.Length; k++) { (double, double) tuple = array4[k]; double x = tuple.Item2 * num5; kit.Box(V(0.12, 1.45, 0.16), DARK_WOOD, V(num4 * (num * 0.5 + 0.03), tuple.Item1, num5 * (num3 - 0.75)), solid: false, V(x, 0.0, 0.0)); } } } kit.Roof(V(num + 1.3, 2.7, num2 + 1.1), color2, V(0.0, 4.75, 0.0)); kit.Box(V(0.22, 0.22, num2 + 1.3), DARK_WOOD, V(0.0, 6.1, 0.0), solid: false); double num6 = rng.Rr((0.0 - num) * 0.2, num * 0.2); kit.Box(V(1.1, 2.0, 0.16), WOOD, V(num6, 1.6, num3 + 0.06), solid: false); kit.Box(V(1.4, 0.16, 0.2), DARK_WOOD, V(num6, 2.7, num3 + 0.08), solid: false); kit.Box(V(1.8, 0.3, 1.0), STONE, V(num6, 0.45, num3 + 0.6), solid: false); (Vec3, double)[] array5 = new(Vec3, double)[4] { (V(num6 - 1.9, 2.1, num3 + 0.05), 0.0), (V(num6 + 1.9, 2.1, num3 + 0.05), 0.0), (V(num * 0.5 + 0.05, 2.1, 0.0), Math.PI / 2.0), (V((0.0 - num) * 0.5 - 0.05, 2.1, 0.3), Math.PI / 2.0) }; for (int i = 0; i < array5.Length; i++) { (Vec3, double) tuple2 = array5[i]; var (vec, _) = tuple2; if (!(Math.Abs((double)vec.x) > num * 0.5 + 0.2)) { Vec3 rotation = V(0.0, tuple2.Item2, 0.0); kit.Box(V(0.9, 0.9, 0.12), C("3c4a5c"), vec, solid: false, rotation); kit.Box(V(1.05, 0.12, 0.16), DARK_WOOD, vec + V(0.0, -0.5, 0.0), solid: false, rotation); Vec3 vec2 = V(0.62, 0.0, 0.0).Rotated(Vec3.UP, tuple2.Item2); kit.Box(V(0.3, 0.95, 0.08), C("5f7a52"), vec + vec2, solid: false, rotation); kit.Box(V(0.3, 0.95, 0.08), C("5f7a52"), vec - vec2, solid: false, rotation); Vec3 vec3 = V(0.0, 0.0, 0.07).Rotated(Vec3.UP, tuple2.Item2); kit.Box(V(0.07, 0.86, 0.05), DARK_WOOD, vec + vec3, solid: false, rotation); kit.Box(V(0.86, 0.07, 0.05), DARK_WOOD, vec + vec3, solid: false, rotation); } } kit.Box(V(0.75, 2.2, 0.75), STONE, V(num * 0.28, 5.4, (0.0 - num2) * 0.18), solid: false); kit.Box(V(0.95, 0.2, 0.95), DARK_STONE, V(num * 0.28, 6.55, (0.0 - num2) * 0.18), solid: false); if (rng.Rf() < 0.7) { kit.Smoke(V(num * 0.28, 6.9, (0.0 - num2) * 0.18)); } kit.Cylinder(0.45, 0.45, 0.95, 8L, WOOD, V((0.0 - num) * 0.5 + 0.6, 0.95, num3 + 0.6)); if (rng.Rf() < 0.6) { for (int l = 0; l < 5; l++) { kit.Cylinder(0.22, 0.22, 1.4, 5L, C("8a6844"), V(num * 0.5 + 0.5, 0.5 + 0.38 * (double)(l / 3), -1.0 + 0.5 * (double)(l % 3)), solid: false, V(Math.PI / 2.0, 0.0, 0.0)); } } else { kit.Box(V(1.8, 0.14, 0.45), WOOD, V(num * 0.5 - 1.2, 0.95, num3 + 0.5), solid: false); } if (rng.Rf() < 0.4) { kit.Cylinder(0.07, 0.07, 2.2, 4L, DARK_WOOD, V((0.0 - num) * 0.5 - 1.2, 1.1, -1.5)); kit.Cylinder(0.07, 0.07, 2.2, 4L, DARK_WOOD, V((0.0 - num) * 0.5 - 1.2, 1.1, 2.0)); kit.Box(V(0.03, 0.03, 3.5), DARK_WOOD, V((0.0 - num) * 0.5 - 1.2, 2.1, 0.25), solid: false); Col[] array6 = (Col[])(object)new Col[3] { C("e6dcc4"), C("9bb4e0"), C("d98aa0") }; for (int m = 0; m < 3; m++) { kit.Box(V(0.04, 0.7, 0.6), array6[m], V((0.0 - num) * 0.5 - 1.2, 1.7, -0.8 + (double)m * 1.0), solid: false); } } double num7 = num2 * 0.5 + 4.2; for (int n = -2; n < 3; n++) { kit.Box(V(0.14, 1.0, 0.14), WOOD, V((double)n * 1.6, 0.6, 0.0 - num7), solid: false); kit.Box(V(0.14, 1.0, 0.14), WOOD, V(-3.2, 0.6, 0.0 - num3 - 0.4 - (double)(n + 2) * 0.95), solid: false); kit.Box(V(0.14, 1.0, 0.14), WOOD, V(3.2, 0.6, 0.0 - num3 - 0.4 - (double)(n + 2) * 0.95), solid: false); } kit.Box(V(6.5, 0.1, 0.08), WOOD, V(0.0, 0.9, 0.0 - num7), solid: false); kit.Box(V(6.5, 0.1, 0.08), WOOD, V(0.0, 0.55, 0.0 - num7), solid: false); kit.Box(V(0.08, 0.1, 4.0), WOOD, V(-3.2, 0.9, 0.0 - num3 - 2.2), solid: false); kit.Box(V(0.08, 0.1, 4.0), WOOD, V(3.2, 0.9, 0.0 - num3 - 2.2), solid: false); array2 = new double[3] { -1.5, 0.0, 1.5 }; foreach (double x2 in array2) { kit.Box(V(1.0, 0.25, 2.6), C("6b4f36"), V(x2, 0.28, 0.0 - num3 - 2.2), solid: false); for (int num8 = 0; num8 < 3; num8++) { kit.Ball(0.22, C("6f9440"), V(x2, 0.5, 0.0 - num3 - 1.3 - (double)num8 * 0.9)); } } } public static void Windmill(Kit kit) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_028b: Unknown result type (might be due to invalid IL or missing references) kit.Cylinder(3.2, 2.3, 9.0, 8L, PLASTER, V(0.0, 4.5, 0.0), solid: true); kit.Cylinder(3.5, 3.3, 0.8, 8L, DARK_STONE, V(0.0, 0.4, 0.0)); kit.Cylinder(2.8, 0.0, 3.0, 8L, ROOF_RED, V(0.0, 10.5, 0.0)); kit.Box(V(1.1, 2.0, 0.2), WOOD, V(0.0, 1.4, 3.15), solid: false); kit.Cylinder(0.25, 0.25, 1.6, 6L, DARK_WOOD, V(0.0, 8.6, 2.6), solid: false, V(Math.PI / 2.0, 0.0, 0.0)); for (int i = 0; i < 4; i++) { double num = Math.PI / 2.0 * (double)i + 0.4; Vec3 vec = V(Math.Cos(num), Math.Sin(num), 0.0); kit.Box(V(7.0, 0.18, 0.12), DARK_WOOD, V(0.0, 8.6, 3.3) + vec * 3.5, solid: false, V(0.0, 0.0, num)); kit.Box(V(5.0, 1.3, 0.06), C("e6dcc4"), V(0.0, 8.6, 3.36) + vec * 4.2 + V(0.0 - Math.Sin(num), Math.Cos(num), 0.0) * 0.7, solid: false, V(0.0, 0.0, num)); } } public static void Village(Kit kit, GodotRng rng) { //IL_0023: 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_031d: Unknown result type (might be due to invalid IL or missing references) //IL_0322: Unknown result type (might be due to invalid IL or missing references) //IL_0324: Unknown result type (might be due to invalid IL or missing references) //IL_0326: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_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_033e: Unknown result type (might be due to invalid IL or missing references) //IL_0343: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_017c: 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_034b: Unknown result type (might be due to invalid IL or missing references) //IL_050a: Unknown result type (might be due to invalid IL or missing references) //IL_050f: Unknown result type (might be due to invalid IL or missing references) //IL_0511: Unknown result type (might be due to invalid IL or missing references) //IL_0513: Unknown result type (might be due to invalid IL or missing references) //IL_037f: Unknown result type (might be due to invalid IL or missing references) //IL_0387: Unknown result type (might be due to invalid IL or missing references) //IL_0389: Unknown result type (might be due to invalid IL or missing references) //IL_0520: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_03ec: Unknown result type (might be due to invalid IL or missing references) //IL_03f1: Unknown result type (might be due to invalid IL or missing references) //IL_03f2: Unknown result type (might be due to invalid IL or missing references) //IL_03f7: Unknown result type (might be due to invalid IL or missing references) //IL_03ff: Unknown result type (might be due to invalid IL or missing references) //IL_0404: Unknown result type (might be due to invalid IL or missing references) //IL_0405: Unknown result type (might be due to invalid IL or missing references) //IL_040a: Unknown result type (might be due to invalid IL or missing references) //IL_0437: Unknown result type (might be due to invalid IL or missing references) //IL_0439: Unknown result type (might be due to invalid IL or missing references) //IL_043b: Unknown result type (might be due to invalid IL or missing references) //IL_0440: Unknown result type (might be due to invalid IL or missing references) //IL_0444: Unknown result type (might be due to invalid IL or missing references) //IL_0449: Unknown result type (might be due to invalid IL or missing references) //IL_056f: Unknown result type (might be due to invalid IL or missing references) //IL_0574: Unknown result type (might be due to invalid IL or missing references) //IL_0576: Unknown result type (might be due to invalid IL or missing references) //IL_0578: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_067e: Unknown result type (might be due to invalid IL or missing references) //IL_0683: Unknown result type (might be due to invalid IL or missing references) //IL_0685: Unknown result type (might be due to invalid IL or missing references) //IL_0687: Unknown result type (might be due to invalid IL or missing references) //IL_09d8: Unknown result type (might be due to invalid IL or missing references) //IL_09dd: Unknown result type (might be due to invalid IL or missing references) //IL_09df: Unknown result type (might be due to invalid IL or missing references) //IL_09e1: Unknown result type (might be due to invalid IL or missing references) //IL_045a: Unknown result type (might be due to invalid IL or missing references) //IL_045f: Unknown result type (might be due to invalid IL or missing references) //IL_0463: Unknown result type (might be due to invalid IL or missing references) //IL_0590: Unknown result type (might be due to invalid IL or missing references) //IL_0595: Unknown result type (might be due to invalid IL or missing references) //IL_0697: Unknown result type (might be due to invalid IL or missing references) //IL_0699: Unknown result type (might be due to invalid IL or missing references) //IL_0b3f: Unknown result type (might be due to invalid IL or missing references) //IL_0b44: Unknown result type (might be due to invalid IL or missing references) //IL_0b46: Unknown result type (might be due to invalid IL or missing references) //IL_0b48: Unknown result type (might be due to invalid IL or missing references) //IL_09f1: Unknown result type (might be due to invalid IL or missing references) //IL_0a1f: Unknown result type (might be due to invalid IL or missing references) //IL_0a75: Unknown result type (might be due to invalid IL or missing references) //IL_0ae1: Unknown result type (might be due to invalid IL or missing references) //IL_022e: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_0280: Unknown result type (might be due to invalid IL or missing references) //IL_0282: Unknown result type (might be due to invalid IL or missing references) //IL_028d: Unknown result type (might be due to invalid IL or missing references) //IL_0292: Unknown result type (might be due to invalid IL or missing references) //IL_0297: Unknown result type (might be due to invalid IL or missing references) //IL_02a2: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: Unknown result type (might be due to invalid IL or missing references) //IL_059d: Unknown result type (might be due to invalid IL or missing references) //IL_0b58: Unknown result type (might be due to invalid IL or missing references) //IL_0b90: Unknown result type (might be due to invalid IL or missing references) //IL_0be6: Unknown result type (might be due to invalid IL or missing references) //IL_0c3c: Unknown result type (might be due to invalid IL or missing references) //IL_0497: Unknown result type (might be due to invalid IL or missing references) //IL_0499: Unknown result type (might be due to invalid IL or missing references) //IL_04a1: Unknown result type (might be due to invalid IL or missing references) //IL_04bb: Unknown result type (might be due to invalid IL or missing references) //IL_05d1: Unknown result type (might be due to invalid IL or missing references) //IL_05eb: Unknown result type (might be due to invalid IL or missing references) //IL_078c: Unknown result type (might be due to invalid IL or missing references) //IL_0e00: Unknown result type (might be due to invalid IL or missing references) //IL_0e05: Unknown result type (might be due to invalid IL or missing references) //IL_0e07: Unknown result type (might be due to invalid IL or missing references) //IL_0e09: Unknown result type (might be due to invalid IL or missing references) //IL_0d43: Unknown result type (might be due to invalid IL or missing references) //IL_0d88: Unknown result type (might be due to invalid IL or missing references) //IL_0879: Unknown result type (might be due to invalid IL or missing references) //IL_08d4: Unknown result type (might be due to invalid IL or missing references) //IL_0918: Unknown result type (might be due to invalid IL or missing references) //IL_0951: Unknown result type (might be due to invalid IL or missing references) //IL_098a: Unknown result type (might be due to invalid IL or missing references) //IL_0e19: Unknown result type (might be due to invalid IL or missing references) //IL_0e47: Unknown result type (might be due to invalid IL or missing references) //IL_0ec1: Unknown result type (might be due to invalid IL or missing references) //IL_07f1: Unknown result type (might be due to invalid IL or missing references) //IL_07e5: Unknown result type (might be due to invalid IL or missing references) V2 val = default(V2); ((V2)(ref val))..ctor(kit.Origin.x, kit.Origin.z); List<V2> list = new List<V2> { V2.ZERO, Kit.LANDMARK_OFFSET }; int num = 0; V2 val4; foreach (V2[] roadLine in kit.RoadLines) { double num2 = 0.0; double num3 = 16.0; double num4 = ((rng.Rf() < 0.5) ? 1.0 : (-1.0)); for (int i = 0; i < roadLine.Length - 1; i++) { V2 val2 = roadLine[i] - val; V2 val3 = roadLine[i + 1] - val; if ((double)((V2)(ref val2)).Length() > 84.0 && (double)((V2)(ref val3)).Length() > 84.0) { continue; } num2 += (double)((V2)(ref val2)).DistanceTo(val3); if (num2 < num3 || num >= 14) { continue; } num3 = num2 + rng.Rr(15.0, 19.0); num4 = 0.0 - num4; val4 = val3 - val2; V2 val5 = ((V2)(ref val4)).Normalized(); V2 val6 = new V2(0f - val5.y, val5.x) * num4; V2 val7 = val2 + val6 * rng.Rr(12.5, 14.5); if ((double)((V2)(ref val7)).Length() < 22.0 || (double)((V2)(ref val7)).Length() > 82.0) { continue; } bool flag = kit.RoadDistanceAt((double)val.x + (double)val7.x, (double)val.y + (double)val7.y) > 10.0; foreach (V2 item in list) { V2 current2 = item; if ((double)((V2)(ref current2)).DistanceTo(val7) < 17.0) { flag = false; } } if (flag) { list.Add(val7); num++; V2 val8 = -val6; kit.Place(val7, Math.Atan2(val8.x, val8.y) + rng.Rr(-0.12, 0.12)); AnimeHouse(kit, rng); kit.Place(val7 - val6 * 6.5 + val5 * 3.0); StoneLantern(kit); } } } double[] array = new double[4] { 300.0, 250.0, 60.0, 120.0 }; foreach (double angleDegrees in array) { V2 val9 = kit.Spot(angleDegrees, 46.0); bool flag2 = val9 != V2.INF; foreach (V2 item2 in list) { V2 current3 = item2; if (flag2 && (double)((V2)(ref current3)).DistanceTo(val9) < 13.0) { flag2 = false; } } if (flag2) { list.Add(val9); kit.Place(val9, (double)(0f - val9.Angle()) - Math.PI / 2.0); Windmill(kit); break; } } int num5 = 0; foreach (V2[] roadLine2 in kit.RoadLines) { if (num5 >= 3) { break; } for (int k = 0; k < roadLine2.Length - 1; k++) { V2 val10 = roadLine2[k] - val; V2 val11 = roadLine2[k + 1] - val; if ((double)((V2)(ref val10)).Length() < 74.0 == (double)((V2)(ref val11)).Length() < 74.0) { continue; } val4 = val11 - val10; V2 val12 = ((V2)(ref val4)).Normalized(); bool flag3 = true; foreach (V2 item3 in list) { V2 current5 = item3; if ((double)((V2)(ref current5)).DistanceTo(val10) < 9.0) { flag3 = false; } } if (flag3) { kit.Place(val10, Math.Atan2(val12.y, 0f - val12.x)); Torii(kit); list.Add(val10); num5++; } break; } } V2 val13 = kit.Spot(50.0, 9.0); if (val13 != V2.INF) { kit.Place(val13); Well(kit); } for (int l = 0; l < 5; l++) { double angleDegrees2 = rng.Rf() * 360.0; double radius = rng.Rr(16.0, 50.0); V2 val14 = kit.Spot(angleDegrees2, radius); bool flag4 = val14 != V2.INF; foreach (V2 item4 in list) { V2 current6 = item4; if (flag4 && (double)((V2)(ref current6)).DistanceTo(val14) < 8.0) { flag4 = false; } } if (flag4) { kit.Place(val14); kit.Ball(1.4, THATCH, V(0.0, 0.9, 0.0), V(1.0, 0.8, 1.0)); } } array = new double[2] { 150.0, 330.0 }; foreach (double angleDegrees3 in array) { V2 val15 = kit.Spot(angleDegrees3, 12.0); if (!(val15 == V2.INF)) { kit.Place(val15, (double)(0f - val15.Angle()) - Math.PI / 2.0); Vec3[] array2 = new Vec3[4] { V(-1.6, 1.1, -1.1), V(1.6, 1.1, -1.1), V(-1.6, 1.3, 1.1), V(1.6, 1.3, 1.1) }; for (int m = 0; m < array2.Length; m++) { Vec3 at = array2[m]; kit.Cylinder(0.08, 0.08, (double)at.y * 2.0, 4L, DARK_WOOD, at); } for (int n = 0; n < 4; n++) { kit.Box(V(0.9, 0.08, 2.9), (n % 2 == 0) ? C("b5563f") : C("e6dcc4"), V(-1.35 + (double)n * 0.9, 2.45, 0.0), solid: false, V(0.14, 0.0, 0.0)); } kit.Box(V(3.0, 0.9, 1.0), WOOD, V(0.0, 0.45, 0.6)); kit.Box(V(0.7, 0.6, 0.7), C("8a6844"), V(-1.9, 0.3, -0.6), solid: false); kit.Ball(0.22, C("c8553d"), V(-0.6, 1.05, 0.6)); kit.Ball(0.22, C("d9b040"), V(0.2, 1.05, 0.7)); kit.Ball(0.22, C("6f9440"), V(0.9, 1.05, 0.5)); } } V2 val16 = kit.Spot(240.0, 8.0); if (val16 != V2.INF) { kit.Place(val16); kit.Cylinder(0.1, 0.1, 2.8, 5L, DARK_WOOD, V(0.0, 1.4, 0.0)); kit.Box(V(1.3, 0.3, 0.06), WOOD, V(0.5, 2.4, 0.0), solid: false, V(0.0, 0.4, 0.0)); kit.Box(V(1.3, 0.3, 0.06), WOOD, V(-0.5, 2.0, 0.0), solid: false, V(0.0, -0.9, 0.0)); } V2 val17 = kit.Spot(200.0, 16.0); if (val17 != V2.INF) { kit.Place(val17, rng.Rf() * (Math.PI * 2.0)); kit.Box(V(1.6, 0.5, 2.6), WOOD, V(0.0, 0.95, 0.0)); kit.Box(V(0.1, 0.1, 1.8), DARK_WOOD, V(0.5, 0.8, 2.1), solid: false); kit.Box(V(0.1, 0.1, 1.8), DARK_WOOD, V(-0.5, 0.8, 2.1), solid: false); Vec3[] array2 = new Vec3[4] { V(-0.95, 0.55, 0.7), V(0.95, 0.55, 0.7), V(-0.95, 0.55, -0.7), V(0.95, 0.55, -0.7) }; foreach (Vec3 at2 in array2) { kit.Cylinder(0.55, 0.55, 0.14, 8L, DARK_WOOD, at2, solid: false, V(0.0, 0.0, Math.PI / 2.0)); } kit.Ball(0.6, THATCH, V(0.0, 1.45, 0.0), V(1.1, 0.7, 1.6)); } array = new double[4] { 20.0, 110.0, 200.0, 290.0 }; foreach (double angleDegrees4 in array) { V2 val18 = kit.Spot(angleDegrees4, 7.0); if (val18 != V2.INF) { kit.Place(val18); kit.Cylinder(0.1, 0.1, 3.2, 5L, DARK_WOOD, V(0.0, 1.6, 0.0)); kit.Box(V(0.4, 0.5, 0.4), new Col(1.0, 0.85, 0.5, 0.35), V(0.0, 3.3, 0.0), solid: false); } } } public static void HunterCamp(Kit kit, GodotRng rng) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: 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_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_016f: 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_0171: 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) //IL_010b: 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_013b: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < 72; i++) { V2 local = V2.FromAngle(Math.PI * 2.0 * (double)i / 72.0) * 44.0; if (kit.IsFree(local, nearLandmark: false)) { kit.Place(local); kit.Cylinder(0.35, 0.1, rng.Rr(3.6, 4.6), 5L, DARK_WOOD, V(0.0, 2.0, 0.0), solid: true); } } double[] array = new double[4] { 40.0, 130.0, 220.0, 310.0 }; foreach (double angleDegrees in array) { V2 val = kit.Spot(angleDegrees, rng.Rr(22.0, 30.0)); if (!(val == V2.INF)) { kit.Place(val, (double)(0f - val.Angle()) - Math.PI / 2.0); House(kit, 6.5, 5.0, WOOD, DARK_WOOD); } } V2 val2 = kit.Spot(175.0, 36.0); if (val2 != V2.INF) { kit.Place(val2); Tower(kit, 10.0); } V2 val3 = kit.Spot(90.0, 9.0); if (val3 != V2.INF) { kit.Place(val3); Campfire(kit); } } public static void Forge(Kit kit, GodotRng rng) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: 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_0024: Unknown result type (might be due to invalid IL or missing references) //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) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_0255: Unknown result type (might be due to invalid IL or missing references) //IL_0257: Unknown result type (might be due to invalid IL or missing references) //IL_0267: Unknown result type (might be due to invalid IL or missing references) //IL_0296: 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_0362: 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) //IL_0369: Unknown result type (might be due to invalid IL or missing references) //IL_036b: Unknown result type (might be due to invalid IL or missing references) //IL_037b: Unknown result type (might be due to invalid IL or missing references) //IL_03bf: Unknown result type (might be due to invalid IL or missing references) Col color = C("2b2527"); V2 val = kit.Spot(40.0, 26.0); if (val != V2.INF) { kit.Place(val, (double)(0f - val.Angle()) - Math.PI / 2.0); kit.Box(V(16.0, 9.0, 11.0), color, V(0.0, 4.5, 0.0)); kit.Box(V(10.0, 5.0, 8.0), C("3a3033"), V(0.0, 11.5, 0.0), solid: false); kit.Cylinder(1.8, 1.4, 10.0, 6L, color, V(5.0, 14.0, -2.0)); kit.Cylinder(1.3, 1.3, 0.6, 6L, FIRE, V(5.0, 19.2, -2.0)); kit.Smoke(V(5.0, 19.8, -2.0)); kit.Box(V(3.0, 4.0, 0.3), FIRE, V(0.0, 2.0, 5.6), solid: false); } double[] array = new double[3] { 150.0, 215.0, 290.0 }; foreach (double angleDegrees in array) { V2 val2 = kit.Spot(angleDegrees, rng.Rr(20.0, 34.0)); if (!(val2 == V2.INF)) { kit.Place(val2); kit.Cylinder(4.0, 4.4, 0.6, 9L, color, V(0.0, 0.3, 0.0)); kit.Cylinder(3.3, 3.3, 0.7, 9L, FIRE, V(0.0, 0.32, 0.0)); } } for (int j = 0; j < 9; j++) { double angleDegrees2 = rng.Rf() * 360.0; double radius = rng.Rr(38.0, 50.0); V2 val3 = kit.Spot(angleDegrees2, radius); if (val3 != V2.INF) { kit.Place(val3, rng.Rf() * (Math.PI * 2.0)); kit.Cylinder(1.4, 0.0, rng.Rr(5.0, 9.0), 5L, color, V(0.0, 3.0, 0.0), solid: true, V(0.1, 0.0, 0.12)); } } } public static void TempleRuins(Kit kit, GodotRng rng) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: 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_0024: Unknown result type (might be due to invalid IL or missing references) //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) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_0270: Unknown result type (might be due to invalid IL or missing references) //IL_0275: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Unknown result type (might be due to invalid IL or missing references) //IL_0279: Unknown result type (might be due to invalid IL or missing references) //IL_022c: Unknown result type (might be due to invalid IL or missing references) //IL_0289: Unknown result type (might be due to invalid IL or missing references) //IL_02d9: Unknown result type (might be due to invalid IL or missing references) //IL_02cd: Unknown result type (might be due to invalid IL or missing references) //IL_032b: 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) Col color = C("c9a676"); V2 val = kit.Spot(210.0, 28.0); double[] array; if (val != V2.INF) { kit.Place(val, (double)(0f - val.Angle()) - Math.PI / 2.0); kit.Box(V(24.0, 1.0, 14.0), color, V(0.0, 0.5, 0.0)); kit.Box(V(20.0, 0.6, 10.0), C("b8946a"), V(0.0, 1.3, 0.0), solid: false); Xf xf = kit.Base; for (int i = 0; i < 6; i++) { array = new double[2] { -4.0, 4.0 }; foreach (double z in array) { kit.Base = xf * new Xf(Basis.IDENTITY, V(-8.0 + (double)i * 3.2, 1.6, z)); if (rng.Rf() < 0.7) { double height = ((rng.Rf() < 0.4) ? rng.Rr(4.0, 7.5) : 7.5); Column(kit, height, color); } } } kit.Base = xf * new Xf(Basis.Yaw(0.4), V(4.0, 0.0, 10.0)); Column(kit, 7.0, color, fallen: true); } array = new double[4] { 20.0, 80.0, 130.0, 320.0 }; foreach (double angleDegrees in array) { V2 val2 = kit.Spot(angleDegrees, rng.Rr(22.0, 36.0)); if (!(val2 == V2.INF)) { kit.Place(val2); kit.Cylinder(3.2, 0.0, 3.6, 6L, (rng.Rf() < 0.5) ? C("b5563f") : C("d8c08a"), V(0.0, 1.8, 0.0), solid: true); kit.Cylinder(0.1, 0.1, 4.4, 4L, DARK_WOOD, V(0.0, 2.2, 0.0)); } } } public static void StiltVillage(Kit kit, GodotRng rng) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_004e: 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_03a9: Unknown result type (might be due to invalid IL or missing references) //IL_03ae: Unknown result type (might be due to invalid IL or missing references) //IL_03b0: Unknown result type (might be due to invalid IL or missing references) //IL_03b2: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: Unknown result type (might be due to invalid IL or missing references) //IL_03c2: Unknown result type (might be due to invalid IL or missing references) //IL_03f0: Unknown result type (might be due to invalid IL or missing references) //IL_0453: Unknown result type (might be due to invalid IL or missing references) double[] array = new double[5] { 30.0, 100.0, 170.0, 240.0, 310.0 }; foreach (double angleDegrees in array) { V2 val = kit.Spot(angleDegrees, rng.Rr(22.0, 32.0)); if (!(val == V2.INF)) { kit.Place(val, (double)(0f - val.Angle()) - Math.PI / 2.0); Vec3[] array2 = new Vec3[4] { V(-3.4, 0.0, -2.8), V(3.4, 0.0, -2.8), V(-3.4, 0.0, 2.8), V(3.4, 0.0, 2.8) }; foreach (Vec3 vec in array2) { kit.Cylinder(0.3, 0.3, 4.0, 5L, DARK_WOOD, vec + V(0.0, 1.4, 0.0)); } kit.Box(V(8.0, 0.4, 6.8), WOOD, V(0.0, 3.4, 0.0), solid: false); kit.Box(V(5.5, 2.6, 4.4), C("65543f"), V(0.0, 4.9, -0.6), solid: false); kit.Roof(V(6.4, 2.0, 5.2), C("4c5a44"), V(0.0, 7.2, -0.6)); kit.Box(V(1.6, 0.25, 9.0), WOOD, V(0.0, 1.7, 7.6), solid: false, V(0.39, 0.0, 0.0)); kit.Solids.Add((V(7.0, 3.2, 5.8), kit.Base * new Xf(Basis.IDENTITY, V(0.0, 1.6, 0.0)))); } } for (int k = 0; k < 6; k++) { double angleDegrees2 = rng.Rf() * 360.0; double radius = rng.Rr(10.0, 44.0); V2 val2 = kit.Spot(angleDegrees2, radius); if (val2 != V2.INF) { kit.Place(val2); kit.Cylinder(0.15, 0.15, 3.0, 4L, DARK_WOOD, V(0.0, 1.5, 0.0)); kit.Ball(0.4, new Col(0.7, 1.0, 0.6, 0.3), V(0.0, 3.1, 0.0)); } } } public static void RestCamp(Kit kit, GodotRng rng) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_0299: Unknown result type (might be due to invalid IL or missing references) //IL_0333: Unknown result type (might be due to invalid IL or missing references) //IL_038c: Unknown result type (might be due to invalid IL or missing references) //IL_039a: Unknown result type (might be due to invalid IL or missing references) //IL_03c5: Unknown result type (might be due to invalid IL or missing references) //IL_0434: Unknown result type (might be due to invalid IL or missing references) //IL_0465: Unknown result type (might be due to invalid IL or missing references) //IL_04b7: Unknown result type (might be due to invalid IL or missing references) //IL_0511: Unknown result type (might be due to invalid IL or missing references) //IL_057f: Unknown result type (might be due to invalid IL or missing references) //IL_05eb: Unknown result type (might be due to invalid IL or missing references) //IL_0632: Unknown result type (might be due to invalid IL or missing references) //IL_0663: Unknown result type (might be due to invalid IL or missing references) //IL_06b8: Unknown result type (might be due to invalid IL or missing references) //IL_06ff: Unknown result type (might be due to invalid IL or missing references) //IL_0730: Unknown result type (might be due to invalid IL or missing references) //IL_078a: Unknown result type (might be due to invalid IL or missing references) kit.Place(V2.ZERO); for (int i = 0; i < 8; i++) { double num = Math.PI * 2.0 * (double)i / 8.0; kit.Ball(0.32, STONE, V(Math.Cos(num) * 1.1, 0.18, Math.Sin(num) * 1.1), V(1.2, 0.8, 1.0)); } kit.Cylinder(0.14, 0.14, 1.3, 5L, DARK_WOOD, V(0.0, 0.25, 0.0), solid: false, V(Math.PI / 2.0, 0.4, 0.0)); kit.Cylinder(0.14, 0.14, 1.3, 5L, DARK_WOOD, V(0.0, 0.3, 0.0), solid: false, V(Math.PI / 2.0, 2.0, 0.0)); kit.Cylinder(0.45, 0.0, 1.2, 5L, FIRE, V(0.0, 0.85, 0.0)); kit.Cylinder(0.25, 0.0, 0.8, 4L, new Col(1.0, 0.8, 0.3, 0.2), V(0.15, 0.7, 0.1)); kit.Smoke(V(0.0, 1.5, 0.0)); for (int j = 0; j < 3; j++) { double num2 = Math.PI * 2.0 * (double)j / 3.0; kit.Cylinder(0.05, 0.05, 2.4, 4L, DARK_WOOD, V(Math.Cos(num2) * 0.5, 1.1, Math.Sin(num2) * 0.5), solid: false, V(Math.Sin(num2) * 0.42, 0.0, (0.0 - Math.Cos(num2)) * 0.42)); } kit.Cylinder(0.3, 0.22, 0.35, 6L, C("2e2a2a"), V(0.0, 1.45, 0.0)); double[] array = new double[3] { 0.6, 2.6, 4.4 }; foreach (double num3 in array) { kit.Place(V2.FromAngle(num3) * 3.0, 0.0 - num3); kit.Cylinder(0.3, 0.3, 2.4, 6L, WOOD, V(0.0, 0.3, 0.0), solid: true, V(Math.PI / 2.0, 0.0, 0.0)); } kit.Place(new V2(-5.5, -3.5), 0.7); kit.Cylinder(0.12, 0.12, 2.4, 5L, DARK_WOOD, V(-1.6, 1.2, 1.2)); kit.Cylinder(0.12, 0.12, 2.4, 5L, DARK_WOOD, V(1.6, 1.2, 1.2)); kit.Box(V(4.0, 0.14, 3.4), C("7b6a4a"), V(0.0, 1.5, -0.2), solid: false, V(-0.62, 0.0, 0.0)); kit.Cylinder(0.3, 0.3, 1.9, 6L, C("a04a3a"), V(0.0, 0.3, -0.4), solid: false, V(0.0, 0.0, Math.PI / 2.0)); kit.Box(V(0.9, 0.7, 0.7), WOOD, V(2.4, 0.35, 0.3)); kit.Place(new V2(4.5, -4.0)); kit.Cylinder(0.12, 0.12, 3.6, 5L, DARK_WOOD, V(0.0, 1.8, 0.0)); kit.Box(V(0.45, 0.55, 0.45), LAMP_GLOW, V(0.0, 3.7, 0.0), solid: false); kit.Place(new V2(-2.0, 5.5)); kit.Cylinder(0.1, 0.07, 7.5, 5L, DARK_WOOD, V(0.0, 3.75, 0.0)); kit.Box(V(1.8, 0.9, 0.05), C("4f7fb5"), V(1.0, 6.8, 0.0), solid: false); } public static void Altar(Kit kit, GodotRng rng) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_0286: Unknown result type (might be due to invalid IL or missing references) //IL_041e: Unknown result type (might be due to invalid IL or missing references) //IL_043b: Unknown result type (might be due to invalid IL or missing references) //IL_0496: Unknown result type (might be due to invalid IL or missing references) //IL_0384: Unknown result type (might be due to invalid IL or missing references) //IL_02ec: Unknown result type (might be due to invalid IL or missing references) //IL_0334: Unknown result type (might be due to invalid IL or missing references) Col color = default(Col); ((Col)(ref color))..ctor(0.55, 0.85, 1.0, 0.2); kit.Place(V2.ZERO); kit.Cylinder(5.6, 5.9, 0.4, 10L, STONE, V(0.0, 0.2, 0.0), solid: true); kit.Cylinder(4.0, 4.2, 0.4, 10L, DARK_STONE, V(0.0, 0.6, 0.0)); kit.Cylinder(1.0, 1.3, 1.1, 8L, STONE, V(0.0, 1.35, 0.0), solid: true); kit.Ball(0.6, color, V(0.0, 2.7, 0.0), V(0.8, 1.7, 0.8)); kit.Cylinder(0.14, 0.02, 9.0, 5L, new Col(0.6, 0.9, 1.0, 0.55), V(0.0, 7.5, 0.0)); for (int i = 0; i < 4; i++) { double num = Math.PI * 2.0 * (double)i / 4.0 + Math.PI / 4.0; Vec3 vec = V(Math.Cos(num) * 4.6, 0.4, Math.Sin(num) * 4.6); double num2 = ((i != 2) ? 4.4 : 2.2); kit.Cylinder(0.5, 0.42, num2, 6L, STONE, vec + V(0.0, num2 * 0.5, 0.0), solid: true); if (i != 2) { kit.Box(V(1.2, 0.3, 1.2), DARK_STONE, vec + V(0.0, num2 + 0.15, 0.0), solid: false); kit.Ball(0.22, color, vec + V(0.0, num2 + 0.55, 0.0)); } else { kit.Cylinder(0.42, 0.42, 2.0, 6L, STONE, vec + V(1.6, 0.45, 0.6), solid: false, V(0.0, 0.5, Math.PI / 2.0)); } } for (int j = 0; j < 7; j++) { double num3 = Math.PI * 2.0 * (double)j / 7.0 + rng.Rr(-0.15, 0.15); kit.Place(V2.FromAngle(num3) * rng.Rr(8.0, 9.5), 0.0 - num3); double y = rng.Rr(1.0, 1.7); double z = rng.Rr(-0.12, 0.12); kit.Box(V(0.8, y, 0.5), DARK_STONE, V(0.0, 0.6, 0.0), solid: true, V(0.06, 0.0, z)); } } public static void EnemyCamp(Kit kit, GodotRng rng, V2 toVillage) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Unknown result type (might be due to invalid IL or missing references) //IL_0266: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Unknown result type (might be due to invalid IL or missing references) //IL_0274: Unknown result type (might be due to invalid IL or missing references) //IL_02b7: Unknown result type (might be due to invalid IL or missing references) //IL_030c: Unknown result type (might be due to invalid IL or missing references) //IL_03c0: Unknown result type (might be due to invalid IL or missing references) //IL_03ce: Unknown result type (might be due to invalid IL or missing references) //IL_03ff: Unknown result type (might be due to invalid IL or missing references) //IL_045a: Unknown result type (might be due to invalid IL or missing references) //IL_04b5: Unknown result type (might be due to invalid IL or missing references) //IL_04f6: Unknown result type (might be due to invalid IL or missing references) //IL_0504: Unknown result type (might be due to invalid IL or missing references) //IL_0530: Unknown result type (might be due to invalid IL or missing references) //IL_0586: Unknown result type (might be due to invalid IL or missing references) //IL_05dc: Unknown result type (might be due to invalid IL or missing references) //IL_0637: Unknown result type (might be due to invalid IL or missing references) //IL_06ae: Unknown result type (might be due to invalid IL or missing references) //IL_072b: Unknown result type (might be due to invalid IL or missing references) //IL_0739: Unknown result type (might be due to invalid IL or missing references) //IL_076d: Unknown result type (might be due to invalid IL or missing references) //IL_07c8: Unknown result type (might be due to invalid IL or missing references) //IL_0836: Unknown result type (might be due to invalid IL or missing references) Col val = C("8a3b32"); double num = toVillage.Angle(); for (int i = 0; i < 30; i++) { double num2 = Math.PI * 2.0 * (double)i / 30.0; if (!(Math.Abs(GX.angle_difference(num2, num)) < 0.34)) { kit.Place(V2.FromAngle(num2) * 13.0, 0.0 - num2); double num3 = rng.Rr(3.2, 4.2); kit.Cylinder(0.32, 0.08, num3, 5L, DARK_WOOD, V(0.0, num3 * 0.5, 0.0), solid: true); kit.Cylinder(0.3, 0.08, num3 - 0.4, 5L, C("5a4330"), V(0.0, num3 * 0.5 - 0.2, 1.3)); } } double[] array = new double[2] { -1.0, 1.0 }; foreach (double num4 in array) { kit.Place(V2.FromAngle(num + num4 * 0.5) * 14.5, 0.0 - num); kit.Cylinder(0.16, 0.0, 2.6, 4L, DARK_WOOD, V(0.0, 0.8, 0.0), solid: false, V(0.0, 0.0, -1.0)); } kit.Place(V2.ZERO); Campfire(kit); for (int k = 0; k < 3; k++) { V2 val2 = V2.FromAngle(num + Math.PI + (double)(k - 1) * 0.9) * 7.5; kit.Place(val2, Math.Atan2(0f - val2.x, 0f - val2.y)); kit.Roof(V(3.8, 2.6, 4.6), ((Col)(ref val)).Darkened(0.1 * (double)k), V(0.0, 1.3, 0.0), Vec3.ZERO, "tent"); kit.Box(V(0.1, 2.9, 0.1), DARK_WOOD, V(0.0, 1.45, 2.3), solid: false); kit.Solids.Add((V(3.2, 2.4, 4.2), kit.Base * new Xf(Basis.IDENTITY, V(0.0, 1.2, 0.0)))); } kit.Place(V2.FromAngle(num + 1.3) * 5.0); kit.Cylinder(0.14, 0.1, 9.0, 5L, DARK_WOOD, V(0.0, 4.5, 0.0), solid: true); kit.Box(V(2.2, 1.4, 0.06), C("b0392e"), V(1.2, 8.0, 0.0), solid: false); kit.Box(V(1.0, 0.7, 0.06), C("7a2620"), V(1.9, 6.9, 0.0), solid: false); kit.Place(V2.FromAngle(num - 1.4) * 6.0, num); kit.Box(V(0.12, 1.5, 0.12), DARK_WOOD, V(-1.2, 0.75, 0.0), solid: false); kit.Box(V(0.12, 1.5, 0.12), DARK_WOOD, V(1.2, 0.75, 0.0), solid: false); kit.Box(V(2.6, 0.1, 0.1), DARK_WOOD, V(0.0, 1.4, 0.0), solid: false); for (int l = 0; l < 3; l++) { kit.Cylinder(0.04, 0.04, 2.6, 4L, WOOD, V(-0.7 + (double)l * 0.7, 1.25, 0.2), solid: false, V(0.18, 0.0, 0.0)); kit.Cylinder(0.1, 0.0, 0.4, 4L, STONE, V(-0.7 + (double)l * 0.7, 2.7, 0.44), solid: false, V(0.18, 0.0, 0.0)); } kit.Place(V2.FromAngle(num + Math.PI + 0.2) * 3.5, 0.5); kit.Box(V(1.0, 0.9, 1.0), WOOD, V(0.0, 0.45, 0.0)); kit.Box(V(0.8, 0.7, 0.8), C("8a6844"), V(0.2, 1.25, 0.1), solid: false, V(0.0, 0.5, 0.0)); kit.Cylinder(0.45, 0.45, 1.0, 8L, C("6a4d34"), V(1.4, 0.5, 0.2), solid: true); } public static void Arena(Kit kit, GodotRng rng, Col tone) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: 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_0063: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: 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_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_0260: Unknown result type (might be due to invalid IL or missing references) //IL_0368: Unknown result type (might be due to invalid IL or missing references) //IL_03c8: Unknown result type (might be due to invalid IL or missing references) //IL_02bc: Unknown result type (might be due to invalid IL or missing references) //IL_030e: Unknown result type (might be due to invalid IL or missing references) //IL_041d: Unknown result type (might be due to invalid IL or missing references) Col val = STONE; Col color = ((Col)(ref val)).Lerp(tone, 0.25); val = DARK_STONE; Col color2 = ((Col)(ref val)).Lerp(tone, 0.2); kit.Place(V2.ZERO); kit.Cylinder(13.5, 14.0, 0.3, 16L, color2, V(0.0, 0.15, 0.0)); kit.Cylinder(11.0, 11.0, 0.34, 16L, color, V(0.0, 0.17, 0.0)); kit.Cylinder(6.0, 6.0, 0.38, 12L, color2, V(0.0, 0.19, 0.0)); kit.Solids.Add((V(19.0, 0.34, 19.0), kit.Base * new Xf(Basis.IDENTITY, V(0.0, 0.17, 0.0)))); for (int i = 0; i < 8; i++) { double num = Math.PI * 2.0 * (double)i / 8.0 + Math.PI / 8.0; V2 local = V2.FromAngle(num) * 12.4; if (kit.IsFree(local, nearLandmark: false)) { kit.Place(local, 0.0 - num); kit.Cylinder(0.9, 0.75, 5.5, 6L, color, V(0.0, 2.75, 0.0), solid: true); kit.Box(V(2.0, 0.4, 2.0), color2, V(0.0, 5.7, 0.0), solid: false); if (i % 2 == 0) { kit.Cylinder(0.7, 0.5, 0.4, 6L, C("2e2a2a"), V(0.0, 6.1, 0.0)); kit.Cylinder(0.45, 0.0, 1.3, 5L, FIRE, V(0.0, 6.9, 0.0)); } else { kit.Box(V(0.12, 2.6, 0.12), DARK_WOOD, V(0.0, 7.2, 0.0), solid: false); kit.Box(V(1.6, 1.0, 0.05), ((Col)(ref tone)).Lightened(0.15), V(0.85, 7.9, 0.0), solid: false); } kit.Box(V(0.7, 1.3, 7.0), color2, V(0.0, 0.65, 4.4), solid: true, V(0.0, -0.39, 0.0)); } } } public static void Lair(Kit kit, GodotRng rng, V2 toVillage) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: 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_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_02da: Unknown result type (might be due to invalid IL or missing references) //IL_031a: Unknown result type (might be due to invalid IL or missing references) //IL_0366: Unknown result type (might be due to invalid IL or missing references) //IL_0374: Unknown result type (might be due to invalid IL or missing references) //IL_03a5: Unknown result type (might be due to invalid IL or missing references) //IL_03e8: Unknown result type (might be due to invalid IL or missing references) //IL_0458: Unknown result type (might be due to invalid IL or missing references) //IL_04c9: Unknown result type (might be due to invalid IL or missing references) double num = toVillage.Angle(); kit.Place(V2.ZERO, Math.Atan2(toVillage.x, toVillage.y)); kit.Ball(5.5, C("6c645b"), V(-4.5, 2.2, -3.0), V(1.1, 0.9, 1.0)); kit.Ball(5.0, C("7d7469"), V(4.5, 2.0, -3.0), V(1.0, 0.9, 1.1)); kit.Ball(4.6, C("756b61"), V(0.0, 5.2, -4.0), V(1.5, 0.7, 1.0)); kit.Ball(3.0, C("877e72"), V(-7.5, 1.0, 1.0), V(1.2, 0.8, 1.0)); kit.Box(V(4.6, 3.6, 3.0), C("121012"), V(0.0, 1.8, -2.2), solid: false); kit.Solids.Add((V(15.0, 6.0, 7.0), kit.Base * new Xf(Basis.IDENTITY, V(0.0, 3.0, -4.5)))); for (int i = 0; i < 7; i++) { double x = rng.Rr(-5.0, 5.0); double z = rng.Rr(1.0, 8.0); Vec3 at = V(x, 0.12, z); double height = rng.Rr(0.8, 1.8); double y = rng.Rf() * (Math.PI * 2.0); kit.Cylinder(0.08, 0.05, height, 4L, C("e2dccb"), at, solid: false, V(Math.PI / 2.0, y, 0.0)); } kit.Ball(0.45, C("e2dccb"), V(2.0, 0.3, 4.0), V(1.0, 0.8, 1.3)); kit.Place(V2.FromAngle(num) * 11.0); kit.Cylinder(0.12, 0.08, 4.5, 5L, DARK_WOOD, V(0.0, 2.25, 0.0)); kit.Ball(0.5, C("e2dccb"), V(0.0, 4.6, 0.0), V(1.0, 0.85, 1.2)); kit.Box(V(1.4, 0.1, 0.1), C("e2dccb"), V(0.0, 3.8, 0.0), solid: false, V(0.0, 0.0, 0.3)); kit.Box(V(1.4, 0.1, 0.1), C("e2dccb"), V(0.0, 3.8, 0.0), solid: false, V(0.0, 0.0, -0.3)); } public static void Merchant(Kit kit, GodotRng rng, Col tone) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0047: 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_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Unknown result type (might be due to invalid IL or missing references) //IL_02ab: Unknown result type (might be due to invalid IL or missing references) //IL_0395: Unknown result type (might be due to invalid IL or missing references) //IL_047d: Unknown result type (might be due to invalid IL or missing references) //IL_04be: Unknown result type (might be due to invalid IL or missing references) //IL_04c3: Unknown result type (might be due to invalid IL or missing references) //IL_04cf: Unknown result type (might be due to invalid IL or missing references) //IL_04d4: Unknown result type (might be due to invalid IL or missing references) //IL_04e0: Unknown result type (might be due to invalid IL or missing references) //IL_04e5: Unknown result type (might be due to invalid IL or missing references) //IL_04f1: Unknown result type (might be due to invalid IL or missing references) //IL_04f6: Unknown result type (might be due to invalid IL or missing references) //IL_04fd: Unknown result type (might be due to invalid IL or missing references) //IL_04fe: Unknown result type (might be due to invalid IL or missing references) //IL_03f5: Unknown result type (might be due to invalid IL or missing references) //IL_03e9: Unknown result type (might be due to invalid IL or missing references) //IL_0516: Unknown result type (might be due to invalid IL or missing references) //IL_057f: Unknown result type (might be due to invalid IL or missing references) //IL_05d6: Unknown result type (might be due to invalid IL or missing references) //IL_061d: Unknown result type (might be due to invalid IL or missing references) //IL_064e: Unknown result type (might be due to invalid IL or missing references) //IL_06a8: Unknown result type (might be due to invalid IL or missing references) //IL_06fd: Unknown result type (might be due to invalid IL or missing references) //IL_0744: Unknown result type (might be due to invalid IL or missing references) kit.Place(new V2(-3.5, 0.0), 0.3); kit.Box(V(2.0, 0.5, 4.0), WOOD, V(0.0, 1.1, 0.0)); kit.Cylinder(1.2, 1.2, 3.8, 8L, C("e6dcc4"), V(0.0, 2.0, 0.0), solid: false, V(Math.PI / 2.0, 0.0, 0.0)); Vec3[] array = new Vec3[4] { V(-1.15, 0.65, 1.3), V(1.15, 0.65, 1.3), V(-1.15, 0.65, -1.3), V(1.15, 0.65, -1.3) }; foreach (Vec3 at in array) { kit.Cylinder(0.65, 0.65, 0.14, 8L, DARK_WOOD, at, solid: false, V(0.0, 0.0, Math.PI / 2.0)); } kit.Box(V(0.1, 0.1, 2.2), DARK_WOOD, V(0.5, 0.9, 3.0), solid: false); kit.Box(V(0.1, 0.1, 2.2), DARK_WOOD, V(-0.5, 0.9, 3.0), solid: false); kit.Place(new V2(3.0, 0.5), -0.2); array = new Vec3[4] { V(-1.8, 1.2, -1.2), V(1.8, 1.2, -1.2), V(-1.8, 1.4, 1.2), V(1.8, 1.4, 1.2) }; for (int i = 0; i < array.Length; i++) { Vec3 at2 = array[i]; kit.Cylinder(0.09, 0.09, (double)at2.y * 2.0, 4L, DARK_WOOD, at2); } for (int j = 0; j < 4; j++) { kit.Box(V(1.0, 0.08, 3.1), (j % 2 == 0) ? C("d9b040") : C("e6dcc4"), V(-1.5 + (double)j * 1.0, 2.6, 0.0), solid: false, V(0.14, 0.0, 0.0)); } kit.Box(V(3.4, 0.95, 1.0), WOOD, V(0.0, 0.47, 0.5)); Col[] array2 = (Col[])(object)new Col[5] { C("c8553d"), C("d9b040"), C("6f9440"), C("9bb4e0"), tone }; for (int k = 0; k < 5; k++) { kit.Ball(0.2, array2[k], V(-1.2 + (double)k * 0.6, 1.1, 0.5)); } kit.Box(V(0.9, 0.8, 0.9), C("8a6844"), V(-2.6, 0.4, -0.5)); kit.Cylinder(0.45, 0.45, 1.0, 8L, C("6a4d34"), V(2.7, 0.5, -0.6), solid: true); kit.Place(new V2(0.0, -4.5)); kit.Cylinder(0.12, 0.08, 8.0, 5L, DARK_WOOD, V(0.0, 4.0, 0.0)); kit.Box(V(2.0, 1.0, 0.05), C("e2b93a"), V(1.1, 7.3, 0.0), solid: false); kit.Box(V(0.45, 0.55, 0.45), LAMP_GLOW, V(0.0, 3.2, 0.4), solid: false); kit.Place(new V2(0.5, 5.0)); Campfire(kit); } public static void Cache(Kit kit, GodotRng rng) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) kit.Place(V2.ZERO, rng.Rf() * (Math.PI * 2.0)); V2 local = V2.FromAngle(rng.Rf() * (Math.PI * 2.0)) * rng.Rr(5.0, 8.0); kit.Place(local); kit.Ball(0.5, STONE, V(0.0, 0.25, 0.0), V(1.3, 0.8, 1.2)); kit.Ball(0.35, DARK_STONE, V(0.05, 0.65, 0.0), V(1.2, 0.8, 1.1)); kit.Ball(0.22, STONE, V(0.0, 0.95, 0.03)); } public static void Portal(Kit kit, V2 toward) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_023c: Unknown result type (might be due to invalid IL or missing references) //IL_0286: Unknown result type (might be due to invalid IL or missing references) //IL_02dd: Unknown result type (might be due to invalid IL or missing references) //IL_0332: Unknown result type (might be due to invalid IL or missing references) //IL_03ab: Unknown result type (might be due to invalid IL or missing references) //IL_0421: Unknown result type (might be due to invalid IL or missing references) //IL_04da: Unknown result type (might be due to invalid IL or missing references) //IL_0557: Unknown result type (might be due to invalid IL or missing references) //IL_05ce: Unknown result type (might be due to invalid IL or missing references) //IL_05dc: Unknown result type (might be due to invalid IL or missing references) //IL_060a: Unknown result type (might be due to invalid IL or missing references) Col color = default(Col); ((Col)(ref color))..ctor(0.5, 0.9, 1.0, 0.15); kit.Place(V2.ZERO, Math.Atan2(toward.x, toward.y)); kit.Cylinder(7.0, 7.4, 0.35, 12L, DARK_STONE, V(0.0, 0.17, 0.0)); kit.Cylinder(5.2, 5.4, 0.35, 12L, STONE, V(0.0, 0.5, 0.0)); kit.Solids.Add((V(10.0, 0.7, 10.0), kit.Base * new Xf(Basis.IDENTITY, V(0.0, 0.35, 0.0)))); double[] array = new double[2] { -3.2, 3.2 }; foreach (double x in array) { kit.Box(V(1.3, 7.5, 1.3), STONE, V(x, 4.4, 0.0)); kit.Box(V(1.7, 0.5, 1.7), DARK_STONE, V(x, 1.0, 0.0), solid: false); kit.Box(V(0.5, 0.5, 0.2), color, V(x, 3.0, 0.7), solid: false); kit.Box(V(0.5, 0.5, 0.2), color, V(x, 5.0, 0.7), solid: false); } kit.Box(V(9.0, 1.2, 1.5), DARK_STONE, V(0.0, 8.7, 0.0), solid: false); kit.Box(V(5.0, 0.6, 1.1), STONE, V(0.0, 9.6, 0.0), solid: false); kit.Box(V(5.1, 7.0, 0.12), new Col(0.45, 0.85, 1.0, 0.4), V(0.0, 4.4, 0.0), solid: false); kit.Cylinder(0.5, 0.0, 2.4, 5L, new Col(0.6, 0.92, 1.0, 0.4), V(0.0, 11.2, 0.0)); Vec3[] array2 = new Vec3[2] { V(-5.2, 0.7, 4.0), V(5.2, 0.7, 4.0) }; foreach (Vec3 vec in array2) { kit.Cylinder(0.6, 0.45, 1.4, 6L, DARK_STONE, vec + V(0.0, 0.7, 0.0), solid: true); kit.Cylinder(0.45, 0.0, 1.3, 5L, new Col(0.5, 0.9, 1.0, 0.25), vec + V(0.0, 2.0, 0.0)); } for (int j = 0; j < 6; j++) { double num = Math.PI * 2.0 * (double)j / 6.0 + 0.5; kit.Place(V2.FromAngle(num) * 9.5, 0.0 - num); kit.Box(V(0.9, 1.6, 0.5), DARK_STONE, V(0.0, 0.7, 0.0), solid: true, V(0.06, 0.0, 0.08)); } } } public sealed class Piece { public string Kind; public Vec3 Origin; public Vec3[] Vertices; public Col[] Colors; public int[] Indices; public bool VisualOnly = true; public int Body = -1; public string Name = ""; } public struct SolidBox { public string Kind; public int Body; public Vec3 Size; public Basis Basis; public Vec3 Origin; public Vec3 X => Basis.X; public Vec3 Y => Basis.Y; public Vec3 Z => Basis.Z; } public struct SolidCylinder { public string Kind; public float Radius; public float Height; public Vec3 Origin; } public sealed class GiantSet { public string Name; public Vec3[] Vertices; public Col[] Colors; public int[] Indices; public List<Xf> Instances = new List<Xf>(); } public struct Geyser { public Vec3 Position; public float Power; public float Rise; public float ColumnHeight; public Col Color; } public struct GodMarker { public string Part; public Vec3 Position; public float Yaw; } public sealed class Built { public readonly List<Piece> Pieces = new List<Piece>(); public readonly List<SolidBox> Solids = new List<SolidBox>(); public readonly List<SolidBox> ExtraSolids = new List<SolidBox>(); public readonly List<SolidCylinder> Cylinders = new List<SolidCylinder>(); public readonly List<V3> Smokes = new List<V3>(); public readonly List<GiantSet> Giants = new List<GiantSet>(); public readonly List<Geyser> Geysers = new List<Geyser>(); public readonly List<GodMarker> Gods = new List<GodMarker>(); public int GiantCount; public int FloorCount; internal int NextBody; } public sealed class Soup { public readonly List<Vec3> P = new List<Vec3>(); public readonly List<Col> C = new List<Col>(); public bool Empty => P.Count == 0; } public static class Detail { private static readonly int[] PM = new int[2] { -1, 1 }; public static string Kind(Col c) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) if ((double)c.a < 0.99) { return "glow"; } float num = c.S(); float num2 = c.V(); if ((double)num < 0.2 && (double)num2 < 0.72) { return "stone"; } if ((double)num2 >= 0.72 && (double)num < 0.35) { return "plaster"; } float num3 = c.H(); if ((double)num3 > 0.05 && (double)num3 < 0.15 && (double)num < 0.48 && (double)num2 >= 0.6) { return "stone"; } if ((double)num3 > 0.02 && (double)num3 < 0.14 && (double)num >= 0.2 && (double)num2 < 0.62) { return "wood"; } return "other"; } public static GodotRng RngAt(Vec3 at, long salt = 0L) { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Expected O, but got Unknown return new GodotRng(GX.HashV3i(GX.RoundI32((double)at.x * 37.0), GX.RoundI32((double)at.y * 41.0), GX.RoundI32((double)at.z * 43.0)) + salt); } private static Col Shade(Col c, double amount) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) if (!(amount > 0.0)) { return ((Col)(ref c)).Darkened(0.0 - amount); } return ((Col)(ref c)).Lightened(amoun