using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
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 ExitGames.Client.Photon;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using Peak;
using Peak.Afflictions;
using Photon.Pun;
using Photon.Realtime;
using UnityEngine;
using UnityEngine.SceneManagement;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("Thraac.TheBadOnes")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+e34cdee01efddbbbbff78449ee2b198add379293")]
[assembly: AssemblyProduct("Thraac.TheBadOnes")]
[assembly: AssemblyTitle("TheBadOnes")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[Embedded]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
internal sealed class NullableAttribute : Attribute
{
public readonly byte[] NullableFlags;
public NullableAttribute(byte P_0)
{
NullableFlags = new byte[1] { P_0 };
}
public NullableAttribute(byte[] P_0)
{
NullableFlags = P_0;
}
}
[CompilerGenerated]
[Embedded]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
internal sealed class NullableContextAttribute : Attribute
{
public readonly byte Flag;
public NullableContextAttribute(byte P_0)
{
Flag = P_0;
}
}
[CompilerGenerated]
[Embedded]
[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
internal sealed class RefSafetyRulesAttribute : Attribute
{
public readonly int Version;
public RefSafetyRulesAttribute(int P_0)
{
Version = P_0;
}
}
}
namespace BepInEx
{
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
[Conditional("CodeGeneration")]
[Embedded]
internal sealed class BepInAutoPluginAttribute : Attribute
{
public BepInAutoPluginAttribute(string? id = null, string? name = null, string? version = null)
{
}
}
}
namespace BepInEx.Preloader.Core.Patching
{
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
[Conditional("CodeGeneration")]
[Embedded]
internal sealed class PatcherAutoPluginAttribute : Attribute
{
public PatcherAutoPluginAttribute(string? id = null, string? name = null, string? version = null)
{
}
}
}
namespace Microsoft.CodeAnalysis
{
[Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace TheBadOnes
{
internal static class CondorPool
{
public const string Key = "TBO_Condor";
private const float SwoopTime = 2f;
private const float GrabMult = 1f;
private const float TriggerRadius = 3f;
private const float LookScale = 1f;
private static GameObject? _holder;
private static GameObject? _template;
private static SFX_Instance? _silent;
public static bool TryEnsure()
{
if ((Object)(object)_template == (Object)null)
{
_template = CopyMapCondor() ?? BuildCodeCondor();
}
IPunPrefabPool prefabPool = PhotonNetwork.PrefabPool;
DefaultPool val = (DefaultPool)(object)((prefabPool is DefaultPool) ? prefabPool : null);
if (val == null)
{
return false;
}
val.ResourceCache["TBO_Condor"] = _template;
return true;
}
public static void Clear()
{
if ((Object)(object)_template != (Object)null)
{
Object.Destroy((Object)(object)_template);
}
_template = null;
IPunPrefabPool prefabPool = PhotonNetwork.PrefabPool;
((DefaultPool)(((prefabPool is DefaultPool) ? prefabPool : null)?)).ResourceCache.Remove("TBO_Condor");
}
private static Transform Holder()
{
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_001c: Expected O, but got Unknown
if ((Object)(object)_holder == (Object)null)
{
_holder = new GameObject("TBO_CondorTemplates");
_holder.SetActive(false);
Object.DontDestroyOnLoad((Object)(object)_holder);
}
return _holder.transform;
}
private static GameObject? CopyMapCondor()
{
//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
Condor[] array = Resources.FindObjectsOfTypeAll<Condor>();
foreach (Condor val in array)
{
if (!((Object)(object)val == (Object)null) && !((Object)(object)val.view == (Object)null) && !((Object)(object)((Component)val).GetComponent<ModCondor>() != (Object)null) && ((Component)val).transform.IsChildOf(((Component)val.view).transform))
{
GameObject val2 = Object.Instantiate<GameObject>(((Component)val.view).gameObject, Holder());
((Object)val2).name = "TBO_Condor";
val2.SetActive(false);
((Component)val2.GetComponentInChildren<Condor>(true)).gameObject.AddComponent<ModCondor>();
ManualLogSource log = Plugin.Log;
Scene scene = ((Component)val).gameObject.scene;
log.LogInfo((object)("[condor] using the real condor from '" + ((Scene)(ref scene)).name + "'."));
return val2;
}
}
return null;
}
private static GameObject BuildCodeCondor()
{
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
//IL_000b: Expected O, but got Unknown
//IL_005a: Unknown result type (might be due to invalid IL or missing references)
//IL_0061: Expected O, but got Unknown
//IL_009e: Unknown result type (might be due to invalid IL or missing references)
//IL_00a5: Expected O, but got Unknown
//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
//IL_0147: Unknown result type (might be due to invalid IL or missing references)
//IL_014c: 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_0162: Unknown result type (might be due to invalid IL or missing references)
//IL_0173: Unknown result type (might be due to invalid IL or missing references)
//IL_0178: Unknown result type (might be due to invalid IL or missing references)
//IL_017d: Unknown result type (might be due to invalid IL or missing references)
//IL_0187: Expected O, but got Unknown
GameObject val = new GameObject("TBO_Condor");
val.transform.SetParent(Holder(), false);
val.SetActive(false);
Rigidbody val2 = val.AddComponent<Rigidbody>();
val2.isKinematic = false;
val2.useGravity = false;
val2.constraints = (RigidbodyConstraints)112;
val2.interpolation = (RigidbodyInterpolation)1;
PhotonView view = val.AddComponent<PhotonView>();
Animator anim = val.AddComponent<Animator>();
GameObject val3 = new GameObject("CarryTrigger");
val3.transform.SetParent(val.transform, false);
SphereCollider val4 = val3.AddComponent<SphereCollider>();
((Collider)val4).isTrigger = true;
val4.radius = 3f;
val3.SetActive(false);
GameObject val5 = new GameObject("DragToPoint");
val5.transform.SetParent(val.transform, false);
val5.transform.localPosition = new Vector3(0f, -1.5f, 0f);
Condor val6 = val.AddComponent<Condor>();
val6.view = view;
val6.rb = val2;
val6.anim = anim;
val6.carryTrigger = val3;
val6.dragToPoint = val5.transform;
val6.sfxDive = Silent();
val6.sfxDrop = Silent();
val6.swoopTime = 2f;
val6.swoopCurve = new AnimationCurve((Keyframe[])(object)new Keyframe[3]
{
new Keyframe(0f, 0f),
new Keyframe(0.5f, -1f),
new Keyframe(1f, 0f)
});
val6.headGrabMult = 1f;
val6.bodyGrabMult = 1f;
AddGhostLook(val.transform);
val.AddComponent<ModCondor>();
Plugin.Log.LogInfo((object)"[condor] no condor on this map; built one in code (GhostBall look).");
return val;
}
private static void AddGhostLook(Transform parent)
{
//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_005f: 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)
GameObject val = Resources.Load<GameObject>("GhostBall");
if ((Object)(object)val == (Object)null)
{
Plugin.Log.LogWarning((object)"[condor] GhostBall not found; condor will be invisible.");
return;
}
GameObject val2 = Object.Instantiate<GameObject>(val, parent, false);
((Object)val2).name = "Look";
val2.transform.localPosition = Vector3.zero;
val2.transform.localRotation = Quaternion.identity;
Transform transform = val2.transform;
transform.localScale *= 1f;
for (int i = 0; i < 3; i++)
{
Component[] componentsInChildren = val2.GetComponentsInChildren<Component>(true);
for (int num = componentsInChildren.Length - 1; num >= 0; num--)
{
Component val3 = componentsInChildren[num];
if (!((Object)(object)val3 == (Object)null) && !(val3 is Transform) && !(val3 is Renderer) && !(val3 is MeshFilter) && !(val3 is ParticleSystem) && !(val3 is Animator) && !(val3 is LODGroup))
{
Object.DestroyImmediate((Object)(object)val3);
}
}
}
Animator[] componentsInChildren2 = val2.GetComponentsInChildren<Animator>(true);
foreach (Animator val4 in componentsInChildren2)
{
val4.applyRootMotion = false;
}
ParticleSystem[] componentsInChildren3 = val2.GetComponentsInChildren<ParticleSystem>(true);
foreach (ParticleSystem val5 in componentsInChildren3)
{
string text = ((Object)((Component)val5).gameObject).name.ToLowerInvariant();
if (text.Contains("die") || text.Contains("explo") || text.Contains("death"))
{
((Component)val5).gameObject.SetActive(false);
}
}
}
private static SFX_Instance Silent()
{
if ((Object)(object)_silent == (Object)null)
{
_silent = ScriptableObject.CreateInstance<SFX_Instance>();
_silent.clips = Array.Empty<AudioClip>();
((Object)_silent).hideFlags = (HideFlags)32;
}
return _silent;
}
}
internal class ModCondor : MonoBehaviour
{
private const float LoopRadius = 10f;
private const float ScanRange = 16f;
private const float LoopDuration = 10f;
private const float DiveTime = 1.5f;
private const float CarrySpeed = 15f;
private Condor _condor;
private GameObject? _nest;
private double _timeBase;
private float _nextLog;
internal float ClockSeconds => (float)(PhotonNetwork.Time - _timeBase);
private void Awake()
{
//IL_001d: Unknown result type (might be due to invalid IL or missing references)
//IL_0027: Expected O, but got Unknown
//IL_0038: 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)
_timeBase = PhotonNetwork.Time;
_condor = ((Component)this).GetComponent<Condor>();
_nest = new GameObject("TBO_CondorNest");
_nest.transform.position = ((Component)this).transform.position;
_condor.nest = _nest;
_condor.radius = 10f;
_condor.swoopTime = 1.5f;
_condor.moveToNestSpeed = 15f;
_condor.scanCharacterSuccessDistance = 16f;
_condor.seed = _condor.view.ViewID % 1000;
Plugin.Log.LogInfo((object)$"[condor] spawn: run clock={RunClock():0.00} pos={((Component)this).transform.position}");
}
private static float RunClock()
{
if (!((Object)(object)RunManager.Instance != (Object)null))
{
return -1f;
}
return RunManager.Instance.TimeSinceRunStarted;
}
private void Update()
{
//IL_0045: 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)
if (!(Time.time < _nextLog))
{
_nextLog = Time.time + 1f;
Plugin.Log.LogInfo((object)$"[condor] t={ClockSeconds:0.0} pos={((Component)this).transform.position} rb={_condor.rb.position} kin={_condor.rb.isKinematic}");
}
}
private void OnDestroy()
{
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
Plugin.Log.LogInfo((object)$"[condor] despawn: run clock={RunClock():0.00} pos={((Component)this).transform.position}");
if ((Object)(object)_nest != (Object)null)
{
Object.Destroy((Object)(object)_nest);
}
foreach (Character allCharacter in Character.AllCharacters)
{
if ((Object)(object)allCharacter != (Object)null && (Object)(object)allCharacter.data.carrierCondor == (Object)(object)_condor)
{
allCharacter.data.carrierCondor = null;
}
}
}
}
[HarmonyPatch(/*Could not decode attribute arguments.*/)]
internal static class Patch_Condor_Time
{
private static bool Prefix(Condor __instance, ref float __result)
{
ModCondor modCondor = default(ModCondor);
if (!((Component)__instance).TryGetComponent<ModCondor>(ref modCondor))
{
return true;
}
__result = modCondor.ClockSeconds;
return false;
}
}
[HarmonyPatch(typeof(Condor), "RPCA_CondorAction")]
internal static class Patch_Condor_Action
{
private static void Postfix(Condor __instance, PhotonView characterView, CondorActionType condorActionType)
{
//IL_0019: Unknown result type (might be due to invalid IL or missing references)
if (!((Object)(object)((Component)__instance).GetComponent<ModCondor>() == (Object)null))
{
Plugin.Log.LogInfo((object)string.Format("[condor] {0} -> {1}", condorActionType, ((Object)(object)characterView != (Object)null) ? ((Object)((Component)characterView).gameObject).name : "?"));
}
}
}
[HarmonyPatch(typeof(DefaultPool), "Instantiate")]
internal static class Patch_DefaultPool_Condor
{
private static bool Prefix(string prefabId, ref GameObject? __result)
{
if (prefabId != "TBO_Condor" || CondorPool.TryEnsure())
{
return true;
}
Plugin.Log.LogWarning((object)"[condor] couldn't register a condor template; skipping spawn.");
__result = null;
return false;
}
}
public class EffectManager : MonoBehaviour
{
internal static readonly Dictionary<int, Character> TornadoTargets = new Dictionary<int, Character>();
private float _timer;
private float _nextInterval;
private string? _lastEffect;
internal static readonly Color[] Palette = BuildPalette();
private static readonly Vector3[] Directions;
private static readonly float[] StrengthSteps;
internal const float BlizzardDuration = 15f;
private const float BlizzardColdPerSecond = 0.04f;
private const float BlizzardShelterFloor = 0.2f;
private const float BlizzardShelterBand = 0.2f;
private static bool _windThresholdsLogged;
private static Color[] _iceTints;
private static Vector3 _cannonEntryOffset;
private static bool _cannonOffsetKnown;
private static bool _bubbleRadiusKnown;
public static EffectManager Instance { get; private set; } = null;
private void Awake()
{
Instance = this;
_nextInterval = PickInterval();
SceneManager.activeSceneChanged += OnSceneChanged;
}
private void OnDestroy()
{
SceneManager.activeSceneChanged -= OnSceneChanged;
}
private void OnSceneChanged(Scene from, Scene to)
{
Patch_WindChillZone_ToggleWind.Restore();
Patch_AntiSphere.Clear();
Patch_ScoutCannon.Clear();
CondorPool.Clear();
}
private static Color[] BuildPalette()
{
string[] array = new string[7] { "#ffe552", "#FF69B4", "#1900ff", "#48ff00", "#9400D3", "#e70f0f", "#FF800D" };
Color[] array2 = (Color[])(object)new Color[array.Length];
for (int i = 0; i < array.Length; i++)
{
ColorUtility.TryParseHtmlString(array[i], ref array2[i]);
}
return array2;
}
private static float PickInterval()
{
float num = Mathf.Min(Plugin.MinInterval.Value, Plugin.MaxInterval.Value);
float num2 = Mathf.Max(Plugin.MinInterval.Value, Plugin.MaxInterval.Value);
return Random.Range(num, num2);
}
private static int PickCount(int min, int max)
{
int num = Mathf.Min(min, max);
int num2 = Mathf.Max(min, max);
return Random.Range(num, num2 + 1);
}
internal static bool NearCampfire(float extra = 0f)
{
//IL_0035: 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)
Character localCharacter = Character.localCharacter;
if ((Object)(object)localCharacter == (Object)null)
{
return false;
}
foreach (Campfire aLL_CAMPFIRE in Campfire.ALL_CAMPFIRES)
{
if (!((Object)(object)aLL_CAMPFIRE == (Object)null) && Vector3.Distance(((Component)aLL_CAMPFIRE).transform.position, localCharacter.Center) <= aLL_CAMPFIRE.moraleBoostRadius + extra)
{
return true;
}
}
return false;
}
private void Update()
{
//IL_0015: 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)
Patch_WindChillZone_ToggleWind.Tick();
if (!PhotonNetwork.IsMasterClient || !PhotonNetwork.InRoom)
{
return;
}
Scene activeScene = SceneManager.GetActiveScene();
string name = ((Scene)(ref activeScene)).name;
if (name.Contains("Island") || name.Contains("Level_"))
{
_timer += Time.deltaTime;
if (!(_timer < _nextInterval))
{
_timer = 0f;
_nextInterval = PickInterval();
SpawnWave();
}
}
}
private void TriggerWind(float yComponent = 0.2f, float duration = 4f)
{
//IL_003e: 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_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_0069: Unknown result type (might be due to invalid IL or missing references)
WindChillZone instance = WindChillZone.instance;
if ((Object)(object)instance == (Object)null)
{
Plugin.Log.LogWarning((object)"No WindChillZone here; skipping wind.");
return;
}
Vector3 val = new Vector3(Random.Range(-1f, 1f), yComponent, Random.Range(-1f, 1f));
Vector3 normalized = ((Vector3)(ref val)).normalized;
((Component)instance).GetComponent<PhotonView>().RPC("RPCA_ToggleWind", (RpcTarget)0, new object[3] { true, normalized, duration });
Plugin.Log.LogInfo((object)"Summoned extreme wind.");
}
private void TriggerEmotes(List<Character> players)
{
string[] array = new string[2] { "A_Scout_Emote_PlayDead", "A_Scout_Emote_BackFlip" };
foreach (Character player in players)
{
string text = array[Random.Range(0, array.Length)];
player.refs.view.RPC("RPCA_PlayRemove", (RpcTarget)0, new object[2] { text, true });
}
}
private void TriggerHotSun(List<Character> players)
{
//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)
//IL_000a: Unknown result type (might be due to invalid IL or missing references)
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
//IL_0019: Expected O, but got Unknown
PhotonNetwork.RaiseEvent((byte)72, (object)null, new RaiseEventOptions
{
Receivers = (ReceiverGroup)1
}, SendOptions.SendReliable);
}
private void TriggerBlizzard(List<Character> players)
{
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
//IL_001a: 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_0029: Expected O, but got Unknown
TriggerWind(-0.2f, 15f);
PhotonNetwork.RaiseEvent((byte)73, (object)null, new RaiseEventOptions
{
Receivers = (ReceiverGroup)1
}, SendOptions.SendReliable);
}
private void TriggerIceVision(List<Character> players)
{
//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)
//IL_000a: Unknown result type (might be due to invalid IL or missing references)
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
//IL_0019: Expected O, but got Unknown
PhotonNetwork.RaiseEvent((byte)74, (object)null, new RaiseEventOptions
{
Receivers = (ReceiverGroup)1
}, SendOptions.SendReliable);
}
public void RunHotSunLocal()
{
((MonoBehaviour)this).StartCoroutine(HotSunRoutine());
}
public void RunBlizzardLocal()
{
((MonoBehaviour)this).StartCoroutine(BlizzardRoutine());
}
public void RunIceVisionLocal()
{
((MonoBehaviour)this).StartCoroutine(IceVisionRoutine());
}
private IEnumerator HotSunRoutine()
{
Character localCharacter = Character.localCharacter;
if (!((Object)(object)localCharacter == (Object)null))
{
Patch_DayNight_ForceSun.ForceBlazing = true;
GameObject go = new GameObject("BadSun");
go.transform.position = localCharacter.Center;
go.transform.localScale = Vector3.one * 1000f;
go.AddComponent<HotSun>();
ManualLogSource log = Plugin.Log;
DayNightManager instance = DayNightManager.instance;
float? obj;
if (instance == null)
{
obj = null;
}
else
{
Light sun = instance.sun;
obj = ((sun != null) ? new float?(sun.intensity) : ((float?)null));
}
log.LogInfo((object)$"[hotsun] spawned. sun.intensity = {obj:0.0}");
yield return (object)new WaitForSeconds(15f);
Object.Destroy((Object)(object)go);
Plugin.Log.LogInfo((object)"[hotsun] removed.");
Patch_DayNight_ForceSun.ForceBlazing = false;
NotificationsManager.Show("The Hot Sun Sets.");
}
}
private IEnumerator BlizzardRoutine()
{
Character me = Character.localCharacter;
if ((Object)(object)me == (Object)null)
{
yield break;
}
WindChillZone instance = WindChillZone.instance;
if ((Object)(object)instance == (Object)null)
{
yield break;
}
float lower = Mathf.Max(instance.lightVolumeSampleThreshold_lower, 0.2f);
float margin = Mathf.Min(Mathf.Max(instance.lightVolumeSampleThreshold_margin, 0.2f), 1f - lower);
if (!_windThresholdsLogged)
{
_windThresholdsLogged = true;
Plugin.Log.LogInfo((object)$"[blizzard] zone lower={instance.lightVolumeSampleThreshold_lower:0.00} margin={instance.lightVolumeSampleThreshold_margin:0.00} -> using lower={lower:0.00} margin={margin:0.00}");
}
bool sampled = false;
float t = 0f;
while (t < 15f)
{
float windIntensityAtPoint = WindChillZone.GetWindIntensityAtPoint(me.Center, lower, margin);
if (!sampled && t > 1f)
{
sampled = true;
Plugin.Log.LogInfo((object)$"[blizzard] alpha={LightVolume.Instance().SamplePositionAlpha(me.Center, false):0.000} exposure={windIntensityAtPoint:0.00} nearFire={NearCampfire()}");
}
if (windIntensityAtPoint > 0f && !NearCampfire())
{
me.refs.afflictions.AddStatus((STATUSTYPE)2, windIntensityAtPoint * 0.04f * Time.deltaTime, false, true, true, false);
}
t += Time.deltaTime;
yield return null;
}
NotificationsManager.Show("No Blizzard rules forever my son.");
}
private IEnumerator IceVisionRoutine()
{
Character localCharacter = Character.localCharacter;
if ((Object)(object)localCharacter == (Object)null)
{
yield break;
}
IllegalScreenEffect[] array = Object.FindObjectsByType<IllegalScreenEffect>((FindObjectsSortMode)0);
foreach (IllegalScreenEffect val in array)
{
if (!(val.statusName.ToUpper() != "BLIND") && !((Object)(object)val.mat == (Object)null) && val.mat.HasProperty("_Color1"))
{
if (_iceTints == null)
{
_iceTints = (Color[])(object)new Color[Palette.Length + 1];
Palette.CopyTo(_iceTints, 0);
_iceTints[Palette.Length] = val.mat.GetColor("_Color1");
}
Color val2 = _iceTints[Random.Range(0, _iceTints.Length)];
val.mat.SetColor("_Color1", val2);
val.mat.SetColor("_Color2", val2 * 0.6f);
val.mat.SetFloat("_FogDistance", 6f);
val.mat.SetFloat("_MinFog", 0.35f);
}
}
localCharacter.refs.afflictions.AddAffliction((Affliction)new Affliction_Blind
{
totalTime = 20f
}, false);
yield return null;
}
private void SpawnWave()
{
List<Character> list = Character.AllCharacters.Where((Character c) => ((Component)c).gameObject.activeInHierarchy && !c.data.dead).ToList();
if (list.Count == 0)
{
Plugin.Log.LogWarning((object)"No players found; skipping wave.");
return;
}
List<string> list2 = new List<string>();
if (Plugin.TornadoesEnabled.Value)
{
list2.Add("Tornado");
}
if (Plugin.DynamiteEnabled.Value)
{
list2.Add("Dynamite");
}
if (Plugin.ZombiesEnabled.Value)
{
list2.Add("Zombie");
}
if (Plugin.WindEnabled.Value)
{
list2.Add("Wind");
}
if (Plugin.BugsEnabled.Value)
{
list2.Add("Bugs");
}
if (Plugin.EmotesEnabled.Value)
{
list2.Add("Emotes");
}
if (Plugin.HotSunEnabled.Value)
{
list2.Add("Sun");
}
if (Plugin.FrogsEnabled.Value)
{
list2.Add("Frogs");
}
if (Plugin.CannonsEnabled.Value)
{
list2.Add("Cannons");
}
if (Plugin.BigGhostEnabled.Value)
{
list2.Add("BigGhosts");
}
if (Plugin.TumbleweedsEnabled.Value)
{
list2.Add("Tumbleweeds");
}
if (Plugin.BlizzardsEnabled.Value)
{
list2.Add("Blizzards");
}
if (Plugin.GravityBubblesEnabled.Value)
{
list2.Add("GravityBubbles");
}
if (Plugin.IceVisionEnabled.Value)
{
list2.Add("IceVision");
}
if (Plugin.CondorsEnabled.Value && CondorPool.TryEnsure())
{
list2.Add("Condors");
}
if (list2.Count == 0)
{
Plugin.Log.LogInfo((object)"No Effects Enabled. Skipping Wave.");
return;
}
if (list2.Count > 1 && _lastEffect != null)
{
list2.Remove(_lastEffect);
}
string text = (_lastEffect = list2[Random.Range(0, list2.Count)]);
int num;
switch (text)
{
case "Wind":
NotificationsManager.Broadcast("It Heckin Wimdy!");
TriggerWind();
return;
case "Emotes":
NotificationsManager.Broadcast("Do a flip!");
((MonoBehaviour)this).StartCoroutine(EmoteRoutine(list));
return;
case "GravityBubbles":
((MonoBehaviour)this).StartCoroutine(SpawnGravityBubbles(list));
return;
case "Sun":
{
float num2 = (((Object)(object)DayNightManager.instance?.sun != (Object)null) ? DayNightManager.instance.sun.intensity : (-1f));
Plugin.Log.LogInfo((object)$"[sun] intensity = {num2:0.00} (need >= 5 for HotSun)");
if ((Object)(object)DayNightManager.instance != (Object)null && DayNightManager.instance.isDay > 0.5f)
{
NotificationsManager.Broadcast("Hot Sun Out!");
TriggerHotSun(list);
}
else
{
NotificationsManager.Broadcast("Suns down so a blizzard rolls in!");
TriggerBlizzard(list);
}
return;
}
case "Blizzards":
NotificationsManager.Broadcast("A blizzard rolls in!");
TriggerBlizzard(list);
return;
case "IceVision":
NotificationsManager.Broadcast("Flashbang out!");
TriggerIceVision(list);
return;
case "Tornado":
num = PickCount(Plugin.MinCount.Value, Plugin.MaxCount.Value);
break;
case "Dynamite":
num = PickCount(Plugin.DynamiteMinCount.Value, Plugin.DynamiteMaxCount.Value);
break;
case "Bugs":
num = list.Count * 3;
break;
case "BigGhosts":
num = list.Count;
break;
case "Tumbleweeds":
num = list.Count * 4;
break;
case "Condors":
num = Mathf.Clamp(list.Count, 1, 3);
break;
default:
num = list.Count;
break;
}
Plugin.Log.LogInfo((object)$"Spawning {num} {text}(s); next wave in {_nextInterval:0.0}s.");
switch (text)
{
case "Tornado":
NotificationsManager.Broadcast("Tornado incoming!");
break;
case "Dynamite":
NotificationsManager.Broadcast("Dynamite lit!");
break;
case "Zombie":
NotificationsManager.Broadcast("They're coming to get you Scout!");
break;
case "Bugs":
NotificationsManager.Broadcast("MY BUGS!");
break;
case "Frogs":
NotificationsManager.Broadcast("Ribbit!");
break;
case "Cannons":
NotificationsManager.Broadcast("FIRING THE CANNONS!");
break;
case "BigGhosts":
NotificationsManager.Broadcast("Boo Buddies!");
break;
case "Tumbleweeds":
NotificationsManager.Broadcast("Its Highnoon!");
break;
case "GravityBubbles":
NotificationsManager.Broadcast("Thats a funny looking bubble");
break;
case "Condors":
NotificationsManager.Broadcast("The Claw!");
break;
}
for (int num3 = 0; num3 < num; num3++)
{
Character target = list[Random.Range(0, list.Count)];
List<Character> list3 = list.Where((Character p) => (Object)(object)p != (Object)(object)target).ToList();
Character spawnNear = ((list3.Count > 0) ? list3[Random.Range(0, list3.Count)] : target);
switch (text)
{
case "Tornado":
((MonoBehaviour)this).StartCoroutine(SpawnTornado(target, spawnNear));
break;
case "Dynamite":
((MonoBehaviour)this).StartCoroutine(SpawnDynamite(spawnNear));
break;
case "Zombie":
((MonoBehaviour)this).StartCoroutine(SpawnZombie(spawnNear));
break;
case "Bugs":
((MonoBehaviour)this).StartCoroutine(SpawnBugs(spawnNear));
break;
case "Frogs":
((MonoBehaviour)this).StartCoroutine(SpawnFrogs(spawnNear));
break;
case "Cannons":
((MonoBehaviour)this).StartCoroutine(SpawnCannon(list[num3 % list.Count]));
break;
case "BigGhosts":
((MonoBehaviour)this).StartCoroutine(SpawnBigGhost(spawnNear));
break;
case "Tumbleweeds":
((MonoBehaviour)this).StartCoroutine(SpawnTumbleweeds(spawnNear));
break;
case "Condors":
((MonoBehaviour)this).StartCoroutine(SpawnCondors(list[num3 % list.Count]));
break;
}
}
}
private IEnumerator SpawnTornado(Character target, Character spawnNear)
{
yield return (object)new WaitForSeconds(0.5f);
Vector3 center = spawnNear.Center;
GameObject val = PhotonNetwork.Instantiate("Tornado", center, Quaternion.identity, (byte)0, (object[])null);
int viewID = val.GetComponent<PhotonView>().ViewID;
TornadoTargets[viewID] = target;
Plugin.Log.LogInfo((object)$"Tornado {viewID} spawned near {((Object)spawnNear).name}, chasing {((Object)target).name}.");
}
private IEnumerator SpawnZombie(Character spawnNear)
{
yield return (object)new WaitForSeconds(0.5f);
Vector3 center = spawnNear.Center;
GameObject zombieObj = PhotonNetwork.Instantiate("MushroomZombie", center, Quaternion.identity, (byte)0, (object[])null);
Plugin.Log.LogInfo((object)$"Zombie spawned near {((Object)spawnNear).name} at {center}.");
yield return (object)new WaitForSeconds(90f);
if ((Object)(object)zombieObj != (Object)null)
{
PhotonNetwork.Destroy(zombieObj);
}
}
private IEnumerator SpawnBugs(Character spawnNear)
{
yield return (object)new WaitForSeconds(0.5f);
Vector3 val = default(Vector3);
((Vector3)(ref val))..ctor(Random.Range(-2f, 2f), 0f, Random.Range(-2f, 2f));
Vector3 val2 = spawnNear.Center + val;
GameObject bugObj = null;
int randomBug = Random.Range(1, 4);
switch (randomBug)
{
case 1:
bugObj = PhotonNetwork.InstantiateItemRoom("Scorpion", val2, Quaternion.identity, true);
break;
case 2:
bugObj = PhotonNetwork.InstantiateItemRoom("Beetle", val2, Quaternion.identity, true);
break;
case 3:
bugObj = PhotonNetwork.InstantiateItemRoom("Beehive", val2, Quaternion.identity, true);
break;
}
if ((Object)(object)bugObj == (Object)null)
{
Plugin.Log.LogWarning((object)"Spawned object has no Bug component");
yield break;
}
Plugin.Log.LogInfo((object)$"Bug spawned near {((Object)spawnNear).name} at {val2}");
yield return (object)new WaitForSeconds(30f);
if (randomBug == 3)
{
Beehive component = bugObj.GetComponent<Beehive>();
if ((Object)(object)component != (Object)null && (Object)(object)component.currentBees != (Object)null)
{
PhotonNetwork.Destroy(((Component)component.currentBees).gameObject);
}
if ((Object)(object)bugObj != (Object)null)
{
PhotonNetwork.Destroy(bugObj);
}
}
else if ((Object)(object)bugObj != (Object)null)
{
PhotonNetwork.Destroy(bugObj);
}
}
private IEnumerator SpawnFrogs(Character spawnNear)
{
yield return (object)new WaitForSeconds(0.5f);
Vector3 val = default(Vector3);
((Vector3)(ref val))..ctor(Random.Range(-5f, 5f), 0f, Random.Range(-5f, 5f));
Vector3 val2 = spawnNear.Center + val;
GameObject frogObj;
try
{
frogObj = PhotonNetwork.InstantiateItemRoom("Frog", val2, Quaternion.identity, true);
}
catch (Exception ex)
{
Plugin.Log.LogError((object)("[frog] spawn failed: " + ex.GetType().Name + ": " + ex.Message));
yield break;
}
Plugin.Log.LogInfo((object)$"Frog spawned near {((Object)spawnNear).name} at {val2}");
yield return (object)new WaitForSeconds(45f);
if ((Object)(object)frogObj != (Object)null)
{
PhotonNetwork.Destroy(frogObj);
}
}
private IEnumerator SpawnCondors(Character target)
{
yield return (object)new WaitForSeconds(0.5f);
Vector3 val = default(Vector3);
((Vector3)(ref val))..ctor(Random.Range(-4f, 4f), 15f, Random.Range(-4f, 4f));
GameObject condorObj = PhotonNetwork.Instantiate("TBO_Condor", target.Center + val, Quaternion.identity, (byte)0, (object[])null);
if ((Object)(object)condorObj == (Object)null)
{
Plugin.Log.LogWarning((object)"[condor] spawn failed.");
yield break;
}
Condor condor = condorObj.GetComponentInChildren<Condor>();
Plugin.Log.LogInfo((object)("[condor] spawned over " + ((Object)target).name));
yield return (object)new WaitForSeconds(1.5f);
if ((Object)(object)condor != (Object)null && (Object)(object)target != (Object)null && !target.data.dead)
{
condor.view.RPC("RPCA_CondorAction", (RpcTarget)0, new object[2]
{
((MonoBehaviourPun)target).photonView,
(object)(CondorActionType)0
});
Plugin.Log.LogInfo((object)("[condor] sent first dive at " + ((Object)target).name));
}
yield return (object)new WaitForSeconds(30f);
if (!((Object)(object)condorObj == (Object)null))
{
Character val2 = ((IEnumerable<Character>)Character.AllCharacters).FirstOrDefault((Func<Character, bool>)((Character c) => (Object)(object)c != (Object)null && (Object)(object)c.data.carrierCondor == (Object)(object)condor));
if ((Object)(object)val2 != (Object)null)
{
condor.view.RPC("RPCA_CondorAction", (RpcTarget)0, new object[2]
{
((MonoBehaviourPun)val2).photonView,
(object)(CondorActionType)2
});
yield return (object)new WaitForSeconds(1f);
}
if ((Object)(object)condorObj != (Object)null)
{
PhotonNetwork.Destroy(condorObj);
}
}
}
private IEnumerator EmoteRoutine(List<Character> players)
{
TriggerEmotes(players);
yield return (object)new WaitForSeconds(15f);
TriggerEmotes(players);
}
private IEnumerator SpawnCannon(Character spawnNear)
{
spawnNear.refs.view.RPC("RPCA_Fall", (RpcTarget)0, new object[2] { 4f, 0f });
yield return (object)new WaitForSeconds(0.5f);
Quaternion val = Quaternion.Euler(-55f, Random.Range(0f, 360f), 0f);
Vector3 val2 = default(Vector3);
((Vector3)(ref val2))..ctor(0f, 1f, 0f);
float num = 2500f;
float num2 = Mathf.Clamp(num / 500f, 1f, 6f);
object[] array = new object[3] { 8843f, num, num2 };
GameObject cannon;
try
{
cannon = PhotonNetwork.Instantiate("ScoutCannon_Placed", spawnNear.Center - val2, val, (byte)0, array);
}
catch (Exception ex)
{
Plugin.Log.LogError((object)("[cannon] spawn failed: " + ex.GetType().Name + ": " + ex.Message));
yield break;
}
if (!((Object)(object)cannon == (Object)null))
{
Transform val3 = cannon.transform.Find("Cannon/Entry");
Plugin.Log.LogInfo((object)string.Format("[cannon] entry={0} root={1}", ((Object)(object)val3 == (Object)null) ? "NULL" : ((object)val3.position/*cast due to .constrained prefix*/).ToString(), cannon.transform.position));
if ((Object)(object)val3 == (Object)null)
{
Plugin.Log.LogWarning((object)("[cannon] no Entry node on " + ((Object)cannon).name + "; placement will be off"));
}
if ((Object)(object)val3 != (Object)null)
{
Transform transform = cannon.transform;
transform.position += spawnNear.Center - val3.position;
}
cannon.GetComponent<ScoutCannon>().Light();
yield return (object)new WaitForSeconds(15f);
if ((Object)(object)cannon != (Object)null)
{
PhotonNetwork.Destroy(cannon);
}
}
}
private IEnumerator SpawnDynamite(Character spawnNear)
{
yield return (object)new WaitForSeconds(0.5f);
float num = (float)Random.Range(-4, 5) * 1f;
float num2 = (float)Random.Range(1, 3) * 0.5f;
float num3 = (float)Random.Range(-4, 5) * 1f;
Vector3 val = default(Vector3);
((Vector3)(ref val))..ctor(num, num2, num3);
Vector3 val2 = spawnNear.Center + val;
GameObject val3;
try
{
val3 = PhotonNetwork.InstantiateItemRoom("Dynamite", val2, Quaternion.identity, true);
}
catch (Exception ex)
{
Plugin.Log.LogError((object)("Dynamite spawn failed: " + ex.Message));
yield break;
}
Dynamite component = val3.GetComponent<Dynamite>();
if ((Object)(object)component == (Object)null)
{
Plugin.Log.LogWarning((object)"Spawned object has no Dynamite component.");
yield break;
}
component.LightFlare();
Plugin.Log.LogInfo((object)$"Dynamite spawnewd and lit near {((Object)spawnNear).name} at {val2}.");
}
private IEnumerator SpawnBigGhost(Character spawnNear)
{
yield return (object)new WaitForSeconds(0.5f);
Vector3 center = spawnNear.Center;
float num = (float)Random.Range(1, 3) * 5f;
float num2 = ((Random.Range(0, 2) == 0) ? (-1f) : 1f);
float num3 = (float)Random.Range(1, 3) * 5f;
float num4 = ((Random.Range(0, 2) == 0) ? (-1f) : 1f);
Vector3 val = default(Vector3);
((Vector3)(ref val))..ctor(num * num2, 0f, num3 * num4);
GameObject val2;
try
{
val2 = PhotonNetwork.Instantiate("GhostBall", center + val, Quaternion.identity, (byte)0, (object[])null);
}
catch (Exception ex)
{
Plugin.Log.LogError((object)("[ghost] spawn failed: " + ex.GetType().Name + ": " + ex.Message));
yield break;
}
if (!((Object)(object)val2 == (Object)null))
{
Plugin.Log.LogInfo((object)("[ghost] spawned near " + ((Object)spawnNear).name));
}
}
private IEnumerator SpawnTumbleweeds(Character spawnNear)
{
yield return (object)new WaitForSeconds(0.5f);
Vector3 center = spawnNear.Center;
float num = (float)Random.Range(0, 3) * 3f;
float num2 = ((Random.Range(0, 2) == 0) ? (-1f) : 1f);
float num3 = (float)Random.Range(0, 3) * 3f;
float num4 = ((Random.Range(0, 2) == 0) ? (-1f) : 1f);
Vector3 val = default(Vector3);
((Vector3)(ref val))..ctor(num * num2, 0f, num3 * num4);
GameObject tumbleweedObj;
try
{
tumbleweedObj = PhotonNetwork.Instantiate("TumbleWeed", center + val, Quaternion.identity, (byte)0, (object[])null);
}
catch (Exception ex)
{
Plugin.Log.LogError((object)("[tumbleweed] spawn failed: " + ex.GetType().Name + ": " + ex.Message));
yield break;
}
if (!((Object)(object)tumbleweedObj == (Object)null))
{
Plugin.Log.LogInfo((object)("[tumbleweed] spawned near " + ((Object)spawnNear).name));
yield return (object)new WaitForSeconds(25f);
if ((Object)(object)tumbleweedObj != (Object)null)
{
PhotonNetwork.Destroy(tumbleweedObj);
}
}
}
private IEnumerator SpawnGravityBubbles(List<Character> players)
{
yield return (object)new WaitForSeconds(0.5f);
int num = Random.Range(0, Directions.Length);
Vector3 val = Directions[num];
int num2 = Random.Range(0, StrengthSteps.Length);
float num3 = StrengthSteps[num2];
Vector3 val2 = default(Vector3);
foreach (Character player in players)
{
Vector3 center = player.Center;
float num4 = (float)Random.Range(0, 2) * 1f;
float num5 = ((Random.Range(0, 2) == 0) ? (-1f) : 1f);
float num6 = (float)Random.Range(0, 3) * 1f;
float num7 = (float)Random.Range(0, 2) * 1f;
float num8 = ((Random.Range(0, 2) == 0) ? (-1f) : 1f);
((Vector3)(ref val2))..ctor(num4 * num5, num6, num7 * num8);
float num9 = Random.Range(0.8f, 2.8f);
object[] array = new object[4] { 8842f, num3, num9, val };
GameObject val3;
try
{
val3 = PhotonNetwork.Instantiate("AntiSphere_Projectile", center + val2, Quaternion.identity, (byte)0, array);
}
catch (Exception ex)
{
Plugin.Log.LogError((object)("[gavitybubbles] spawn failed: " + ex.GetType().Name + ": " + ex.Message));
continue;
}
if ((Object)(object)val3 == (Object)null)
{
continue;
}
if (!_bubbleRadiusKnown)
{
_bubbleRadiusKnown = true;
AntiSphere componentInChildren = val3.GetComponentInChildren<AntiSphere>(true);
if ((Object)(object)componentInChildren == (Object)null || (Object)(object)componentInChildren.coll == (Object)null)
{
Plugin.Log.LogWarning((object)("[gravitybubbles] no AntiSphere/coll on '" + ((Object)val3).name + "'"));
}
else
{
Plugin.Log.LogInfo((object)$"[gravitybubbles] radius={componentInChildren.coll.radius * val3.transform.lossyScale.x:0.00} root={(Object)(object)val3.GetComponent<AntiSphere>() != (Object)null}");
}
}
Plugin.Log.LogInfo((object)$"[gravitybubbles] spawned on {((Object)player).name} dir={val} strength={num3:0.0}");
}
}
static EffectManager()
{
//IL_0022: Unknown result type (might be due to invalid IL or missing references)
//IL_0027: 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_0042: 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_0060: 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_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_0083: Unknown result type (might be due to invalid IL or missing references)
//IL_0088: 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_00a3: Unknown result type (might be due to invalid IL or missing references)
//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
//IL_00ab: 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_00c9: Unknown result type (might be due to invalid IL or missing references)
//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
Vector3[] obj = new Vector3[6]
{
Vector3.up,
new Vector3(0f, -1f, 0f),
default(Vector3),
default(Vector3),
default(Vector3),
default(Vector3)
};
Vector3 val = new Vector3(1f, 0.6f, 0f);
obj[2] = ((Vector3)(ref val)).normalized;
val = new Vector3(-1f, -0.6f, 0f);
obj[3] = ((Vector3)(ref val)).normalized;
val = new Vector3(0f, 0.6f, 1f);
obj[4] = ((Vector3)(ref val)).normalized;
val = new Vector3(0f, -0.6f, -1f);
obj[5] = ((Vector3)(ref val)).normalized;
Directions = (Vector3[])(object)obj;
StrengthSteps = new float[4] { 35f, 45f, 55f, 65f };
_iceTints = null;
}
}
public class FollowTarget : MonoBehaviour
{
public Character? Target;
private void Update()
{
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)Target != (Object)null)
{
((Component)this).transform.position = Target.Center;
}
}
}
[HarmonyPatch(typeof(Tornado), "Start")]
public static class Patch_Tornado_Start
{
private static void Postfix(Tornado __instance)
{
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
//IL_000b: Expected O, but got Unknown
//IL_0017: Unknown result type (might be due to invalid IL or missing references)
//IL_0026: Unknown result type (might be due to invalid IL or missing references)
//IL_002c: Expected O, but got Unknown
//IL_0042: Unknown result type (might be due to invalid IL or missing references)
//IL_0048: Expected O, but got Unknown
//IL_0065: Unknown result type (might be due to invalid IL or missing references)
GameObject val = new GameObject("TornadoTarget");
val.transform.position = ((Component)__instance).transform.position;
GameObject val2 = new GameObject("TornadoPoints");
val2.transform.SetParent(val.transform);
GameObject val3 = new GameObject("Target0");
val3.transform.SetParent(val2.transform);
val3.transform.position = ((Component)__instance).transform.position;
int viewID = ((Component)__instance).GetComponent<PhotonView>().ViewID;
if (EffectManager.TornadoTargets.TryGetValue(viewID, out Character value))
{
FollowTarget followTarget = val3.AddComponent<FollowTarget>();
followTarget.Target = value;
EffectManager.TornadoTargets.Remove(viewID);
}
typeof(Tornado).GetField("targetParent", BindingFlags.Instance | BindingFlags.NonPublic)?.SetValue(__instance, val2.transform);
ApplyTornadoColor(__instance, viewID);
if (PhotonNetwork.IsMasterClient)
{
typeof(Tornado).GetField("lifeTime", BindingFlags.Instance | BindingFlags.NonPublic)?.SetValue(__instance, Random.Range(15f, 25f));
}
static void ApplyTornadoColor(Tornado tornado, int num)
{
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
//IL_0014: 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_001f: 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_008b: 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_0065: Unknown result type (might be due to invalid IL or missing references)
Color val4 = EffectManager.Palette[num % EffectManager.Palette.Length];
Color val5 = val4 * 0.6f;
Renderer[] componentsInChildren = ((Component)tornado).GetComponentsInChildren<Renderer>();
Renderer[] array = componentsInChildren;
foreach (Renderer val6 in array)
{
if (((Object)val6).name == "Smoke")
{
val6.material.SetColor("_Color", val4);
val6.material.SetColor("_Color2", val5);
}
else
{
val6.material.SetColor("_Color1", val4);
val6.material.SetColor("_Color2", val5);
}
}
}
}
}
[HarmonyPatch(typeof(Dynamite), "EnableFlareVisuals")]
public static class Patch_Dynamite_EnableFlareVisuals
{
private static void Postfix(Dynamite __instance)
{
//IL_001a: 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_0021: 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_0049: 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_0064: Unknown result type (might be due to invalid IL or missing references)
int viewID = ((Component)__instance).GetComponent<PhotonView>().ViewID;
Color chosen = EffectManager.Palette[viewID % EffectManager.Palette.Length];
ColorParticles((Component)(object)__instance, chosen);
TrackNetworkedObject[] array = Object.FindObjectsByType<TrackNetworkedObject>((FindObjectsSortMode)0);
foreach (TrackNetworkedObject val in array)
{
if (!(Vector3.Distance(((Component)val).transform.position, ((Component)__instance).transform.position) > 2f))
{
ColorParticles((Component)(object)val, chosen);
ColorRenderers((Component)(object)val, chosen);
}
}
static void ColorParticles(Component root, Color val3)
{
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
//IL_0016: 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_0025: 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_0037: 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)
ParticleSystem[] componentsInChildren = root.GetComponentsInChildren<ParticleSystem>(true);
foreach (ParticleSystem val2 in componentsInChildren)
{
MainModule main = val2.main;
((MainModule)(ref main)).startColor = new MinMaxGradient(val3);
ColorOverLifetimeModule colorOverLifetime = val2.colorOverLifetime;
if (((ColorOverLifetimeModule)(ref colorOverLifetime)).enabled)
{
((ColorOverLifetimeModule)(ref colorOverLifetime)).color = new MinMaxGradient(val3);
}
}
}
static void ColorRenderers(Component root, Color val3)
{
//IL_0028: Unknown result type (might be due to invalid IL or missing references)
Renderer[] componentsInChildren = root.GetComponentsInChildren<Renderer>(true);
foreach (Renderer val2 in componentsInChildren)
{
Material material = val2.material;
Shader shader = material.shader;
for (int k = 0; k < shader.GetPropertyCount(); k++)
{
if ((int)shader.GetPropertyType(k) == 0)
{
Plugin.Log.LogInfo((object)("[smoke] color prop: " + shader.GetPropertyName(k)));
}
}
}
}
}
}
[HarmonyPatch(typeof(Dynamite), "RPC_Explode")]
public static class Patch_Dynamite_RPC_Explode
{
private static void Postfix(Dynamite __instance)
{
//IL_001a: 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_0026: Unknown result type (might be due to invalid IL or missing references)
//IL_002b: Unknown result type (might be due to invalid IL or missing references)
//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_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_007e: 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_008b: Unknown result type (might be due to invalid IL or missing references)
//IL_0090: Unknown result type (might be due to invalid IL or missing references)
//IL_009d: 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_00ea: 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)
int viewID = ((Component)__instance).GetComponent<PhotonView>().ViewID;
Color val = EffectManager.Palette[viewID % EffectManager.Palette.Length];
Vector3 position = ((Component)__instance).transform.position;
ExplosionEffect[] array = Object.FindObjectsByType<ExplosionEffect>((FindObjectsSortMode)0);
foreach (ExplosionEffect val2 in array)
{
if (Vector3.Distance(((Component)val2).transform.position, position) > 0.5f)
{
continue;
}
ParticleSystem[] componentsInChildren = ((Component)val2).GetComponentsInChildren<ParticleSystem>(true);
foreach (ParticleSystem val3 in componentsInChildren)
{
MainModule main = val3.main;
((MainModule)(ref main)).startColor = new MinMaxGradient(val);
ColorOverLifetimeModule colorOverLifetime = val3.colorOverLifetime;
if (((ColorOverLifetimeModule)(ref colorOverLifetime)).enabled)
{
((ColorOverLifetimeModule)(ref colorOverLifetime)).color = new MinMaxGradient(val);
}
}
Renderer[] componentsInChildren2 = ((Component)val2).GetComponentsInChildren<Renderer>(true);
foreach (Renderer val4 in componentsInChildren2)
{
Material material = val4.material;
Shader shader = material.shader;
for (int l = 0; l < shader.GetPropertyCount(); l++)
{
if ((int)shader.GetPropertyType(l) == 0)
{
material.SetColor(shader.GetPropertyName(l), val);
}
}
Plugin.Log.LogInfo((object)("[boom] '" + ((Object)val4).name + "' shader '" + ((Object)shader).name + "'"));
}
}
}
}
[HarmonyPatch(typeof(WindChillZone), "RPCA_ToggleWind")]
public static class Patch_WindChillZone_ToggleWind
{
private static WindChillZone? _zone;
internal static float GustForce = 85f;
internal static float BlizzardForce = 8f;
private static float _origForce;
private static Bounds _origBounds;
private static float _origStatusRate;
private static float _boostedUntil;
internal static bool IsBoosted => (Object)(object)_zone != (Object)null;
private static void Postfix(WindChillZone __instance, bool set, Vector3 windDir, float untilSwitch)
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
//IL_0074: Unknown result type (might be due to invalid IL or missing references)
//IL_004c: 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_0093: 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_00a2: Unknown result type (might be due to invalid IL or missing references)
//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
bool flag = Mathf.Abs(windDir.y) > 0.001f;
if (set && flag)
{
if ((Object)(object)_zone != (Object)(object)__instance)
{
Restore();
}
if ((Object)(object)_zone == (Object)null)
{
_zone = __instance;
_origForce = __instance.windForce;
_origBounds = __instance.windZoneBounds;
_origStatusRate = __instance.statusApplicationPerSecond;
}
_boostedUntil = Time.time + untilSwitch + 1f;
__instance.windForce = ((windDir.y > 0f) ? GustForce : BlizzardForce);
__instance.windZoneBounds = new Bounds(Vector3.zero, Vector3.one * 100000f);
__instance.statusApplicationPerSecond = 0f;
}
else
{
Restore();
}
}
internal static void Tick()
{
if ((Object)(object)_zone != (Object)null && Time.time >= _boostedUntil)
{
Restore();
}
}
internal static void Restore()
{
//IL_0022: Unknown result type (might be due to invalid IL or missing references)
//IL_0027: Unknown result type (might be due to invalid IL or missing references)
WindChillZone zone = _zone;
_zone = null;
if (!((Object)(object)zone == (Object)null))
{
zone.windForce = _origForce;
zone.windZoneBounds = _origBounds;
zone.statusApplicationPerSecond = _origStatusRate;
}
}
}
[HarmonyPatch(typeof(DayNightManager), "UpdateCycle")]
public static class Patch_DayNight_ForceSun
{
public static bool ForceBlazing;
private static void Postfix(DayNightManager __instance)
{
if (ForceBlazing && (Object)(object)__instance.sun != (Object)null)
{
__instance.sun.intensity = 6f;
}
}
}
[HarmonyPatch(typeof(TumbleWeed), "Start")]
public static class Patch_TumbleWeed_Start
{
private static void Postfix(TumbleWeed __instance)
{
//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_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_0069: Unknown result type (might be due to invalid IL or missing references)
//IL_007b: Unknown result type (might be due to invalid IL or missing references)
int viewID = ((Component)__instance).GetComponent<PhotonView>().ViewID;
float rollForce = ((Random.Range(0, 2) == 0) ? 10f : 20f);
__instance.rollForce = rollForce;
Color val = EffectManager.Palette[viewID % EffectManager.Palette.Length];
Color val2 = val * 0.3f;
Renderer[] componentsInChildren = ((Component)__instance).GetComponentsInChildren<Renderer>();
foreach (Renderer val3 in componentsInChildren)
{
val3.material.SetColor("_BaseColor", val);
val3.material.SetColor("_Tint", val2);
}
}
}
[HarmonyPatch(typeof(AntiSphere), "FixedUpdate")]
public static class Patch_AntiSphere
{
internal const float Marker = 8842f;
private static readonly HashSet<AntiSphere> Seen = new HashSet<AntiSphere>();
private static readonly Dictionary<AntiSphere, Vector3> Ours = new Dictionary<AntiSphere, Vector3>();
internal static void Clear()
{
Seen.Clear();
Ours.Clear();
}
private static void Prefix(AntiSphere __instance)
{
//IL_0065: 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_00ae: Unknown result type (might be due to invalid IL or missing references)
//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
//IL_00d2: 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_0189: 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_011b: 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_0153: Unknown result type (might be due to invalid IL or missing references)
//IL_015a: Unknown result type (might be due to invalid IL or missing references)
if (!Seen.Add(__instance))
{
return;
}
PhotonView componentInParent = ((Component)__instance).GetComponentInParent<PhotonView>();
if ((Object)(object)componentInParent == (Object)null)
{
return;
}
object[] instantiationData = componentInParent.InstantiationData;
if (instantiationData == null || instantiationData.Length < 4 || !(instantiationData[0] is float num) || num != 8842f)
{
return;
}
float num2 = (float)instantiationData[1];
float num3 = (float)instantiationData[2];
Vector3 val = (Vector3)instantiationData[3];
__instance.antiGravForceCurve = AnimationCurve.Linear(0f, num2 * 0.25f, 1f, num2);
__instance.antiGravForceRagdoll = num2 * 0.6f;
__instance.hasLifetime = true;
__instance.lifetime = 20f;
((Component)__instance).transform.localScale = Vector3.one * num3;
Color val2 = EffectManager.Palette[componentInParent.ViewID % EffectManager.Palette.Length];
Renderer[] componentsInChildren = ((Component)__instance).GetComponentsInChildren<Renderer>(true);
foreach (Renderer val3 in componentsInChildren)
{
Material[] materials = val3.materials;
foreach (Material val4 in materials)
{
if (val4.HasProperty("_Color1"))
{
val4.SetColor("_Color1", val2);
}
if (val4.HasProperty("_BaseColor"))
{
val4.SetColor("_BaseColor", val2);
}
if (val4.HasProperty("_EmissionColor"))
{
val4.SetColor("_EmissionColor", val2 * 2f);
}
}
}
Ours[__instance] = val;
Plugin.Log.LogInfo((object)$"[gravitybubbles] tuned {componentInParent.ViewID} dir={val} strength={num2:0.0} scale={num3:0.00}");
}
private static void Postfix(AntiSphere __instance)
{
//IL_007c: Unknown result type (might be due to invalid IL or missing references)
//IL_007d: Unknown result type (might be due to invalid IL or missing references)
//IL_0082: Unknown result type (might be due to invalid IL or missing references)
//IL_0088: Unknown result type (might be due to invalid IL or missing references)
if (!Ours.TryGetValue(__instance, out var value))
{
return;
}
foreach (Character aCTIVE_CHARACTER in __instance.ACTIVE_CHARACTERS)
{
if (!((Object)(object)aCTIVE_CHARACTER == (Object)null) && !((Object)(object)aCTIVE_CHARACTER.data == (Object)null) && !aCTIVE_CHARACTER.data.isClimbing)
{
float num = ((aCTIVE_CHARACTER.data.fallSeconds > 0f) ? __instance.antiGravForceRagdoll : __instance.antiGravForceCurve.Evaluate(aCTIVE_CHARACTER.data.timeInAntigrav));
aCTIVE_CHARACTER.AddForce((value - Vector3.up) * num, 1f, 1f);
}
}
}
}
[HarmonyPatch(typeof(IllegalScreenEffect), "Update")]
public static class Patch_IllegalScreenEffect
{
public static float FadeSpeed = 8f;
private static void Postfix(IllegalScreenEffect __instance)
{
if (!((Object)(object)__instance.character == (Object)null) && !(__instance.activeForSeconds <= 0f))
{
float num = Mathf.Clamp01(__instance.activeForSeconds / 3f);
float num2 = __instance.mat.GetFloat(__instance.shaderVarName);
__instance.mat.SetFloat(__instance.shaderVarName, Mathf.MoveTowards(num2, num, FadeSpeed * Time.deltaTime));
}
}
}
[HarmonyPatch(typeof(HotSun), "Update")]
public static class Patch_HotSun_Update
{
private static bool Prefix()
{
return !EffectManager.NearCampfire();
}
}
[HarmonyPatch(typeof(ScoutCannon), "FixedUpdate")]
public static class Patch_ScoutCannon
{
internal const float Marker = 8843f;
private static readonly HashSet<ScoutCannon> Seen = new HashSet<ScoutCannon>();
internal static void Clear()
{
Seen.Clear();
}
private static void Prefix(ScoutCannon __instance)
{
if (!Seen.Add(__instance))
{
return;
}
PhotonView componentInParent = ((Component)__instance).GetComponentInParent<PhotonView>();
if (!((Object)(object)componentInParent == (Object)null))
{
object[] instantiationData = componentInParent.InstantiationData;
if (instantiationData != null && instantiationData.Length >= 3 && instantiationData[0] is float num && num == 8843f)
{
float num2 = (float)instantiationData[1];
float num3 = (float)instantiationData[2];
__instance.launchForce = num2;
__instance.fallFor = num3;
Plugin.Log.LogInfo((object)$"[cannon] tuned {componentInParent.ViewID} launch={num2:0} fallFor={num3:0.00}");
}
}
}
}
internal static class HostSettings
{
public static bool IsHost
{
get
{
if (PhotonNetwork.InRoom)
{
return PhotonNetwork.IsMasterClient;
}
return true;
}
}
private static string KeyFor(ConfigDefinition def)
{
return "TBO." + def.Section + "." + def.Key;
}
public static void PushIfChanged()
{
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_0020: Expected O, but got Unknown
if (!PhotonNetwork.InRoom || !PhotonNetwork.IsMasterClient)
{
return;
}
Hashtable customProperties = ((RoomInfo)PhotonNetwork.CurrentRoom).CustomProperties;
Hashtable val = new Hashtable();
foreach (KeyValuePair<ConfigDefinition, ConfigEntryBase> item in Plugin.Conf)
{
if (!(item.Key.Section == "UI"))
{
string text = KeyFor(item.Key);
object boxedValue = item.Value.BoxedValue;
if (!((Dictionary<object, object>)(object)customProperties).TryGetValue((object)text, out object value) || !boxedValue.Equals(value))
{
val[(object)text] = boxedValue;
}
}
}
if (((Dictionary<object, object>)(object)val).Count > 0)
{
PhotonNetwork.CurrentRoom.SetCustomProperties(val, (Hashtable)null, (WebFlags)null);
}
}
public static T Get<T>(ConfigEntry<T> entry)
{
if (IsHost)
{
return entry.Value;
}
Hashtable customProperties = ((RoomInfo)PhotonNetwork.CurrentRoom).CustomProperties;
if (((Dictionary<object, object>)(object)customProperties).TryGetValue((object)KeyFor(((ConfigEntryBase)entry).Definition), out object value) && value is T)
{
return (T)value;
}
return entry.Value;
}
}
internal static class NotificationsManager
{
internal class NotificationRelay : MonoBehaviour, IOnEventCallback
{
private void OnEnable()
{
PhotonNetwork.AddCallbackTarget((object)this);
}
private void OnDisable()
{
PhotonNetwork.RemoveCallbackTarget((object)this);
}
public void OnEvent(EventData photonEvent)
{
if (photonEvent.Code == 71)
{
Show((string)photonEvent.CustomData);
}
else if (photonEvent.Code == 72)
{
EffectManager.Instance.RunHotSunLocal();
}
else if (photonEvent.Code == 73)
{
EffectManager.Instance.RunBlizzardLocal();
}
else if (photonEvent.Code == 74)
{
EffectManager.Instance.RunIceVisionLocal();
}
}
}
private static PlayerConnectionLog? _log;
private static MethodInfo? _addMessage;
private const string Size = "150%";
private static readonly string[] Colors = new string[6] { "FF800D", "f9275e", "f3bd10", "FF4444", "44CCFF", "44DD44" };
internal const byte EventCode = 71;
internal const byte HotSunCode = 72;
internal const byte BlizzardCode = 73;
internal const byte BlindCode = 74;
public static void Show(string text)
{
if ((Object)(object)_log == (Object)null)
{
_log = Object.FindFirstObjectByType<PlayerConnectionLog>((FindObjectsInactive)1);
_addMessage = AccessTools.Method(typeof(PlayerConnectionLog), "AddMessage", (Type[])null, (Type[])null);
}
if ((Object)(object)_log == (Object)null || _addMessage == null)
{
Plugin.Log.LogWarning((object)"[notif] PlayerConnectionLog not found");
return;
}
string text2 = Colors[Random.Range(0, Colors.Length)];
string text3 = "<size=150%><color=#" + text2 + ">" + text + "</color></size>";
_addMessage.Invoke(_log, new object[1] { text3 });
}
public static void Broadcast(string text)
{
//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)
//IL_000a: Unknown result type (might be due to invalid IL or missing references)
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
//IL_0019: Expected O, but got Unknown
PhotonNetwork.RaiseEvent((byte)71, (object)text, new RaiseEventOptions
{
Receivers = (ReceiverGroup)1
}, SendOptions.SendReliable);
}
}
[BepInPlugin("Thraac.TheBadOnes", "TheBadOnes", "1.0.0")]
public class Plugin : BaseUnityPlugin
{
internal static ConfigEntry<float> MinInterval;
internal static ConfigEntry<float> MaxInterval;
internal static ConfigEntry<int> MinCount;
internal static ConfigEntry<int> MaxCount;
internal static ConfigEntry<KeyCode> ToggleMenuKey;
internal static ConfigEntry<bool> TornadoesEnabled;
internal static ConfigEntry<bool> DynamiteEnabled;
internal static ConfigEntry<bool> ZombiesEnabled;
internal static ConfigEntry<int> DynamiteMinCount;
internal static ConfigEntry<int> DynamiteMaxCount;
internal static ConfigEntry<bool> WindEnabled;
internal static ConfigEntry<bool> BugsEnabled;
internal static ConfigEntry<bool> EmotesEnabled;
internal static ConfigEntry<bool> HotSunEnabled;
internal static ConfigEntry<bool> FrogsEnabled;
internal static ConfigEntry<bool> CannonsEnabled;
internal static ConfigEntry<bool> BigGhostEnabled;
internal static ConfigEntry<bool> TumbleweedsEnabled;
internal static ConfigEntry<bool> BlizzardsEnabled;
internal static ConfigEntry<bool> GravityBubblesEnabled;
internal static ConfigEntry<bool> IceVisionEnabled;
internal static ConfigEntry<bool> CondorsEnabled;
private Harmony _harmony;
public const string Id = "Thraac.TheBadOnes";
internal static ManualLogSource Log { get; private set; }
internal static ConfigFile Conf { get; private set; }
public static string Name => "TheBadOnes";
public static string Version => "1.0.0";
private void Awake()
{
//IL_0044: Unknown result type (might be due to invalid IL or missing references)
//IL_004e: Expected O, but got Unknown
//IL_0081: Unknown result type (might be due to invalid IL or missing references)
//IL_008b: Expected O, but got Unknown
//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
//IL_00bd: Expected O, but got Unknown
//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
//IL_00ef: Expected O, but got Unknown
//IL_019b: Unknown result type (might be due to invalid IL or missing references)
//IL_01a5: Expected O, but got Unknown
//IL_01ce: Unknown result type (might be due to invalid IL or missing references)
//IL_01d8: Expected O, but got Unknown
//IL_036f: Unknown result type (might be due to invalid IL or missing references)
//IL_0379: Expected O, but got Unknown
//IL_0389: Unknown result type (might be due to invalid IL or missing references)
//IL_038f: Expected O, but got Unknown
Log = ((BaseUnityPlugin)this).Logger;
Conf = ((BaseUnityPlugin)this).Config;
MinInterval = ((BaseUnityPlugin)this).Config.Bind<float>("Timing", "MinIntervalSeconds", 30f, new ConfigDescription("Shortest possible wait between tornado waves.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(5f, 300f), Array.Empty<object>()));
MaxInterval = ((BaseUnityPlugin)this).Config.Bind<float>("Timing", "MaxIntervalSeconds", 90f, new ConfigDescription("Longest possible wait between tornado waves.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(5f, 300f), Array.Empty<object>()));
MinCount = ((BaseUnityPlugin)this).Config.Bind<int>("Amount", "MinTornadoes", 1, new ConfigDescription("Fewest tornadoes to spawn in a wave.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 20), Array.Empty<object>()));
MaxCount = ((BaseUnityPlugin)this).Config.Bind<int>("Amount", "MaxTornadoes", 3, new ConfigDescription("Most tornadoes to spawn in a wave.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 20), Array.Empty<object>()));
ToggleMenuKey = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("UI", "ToggleMenuKey", (KeyCode)283, "Key to open/close the in-game settings menu.");
TornadoesEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Effects", "Tornadoes", true, "Enable tornado spawns.");
DynamiteEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Effects", "Dynamite", true, "Enable Dynamite spawns.");
ZombiesEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Effects", "Zombies", true, "Enable zombie spawns (one per player).");
DynamiteMinCount = ((BaseUnityPlugin)this).Config.Bind<int>("Amount", "MinDynamite", 1, new ConfigDescription("Fewest dynamite to spawn in a wave.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 20), Array.Empty<object>()));
DynamiteMaxCount = ((BaseUnityPlugin)this).Config.Bind<int>("Amount", "MaxDynamite", 20, new ConfigDescription("Most dynamite to spawn in a wave.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 20), Array.Empty<object>()));
WindEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Effects", "Wind", true, "Enable Wind Spawning.");
BugsEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Effects", "Bugs", true, "Enable Bugs Spawning.");
EmotesEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Effects", "Emotes", true, "Enable forced emotes going off.");
HotSunEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Effects", "Sun", true, "Enable Hot Sun.");
FrogsEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Effects", "Frogs", true, "Enable Frogs.");
CannonsEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Effects", "Cannons", true, "Enable Cannons.");
BigGhostEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Effects", "BigGhosts", true, "Enable Big Friendly Ghosts.");
TumbleweedsEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Effects", "Tumbleweeds", true, "Enable an onslaught of tumbleweeds.");
BlizzardsEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Effects", "Blizzards", true, "Enable a harsh frigid wind.");
GravityBubblesEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Effects", "GravityBubbles", true, "Enable anti gravity bubbles.");
IceVisionEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Effects", "IceVision", true, "Enable ice vision on players.");
CondorsEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Effects", "Condors", true, "Enable condors that dive at players and carry them off.");
((BaseUnityPlugin)this).Config.SaveOnConfigSet = false;
_harmony = new Harmony("Thraac.TheBadOnes");
_harmony.PatchAll();
GameObject val = new GameObject("TheBadOnes");
val.AddComponent<EffectManager>();
val.AddComponent<TornadoConfigUI>();
val.AddComponent<NotificationsManager.NotificationRelay>();
Object.DontDestroyOnLoad((Object)(object)val);
Log.LogInfo((object)("Plugin " + Name + " is loaded!"));
}
}
public class TornadoConfigUI : MonoBehaviour
{
private bool _open;
private Rect _window = new Rect(150f, 40f, 640f, 550f);
private GUIStyle? _titleStyle;
private GUIStyle? _thumbStyle;
private GUIStyle? _sliderStyle;
private GUIStyle? _windowStyle;
private GUIStyle? _headerStyle;
private GUIStyle? _headerTitleStyle;
private Texture2D? _bgTex;
private Texture2D? _headerTex;
private Texture2D? _headerRoundTex;
private const float HeaderHeight = 36f;
private float timer;
private const float PushInterval = 0.5f;
public static bool IsOpen { get; private set; }
private void Update()
{
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
if (Input.GetKeyDown(Plugin.ToggleMenuKey.Value))
{
ToggleMenu();
}
timer += Time.deltaTime;
if (timer >= 0.5f)
{
HostSettings.PushIfChanged();
timer = 0f;
}
}
private void ToggleMenu()
{
_open = !_open;
IsOpen = _open;
if (!_open)
{
Plugin.Conf.Save();
}
}
private void OnGUI()
{
//IL_0044: Unknown result type (might be due to invalid IL or missing references)
//IL_0050: Unknown result type (might be due to invalid IL or missing references)
//IL_0065: Expected O, but got Unknown
//IL_0060: 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)
if (_open)
{
Cursor.visible = true;
Cursor.lockState = (CursorLockMode)0;
EnsureStyles();
GUI.skin.window.fontSize = 18;
GUI.skin.window.fontStyle = (FontStyle)1;
_window = GUI.Window(((Object)this).GetInstanceID(), _window, new WindowFunction(DrawWindow), "", _windowStyle);
}
}
private void EnsureStyles()
{
//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_0042: 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_0062: Unknown result type (might be due to invalid IL or missing references)
//IL_0067: Unknown result type (might be due to invalid IL or missing references)
//IL_0085: Unknown result type (might be due to invalid IL or missing references)
//IL_008f: Expected O, but got Unknown
//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
//IL_00d3: Expected O, but got Unknown
//IL_0110: Unknown result type (might be due to invalid IL or missing references)
//IL_0124: Unknown result type (might be due to invalid IL or missing references)
//IL_0138: Unknown result type (might be due to invalid IL or missing references)
//IL_014c: Unknown result type (might be due to invalid IL or missing references)
//IL_0161: Unknown result type (might be due to invalid IL or missing references)
//IL_0166: Unknown result type (might be due to invalid IL or missing references)
//IL_016e: 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_017c: 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_0191: Expected O, but got Unknown
//IL_0192: 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_01a8: 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: Expected O, but got Unknown
//IL_01c0: Expected O, but got Unknown
//IL_01cb: 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_01d8: 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_01e5: Unknown result type (might be due to invalid IL or missing references)
//IL_01f4: Expected O, but got Unknown
//IL_01ff: Unknown result type (might be due to invalid IL or missing references)
//IL_0204: Unknown result type (might be due to invalid IL or missing references)
//IL_0214: Expected O, but got Unknown
//IL_021f: 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_022f: Unknown result type (might be due to invalid IL or missing references)
//IL_023f: Expected O, but got Unknown
if (_titleStyle == null)
{
_bgTex = MakeRoundedTex(Color32.op_Implicit(new Color32((byte)143, (byte)141, (byte)133, byte.MaxValue)), 32, 10);
_headerTex = MakeTex(Color32.op_Implicit(new Color32((byte)89, (byte)88, (byte)83, byte.MaxValue)));
_headerRoundTex = MakeRoundedTex(Color32.op_Implicit(new Color32((byte)89, (byte)88, (byte)83, byte.MaxValue)), 32, 10);
_windowStyle = new GUIStyle(GUI.skin.window);
_windowStyle.normal.background = _bgTex;
_windowStyle.onNormal.background = _bgTex;
_windowStyle.border = new RectOffset(10, 10, 10, 10);
GUI.skin.label.fontSize = 15;
GUI.skin.toggle.fontSize = 15;
GUI.skin.button.fontSize = 15;
SetTextColor(GUI.skin.label, Color.white);
SetTextColor(GUI.skin.button, Color.white);
SetTextColor(GUI.skin.toggle, Color.white);
SetTextColor(GUI.skin.window, Color.white);
GUIStyle val = new GUIStyle(GUI.skin.label)
{
fontSize = 18,
fontStyle = (FontStyle)1,
alignment = (TextAnchor)4
};
val.normal.textColor = Color.white;
_headerTitleStyle = val;
GUIStyle val2 = new GUIStyle();
val2.normal.background = _headerRoundTex;
val2.border = new RectOffset(10, 10, 10, 10);
_headerStyle = val2;
GUIStyle val3 = new GUIStyle(GUI.skin.label)
{
fontSize = 14,
fontStyle = (FontStyle)1
};
val3.normal.textColor = Color.white;
_titleStyle = val3;
_sliderStyle = new GUIStyle(GUI.skin.horizontalSlider)
{
fixedHeight = 18f
};
_thumbStyle = new GUIStyle(GUI.skin.horizontalSliderThumb)
{
fixedHeight = 24f,
fixedWidth = 24f
};
}
}
private void DrawWindow(int id)
{
//IL_0048: Unknown result type (might be due to invalid IL or missing references)
//IL_0059: Unknown result type (might be due to invalid IL or missing references)
//IL_0065: 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_00ad: 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_0300: Unknown result type (might be due to invalid IL or missing references)
//IL_0305: Unknown result type (might be due to invalid IL or missing references)
//IL_0307: Unknown result type (might be due to invalid IL or missing references)
//IL_04bc: Unknown result type (might be due to invalid IL or missing references)
EnsureStyles();
Rect val = default(Rect);
((Rect)(ref val))..ctor(0f, 0f, ((Rect)(ref _window)).width, 36f);
Rect val2 = default(Rect);
((Rect)(ref val2))..ctor(0f, 18f, ((Rect)(ref _window)).width, 18f);
GUI.Box(val, GUIContent.none, _headerStyle);
GUI.DrawTexture(val2, (Texture)(object)_headerTex);
GUI.Label(val, "The Bad Ones: Controls", _headerTitleStyle);
GUI.backgroundColor = Color32.op_Implicit(new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue));
GUI.contentColor = Color32.op_Implicit(new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue));
GUILayout.Space(20f);
if (!HostSettings.IsHost)
{
GUILayout.Label("Only the host can change these settings", _titleStyle, Array.Empty<GUILayoutOption>());
}
GUI.enabled = HostSettings.IsHost;
GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
GUILayout.BeginVertical((GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(300f) });
GUILayout.Label("Wave Options:", Array.Empty<GUILayoutOption>());
float num = HostSettings.Get<float>(Plugin.MinInterval);
float num2 = HostSettings.Get<float>(Plugin.MaxInterval);
GUILayout.Label($"Wave interval: {Plugin.MinInterval.Value:0} - {Plugin.MaxInterval.Value:0} sec", _titleStyle, Array.Empty<GUILayoutOption>());
FloatSlider("Min secs", Plugin.MinInterval, 5f, Plugin.MaxInterval.Value);
FloatSlider("Max secs", Plugin.MaxInterval, Plugin.MinInterval.Value, 300f);
GUILayout.Space(12f);
int num3 = HostSettings.Get<int>(Plugin.MinCount);
int num4 = HostSettings.Get<int>(Plugin.MaxCount);
GUILayout.Label($"Tornadoes per wave: {Plugin.MinCount.Value} - {Plugin.MaxCount.Value}", _titleStyle, Array.Empty<GUILayoutOption>());
IntSlider("Min count", Plugin.MinCount, 1, Plugin.MaxCount.Value);
IntSlider("Max count", Plugin.MaxCount, Plugin.MinCount.Value, 20);
GUILayout.Space(12f);
int num5 = HostSettings.Get<int>(Plugin.DynamiteMinCount);
int num6 = HostSettings.Get<int>(Plugin.DynamiteMaxCount);
GUILayout.Label($"Dynamite per wave: {Plugin.DynamiteMinCount.Value} - {Plugin.DynamiteMaxCount.Value}", _titleStyle, Array.Empty<GUILayoutOption>());
IntSlider("Min count", Plugin.DynamiteMinCount, 1, Plugin.DynamiteMaxCount.Value);
IntSlider("Max count", Plugin.DynamiteMaxCount, Plugin.DynamiteMinCount.Value, 20);
GUILayout.EndVertical();
GUILayout.Space(24f);
Rect rect = GUILayoutUtility.GetRect(2f, 2f, (GUILayoutOption[])(object)new GUILayoutOption[2]
{
GUILayout.Width(2f),
GUILayout.ExpandHeight(true)
});
GUI.DrawTexture(rect, (Texture)(object)_headerTex);
GUILayout.Space(24f);
GUILayout.BeginVertical(Array.Empty<GUILayoutOption>());
GUILayout.Space(-0.5f);
GUILayout.Label("Spawning Options:", Array.Empty<GUILayoutOption>());
GUILayout.Label("Weather:", _titleStyle, Array.Empty<GUILayoutOption>());
BoolToggle(Plugin.BlizzardsEnabled, " Blizzards");
BoolToggle(Plugin.HotSunEnabled, " Hot Sun");
BoolToggle(Plugin.TornadoesEnabled, " Tornadoes");
BoolToggle(Plugin.WindEnabled, " Wind");
GUILayout.Space(12f);
GUILayout.Label("Spawns:", _titleStyle, Array.Empty<GUILayoutOption>());
BoolToggle(Plugin.BigGhostEnabled, " Big Ghosts");
BoolToggle(Plugin.BugsEnabled, " Bugs");
BoolToggle(Plugin.CondorsEnabled, " Condors");
BoolToggle(Plugin.FrogsEnabled, " Frogs");
BoolToggle(Plugin.ZombiesEnabled, " Zombies");
GUILayout.Space(12f);
GUILayout.Label("Misc:", _titleStyle, Array.Empty<GUILayoutOption>());
BoolToggle(Plugin.GravityBubblesEnabled, " Anti Gravity Bubbles");
BoolToggle(Plugin.CannonsEnabled, " Cannons");
BoolToggle(Plugin.DynamiteEnabled, " Dynamite");
BoolToggle(Plugin.EmotesEnabled, " Emotes");
BoolToggle(Plugin.IceVisionEnabled, " Ice Vision");
BoolToggle(Plugin.TumbleweedsEnabled, " Tumbleweeds");
GUILayout.Space(12f);
GUILayout.EndVertical();
GUILayout.Space(12f);
GUILayout.EndHorizontal();
GUI.enabled = true;
GUI.DragWindow(new Rect(0f, 0f, 10000f, 36f));
}
private void FloatSlider(string label, ConfigEntry<float> entry, float min, float max)
{
float num = HostSettings.Get<float>(entry);
GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
GUILayout.Label(label, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(70f) });
float value = Mathf.Round(GUILayout.HorizontalSlider(num, min, max, _sliderStyle, _thumbStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(24f) }));
GUILayout.Label(value.ToString("0"), (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(35f) });
GUILayout.EndHorizontal();
if (HostSettings.IsHost)
{
entry.Value = value;
}
}
private void IntSlider(string label, ConfigEntry<int> entry, int min, int max)
{
int num = HostSettings.Get<int>(entry);
GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
GUILayout.Label(label, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(70f) });
int value = Mathf.RoundToInt(GUILayout.HorizontalSlider((float)num, (float)min, (float)max, _sliderStyle, _thumbStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(24f) }));
GUILayout.Label(value.ToString("0"), (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(35f) });
GUILayout.EndHorizontal();
if (HostSettings.IsHost)
{
entry.Value = value;
}
}
private void BoolToggle(ConfigEntry<bool> entry, string label)
{
bool flag = HostSettings.Get<bool>(entry);
GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
bool value = GUILayout.Toggle(flag, label, Array.Empty<GUILayoutOption>());
GUILayout.EndHorizontal();
if (HostSettings.IsHost)
{
entry.Value = value;
}
}
private static void SetTextColor(GUIStyle s, Color c)
{
//IL_0018: 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_0020: 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_0022: 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_0029: 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_0030: 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_0050: Unknown result type (might be due to invalid IL or missing references)
//IL_0056: Unknown result type (might be due to invalid IL or missing references)
//IL_0057: Unknown result type (might be due to invalid IL or missing references)
//IL_0058: 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_005f: 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_0066: Unknown result type (might be due to invalid IL or missing references)
GUIStyleState normal = s.normal;
GUIStyleState hover = s.hover;
GUIStyleState active = s.active;
Color val = (s.focused.textColor = c);
Color val3 = (active.textColor = val);
Color textColor = (hover.textColor = val3);
normal.textColor = textColor;
GUIStyleState onNormal = s.onNormal;
GUIStyleState onHover = s.onHover;
GUIStyleState onActive = s.onActive;
val = (s.onFocused.textColor = c);
val3 = (onActive.textColor = val);
textColor = (onHover.textColor = val3);
onNormal.textColor = textColor;
}
private static Texture2D MakeTex(Color c)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Expected O, but got Unknown
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
Texture2D val = new Texture2D(1, 1);
val.SetPixel(0, 0, c);
val.Apply();
return val;
}
private static Texture2D MakeRoundedTex(Color col, int size, int radius)
{
//IL_0004: Unknown result type (might be due to invalid IL or missing references)
//IL_000a: Expected O, but got Unknown
//IL_0032: Unknown result type (might be due to invalid IL or missing references)
//IL_0033: Unknown result type (might be due to invalid IL or missing references)
//IL_006c: Unknown result type (might be due to invalid IL or missing references)
Texture2D val = new Texture2D(size, size, (TextureFormat)4, false);
((Texture)val).filterMode = (FilterMode)1;
for (int i = 0; i < size; i++)
{
for (int j = 0; j < size; j++)
{
int num = Mathf.Min(j, size - 1 - j);
int num2 = Mathf.Min(i, size - 1 - i);
Color val2 = col;
if (num < radius && num2 < radius)
{
float num3 = Mathf.Sqrt((float)((radius - num) * (radius - num) + (radius - num2) * (radius - num2)));
if (num3 > (float)radius)
{
val2.a = 0f;
}
}
val.SetPixel(j, i, val2);
}
}
val.Apply();
return val;
}
}
[HarmonyPatch(typeof(CharacterInput), "Sample")]
public static class Patch_CharacterInput_Sample
{
private static void Prefix(ref bool playerMovementActive)
{
if (TornadoConfigUI.IsOpen)
{
playerMovementActive = false;
}
}
}
}
namespace System.Diagnostics.CodeAnalysis
{
[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class ConstantExpectedAttribute : Attribute
{
public object? Min { get; set; }
public object? Max { get; set; }
}
[AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Module | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Interface | AttributeTargets.Delegate, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class ExperimentalAttribute : Attribute
{
public string DiagnosticId { get; }
public string? UrlFormat { get; set; }
public ExperimentalAttribute(string diagnosticId)
{
DiagnosticId = diagnosticId;
}
}
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
[ExcludeFromCodeCoverage]
internal sealed class MemberNotNullAttribute : Attribute
{
public string[] Members { get; }
public MemberNotNullAttribute(string member)
{
Members = new string[1] { member };
}
public MemberNotNullAttribute(params string[] members)
{
Members = members;
}
}
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
[ExcludeFromCodeCoverage]
internal sealed class MemberNotNullWhenAttribute : Attribute
{
public bool ReturnValue { get; }
public string[] Members { get; }
public MemberNotNullWhenAttribute(bool returnValue, string member)
{
ReturnValue = returnValue;
Members = new string[1] { member };
}
public MemberNotNullWhenAttribute(bool returnValue, params string[] members)
{
ReturnValue = returnValue;
Members = members;
}
}
[AttributeUsage(AttributeTargets.Constructor, AllowMultiple = false, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class SetsRequiredMembersAttribute : Attribute
{
}
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class StringSyntaxAttribute : Attribute
{
public const string CompositeFormat = "CompositeFormat";
public const string DateOnlyFormat = "DateOnlyFormat";
public const string DateTimeFormat = "DateTimeFormat";
public const string EnumFormat = "EnumFormat";
public const string GuidFormat = "GuidFormat";
public const string Json = "Json";
public const string NumericFormat = "NumericFormat";
public const string Regex = "Regex";
public const string TimeOnlyFormat = "TimeOnlyFormat";
public const string TimeSpanFormat = "TimeSpanFormat";
public const string Uri = "Uri";
public const string Xml = "Xml";
public string Syntax { get; }
public object?[] Arguments { get; }
public StringSyntaxAttribute(string syntax)
{
Syntax = syntax;
Arguments = new object[0];
}
public StringSyntaxAttribute(string syntax, params object?[] arguments)
{
Syntax = syntax;
Arguments = arguments;
}
}
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class UnscopedRefAttribute : Attribute
{
}
}
namespace System.Runtime.Versioning
{
[AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Module | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Interface | AttributeTargets.Delegate, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class RequiresPreviewFeaturesAttribute : Attribute
{
public string? Message { get; }
public string? Url { get; set; }
public RequiresPreviewFeaturesAttribute()
{
}
public RequiresPreviewFeaturesAttribute(string? message)
{
Message = message;
}
}
}
namespace System.Runtime.CompilerServices
{
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
internal sealed class IgnoresAccessChecksToAttribute : Attribute
{
public IgnoresAccessChecksToAttribute(string assemblyName)
{
}
}
[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class CallerArgumentExpressionAttribute : Attribute
{
public string ParameterName { get; }
public CallerArgumentExpressionAttribute(string parameterName)
{
ParameterName = parameterName;
}
}
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Interface, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class CollectionBuilderAttribute : Attribute
{
public Type BuilderType { get; }
public string MethodName { get; }
public CollectionBuilderAttribute(Type builderType, string methodName)
{
BuilderType = builderType;
MethodName = methodName;
}
}
[AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class CompilerFeatureRequiredAttribute : Attribute
{
public const string RefStructs = "RefStructs";
public const string RequiredMembers = "RequiredMembers";
public string FeatureName { get; }
public bool IsOptional { get; set; }
public CompilerFeatureRequiredAttribute(string featureName)
{
FeatureName = featureName;
}
}
[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class InterpolatedStringHandlerArgumentAttribute : Attribute
{
public string[] Arguments { get; }
public InterpolatedStringHandlerArgumentAttribute(string argument)
{
Arguments = new string[1] { argument };
}
public InterpolatedStringHandlerArgumentAttribute(params string[] arguments)
{
Arguments = arguments;
}
}
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, AllowMultiple = false, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class InterpolatedStringHandlerAttribute : Attribute
{
}
[EditorBrowsable(EditorBrowsableState.Never)]
[ExcludeFromCodeCoverage]
internal static class IsExternalInit
{
}
[AttributeUsage(AttributeTargets.Method, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class ModuleInitializerAttribute : Attribute
{
}
[AttributeUsage(AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property, AllowMultiple = false, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class OverloadResolutionPriorityAttribute : Attribute
{
public int Priority { get; }
public OverloadResolutionPriorityAttribute(int priority)
{
Priority = priority;
}
}
[AttributeUsage(AttributeTargets.Parameter, Inherited = true, AllowMultiple = false)]
[ExcludeFromCodeCoverage]
internal sealed class ParamCollectionAttribute : Attribute
{
}
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class RequiredMemberAttribute : Attribute
{
}
[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
[EditorBrowsable(EditorBrowsableState.Never)]
[ExcludeFromCodeCoverage]
internal sealed class RequiresLocationAttribute : Attribute
{
}
[AttributeUsage(AttributeTargets.Module | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Event | AttributeTargets.Interface, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class SkipLocalsInitAttribute : Attribute
{
}
}