using System; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using ComputerysModdingUtilities; using FishNet; using FishNet.Managing.Timing; using Microsoft.CodeAnalysis; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: StraftatMod(false)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("sudden_death")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyDescription("Create walls that close in on a timer")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+1d0a3fa39cc3a6fda8289735d3c600f33aa4412f")] [assembly: AssemblyProduct("com.koki.suddendeath")] [assembly: AssemblyTitle("sudden_death")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace straftat_sudden_death { [BepInPlugin("sudden_death", "com.koki.suddendeath", "1.0.0")] public class Plugin : BaseUnityPlugin { [CompilerGenerated] private static class <>O { public static BeforeSpawnAction <0>__ResetTimer; public static Action <1>__TickCountdown; public static Action <2>__TickSD; } private static ManualLogSource log; private static int ticksUntilSD; private static bool isSD; private static Vector3 center; private static float radius; private static ConfigEntry startRadius; private static ConfigEntry minRadius; private static ConfigEntry shrinkRate; private static ConfigEntry secUntilSD; private static ConfigEntry zoneAlpha; private static GameObject SDCylinder; private static PlayerHealth[] players; private static ConfigEntry damagePerSec; private static ConfigEntry zoneColor; private void Awake() { //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_0042: Expected O, but got Unknown string text = ":3"; ((Object)((Component)this).gameObject).hideFlags = (HideFlags)61; log = ((BaseUnityPlugin)this).Logger; ConfigInit(); object obj = <>O.<0>__ResetTimer; if (obj == null) { BeforeSpawnAction val = ResetTimer; <>O.<0>__ResetTimer = val; obj = (object)val; } PauseManager.OnBeforeSpawn += (BeforeSpawnAction)obj; } public void ConfigInit() { zoneColor = ((BaseUnityPlugin)this).Config.Bind("general", "Death Zone Color", "110, 53, 45", "R, G, B"); startRadius = ((BaseUnityPlugin)this).Config.Bind("general", "Death Zone Starting Radius", 37.5f, "zone is a cylinder, radius measured in arbitrary in game units"); minRadius = ((BaseUnityPlugin)this).Config.Bind("general", "Death Zone Minimum Radius", 10f, "zone is a cylinder, radius measured in arbitrary in game units"); shrinkRate = ((BaseUnityPlugin)this).Config.Bind("general", "Units / Second that the Zone Shrinks at", 1f, "zone is a cylinder, radius measured in arbitrary in game units"); secUntilSD = ((BaseUnityPlugin)this).Config.Bind("general", "Seconds until Zone Appears", 45, ""); damagePerSec = ((BaseUnityPlugin)this).Config.Bind("general", "Damage per Second while in Zone", 10f, ""); zoneAlpha = ((BaseUnityPlugin)this).Config.Bind("general", "Death Zone Transparency", 0.5f, "Transparency of the zone (0.0 to 1.0)"); } public static void ResetTimer() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) radius = startRadius.Value; ticksUntilSD = secUntilSD.Value * 60; isSD = false; center = Vector3.zero; if (Object.op_Implicit((Object)(object)SDCylinder)) { Object.Destroy((Object)(object)SDCylinder); } InstanceFinder.TimeManager.OnTick -= TickCountdown; InstanceFinder.TimeManager.OnTick -= TickSD; InstanceFinder.TimeManager.OnTick += TickCountdown; InstanceFinder.TimeManager.OnTick += TickSD; } public static void TickCountdown() { if (ticksUntilSD > 0) { ticksUntilSD--; } else if (!isSD) { isSD = true; if (Object.op_Implicit((Object)(object)SDCylinder)) { Object.Destroy((Object)(object)SDCylinder); } SpawnSDCylinder(); } } public static void TickSD() { //IL_0147: 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_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0071: 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_0096: Unknown result type (might be due to invalid IL or missing references) if (!isSD) { return; } TimeManager timeManager = InstanceFinder.TimeManager; if (timeManager.Tick % 60 == 0 && InstanceFinder.IsServer) { PlayerHealth[] array = players; foreach (PlayerHealth val in array) { if (Object.op_Implicit((Object)(object)val)) { Vector3 position = ((Component)val).transform.position; float num = Vector3.Distance(new Vector3(position.x, 0f, position.z), new Vector3(center.x, 0f, center.z)); if (num > radius) { val.RemoveHealth(damagePerSec.Value / 25f); } } } } if (Object.op_Implicit((Object)(object)SDCylinder)) { if (radius > minRadius.Value) { radius -= shrinkRate.Value / 60f; } SDCylinder.transform.localScale = new Vector3(radius * 2f, 200f, radius * 2f); } } public static void SpawnSDCylinder() { //IL_0080: 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_00ba: 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_0057: 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_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) SDCylinder = GameObject.CreatePrimitive((PrimitiveType)2); SDCylinder.GetComponent().enabled = false; players = Object.FindObjectsOfType(); PlayerHealth[] array = players; foreach (PlayerHealth val in array) { if ((Object)(object)val != (Object)null && !val.isKilled) { center += ((Component)val).transform.position; } } center /= (float)players.Length; SDCylinder.transform.position = new Vector3(center.x, 0f, center.z); Material material = ((Renderer)SDCylinder.GetComponent()).material; material.shader = Shader.Find("UI/Default"); string[] array2 = zoneColor.Value.Split(", "); Color val2 = default(Color); ((Color)(ref val2))..ctor(float.Parse(array2[0]) / 255f, float.Parse(array2[1]) / 255f, float.Parse(array2[2]) / 255f, zoneAlpha.Value); material.SetColor("_Color", val2); material.SetInt("_Cull", 0); } } public static class PluginInfo { public const string PLUGIN_GUID = "sudden_death"; public const string PLUGIN_NAME = "com.koki.suddendeath"; public const string PLUGIN_VERSION = "1.0.0"; } }