Decompiled source of DroneColor v1.0.0

DroneColor/DroneColor.dll

Decompiled 2 months ago
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyCompany("GuttertankColorMod")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("GuttertankColorMod")]
[assembly: AssemblyTitle("GuttertankColorMod")]
[assembly: AssemblyVersion("1.0.0.0")]
[BepInPlugin("com.antek.dronecolors.ultimate", "Drone Rainbow Madness Mod", "3.0.0")]
public class DroneRainbowMadnessMod : BaseUnityPlugin
{
	private static readonly List<Color> possibleColors = new List<Color>
	{
		Color.white,
		Color.red,
		Color.green,
		Color.blue,
		Color.yellow,
		Color.cyan,
		Color.magenta,
		Color.gray,
		Color.black,
		new Color(1f, 0.5f, 0f),
		new Color(0.2f, 0.8f, 0.6f),
		new Color(1f, 0.2f, 0.6f),
		new Color(0.3f, 0.9f, 0.5f),
		new Color(0.6f, 0.3f, 0.9f),
		new Color(0.9f, 0.9f, 0.3f),
		new Color(0.4f, 0.7f, 0.9f),
		new Color(0.9f, 0.6f, 0.7f),
		new Color(0.9f, 0.8f, 0.2f),
		new Color(0.2f, 0.2f, 0.9f),
		new Color(0.6f, 0.9f, 0.7f),
		new Color(0.8f, 0.1f, 0.2f),
		new Color(0.1f, 0.8f, 0.3f),
		new Color(0.2f, 0.7f, 0.9f),
		new Color(0.8f, 0.4f, 0.6f),
		new Color(0.4f, 0.9f, 0.4f),
		new Color(0.9f, 0.3f, 0.5f),
		new Color(0.5f, 0.3f, 0.9f),
		new Color(0.3f, 0.9f, 0.8f),
		new Color(0.9f, 0.5f, 0.2f),
		new Color(0.7f, 0.2f, 0.9f),
		new Color(0.1f, 0.9f, 0.6f),
		new Color(0.5f, 0.9f, 0.1f),
		new Color(0.8f, 0.6f, 0.1f),
		new Color(0.1f, 0.6f, 0.9f),
		new Color(0.6f, 0.1f, 0.9f),
		new Color(0.9f, 0.1f, 0.8f),
		new Color(0.9f, 0.4f, 0.1f),
		new Color(0.3f, 0.6f, 0.9f),
		new Color(0.2f, 0.8f, 0.2f),
		new Color(0.9f, 0.7f, 0.5f),
		new Color(0.5f, 0.9f, 0.9f),
		new Color(0.8f, 0.5f, 0.7f),
		new Color(0.7f, 0.9f, 0.3f),
		new Color(0.9f, 0.2f, 0.2f),
		new Color(0.2f, 0.9f, 0.9f),
		new Color(0.9f, 0.5f, 0.5f),
		new Color(0.5f, 0.5f, 0.9f),
		new Color(0.2f, 0.2f, 0.8f),
		new Color(0.8f, 0.8f, 0.2f),
		new Color(0.9f, 0.7f, 0.3f),
		new Color(0.4f, 0.8f, 0.2f),
		new Color(0.6f, 0.8f, 0.3f),
		new Color(0.3f, 0.8f, 0.4f),
		new Color(0.8f, 0.3f, 0.5f),
		new Color(0.9f, 0.4f, 0.4f),
		new Color(0.7f, 0.5f, 0.8f),
		new Color(0.2f, 0.5f, 0.9f),
		new Color(0.3f, 0.9f, 0.2f),
		new Color(0.6f, 0.9f, 0.4f),
		new Color(0.8f, 0.9f, 0.4f),
		new Color(0.9f, 0.8f, 0.6f),
		new Color(0.8f, 0.6f, 0.9f),
		new Color(0.4f, 0.9f, 0.6f),
		new Color(0.9f, 0.6f, 0.9f),
		new Color(0.6f, 0.3f, 0.2f),
		new Color(0.8f, 0.4f, 0.8f),
		new Color(0.4f, 0.6f, 0.9f),
		new Color(0.3f, 0.7f, 0.9f),
		new Color(0.9f, 0.3f, 0.9f),
		new Color(0.9f, 0.9f, 0.9f),
		new Color(0.1f, 0.3f, 0.9f),
		new Color(0.9f, 0.1f, 0.4f),
		new Color(0.3f, 0.1f, 0.9f),
		new Color(0.4f, 0.9f, 0.1f),
		new Color(0.9f, 0.4f, 0.7f),
		new Color(0.7f, 0.9f, 0.5f),
		new Color(0.2f, 0.9f, 0.7f),
		new Color(0.5f, 0.7f, 0.9f),
		new Color(0.7f, 0.4f, 0.9f),
		new Color(0.9f, 0.2f, 0.5f),
		new Color(0.9f, 0.5f, 0.9f),
		new Color(0.2f, 0.9f, 0.4f),
		new Color(0.5f, 0.9f, 0.2f),
		new Color(0.8f, 0.2f, 0.9f),
		new Color(0.9f, 0.8f, 0.1f),
		new Color(0.1f, 0.9f, 0.8f),
		new Color(0.9f, 0.1f, 0.9f),
		new Color(0.3f, 0.9f, 0.5f),
		new Color(0.9f, 0.3f, 0.4f),
		new Color(0.9f, 0.5f, 0.3f),
		new Color(0.6f, 0.9f, 0.8f),
		new Color(0.9f, 0.6f, 0.5f),
		new Color(0.7f, 0.9f, 0.7f),
		new Color(0.4f, 0.9f, 0.8f),
		new Color(0.8f, 0.9f, 0.8f),
		new Color(0.9f, 0.8f, 0.9f)
	};

	private readonly HashSet<GameObject> coloredEnemies = new HashSet<GameObject>();

	private void Start()
	{
		((BaseUnityPlugin)this).Logger.LogInfo((object)"Drone Rainbow Madness Mod 3.0.0 załadowany!");
	}

	private void Update()
	{
		//IL_0086: Unknown result type (might be due to invalid IL or missing references)
		//IL_008b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0094: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
		GameObject[] array = Object.FindObjectsOfType<GameObject>();
		foreach (GameObject val in array)
		{
			if (((Object)val).name.ToLower().Contains("drone") && !coloredEnemies.Contains(val))
			{
				Renderer componentInChildren = val.GetComponentInChildren<Renderer>();
				if ((Object)(object)componentInChildren != (Object)null && (Object)(object)componentInChildren.material != (Object)null)
				{
					Color val2 = possibleColors[Random.Range(0, possibleColors.Count)];
					componentInChildren.material.color = val2;
					coloredEnemies.Add(val);
					((BaseUnityPlugin)this).Logger.LogInfo((object)$"Drone {((Object)val).name} kolor: R={val2.r:F2} G={val2.g:F2} B={val2.b:F2}");
				}
			}
		}
	}
}