using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace PlanetaryShieldGenerator;
[BepInPlugin("lltcggie.DSP.plugin.PlanetwidePlanetaryShieldGenerator", "PlanetwidePlanetaryShieldGenerator", "1.1.0")]
public class Main : BaseUnityPlugin
{
public const string GUID = "lltcggie.DSP.plugin.PlanetwidePlanetaryShieldGenerator";
public const string NAME = "PlanetwidePlanetaryShieldGenerator";
public const string VERSION = "1.1.0";
private Harmony harmony;
public void Awake()
{
LogManager.Logger = ((BaseUnityPlugin)this).Logger;
harmony = Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), "lltcggie.DSP.plugin.PlanetwidePlanetaryShieldGenerator");
}
}
public class LogManager
{
public static ManualLogSource Logger;
}
[HarmonyPatch]
internal class PlanetaryShieldGeneratorPatches
{
[HarmonyPostfix]
[HarmonyPatch(typeof(PlanetATField), "UpdateGeneratorMatrix")]
public static void PlanetATField_UpdateGeneratorMatrix_Postfix(PlanetATField __instance)
{
//IL_008e: 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_00a4: Unknown result type (might be due to invalid IL or missing references)
//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
//IL_0101: Unknown result type (might be due to invalid IL or missing references)
//IL_0112: Unknown result type (might be due to invalid IL or missing references)
//IL_0117: Unknown result type (might be due to invalid IL or missing references)
//IL_0129: Unknown result type (might be due to invalid IL or missing references)
//IL_012e: Unknown result type (might be due to invalid IL or missing references)
//IL_013e: Unknown result type (might be due to invalid IL or missing references)
//IL_0143: Unknown result type (might be due to invalid IL or missing references)
//IL_0155: 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)
//IL_016c: Unknown result type (might be due to invalid IL or missing references)
//IL_0171: Unknown result type (might be due to invalid IL or missing references)
//IL_0184: 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_0198: Unknown result type (might be due to invalid IL or missing references)
//IL_019d: Unknown result type (might be due to invalid IL or missing references)
//IL_01ad: Unknown result type (might be due to invalid IL or missing references)
//IL_01b2: Unknown result type (might be due to invalid IL or missing references)
//IL_01c2: Unknown result type (might be due to invalid IL or missing references)
//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
//IL_01d8: Unknown result type (might be due to invalid IL or missing references)
//IL_01dd: Unknown result type (might be due to invalid IL or missing references)
//IL_01ed: Unknown result type (might be due to invalid IL or missing references)
//IL_01f2: Unknown result type (might be due to invalid IL or missing references)
//IL_0203: Unknown result type (might be due to invalid IL or missing references)
//IL_0208: Unknown result type (might be due to invalid IL or missing references)
//IL_0219: Unknown result type (might be due to invalid IL or missing references)
//IL_021e: 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_0234: Unknown result type (might be due to invalid IL or missing references)
int generatorCount = __instance.generatorCount;
if (generatorCount > 0)
{
float num = 0f;
for (int i = 0; i < generatorCount; i++)
{
num = Math.Max(__instance.generatorMatrix[i].w, num);
}
__instance.generatorCount = 20;
Vector4[] generatorMatrix = __instance.generatorMatrix;
Array.Clear(__instance.generatorMatrix, 0, __instance.generatorMatrix.Length);
float realRadius = __instance.planet.realRadius;
float num2 = 0.934172f * realRadius;
float num3 = 0.356822f * realRadius;
float num4 = 0.57735f * realRadius;
generatorMatrix[0] = new Vector4(num2, num3, 0f, num);
generatorMatrix[1] = new Vector4(num2, 0f - num3, 0f, num);
generatorMatrix[2] = new Vector4(0f - num2, num3, 0f, num);
generatorMatrix[3] = new Vector4(0f - num2, 0f - num3, 0f, num);
generatorMatrix[4] = new Vector4(0f, num2, num3, num);
generatorMatrix[5] = new Vector4(0f, num2, 0f - num3, num);
generatorMatrix[6] = new Vector4(0f, 0f - num2, num3, num);
generatorMatrix[7] = new Vector4(0f, 0f - num2, 0f - num3, num);
generatorMatrix[8] = new Vector4(num3, 0f, num2, num);
generatorMatrix[9] = new Vector4(num3, 0f, 0f - num2, num);
generatorMatrix[10] = new Vector4(0f - num3, 0f, num2, num);
generatorMatrix[11] = new Vector4(0f - num3, 0f, 0f - num2, num);
generatorMatrix[12] = new Vector4(num4, num4, num4, num);
generatorMatrix[13] = new Vector4(num4, num4, 0f - num4, num);
generatorMatrix[14] = new Vector4(num4, 0f - num4, num4, num);
generatorMatrix[15] = new Vector4(num4, 0f - num4, 0f - num4, num);
generatorMatrix[16] = new Vector4(0f - num4, num4, num4, num);
generatorMatrix[17] = new Vector4(0f - num4, num4, 0f - num4, num);
generatorMatrix[18] = new Vector4(0f - num4, 0f - num4, num4, num);
generatorMatrix[19] = new Vector4(0f - num4, 0f - num4, 0f - num4, num);
}
}
}