using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using PluginConfig.API;
using PluginConfig.API.Decorators;
using PluginConfig.API.Fields;
using Sandbox;
using TMPro;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.UI;
using forcerad;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("forcerad")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+3e7f4c5fcccbba9a7ddd182b59e8bc43dc7d1567")]
[assembly: AssemblyProduct("forcerad")]
[assembly: AssemblyTitle("forcerad")]
[assembly: AssemblyVersion("1.0.0.0")]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[Embedded]
[AttributeUsage(AttributeTargets.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;
}
}
}
public class ForceRadiance
{
public class Radiance
{
public float speed;
public float health;
public float damage;
public Radiance(float speedRad, float healthRad, float damageRad)
{
speed = speedRad;
health = healthRad;
damage = damageRad;
}
}
[HarmonyPatch(typeof(SceneHelper))]
[HarmonyPatch("OnSceneLoaded")]
private class ClearDicts
{
private static void Prefix()
{
extraRadiance = new Dictionary<EnemyIdentifier, Radiance>();
extraIdolRadiance = new Dictionary<EnemyIdentifier, Radiance>();
startingRadiance = new Dictionary<EnemyIdentifier, Radiance>();
currentRadiance = new Dictionary<EnemyIdentifier, float>();
newRadiance = new Dictionary<EnemyIdentifier, float>();
}
}
[HarmonyPatch(typeof(DifficultyTitle))]
[HarmonyPatch("Check")]
public class AddNumber
{
private static void Postfix(TMP_Text ___txt2)
{
if (!(ConfigManager.ExtraRadiance.value > 0f))
{
return;
}
if (___txt2.text.Contains("--"))
{
string[] array = ___txt2.text.Split("--");
string text = "";
for (int i = 0; i < array.Length; i++)
{
text += array[i];
}
___txt2.text = "--" + text + "+" + ConfigManager.ExtraRadiance.value + " --";
}
else
{
___txt2.text = ___txt2.text + " +" + ConfigManager.ExtraRadiance.value;
}
}
}
[HarmonyPatch(typeof(PresenceController))]
[HarmonyPatch("Start")]
private class AddNumber2
{
private static void Prefix(PresenceController __instance)
{
if (ConfigManager.ExtraRadiance.value > 0f)
{
for (int num = __instance.diffNames.ToList().Count - 1; num >= 0; num--)
{
ref string reference = ref __instance.diffNames[num];
reference = reference + " +" + ConfigManager.ExtraRadiance.value;
}
}
}
}
[HarmonyPatch(typeof(ChapterSelectButton))]
[HarmonyPatch("CheckScore")]
private class BetterPRanks
{
public static void Postfix(ChapterSelectButton __instance, Image ___rankButton)
{
}
}
[HarmonyPatch(typeof(EnemyIdentifier))]
[HarmonyPatch("Start")]
private class Start
{
private static void Postfix(EnemyIdentifier __instance)
{
if (!__instance.dead)
{
__instance.UpdateBuffs(false, true);
}
}
}
[HarmonyPatch(typeof(EnemyIdentifier))]
[HarmonyPatch("UpdateBuffs")]
private class UpdateBuffs
{
private static void Prefix(EnemyIdentifier __instance, bool ___puppet, float ___puppetSpawnTimer)
{
//IL_0633: Unknown result type (might be due to invalid IL or missing references)
//IL_063a: Invalid comparison between Unknown and I4
//IL_065f: Unknown result type (might be due to invalid IL or missing references)
//IL_0666: Invalid comparison between Unknown and I4
//IL_01ba: Unknown result type (might be due to invalid IL or missing references)
//IL_01c1: Invalid comparison between Unknown and I4
//IL_05c0: Unknown result type (might be due to invalid IL or missing references)
if (!___puppet || !extraRadiance.ContainsKey(__instance))
{
float speedRad = ConfigManager.ExtraRadiance.value + ConfigManager.ExtraSpeed.value;
float healthRad = ConfigManager.ExtraRadiance.value + ConfigManager.ExtraHealth.value;
float damageRad = ConfigManager.ExtraRadiance.value + ConfigManager.ExtraDamage.value;
bool flag = __instance.speedBuff || __instance.speedBuffRequests > 0;
bool flag2 = __instance.healthBuff || __instance.healthBuffRequests > 0;
bool flag3 = __instance.damageBuff || __instance.damageBuffRequests > 0;
if (!extraRadiance.ContainsKey(__instance))
{
Radiance value = new Radiance(speedRad, healthRad, damageRad);
extraRadiance.Add(__instance, value);
}
if ((flag || flag2 || flag3) && __instance.radianceTier == 0f)
{
__instance.radianceTier = 1f;
}
if (__instance.radianceTier > 0f)
{
Radiance value2 = new Radiance(0f, 0f, 0f);
startingRadiance[__instance] = value2;
if (flag)
{
startingRadiance[__instance].speed = __instance.radianceTier;
}
if (flag2)
{
startingRadiance[__instance].health = __instance.radianceTier;
}
if (flag3)
{
startingRadiance[__instance].damage = __instance.radianceTier;
}
}
__instance.totalSpeedModifier = 1f;
__instance.totalHealthModifier = 1f;
__instance.totalDamageModifier = 1f;
if ((int)__instance.enemyType == 38 && ConfigManager.NerfProvs.value)
{
__instance.speedBuffModifier = ConfigManager.ProvSpeed.value;
__instance.healthBuffModifier = ConfigManager.ProvHealth.value;
}
float num = extraRadiance[__instance].speed;
float num2 = extraRadiance[__instance].health;
float num3 = extraRadiance[__instance].damage;
if (startingRadiance.ContainsKey(__instance))
{
num = (ConfigManager.AdditiveRadiance.value ? (num + startingRadiance[__instance].speed) : Mathf.Max(num, startingRadiance[__instance].speed));
num2 = (ConfigManager.AdditiveRadiance.value ? (num2 + startingRadiance[__instance].health) : Mathf.Max(num2, startingRadiance[__instance].health));
num3 = (ConfigManager.AdditiveRadiance.value ? (num3 + startingRadiance[__instance].damage) : Mathf.Max(num3, startingRadiance[__instance].damage));
}
if (extraIdolRadiance.ContainsKey(__instance) && ConfigManager.AdditiveIdols.value)
{
num += (ConfigManager.CapBonuses.value ? Mathf.Min(ConfigManager.MaxSpeedBonus.value, extraIdolRadiance[__instance].speed) : extraIdolRadiance[__instance].speed);
num2 += (ConfigManager.CapBonuses.value ? Mathf.Min(ConfigManager.MaxHealthBonus.value, extraIdolRadiance[__instance].health) : extraIdolRadiance[__instance].health);
num3 += (ConfigManager.CapBonuses.value ? Mathf.Min(ConfigManager.MaxDamageBonus.value, extraIdolRadiance[__instance].damage) : extraIdolRadiance[__instance].damage);
}
__instance.totalSpeedModifier *= ((num > 1f) ? (__instance.speedBuffModifier * (0.75f + num / 4f)) : (1f + num * (__instance.speedBuffModifier - 1f)));
__instance.totalHealthModifier *= ((num2 > 1f) ? (__instance.healthBuffModifier * (0.75f + num2 / 4f)) : (1f + num2 * (__instance.healthBuffModifier - 1f)));
float num4 = (__instance.damageBuffModifier - 1f) * (ConfigManager.MaxDamageMultiplier.value - 1f) * 2f;
if (ConfigManager.ScalingDamage.value)
{
__instance.totalDamageModifier *= Mathf.Lerp(1f, 1f + num4, num3 / ConfigManager.MaxDamageTier.value);
}
else if (num3 > 0f)
{
__instance.totalDamageModifier *= __instance.damageBuffModifier;
}
ConfigManager.TierBehaviorOptions value3 = ConfigManager.TierBehavior.value;
if (1 == 0)
{
}
float num5 = value3 switch
{
ConfigManager.TierBehaviorOptions.Speed => num,
ConfigManager.TierBehaviorOptions.Health => num2,
ConfigManager.TierBehaviorOptions.Damage => num3,
ConfigManager.TierBehaviorOptions.Highest => Mathf.Max(new float[3] { num, num2, num3 }),
ConfigManager.TierBehaviorOptions.Average => (num + num2 + num3) / 3f,
ConfigManager.TierBehaviorOptions.AverageTwo => (num + num2 + num3 - Mathf.Min(new float[3] { num, num2, num3 })) / 2f,
_ => Mathf.Max(new float[3] { num, num2, num3 }),
};
if (1 == 0)
{
}
float value4 = num5;
Console.WriteLine($"{__instance.enemyType} updated buffs: {num}, {num2}, {num3}");
if (!newRadiance.ContainsKey(__instance))
{
newRadiance.Add(__instance, value4);
}
else
{
newRadiance[__instance] = value4;
}
}
if (!___puppet || !(___puppetSpawnTimer < 1f) || (int)__instance.enemyType == 21)
{
return;
}
if (___puppetSpawnTimer == 0f)
{
if ((int)__instance.enemyType == 38 && ConfigManager.NerfProvs.value)
{
__instance.speedBuffModifier = ConfigManager.ProvSpeed.value;
__instance.healthBuffModifier = ConfigManager.ProvHealth.value;
}
__instance.totalHealthModifier = 1f;
__instance.totalDamageModifier = 1f;
float num6 = extraRadiance[__instance].health;
float num7 = extraRadiance[__instance].damage;
if (startingRadiance.ContainsKey(__instance))
{
num6 = (ConfigManager.AdditiveRadiance.value ? (num6 + startingRadiance[__instance].health) : Mathf.Max(num6, startingRadiance[__instance].health));
num7 = (ConfigManager.AdditiveRadiance.value ? (num7 + startingRadiance[__instance].damage) : Mathf.Max(num7, startingRadiance[__instance].damage));
}
__instance.totalHealthModifier *= ((num6 > 1f) ? (__instance.healthBuffModifier * (0.75f + num6 / 4f)) : (1f + num6 * (__instance.healthBuffModifier - 1f)));
__instance.totalHealthModifier /= 2f;
float num8 = (__instance.damageBuffModifier - 1f) * (ConfigManager.MaxDamageMultiplier.value - 1f) * 2f;
if (ConfigManager.ScalingDamage.value)
{
__instance.totalDamageModifier *= Mathf.Lerp(1f, 1f + num8, num7 / ConfigManager.MaxDamageTier.value);
}
else if (num7 > 0f)
{
__instance.totalDamageModifier *= __instance.damageBuffModifier;
}
}
__instance.totalSpeedModifier = 1f;
float num9 = extraRadiance[__instance].speed;
if (startingRadiance.ContainsKey(__instance))
{
num9 = (ConfigManager.AdditiveRadiance.value ? (num9 + startingRadiance[__instance].speed) : Mathf.Max(num9, startingRadiance[__instance].speed));
}
__instance.totalSpeedModifier *= ((num9 > 1f) ? (__instance.speedBuffModifier * (0.75f + num9 / 4f)) : (1f + num9 * (__instance.speedBuffModifier - 1f)));
__instance.totalSpeedModifier *= Mathf.Lerp(0.01f, Mathf.Max(0.01f, ___puppetSpawnTimer - 0.75f) * 3f, ___puppetSpawnTimer);
}
}
[HarmonyPatch(typeof(EnemySimplifier))]
[HarmonyPatch("SetOutline")]
private class SetOutline
{
private static bool Prefix(ref EnemySimplifier __instance, ref bool forceUpdate, ref bool ___playerDistCheck, ref GameObject ___player, ref OptionsManager ___oman, ref bool ___hasSimplifiedMaterial, ref MaterialState ___currentState, ref bool ___hasEnragedSimplified, ref MaterialState ___lastState, ref bool ___lastSandified, ref bool ___lastBlessed, ref Dictionary<MaterialState, Material> ___materialDict, ref Renderer ___meshrenderer, ref int ___shouldBeOutlined, ref int ___lastOutlineState, ref MaterialPropertyBlock ___propBlock, int ___HasSandBuff, int ___NewSanded, int ___Blessed, int ___Outline, int ___ForceOutline)
{
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
//IL_0015: Unknown result type (might be due to invalid IL or missing references)
//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
//IL_00de: Invalid comparison between Unknown and I4
___playerDistCheck = Vector3.Distance(__instance.enemyRootTransform.position, ___player.transform.position) > ___oman.simplifiedDistance;
if (!__instance.enemyScriptHandlesEnrage)
{
if ((___oman.simplifyEnemies & ___hasSimplifiedMaterial & ___playerDistCheck) && !___oman.outlinesOnly)
{
___currentState = (MaterialState)((!__instance.enraged || !___hasEnragedSimplified) ? 1 : 3);
}
else
{
___currentState = (MaterialState)(__instance.enraged ? 2 : 0);
}
}
bool flag = (int)___currentState != (int)___lastState;
bool flag2 = false;
bool flag3 = false;
if (Object.op_Implicit((Object)(object)__instance.eid) && !__instance.eid.dead)
{
flag3 = __instance.eid.blessed;
if ((int)__instance.eid.enemyType != 12 && __instance.eid.sandified)
{
flag2 = true;
}
}
if (flag2 != ___lastSandified || flag3 != ___lastBlessed)
{
flag = true;
}
___lastSandified = flag2;
___lastBlessed = flag3;
if (forceUpdate)
{
flag = true;
}
if (flag && !__instance.enemyScriptHandlesEnrage)
{
__instance.matList[0] = ___materialDict[___currentState];
if ((Object)(object)__instance.simplifiedMaterial2 != (Object)null)
{
__instance.matList[1] = (((int)___currentState == 0) ? __instance.originalMaterial2 : __instance.simplifiedMaterial2);
}
if ((Object)(object)__instance.simplifiedMaterial3 != (Object)null)
{
__instance.matList[2] = (((int)___currentState == 0) ? __instance.originalMaterial3 : __instance.simplifiedMaterial3);
}
___meshrenderer.materials = __instance.matList;
}
___shouldBeOutlined = ((___oman.simplifyEnemies & ___playerDistCheck) ? 1 : 0);
bool flag4 = ___shouldBeOutlined != ___lastOutlineState;
if (forceUpdate)
{
Material[] matList = __instance.matList;
Material[] array = matList;
foreach (Material val in array)
{
val.SetFloat("_BlendOp1", 0f);
val.SetFloat("_SrcBlend1", 1f);
val.SetFloat("_DstBlend1", 0f);
val.SetFloat("_ForceOutlineBehind", 0f);
}
}
if (flag4 || flag)
{
___meshrenderer.GetPropertyBlock(___propBlock);
___propBlock.SetFloat(___HasSandBuff, (float)(flag2 ? 1 : 0));
___propBlock.SetFloat(___NewSanded, (float)(flag2 ? 1 : 0));
___propBlock.SetFloat(___Blessed, (float)(flag3 ? 1 : 0));
___propBlock.SetFloat(___Outline, (float)___shouldBeOutlined);
___propBlock.SetFloat(___ForceOutline, 0.5f);
___meshrenderer.SetPropertyBlock(___propBlock);
}
___lastState = ___currentState;
___lastOutlineState = ___shouldBeOutlined;
if (Object.op_Implicit((Object)(object)__instance.eid))
{
if (!newRadiance.ContainsKey(__instance.eid))
{
newRadiance.Add(__instance.eid, 0f);
}
if (!currentRadiance.ContainsKey(__instance.eid))
{
currentRadiance.Add(__instance.eid, 0f);
}
if (currentRadiance[__instance.eid] != newRadiance[__instance.eid])
{
if ((Object)(object)__instance.radianceEffect != (Object)null)
{
currentRadiance[__instance.eid] = 0f;
}
else
{
currentRadiance[__instance.eid] = newRadiance[__instance.eid];
}
DoubleRender radianceEffect = __instance.radianceEffect;
if (radianceEffect != null)
{
radianceEffect.RemoveEffect();
}
}
if ((Object)(object)__instance.radianceEffect == (Object)null && currentRadiance[__instance.eid] - ConfigManager.Baseline.value > 0f)
{
__instance.radianceEffect = ((Component)___meshrenderer).gameObject.AddComponent<DoubleRender>();
__instance.radianceEffect.subMeshesToIgnore = __instance.radiantSubmeshesToIgnore;
if (ConfigManager.CustomColors.value)
{
__instance.radianceEffect.SetOutline(Mathf.FloorToInt(-100f * newRadiance[__instance.eid]));
}
}
else
{
DoubleRender radianceEffect2 = __instance.radianceEffect;
if (radianceEffect2 != null)
{
radianceEffect2.SetOutline((___oman.simplifyEnemies & ___playerDistCheck) ? 1 : 0);
}
}
}
return false;
}
}
[HarmonyPatch(typeof(DoubleRender))]
[HarmonyPatch("SetOutline")]
private class DoubleRenderSetOutline
{
private static bool Prefix(DoubleRender __instance, int showOultine, ref CameraController ___cc, ref Camera ___currentCam, ref CommandBuffer ___cb)
{
//IL_0059: Unknown result type (might be due to invalid IL or missing references)
//IL_005f: Expected O, but got Unknown
//IL_006a: Unknown result type (might be due to invalid IL or missing references)
//IL_0070: Expected O, but got Unknown
//IL_035f: Unknown result type (might be due to invalid IL or missing references)
//IL_0364: Unknown result type (might be due to invalid IL or missing references)
//IL_0371: Expected O, but got Unknown
//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
//IL_00b5: Expected O, but got Unknown
//IL_017c: Unknown result type (might be due to invalid IL or missing references)
//IL_0181: Unknown result type (might be due to invalid IL or missing references)
//IL_0191: Unknown result type (might be due to invalid IL or missing references)
//IL_0196: Unknown result type (might be due to invalid IL or missing references)
//IL_01aa: Unknown result type (might be due to invalid IL or missing references)
//IL_01af: Unknown result type (might be due to invalid IL or missing references)
//IL_01c3: Unknown result type (might be due to invalid IL or missing references)
//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
//IL_02a7: Unknown result type (might be due to invalid IL or missing references)
//IL_02a9: Unknown result type (might be due to invalid IL or missing references)
//IL_02ad: Unknown result type (might be due to invalid IL or missing references)
//IL_02b2: Unknown result type (might be due to invalid IL or missing references)
//IL_029e: Unknown result type (might be due to invalid IL or missing references)
//IL_02a3: Unknown result type (might be due to invalid IL or missing references)
//IL_02de: Unknown result type (might be due to invalid IL or missing references)
//IL_02e0: Unknown result type (might be due to invalid IL or missing references)
//IL_02e4: Unknown result type (might be due to invalid IL or missing references)
//IL_02e9: Unknown result type (might be due to invalid IL or missing references)
//IL_02d5: Unknown result type (might be due to invalid IL or missing references)
//IL_02da: Unknown result type (might be due to invalid IL or missing references)
//IL_02ef: Unknown result type (might be due to invalid IL or missing references)
//IL_02f1: Unknown result type (might be due to invalid IL or missing references)
//IL_02f5: Unknown result type (might be due to invalid IL or missing references)
//IL_02fa: Unknown result type (might be due to invalid IL or missing references)
if (!ConfigManager.CustomColors.value)
{
return true;
}
if (showOultine >= 0)
{
return true;
}
showOultine *= -1;
showOultine -= Mathf.FloorToInt(100f * ConfigManager.Baseline.value);
Material val = new Material(MonoSingleton<PostProcessV2_Handler>.Instance.radiantBuff);
Texture2D val2 = (Texture2D)val.GetTexture("_BuffTex");
Assembly executingAssembly = Assembly.GetExecutingAssembly();
using Stream stream = executingAssembly.GetManifestResourceStream("forcerad.radiant.png");
if (stream != null)
{
byte[] array = new byte[stream.Length];
stream.Read(array, 0, array.Length);
Texture2D val3 = new Texture2D(2, 2);
if (ImageConversion.LoadImage(val3, array) && showOultine > 0)
{
int num = Mathf.FloorToInt((float)showOultine / 100f);
float num2 = (float)(showOultine % 100) / 100f;
if (num == 0)
{
num2 = (float)(showOultine % 50) / 50f;
num = Mathf.FloorToInt((float)showOultine / 50f) - 1;
}
int num3;
if (ConfigManager.SixPlus.value == ConfigManager.SixPlusOptions.Rainbow)
{
num3 = num + 1;
}
else if (ConfigManager.SixPlus.value == ConfigManager.SixPlusOptions.Loop)
{
num3 = (num + 1) % 6;
num %= 6;
}
else
{
num3 = Mathf.Min(5, num + 1);
}
num = Mathf.Min(5, num);
Color value = ConfigManager.Color1[num3 % 6].value;
Color value2 = ConfigManager.Color2[num3 % 6].value;
Color value3 = ConfigManager.Color1[Mathf.Max(0, num)].value;
Color value4 = ConfigManager.Color2[Mathf.Max(0, num)].value;
if (num < 0)
{
((Color)(ref value3))..ctor(0f, 0f, 0f, 0f);
((Color)(ref value4))..ctor(0f, 0f, 0f, 0f);
}
Color[] pixels = val3.GetPixels(0, 0, ((Texture)val3).width, ((Texture)val3).height, 0);
Color[] pixels2 = val2.GetPixels(0, 0, ((Texture)val3).width, ((Texture)val3).height, 0);
for (int i = 0; i < pixels.Length; i++)
{
float num4 = (pixels[i].r + pixels[i].g + pixels[i].b) / 3f;
Color val4 = ((ConfigManager.SixPlus.value != ConfigManager.SixPlusOptions.Rainbow || num3 < 7) ? Color.Lerp(value3, value4, num4) : pixels2[i]);
Color val5 = ((ConfigManager.SixPlus.value != ConfigManager.SixPlusOptions.Rainbow || num3 < 6) ? Color.Lerp(value, value2, num4) : pixels2[i]);
pixels[i] = Color.Lerp(val4, val5, num2);
}
val3.SetPixels(0, 0, ((Texture)val3).width, ((Texture)val3).height, pixels, 0);
val3.Apply();
val.SetTexture("_BuffTex", (Texture)(object)val3);
}
}
__instance.radiantMat = val;
__instance.thisRend = ((Component)__instance).GetComponent<Renderer>();
___cb = new CommandBuffer
{
name = "BuffRender"
};
Mesh val6 = null;
if (__instance.thisRend is SkinnedMeshRenderer)
{
Renderer thisRend = __instance.thisRend;
val6 = ((SkinnedMeshRenderer)((thisRend is SkinnedMeshRenderer) ? thisRend : null)).sharedMesh;
}
else if (__instance.thisRend is MeshRenderer)
{
val6 = ((Component)__instance.thisRend).GetComponent<MeshFilter>().sharedMesh;
}
if ((Object)(object)val6 != (Object)null)
{
for (int j = 0; j < val6.subMeshCount; j++)
{
if (!__instance.subMeshesToIgnore.Contains(j))
{
___cb.DrawRenderer(__instance.thisRend, __instance.radiantMat, j);
}
}
}
return false;
}
}
[HarmonyPatch(typeof(EnemyIdentifier))]
[HarmonyPatch("UpdateModifiers")]
private class UpdateModifiers
{
private static bool Prefix(EnemyIdentifier __instance)
{
return false;
}
}
[HarmonyPatch(typeof(Deathcatcher))]
[HarmonyPatch("RespawnPuppets")]
private class RadiantRespawn
{
private static bool Prefix(Deathcatcher __instance, ref IEnumerator __result, ref List<CaughtEnemy> ___deadCaughtEnemies, ref EnemyIdentifier ___eid)
{
___eid.UpdateBuffs(false, true);
__result = RespawnPuppets(__instance, ___deadCaughtEnemies, ___eid);
return false;
}
private static IEnumerator RespawnPuppets(Deathcatcher __instance, List<CaughtEnemy> ___deadCaughtEnemies, EnemyIdentifier ___eid)
{
if (!__instance.active || ___deadCaughtEnemies == null || ___deadCaughtEnemies.Count == 0)
{
yield break;
}
for (int i = ___deadCaughtEnemies.Count - 1; i >= 0; i--)
{
if (___deadCaughtEnemies[i] == null)
{
___deadCaughtEnemies.RemoveAt(i);
}
else if ((Object)(object)___deadCaughtEnemies[i].puppet == (Object)null)
{
SavedEnemy savedEnemy = ___deadCaughtEnemies[i].savedEnemy;
SpawnableInstance spawnableInstance = SpawnableObjectExtensions.InstantiateSpawnable(((SavedGeneric)savedEnemy).Spawnable, (SavedGeneric)(object)savedEnemy, ((Component)__instance).transform.parent, true);
((Component)spawnableInstance).transform.position = ___deadCaughtEnemies[i].position;
((Component)spawnableInstance).transform.rotation = ___deadCaughtEnemies[i].rotation;
spawnableInstance.ApplyAlterOptions((IEnumerable<AlterOption>)(object)new AlterOption[1]
{
new AlterOption
{
targetKey = "puppeted",
useBool = true,
boolValue = true
}
});
if (extraRadiance[___eid].speed > 0f || extraRadiance[___eid].health > 0f || extraRadiance[___eid].damage > 0f)
{
EnemyIdentifier componentInChildren = ((Component)spawnableInstance).GetComponentInChildren<EnemyIdentifier>(true);
float speedRad = extraRadiance[___eid].speed;
float healthRad = extraRadiance[___eid].health;
float damageRad = extraRadiance[___eid].damage;
if (startingRadiance.ContainsKey(___eid))
{
speedRad = (ConfigManager.AdditiveRadiance.value ? (speedRad + startingRadiance[___eid].speed) : Mathf.Max(speedRad, startingRadiance[___eid].speed));
healthRad = (ConfigManager.AdditiveRadiance.value ? (healthRad + startingRadiance[___eid].health) : Mathf.Max(healthRad, startingRadiance[___eid].health));
damageRad = (ConfigManager.AdditiveRadiance.value ? (damageRad + startingRadiance[___eid].damage) : Mathf.Max(damageRad, startingRadiance[___eid].damage));
}
if (Object.op_Implicit((Object)(object)componentInChildren))
{
if (speedRad > 0f)
{
extraRadiance[componentInChildren].speed = speedRad;
}
if (healthRad > 0f)
{
extraRadiance[componentInChildren].health = healthRad;
}
if (extraRadiance[___eid].damage > 0f)
{
extraRadiance[componentInChildren].damage = damageRad;
}
ConfigManager.TierBehaviorOptions value = ConfigManager.TierBehavior.value;
if (1 == 0)
{
}
float num = value switch
{
ConfigManager.TierBehaviorOptions.Speed => speedRad,
ConfigManager.TierBehaviorOptions.Health => healthRad,
ConfigManager.TierBehaviorOptions.Damage => damageRad,
ConfigManager.TierBehaviorOptions.Highest => Mathf.Max(new float[3] { speedRad, healthRad, damageRad }),
ConfigManager.TierBehaviorOptions.Average => (speedRad + healthRad + damageRad) / 3f,
ConfigManager.TierBehaviorOptions.AverageTwo => (speedRad + healthRad + damageRad - Mathf.Min(new float[3] { speedRad, healthRad, damageRad })) / 2f,
_ => Mathf.Max(new float[3] { speedRad, healthRad, damageRad }),
};
if (1 == 0)
{
}
float totalRadiance = num;
newRadiance[componentInChildren] = totalRadiance;
}
}
___deadCaughtEnemies[i].UpdatePuppet(((Component)spawnableInstance).gameObject);
yield return (object)new WaitForSeconds(0.1f);
}
}
}
}
[HarmonyPatch(typeof(Idol))]
[HarmonyPatch("Death")]
private class IdolDeath
{
private static bool Prefix(Idol __instance, EnemyIdentifier ___eid, EnemyIdentifier ___target, LineRenderer ___beam, ref bool ___dead)
{
//IL_0547: Unknown result type (might be due to invalid IL or missing references)
if (((Object)((Component)__instance).gameObject).name.EndsWith("exclude"))
{
return true;
}
___eid.UpdateBuffs(false, true);
Console.WriteLine("idol buffs:");
Console.WriteLine($"tiers: S{extraRadiance[___eid].speed} H{extraRadiance[___eid].health} D{extraRadiance[___eid].damage}");
if (startingRadiance.ContainsKey(___eid))
{
Console.WriteLine($"starting: S{startingRadiance[___eid].speed} H{startingRadiance[___eid].health} D{startingRadiance[___eid].damage}");
}
float num = extraRadiance[___eid].speed;
float num2 = extraRadiance[___eid].health;
float num3 = extraRadiance[___eid].damage;
if (startingRadiance.ContainsKey(___eid))
{
num = (ConfigManager.AdditiveRadiance.value ? (num + startingRadiance[___eid].speed) : Mathf.Max(num, startingRadiance[___eid].speed));
num2 = (ConfigManager.AdditiveRadiance.value ? (num2 + startingRadiance[___eid].health) : Mathf.Max(num2, startingRadiance[___eid].health));
num3 = (ConfigManager.AdditiveRadiance.value ? (num3 + startingRadiance[___eid].damage) : Mathf.Max(num3, startingRadiance[___eid].damage));
}
___eid.radianceTier = -1f;
float health = ___eid.health;
if ((Object)(object)___target != (Object)null && !extraIdolRadiance.ContainsKey(___target))
{
Radiance value = new Radiance(0f, 0f, 0f);
extraIdolRadiance.Add(___target, value);
}
float num4 = ((___eid.health != 999f) ? (1000f * (num2 + 1f) / health) : (num2 + 1f));
if (!ConfigManager.AdditiveIdols.value && (Object)(object)___target != (Object)null && (num > 0f || num3 > 0f || num2 > 0f))
{
if (num > 0f)
{
startingRadiance[___target].speed = Mathf.Max(num, startingRadiance[___target].speed);
}
if (num2 > 0f)
{
startingRadiance[___target].health = Mathf.Max(num2, startingRadiance[___target].health);
}
if (num3 > 0f)
{
startingRadiance[___target].damage = Mathf.Max(num3, startingRadiance[___target].damage);
}
___target.UpdateBuffs(false, true);
}
if (ConfigManager.ExtraHits.value && num2 > 0f)
{
if (num > 0f && ConfigManager.AdditiveIdols.value)
{
float num5 = num / num4;
extraRadiance[___eid].speed -= num5;
if (extraRadiance[___eid].speed < 0f)
{
if (startingRadiance.ContainsKey(___eid))
{
startingRadiance[___eid].speed -= extraRadiance[___eid].speed;
}
extraRadiance[___eid].speed = 0f;
}
if ((Object)(object)___target != (Object)null)
{
extraIdolRadiance[___target].speed += num5;
}
}
if (num3 > 0f && ConfigManager.AdditiveIdols.value)
{
float num6 = num3 / num4;
extraRadiance[___eid].damage -= num6;
if (extraRadiance[___eid].damage < 0f)
{
if (startingRadiance.ContainsKey(___eid))
{
startingRadiance[___eid].damage -= extraRadiance[___eid].damage;
}
extraRadiance[___eid].damage = 0f;
}
if ((Object)(object)___target != (Object)null)
{
extraIdolRadiance[___target].damage += num6;
}
}
Bloodsplatter val2 = default(Bloodsplatter);
for (int i = 0; i < 3; i++)
{
GoreZone val = GoreZone.ResolveGoreZone(((Component)__instance).transform);
GameObject gore = MonoSingleton<BloodsplatterManager>.Instance.GetGore((GoreType)0, ___eid, false);
if (!Object.op_Implicit((Object)(object)gore))
{
break;
}
gore.transform.position = ((Component)___beam).transform.position;
gore.transform.SetParent(val.goreZone, true);
gore.SetActive(true);
if (gore.TryGetComponent<Bloodsplatter>(ref val2))
{
val2.GetReady();
}
}
___eid.health = 1000f * (num2 / num4);
float num7 = Mathf.Min(num2, 1f);
extraRadiance[___eid].health -= num7;
if (extraRadiance[___eid].health < 0f)
{
if (startingRadiance.ContainsKey(___eid))
{
startingRadiance[___eid].health -= extraRadiance[___eid].health;
}
extraRadiance[___eid].health = 0f;
}
if ((Object)(object)___target != (Object)null && ConfigManager.AdditiveIdols.value)
{
extraIdolRadiance[___target].health += num7;
___target.UpdateBuffs(false, true);
}
___eid.UpdateBuffs(false, true);
___dead = false;
return false;
}
if ((Object)(object)___target != (Object)null && ConfigManager.AdditiveIdols.value)
{
if (num > 0f)
{
extraIdolRadiance[___target].speed += num;
extraRadiance[___eid].speed = 0f;
if (startingRadiance.ContainsKey(___eid))
{
startingRadiance[___eid].speed = 0f;
}
}
if (num3 > 0f)
{
extraIdolRadiance[___target].damage += num3;
extraRadiance[___eid].damage = 0f;
if (startingRadiance.ContainsKey(___eid))
{
startingRadiance[___eid].damage = 0f;
}
}
if (num2 > 0f)
{
extraIdolRadiance[___target].health += num2;
extraRadiance[___eid].health = 0f;
if (startingRadiance.ContainsKey(___eid))
{
startingRadiance[___eid].health = 0f;
}
}
___target.UpdateBuffs(false, true);
}
___eid.speedBuff = false;
___eid.damageBuff = false;
___eid.healthBuff = false;
return true;
}
}
[HarmonyPatch(typeof(EnemyIdentifier))]
[HarmonyPatch("ProcessDeath")]
private class AnyDeath
{
private static void Postfix(EnemyIdentifier __instance)
{
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
Console.WriteLine($"{__instance.enemyType} died: S{__instance.totalSpeedModifier} H{__instance.totalHealthModifier} D{__instance.totalDamageModifier}");
if (extraRadiance.ContainsKey(__instance))
{
Console.WriteLine($"tiers: S{extraRadiance[__instance].speed} H{extraRadiance[__instance].health} D{extraRadiance[__instance].damage}");
}
if (extraRadiance.ContainsKey(__instance))
{
extraRadiance.Remove(__instance);
}
if (startingRadiance.ContainsKey(__instance))
{
Console.WriteLine($"starting: S{startingRadiance[__instance].speed} H{startingRadiance[__instance].health} D{startingRadiance[__instance].damage}");
}
if (startingRadiance.ContainsKey(__instance))
{
startingRadiance.Remove(__instance);
}
if (extraIdolRadiance.ContainsKey(__instance))
{
Console.WriteLine($"idols: S{extraIdolRadiance[__instance].speed} H{extraIdolRadiance[__instance].health} D{extraIdolRadiance[__instance].damage}");
}
if (extraIdolRadiance.ContainsKey(__instance))
{
extraIdolRadiance.Remove(__instance);
}
if (newRadiance.ContainsKey(__instance))
{
newRadiance.Remove(__instance);
}
if (currentRadiance.ContainsKey(__instance))
{
currentRadiance.Remove(__instance);
}
}
}
public static Dictionary<EnemyIdentifier, Radiance> extraRadiance = new Dictionary<EnemyIdentifier, Radiance>();
public static Dictionary<EnemyIdentifier, Radiance> extraIdolRadiance = new Dictionary<EnemyIdentifier, Radiance>();
public static Dictionary<EnemyIdentifier, Radiance> startingRadiance = new Dictionary<EnemyIdentifier, Radiance>();
public static Dictionary<EnemyIdentifier, float> currentRadiance = new Dictionary<EnemyIdentifier, float>();
public static Dictionary<EnemyIdentifier, float> newRadiance = new Dictionary<EnemyIdentifier, float>();
}
namespace forceradplus
{
[BepInPlugin("cali.forceradplus", "Additive Forcerad", "1.0.0")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
public class ForceradPlugin : BaseUnityPlugin
{
public const string PLUGIN_GUID = "cali.forceradplus";
public const string PLUGIN_NAME = "Additive Forcerad";
public const string PLUGIN_VERSION = "1.0.0";
private readonly Harmony harmony = new Harmony("cali.forceradplus");
internal static ManualLogSource Log;
private void Awake()
{
ConfigManager.Initialize();
harmony.PatchAll();
((BaseUnityPlugin)this).Logger.LogInfo((object)"The mod is in fact loaded");
}
}
}
namespace forcerad
{
internal class ConfigManager
{
public enum TierBehaviorOptions
{
Speed,
Health,
Damage,
Highest,
Average,
AverageTwo
}
public enum SixPlusOptions
{
Rainbow,
Loop,
FivePlus
}
private static PluginConfigurator config;
public static FloatField ExtraRadiance;
public static FloatField ExtraSpeed;
public static FloatField ExtraHealth;
public static FloatField ExtraDamage;
public static BoolField AdditiveRadiance;
public static BoolField ExtraHits;
public static BoolField AdditiveIdols;
public static BoolField CapBonuses;
public static FloatField MaxSpeedBonus;
public static FloatField MaxHealthBonus;
public static FloatField MaxDamageBonus;
public static ConfigHeader CapBonusesDesc;
public static BoolField ScalingDamage;
public static FloatField MaxDamageTier;
public static FloatField MaxDamageMultiplier;
public static BoolField NerfProvs;
public static FloatField ProvSpeed;
public static FloatField ProvHealth;
public static ConfigPanel colorsPanel;
public static BoolField CustomColors;
public static EnumField<TierBehaviorOptions> TierBehavior;
public static FloatField Baseline;
public static List<ColorField> Color1;
public static List<ColorField> Color2;
public static EnumField<SixPlusOptions> SixPlus;
public static void Initialize()
{
}
static ConfigManager()
{
//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
//IL_010d: 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_0122: Expected O, but got Unknown
//IL_013b: Unknown result type (might be due to invalid IL or missing references)
//IL_0140: Unknown result type (might be due to invalid IL or missing references)
//IL_0150: Expected O, but got Unknown
//IL_0169: 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_017e: Expected O, but got Unknown
//IL_0197: Unknown result type (might be due to invalid IL or missing references)
//IL_019c: Unknown result type (might be due to invalid IL or missing references)
//IL_01ac: Expected O, but got Unknown
//IL_01c1: Unknown result type (might be due to invalid IL or missing references)
//IL_01cb: Expected O, but got Unknown
//IL_01e1: Unknown result type (might be due to invalid IL or missing references)
//IL_01fd: Unknown result type (might be due to invalid IL or missing references)
//IL_021a: Unknown result type (might be due to invalid IL or missing references)
//IL_0235: Unknown result type (might be due to invalid IL or missing references)
//IL_023f: Expected O, but got Unknown
//IL_0255: Unknown result type (might be due to invalid IL or missing references)
//IL_0271: Unknown result type (might be due to invalid IL or missing references)
//IL_0292: Unknown result type (might be due to invalid IL or missing references)
//IL_029c: Expected O, but got Unknown
//IL_02b1: Unknown result type (might be due to invalid IL or missing references)
//IL_02b6: Unknown result type (might be due to invalid IL or missing references)
//IL_02cc: Expected O, but got Unknown
//IL_02e5: Unknown result type (might be due to invalid IL or missing references)
//IL_02ea: Unknown result type (might be due to invalid IL or missing references)
//IL_006b: Unknown result type (might be due to invalid IL or missing references)
//IL_0072: Expected O, but got Unknown
//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
//IL_030d: Unknown result type (might be due to invalid IL or missing references)
//IL_031d: Expected O, but got Unknown
//IL_0336: Unknown result type (might be due to invalid IL or missing references)
//IL_033b: Unknown result type (might be due to invalid IL or missing references)
//IL_035e: Unknown result type (might be due to invalid IL or missing references)
//IL_036e: Expected O, but got Unknown
//IL_0387: Unknown result type (might be due to invalid IL or missing references)
//IL_038c: Unknown result type (might be due to invalid IL or missing references)
//IL_03af: Unknown result type (might be due to invalid IL or missing references)
//IL_03bf: Expected O, but got Unknown
//IL_03d5: Unknown result type (might be due to invalid IL or missing references)
//IL_03da: Unknown result type (might be due to invalid IL or missing references)
//IL_03f0: Expected O, but got Unknown
//IL_0406: Unknown result type (might be due to invalid IL or missing references)
//IL_0422: Unknown result type (might be due to invalid IL or missing references)
//IL_042c: Expected O, but got Unknown
//IL_043d: Unknown result type (might be due to invalid IL or missing references)
//IL_0447: Expected O, but got Unknown
//IL_0459: Unknown result type (might be due to invalid IL or missing references)
//IL_0474: Unknown result type (might be due to invalid IL or missing references)
//IL_047e: Expected O, but got Unknown
//IL_0497: Unknown result type (might be due to invalid IL or missing references)
//IL_049c: Unknown result type (might be due to invalid IL or missing references)
//IL_04b0: Unknown result type (might be due to invalid IL or missing references)
//IL_04c0: Expected O, but got Unknown
//IL_04d9: Unknown result type (might be due to invalid IL or missing references)
//IL_04de: Unknown result type (might be due to invalid IL or missing references)
//IL_04f2: Unknown result type (might be due to invalid IL or missing references)
//IL_0502: Expected O, but got Unknown
//IL_0518: Unknown result type (might be due to invalid IL or missing references)
//IL_0534: Unknown result type (might be due to invalid IL or missing references)
//IL_0550: Unknown result type (might be due to invalid IL or missing references)
//IL_055a: Expected O, but got Unknown
//IL_0570: Unknown result type (might be due to invalid IL or missing references)
//IL_057a: Expected O, but got Unknown
//IL_0593: Unknown result type (might be due to invalid IL or missing references)
//IL_0598: Unknown result type (might be due to invalid IL or missing references)
//IL_05ac: Unknown result type (might be due to invalid IL or missing references)
//IL_05bc: Expected O, but got Unknown
//IL_05d5: Unknown result type (might be due to invalid IL or missing references)
//IL_05da: Unknown result type (might be due to invalid IL or missing references)
//IL_05ee: Unknown result type (might be due to invalid IL or missing references)
//IL_05fe: Expected O, but got Unknown
//IL_0614: Unknown result type (might be due to invalid IL or missing references)
//IL_0630: Unknown result type (might be due to invalid IL or missing references)
//IL_064c: Unknown result type (might be due to invalid IL or missing references)
//IL_0656: Expected O, but got Unknown
//IL_0668: Unknown result type (might be due to invalid IL or missing references)
//IL_0683: Unknown result type (might be due to invalid IL or missing references)
//IL_068d: Expected O, but got Unknown
//IL_073c: Unknown result type (might be due to invalid IL or missing references)
//IL_0741: Unknown result type (might be due to invalid IL or missing references)
//IL_0752: Unknown result type (might be due to invalid IL or missing references)
//IL_0762: Expected O, but got Unknown
//IL_0778: Unknown result type (might be due to invalid IL or missing references)
//IL_0794: Unknown result type (might be due to invalid IL or missing references)
//IL_07b4: Unknown result type (might be due to invalid IL or missing references)
//IL_07b9: Unknown result type (might be due to invalid IL or missing references)
//IL_07cf: Expected O, but got Unknown
//IL_07df: Unknown result type (might be due to invalid IL or missing references)
//IL_07e9: Expected O, but got Unknown
//IL_07f6: Unknown result type (might be due to invalid IL or missing references)
//IL_0808: Unknown result type (might be due to invalid IL or missing references)
//IL_0837: Unknown result type (might be due to invalid IL or missing references)
//IL_083c: Unknown result type (might be due to invalid IL or missing references)
//IL_0846: Expected O, but got Unknown
//IL_0870: Unknown result type (might be due to invalid IL or missing references)
//IL_0875: Unknown result type (might be due to invalid IL or missing references)
//IL_087f: Expected O, but got Unknown
//IL_08a9: Unknown result type (might be due to invalid IL or missing references)
//IL_08ae: Unknown result type (might be due to invalid IL or missing references)
//IL_08b8: Expected O, but got Unknown
//IL_08e2: Unknown result type (might be due to invalid IL or missing references)
//IL_08e7: Unknown result type (might be due to invalid IL or missing references)
//IL_08f1: Expected O, but got Unknown
//IL_091b: Unknown result type (might be due to invalid IL or missing references)
//IL_0920: Unknown result type (might be due to invalid IL or missing references)
//IL_092a: Expected O, but got Unknown
//IL_0954: Unknown result type (might be due to invalid IL or missing references)
//IL_0959: Unknown result type (might be due to invalid IL or missing references)
//IL_0963: Expected O, but got Unknown
//IL_098d: Unknown result type (might be due to invalid IL or missing references)
//IL_0992: Unknown result type (might be due to invalid IL or missing references)
//IL_099c: Expected O, but got Unknown
//IL_09c6: Unknown result type (might be due to invalid IL or missing references)
//IL_09cb: Unknown result type (might be due to invalid IL or missing references)
//IL_09d5: Expected O, but got Unknown
//IL_09ff: Unknown result type (might be due to invalid IL or missing references)
//IL_0a04: Unknown result type (might be due to invalid IL or missing references)
//IL_0a0e: Expected O, but got Unknown
//IL_0a38: Unknown result type (might be due to invalid IL or missing references)
//IL_0a3d: Unknown result type (might be due to invalid IL or missing references)
//IL_0a47: Expected O, but got Unknown
//IL_0a71: Unknown result type (might be due to invalid IL or missing references)
//IL_0a76: Unknown result type (might be due to invalid IL or missing references)
//IL_0a80: Expected O, but got Unknown
//IL_0aaa: Unknown result type (might be due to invalid IL or missing references)
//IL_0aaf: Unknown result type (might be due to invalid IL or missing references)
//IL_0ab9: Expected O, but got Unknown
Color1 = ((IEnumerable<ColorField>)(object)new ColorField[6]).ToList();
Color2 = ((IEnumerable<ColorField>)(object)new ColorField[6]).ToList();
config = PluginConfigurator.Create("Forcerad Plus", "cali.forceradplus");
Assembly executingAssembly = Assembly.GetExecutingAssembly();
using Stream stream = executingAssembly.GetManifestResourceStream("forcerad.icon.png");
if (stream != null)
{
byte[] array = new byte[stream.Length];
stream.Read(array, 0, array.Length);
Texture2D val = new Texture2D(2, 2);
if (ImageConversion.LoadImage(val, array))
{
config.icon = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f), 100f);
}
}
new ConfigHeader(config.rootPanel, "", 24);
new ConfigHeader(config.rootPanel, "FORCERAD", 24);
ExtraRadiance = new FloatField(config.rootPanel, "Extra Radiance Tiers", "extraRadiance", 1f)
{
minimumValue = 0f
};
ExtraSpeed = new FloatField(config.rootPanel, "Extra Speed Tiers", "extraSpeed", 0f)
{
minimumValue = 0f
};
ExtraHealth = new FloatField(config.rootPanel, "Extra Health Tiers", "extraHealth", 0f)
{
minimumValue = 0f
};
ExtraDamage = new FloatField(config.rootPanel, "Extra Damage Tiers", "extraDamage", 0f)
{
minimumValue = 0f
};
AdditiveRadiance = new BoolField(config.rootPanel, "Additive radiance?", "additiveRadiance", true);
new ConfigHeader(config.rootPanel, "If enabled, radiance given by this mod will be added to any radiance an enemy already has.", 12, (TextAlignmentOptions)4097);
((ConfigField)new ConfigHeader(config.rootPanel, "-------------------------------------------------------------------------", 14, (TextAlignmentOptions)514)).interactable = false;
new ConfigHeader(config.rootPanel, "IDOLS", 24);
ExtraHits = new BoolField(config.rootPanel, "Idols take extra hits?", "extraHits", false);
new ConfigHeader(config.rootPanel, "Idols will take an extra hit to break for each tier of health radiance they have if this option is enabled.", 12, (TextAlignmentOptions)4097);
((ConfigField)new ConfigHeader(config.rootPanel, "-------------------------------------------------------------------------", 14, (TextAlignmentOptions)514)).interactable = false;
AdditiveIdols = new BoolField(config.rootPanel, "Additive idol radiance?", "additiveIdols", false);
CapBonuses = new BoolField(config.rootPanel, "Cap bonus radiance?", "capBonuses", true)
{
interactable = AdditiveIdols.value
};
MaxSpeedBonus = new FloatField(config.rootPanel, "Maximum bonus speed radiance", "maxSpeedBonus", 1f)
{
hidden = (!CapBonuses.value || !AdditiveIdols.value),
minimumValue = 0f
};
MaxHealthBonus = new FloatField(config.rootPanel, "Maximum bonus health radiance", "maxHealthBonus", 1f)
{
hidden = (!CapBonuses.value || !AdditiveIdols.value),
minimumValue = 0f
};
MaxDamageBonus = new FloatField(config.rootPanel, "Maximum bonus damage radiance", "maxDamageBonus", 1f)
{
hidden = (!CapBonuses.value || !AdditiveIdols.value),
minimumValue = 0f
};
CapBonusesDesc = new ConfigHeader(config.rootPanel, "Idols will add extra radiance to their targets up to the radiance tier of the idol when they are broken. If this option is enabled, radiance added by idols will not go above the set limits.", 12, (TextAlignmentOptions)4097)
{
interactable = AdditiveIdols.value
};
((ConfigField)new ConfigHeader(config.rootPanel, "-------------------------------------------------------------------------", 14, (TextAlignmentOptions)514)).interactable = false;
AdditiveIdols.onValueChange += (BoolValueChangeEventDelegate)delegate(BoolValueChangeEvent unhide)
{
((ConfigField)CapBonuses).interactable = unhide.value;
((ConfigField)CapBonusesDesc).interactable = unhide.value;
((ConfigField)MaxSpeedBonus).hidden = !unhide.value || !CapBonuses.value;
((ConfigField)MaxHealthBonus).hidden = !unhide.value || !CapBonuses.value;
((ConfigField)MaxDamageBonus).hidden = !unhide.value || !CapBonuses.value;
};
CapBonuses.onValueChange += (BoolValueChangeEventDelegate)delegate(BoolValueChangeEvent unhide)
{
((ConfigField)MaxSpeedBonus).hidden = !unhide.value || !AdditiveIdols.value;
((ConfigField)MaxHealthBonus).hidden = !unhide.value || !AdditiveIdols.value;
((ConfigField)MaxDamageBonus).hidden = !unhide.value || !AdditiveIdols.value;
};
new ConfigHeader(config.rootPanel, "BALANCE TWEAKS", 24);
ScalingDamage = new BoolField(config.rootPanel, "Scaling Damage Radiance?", "scalingDamage", true);
MaxDamageTier = new FloatField(config.rootPanel, "Scales to tier", "maxDamageTier", 2f)
{
hidden = !ScalingDamage.value,
minimumValue = 0f
};
MaxDamageMultiplier = new FloatField(config.rootPanel, "Multiplier at highest tier", "maxDamageMultiplier", 1.5f)
{
hidden = !ScalingDamage.value,
minimumValue = 1f
};
new ConfigHeader(config.rootPanel, "If enabled, the extra damage multiplier given to enemies will scale linearly per tier of damage radiance.", 12, (TextAlignmentOptions)4097);
((ConfigField)new ConfigHeader(config.rootPanel, "-------------------------------------------------------------------------", 14, (TextAlignmentOptions)514)).interactable = false;
ScalingDamage.onValueChange += (BoolValueChangeEventDelegate)delegate(BoolValueChangeEvent unhide)
{
((ConfigField)MaxDamageTier).hidden = !unhide.value;
((ConfigField)MaxDamageMultiplier).hidden = !unhide.value;
};
NerfProvs = new BoolField(config.rootPanel, "Nerf Providences?", "nerfProvs", true);
ProvHealth = new FloatField(config.rootPanel, "Providence Health Multiplier", "provHealth", 1.5f)
{
hidden = !NerfProvs.value,
minimumValue = 1f
};
ProvSpeed = new FloatField(config.rootPanel, "Providence Speed Multiplier", "provSpeed", 1.25f)
{
hidden = !NerfProvs.value,
minimumValue = 1f
};
new ConfigHeader(config.rootPanel, "Providences in vanilla get a 2x health multiplier and a 1.5x speed multiplier when radiant. This is TOO MUCH, HAKITA", 12, (TextAlignmentOptions)4097);
((ConfigField)new ConfigHeader(config.rootPanel, "-------------------------------------------------------------------------", 14, (TextAlignmentOptions)514)).interactable = false;
NerfProvs.onValueChange += (BoolValueChangeEventDelegate)delegate(BoolValueChangeEvent unhide)
{
((ConfigField)ProvSpeed).hidden = !unhide.value;
((ConfigField)ProvHealth).hidden = !unhide.value;
};
new ConfigHeader(config.rootPanel, "COLORS", 24);
CustomColors = new BoolField(config.rootPanel, "Tier dependant radiance colors?", "customColors", true);
EnumField<TierBehaviorOptions> obj = new EnumField<TierBehaviorOptions>(config.rootPanel, "Color is determined by:", "tierBehavior", TierBehaviorOptions.Highest);
((ConfigField)obj).interactable = CustomColors.value;
TierBehavior = obj;
TierBehavior.SetEnumDisplayName(TierBehaviorOptions.Speed, "Speed radiance tier");
TierBehavior.SetEnumDisplayName(TierBehaviorOptions.Health, "Health radiance tier");
TierBehavior.SetEnumDisplayName(TierBehaviorOptions.Damage, "Damage radiance tier");
TierBehavior.SetEnumDisplayName(TierBehaviorOptions.Highest, "Highest of all 3");
TierBehavior.SetEnumDisplayName(TierBehaviorOptions.Average, "Average of all 3");
TierBehavior.SetEnumDisplayName(TierBehaviorOptions.AverageTwo, "Average of two highest");
Baseline = new FloatField(config.rootPanel, "Baseline Tier", "baseline", 0f)
{
interactable = CustomColors.value,
minimumValue = 0f
};
new ConfigHeader(config.rootPanel, "The baseline tier is subtracted from the actual radiance tier when determining outline colors. If the baseline is set to 1, tier 1 enemies will appear non radiant, and tier 2 enemies will use tier 1 colors, and so on.", 12, (TextAlignmentOptions)4097);
((ConfigField)new ConfigHeader(config.rootPanel, "-------------------------------------------------------------------------", 14, (TextAlignmentOptions)514)).interactable = false;
colorsPanel = new ConfigPanel(config.rootPanel, "Color Settings", "colorsPanel")
{
interactable = CustomColors.value
};
CustomColors.onValueChange += (BoolValueChangeEventDelegate)delegate(BoolValueChangeEvent unhide)
{
((ConfigField)TierBehavior).interactable = unhide.value;
((ConfigField)colorsPanel).interactable = unhide.value;
((ConfigField)Baseline).interactable = unhide.value;
};
new ConfigHeader(colorsPanel, "", 24);
new ConfigHeader(colorsPanel, "COLORS", 24);
Color1[0] = new ColorField(colorsPanel, "Tier 0.5 Outline Color 1", "tier0Color1", new Color(0.5f, 1f, 0.25f, 1f));
Color2[0] = new ColorField(colorsPanel, "Tier 0.5 Outline Color 2", "tier0Color2", new Color(0f, 0.5f, 0f, 1f));
Color1[1] = new ColorField(colorsPanel, "Tier 1 Outline Color 1", "tier1Color1", new Color(0.5f, 1f, 1f, 1f));
Color2[1] = new ColorField(colorsPanel, "Tier 1 Outline Color 2", "tier1Color2", new Color(0f, 0f, 1f, 1f));
Color1[2] = new ColorField(colorsPanel, "Tier 2 Outline Color 1", "tier2Color1", new Color(1f, 0.5f, 1f, 1f));
Color2[2] = new ColorField(colorsPanel, "Tier 2 Outline Color 2", "tier2Color2", new Color(0.25f, 0f, 0.5f, 1f));
Color1[3] = new ColorField(colorsPanel, "Tier 3 Outline Color 1", "tier3Color1", new Color(1f, 0f, 0f, 1f));
Color2[3] = new ColorField(colorsPanel, "Tier 3 Outline Color 2", "tier3Color2", new Color(0.125f, 0f, 0f, 1f));
Color1[4] = new ColorField(colorsPanel, "Tier 4 Outline Color 1", "tier4Color1", new Color(1f, 0.75f, 0.25f, 1f));
Color2[4] = new ColorField(colorsPanel, "Tier 4 Outline Color 2", "tier4Color2", new Color(0.75f, 0.25f, 0f, 1f));
Color1[5] = new ColorField(colorsPanel, "Tier 5 Outline Color 1", "tier5Color1", new Color(1f, 1f, 1f, 1f));
Color2[5] = new ColorField(colorsPanel, "Tier 5 Outline Color 2", "tier5Color2", new Color(0.25f, 0.25f, 0.25f, 1f));
SixPlus = new EnumField<SixPlusOptions>(colorsPanel, "Tier 6+ Outline Color", "sixPlus", SixPlusOptions.Rainbow);
SixPlus.SetEnumDisplayName(SixPlusOptions.Rainbow, "Rainbow");
SixPlus.SetEnumDisplayName(SixPlusOptions.Loop, "Loop");
SixPlus.SetEnumDisplayName(SixPlusOptions.FivePlus, "Copy Tier 5");
}
}
}